diff --git a/CMakeVariables.txt b/CMakeVariables.txt index d3c8b36f..647f43c6 100644 --- a/CMakeVariables.txt +++ b/CMakeVariables.txt @@ -17,7 +17,7 @@ __dynamic=1 # Set __compile_backtrace__ to 1 to compile the backtrace library instead of using system libraries. # __compile_backtrace__=1 # Set to the number of jobs (make -j equivalent) to compile the mariadbconn files with. -__maria_db_connector_compile_jobs__=1 +__maria_db_connector_compile_jobs__= # When set to 1 and uncommented, compiling and linking testing folders and libraries will be done. __enable_testing__=1 # The path to OpenSSL. Change this if your OpenSSL install path is different than the default. diff --git a/build.sh b/build.sh index a736a4ee..a173cc68 100755 --- a/build.sh +++ b/build.sh @@ -9,5 +9,5 @@ cd build cmake .. # To build utilizing multiple cores, append `-j` and the amount of cores to utilize, for example `cmake --build . --config Release -j8' -cmake --build . --config Release +cmake --build . --config Release -j diff --git a/dGame/dGameMessages/GameMessageHandler.cpp b/dGame/dGameMessages/GameMessageHandler.cpp index a91a1e2a..d5c44b2a 100644 --- a/dGame/dGameMessages/GameMessageHandler.cpp +++ b/dGame/dGameMessages/GameMessageHandler.cpp @@ -42,7 +42,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System Entity* entity = EntityManager::Instance()->GetEntity(objectID); User* usr = UserManager::Instance()->GetUser(sysAddr); - + Game::logger->Log("GameMessageHandler", "handling message %i", messageID); if (!entity) { Game::logger->Log("GameMessageHandler", "Failed to find associated entity (%llu), aborting GM (%X)!", objectID, messageID); diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index b655bef3..d3706ab9 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -413,21 +413,27 @@ int main(int argc, char** argv) { UserManager::Instance()->DeletePendingRemovals(); - auto t1 = std::chrono::high_resolution_clock::now(); - for (uint32_t curPacket = 0; curPacket < maxPacketsToProcess && timeSpent < maxPacketProcessingTime; curPacket++) { - packet = Game::server->Receive(); - if (packet) { - auto t1 = std::chrono::high_resolution_clock::now(); - HandlePacket(packet); - auto t2 = std::chrono::high_resolution_clock::now(); + try { + auto t1 = std::chrono::high_resolution_clock::now(); + for (uint32_t curPacket = 0; curPacket < maxPacketsToProcess && timeSpent < maxPacketProcessingTime; curPacket++) { + packet = Game::server->Receive(); + if (packet) { + auto t1 = std::chrono::high_resolution_clock::now(); + HandlePacket(packet); + auto t2 = std::chrono::high_resolution_clock::now(); - timeSpent += std::chrono::duration_cast>(t2 - t1).count(); - Game::server->DeallocatePacket(packet); - packet = nullptr; - } else { - break; + timeSpent += std::chrono::duration_cast>(t2 - t1).count(); + Game::server->DeallocatePacket(packet); + packet = nullptr; + } else { + break; + } } + } catch (sql::SQLException& e) { + Game::logger->Log("WorldServer", "Caught an error (%s)", e.what()); + std::raise(SIGTERM); } + Metrics::EndMeasurement(MetricVariable::PacketHandling);