feat(Core/Battleground): rework bg queue system (#10817)

This commit is contained in:
Kargatum
2022-03-16 00:36:49 +07:00
committed by GitHub
parent 6c60dc3841
commit 78bdc89881
29 changed files with 1354 additions and 963 deletions

View File

@@ -587,8 +587,6 @@ void WorldSession::LogoutPlayer(bool save)
for (int i = 0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
if (BattlegroundQueueTypeId bgQueueTypeId = _player->GetBattlegroundQueueTypeId(i))
{
_player->RemoveBattlegroundQueueId(bgQueueTypeId);
sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId).RemovePlayer(_player->GetGUID(), false, i);
// track if player logs out after invited to join BG
if (_player->IsInvitedForBattlegroundInstance())
{
@@ -599,8 +597,12 @@ void WorldSession::LogoutPlayer(bool save)
stmt->SetData(1, BG_DESERTION_TYPE_INVITE_LOGOUT);
CharacterDatabase.Execute(stmt);
}
sScriptMgr->OnBattlegroundDesertion(_player, BG_DESERTION_TYPE_INVITE_LOGOUT);
}
_player->RemoveBattlegroundQueueId(bgQueueTypeId);
sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId).RemovePlayer(_player->GetGUID(), true);
}
///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members