mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
This commit is contained in:
@@ -36,7 +36,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPackets::LFG::DFJoin& dfJoin)
|
||||
|
||||
if (dfJoin.Slots.empty())
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_JOIN %s no dungeons selected", GetPlayerInfo().c_str());
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_JOIN {} no dungeons selected", GetPlayerInfo());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPackets::LFG::DFJoin& dfJoin)
|
||||
newDungeons.insert(dungeon);
|
||||
}
|
||||
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_JOIN %s roles: %u, Dungeons: %u", GetPlayerInfo().c_str(), dfJoin.Roles, uint8(newDungeons.size()));
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_JOIN {} roles: {}, Dungeons: {}", GetPlayerInfo(), dfJoin.Roles, uint8(newDungeons.size()));
|
||||
|
||||
sLFGMgr->JoinLfg(GetPlayer(), uint8(dfJoin.Roles), newDungeons);
|
||||
}
|
||||
@@ -57,8 +57,8 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPackets::LFG::DFLeave& dfLeave)
|
||||
{
|
||||
Group* group = GetPlayer()->GetGroup();
|
||||
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_LEAVE %s in group: %u sent guid %s.",
|
||||
GetPlayerInfo().c_str(), group ? 1 : 0, dfLeave.Ticket.RequesterGuid.ToString().c_str());
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_LEAVE {} in group: {} sent guid {}.",
|
||||
GetPlayerInfo(), group ? 1 : 0, dfLeave.Ticket.RequesterGuid.ToString());
|
||||
|
||||
// Check cheating - only leader can leave the queue
|
||||
if (!group || group->GetLeaderGUID() == dfLeave.Ticket.RequesterGuid)
|
||||
@@ -67,8 +67,8 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPackets::LFG::DFLeave& dfLeave)
|
||||
|
||||
void WorldSession::HandleLfgProposalResultOpcode(WorldPackets::LFG::DFProposalResponse& dfProposalResponse)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "CMSG_LFG_PROPOSAL_RESULT %s proposal: %u accept: %u",
|
||||
GetPlayerInfo().c_str(), dfProposalResponse.ProposalID, dfProposalResponse.Accepted ? 1 : 0);
|
||||
TC_LOG_DEBUG("lfg", "CMSG_LFG_PROPOSAL_RESULT {} proposal: {} accept: {}",
|
||||
GetPlayerInfo(), dfProposalResponse.ProposalID, dfProposalResponse.Accepted ? 1 : 0);
|
||||
sLFGMgr->UpdateProposal(dfProposalResponse.ProposalID, GetPlayer()->GetGUID(), dfProposalResponse.Accepted);
|
||||
}
|
||||
|
||||
@@ -78,34 +78,34 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPackets::LFG::DFSetRoles& dfSetR
|
||||
Group* group = GetPlayer()->GetGroup();
|
||||
if (!group)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_SET_ROLES %s Not in group",
|
||||
GetPlayerInfo().c_str());
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_SET_ROLES {} Not in group",
|
||||
GetPlayerInfo());
|
||||
return;
|
||||
}
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_SET_ROLES: Group %s, Player %s, Roles: %u",
|
||||
gguid.ToString().c_str(), GetPlayerInfo().c_str(), dfSetRoles.RolesDesired);
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_SET_ROLES: Group {}, Player {}, Roles: {}",
|
||||
gguid.ToString(), GetPlayerInfo(), dfSetRoles.RolesDesired);
|
||||
sLFGMgr->UpdateRoleCheck(gguid, guid, dfSetRoles.RolesDesired);
|
||||
}
|
||||
|
||||
void WorldSession::HandleLfgSetBootVoteOpcode(WorldPackets::LFG::DFBootPlayerVote& dfBootPlayerVote)
|
||||
{
|
||||
ObjectGuid guid = GetPlayer()->GetGUID();
|
||||
TC_LOG_DEBUG("lfg", "CMSG_LFG_SET_BOOT_VOTE %s agree: %u",
|
||||
GetPlayerInfo().c_str(), dfBootPlayerVote.Vote ? 1 : 0);
|
||||
TC_LOG_DEBUG("lfg", "CMSG_LFG_SET_BOOT_VOTE {} agree: {}",
|
||||
GetPlayerInfo(), dfBootPlayerVote.Vote ? 1 : 0);
|
||||
sLFGMgr->UpdateBoot(guid, dfBootPlayerVote.Vote);
|
||||
}
|
||||
|
||||
void WorldSession::HandleLfgTeleportOpcode(WorldPackets::LFG::DFTeleport& dfTeleport)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_TELEPORT %s out: %u",
|
||||
GetPlayerInfo().c_str(), dfTeleport.TeleportOut ? 1 : 0);
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_TELEPORT {} out: {}",
|
||||
GetPlayerInfo(), dfTeleport.TeleportOut ? 1 : 0);
|
||||
sLFGMgr->TeleportPlayer(GetPlayer(), dfTeleport.TeleportOut, true);
|
||||
}
|
||||
|
||||
void WorldSession::HandleDFGetSystemInfo(WorldPackets::LFG::DFGetSystemInfo& dfGetSystemInfo)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_GET_SYSTEM_INFO %s for %s", GetPlayerInfo().c_str(), (dfGetSystemInfo.Player ? "player" : "party"));
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_GET_SYSTEM_INFO {} for {}", GetPlayerInfo(), (dfGetSystemInfo.Player ? "player" : "party"));
|
||||
|
||||
if (dfGetSystemInfo.Player)
|
||||
SendLfgPlayerLockInfo();
|
||||
@@ -115,7 +115,7 @@ void WorldSession::HandleDFGetSystemInfo(WorldPackets::LFG::DFGetSystemInfo& dfG
|
||||
|
||||
void WorldSession::HandleDFGetJoinStatus(WorldPackets::LFG::DFGetJoinStatus& /*dfGetJoinStatus*/)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_GET_JOIN_STATUS %s", GetPlayerInfo().c_str());
|
||||
TC_LOG_DEBUG("lfg", "CMSG_DF_GET_JOIN_STATUS {}", GetPlayerInfo());
|
||||
|
||||
if (!GetPlayer()->isUsingLfg())
|
||||
return;
|
||||
@@ -139,7 +139,7 @@ void WorldSession::HandleDFGetJoinStatus(WorldPackets::LFG::DFGetJoinStatus& /*d
|
||||
|
||||
void WorldSession::SendLfgPlayerLockInfo()
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PLAYER_INFO %s", GetPlayerInfo().c_str());
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PLAYER_INFO {}", GetPlayerInfo());
|
||||
|
||||
// Get Random dungeons that can be done at a certain level and expansion
|
||||
uint8 level = GetPlayer()->GetLevel();
|
||||
@@ -226,7 +226,7 @@ void WorldSession::SendLfgPartyLockInfo()
|
||||
lfgBlackList.Slot.emplace_back(lock.first, lock.second.lockStatus, lock.second.requiredItemLevel, lock.second.currentItemLevel, 0);
|
||||
}
|
||||
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PARTY_INFO %s", GetPlayerInfo().c_str());
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PARTY_INFO {}", GetPlayerInfo());
|
||||
SendPacket(lfgPartyInfo.Write());;
|
||||
}
|
||||
|
||||
@@ -256,8 +256,8 @@ void WorldSession::SendLfgUpdateStatus(lfg::LfgUpdateData const& updateData, boo
|
||||
break;
|
||||
}
|
||||
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_UPDATE_STATUS %s updatetype: %u, party %s",
|
||||
GetPlayerInfo().c_str(), updateData.updateType, party ? "true" : "false");
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_UPDATE_STATUS {} updatetype: {}, party {}",
|
||||
GetPlayerInfo(), updateData.updateType, party ? "true" : "false");
|
||||
|
||||
WorldPackets::LFG::LFGUpdateStatus lfgUpdateStatus;
|
||||
if (WorldPackets::LFG::RideTicket const* ticket = sLFGMgr->GetTicket(_player->GetGUID()))
|
||||
@@ -283,8 +283,8 @@ void WorldSession::SendLfgUpdateStatus(lfg::LfgUpdateData const& updateData, boo
|
||||
|
||||
void WorldSession::SendLfgRoleChosen(ObjectGuid guid, uint8 roles)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_ROLE_CHOSEN %s guid: %s roles: %u",
|
||||
GetPlayerInfo().c_str(), guid.ToString().c_str(), roles);
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_ROLE_CHOSEN {} guid: {} roles: {}",
|
||||
GetPlayerInfo(), guid.ToString(), roles);
|
||||
|
||||
WorldPackets::LFG::RoleChosen roleChosen;
|
||||
roleChosen.Player = guid;
|
||||
@@ -301,7 +301,7 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck)
|
||||
else
|
||||
dungeons = roleCheck.dungeons;
|
||||
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_ROLE_CHECK_UPDATE %s", GetPlayerInfo().c_str());
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_ROLE_CHECK_UPDATE {}", GetPlayerInfo());
|
||||
WorldPackets::LFG::LFGRoleCheckUpdate lfgRoleCheckUpdate;
|
||||
lfgRoleCheckUpdate.PartyIndex = 127;
|
||||
lfgRoleCheckUpdate.RoleCheckStatus = roleCheck.state;
|
||||
@@ -331,8 +331,8 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck)
|
||||
|
||||
void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_JOIN_RESULT %s checkResult: %u checkValue: %u",
|
||||
GetPlayerInfo().c_str(), joinData.result, joinData.state);
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_JOIN_RESULT {} checkResult: {} checkValue: {}",
|
||||
GetPlayerInfo(), joinData.result, joinData.state);
|
||||
|
||||
WorldPackets::LFG::LFGJoinResult lfgJoinResult;
|
||||
if (WorldPackets::LFG::RideTicket const* ticket = sLFGMgr->GetTicket(GetPlayer()->GetGUID()))
|
||||
@@ -351,8 +351,8 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData)
|
||||
|
||||
for (lfg::LfgLockMap::const_iterator itr = it->second.begin(); itr != it->second.end(); ++itr)
|
||||
{
|
||||
TC_LOG_TRACE("lfg", "SendLfgJoinResult:: %s DungeonID: %u Lock status: %u Required itemLevel: %u Current itemLevel: %f",
|
||||
it->first.ToString().c_str(), (itr->first & 0x00FFFFFF), itr->second.lockStatus, itr->second.requiredItemLevel, itr->second.currentItemLevel);
|
||||
TC_LOG_TRACE("lfg", "SendLfgJoinResult:: {} DungeonID: {} Lock status: {} Required itemLevel: {} Current itemLevel: {}",
|
||||
it->first.ToString(), (itr->first & 0x00FFFFFF), itr->second.lockStatus, itr->second.requiredItemLevel, itr->second.currentItemLevel);
|
||||
|
||||
blackList.Slot.emplace_back(itr->first, itr->second.lockStatus, itr->second.requiredItemLevel, itr->second.currentItemLevel, 0);
|
||||
}
|
||||
@@ -363,10 +363,10 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData)
|
||||
|
||||
void WorldSession::SendLfgQueueStatus(lfg::LfgQueueStatusData const& queueData)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_QUEUE_STATUS %s state: %s, dungeon: %u, waitTime: %d, "
|
||||
"avgWaitTime: %d, waitTimeTanks: %d, waitTimeHealer: %d, waitTimeDps: %d, "
|
||||
"queuedTime: %u, tanks: %u, healers: %u, dps: %u",
|
||||
GetPlayerInfo().c_str(), lfg::GetStateString(sLFGMgr->GetState(GetPlayer()->GetGUID())).c_str(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg,
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_QUEUE_STATUS {} state: {}, dungeon: {}, waitTime: {}, "
|
||||
"avgWaitTime: {}, waitTimeTanks: {}, waitTimeHealer: {}, waitTimeDps: {}, "
|
||||
"queuedTime: {}, tanks: {}, healers: {}, dps: {}",
|
||||
GetPlayerInfo(), lfg::GetStateString(sLFGMgr->GetState(GetPlayer()->GetGUID())), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg,
|
||||
queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps,
|
||||
queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps);
|
||||
|
||||
@@ -391,8 +391,8 @@ void WorldSession::SendLfgPlayerReward(lfg::LfgPlayerRewardData const& rewardDat
|
||||
if (!rewardData.rdungeonEntry || !rewardData.sdungeonEntry || !rewardData.quest)
|
||||
return;
|
||||
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PLAYER_REWARD %s rdungeonEntry: %u, sdungeonEntry: %u, done: %u",
|
||||
GetPlayerInfo().c_str(), rewardData.rdungeonEntry, rewardData.sdungeonEntry, rewardData.done);
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PLAYER_REWARD {} rdungeonEntry: {}, sdungeonEntry: {}, done: {}",
|
||||
GetPlayerInfo(), rewardData.rdungeonEntry, rewardData.sdungeonEntry, rewardData.done);
|
||||
|
||||
WorldPackets::LFG::LFGPlayerReward lfgPlayerReward;
|
||||
lfgPlayerReward.QueuedSlot = rewardData.rdungeonEntry;
|
||||
@@ -426,12 +426,12 @@ void WorldSession::SendLfgBootProposalUpdate(lfg::LfgPlayerBoot const& boot)
|
||||
++agreeNum;
|
||||
}
|
||||
}
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_BOOT_PROPOSAL_UPDATE %s inProgress: %u - "
|
||||
"didVote: %u - agree: %u - victim: %s votes: %u - agrees: %u - left: %u - "
|
||||
"needed: %u - reason %s",
|
||||
GetPlayerInfo().c_str(), uint8(boot.inProgress), uint8(playerVote != lfg::LFG_ANSWER_PENDING),
|
||||
uint8(playerVote == lfg::LFG_ANSWER_AGREE), boot.victim.ToString().c_str(), votesNum, agreeNum,
|
||||
secsleft, lfg::LFG_GROUP_KICK_VOTES_NEEDED, boot.reason.c_str());
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_BOOT_PROPOSAL_UPDATE {} inProgress: {} - "
|
||||
"didVote: {} - agree: {} - victim: {} votes: {} - agrees: {} - left: {} - "
|
||||
"needed: {} - reason {}",
|
||||
GetPlayerInfo(), uint8(boot.inProgress), uint8(playerVote != lfg::LFG_ANSWER_PENDING),
|
||||
uint8(playerVote == lfg::LFG_ANSWER_AGREE), boot.victim.ToString(), votesNum, agreeNum,
|
||||
secsleft, lfg::LFG_GROUP_KICK_VOTES_NEEDED, boot.reason);
|
||||
|
||||
WorldPackets::LFG::LfgBootPlayer lfgBootPlayer;
|
||||
lfgBootPlayer.Info.VoteInProgress = boot.inProgress;
|
||||
@@ -454,8 +454,8 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal)
|
||||
bool silent = !proposal.isNew && gguid == proposal.group;
|
||||
uint32 dungeonEntry = proposal.dungeonId;
|
||||
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PROPOSAL_UPDATE %s state: %u",
|
||||
GetPlayerInfo().c_str(), proposal.state);
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PROPOSAL_UPDATE {} state: {}",
|
||||
GetPlayerInfo(), proposal.state);
|
||||
|
||||
// show random dungeon if player selected random dungeon and it's not lfg group
|
||||
if (!silent)
|
||||
@@ -494,20 +494,20 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal)
|
||||
|
||||
void WorldSession::SendLfgDisabled()
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_DISABLED %s", GetPlayerInfo().c_str());
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_DISABLED {}", GetPlayerInfo());
|
||||
SendPacket(WorldPackets::LFG::LFGDisabled().Write());
|
||||
}
|
||||
|
||||
void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_OFFER_CONTINUE %s dungeon entry: %u",
|
||||
GetPlayerInfo().c_str(), dungeonEntry);
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_OFFER_CONTINUE {} dungeon entry: {}",
|
||||
GetPlayerInfo(), dungeonEntry);
|
||||
SendPacket(WorldPackets::LFG::LFGOfferContinue(sLFGMgr->GetLFGDungeonEntry(dungeonEntry)).Write());
|
||||
}
|
||||
|
||||
void WorldSession::SendLfgTeleportError(lfg::LfgTeleportResult err)
|
||||
{
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_TELEPORT_DENIED %s reason: %u",
|
||||
GetPlayerInfo().c_str(), err);
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_TELEPORT_DENIED {} reason: {}",
|
||||
GetPlayerInfo(), err);
|
||||
SendPacket(WorldPackets::LFG::LFGTeleportDenied(err).Write());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user