Added global disable system and moved all disable fields/tables/configs into it

NOTE: instance disables were not converted for new system! if you had some then you need to fix that using new system

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-07-21 12:14:23 +02:00
parent 0bda7fd361
commit 6a539270ec
23 changed files with 435 additions and 258 deletions
@@ -34,6 +34,7 @@
#include "Player.h"
#include "Object.h"
#include "Opcodes.h"
#include "DisableMgr.h"
void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data)
{
@@ -90,6 +91,12 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data)
return;
}
if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId_, NULL))
{
ChatHandler(this).PSendSysMessage(LANG_BG_DISABLED);
return;
}
BattleGroundTypeId bgTypeId = BattleGroundTypeId(bgTypeId_);
sLog.outDebug("WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)));
@@ -659,6 +666,12 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data)
return;
}
if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, BATTLEGROUND_AA, NULL))
{
ChatHandler(this).PSendSysMessage(LANG_ARENA_DISABLED);
return;
}
BattleGroundTypeId bgTypeId = bg->GetTypeID();
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(bgTypeId, arenatype);
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel());