Added extra log information and replaced incorrect print statements

- Added extra Zone and Instance information to ambiguous log calls during loading. chat connection, chat connection loss, and shutdown
- Fixed correct class names in some log lines
- Replaced printf during world shutdown with correct log call with instance and zone info
This commit is contained in:
cooltrain7 2021-12-13 01:37:09 +00:00
parent ed151e6d45
commit 9b1fbe6c2c

View File

@ -416,7 +416,7 @@ int main(int argc, char** argv) {
if (framesSinceMasterStatus >= 200) if (framesSinceMasterStatus >= 200)
{ {
Game::logger->Log("WorldServer", "Finished loading world, ready up!\n"); Game::logger->Log("WorldServer", "Finished loading world with zone (%i), ready up!\n", Game::server->GetZoneID());
MasterPackets::SendWorldReady(Game::server, Game::server->GetZoneID(), Game::server->GetInstanceID()); MasterPackets::SendWorldReady(Game::server, Game::server->GetZoneID(), Game::server->GetInstanceID());
@ -487,7 +487,7 @@ int main(int argc, char** argv) {
if (Game::physicsWorld) Game::physicsWorld = nullptr; if (Game::physicsWorld) Game::physicsWorld = nullptr;
if (Game::zoneManager) delete Game::zoneManager; if (Game::zoneManager) delete Game::zoneManager;
Game::logger->Log("Test", "Quitting\n"); Game::logger->Log("WorldServer", "Shutdown complete, zone (%i), instance (%i)\n", Game::server->GetZoneID(), instanceID);
Metrics::Clear(); Metrics::Clear();
Database::Destroy(); Database::Destroy();
@ -512,11 +512,11 @@ dLogger * SetupLogger(int zoneID, int instanceID) {
void HandlePacketChat(Packet* packet) { void HandlePacketChat(Packet* packet) {
if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) { if (packet->data[0] == ID_DISCONNECTION_NOTIFICATION || packet->data[0] == ID_CONNECTION_LOST) {
Game::logger->Log("WorldServer", "Lost our connection to chat.\n"); Game::logger->Log("WorldServer", "Lost our connection to chat, zone(%i), instance(%i)\n", Game::server->GetZoneID(), Game::server->GetInstanceID());
} }
if (packet->data[0] == ID_CONNECTION_REQUEST_ACCEPTED) { if (packet->data[0] == ID_CONNECTION_REQUEST_ACCEPTED) {
Game::logger->Log("WorldServer", "Established connection to chat\n"); Game::logger->Log("WorldServer", "Established connection to chat, zone(%i), instance (%i)\n",Game::server -> GetZoneID(), Game::server -> GetInstanceID());
Game::chatSysAddr = packet->systemAddress; Game::chatSysAddr = packet->systemAddress;
} }
@ -798,7 +798,7 @@ void HandlePacket(Packet* packet) {
case MSG_MASTER_SHUTDOWN: { case MSG_MASTER_SHUTDOWN: {
worldShutdownSequenceStarted = true; worldShutdownSequenceStarted = true;
Game::logger->Log("WorldServer", "Got shutdown request\n"); Game::logger->Log("WorldServer", "Got shutdown request from master, zone (%i), instance (%i)\n", Game::server->GetZoneID(), Game::server->GetInstanceID());
break; break;
} }
@ -1095,11 +1095,11 @@ void HandlePacket(Packet* packet) {
} }
} }
else { else {
Game::logger->Log("WorldMain", "Couldn't find character to log in with for user %s (%i)!\n", user->GetUsername().c_str(), user->GetAccountID()); Game::logger->Log("WorldServer", "Couldn't find character to log in with for user %s (%i)!\n", user->GetUsername().c_str(), user->GetAccountID());
Game::server->Disconnect(packet->systemAddress, SERVER_DISCON_CHARACTER_NOT_FOUND); Game::server->Disconnect(packet->systemAddress, SERVER_DISCON_CHARACTER_NOT_FOUND);
} }
} else { } else {
Game::logger->Log("WorldMain", "Couldn't get user for level load complete!\n"); Game::logger->Log("WorldServer", "Couldn't get user for level load complete!\n");
} }
break; break;
} }
@ -1205,7 +1205,7 @@ void WorldShutdownSequence()
auto t = std::chrono::high_resolution_clock::now(); auto t = std::chrono::high_resolution_clock::now();
auto ticks = 0; auto ticks = 0;
printf("Attempting to shutdown world, max 10 seconds...");; Game::logger->Log("WorldServer", "Attempting to shutdown world, zone (%i), instance (%i), max 10 seconds...\n", Game::server->GetZoneID(), instanceID);
while (true) while (true)
{ {