Core/Dungeon Finder: Ignore multiple join queue petitions while joining
--HG-- branch : trunk
This commit is contained in:
@@ -155,6 +155,7 @@ LFGMgr::~LFGMgr()
|
||||
m_QueueInfoMap.clear();
|
||||
m_currentQueue.clear();
|
||||
m_newToQueue.clear();
|
||||
m_JoinQueue.clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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*/)
|
||||
|
||||
Reference in New Issue
Block a user