From 0f4f00c5927624fa7bf69c718e1f01d2bf6be5cd Mon Sep 17 00:00:00 2001 From: Spp Date: Thu, 16 Sep 2010 18:54:36 +0200 Subject: Core/Dungeon Finder: Extend error info about duplicate player in queue --HG-- branch : trunk --- src/server/game/DungeonFinding/LFGMgr.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 713b446a230..79eb5a2b97a 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -914,13 +914,35 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposalList *proposals) // Assign new leader if (itRoles->second & ROLE_LEADER && (!newLeaderLowGuid || urand(0, 1))) newLeaderLowGuid = itRoles->first; + if (rolesMap[itRoles->first]) // Player already added! + { + // Find the other guid + uint64 guid1 = it->first; + uint64 guid2 = 0; + for (LfgQueueInfoMap::const_iterator it2 = pqInfoMap.begin(); it2 != it && !guid2; ++it2) + { + if (it2->second->roles.find(itRoles->first) != it2->second->roles.end()) + guid2 = it2->first; + } + uint64 playerguid; + + // store in guid2 the obsolete group + if (pqInfoMap[guid2]->joinTime > it->second->joinTime) + { + playerguid = guid2; + guid2 = guid1; + guid1 = playerguid; + } + playerguid = MAKE_NEW_GUID(itRoles->first, 0, HIGHGUID_PLAYER); + sLog.outError("LFGMgr::CheckCompatibility: check(%s) player [" UI64FMTD "] in queue with [" UI64FMTD "] and OBSOLETE! [" UI64FMTD "]", + strGuids.c_str(), playerguid, guid1, guid2); + } rolesMap[itRoles->first] = itRoles->second; } } if (rolesMap.size() != numPlayers) { - sLog.outError("LFGMgr::CheckCompatibility: There is a player multiple times in queue."); pqInfoMap.clear(); rolesMap.clear(); return false; -- cgit v1.2.3