mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +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,7 +72,7 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
Map* oldMap = GetPlayer()->GetMap();
|
||||
if (GetPlayer()->IsInWorld())
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Player (Name %s) is still in world when teleported from map %u to new map %u", GetPlayer()->GetName().c_str(), oldMap->GetId(), loc.GetMapId());
|
||||
LOG_ERROR("network.opcode", "Player (Name {}) is still in world when teleported from map {} to new map {}", GetPlayer()->GetName(), oldMap->GetId(), loc.GetMapId());
|
||||
oldMap->RemovePlayerFromMap(GetPlayer(), false);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
// while the player is in transit, for example the map may get full
|
||||
if (!newMap || newMap->CannotEnter(GetPlayer(), false))
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Map %d could not be created for player %s, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUID().ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "Map {} could not be created for player {}, porting player to homebind", loc.GetMapId(), GetPlayer()->GetGUID().ToString());
|
||||
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
|
||||
return;
|
||||
}
|
||||
@@ -107,8 +107,8 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
GetPlayer()->SendInitialPacketsBeforeAddToMap();
|
||||
if (!GetPlayer()->GetMap()->AddPlayerToMap(GetPlayer()))
|
||||
{
|
||||
LOG_ERROR("network.opcode", "WORLD: failed to teleport player %s (%s) to map %d because of unknown reason!",
|
||||
GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str(), loc.GetMapId());
|
||||
LOG_ERROR("network.opcode", "WORLD: failed to teleport player {} ({}) to map {} because of unknown reason!",
|
||||
GetPlayer()->GetName(), GetPlayer()->GetGUID().ToString(), loc.GetMapId());
|
||||
GetPlayer()->ResetMap();
|
||||
GetPlayer()->SetMap(oldMap);
|
||||
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
|
||||
@@ -256,8 +256,8 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recvData)
|
||||
|
||||
uint32 flags, time;
|
||||
recvData >> flags >> time; // unused
|
||||
LOG_DEBUG("network.opcode", "Guid %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("network.opcode", "Flags %u, time %u", flags, time / IN_MILLISECONDS);
|
||||
LOG_DEBUG("network.opcode", "Guid {}", guid.ToString());
|
||||
LOG_DEBUG("network.opcode", "Flags {}, time {}", flags, time / IN_MILLISECONDS);
|
||||
|
||||
Player* plMover = _player->m_mover->ToPlayer();
|
||||
|
||||
@@ -587,7 +587,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
|
||||
void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
|
||||
{
|
||||
uint32 opcode = recvData.GetOpcode();
|
||||
LOG_DEBUG("network", "WORLD: Recvd %s (%u, 0x%X) opcode", GetOpcodeNameForLogging(static_cast<OpcodeClient>(opcode)).c_str(), opcode, opcode);
|
||||
LOG_DEBUG("network", "WORLD: Recvd {} ({}, 0x{:X}) opcode", GetOpcodeNameForLogging(static_cast<OpcodeClient>(opcode)), opcode, opcode);
|
||||
|
||||
/* extract packet */
|
||||
ObjectGuid guid;
|
||||
@@ -658,7 +658,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
|
||||
force_move_type = MOVE_PITCH_RATE;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("network.opcode", "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: %u", opcode);
|
||||
LOG_ERROR("network.opcode", "WorldSession::HandleForceSpeedChangeAck: Unknown move type opcode: {}", opcode);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -677,14 +677,14 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket& recvData)
|
||||
{
|
||||
if (_player->GetSpeed(move_type) > newspeed) // must be greater - just correct
|
||||
{
|
||||
LOG_ERROR("network.opcode", "%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value",
|
||||
move_type_name[move_type], _player->GetName().c_str(), _player->GetSpeed(move_type), newspeed);
|
||||
LOG_ERROR("network.opcode", "{}SpeedChange player {} is NOT correct (must be {} instead {}), force set to correct value",
|
||||
move_type_name[move_type], _player->GetName(), _player->GetSpeed(move_type), newspeed);
|
||||
_player->SetSpeed(move_type, _player->GetSpeedRate(move_type), true);
|
||||
}
|
||||
else // must be lesser - cheating
|
||||
{
|
||||
LOG_INFO("network.opcode", "Player %s from account id %u kicked for incorrect speed (must be %f instead %f)",
|
||||
_player->GetName().c_str(), GetAccountId(), _player->GetSpeed(move_type), newspeed);
|
||||
LOG_INFO("network.opcode", "Player {} from account id {} kicked for incorrect speed (must be {} instead {})",
|
||||
_player->GetName(), GetAccountId(), _player->GetSpeed(move_type), newspeed);
|
||||
KickPlayer("Incorrect speed");
|
||||
}
|
||||
}
|
||||
@@ -700,8 +700,8 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket& recvData)
|
||||
if (GetPlayer()->IsInWorld() && _player->m_mover && _player->m_mover->IsInWorld())
|
||||
{
|
||||
if (_player->m_mover->GetGUID() != guid)
|
||||
LOG_ERROR("network.opcode", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is %s and should be %s",
|
||||
guid.ToString().c_str(), _player->m_mover->GetGUID().ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is {} and should be {}",
|
||||
guid.ToString(), _player->m_mover->GetGUID().ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -838,14 +838,14 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket& recvData)
|
||||
|
||||
if (!mover)
|
||||
{
|
||||
LOG_ERROR("network.opcode", "WorldSession::HandleMoveTimeSkippedOpcode wrong mover state from the unit moved by the player [%s]", GetPlayer()->GetGUID().ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "WorldSession::HandleMoveTimeSkippedOpcode wrong mover state from the unit moved by the player [{}]", GetPlayer()->GetGUID().ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
// prevent tampered movement data
|
||||
if (guid != mover->GetGUID())
|
||||
{
|
||||
LOG_ERROR("network.opcode", "WorldSession::HandleMoveTimeSkippedOpcode wrong guid from the unit moved by the player [%s]", GetPlayer()->GetGUID().ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "WorldSession::HandleMoveTimeSkippedOpcode wrong guid from the unit moved by the player [{}]", GetPlayer()->GetGUID().ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user