diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.cpp | 1 | ||||
-rw-r--r-- | src/server/game/DungeonFinding/LFGMgr.h | 18 | ||||
-rw-r--r-- | src/server/game/Server/Protocol/Handlers/LFGHandler.cpp | 11 |
3 files changed, 30 insertions, 0 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 79eb5a2b97a..d081ccc1a27 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -155,6 +155,7 @@ LFGMgr::~LFGMgr() m_QueueInfoMap.clear(); m_currentQueue.clear(); m_newToQueue.clear(); + m_JoinQueue.clear(); } /// <summary> diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 7903dff14d8..c5674e91d13 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -276,6 +276,23 @@ class LFGMgr LfgLockStatusSet* GetPlayerLockStatusDungeons(Player *plr, LfgDungeonSet *dungeons = NULL, bool useEntry = true); LfgReward const* GetRandomDungeonReward(uint32 dungeon, uint8 level); + bool isJoining(uint64 guid) + { + return m_JoinQueue.find(guid) != m_JoinQueue.end(); + }; + + void SetJoining(uint64 guid, bool add) + { + if (add) + m_JoinQueue.insert(guid); + else + { + LfgGuidSet::const_iterator it = m_JoinQueue.find(guid); + if (it != m_JoinQueue.end()) + m_JoinQueue.erase(it); + } + }; + private: void Cleaner(); void AddGuidToNewQueue(uint64 guid); @@ -306,6 +323,7 @@ class LFGMgr LfgQueueInfoMap m_QueueInfoMap; // Queued groups LfgGuidList m_currentQueue; // Ordered list. Used to find groups LfgGuidList m_newToQueue; // New groups to add to queue + LfgGuidSet m_JoinQueue; // Stores guids being joined (to avoid duplicate tries to join) LfgCompatibleMap m_CompatibleMap; // Compatible dungeons LfgProposalMap m_Proposals; // Current Proposals LfgPlayerBootMap m_Boots; // Current player kicks diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index 5e88c8dd661..f54eb74f5c7 100644 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -68,6 +68,15 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket &recv_data) return; } + if (sLFGMgr.isJoining(GetPlayer()->GetGUID())) + { + recv_data.rpos(recv_data.wpos()); + sLog.outDebug("CMSG_LFG_JOIN [" UI64FMTD "] already Joining. Ignoring", GetPlayer()->GetGUID()); + return; + } + + sLFGMgr.SetJoining(GetPlayer()->GetGUID(), true); + uint8 numDungeons; uint32 dungeon; uint32 roles; @@ -82,6 +91,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket &recv_data) { sLog.outDebug("CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); recv_data.rpos(recv_data.wpos()); + sLFGMgr.SetJoining(GetPlayer()->GetGUID(), false); return; } @@ -113,6 +123,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket &recv_data) sLog.outDebug("CMSG_LFG_JOIN [" UI64FMTD "] as group: %u - Dungeons: %u", GetPlayer()->GetGUID(), grp ? 1 : 0, uint8(newDungeons.size())); newDungeons.clear(); sLFGMgr.Join(GetPlayer()); + sLFGMgr.SetJoining(GetPlayer()->GetGUID(), false); } void WorldSession::HandleLfgLeaveOpcode(WorldPacket & /*recv_data*/) |