Skip to content

Commit

Permalink
format codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
aronwk-aaron committed Jul 28, 2022
1 parent 4f7aa11 commit 19e77a3
Show file tree
Hide file tree
Showing 881 changed files with 36,517 additions and 40,506 deletions.
16 changes: 7 additions & 9 deletions dAuthServer/AuthServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ int main(int argc, char** argv) {
std::string mysql_username = config.GetValue("mysql_username");
std::string mysql_password = config.GetValue("mysql_password");

try {
Database::Connect(mysql_host, mysql_database, mysql_username, mysql_password);
} catch (sql::SQLException& ex) {
try {
Database::Connect(mysql_host, mysql_database, mysql_username, mysql_password);
} catch (sql::SQLException& ex) {
Game::logger->Log("AuthServer", "Got an error while connecting to the database: %s", ex.what());
Database::Destroy("AuthServer");
delete Game::server;
delete Game::logger;
return 0;
}
}

//Find out the master's IP:
std::string masterIP;
Expand Down Expand Up @@ -98,8 +98,7 @@ int main(int argc, char** argv) {

if (framesSinceMasterDisconnect >= 30)
break; //Exit our loop, shut down.
}
else framesSinceMasterDisconnect = 0;
} else framesSinceMasterDisconnect = 0;

//In world we'd update our other systems here.

Expand Down Expand Up @@ -134,8 +133,7 @@ int main(int argc, char** argv) {
delete stmt;

framesSinceLastSQLPing = 0;
}
else framesSinceLastSQLPing++;
} else framesSinceLastSQLPing++;

//Sleep our thread since auth can afford to.
t += std::chrono::milliseconds(mediumFramerate); //Auth can run at a lower "fps"
Expand All @@ -151,7 +149,7 @@ int main(int argc, char** argv) {
return EXIT_SUCCESS;
}

dLogger * SetupLogger() {
dLogger* SetupLogger() {
std::string logPath = "./logs/AuthServer_" + std::to_string(time(nullptr)) + ".log";
bool logToConsole = false;
bool logDebugStatements = false;
Expand Down
8 changes: 3 additions & 5 deletions dChatFilter/dChatFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ dChatFilter::dChatFilter(const std::string& filepath, bool dontGenerateDCF) {
if (!BinaryIO::DoesFileExist(filepath + ".dcf") || m_DontGenerateDCF) {
ReadWordlistPlaintext(filepath + ".txt", true);
if (!m_DontGenerateDCF) ExportWordlistToDCF(filepath + ".dcf", true);
}
else if (!ReadWordlistDCF(filepath + ".dcf", true)) {
} else if (!ReadWordlistDCF(filepath + ".dcf", true)) {
ReadWordlistPlaintext(filepath + ".txt", true);
ExportWordlistToDCF(filepath + ".dcf", true);
}
Expand Down Expand Up @@ -85,8 +84,7 @@ bool dChatFilter::ReadWordlistDCF(const std::string& filepath, bool whiteList) {
}

return true;
}
else {
} else {
file.close();
return false;
}
Expand Down Expand Up @@ -139,7 +137,7 @@ std::vector<std::pair<uint8_t, uint8_t>> dChatFilter::IsSentenceOkay(const std::
m_UserUnapprovedWordCache.push_back(hash);
listOfBadSegments.emplace_back(position, originalSegment.length());
}

if (std::find(m_DeniedWords.begin(), m_DeniedWords.end(), hash) != m_DeniedWords.end() && !whiteList) {
m_UserUnapprovedWordCache.push_back(hash);
listOfBadSegments.emplace_back(position, originalSegment.length());
Expand Down
Loading

0 comments on commit 19e77a3

Please sign in to comment.