Core/Battlegrounds: Rework queues

* No more copies of Battleground classes
* FreesSlotQueues now have as key the MapId instead of queue id
* Random queues can now popup already busy specific battelgrounds (queues are NOT merged)
* Removed Holiday handling, this should already be handled in BattlegroundMgr::IsBGWeekend
Port From (https://github.com/TrinityCore/TrinityCore/commit/0ede6c155605da602b3bafaa3a1212d9f924759b)
This commit is contained in:
hondacrx
2023-09-14 06:16:30 -04:00
parent bad3e89ee6
commit 4134796f1b
35 changed files with 364 additions and 418 deletions
+6 -21
View File
@@ -1,25 +1,10 @@
/*
* Copyright (C) 2012-2016 CypherCore <http://github.com/CypherCore>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
using Game.Entities;
using Framework.Constants;
using System.Collections.Generic;
using Game.Entities;
using Game.Networking.Packets;
using Game.DataStorage;
using System.Collections.Generic;
namespace Game.BattleGrounds.Zones
{
@@ -367,10 +352,10 @@ namespace Game.BattleGrounds.Zones
}
}
public override void AddPlayer(Player player)
public override void AddPlayer(Player player, BattlegroundQueueTypeId queueId)
{
bool isInBattleground = IsPlayerInBattleground(player.GetGUID());
base.AddPlayer(player);
base.AddPlayer(player, queueId);
if (!isInBattleground)
PlayerScores[player.GetGUID()] = new BgEyeOfStormScore(player.GetGUID(), player.GetBGTeam());