mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Dungeon Finder: Remove disconnected players from LFG queue
Fix LFG queue issues by removing disconnected players from LFG queue and their party with them.
This commit is contained in:
@@ -585,7 +585,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const
|
||||
|
||||
@param[in] guid Player or group guid
|
||||
*/
|
||||
void LFGMgr::LeaveLfg(ObjectGuid guid)
|
||||
void LFGMgr::LeaveLfg(ObjectGuid guid, bool disconnected)
|
||||
{
|
||||
ObjectGuid gguid = guid.IsGroup() ? guid : GetGroup(guid);
|
||||
|
||||
@@ -646,7 +646,7 @@ void LFGMgr::LeaveLfg(ObjectGuid guid)
|
||||
break;
|
||||
case LFG_STATE_DUNGEON:
|
||||
case LFG_STATE_FINISHED_DUNGEON:
|
||||
if (guid != gguid) // Player
|
||||
if (guid != gguid && !disconnected) // Player
|
||||
SetState(guid, LFG_STATE_NONE);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ class LFGMgr
|
||||
/// Join Lfg with selected roles, dungeons and comment
|
||||
void JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, std::string const& comment);
|
||||
/// Leaves lfg
|
||||
void LeaveLfg(ObjectGuid guid);
|
||||
void LeaveLfg(ObjectGuid guid, bool disconnected = false);
|
||||
|
||||
// LfgQueue
|
||||
/// Get last lfg state (NONE, DUNGEON or FINISHED_DUNGEON)
|
||||
|
||||
@@ -44,6 +44,8 @@ void LFGPlayerScript::OnLogout(Player* player)
|
||||
player->GetSession()->SendLfgLfrList(false);
|
||||
sLFGMgr->LeaveLfg(player->GetGUID());
|
||||
}
|
||||
else if (player->GetSession()->PlayerDisconnected())
|
||||
sLFGMgr->LeaveLfg(player->GetGUID(), true);
|
||||
}
|
||||
|
||||
void LFGPlayerScript::OnLogin(Player* player, bool /*loginFirst*/)
|
||||
|
||||
@@ -256,6 +256,7 @@ class WorldSession
|
||||
bool PlayerLogout() const { return m_playerLogout; }
|
||||
bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; }
|
||||
bool PlayerRecentlyLoggedOut() const { return m_playerRecentlyLogout; }
|
||||
bool PlayerDisconnected() const { return !m_Socket; }
|
||||
|
||||
void ReadAddonsInfo(WorldPacket& data);
|
||||
void SendAddonsInfo();
|
||||
|
||||
Reference in New Issue
Block a user