mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-05-17 12:01:22 +00:00
Add try catch around packet handling for sql error
This commit is contained in:
parent
a580e3a2f5
commit
05c67fd712
@ -17,7 +17,7 @@ __dynamic=1
|
|||||||
# Set __compile_backtrace__ to 1 to compile the backtrace library instead of using system libraries.
|
# Set __compile_backtrace__ to 1 to compile the backtrace library instead of using system libraries.
|
||||||
# __compile_backtrace__=1
|
# __compile_backtrace__=1
|
||||||
# Set to the number of jobs (make -j equivalent) to compile the mariadbconn files with.
|
# 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.
|
# When set to 1 and uncommented, compiling and linking testing folders and libraries will be done.
|
||||||
__enable_testing__=1
|
__enable_testing__=1
|
||||||
# The path to OpenSSL. Change this if your OpenSSL install path is different than the default.
|
# The path to OpenSSL. Change this if your OpenSSL install path is different than the default.
|
||||||
|
2
build.sh
2
build.sh
@ -9,5 +9,5 @@ cd build
|
|||||||
cmake ..
|
cmake ..
|
||||||
|
|
||||||
# To build utilizing multiple cores, append `-j` and the amount of cores to utilize, for example `cmake --build . --config Release -j8'
|
# 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
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ void GameMessageHandler::HandleMessage(RakNet::BitStream* inStream, const System
|
|||||||
Entity* entity = EntityManager::Instance()->GetEntity(objectID);
|
Entity* entity = EntityManager::Instance()->GetEntity(objectID);
|
||||||
|
|
||||||
User* usr = UserManager::Instance()->GetUser(sysAddr);
|
User* usr = UserManager::Instance()->GetUser(sysAddr);
|
||||||
|
Game::logger->Log("GameMessageHandler", "handling message %i", messageID);
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
Game::logger->Log("GameMessageHandler", "Failed to find associated entity (%llu), aborting GM (%X)!", objectID, messageID);
|
Game::logger->Log("GameMessageHandler", "Failed to find associated entity (%llu), aborting GM (%X)!", objectID, messageID);
|
||||||
|
|
||||||
|
@ -413,6 +413,7 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
UserManager::Instance()->DeletePendingRemovals();
|
UserManager::Instance()->DeletePendingRemovals();
|
||||||
|
|
||||||
|
try {
|
||||||
auto t1 = std::chrono::high_resolution_clock::now();
|
auto t1 = std::chrono::high_resolution_clock::now();
|
||||||
for (uint32_t curPacket = 0; curPacket < maxPacketsToProcess && timeSpent < maxPacketProcessingTime; curPacket++) {
|
for (uint32_t curPacket = 0; curPacket < maxPacketsToProcess && timeSpent < maxPacketProcessingTime; curPacket++) {
|
||||||
packet = Game::server->Receive();
|
packet = Game::server->Receive();
|
||||||
@ -428,6 +429,11 @@ int main(int argc, char** argv) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (sql::SQLException& e) {
|
||||||
|
Game::logger->Log("WorldServer", "Caught an error (%s)", e.what());
|
||||||
|
std::raise(SIGTERM);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Metrics::EndMeasurement(MetricVariable::PacketHandling);
|
Metrics::EndMeasurement(MetricVariable::PacketHandling);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user