mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
refactor(Core/Logging): switch to fmt style for LOG_ (#10366)
* feat(Core/Common): add support fmt style for ASSERT and ABORT * correct CheckCompactArrayMaskOverflow * 1 * Update src/server/game/Spells/Spell.cpp * rework logging * add fmt replace logs * logging * FMT_LOG_ * settings * fix startup * 1 * 2 * 3 * 4 * 5 * fmt::print * to fmt
This commit is contained in:
@@ -72,8 +72,8 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
|
||||
// release spirit after he's killed but before he is updated
|
||||
if (GetPlayer()->getDeathState() == JUST_DIED)
|
||||
{
|
||||
LOG_DEBUG("network", "HandleRepopRequestOpcode: got request after player %s (%s) was killed and before he was updated",
|
||||
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("network", "HandleRepopRequestOpcode: got request after player {} ({}) was killed and before he was updated",
|
||||
GetPlayer()->GetName(), GetPlayer()->GetGUID().ToString());
|
||||
GetPlayer()->KillPlayer();
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
|
||||
unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
|
||||
if (!unit)
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - Unit (%s) not found or you can't interact with him.", guid.ToString().c_str());
|
||||
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - Unit ({}) not found or you can't interact with him.", guid.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -114,7 +114,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
|
||||
go = _player->GetMap()->GetGameObject(guid);
|
||||
if (!go)
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - GameObject (%s) not found.", guid.ToString().c_str());
|
||||
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - GameObject ({}) not found.", guid.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -123,7 +123,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
|
||||
item = _player->GetItemByGuid(guid);
|
||||
if (!item || _player->IsBankPos(item->GetPos()))
|
||||
{
|
||||
//LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - %s not found.", guid.ToString().c_str());
|
||||
//LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - {} not found.", guid.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -131,13 +131,13 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
if (guid != _player->GetGUID() || menuId != _player->PlayerTalkClass->GetGossipMenu().GetMenuId())
|
||||
{
|
||||
//LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - %s not found.", guid.ToString().c_str());
|
||||
//LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - {} not found.", guid.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for %s.", guid.ToString().c_str());
|
||||
LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for {}.", guid.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
|
||||
uint32 temp;
|
||||
recvData >> temp; // zone id, 0 if zone is unknown...
|
||||
zoneids[i] = temp;
|
||||
FMT_LOG_DEBUG("network.who", "Zone {}: {}", i, zoneids[i]);
|
||||
LOG_DEBUG("network.who", "Zone {}: {}", i, zoneids[i]);
|
||||
}
|
||||
|
||||
recvData >> strCount; // user entered strings count, client limit=4 (checked on 2.0.10)
|
||||
@@ -238,7 +238,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
|
||||
if (strCount > 4)
|
||||
return; // can't be received from real client or broken packet
|
||||
|
||||
FMT_LOG_DEBUG("network.who", "Minlvl {}, maxlvl {}, name {}, guild {}, racemask {}, classmask {}, zones {}, strings {}",
|
||||
LOG_DEBUG("network.who", "Minlvl {}, maxlvl {}, name {}, guild {}, racemask {}, classmask {}, zones {}, strings {}",
|
||||
levelMin, levelMax, packetPlayerName, packetGuildName, racemask, classmask, zonesCount, strCount);
|
||||
|
||||
std::wstring str[4]; // 4 is client limit
|
||||
@@ -252,7 +252,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
|
||||
|
||||
wstrToLower(str[i]);
|
||||
|
||||
FMT_LOG_DEBUG("network.who", "String {}: {}", i, temp);
|
||||
LOG_DEBUG("network.who", "String {}: {}", i, temp);
|
||||
}
|
||||
|
||||
std::wstring wpacketPlayerName;
|
||||
@@ -405,12 +405,12 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData)
|
||||
data.put(4, matchCount); // insert right count, count of matches
|
||||
|
||||
SendPacket(&data);
|
||||
FMT_LOG_DEBUG("network", "WORLD: Send SMSG_WHO Message");
|
||||
LOG_DEBUG("network", "WORLD: Send SMSG_WHO Message");
|
||||
}
|
||||
|
||||
void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequest& /*logoutRequest*/)
|
||||
{
|
||||
LOG_DEBUG("network", "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity());
|
||||
LOG_DEBUG("network", "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - {}", GetSecurity());
|
||||
|
||||
if (ObjectGuid lguid = GetPlayer()->GetLootGUID())
|
||||
DoLootRelease(lguid);
|
||||
@@ -514,7 +514,7 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket& recv_data)
|
||||
uint32 newZone;
|
||||
recv_data >> newZone;
|
||||
|
||||
LOG_DEBUG("network", "WORLD: Recvd ZONE_UPDATE: %u", newZone);
|
||||
LOG_DEBUG("network", "WORLD: Recvd ZONE_UPDATE: {}", newZone);
|
||||
|
||||
// use server side data, but only after update the player position. See Player::UpdatePosition().
|
||||
GetPlayer()->SetNeedZoneUpdate(true);
|
||||
@@ -618,8 +618,8 @@ void WorldSession::HandleBugOpcode(WorldPacket& recv_data)
|
||||
else
|
||||
LOG_DEBUG("network", "WORLD: Received CMSG_BUG [Suggestion]");
|
||||
|
||||
LOG_DEBUG("network", "%s", type.c_str());
|
||||
LOG_DEBUG("network", "%s", content.c_str());
|
||||
LOG_DEBUG("network", "{}", type);
|
||||
LOG_DEBUG("network", "{}", content);
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT);
|
||||
|
||||
@@ -712,28 +712,28 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
|
||||
uint32 triggerId;
|
||||
recv_data >> triggerId;
|
||||
|
||||
LOG_DEBUG("network", "CMSG_AREATRIGGER. Trigger ID: %u", triggerId);
|
||||
LOG_DEBUG("network", "CMSG_AREATRIGGER. Trigger ID: {}", triggerId);
|
||||
|
||||
Player* player = GetPlayer();
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) in flight, ignore Area Trigger ID:%u",
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), triggerId);
|
||||
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '{}' ({}) in flight, ignore Area Trigger ID:{}",
|
||||
player->GetName(), player->GetGUID().ToString(), triggerId);
|
||||
return;
|
||||
}
|
||||
|
||||
AreaTrigger const* atEntry = sObjectMgr->GetAreaTrigger(triggerId);
|
||||
if (!atEntry)
|
||||
{
|
||||
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) send unknown (by DBC) Area Trigger ID:%u",
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), triggerId);
|
||||
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '{}' ({}) send unknown (by DBC) Area Trigger ID:{}",
|
||||
player->GetName(), player->GetGUID().ToString(), triggerId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player->IsInAreaTriggerRadius(atEntry))
|
||||
{
|
||||
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player %s (%s) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u",
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->map, player->GetMapId(), triggerId);
|
||||
LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player {} ({}) too far (trigger map: {} player map: {}), ignore Area Trigger ID: {}",
|
||||
player->GetName(), player->GetGUID().ToString(), atEntry->map, player->GetMapId(), triggerId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -824,7 +824,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket& recv_data)
|
||||
uint32 type, timestamp, decompressedSize;
|
||||
recv_data >> type >> timestamp >> decompressedSize;
|
||||
|
||||
LOG_DEBUG("network", "UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize);
|
||||
LOG_DEBUG("network", "UAD: type {}, time {}, decompressedSize {}", type, timestamp, decompressedSize);
|
||||
|
||||
if (type > NUM_ACCOUNT_DATA_TYPES)
|
||||
return;
|
||||
@@ -844,7 +844,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket& recv_data)
|
||||
if (decompressedSize > 0xFFFF)
|
||||
{
|
||||
recv_data.rfinish(); // unnneded warning spam in this case
|
||||
LOG_ERROR("network.opcode", "UAD: Account data packet too big, size %u", decompressedSize);
|
||||
LOG_ERROR("network.opcode", "UAD: Account data packet too big, size {}", decompressedSize);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -879,7 +879,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data)
|
||||
uint32 type;
|
||||
recv_data >> type;
|
||||
|
||||
LOG_DEBUG("network", "RAD: type %u", type);
|
||||
LOG_DEBUG("network", "RAD: type {}", type);
|
||||
|
||||
if (type >= NUM_ACCOUNT_DATA_TYPES)
|
||||
return;
|
||||
@@ -920,10 +920,10 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
|
||||
uint32 action = ACTION_BUTTON_ACTION(packetData);
|
||||
uint8 type = ACTION_BUTTON_TYPE(packetData);
|
||||
|
||||
LOG_DEBUG("network.opcode", "BUTTON: %u ACTION: %u TYPE: %u", button, action, type);
|
||||
LOG_DEBUG("network.opcode", "BUTTON: {} ACTION: {} TYPE: {}", button, action, type);
|
||||
if (!packetData)
|
||||
{
|
||||
LOG_DEBUG("network.opcode", "MISC: Remove action from button %u", button);
|
||||
LOG_DEBUG("network.opcode", "MISC: Remove action from button {}", button);
|
||||
GetPlayer()->removeActionButton(button);
|
||||
}
|
||||
else
|
||||
@@ -932,20 +932,20 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data)
|
||||
{
|
||||
case ACTION_BUTTON_MACRO:
|
||||
case ACTION_BUTTON_CMACRO:
|
||||
LOG_DEBUG("network.opcode", "MISC: Added Macro %u into button %u", action, button);
|
||||
LOG_DEBUG("network.opcode", "MISC: Added Macro {} into button {}", action, button);
|
||||
break;
|
||||
case ACTION_BUTTON_EQSET:
|
||||
LOG_DEBUG("network.opcode", "MISC: Added EquipmentSet %u into button %u", action, button);
|
||||
LOG_DEBUG("network.opcode", "MISC: Added EquipmentSet {} into button {}", action, button);
|
||||
break;
|
||||
case ACTION_BUTTON_SPELL:
|
||||
LOG_DEBUG("network.opcode", "MISC: Added Spell %u into button %u", action, button);
|
||||
LOG_DEBUG("network.opcode", "MISC: Added Spell {} into button {}", action, button);
|
||||
break;
|
||||
case ACTION_BUTTON_ITEM:
|
||||
LOG_DEBUG("network.opcode", "MISC: Added Item %u into button %u", action, button);
|
||||
LOG_DEBUG("network.opcode", "MISC: Added Item {} into button {}", action, button);
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("network.opcode", "MISC: Unknown action button type %u for action %u into button %u for player %s (%s)",
|
||||
type, action, button, _player->GetName().c_str(), _player->GetGUID().ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "MISC: Unknown action button type {} for action {} into button {} for player {} ({})",
|
||||
type, action, button, _player->GetName(), _player->GetGUID().ToString());
|
||||
return;
|
||||
}
|
||||
GetPlayer()->addActionButton(button, action, type);
|
||||
@@ -987,7 +987,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data)
|
||||
if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED)
|
||||
{
|
||||
if (ActionBar != 0)
|
||||
LOG_ERROR("network.opcode", "WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(ActionBar));
|
||||
LOG_ERROR("network.opcode", "WorldSession::HandleSetActionBarToggles in not logged state with value: {}, ignored", uint32(ActionBar));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1013,7 +1013,7 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
|
||||
Player* player = ObjectAccessor::GetPlayer(*_player, guid);
|
||||
if (!player)
|
||||
{
|
||||
LOG_DEBUG("network", "CMSG_INSPECT: No player found from %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("network", "CMSG_INSPECT: No player found from {}", guid.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1045,7 +1045,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
|
||||
Player* player = ObjectAccessor::GetPlayer(*_player, guid);
|
||||
if (!player)
|
||||
{
|
||||
LOG_DEBUG("network", "MSG_INSPECT_HONOR_STATS: No player found from %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("network", "MSG_INSPECT_HONOR_STATS: No player found from {}", guid.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1079,11 +1079,11 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
|
||||
|
||||
if (GetPlayer()->IsInFlight())
|
||||
{
|
||||
LOG_DEBUG("network", "Player '%s' (%s) in flight, ignore worldport command.", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("network", "Player '{}' ({}) in flight, ignore worldport command.", GetPlayer()->GetName(), GetPlayer()->GetGUID().ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_DEBUG("network", "CMSG_WORLD_TELEPORT: Player = %s, Time = %u, map = %u, x = %f, y = %f, z = %f, o = %f", GetPlayer()->GetName().c_str(), time, mapid, PositionX, PositionY, PositionZ, Orientation);
|
||||
LOG_DEBUG("network", "CMSG_WORLD_TELEPORT: Player = {}, Time = {}, map = {}, x = {}, y = {}, z = {}, o = {}", GetPlayer()->GetName(), time, mapid, PositionX, PositionY, PositionZ, Orientation);
|
||||
|
||||
if (AccountMgr::IsAdminAccount(GetSecurity()))
|
||||
GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation);
|
||||
@@ -1148,7 +1148,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
|
||||
data << msg;
|
||||
SendPacket(&data);
|
||||
|
||||
LOG_DEBUG("network", "Received whois command from player %s for character %s", GetPlayer()->GetName().c_str(), charname.c_str());
|
||||
LOG_DEBUG("network", "Received whois command from player {} for character {}", GetPlayer()->GetName(), charname);
|
||||
}
|
||||
|
||||
void WorldSession::HandleComplainOpcode(WorldPacket& recv_data)
|
||||
@@ -1188,8 +1188,8 @@ void WorldSession::HandleComplainOpcode(WorldPacket& recv_data)
|
||||
data << uint8(0);
|
||||
SendPacket(&data);
|
||||
|
||||
LOG_DEBUG("network", "REPORT SPAM: type %u, %s, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s",
|
||||
spam_type, spammer_guid.ToString().c_str(), unk1, unk2, unk3, unk4, description.c_str());
|
||||
LOG_DEBUG("network", "REPORT SPAM: type {}, {}, unk1 {}, unk2 {}, unk3 {}, unk4 {}, message {}",
|
||||
spam_type, spammer_guid.ToString(), unk1, unk2, unk3, unk4, description);
|
||||
}
|
||||
|
||||
void WorldSession::HandleRealmSplitOpcode(WorldPacket& recv_data)
|
||||
@@ -1220,17 +1220,17 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData)
|
||||
|
||||
if (apply)
|
||||
{
|
||||
LOG_DEBUG("network", "Added FarSight %s to player %s", _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str(), _player->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("network", "Added FarSight {} to player {}", _player->GetGuidValue(PLAYER_FARSIGHT).ToString(), _player->GetGUID().ToString());
|
||||
if (WorldObject* target = _player->GetViewpoint())
|
||||
_player->SetSeer(target);
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("network.opcode", "Player %s requests non-existing seer %s", _player->GetName().c_str(), _player->GetGuidValue(PLAYER_FARSIGHT).ToString().c_str());
|
||||
LOG_DEBUG("network.opcode", "Player {} requests non-existing seer {}", _player->GetName(), _player->GetGuidValue(PLAYER_FARSIGHT).ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("network", "Player %s set vision to self", _player->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("network", "Player {} set vision to self", _player->GetGUID().ToString());
|
||||
_player->SetSeer(_player);
|
||||
}
|
||||
|
||||
@@ -1550,7 +1550,7 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket& recv_data)
|
||||
|
||||
mode ? _player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);
|
||||
|
||||
LOG_DEBUG("network", "Client used \"/timetest %d\" command", mode);
|
||||
LOG_DEBUG("network", "Client used \"/timetest {}\" command", mode);
|
||||
}
|
||||
|
||||
void WorldSession::HandleQueryInspectAchievements(WorldPacket& recv_data)
|
||||
@@ -1665,8 +1665,8 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket)
|
||||
|
||||
if (!_player->HasPendingBind() || _player->GetPendingBind() != _player->GetInstanceId() || (_player->GetGroup() && _player->GetGroup()->isLFGGroup() && _player->GetGroup()->IsLfgRandomInstance()))
|
||||
{
|
||||
LOG_DEBUG("network.opcode", "InstanceLockResponse: Player %s (%s) tried to bind himself/teleport to graveyard without a pending bind!",
|
||||
_player->GetName().c_str(), _player->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("network.opcode", "InstanceLockResponse: Player {} ({}) tried to bind himself/teleport to graveyard without a pending bind!",
|
||||
_player->GetName(), _player->GetGUID().ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user