aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy <Golrag@users.noreply.github.com>2019-12-15 12:43:33 +0100
committerShauren <shauren.trinity@gmail.com>2019-12-15 12:43:33 +0100
commit5d57415951c4b6f7b86c97922c94b571a178f35a (patch)
treeb3fedc391f679231f29e4ea3d8caa62f26da8e3b
parent4cfaf266b9e15032e7fd6c75d526d6df797d715e (diff)
Core/Battleground: Check battlegrounds disabled in db2 files (#23924)
* Name BattlemasterList flags
-rw-r--r--src/server/game/DataStores/DBCEnums.h11
-rw-r--r--src/server/game/Handlers/BattleGroundHandler.cpp5
2 files changed, 14 insertions, 2 deletions
diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h
index 04c5be7834f..ff714478aea 100644
--- a/src/server/game/DataStores/DBCEnums.h
+++ b/src/server/game/DataStores/DBCEnums.h
@@ -185,6 +185,17 @@ enum AzeriteTierUnlockSetFlags
#define BATTLE_PET_SPECIES_MAX_ID 2796
+enum BattlemasterListFlags
+{
+ BATTLEMASTER_LIST_FLAG_DISABLED = 0x01,
+ BATTLEMASTER_LIST_FLAG_SKIP_ROLE_CHECK = 0x02,
+ BATTLEMASTER_LIST_FLAG_UNK04 = 0x04,
+ BATTLEMASTER_LIST_FLAG_CAN_INIT_WAR_GAME = 0x08,
+ BATTLEMASTER_LIST_FLAG_CAN_SPECIFIC_QUEUE = 0x10,
+ BATTLEMASTER_LIST_FLAG_BRAWL = 0x20,
+ BATTLEMASTER_LIST_FLAG_FACTIONAL = 0x40
+};
+
enum ChrSpecializationFlag
{
CHR_SPECIALIZATION_FLAG_CASTER = 0x01,
diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp
index b02e7c052c6..7c095a75ed9 100644
--- a/src/server/game/Handlers/BattleGroundHandler.cpp
+++ b/src/server/game/Handlers/BattleGroundHandler.cpp
@@ -71,13 +71,14 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
}
uint32 bgTypeId_ = battlemasterJoin.QueueIDs[0] & 0xFFFF;
- if (!sBattlemasterListStore.LookupEntry(bgTypeId_))
+ BattlemasterListEntry const* battlemasterListEntry = sBattlemasterListStore.LookupEntry(bgTypeId_);
+ if (!battlemasterListEntry)
{
TC_LOG_ERROR("network", "Battleground: invalid bgtype (%u) received. possible cheater? %s", bgTypeId_, _player->GetGUID().ToString().c_str());
return;
}
- if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId_, NULL))
+ if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId_, NULL) || (battlemasterListEntry->Flags & BATTLEMASTER_LIST_FLAG_DISABLED) != 0)
{
ChatHandler(this).PSendSysMessage(LANG_BG_DISABLED);
return;