Core/Battleground: Check battlegrounds disabled in db2 files

Port From (https://github.com/TrinityCore/TrinityCore/commit/5d57415951c4b6f7b86c97922c94b571a178f35a)
This commit is contained in:
hondacrx
2020-01-09 11:30:07 -05:00
parent 1a09ae3b69
commit 191d465eee
3 changed files with 18 additions and 6 deletions
+5 -5
View File
@@ -64,19 +64,19 @@ namespace Game
return;
}
uint bgTypeId_ = (uint)(battlemasterJoin.QueueIDs[0] & 0xFFFF);
if (!CliDB.BattlemasterListStorage.ContainsKey(bgTypeId_))
BattlegroundTypeId bgTypeId = (BattlegroundTypeId)(battlemasterJoin.QueueIDs[0] & 0xFFFF);
BattlemasterListRecord battlemasterListEntry = CliDB.BattlemasterListStorage.LookupByKey(bgTypeId);
if (battlemasterListEntry == null)
{
Log.outError(LogFilter.Network, "Battleground: invalid bgtype ({0}) received. possible cheater? player guid {1}", bgTypeId_, GetPlayer().GetGUID().ToString());
Log.outError(LogFilter.Network, "Battleground: invalid bgtype ({0}) received. possible cheater? player guid {1}", bgTypeId, GetPlayer().GetGUID().ToString());
return;
}
if (Global.DisableMgr.IsDisabledFor(DisableType.Battleground, bgTypeId_, null))
if (Global.DisableMgr.IsDisabledFor(DisableType.Battleground, (uint)bgTypeId, null) || battlemasterListEntry.Flags.HasAnyFlag(BattlemasterListFlags.Disabled))
{
GetPlayer().SendSysMessage(CypherStrings.BgDisabled);
return;
}
BattlegroundTypeId bgTypeId = (BattlegroundTypeId)bgTypeId_;
// can do this, since it's Battleground, not arena
BattlegroundQueueTypeId bgQueueTypeId = Global.BattlegroundMgr.BGQueueTypeId(bgTypeId, 0);