Battleground/Arena: Properly check RBAC arena join permission before allowing queue.

Port From (https://github.com/TrinityCore/TrinityCore/commit/a69a061d76fe4e142e84c775230e2fcbd6ddb9d4)
This commit is contained in:
hondacrx
2021-12-27 17:06:18 -05:00
parent cba0f64c2d
commit c209f30475
3 changed files with 31 additions and 17 deletions
+4 -1
View File
@@ -1825,6 +1825,9 @@ namespace Game.Groups
// offline member? don't let join
if (!member)
return GroupJoinBattlegroundResult.JoinFailed;
// rbac permissions
if (!member.CanJoinToBattleground(bgOrTemplate))
return GroupJoinBattlegroundResult.JoinTimedOut;
// don't allow cross-faction join as group
if (member.GetTeam() != team)
{
@@ -1850,7 +1853,7 @@ namespace Game.Groups
if ((bgOrTemplate.GetTypeID() == BattlegroundTypeId.RB || bgOrTemplate.GetTypeID() == BattlegroundTypeId.RandomEpic) && member.InBattlegroundQueue(true) && !isInRandomBgQueue)
return GroupJoinBattlegroundResult.InNonRandomBg;
// check for deserter debuff in case not arena queue
if (bgOrTemplate.GetTypeID() != BattlegroundTypeId.AA && !member.CanJoinToBattleground(bgOrTemplate))
if (bgOrTemplate.GetTypeID() != BattlegroundTypeId.AA && member.IsDeserter())
return GroupJoinBattlegroundResult.Deserters;
// check if member can join any more Battleground queues
if (!member.HasFreeBattlegroundQueueId())