aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 79bd537e5b5..ec601717437 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -561,6 +561,7 @@ bool LFGMgr::RemoveFromQueue(uint64 guid)
/// <param name="Player*">Player</param>
void LFGMgr::Join(Player* plr)
{
+ LfgDungeonSet* dungeons = NULL;
Group* grp = plr->GetGroup();
if (grp && grp->GetLeaderGUID() != plr->GetGUID())
@@ -573,8 +574,12 @@ void LFGMgr::Join(Player* plr)
LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid);
if (itQueue != m_QueueInfoMap.end())
{
- sLog.outError("LFGMgr::Join: [" UI64FMTD "] trying to join but is already in queue! Forcing leave before readding", guid);
+ time_t now = time_t(time(NULL));
+ time_t joinTime = itQueue->second->joinTime;
+ uint32 diff = uint32(now - joinTime);
+ sLog.outError("LFGMgr::Join: [" UI64FMTD "] trying to join but is already in queue! diff %u (" UI64FMTD " - " UI64FMTD ")", guid, diff, uint64(now), uint64(joinTime));
Leave(plr, grp);
+ result = LFG_JOIN_INTERNAL_ERROR;
}
else if (plr->InBattleground() || plr->InArena() || plr->InBattlegroundQueue())
result = LFG_JOIN_USING_BG_SYSTEM;
@@ -584,15 +589,18 @@ void LFGMgr::Join(Player* plr)
result = LFG_JOIN_RANDOM_COOLDOWN;
else
{
- // Check if all dungeons are valid
- for (LfgDungeonSet::const_iterator it = plr->GetLfgDungeons()->begin(); it != plr->GetLfgDungeons()->end(); ++it)
- {
- if (!GetDungeonGroupType(*it))
+ dungeons = plr->GetLfgDungeons();
+ if (!dungeons || dungeons->size())
+ result = LFG_JOIN_NOT_MEET_REQS;
+ else // Check if all dungeons are valid
+ for (LfgDungeonSet::const_iterator it = dungeons->begin(); it != dungeons->end(); ++it)
{
- result = LFG_JOIN_DUNGEON_INVALID;
- break;
+ if (!GetDungeonGroupType(*it))
+ {
+ result = LFG_JOIN_DUNGEON_INVALID;
+ break;
+ }
}
- }
}
// Group checks
@@ -633,7 +641,6 @@ void LFGMgr::Join(Player* plr)
return;
}
- LfgDungeonSet* dungeons = NULL;
if (grp)
{
Player* plrg = NULL;
@@ -666,19 +673,17 @@ void LFGMgr::Join(Player* plr)
players.insert(plr);
dungeons = GetDungeonsByRandom(*plr->GetLfgDungeons()->begin());
playersLockMap = CheckCompatibleDungeons(dungeons, &players);
+ if (dungeons && !dungeons->size())
+ {
+ delete dungeons;
+ dungeons = NULL;
+ }
}
else
dungeons = plr->GetLfgDungeons();
if (!dungeons || !dungeons->size())
- {
- if (dungeons)
- {
- delete dungeons;
- dungeons = NULL;
- }
plr->GetSession()->SendLfgJoinResult(LFG_JOIN_NOT_MEET_REQS, 0, playersLockMap);
- }
else
{
plr->GetSession()->SendLfgJoinResult(LFG_JOIN_OK, 0);