mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +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:
@@ -52,7 +52,7 @@ Copied events should probably have a new owner
|
||||
void WorldSession::HandleCalendarGetCalendar(WorldPacket& /*recvData*/)
|
||||
{
|
||||
ObjectGuid guid = _player->GetGUID();
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GET_CALENDAR [%s]", guid.ToString().c_str());
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GET_CALENDAR [{}]", guid.ToString());
|
||||
|
||||
time_t currTime = GameTime::GetGameTime().count();
|
||||
|
||||
@@ -189,7 +189,7 @@ void WorldSession::HandleCalendarGetEvent(WorldPacket& recvData)
|
||||
uint64 eventId;
|
||||
recvData >> eventId;
|
||||
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GET_EVENT. Player [%s] Event [" UI64FMTD "]", _player->GetGUID().ToString().c_str(), eventId);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GET_EVENT. Player [{}] Event [{}]", _player->GetGUID().ToString(), eventId);
|
||||
|
||||
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId))
|
||||
sCalendarMgr->SendCalendarEvent(_player->GetGUID(), *calendarEvent, CALENDAR_SENDTYPE_GET);
|
||||
@@ -199,7 +199,7 @@ void WorldSession::HandleCalendarGetEvent(WorldPacket& recvData)
|
||||
|
||||
void WorldSession::HandleCalendarGuildFilter(WorldPacket& recvData)
|
||||
{
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GUILD_FILTER [%s]", _player->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GUILD_FILTER [{}]", _player->GetGUID().ToString());
|
||||
|
||||
uint32 minLevel;
|
||||
uint32 maxLevel;
|
||||
@@ -210,12 +210,12 @@ void WorldSession::HandleCalendarGuildFilter(WorldPacket& recvData)
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(_player->GetGuildId()))
|
||||
guild->MassInviteToEvent(this, minLevel, maxLevel, minRank);
|
||||
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GUILD_FILTER: Min level [%d], Max level [%d], Min rank [%d]", minLevel, maxLevel, minRank);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GUILD_FILTER: Min level [{}], Max level [{}], Min rank [{}]", minLevel, maxLevel, minRank);
|
||||
}
|
||||
|
||||
void WorldSession::HandleCalendarArenaTeam(WorldPacket& recvData)
|
||||
{
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_ARENA_TEAM [%s]", _player->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_ARENA_TEAM [{}]", _player->GetGUID().ToString());
|
||||
|
||||
uint32 arenaTeamId;
|
||||
recvData >> arenaTeamId;
|
||||
@@ -228,8 +228,8 @@ bool validUtf8String(WorldPacket& recvData, std::string& s, std::string action,
|
||||
{
|
||||
if (!utf8::is_valid(s.begin(), s.end()))
|
||||
{
|
||||
LOG_INFO("network.opcode", "CalendarHandler: Player (%s) attempt to %s an event with invalid name or description (packet modification)",
|
||||
playerGUID.ToString().c_str(), action.c_str());
|
||||
LOG_INFO("network.opcode", "CalendarHandler: Player ({}) attempt to {} an event with invalid name or description (packet modification)",
|
||||
playerGUID.ToString(), action);
|
||||
recvData.rfinish();
|
||||
return false;
|
||||
}
|
||||
@@ -399,12 +399,9 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_UPDATE_EVENT [%s] EventId [" UI64FMTD
|
||||
"], InviteId [" UI64FMTD "] Title %s, Description %s, type %u "
|
||||
"Repeatable %u, MaxInvites %u, Dungeon ID %d, Time %u "
|
||||
"Time2 %u, Flags %u", guid.ToString().c_str(), eventId, inviteId, title.c_str(),
|
||||
description.c_str(), type, repetitionType, maxInvites, dungeonId,
|
||||
eventPackedTime, timeZoneTime, flags);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_UPDATE_EVENT [{}] EventId [{}], InviteId [{}] Title {}, Description {}, type {} "
|
||||
"Repeatable {}, MaxInvites {}, Dungeon ID {}, Time {} Time2 {}, Flags {}",
|
||||
guid.ToString(), eventId, inviteId, title, description, type, repetitionType, maxInvites, dungeonId, eventPackedTime, timeZoneTime, flags);
|
||||
|
||||
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId))
|
||||
{
|
||||
@@ -445,8 +442,7 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket& recvData)
|
||||
|
||||
recvData >> eventId >> inviteId;
|
||||
recvData.ReadPackedTime(eventTime);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_COPY_EVENT [%s], EventId [" UI64FMTD
|
||||
"] inviteId [" UI64FMTD "] Time: %u", guid.ToString().c_str(), eventId, inviteId, eventTime);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_COPY_EVENT [{}], EventId [{}] inviteId [{}] Time: {}", guid.ToString(), eventId, inviteId, eventTime);
|
||||
|
||||
// prevent events in the past
|
||||
// To Do: properly handle timezones and remove the "- time_t(86400L)" hack
|
||||
@@ -623,7 +619,7 @@ void WorldSession::HandleCalendarEventSignup(WorldPacket& recvData)
|
||||
bool tentative;
|
||||
|
||||
recvData >> eventId >> tentative;
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_SIGNUP [%s] EventId [" UI64FMTD "] Tentative %u", guid.ToString().c_str(), eventId, tentative);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_SIGNUP [{}] EventId [{}] Tentative {}", guid.ToString(), eventId, tentative);
|
||||
|
||||
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId))
|
||||
{
|
||||
@@ -650,9 +646,8 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket& recvData)
|
||||
uint32 status;
|
||||
|
||||
recvData >> eventId >> inviteId >> status;
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_RSVP [%s] EventId ["
|
||||
UI64FMTD "], InviteId [" UI64FMTD "], status %u", guid.ToString().c_str(), eventId,
|
||||
inviteId, status);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_RSVP [{}] EventId [{}], InviteId [{}], status {}",
|
||||
guid.ToString(), eventId, inviteId, status);
|
||||
|
||||
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId))
|
||||
{
|
||||
@@ -690,8 +685,8 @@ void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket& recvData)
|
||||
recvData>> invitee.ReadAsPacked();
|
||||
recvData >> inviteId >> ownerInviteId >> eventId;
|
||||
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_REMOVE_INVITE [%s] EventId [" UI64FMTD "], ownerInviteId [" UI64FMTD "], Invitee ([%s] id: [" UI64FMTD "])",
|
||||
guid.ToString().c_str(), eventId, ownerInviteId, invitee.ToString().c_str(), inviteId);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_REMOVE_INVITE [{}] EventId [{}], ownerInviteId [{}], Invitee ([{}] id: [{}])",
|
||||
guid.ToString(), eventId, ownerInviteId, invitee.ToString(), inviteId);
|
||||
|
||||
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId))
|
||||
{
|
||||
@@ -718,8 +713,8 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket& recvData)
|
||||
|
||||
recvData >> invitee.ReadAsPacked();
|
||||
recvData >> eventId >> inviteId >> ownerInviteId >> status;
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_STATUS [%s] EventId [" UI64FMTD "] ownerInviteId [" UI64FMTD "], Invitee (%s) id: [" UI64FMTD "], status %u",
|
||||
guid.ToString().c_str(), eventId, ownerInviteId, invitee.ToString().c_str(), inviteId, status);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_STATUS [{}] EventId [{}] ownerInviteId [{}], Invitee ({}) id: [{}], status {}",
|
||||
guid.ToString(), eventId, ownerInviteId, invitee.ToString(), inviteId, status);
|
||||
|
||||
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId))
|
||||
{
|
||||
@@ -750,9 +745,8 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket& recvData)
|
||||
|
||||
recvData>> invitee.ReadAsPacked();
|
||||
recvData >> eventId >> inviteId >> ownerInviteId >> rank;
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_MODERATOR_STATUS [%s] EventId ["
|
||||
UI64FMTD "] ownerInviteId [" UI64FMTD "], Invitee ([%s] id: ["
|
||||
UI64FMTD "], rank %u", guid.ToString().c_str(), eventId, ownerInviteId, invitee.ToString().c_str(), inviteId, rank);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_EVENT_MODERATOR_STATUS [{}] EventId [{}] ownerInviteId [{}], Invitee ([{}] id: [{}], rank {}",
|
||||
guid.ToString(), eventId, ownerInviteId, invitee.ToString(), inviteId, rank);
|
||||
|
||||
if (CalendarEvent* calendarEvent = sCalendarMgr->GetEvent(eventId))
|
||||
{
|
||||
@@ -776,8 +770,7 @@ void WorldSession::HandleCalendarComplain(WorldPacket& recvData)
|
||||
ObjectGuid complainGUID;
|
||||
|
||||
recvData >> eventId >> complainGUID;
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_COMPLAIN [%s] EventId ["
|
||||
UI64FMTD "] guid [%s]", guid.ToString().c_str(), eventId, complainGUID.ToString().c_str());
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_COMPLAIN [{}] EventId [{}] guid [{}]", guid.ToString(), eventId, complainGUID.ToString());
|
||||
|
||||
// what to do with complains?
|
||||
}
|
||||
@@ -787,7 +780,7 @@ void WorldSession::HandleCalendarGetNumPending(WorldPacket& /*recvData*/)
|
||||
ObjectGuid guid = _player->GetGUID();
|
||||
uint32 pending = sCalendarMgr->GetPlayerNumPending(guid);
|
||||
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GET_NUM_PENDING: [%s] Pending: %u", guid.ToString().c_str(), pending);
|
||||
LOG_DEBUG("network", "CMSG_CALENDAR_GET_NUM_PENDING: [{}] Pending: {}", guid.ToString(), pending);
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4);
|
||||
data << uint32(pending);
|
||||
@@ -824,7 +817,7 @@ void WorldSession::HandleSetSavedInstanceExtend(WorldPacket& recvData)
|
||||
|
||||
void WorldSession::SendCalendarRaidLockout(InstanceSave const* save, bool add)
|
||||
{
|
||||
LOG_DEBUG("network", "%s", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED");
|
||||
LOG_DEBUG("network", "{}", add ? "SMSG_CALENDAR_RAID_LOCKOUT_ADDED" : "SMSG_CALENDAR_RAID_LOCKOUT_REMOVED");
|
||||
time_t currTime = GameTime::GetGameTime().count();
|
||||
|
||||
WorldPacket data(SMSG_CALENDAR_RAID_LOCKOUT_REMOVED, (add ? 4 : 0) + 4 + 4 + 4 + 8);
|
||||
|
||||
Reference in New Issue
Block a user