mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Core/Logging: Performance-related tweaks to logging system
All sLog->out* functions (except outCommand atm) are replaced with TC_LOG_* macros.
Memleak fix
This commit is contained in:
@@ -70,7 +70,7 @@ void WorldSession::HandleNameQueryOpcode(WorldPacket& recvData)
|
||||
recvData >> guid;
|
||||
|
||||
// This is disable by default to prevent lots of console spam
|
||||
// sLog->outInfo(LOG_FILTER_NETWORKIO, "HandleNameQueryOpcode %u", guid);
|
||||
// TC_LOG_INFO(LOG_FILTER_NETWORKIO, "HandleNameQueryOpcode %u", guid);
|
||||
|
||||
SendNameQueryOpcode(guid);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket& recvData)
|
||||
ObjectMgr::GetLocaleString(cl->SubName, loc_idx, SubName);
|
||||
}
|
||||
}
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name.c_str(), entry);
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY '%s' - Entry: %u.", ci->Name.c_str(), entry);
|
||||
// guess size
|
||||
WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 100);
|
||||
data << uint32(entry); // creature entry
|
||||
@@ -138,16 +138,16 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket& recvData)
|
||||
data << uint32(ci->questItems[i]); // itemId[6], quest drop
|
||||
data << uint32(ci->movementId); // CreatureMovementInfo.dbc
|
||||
SendPacket(&data);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE");
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)",
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)",
|
||||
GUID_LOPART(guid), entry);
|
||||
WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4);
|
||||
data << uint32(entry | 0x80000000);
|
||||
SendPacket(&data);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData)
|
||||
ObjectMgr::GetLocaleString(gl->CastBarCaption, loc_idx, CastBarCaption);
|
||||
}
|
||||
}
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry);
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry);
|
||||
WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 150);
|
||||
data << uint32(entry);
|
||||
data << uint32(info->type);
|
||||
@@ -194,22 +194,22 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recvData)
|
||||
for (uint32 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i)
|
||||
data << uint32(info->questItems[i]); // itemId[6], quest drop
|
||||
SendPacket(&data);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE");
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)",
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)",
|
||||
GUID_LOPART(guid), entry);
|
||||
WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4);
|
||||
data << uint32(entry | 0x80000000);
|
||||
SendPacket(&data);
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE");
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recvData*/)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY");
|
||||
|
||||
Corpse* corpse = GetPlayer()->GetCorpse();
|
||||
|
||||
@@ -264,7 +264,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket& recvData)
|
||||
uint64 guid;
|
||||
|
||||
recvData >> textID;
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID);
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID);
|
||||
|
||||
recvData >> guid;
|
||||
GetPlayer()->SetSelection(guid);
|
||||
@@ -338,13 +338,13 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket& recvData)
|
||||
|
||||
SendPacket(&data);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_NPC_TEXT_UPDATE");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_NPC_TEXT_UPDATE");
|
||||
}
|
||||
|
||||
/// Only _static_ data is sent in this packet !!!
|
||||
void WorldSession::HandlePageTextQueryOpcode(WorldPacket& recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY");
|
||||
|
||||
uint32 pageID;
|
||||
recvData >> pageID;
|
||||
@@ -378,13 +378,13 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket& recvData)
|
||||
}
|
||||
SendPacket(&data);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE");
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleCorpseMapPositionQuery(WorldPacket& recvData)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY");
|
||||
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY");
|
||||
|
||||
uint32 unk;
|
||||
recvData >> unk;
|
||||
|
||||
Reference in New Issue
Block a user