Allow Battlegrounds and arenas to be disabled by DB.
wtlk arenas disabled by default. - Player will continue to see all bgs using UI, but won't be able to join disabled bg's - Gossip menu not shown for disabled Bgs/arenas - Id 6 disabled = all arenas disabled. - Only id 6 arena enabled = Gossip shown but unable to join any arena --HG-- branch : trunk
This commit is contained in:
@@ -108,7 +108,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
||||
|
||||
if (!bg && !(bg = sBattleGroundMgr.GetBattleGroundTemplate(bgTypeId)))
|
||||
{
|
||||
sLog.outError("Battleground: no available bg / template found");
|
||||
SendBattleGroundOrArenaJoinError(BG_JOIN_ERR_BG_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -615,6 +615,12 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
||||
return;
|
||||
}
|
||||
|
||||
//check if any arena enabled
|
||||
if (!sBattleGroundMgr.isAnyArenaEnabled())
|
||||
{
|
||||
SendBattleGroundOrArenaJoinError(BG_JOIN_ERR_ARENA_DISABLED);
|
||||
return;
|
||||
}
|
||||
//check existance
|
||||
BattleGround* bg = sBattleGroundMgr.GetBattleGroundTemplate(BATTLEGROUND_AA);
|
||||
if (!bg)
|
||||
@@ -778,6 +784,12 @@ void WorldSession::SendBattleGroundOrArenaJoinError(uint8 err)
|
||||
case BG_JOIN_ERR_ALL_QUEUES_USED:
|
||||
msg = LANG_BG_GROUP_MEMBER_NO_FREE_QUEUE_SLOTS;
|
||||
break;
|
||||
case BG_JOIN_ERR_ARENA_DISABLED:
|
||||
msg = LANG_ARENA_DISABLED;
|
||||
break;
|
||||
case BG_JOIN_ERR_BG_DISABLED:
|
||||
msg = LANG_BG_DISABLED;
|
||||
break;
|
||||
case BG_JOIN_ERR_GROUP_NOT_ENOUGH:
|
||||
case BG_JOIN_ERR_MIXED_ARENATEAM:
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user