*add .debug bg to allow starting a battleground with just one player it's implemented like .debug arena - so you toggle debug bg on or off By balrok

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-10 00:39:03 -06:00
parent d696381f32
commit 7f39dbd848
8 changed files with 30 additions and 9 deletions
+11 -1
View File
@@ -675,7 +675,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, uint32 queue_id, uin
sLog.outDebug("Battleground: horde pool wasn't created");
// if selection pools are ready, create the new bg
if (bAllyOK && bHordeOK)
if ((bAllyOK && bHordeOK) || ( sBattleGroundMgr.isTesting() && (bAllyOK || bHordeOK)))
{
BattleGround * bg2 = 0;
// special handling for arenas
@@ -1031,6 +1031,7 @@ BattleGroundMgr::BattleGroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe
{
m_BattleGrounds.clear();
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
m_Testing=false;
}
BattleGroundMgr::~BattleGroundMgr()
@@ -1848,6 +1849,15 @@ uint8 BattleGroundMgr::BGArenaType(uint32 bgQueueTypeId)
}
}
void BattleGroundMgr::ToggleTesting()
{
m_Testing = !m_Testing;
if(m_Testing)
sWorld.SendGlobalText("Battlegrounds are set to 1v0 for debugging.", NULL);
else
sWorld.SendGlobalText("Battlegrounds are set to normal playercount.", NULL);
}
void BattleGroundMgr::ToggleArenaTesting()
{
m_ArenaTesting = !m_ArenaTesting;
+3
View File
@@ -224,6 +224,7 @@ class BattleGroundMgr
void InitAutomaticArenaPointDistribution();
void DistributeArenaPoints();
void ToggleArenaTesting();
void ToggleTesting();
void SetHolidayWeekends(uint32 mask);
void LoadBattleMastersEntry();
@@ -236,6 +237,7 @@ class BattleGroundMgr
}
bool isArenaTesting() const { return m_ArenaTesting; }
bool isTesting() const { return m_Testing; }
static bool IsArenaType(BattleGroundTypeId bgTypeId);
static bool IsBattleGroundType(BattleGroundTypeId bgTypeId) { return !BattleGroundMgr::IsArenaType(bgTypeId); }
@@ -251,6 +253,7 @@ class BattleGroundMgr
uint64 m_NextAutoDistributionTime;
uint32 m_AutoDistributionTimeChecker;
bool m_ArenaTesting;
bool m_Testing;
};
#define sBattleGroundMgr Trinity::Singleton<BattleGroundMgr>::Instance()
+1
View File
@@ -226,6 +226,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "anim", SEC_GAMEMASTER, false, &ChatHandler::HandleAnimCommand, "", NULL },
{ "lootrecipient", SEC_GAMEMASTER, false, &ChatHandler::HandleGetLootRecipient, "", NULL },
{ "arena", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugArenaCommand, "", NULL },
{ "bg", SEC_ADMINISTRATOR, false, &ChatHandler::HandleDebugBattlegroundCommand, "", NULL },
{ "sendlargepacket",SEC_ADMINISTRATOR, false, &ChatHandler::HandleSendLargePacketCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
+1
View File
@@ -496,6 +496,7 @@ class ChatHandler
bool HandleUnPossessCommand(const char* args);
bool HandleBindSightCommand(const char* args);
bool HandleUnbindSightCommand(const char* args);
bool HandleDebugBattlegroundCommand(const char * args);
bool HandleSpawnVehicle(const char * args);
bool HandleSendLargePacketCommand(const char * args);
+6
View File
@@ -535,6 +535,12 @@ bool ChatHandler::HandleGetItemState(const char* args)
return true;
}
bool ChatHandler::HandleDebugBattlegroundCommand(const char * /*args*/)
{
sBattleGroundMgr.ToggleTesting();
return true;
}
bool ChatHandler::HandleDebugArenaCommand(const char * /*args*/)
{
sBattleGroundMgr.ToggleArenaTesting();