ProcessLSStatus logging

This commit is contained in:
Akkadius 2019-07-03 19:22:06 -05:00
parent dc9e4e8260
commit d40b95f2e8

View File

@ -141,30 +141,40 @@ void WorldServer::ProcessNewLSInfo(uint16_t opcode, const EQ::Net::Packet &p)
void WorldServer::ProcessLSStatus(uint16_t opcode, const EQ::Net::Packet &p) void WorldServer::ProcessLSStatus(uint16_t opcode, const EQ::Net::Packet &p)
{ {
if (server.options.IsWorldTraceOn()) { Log(
Log(Logs::General, Logs::Detail,
Logs::Netcode, Logs::Netcode,
"Application packet received from server: 0x%.4X, (size %u)", "Application packet received from server: 0x%.4X, (size %u)",
opcode, opcode,
p.Length()); p.Length()
} );
if (server.options.IsDumpInPacketsOn()) { if (server.options.IsDumpInPacketsOn()) {
DumpPacket(opcode, p); DumpPacket(opcode, p);
} }
if (p.Length() < sizeof(ServerLSStatus_Struct)) { if (p.Length() < sizeof(ServerLSStatus_Struct)) {
Log(Logs::General, Log(
Logs::General,
Logs::Error, Logs::Error,
"Received application packet from server that had opcode ServerOP_LSStatus, but was too small. Discarded to avoid buffer overrun"); "Received application packet from server that had opcode ServerOP_LSStatus, but was too small. Discarded to avoid buffer overrun"
);
return; return;
} }
if (server.options.IsWorldTraceOn()) {
Log(Logs::General, Logs::Netcode, "World Server Status Received.");
}
ServerLSStatus_Struct *ls_status = (ServerLSStatus_Struct *) p.Data(); ServerLSStatus_Struct *ls_status = (ServerLSStatus_Struct *) p.Data();
LogF(
Logs::Detail,
Logs::Login_Server,
"World Server Status Update Received | Server [{0}] Status [{1}] Players [{2}] Zones [{3}]",
this->GetLongName(),
ls_status->status,
ls_status->num_players,
ls_status->num_zones
);
Handle_LSStatus(ls_status); Handle_LSStatus(ls_status);
} }