mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +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:
@@ -136,25 +136,25 @@ namespace lfg
|
||||
|
||||
if (!GetLFGDungeonEntry(dungeonId))
|
||||
{
|
||||
LOG_ERROR("lfg", "Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
|
||||
LOG_ERROR("lfg", "Dungeon {} specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!maxLevel || maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
LOG_ERROR("lfg", "Level %u specified for dungeon %u in table `lfg_dungeon_rewards` can never be reached!", maxLevel, dungeonId);
|
||||
LOG_ERROR("lfg", "Level {} specified for dungeon {} in table `lfg_dungeon_rewards` can never be reached!", maxLevel, dungeonId);
|
||||
maxLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||
}
|
||||
|
||||
if (!firstQuestId || !sObjectMgr->GetQuestTemplate(firstQuestId))
|
||||
{
|
||||
LOG_ERROR("lfg", "First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
|
||||
LOG_ERROR("lfg", "First quest {} specified for dungeon {} in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (otherQuestId && !sObjectMgr->GetQuestTemplate(otherQuestId))
|
||||
{
|
||||
LOG_ERROR("lfg", "Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
|
||||
LOG_ERROR("lfg", "Other quest {} specified for dungeon {} in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
|
||||
otherQuestId = 0;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace lfg
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} lfg dungeon rewards in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace lfg
|
||||
LFGDungeonContainer::iterator dungeonItr = LfgDungeonStore.find(dungeonId);
|
||||
if (dungeonItr == LfgDungeonStore.end())
|
||||
{
|
||||
LOG_ERROR("lfg", "table `lfg_dungeon_template` contains coordinates for wrong dungeon %u", dungeonId);
|
||||
LOG_ERROR("lfg", "table `lfg_dungeon_template` contains coordinates for wrong dungeon {}", dungeonId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace lfg
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server.loading", ">> Loaded %u lfg entrance positions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", ">> Loaded {} lfg entrance positions in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
// Fill all other teleport coords from areatriggers
|
||||
@@ -246,7 +246,7 @@ namespace lfg
|
||||
AreaTriggerTeleport const* at = sObjectMgr->GetMapEntranceTrigger(dungeon.map);
|
||||
if (!at)
|
||||
{
|
||||
LOG_ERROR("lfg", "LFGMgr::LoadLFGDungeons: Failed to load dungeon %s, cant find areatrigger for map %u", dungeon.name.c_str(), dungeon.map);
|
||||
LOG_ERROR("lfg", "LFGMgr::LoadLFGDungeons: Failed to load dungeon {}, cant find areatrigger for map {}", dungeon.name, dungeon.map);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ namespace lfg
|
||||
isRaid = true;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("lfg", "Wrong dungeon type %u for dungeon %u", type, *it);
|
||||
LOG_ERROR("lfg", "Wrong dungeon type {} for dungeon {}", type, *it);
|
||||
joinData.result = LFG_JOIN_DUNGEON_INVALID;
|
||||
break;
|
||||
}
|
||||
@@ -697,7 +697,7 @@ namespace lfg
|
||||
// Can't join. Send result
|
||||
if (joinData.result != LFG_JOIN_OK)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::Join: [%s] joining with %u members. result: %u", guid.ToString().c_str(), grp ? grp->GetMembersCount() : 1, joinData.result);
|
||||
LOG_DEBUG("lfg", "LFGMgr::Join: [{}] joining with {} members. result: {}", guid.ToString(), grp ? grp->GetMembersCount() : 1, joinData.result);
|
||||
if (!dungeons.empty()) // Only should show lockmap when have no dungeons available
|
||||
joinData.lockmap.clear();
|
||||
player->GetSession()->SendLfgJoinResult(joinData);
|
||||
@@ -788,7 +788,7 @@ namespace lfg
|
||||
std::ostringstream o;
|
||||
o << "LFGMgr::Join: [" << guid << "] joined (" << (grp ? "group" : "player") << ") Members: " << debugNames.c_str()
|
||||
<< ". Dungeons (" << uint32(dungeons.size()) << "): " << ConcatenateDungeons(dungeons);
|
||||
LOG_DEBUG("lfg", "%s", o.str().c_str());
|
||||
LOG_DEBUG("lfg", "{}", o.str());
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ namespace lfg
|
||||
*/
|
||||
void LFGMgr::LeaveLfg(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::Leave: [%s]", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::Leave: [{}]", guid.ToString());
|
||||
ObjectGuid gguid = guid.IsGroup() ? guid : GetGroup(guid);
|
||||
LfgState state = GetState(guid);
|
||||
switch (state)
|
||||
@@ -1798,7 +1798,7 @@ namespace lfg
|
||||
LfgProposalPlayer& player = itProposalPlayer->second;
|
||||
player.accept = LfgAnswer(accept);
|
||||
|
||||
LOG_DEBUG("lfg", "LFGMgr::UpdateProposal: Player [%s] of proposal %u selected: %u", guid.ToString().c_str(), proposalId, accept);
|
||||
LOG_DEBUG("lfg", "LFGMgr::UpdateProposal: Player [{}] of proposal {} selected: {}", guid.ToString(), proposalId, accept);
|
||||
if (!accept)
|
||||
{
|
||||
RemoveProposal(itProposal, LFG_UPDATETYPE_PROPOSAL_DECLINED);
|
||||
@@ -1889,7 +1889,7 @@ namespace lfg
|
||||
LfgProposal& proposal = itProposal->second;
|
||||
proposal.state = LFG_PROPOSAL_FAILED;
|
||||
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type);
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: Proposal {}, state FAILED, UpdateType {}", itProposal->first, type);
|
||||
// Mark all people that didn't answered as no accept
|
||||
if (type == LFG_UPDATETYPE_PROPOSAL_FAILED)
|
||||
for (LfgProposalPlayerContainer::iterator it = proposal.players.begin(); it != proposal.players.end(); ++it)
|
||||
@@ -1933,12 +1933,12 @@ namespace lfg
|
||||
if (it->second.accept == LFG_ANSWER_DENY)
|
||||
{
|
||||
updateData.updateType = type;
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: [%s] didn't accept. Removing from queue and compatible cache", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: [{}] didn't accept. Removing from queue and compatible cache", guid.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE;
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: [%s] in same group that someone that didn't accept. Removing from queue and compatible cache", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: [{}] in same group that someone that didn't accept. Removing from queue and compatible cache", guid.ToString());
|
||||
}
|
||||
|
||||
RestoreState(guid, "Proposal Fail (didn't accepted or in group with someone that didn't accept");
|
||||
@@ -1952,7 +1952,7 @@ namespace lfg
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: Readding [%s] to queue.", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: Readding [{}] to queue.", guid.ToString());
|
||||
SetState(guid, LFG_STATE_QUEUED);
|
||||
if (gguid != guid)
|
||||
{
|
||||
@@ -2161,8 +2161,8 @@ namespace lfg
|
||||
if (error != LFG_TELEPORTERROR_OK)
|
||||
player->GetSession()->SendLfgTeleportError(uint8(error));
|
||||
|
||||
//LOG_DEBUG("lfg", "TeleportPlayer: Player %s is being teleported in to map %u "
|
||||
// "(x: %f, y: %f, z: %f) Result: %u", player->GetName().c_str(), dungeon->map,
|
||||
//LOG_DEBUG("lfg", "TeleportPlayer: Player {} is being teleported in to map {} "
|
||||
// "(x: {}, y: {}, z: {}) Result: {}", player->GetName(), dungeon->map,
|
||||
// dungeon->x, dungeon->y, dungeon->z, error);
|
||||
}
|
||||
|
||||
@@ -2177,13 +2177,13 @@ namespace lfg
|
||||
uint32 gDungeonId = GetDungeon(gguid);
|
||||
if (gDungeonId != dungeonId)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [%s] Finished dungeon %u but group queued for %u. Ignoring", gguid.ToString().c_str(), dungeonId, gDungeonId);
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [{}] Finished dungeon {} but group queued for {}. Ignoring", gguid.ToString(), dungeonId, gDungeonId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetState(gguid) == LFG_STATE_FINISHED_DUNGEON) // Shouldn't happen. Do not reward multiple times
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [%s] Already rewarded group. Ignoring", gguid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [{}] Already rewarded group. Ignoring", gguid.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2196,7 +2196,7 @@ namespace lfg
|
||||
ObjectGuid guid = (*it);
|
||||
if (GetState(guid) == LFG_STATE_FINISHED_DUNGEON)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [%s] Already rewarded player. Ignoring", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [{}] Already rewarded player. Ignoring", guid.ToString());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2212,14 +2212,14 @@ namespace lfg
|
||||
|
||||
if (!dungeon || (dungeon->type != LFG_TYPE_RANDOM && !dungeon->seasonal))
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [%s] dungeon %u is not random or seasonal", guid.ToString().c_str(), rDungeonId);
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [{}] dungeon {} is not random or seasonal", guid.ToString(), rDungeonId);
|
||||
continue;
|
||||
}
|
||||
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
if (!player || player->FindMap() != currMap) // pussywizard: currMap - multithreading crash if on other map (map id check is not enough, binding system is not reliable)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [%s] not found in world", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [{}] not found in world", guid.ToString());
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2228,7 +2228,7 @@ namespace lfg
|
||||
|
||||
if (player->GetMapId() != mapId)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [%s] is in map %u and should be in %u to get reward", guid.ToString().c_str(), player->GetMapId(), mapId);
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [{}] is in map {} and should be in {} to get reward", guid.ToString(), player->GetMapId(), mapId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2266,7 +2266,7 @@ namespace lfg
|
||||
}
|
||||
|
||||
// Give rewards
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [%s] done dungeon %u, %s previously done.", player->GetGUID().ToString().c_str(), GetDungeon(gguid), done ? " " : " not");
|
||||
LOG_DEBUG("lfg", "LFGMgr::FinishDungeon: [{}] done dungeon {}, {} previously done.", player->GetGUID().ToString(), GetDungeon(gguid), done ? " " : " not");
|
||||
LfgPlayerRewardData data = LfgPlayerRewardData(dungeon->Entry(), GetDungeon(gguid, false), done, quest);
|
||||
player->GetSession()->SendLfgPlayerReward(data);
|
||||
}
|
||||
@@ -2334,7 +2334,7 @@ namespace lfg
|
||||
else
|
||||
state = PlayersStore[guid].GetState();
|
||||
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetState: [%s] = %u", guid.ToString().c_str(), state);
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetState: [{}] = {}", guid.ToString(), state);
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -2346,14 +2346,14 @@ namespace lfg
|
||||
else
|
||||
state = PlayersStore[guid].GetOldState();
|
||||
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetOldState: [%s] = %u", guid.ToString().c_str(), state);
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetOldState: [{}] = {}", guid.ToString(), state);
|
||||
return state;
|
||||
}
|
||||
|
||||
uint32 LFGMgr::GetDungeon(ObjectGuid guid, bool asId /*= true */)
|
||||
{
|
||||
uint32 dungeon = GroupsStore[guid].GetDungeon(asId);
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetDungeon: [%s] asId: %u = %u", guid.ToString().c_str(), asId, dungeon);
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetDungeon: [{}] asId: {} = {}", guid.ToString(), asId, dungeon);
|
||||
return dungeon;
|
||||
}
|
||||
|
||||
@@ -2365,39 +2365,39 @@ namespace lfg
|
||||
if (LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId))
|
||||
mapId = dungeon->map;
|
||||
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetDungeonMapId: [%s] = %u (DungeonId = %u)", guid.ToString().c_str(), mapId, dungeonId);
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetDungeonMapId: [{}] = {} (DungeonId = {})", guid.ToString(), mapId, dungeonId);
|
||||
return mapId;
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetRoles(ObjectGuid guid)
|
||||
{
|
||||
uint8 roles = PlayersStore[guid].GetRoles();
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetRoles: [%s] = %u", guid.ToString().c_str(), roles);
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetRoles: [{}] = {}", guid.ToString(), roles);
|
||||
return roles;
|
||||
}
|
||||
|
||||
const std::string& LFGMgr::GetComment(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetComment: [%s] = %s", guid.ToString().c_str(), PlayersStore[guid].GetComment().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetComment: [{}] = {}", guid.ToString(), PlayersStore[guid].GetComment());
|
||||
return PlayersStore[guid].GetComment();
|
||||
}
|
||||
|
||||
LfgDungeonSet const& LFGMgr::GetSelectedDungeons(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetSelectedDungeons: [%s]", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetSelectedDungeons: [{}]", guid.ToString());
|
||||
return PlayersStore[guid].GetSelectedDungeons();
|
||||
}
|
||||
|
||||
LfgLockMap const& LFGMgr::GetLockedDungeons(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetLockedDungeons: [%s]", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetLockedDungeons: [{}]", guid.ToString());
|
||||
return PlayersStore[guid].GetLockedDungeons();
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetKicksLeft(ObjectGuid guid)
|
||||
{
|
||||
uint8 kicks = GroupsStore[guid].GetKicksLeft();
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetKicksLeft: [%s] = %u", guid.ToString().c_str(), kicks);
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetKicksLeft: [{}] = {}", guid.ToString(), kicks);
|
||||
return kicks;
|
||||
}
|
||||
|
||||
@@ -2410,8 +2410,8 @@ namespace lfg
|
||||
{
|
||||
std::string const& ps = GetStateString(data.GetState());
|
||||
std::string const& os = GetStateString(data.GetOldState());
|
||||
LOG_TRACE("lfg", "LFGMgr::RestoreState: Group: [%s] (%s) State: %s, oldState: %s",
|
||||
guid.ToString().c_str(), debugMsg, ps.c_str(), os.c_str());
|
||||
LOG_TRACE("lfg", "LFGMgr::RestoreState: Group: [{}] ({}) State: {}, oldState: {}",
|
||||
guid.ToString(), debugMsg, ps, os);
|
||||
}*/
|
||||
|
||||
data.RestoreState();
|
||||
@@ -2423,8 +2423,8 @@ namespace lfg
|
||||
{
|
||||
std::string const& ps = GetStateString(data.GetState());
|
||||
std::string const& os = GetStateString(data.GetOldState());
|
||||
LOG_TRACE("lfg", "LFGMgr::RestoreState: Player: [%s] (%s) State: %s, oldState: %s",
|
||||
guid.ToString().c_str(), debugMsg, ps.c_str(), os.c_str());
|
||||
LOG_TRACE("lfg", "LFGMgr::RestoreState: Player: [{}] ({}) State: {}, oldState: {}",
|
||||
guid.ToString(), debugMsg, ps, os);
|
||||
}*/
|
||||
data.RestoreState();
|
||||
}
|
||||
@@ -2438,7 +2438,7 @@ namespace lfg
|
||||
std::string ns = GetStateString(state);
|
||||
std::string ps = GetStateString(data.GetState());
|
||||
std::string os = GetStateString(data.GetOldState());
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetState: Group: [%s] newState: %s, previous: %s, oldState: %s", guid.ToString().c_str(), ns.c_str(), ps.c_str(), os.c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetState: Group: [{}] newState: {}, previous: {}, oldState: {}", guid.ToString(), ns, ps, os);
|
||||
data.SetState(state);
|
||||
}
|
||||
else
|
||||
@@ -2447,7 +2447,7 @@ namespace lfg
|
||||
std::string ns = GetStateString(state);
|
||||
std::string ps = GetStateString(data.GetState());
|
||||
std::string os = GetStateString(data.GetOldState());
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetState: Player: [%s] newState: %s, previous: %s, oldState: %s", guid.ToString().c_str(), ns.c_str(), ps.c_str(), os.c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetState: Player: [{}] newState: {}, previous: {}, oldState: {}", guid.ToString(), ns, ps, os);
|
||||
data.SetState(state);
|
||||
}
|
||||
}
|
||||
@@ -2459,19 +2459,19 @@ namespace lfg
|
||||
|
||||
void LFGMgr::SetDungeon(ObjectGuid guid, uint32 dungeon)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetDungeon: [%s] dungeon %u", guid.ToString().c_str(), dungeon);
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetDungeon: [{}] dungeon {}", guid.ToString(), dungeon);
|
||||
GroupsStore[guid].SetDungeon(dungeon);
|
||||
}
|
||||
|
||||
void LFGMgr::SetRoles(ObjectGuid guid, uint8 roles)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetRoles: [%s] roles: %u", guid.ToString().c_str(), roles);
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetRoles: [{}] roles: {}", guid.ToString(), roles);
|
||||
PlayersStore[guid].SetRoles(roles);
|
||||
}
|
||||
|
||||
void LFGMgr::SetComment(ObjectGuid guid, std::string const& comment)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetComment: [%s] comment: %s", guid.ToString().c_str(), comment.c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetComment: [{}] comment: {}", guid.ToString(), comment);
|
||||
PlayersStore[guid].SetComment(comment);
|
||||
}
|
||||
|
||||
@@ -2490,25 +2490,25 @@ namespace lfg
|
||||
|
||||
void LFGMgr::SetSelectedDungeons(ObjectGuid guid, LfgDungeonSet const& dungeons)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetLockedDungeons: [%s]", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetLockedDungeons: [{}]", guid.ToString());
|
||||
PlayersStore[guid].SetSelectedDungeons(dungeons);
|
||||
}
|
||||
|
||||
void LFGMgr::SetLockedDungeons(ObjectGuid guid, LfgLockMap const& lock)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetLockedDungeons: [%s]", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetLockedDungeons: [{}]", guid.ToString());
|
||||
PlayersStore[guid].SetLockedDungeons(lock);
|
||||
}
|
||||
|
||||
void LFGMgr::DecreaseKicksLeft(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::DecreaseKicksLeft: [%s]", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::DecreaseKicksLeft: [{}]", guid.ToString());
|
||||
GroupsStore[guid].DecreaseKicksLeft();
|
||||
}
|
||||
|
||||
void LFGMgr::RemoveGroupData(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveGroupData: [%s]", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveGroupData: [{}]", guid.ToString());
|
||||
LfgGroupDataContainer::iterator it = GroupsStore.find(guid);
|
||||
if (it == GroupsStore.end())
|
||||
return;
|
||||
|
||||
@@ -36,20 +36,20 @@ namespace lfg
|
||||
|
||||
void LFGQueue::AddToQueue(ObjectGuid guid, bool failedProposal)
|
||||
{
|
||||
LOG_DEBUG("lfg", "ADD AddToQueue: %s, failed proposal: %u", guid.ToString().c_str(), failedProposal ? 1 : 0);
|
||||
LOG_DEBUG("lfg", "ADD AddToQueue: {}, failed proposal: {}", guid.ToString(), failedProposal ? 1 : 0);
|
||||
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
|
||||
if (itQueue == QueueDataStore.end())
|
||||
{
|
||||
LOG_ERROR("lfg", "LFGQueue::AddToQueue: Queue data not found for [%s]", guid.ToString().c_str());
|
||||
LOG_ERROR("lfg", "LFGQueue::AddToQueue: Queue data not found for [{}]", guid.ToString());
|
||||
return;
|
||||
}
|
||||
LOG_DEBUG("lfg", "AddToQueue success: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "AddToQueue success: {}", guid.ToString());
|
||||
AddToNewQueue(guid, failedProposal);
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveFromQueue(ObjectGuid guid, bool partial)
|
||||
{
|
||||
LOG_DEBUG("lfg", "REMOVE RemoveFromQueue: %s, partial: %u", guid.ToString().c_str(), partial ? 1 : 0);
|
||||
LOG_DEBUG("lfg", "REMOVE RemoveFromQueue: {}, partial: {}", guid.ToString(), partial ? 1 : 0);
|
||||
RemoveFromNewQueue(guid);
|
||||
RemoveFromCompatibles(guid);
|
||||
|
||||
@@ -60,13 +60,13 @@ namespace lfg
|
||||
{
|
||||
if (itr->second.bestCompatible.hasGuid(guid))
|
||||
{
|
||||
LOG_DEBUG("lfg", "CLEAR bestCompatible: %s, because of: %s", itr->second.bestCompatible.toString().c_str(), guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "CLEAR bestCompatible: {}, because of: {}", itr->second.bestCompatible.toString(), guid.ToString());
|
||||
itr->second.bestCompatible.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("lfg", "CLEAR bestCompatible SELF: %s, because of: %s", itr->second.bestCompatible.toString().c_str(), guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "CLEAR bestCompatible SELF: {}, because of: {}", itr->second.bestCompatible.toString(), guid.ToString());
|
||||
//itr->second.bestCompatible.clear(); // don't clear here, because UpdateQueueTimers will try to find with every diff update
|
||||
itDelete = itr;
|
||||
}
|
||||
@@ -75,10 +75,10 @@ namespace lfg
|
||||
// xinef: partial
|
||||
if (!partial && itDelete != QueueDataStore.end())
|
||||
{
|
||||
LOG_DEBUG("lfg", "ERASE QueueDataStore for: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "ERASE QueueDataStore for: %s, itDelete: %u,%u,%u", guid.ToString().c_str(), itDelete->second.dps, itDelete->second.healers, itDelete->second.tanks);
|
||||
LOG_DEBUG("lfg", "ERASE QueueDataStore for: {}", guid.ToString());
|
||||
LOG_DEBUG("lfg", "ERASE QueueDataStore for: {}, itDelete: {},{},{}", guid.ToString(), itDelete->second.dps, itDelete->second.healers, itDelete->second.tanks);
|
||||
QueueDataStore.erase(itDelete);
|
||||
LOG_DEBUG("lfg", "ERASE QueueDataStore for: %s SUCCESS", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "ERASE QueueDataStore for: {} SUCCESS", guid.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,34 +86,34 @@ namespace lfg
|
||||
{
|
||||
if (front)
|
||||
{
|
||||
LOG_DEBUG("lfg", "ADD AddToNewQueue at FRONT: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "ADD AddToNewQueue at FRONT: {}", guid.ToString());
|
||||
restoredAfterProposal.push_back(guid);
|
||||
newToQueueStore.push_front(guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("lfg", "ADD AddToNewQueue at the END: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "ADD AddToNewQueue at the END: {}", guid.ToString());
|
||||
newToQueueStore.push_back(guid);
|
||||
}
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveFromNewQueue(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "REMOVE RemoveFromNewQueue: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "REMOVE RemoveFromNewQueue: {}", guid.ToString());
|
||||
newToQueueStore.remove(guid);
|
||||
restoredAfterProposal.remove(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap)
|
||||
{
|
||||
LOG_DEBUG("lfg", "JOINED AddQueueData: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "JOINED AddQueueData: {}", guid.ToString());
|
||||
QueueDataStore[guid] = LfgQueueData(joinTime, dungeons, rolesMap);
|
||||
AddToQueue(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveQueueData(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LEFT RemoveQueueData: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LEFT RemoveQueueData: {}", guid.ToString());
|
||||
LfgQueueDataContainer::iterator it = QueueDataStore.find(guid);
|
||||
if (it != QueueDataStore.end())
|
||||
QueueDataStore.erase(it);
|
||||
@@ -149,11 +149,11 @@ namespace lfg
|
||||
|
||||
void LFGQueue::RemoveFromCompatibles(ObjectGuid guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "COMPATIBLES REMOVE for: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "COMPATIBLES REMOVE for: {}", guid.ToString());
|
||||
for (LfgCompatibleContainer::iterator it = CompatibleList.begin(); it != CompatibleList.end(); ++it)
|
||||
if (it->hasGuid(guid))
|
||||
{
|
||||
LOG_DEBUG("lfg", "Removed Compatible: %s, because of: %s", it->toString().c_str(), guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "Removed Compatible: {}, because of: {}", it->toString(), guid.ToString());
|
||||
it->clear(); // set to 0, this will be removed while iterating in FindNewGroups
|
||||
}
|
||||
for (LfgCompatibleContainer::iterator itr = CompatibleTempList.begin(); itr != CompatibleTempList.end(); )
|
||||
@@ -161,7 +161,7 @@ namespace lfg
|
||||
LfgCompatibleContainer::iterator it = itr++;
|
||||
if (it->hasGuid(guid))
|
||||
{
|
||||
LOG_DEBUG("lfg", "Erased Temp Compatible: %s, because of: %s", it->toString().c_str(), guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "Erased Temp Compatible: {}, because of: {}", it->toString(), guid.ToString());
|
||||
CompatibleTempList.erase(it);
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ namespace lfg
|
||||
|
||||
void LFGQueue::AddToCompatibles(Lfg5Guids const& key)
|
||||
{
|
||||
LOG_DEBUG("lfg", "COMPATIBLES ADD: %s", key.toString().c_str());
|
||||
LOG_DEBUG("lfg", "COMPATIBLES ADD: {}", key.toString());
|
||||
CompatibleTempList.push_back(key);
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace lfg
|
||||
++newGroupsProcessed;
|
||||
ObjectGuid newGuid = newToQueueStore.front();
|
||||
bool pushCompatiblesToFront = (std::find(restoredAfterProposal.begin(), restoredAfterProposal.end(), newGuid) != restoredAfterProposal.end());
|
||||
LOG_DEBUG("lfg", "newToQueueStore: %s, front: %u", newGuid.ToString().c_str(), pushCompatiblesToFront ? 1 : 0);
|
||||
LOG_DEBUG("lfg", "newToQueueStore: {}, front: {}", newGuid.ToString(), pushCompatiblesToFront ? 1 : 0);
|
||||
RemoveFromNewQueue(newGuid);
|
||||
|
||||
FindNewGroups(newGuid);
|
||||
@@ -202,7 +202,7 @@ namespace lfg
|
||||
uint64 foundMask = 0;
|
||||
uint32 foundCount = 0;
|
||||
|
||||
LOG_DEBUG("lfg", "FIND NEW GROUPS for: %s", newGuid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "FIND NEW GROUPS for: {}", newGuid.ToString());
|
||||
|
||||
// we have to take into account that FindNewGroups is called every X minutes if number of compatibles is low!
|
||||
// build set of already present compatibles for this guid
|
||||
@@ -246,7 +246,7 @@ namespace lfg
|
||||
|
||||
LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const ObjectGuid& newGuid, uint64& foundMask, uint32& foundCount, const std::set<Lfg5Guids>& currentCompatibles)
|
||||
{
|
||||
LOG_DEBUG("lfg", "CHECK CheckCompatibility: %s, new guid: %s", checkWith.toString().c_str(), newGuid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "CHECK CheckCompatibility: {}, new guid: {}", checkWith.toString(), newGuid.ToString());
|
||||
Lfg5Guids check(checkWith, false); // here newGuid is at front
|
||||
Lfg5Guids strGuids(checkWith, false); // here guids are sorted
|
||||
check.force_insert_front(newGuid);
|
||||
@@ -271,7 +271,7 @@ namespace lfg
|
||||
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
|
||||
if (itQueue == QueueDataStore.end())
|
||||
{
|
||||
LOG_ERROR("lfg", "LFGQueue::CheckCompatibility: [%s] is not queued but listed as queued!", guid.ToString().c_str());
|
||||
LOG_ERROR("lfg", "LFGQueue::CheckCompatibility: [{}] is not queued but listed as queued!", guid.ToString());
|
||||
RemoveFromQueue(guid);
|
||||
return LFG_COMPATIBILITY_PENDING;
|
||||
}
|
||||
@@ -325,7 +325,7 @@ namespace lfg
|
||||
if (itRoles->first == itPlayer->first)
|
||||
{
|
||||
// pussywizard: LFG this means that this player was in two different LfgQueueData (in QueueDataStore), and at least one of them is a group guid, because we do checks so there aren't 2 same guids in current CHECK
|
||||
//LOG_ERROR("lfg", "LFGQueue::CheckCompatibility: ERROR! Player multiple times in queue! [%s]", itRoles->first.ToString().c_str());
|
||||
//LOG_ERROR("lfg", "LFGQueue::CheckCompatibility: ERROR! Player multiple times in queue! [{}]", itRoles->first.ToString());
|
||||
break;
|
||||
}
|
||||
else if (sLFGMgr->HasIgnore(itRoles->first, itPlayer->first))
|
||||
@@ -586,7 +586,7 @@ namespace lfg
|
||||
|
||||
void LFGQueue::UpdateBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueue, Lfg5Guids const& key)
|
||||
{
|
||||
LOG_DEBUG("lfg", "UpdateBestCompatibleInQueue: %s", key.toString().c_str());
|
||||
LOG_DEBUG("lfg", "UpdateBestCompatibleInQueue: {}", key.toString());
|
||||
LfgQueueData& queueData = itrQueue->second;
|
||||
|
||||
uint8 storedSize = queueData.bestCompatible.size();
|
||||
|
||||
@@ -106,8 +106,8 @@ namespace lfg
|
||||
sLFGMgr->LeaveAllLfgQueues(player->GetGUID(), true);
|
||||
player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
|
||||
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, 0.0f);
|
||||
LOG_DEBUG("lfg", "LFGPlayerScript::OnMapChanged, Player %s (%s) is in LFG dungeon map but does not have a valid group! Teleporting to homebind.",
|
||||
player->GetName().c_str(), player->GetGUID().ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGPlayerScript::OnMapChanged, Player {} ({}) is in LFG dungeon map but does not have a valid group! Teleporting to homebind.",
|
||||
player->GetName(), player->GetGUID().ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -143,15 +143,15 @@ namespace lfg
|
||||
|
||||
if (leader == guid)
|
||||
{
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnAddMember [%s]: added [%s] leader [%s]", gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnAddMember [{}]: added [{}] leader [{}]", gguid.ToString(), guid.ToString(), leader.ToString());
|
||||
sLFGMgr->SetLeader(gguid, guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LfgState gstate = sLFGMgr->GetState(gguid);
|
||||
LfgState state = sLFGMgr->GetState(guid);
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnAddMember [%s]: added [%s] leader [%s] gstate: %u, state: %u",
|
||||
gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str(), gstate, state);
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnAddMember [{}]: added [{}] leader [{}] gstate: {}, state: {}",
|
||||
gguid.ToString(), guid.ToString(), leader.ToString(), gstate, state);
|
||||
|
||||
if (state == LFG_STATE_QUEUED)
|
||||
sLFGMgr->LeaveLfg(guid);
|
||||
@@ -184,8 +184,8 @@ namespace lfg
|
||||
return;
|
||||
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnRemoveMember [%s]: remove [%s] Method: %d Kicker: [%s] Reason: %s",
|
||||
gguid.ToString().c_str(), guid.ToString().c_str(), method, kicker.ToString().c_str(), (reason ? reason : ""));
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnRemoveMember [{}]: remove [{}] Method: {} Kicker: [{}] Reason: {}",
|
||||
gguid.ToString(), guid.ToString(), method, kicker.ToString(), (reason ? reason : ""));
|
||||
|
||||
bool isLFG = group->isLFGGroup();
|
||||
LfgState state = sLFGMgr->GetState(gguid);
|
||||
@@ -250,7 +250,7 @@ namespace lfg
|
||||
return;
|
||||
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnDisband [%s]", gguid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnDisband [{}]", gguid.ToString());
|
||||
|
||||
// pussywizard: after all necessary actions handle raid browser
|
||||
if (sLFGMgr->GetState(group->GetLeaderGUID()) == LFG_STATE_RAIDBROWSER)
|
||||
@@ -266,8 +266,8 @@ namespace lfg
|
||||
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnChangeLeader [%s]: old [%s] new [%s]",
|
||||
gguid.ToString().c_str(), newLeaderGuid.ToString().c_str(), oldLeaderGuid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnChangeLeader [{}]: old [{}] new [{}]",
|
||||
gguid.ToString(), newLeaderGuid.ToString(), oldLeaderGuid.ToString());
|
||||
sLFGMgr->SetLeader(gguid, newLeaderGuid);
|
||||
|
||||
// pussywizard: after all necessary actions handle raid browser
|
||||
@@ -285,7 +285,7 @@ namespace lfg
|
||||
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
ObjectGuid leader = group->GetLeaderGUID();
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnInviteMember [%s]: invite [%s] leader [%s]", gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnInviteMember [{}]: invite [{}] leader [{}]", gguid.ToString(), guid.ToString(), leader.ToString());
|
||||
// No gguid == new group being formed
|
||||
// No leader == after group creation first invite is new leader
|
||||
// leader and no gguid == first invite after leader is added to new group (this is the real invite)
|
||||
|
||||
Reference in New Issue
Block a user