mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
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
This commit is contained in:
parent
3c38b4d3e6
commit
78a6d084bc
5 changed files with 22 additions and 1 deletions
|
|
@ -721,7 +721,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
|
||||
|
|
@ -1077,6 +1077,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()
|
||||
|
|
@ -1894,6 +1895,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;
|
||||
|
|
|
|||
|
|
@ -223,6 +223,7 @@ class BattleGroundMgr
|
|||
void InitAutomaticArenaPointDistribution();
|
||||
void DistributeArenaPoints();
|
||||
void ToggleArenaTesting();
|
||||
void ToggleTesting();
|
||||
|
||||
void LoadBattleMastersEntry();
|
||||
BattleGroundTypeId GetBattleMasterBG(uint32 entry) const
|
||||
|
|
@ -234,6 +235,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); }
|
||||
|
|
@ -249,6 +251,7 @@ class BattleGroundMgr
|
|||
uint64 m_NextAutoDistributionTime;
|
||||
uint32 m_AutoDistributionTimeChecker;
|
||||
bool m_ArenaTesting;
|
||||
bool m_Testing;
|
||||
};
|
||||
|
||||
#define sBattleGroundMgr MaNGOS::Singleton<BattleGroundMgr>::Instance()
|
||||
|
|
|
|||
|
|
@ -219,6 +219,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 }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -439,6 +439,7 @@ class ChatHandler
|
|||
bool HandleGetItemState(const char * args);
|
||||
bool HandleGetLootRecipient(const char * args);
|
||||
bool HandleDebugArenaCommand(const char * args);
|
||||
bool HandleDebugBattlegroundCommand(const char * args);
|
||||
bool HandleSpawnVehicle(const char * args);
|
||||
bool HandleSendLargePacketCommand(const char * args);
|
||||
|
||||
|
|
|
|||
|
|
@ -521,6 +521,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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue