mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-09 21:51:29 +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:
@@ -70,8 +70,8 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData)
|
||||
if (!seat->CanSwitchFromSeat())
|
||||
{
|
||||
recvData.rfinish(); // prevent warnings spam
|
||||
LOG_ERROR("network.opcode", "HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %s tried to switch seats but current seatflags %u don't permit that.",
|
||||
recvData.GetOpcode(), GetPlayer()->GetGUID().ToString().c_str(), seat->m_flags);
|
||||
LOG_ERROR("network.opcode", "HandleChangeSeatsOnControlledVehicle, Opcode: {}, Player {} tried to switch seats but current seatflags {} don't permit that.",
|
||||
recvData.GetOpcode(), GetPlayer()->GetGUID().ToString(), seat->m_flags);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket& data)
|
||||
if (!vehicle)
|
||||
{
|
||||
data.rfinish(); // prevent warnings spam
|
||||
LOG_ERROR("network.opcode", "HandleEjectPassenger: Player %s is not in a vehicle!", GetPlayer()->GetGUID().ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "HandleEjectPassenger: Player {} is not in a vehicle!", GetPlayer()->GetGUID().ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -177,13 +177,13 @@ void WorldSession::HandleEjectPassenger(WorldPacket& data)
|
||||
Player* player = ObjectAccessor::GetPlayer(*_player, guid);
|
||||
if (!player)
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Player %s tried to eject player %s from vehicle, but the latter was not found in world!", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "Player {} tried to eject player {} from vehicle, but the latter was not found in world!", GetPlayer()->GetGUID().ToString(), guid.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player->IsOnVehicle(vehicle->GetBase()))
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Player %s tried to eject player %s, but they are not in the same vehicle", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "Player {} tried to eject player {}, but they are not in the same vehicle", GetPlayer()->GetGUID().ToString(), guid.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,20 +192,20 @@ void WorldSession::HandleEjectPassenger(WorldPacket& data)
|
||||
if (seat->IsEjectable())
|
||||
player->ExitVehicle();
|
||||
else
|
||||
LOG_ERROR("network.opcode", "Player %s attempted to eject player %s from non-ejectable seat.", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "Player {} attempted to eject player {} from non-ejectable seat.", GetPlayer()->GetGUID().ToString(), guid.ToString());
|
||||
}
|
||||
else if (guid.IsCreature())
|
||||
{
|
||||
Unit* unit = ObjectAccessor::GetUnit(*_player, guid);
|
||||
if (!unit) // creatures can be ejected too from player mounts
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Player %s tried to eject creature guid %s from vehicle, but the latter was not found in world!", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "Player {} tried to eject creature guid {} from vehicle, but the latter was not found in world!", GetPlayer()->GetGUID().ToString(), guid.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!unit->IsOnVehicle(vehicle->GetBase()))
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Player %s tried to eject unit %s, but they are not in the same vehicle", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "Player {} tried to eject unit {}, but they are not in the same vehicle", GetPlayer()->GetGUID().ToString(), guid.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -217,10 +217,10 @@ void WorldSession::HandleEjectPassenger(WorldPacket& data)
|
||||
unit->ExitVehicle();
|
||||
}
|
||||
else
|
||||
LOG_ERROR("network.opcode", "Player %s attempted to eject creature %s from non-ejectable seat.", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "Player {} attempted to eject creature {} from non-ejectable seat.", GetPlayer()->GetGUID().ToString(), guid.ToString());
|
||||
}
|
||||
else
|
||||
LOG_ERROR("network.opcode", "HandleEjectPassenger: Player %s tried to eject invalid %s", GetPlayer()->GetGUID().ToString().c_str(), guid.ToString().c_str());
|
||||
LOG_ERROR("network.opcode", "HandleEjectPassenger: Player {} tried to eject invalid {}", GetPlayer()->GetGUID().ToString(), guid.ToString());
|
||||
}
|
||||
|
||||
void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
|
||||
@@ -234,8 +234,8 @@ void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/)
|
||||
if (seat->CanEnterOrExit())
|
||||
GetPlayer()->ExitVehicle();
|
||||
else
|
||||
LOG_ERROR("network.opcode", "Player %s tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.",
|
||||
GetPlayer()->GetGUID().ToString().c_str(), seat->m_ID, seat->m_flags);
|
||||
LOG_ERROR("network.opcode", "Player {} tried to exit vehicle, but seatflags {} (ID: {}) don't permit that.",
|
||||
GetPlayer()->GetGUID().ToString(), seat->m_ID, seat->m_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user