mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
chore(Core/Logging): replace most server loggers (#5726)
* chore(Core/Logging): replace most server loggers Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
@@ -106,7 +106,7 @@ namespace lfg
|
||||
|
||||
if (!result)
|
||||
{
|
||||
LOG_ERROR("server", ">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!");
|
||||
LOG_ERROR("lfg", ">> Loaded 0 lfg dungeon rewards. DB table `lfg_dungeon_rewards` is empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -123,25 +123,25 @@ namespace lfg
|
||||
|
||||
if (!GetLFGDungeonEntry(dungeonId))
|
||||
{
|
||||
LOG_ERROR("server", "Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
|
||||
LOG_ERROR("lfg", "Dungeon %u specified in table `lfg_dungeon_rewards` does not exist!", dungeonId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!maxLevel || maxLevel > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
LOG_ERROR("server", "Level %u specified for dungeon %u in table `lfg_dungeon_rewards` can never be reached!", maxLevel, dungeonId);
|
||||
LOG_ERROR("lfg", "Level %u specified for dungeon %u 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("server", "First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
|
||||
LOG_ERROR("lfg", "First quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", firstQuestId, dungeonId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (otherQuestId && !sObjectMgr->GetQuestTemplate(otherQuestId))
|
||||
{
|
||||
LOG_ERROR("server", "Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
|
||||
LOG_ERROR("lfg", "Other quest %u specified for dungeon %u in table `lfg_dungeon_rewards` does not exist!", otherQuestId, dungeonId);
|
||||
otherQuestId = 0;
|
||||
}
|
||||
|
||||
@@ -149,8 +149,8 @@ namespace lfg
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server", ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Loaded %u lfg dungeon rewards in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
}
|
||||
|
||||
LFGDungeonData const* LFGMgr::GetLFGDungeon(uint32 id)
|
||||
@@ -192,8 +192,8 @@ namespace lfg
|
||||
|
||||
if (!result)
|
||||
{
|
||||
LOG_ERROR("server", ">> Loaded 0 lfg entrance positions. DB table `lfg_dungeon_template` is empty!");
|
||||
LOG_INFO("server", " ");
|
||||
LOG_ERROR("lfg", ">> Loaded 0 lfg entrance positions. DB table `lfg_dungeon_template` is empty!");
|
||||
LOG_INFO("server.loading", " ");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace lfg
|
||||
LFGDungeonContainer::iterator dungeonItr = LfgDungeonStore.find(dungeonId);
|
||||
if (dungeonItr == LfgDungeonStore.end())
|
||||
{
|
||||
LOG_ERROR("server", "table `lfg_dungeon_template` contains coordinates for wrong dungeon %u", dungeonId);
|
||||
LOG_ERROR("lfg", "table `lfg_dungeon_template` contains coordinates for wrong dungeon %u", dungeonId);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -219,8 +219,8 @@ namespace lfg
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
LOG_INFO("server", ">> Loaded %u lfg entrance positions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server", " ");
|
||||
LOG_INFO("server.loading", ">> Loaded %u lfg entrance positions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
LOG_INFO("server.loading", " ");
|
||||
|
||||
// Fill all other teleport coords from areatriggers
|
||||
for (LFGDungeonContainer::iterator itr = LfgDungeonStore.begin(); itr != LfgDungeonStore.end(); ++itr)
|
||||
@@ -233,7 +233,7 @@ namespace lfg
|
||||
AreaTriggerTeleport const* at = sObjectMgr->GetMapEntranceTrigger(dungeon.map);
|
||||
if (!at)
|
||||
{
|
||||
LOG_ERROR("server", "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 %s, cant find areatrigger for map %u", dungeon.name.c_str(), dungeon.map);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ namespace lfg
|
||||
isRaid = true;
|
||||
break;
|
||||
default:
|
||||
LOG_ERROR("server", "Wrong dungeon type %u for dungeon %u", type, *it);
|
||||
LOG_ERROR("lfg", "Wrong dungeon type %u for dungeon %u", type, *it);
|
||||
joinData.result = LFG_JOIN_DUNGEON_INVALID;
|
||||
break;
|
||||
}
|
||||
@@ -665,9 +665,7 @@ namespace lfg
|
||||
// Can't join. Send result
|
||||
if (joinData.result != LFG_JOIN_OK)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::Join: [%s] joining with %u members. result: %u", guid.ToString().c_str(), grp ? grp->GetMembersCount() : 1, joinData.result);
|
||||
#endif
|
||||
if (!dungeons.empty()) // Only should show lockmap when have no dungeons available
|
||||
joinData.lockmap.clear();
|
||||
player->GetSession()->SendLfgJoinResult(joinData);
|
||||
@@ -758,9 +756,7 @@ namespace lfg
|
||||
std::ostringstream o;
|
||||
o << "LFGMgr::Join: [" << guid << "] joined (" << (grp ? "group" : "player") << ") Members: " << debugNames.c_str()
|
||||
<< ". Dungeons (" << uint32(dungeons.size()) << "): " << ConcatenateDungeons(dungeons);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "%s", o.str().c_str());
|
||||
#endif
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -1664,9 +1660,7 @@ namespace lfg
|
||||
LfgProposalPlayer& player = itProposalPlayer->second;
|
||||
player.accept = LfgAnswer(accept);
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::UpdateProposal: Player [%s] of proposal %u selected: %u", guid.ToString().c_str(), proposalId, accept);
|
||||
#endif
|
||||
if (!accept)
|
||||
{
|
||||
RemoveProposal(itProposal, LFG_UPDATETYPE_PROPOSAL_DECLINED);
|
||||
@@ -1757,9 +1751,7 @@ namespace lfg
|
||||
LfgProposal& proposal = itProposal->second;
|
||||
proposal.state = LFG_PROPOSAL_FAILED;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type);
|
||||
#endif
|
||||
// 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)
|
||||
@@ -1803,16 +1795,12 @@ namespace lfg
|
||||
if (it->second.accept == LFG_ANSWER_DENY)
|
||||
{
|
||||
updateData.updateType = type;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: [%s] didn't accept. Removing from queue and compatible cache", guid.ToString().c_str());
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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());
|
||||
#endif
|
||||
}
|
||||
|
||||
RestoreState(guid, "Proposal Fail (didn't accepted or in group with someone that didn't accept");
|
||||
@@ -1826,9 +1814,7 @@ namespace lfg
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveProposal: Readding [%s] to queue.", guid.ToString().c_str());
|
||||
#endif
|
||||
SetState(guid, LFG_STATE_QUEUED);
|
||||
if (gguid != guid)
|
||||
{
|
||||
@@ -2211,9 +2197,7 @@ namespace lfg
|
||||
else
|
||||
state = PlayersStore[guid].GetState();
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetState: [%s] = %u", guid.ToString().c_str(), state);
|
||||
#endif
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -2225,18 +2209,14 @@ namespace lfg
|
||||
else
|
||||
state = PlayersStore[guid].GetOldState();
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetOldState: [%s] = %u", guid.ToString().c_str(), state);
|
||||
#endif
|
||||
return state;
|
||||
}
|
||||
|
||||
uint32 LFGMgr::GetDungeon(ObjectGuid guid, bool asId /*= true */)
|
||||
{
|
||||
uint32 dungeon = GroupsStore[guid].GetDungeon(asId);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetDungeon: [%s] asId: %u = %u", guid.ToString().c_str(), asId, dungeon);
|
||||
#endif
|
||||
return dungeon;
|
||||
}
|
||||
|
||||
@@ -2248,51 +2228,39 @@ namespace lfg
|
||||
if (LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId))
|
||||
mapId = dungeon->map;
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetDungeonMapId: [%s] = %u (DungeonId = %u)", guid.ToString().c_str(), mapId, dungeonId);
|
||||
#endif
|
||||
return mapId;
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetRoles(ObjectGuid guid)
|
||||
{
|
||||
uint8 roles = PlayersStore[guid].GetRoles();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetRoles: [%s] = %u", guid.ToString().c_str(), roles);
|
||||
#endif
|
||||
return roles;
|
||||
}
|
||||
|
||||
const std::string& LFGMgr::GetComment(ObjectGuid guid)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetComment: [%s] = %s", guid.ToString().c_str(), PlayersStore[guid].GetComment().c_str());
|
||||
#endif
|
||||
return PlayersStore[guid].GetComment();
|
||||
}
|
||||
|
||||
LfgDungeonSet const& LFGMgr::GetSelectedDungeons(ObjectGuid guid)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetSelectedDungeons: [%s]", guid.ToString().c_str());
|
||||
#endif
|
||||
return PlayersStore[guid].GetSelectedDungeons();
|
||||
}
|
||||
|
||||
LfgLockMap const& LFGMgr::GetLockedDungeons(ObjectGuid guid)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetLockedDungeons: [%s]", guid.ToString().c_str());
|
||||
#endif
|
||||
return PlayersStore[guid].GetLockedDungeons();
|
||||
}
|
||||
|
||||
uint8 LFGMgr::GetKicksLeft(ObjectGuid guid)
|
||||
{
|
||||
uint8 kicks = GroupsStore[guid].GetKicksLeft();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::GetKicksLeft: [%s] = %u", guid.ToString().c_str(), kicks);
|
||||
#endif
|
||||
return kicks;
|
||||
}
|
||||
|
||||
@@ -2354,25 +2322,19 @@ namespace lfg
|
||||
|
||||
void LFGMgr::SetDungeon(ObjectGuid guid, uint32 dungeon)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetDungeon: [%s] dungeon %u", guid.ToString().c_str(), dungeon);
|
||||
#endif
|
||||
GroupsStore[guid].SetDungeon(dungeon);
|
||||
}
|
||||
|
||||
void LFGMgr::SetRoles(ObjectGuid guid, uint8 roles)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetRoles: [%s] roles: %u", guid.ToString().c_str(), roles);
|
||||
#endif
|
||||
PlayersStore[guid].SetRoles(roles);
|
||||
}
|
||||
|
||||
void LFGMgr::SetComment(ObjectGuid guid, std::string const& comment)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetComment: [%s] comment: %s", guid.ToString().c_str(), comment.c_str());
|
||||
#endif
|
||||
PlayersStore[guid].SetComment(comment);
|
||||
}
|
||||
|
||||
@@ -2391,33 +2353,25 @@ namespace lfg
|
||||
|
||||
void LFGMgr::SetSelectedDungeons(ObjectGuid guid, LfgDungeonSet const& dungeons)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetLockedDungeons: [%s]", guid.ToString().c_str());
|
||||
#endif
|
||||
PlayersStore[guid].SetSelectedDungeons(dungeons);
|
||||
}
|
||||
|
||||
void LFGMgr::SetLockedDungeons(ObjectGuid guid, LfgLockMap const& lock)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::SetLockedDungeons: [%s]", guid.ToString().c_str());
|
||||
#endif
|
||||
PlayersStore[guid].SetLockedDungeons(lock);
|
||||
}
|
||||
|
||||
void LFGMgr::DecreaseKicksLeft(ObjectGuid guid)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::DecreaseKicksLeft: [%s]", guid.ToString().c_str());
|
||||
#endif
|
||||
GroupsStore[guid].DecreaseKicksLeft();
|
||||
}
|
||||
|
||||
void LFGMgr::RemoveGroupData(ObjectGuid guid)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGMgr::RemoveGroupData: [%s]", guid.ToString().c_str());
|
||||
#endif
|
||||
LfgGroupDataContainer::iterator it = GroupsStore.find(guid);
|
||||
if (it == GroupsStore.end())
|
||||
return;
|
||||
|
||||
@@ -25,23 +25,22 @@
|
||||
|
||||
namespace lfg
|
||||
{
|
||||
|
||||
void LFGQueue::AddToQueue(ObjectGuid guid, bool failedProposal)
|
||||
{
|
||||
//LOG_INFO("server", "ADD AddToQueue: %s, failed proposal: %u", guid.ToString().c_str(), failedProposal ? 1 : 0);
|
||||
LOG_DEBUG("lfg", "ADD AddToQueue: %s, failed proposal: %u", guid.ToString().c_str(), failedProposal ? 1 : 0);
|
||||
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
|
||||
if (itQueue == QueueDataStore.end())
|
||||
{
|
||||
LOG_ERROR("server", "LFGQueue::AddToQueue: Queue data not found for [%s]", guid.ToString().c_str());
|
||||
LOG_ERROR("lfg", "LFGQueue::AddToQueue: Queue data not found for [%s]", guid.ToString().c_str());
|
||||
return;
|
||||
}
|
||||
//LOG_INFO("server", "AddToQueue success: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "AddToQueue success: %s", guid.ToString().c_str());
|
||||
AddToNewQueue(guid, failedProposal);
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveFromQueue(ObjectGuid guid, bool partial)
|
||||
{
|
||||
//LOG_INFO("server", "REMOVE RemoveFromQueue: %s, partial: %u", guid.ToString().c_str(), partial ? 1 : 0);
|
||||
LOG_DEBUG("lfg", "REMOVE RemoveFromQueue: %s, partial: %u", guid.ToString().c_str(), partial ? 1 : 0);
|
||||
RemoveFromNewQueue(guid);
|
||||
RemoveFromCompatibles(guid);
|
||||
|
||||
@@ -52,13 +51,13 @@ namespace lfg
|
||||
{
|
||||
if (itr->second.bestCompatible.hasGuid(guid))
|
||||
{
|
||||
//LOG_INFO("server", "CLEAR bestCompatible: %s, because of: %s", itr->second.bestCompatible.toString().c_str(), guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "CLEAR bestCompatible: %s, because of: %s", itr->second.bestCompatible.toString().c_str(), guid.ToString().c_str());
|
||||
itr->second.bestCompatible.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//LOG_INFO("server", "CLEAR bestCompatible SELF: %s, because of: %s", itr->second.bestCompatible.toString().c_str(), guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "CLEAR bestCompatible SELF: %s, because of: %s", itr->second.bestCompatible.toString().c_str(), guid.ToString().c_str());
|
||||
//itr->second.bestCompatible.clear(); // don't clear here, because UpdateQueueTimers will try to find with every diff update
|
||||
itDelete = itr;
|
||||
}
|
||||
@@ -67,10 +66,10 @@ namespace lfg
|
||||
// xinef: partial
|
||||
if (!partial && itDelete != QueueDataStore.end())
|
||||
{
|
||||
//LOG_INFO("server", "ERASE QueueDataStore for: %s", guid.ToString().c_str());
|
||||
//LOG_INFO("server", "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: %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);
|
||||
QueueDataStore.erase(itDelete);
|
||||
//LOG_INFO("server", "ERASE QueueDataStore for: %s SUCCESS", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "ERASE QueueDataStore for: %s SUCCESS", guid.ToString().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,34 +77,34 @@ namespace lfg
|
||||
{
|
||||
if (front)
|
||||
{
|
||||
//LOG_INFO("server", "ADD AddToNewQueue at FRONT: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "ADD AddToNewQueue at FRONT: %s", guid.ToString().c_str());
|
||||
restoredAfterProposal.push_back(guid);
|
||||
newToQueueStore.push_front(guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
//LOG_INFO("server", "ADD AddToNewQueue at the END: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "ADD AddToNewQueue at the END: %s", guid.ToString().c_str());
|
||||
newToQueueStore.push_back(guid);
|
||||
}
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveFromNewQueue(ObjectGuid guid)
|
||||
{
|
||||
//LOG_INFO("server", "REMOVE RemoveFromNewQueue: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "REMOVE RemoveFromNewQueue: %s", guid.ToString().c_str());
|
||||
newToQueueStore.remove(guid);
|
||||
restoredAfterProposal.remove(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::AddQueueData(ObjectGuid guid, time_t joinTime, LfgDungeonSet const& dungeons, LfgRolesMap const& rolesMap)
|
||||
{
|
||||
//LOG_INFO("server", "JOINED AddQueueData: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "JOINED AddQueueData: %s", guid.ToString().c_str());
|
||||
QueueDataStore[guid] = LfgQueueData(joinTime, dungeons, rolesMap);
|
||||
AddToQueue(guid);
|
||||
}
|
||||
|
||||
void LFGQueue::RemoveQueueData(ObjectGuid guid)
|
||||
{
|
||||
//LOG_INFO("server", "LEFT RemoveQueueData: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "LEFT RemoveQueueData: %s", guid.ToString().c_str());
|
||||
LfgQueueDataContainer::iterator it = QueueDataStore.find(guid);
|
||||
if (it != QueueDataStore.end())
|
||||
QueueDataStore.erase(it);
|
||||
@@ -141,11 +140,11 @@ namespace lfg
|
||||
|
||||
void LFGQueue::RemoveFromCompatibles(ObjectGuid guid)
|
||||
{
|
||||
//LOG_INFO("server", "COMPATIBLES REMOVE for: %s", guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "COMPATIBLES REMOVE for: %s", guid.ToString().c_str());
|
||||
for (LfgCompatibleContainer::iterator it = CompatibleList.begin(); it != CompatibleList.end(); ++it)
|
||||
if (it->hasGuid(guid))
|
||||
{
|
||||
//LOG_INFO("server", "Removed Compatible: %s, because of: %s", it->toString().c_str(), guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "Removed Compatible: %s, because of: %s", it->toString().c_str(), guid.ToString().c_str());
|
||||
it->clear(); // set to 0, this will be removed while iterating in FindNewGroups
|
||||
}
|
||||
for (LfgCompatibleContainer::iterator itr = CompatibleTempList.begin(); itr != CompatibleTempList.end(); )
|
||||
@@ -153,7 +152,7 @@ namespace lfg
|
||||
LfgCompatibleContainer::iterator it = itr++;
|
||||
if (it->hasGuid(guid))
|
||||
{
|
||||
//LOG_INFO("server", "Erased Temp Compatible: %s, because of: %s", it->toString().c_str(), guid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "Erased Temp Compatible: %s, because of: %s", it->toString().c_str(), guid.ToString().c_str());
|
||||
CompatibleTempList.erase(it);
|
||||
}
|
||||
}
|
||||
@@ -161,20 +160,20 @@ namespace lfg
|
||||
|
||||
void LFGQueue::AddToCompatibles(Lfg5Guids const& key)
|
||||
{
|
||||
//LOG_INFO("server", "COMPATIBLES ADD: %s", key.toString().c_str());
|
||||
LOG_DEBUG("lfg", "COMPATIBLES ADD: %s", key.toString().c_str());
|
||||
CompatibleTempList.push_back(key);
|
||||
}
|
||||
|
||||
uint8 LFGQueue::FindGroups()
|
||||
{
|
||||
//LOG_INFO("server", "FIND GROUPS!");
|
||||
LOG_DEBUG("lfg", "FIND GROUPS!");
|
||||
uint8 newGroupsProcessed = 0;
|
||||
if (!newToQueueStore.empty())
|
||||
{
|
||||
++newGroupsProcessed;
|
||||
ObjectGuid newGuid = newToQueueStore.front();
|
||||
bool pushCompatiblesToFront = (std::find(restoredAfterProposal.begin(), restoredAfterProposal.end(), newGuid) != restoredAfterProposal.end());
|
||||
//LOG_INFO("server", "newToQueueStore: %s, front: %u", newGuid.ToString().c_str(), pushCompatiblesToFront ? 1 : 0);
|
||||
LOG_DEBUG("lfg", "newToQueueStore: %s, front: %u", newGuid.ToString().c_str(), pushCompatiblesToFront ? 1 : 0);
|
||||
RemoveFromNewQueue(newGuid);
|
||||
|
||||
FindNewGroups(newGuid);
|
||||
@@ -194,7 +193,7 @@ namespace lfg
|
||||
uint64 foundMask = 0;
|
||||
uint32 foundCount = 0;
|
||||
|
||||
//LOG_INFO("server", "FIND NEW GROUPS for: %s", newGuid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "FIND NEW GROUPS for: %s", newGuid.ToString().c_str());
|
||||
|
||||
// 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
|
||||
@@ -222,7 +221,7 @@ namespace lfg
|
||||
Lfg5GuidsList::iterator itr = it++;
|
||||
if (itr->empty())
|
||||
{
|
||||
//LOG_INFO("server", "ERASE from CompatibleList");
|
||||
LOG_DEBUG("lfg", "ERASE from CompatibleList");
|
||||
CompatibleList.erase(itr);
|
||||
continue;
|
||||
}
|
||||
@@ -238,7 +237,7 @@ namespace lfg
|
||||
|
||||
LfgCompatibility LFGQueue::CheckCompatibility(Lfg5Guids const& checkWith, const ObjectGuid& newGuid, uint64& foundMask, uint32& foundCount, const std::set<Lfg5Guids>& currentCompatibles)
|
||||
{
|
||||
//LOG_INFO("server", "CHECK CheckCompatibility: %s, new guid: %s", checkWith.toString().c_str(), newGuid.ToString().c_str());
|
||||
LOG_DEBUG("lfg", "CHECK CheckCompatibility: %s, new guid: %s", checkWith.toString().c_str(), newGuid.ToString().c_str());
|
||||
Lfg5Guids check(checkWith, false); // here newGuid is at front
|
||||
Lfg5Guids strGuids(checkWith, false); // here guids are sorted
|
||||
check.force_insert_front(newGuid);
|
||||
@@ -263,7 +262,7 @@ namespace lfg
|
||||
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(guid);
|
||||
if (itQueue == QueueDataStore.end())
|
||||
{
|
||||
LOG_ERROR("server", "LFGQueue::CheckCompatibility: [%s] is not queued but listed as queued!", guid.ToString().c_str());
|
||||
LOG_ERROR("lfg", "LFGQueue::CheckCompatibility: [%s] is not queued but listed as queued!", guid.ToString().c_str());
|
||||
RemoveFromQueue(guid);
|
||||
return LFG_COMPATIBILITY_PENDING;
|
||||
}
|
||||
@@ -317,7 +316,7 @@ namespace lfg
|
||||
if (itRoles->first == itPlayer->first)
|
||||
{
|
||||
// pussywizard: LFG ZOMG! 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("server", "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! [%s]", itRoles->first.ToString().c_str());
|
||||
break;
|
||||
}
|
||||
else if (sLFGMgr->HasIgnore(itRoles->first, itPlayer->first))
|
||||
@@ -453,13 +452,13 @@ namespace lfg
|
||||
else
|
||||
m_QueueStatusTimer += diff;
|
||||
|
||||
//LOG_INFO("server", "UPDATE UpdateQueueTimers");
|
||||
LOG_DEBUG("lfg", "UPDATE UpdateQueueTimers");
|
||||
for (Lfg5GuidsList::iterator it = CompatibleList.begin(); it != CompatibleList.end(); )
|
||||
{
|
||||
Lfg5GuidsList::iterator itr = it++;
|
||||
if (itr->empty())
|
||||
{
|
||||
//LOG_INFO("server", "UpdateQueueTimers ERASE compatible");
|
||||
LOG_DEBUG("lfg", "UpdateQueueTimers ERASE compatible");
|
||||
CompatibleList.erase(itr);
|
||||
}
|
||||
}
|
||||
@@ -527,7 +526,7 @@ namespace lfg
|
||||
|
||||
if (queueinfo.bestCompatible.empty())
|
||||
{
|
||||
//LOG_INFO("server", "found empty bestCompatible");
|
||||
LOG_DEBUG("lfg", "found empty bestCompatible");
|
||||
FindBestCompatibleInQueue(itQueue);
|
||||
}
|
||||
|
||||
@@ -559,7 +558,7 @@ namespace lfg
|
||||
|
||||
void LFGQueue::UpdateBestCompatibleInQueue(LfgQueueDataContainer::iterator itrQueue, Lfg5Guids const& key)
|
||||
{
|
||||
//LOG_INFO("server", "UpdateBestCompatibleInQueue: %s", key.toString().c_str());
|
||||
LOG_DEBUG("lfg", "UpdateBestCompatibleInQueue: %s", key.toString().c_str());
|
||||
LfgQueueData& queueData = itrQueue->second;
|
||||
|
||||
uint8 storedSize = queueData.bestCompatible.size();
|
||||
|
||||
@@ -65,8 +65,6 @@ namespace lfg
|
||||
ObjectGuid gguid2 = group->GetGUID();
|
||||
if (gguid != gguid2)
|
||||
{
|
||||
//LOG_ERROR("server", "%s on group %s but LFG has group %s saved... Fixing.",
|
||||
// player->GetSession()->GetPlayerInfo().c_str(), gguid2.ToString().c_str(), gguid.ToString().c_str());
|
||||
sLFGMgr->SetupGroupMember(guid, group->GetGUID());
|
||||
}
|
||||
}
|
||||
@@ -100,10 +98,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);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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());
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,19 +135,15 @@ namespace lfg
|
||||
|
||||
if (leader == guid)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnAddMember [%s]: added [%s] leader [%s]", gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str());
|
||||
#endif
|
||||
sLFGMgr->SetLeader(gguid, guid);
|
||||
}
|
||||
else
|
||||
{
|
||||
LfgState gstate = sLFGMgr->GetState(gguid);
|
||||
LfgState state = sLFGMgr->GetState(guid);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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);
|
||||
#endif
|
||||
|
||||
if (state == LFG_STATE_QUEUED)
|
||||
sLFGMgr->LeaveLfg(guid);
|
||||
@@ -184,10 +176,8 @@ namespace lfg
|
||||
return;
|
||||
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
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 : ""));
|
||||
#endif
|
||||
|
||||
bool isLFG = group->isLFGGroup();
|
||||
LfgState state = sLFGMgr->GetState(gguid);
|
||||
@@ -246,9 +236,7 @@ namespace lfg
|
||||
return;
|
||||
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnDisband [%s]", gguid.ToString().c_str());
|
||||
#endif
|
||||
|
||||
// pussywizard: after all necessary actions handle raid browser
|
||||
if (sLFGMgr->GetState(group->GetLeaderGUID()) == LFG_STATE_RAIDBROWSER)
|
||||
@@ -264,10 +252,8 @@ namespace lfg
|
||||
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnChangeLeader [%s]: old [%s] new [%s]",
|
||||
gguid.ToString().c_str(), newLeaderGuid.ToString().c_str(), oldLeaderGuid.ToString().c_str());
|
||||
#endif
|
||||
sLFGMgr->SetLeader(gguid, newLeaderGuid);
|
||||
|
||||
// pussywizard: after all necessary actions handle raid browser
|
||||
@@ -285,9 +271,7 @@ namespace lfg
|
||||
|
||||
ObjectGuid gguid = group->GetGUID();
|
||||
ObjectGuid leader = group->GetLeaderGUID();
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("lfg", "LFGScripts::OnInviteMember [%s]: invite [%s] leader [%s]", gguid.ToString().c_str(), guid.ToString().c_str(), leader.ToString().c_str());
|
||||
#endif
|
||||
// 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