Core/Dungeon Finder: Improve ".lfg queue debug" command

Log roles of every combinations in ".lfg queue debug" output

(cherry picked from commit 16e9882aa8)
This commit is contained in:
jackpoz
2015-09-05 17:08:37 +02:00
committed by Carbenium
parent ee7039e845
commit 2f0079410d
2 changed files with 22 additions and 16 deletions

View File

@@ -72,7 +72,7 @@ char const* GetCompatibleString(LfgCompatibility compatibles)
case LFG_INCOMPATIBLES_NO_ROLES:
return "Incompatible roles";
case LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS:
return "Too much players";
return "Too many players";
case LFG_INCOMPATIBLES_WRONG_GROUP_SIZE:
return "Wrong group size";
default:
@@ -93,12 +93,7 @@ std::string LFGQueue::GetDetailedMatchRoles(GuidList const& check)
GuidSet::const_iterator it = guids.begin();
o << it->ToString();
LfgQueueDataContainer::iterator itQueue = QueueDataStore.find(*it);
if (itQueue == QueueDataStore.end())
{
TC_LOG_ERROR("lfg.queue.data.details", "Queue data not found for [%s]", it->ToString().c_str());
o << ' ' << GetRolesString(PLAYER_ROLE_NONE);
}
else
if (itQueue != QueueDataStore.end())
{
// skip leader flag, log only dps/tank/healer
o << ' ' << GetRolesString(itQueue->second.roles[*it] & uint8(~PLAYER_ROLE_LEADER));
@@ -108,12 +103,7 @@ std::string LFGQueue::GetDetailedMatchRoles(GuidList const& check)
{
o << '|' << it->ToString();
itQueue = QueueDataStore.find(*it);
if (itQueue == QueueDataStore.end())
{
TC_LOG_ERROR("lfg.queue.data.details", "Queue data not found for [%s]", it->ToString().c_str());
o << ' ' << GetRolesString(PLAYER_ROLE_NONE);
}
else
if (itQueue != QueueDataStore.end())
{
// skip leader flag, log only dps/tank/healer
o << ' ' << GetRolesString(itQueue->second.roles[*it] & uint8(~PLAYER_ROLE_LEADER));
@@ -438,7 +428,7 @@ LfgCompatibility LFGQueue::CheckCompatibility(GuidList check)
if (numPlayers > MAX_GROUP_SIZE)
{
TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Too much players (%u)", GetDetailedMatchRoles(check).c_str(), numPlayers);
TC_LOG_DEBUG("lfg.queue.match.compatibility.check", "Guids: (%s) Too many players (%u)", GetDetailedMatchRoles(check).c_str(), numPlayers);
SetCompatibles(strGuids, LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS);
return LFG_INCOMPATIBLES_TOO_MUCH_PLAYERS;
}
@@ -670,7 +660,23 @@ std::string LFGQueue::DumpCompatibleInfo(bool full /* = false */) const
o << "Compatible Map size: " << CompatibleMapStore.size() << "\n";
if (full)
for (LfgCompatibleContainer::const_iterator itr = CompatibleMapStore.begin(); itr != CompatibleMapStore.end(); ++itr)
o << "(" << itr->first << "): " << GetCompatibleString(itr->second.compatibility) << "\n";
{
o << "(" << itr->first << "): " << GetCompatibleString(itr->second.compatibility);
if (!itr->second.roles.empty())
{
o << " (";
bool first = true;
for (const auto& role : itr->second.roles)
{
if (!first)
o << "|";
o << role.first.GetRawValue() << " " << GetRolesString(role.second & uint8(~PLAYER_ROLE_LEADER));
first = false;
}
o << ")";
}
o << "\n";
}
return o.str();
}