TrinityCore
Loading...
Searching...
No Matches
BattlegroundMgr Class Reference

#include <BattlegroundMgr.h>

Classes

struct  ScheduledQueueUpdate
 

Public Member Functions

 BattlegroundMgr (BattlegroundMgr const &right)=delete
 
 BattlegroundMgr (BattlegroundMgr &&right)=delete
 
BattlegroundMgr & operator= (BattlegroundMgr const &right)=delete
 
BattlegroundMgr & operator= (BattlegroundMgr &&right)=delete
 
void Update (uint32 diff)
 
void SendBattlegroundList (Player *player, ObjectGuid const &guid, BattlegroundTypeId bgTypeId)
 
Battleground * GetBattleground (uint32 InstanceID, BattlegroundTypeId bgTypeId)
 
Battleground * CreateNewBattleground (BattlegroundQueueTypeId queueId, BattlegroundBracketId bracketId)
 
void AddBattleground (Battleground *bg)
 
void AddToBGFreeSlotQueue (Battleground *bg)
 
void RemoveFromBGFreeSlotQueue (uint32 mapId, uint32 instanceId)
 
BGFreeSlotQueueContainer & GetBGFreeSlotQueueStore (uint32 mapId)
 
void LoadBattlegroundTemplates ()
 
void DeleteAllBattlegrounds ()
 
BattlegroundQueue & GetBattlegroundQueue (BattlegroundQueueTypeId bgQueueTypeId)
 
void ScheduleQueueUpdate (uint32 arenaMatchmakerRating, BattlegroundQueueTypeId bgQueueTypeId, BattlegroundBracketId bracket_id)
 
uint32 GetPrematureFinishTime () const
 
bool ToggleArenaTesting (uint32 battlemasterListId)
 
void ToggleTesting ()
 
bool isArenaTesting () const
 
bool isTesting () const
 
uint32 GetMaxRatingDifference () const
 
uint32 GetRatingDiscardTimer () const
 
void LoadBattleMastersEntry ()
 
void CheckBattleMasters ()
 
BattlegroundTypeId GetBattleMasterBG (uint32 entry) const
 
BattlegroundTemplate const * GetBattlegroundTemplateByTypeId (BattlegroundTypeId id)
 
void LoadBattlegroundScriptTemplate ()
 
BattlegroundScriptTemplate const * FindBattlegroundScriptTemplate (uint32 mapId, BattlegroundTypeId bgTypeId) const
 

Static Public Member Functions

static BattlegroundMgr * instance ()
 
static void BuildBattlegroundStatusHeader (WorldPackets::Battleground::BattlefieldStatusHeader *header, Player const *player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId)
 
static void BuildBattlegroundStatusNone (WorldPackets::Battleground::BattlefieldStatusNone *battlefieldStatus, Player const *player, uint32 ticketId, uint32 joinTime)
 
static void BuildBattlegroundStatusNeedConfirmation (WorldPackets::Battleground::BattlefieldStatusNeedConfirmation *battlefieldStatus, Battleground const *bg, Player const *player, uint32 ticketId, uint32 joinTime, uint32 timeout, BattlegroundQueueTypeId queueId)
 
static void BuildBattlegroundStatusActive (WorldPackets::Battleground::BattlefieldStatusActive *battlefieldStatus, Battleground const *bg, Player const *player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId)
 
static void BuildBattlegroundStatusQueued (WorldPackets::Battleground::BattlefieldStatusQueued *battlefieldStatus, Player const *player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId, uint32 avgWaitTime, bool asGroup)
 
static void BuildBattlegroundStatusFailed (WorldPackets::Battleground::BattlefieldStatusFailed *battlefieldStatus, BattlegroundQueueTypeId queueId, Player const *player, uint32 ticketId, GroupJoinBattlegroundResult result, ObjectGuid const *errorGuid=nullptr)
 
static void SendToBattleground (Player *player, Battleground const *battleground)
 
static bool IsValidQueueId (BattlegroundQueueTypeId bgQueueTypeId)
 
static bool IsRandomBattleground (uint32 battlemasterListId)
 
static BattlegroundQueueTypeId BGQueueTypeId (uint16 battlemasterListId, BattlegroundQueueIdType type, bool rated, uint8 teamSize)
 
static HolidayIds BGTypeToWeekendHolidayId (BattlegroundTypeId bgTypeId)
 
static BattlegroundTypeId WeekendHolidayIdToBGType (HolidayIds holiday)
 
static bool IsBGWeekend (BattlegroundTypeId bgTypeId)
 
static void QueuePlayerForArena (Player const *player, uint8 teamSize, uint8 roles)
 

Private Types

typedef std::map< BattlegroundTypeId, BattlegroundData > BattlegroundDataContainer
 
typedef std::map< BattlegroundTypeId, BattlegroundTemplate > BattlegroundTemplateMap
 
typedef std::map< uint32, BattlegroundTemplate * > BattlegroundMapTemplateContainer
 

Private Member Functions

 BattlegroundMgr ()
 
 ~BattlegroundMgr ()
 
uint32 CreateClientVisibleInstanceId (BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id)
 
BattlegroundTypeId GetRandomBG (BattlegroundTypeId id)
 
BattlegroundTemplate const * GetBattlegroundTemplateByMapId (uint32 mapId)
 

Static Private Member Functions

static bool IsArenaType (BattlegroundTypeId bgTypeId)
 

Private Attributes

BattlegroundDataContainer bgDataStore
 
std::map< BattlegroundQueueTypeId, BattlegroundQueue > m_BattlegroundQueues
 
std::map< uint32, BGFreeSlotQueueContainer > m_BGFreeSlotQueue
 
std::vector< ScheduledQueueUpdate > m_QueueUpdateScheduler
 
uint32 m_NextRatedArenaUpdate
 
uint32 m_UpdateTimer
 
uint32 m_ArenaTesting
 
bool m_Testing
 
BattleMastersMap mBattleMastersMap
 
BattlegroundTemplateMap _battlegroundTemplates
 
BattlegroundMapTemplateContainer _battlegroundMapTemplates
 
std::map< std::pair< int32, uint32 >, BattlegroundScriptTemplate > _battlegroundScriptTemplates
 

Detailed Description

Definition at line 84 of file BattlegroundMgr.h.

Member Typedef Documentation

◆ BattlegroundDataContainer

◆ BattlegroundMapTemplateContainer

◆ BattlegroundTemplateMap

Constructor & Destructor Documentation

◆ BattlegroundMgr() [1/3]

BattlegroundMgr::BattlegroundMgr ( )
private

Definition at line 66 of file BattlegroundMgr.cpp.

◆ ~BattlegroundMgr()

BattlegroundMgr::~BattlegroundMgr ( )
private

Definition at line 71 of file BattlegroundMgr.cpp.

References DeleteAllBattlegrounds().

◆ BattlegroundMgr() [2/3]

BattlegroundMgr::BattlegroundMgr ( BattlegroundMgr const &  right)
delete

◆ BattlegroundMgr() [3/3]

BattlegroundMgr::BattlegroundMgr ( BattlegroundMgr &&  right)
delete

Member Function Documentation

◆ AddBattleground()

◆ AddToBGFreeSlotQueue()

void BattlegroundMgr::AddToBGFreeSlotQueue ( Battleground *  bg)

Definition at line 737 of file BattlegroundMgr.cpp.

References Battleground::GetMapId(), and m_BGFreeSlotQueue.

◆ BGQueueTypeId()

BattlegroundQueueTypeId BattlegroundMgr::BGQueueTypeId ( uint16  battlemasterListId,
BattlegroundQueueIdType  type,
bool  rated,
uint8  teamSize 
)
static

◆ BGTypeToWeekendHolidayId()

◆ BuildBattlegroundStatusActive()

◆ BuildBattlegroundStatusFailed()

◆ BuildBattlegroundStatusHeader()

◆ BuildBattlegroundStatusNeedConfirmation()

◆ BuildBattlegroundStatusNone()

◆ BuildBattlegroundStatusQueued()

◆ CheckBattleMasters()

void BattlegroundMgr::CheckBattleMasters ( )

◆ CreateClientVisibleInstanceId()

uint32 BattlegroundMgr::CreateClientVisibleInstanceId ( BattlegroundTypeId  bgTypeId,
BattlegroundBracketId  bracket_id 
)
private

Definition at line 317 of file BattlegroundMgr.cpp.

References bgDataStore, and IsArenaType().

Referenced by CreateNewBattleground().

◆ CreateNewBattleground()

◆ DeleteAllBattlegrounds()

void BattlegroundMgr::DeleteAllBattlegrounds ( )

Definition at line 76 of file BattlegroundMgr.cpp.

References bgDataStore, and m_BGFreeSlotQueue.

Referenced by ~BattlegroundMgr().

◆ FindBattlegroundScriptTemplate()

BattlegroundScriptTemplate const * BattlegroundMgr::FindBattlegroundScriptTemplate ( uint32  mapId,
BattlegroundTypeId  bgTypeId 
) const

◆ GetBattleground()

Battleground * BattlegroundMgr::GetBattleground ( uint32  InstanceID,
BattlegroundTypeId  bgTypeId 
)

Definition at line 224 of file BattlegroundMgr.cpp.

References BATTLEGROUND_TYPE_NONE, bgDataStore, and IsRandomBattleground().

◆ GetBattlegroundQueue()

BattlegroundQueue & BattlegroundMgr::GetBattlegroundQueue ( BattlegroundQueueTypeId  bgQueueTypeId)
inline

Definition at line 125 of file BattlegroundMgr.h.

Referenced by Update().

◆ GetBattlegroundTemplateByMapId()

BattlegroundTemplate const * BattlegroundMgr::GetBattlegroundTemplateByMapId ( uint32  mapId)
inlineprivate

Definition at line 195 of file BattlegroundMgr.h.

Referenced by GetRandomBG().

◆ GetBattlegroundTemplateByTypeId()

BattlegroundTemplate const * BattlegroundMgr::GetBattlegroundTemplateByTypeId ( BattlegroundTypeId  id)
inline

◆ GetBattleMasterBG()

BattlegroundTypeId BattlegroundMgr::GetBattleMasterBG ( uint32  entry) const
inline

Definition at line 147 of file BattlegroundMgr.h.

References BATTLEGROUND_TYPE_NONE.

◆ GetBGFreeSlotQueueStore()

BGFreeSlotQueueContainer & BattlegroundMgr::GetBGFreeSlotQueueStore ( uint32  mapId)

Definition at line 732 of file BattlegroundMgr.cpp.

References m_BGFreeSlotQueue.

◆ GetMaxRatingDifference()

uint32 BattlegroundMgr::GetMaxRatingDifference ( ) const

Definition at line 593 of file BattlegroundMgr.cpp.

References CONFIG_ARENA_MAX_RATING_DIFFERENCE, and sWorld.

◆ GetPrematureFinishTime()

uint32 BattlegroundMgr::GetPrematureFinishTime ( ) const

Definition at line 607 of file BattlegroundMgr.cpp.

References CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER, and sWorld.

◆ GetRandomBG()

◆ GetRatingDiscardTimer()

uint32 BattlegroundMgr::GetRatingDiscardTimer ( ) const

Definition at line 602 of file BattlegroundMgr.cpp.

References CONFIG_ARENA_RATING_DISCARD_TIMER, and sWorld.

◆ instance()

BattlegroundMgr * BattlegroundMgr::instance ( )
static

Definition at line 86 of file BattlegroundMgr.cpp.

References instance().

Referenced by instance().

◆ isArenaTesting()

bool BattlegroundMgr::isArenaTesting ( ) const
inline

Definition at line 133 of file BattlegroundMgr.h.

Referenced by GetRandomBG().

◆ IsArenaType()

bool BattlegroundMgr::IsArenaType ( BattlegroundTypeId  bgTypeId)
staticprivate

◆ IsBGWeekend()

bool BattlegroundMgr::IsBGWeekend ( BattlegroundTypeId  bgTypeId)
static

◆ IsRandomBattleground()

◆ isTesting()

bool BattlegroundMgr::isTesting ( ) const
inline

Definition at line 134 of file BattlegroundMgr.h.

◆ IsValidQueueId()

◆ LoadBattlegroundScriptTemplate()

◆ LoadBattlegroundTemplates()

◆ LoadBattleMastersEntry()

◆ operator=() [1/2]

BattlegroundMgr & BattlegroundMgr::operator= ( BattlegroundMgr &&  right)
delete

◆ operator=() [2/2]

BattlegroundMgr & BattlegroundMgr::operator= ( BattlegroundMgr const &  right)
delete

◆ QueuePlayerForArena()

◆ RemoveFromBGFreeSlotQueue()

void BattlegroundMgr::RemoveFromBGFreeSlotQueue ( uint32  mapId,
uint32  instanceId 
)

◆ ScheduleQueueUpdate()

void BattlegroundMgr::ScheduleQueueUpdate ( uint32  arenaMatchmakerRating,
BattlegroundQueueTypeId  bgQueueTypeId,
BattlegroundBracketId  bracket_id 
)

Definition at line 584 of file BattlegroundMgr.cpp.

References m_QueueUpdateScheduler.

◆ SendBattlegroundList()

◆ SendToBattleground()

◆ ToggleArenaTesting()

bool BattlegroundMgr::ToggleArenaTesting ( uint32  battlemasterListId)

◆ ToggleTesting()

void BattlegroundMgr::ToggleTesting ( )

Definition at line 518 of file BattlegroundMgr.cpp.

References LANG_DEBUG_BG_OFF, LANG_DEBUG_BG_ON, m_Testing, and sWorld.

◆ Update()

◆ WeekendHolidayIdToBGType()

Member Data Documentation

◆ _battlegroundMapTemplates

BattlegroundMapTemplateContainer BattlegroundMgr::_battlegroundMapTemplates
private

Definition at line 206 of file BattlegroundMgr.h.

Referenced by LoadBattlegroundTemplates().

◆ _battlegroundScriptTemplates

std::map<std::pair<int32, uint32>, BattlegroundScriptTemplate> BattlegroundMgr::_battlegroundScriptTemplates
private

◆ _battlegroundTemplates

BattlegroundTemplateMap BattlegroundMgr::_battlegroundTemplates
private

Definition at line 205 of file BattlegroundMgr.h.

Referenced by LoadBattlegroundScriptTemplate(), and LoadBattlegroundTemplates().

◆ bgDataStore

BattlegroundDataContainer BattlegroundMgr::bgDataStore
private

◆ m_ArenaTesting

uint32 BattlegroundMgr::m_ArenaTesting
private

Definition at line 191 of file BattlegroundMgr.h.

Referenced by GetRandomBG(), and ToggleArenaTesting().

◆ m_BattlegroundQueues

std::map<BattlegroundQueueTypeId, BattlegroundQueue> BattlegroundMgr::m_BattlegroundQueues
private

Definition at line 176 of file BattlegroundMgr.h.

Referenced by Update().

◆ m_BGFreeSlotQueue

std::map<uint32 , BGFreeSlotQueueContainer> BattlegroundMgr::m_BGFreeSlotQueue
private

◆ m_NextRatedArenaUpdate

uint32 BattlegroundMgr::m_NextRatedArenaUpdate
private

Definition at line 189 of file BattlegroundMgr.h.

Referenced by Update().

◆ m_QueueUpdateScheduler

std::vector<ScheduledQueueUpdate> BattlegroundMgr::m_QueueUpdateScheduler
private

Definition at line 188 of file BattlegroundMgr.h.

Referenced by ScheduleQueueUpdate(), and Update().

◆ m_Testing

bool BattlegroundMgr::m_Testing
private

Definition at line 192 of file BattlegroundMgr.h.

Referenced by ToggleTesting().

◆ m_UpdateTimer

uint32 BattlegroundMgr::m_UpdateTimer
private

Definition at line 190 of file BattlegroundMgr.h.

Referenced by Update().

◆ mBattleMastersMap

BattleMastersMap BattlegroundMgr::mBattleMastersMap
private

Definition at line 193 of file BattlegroundMgr.h.

Referenced by CheckBattleMasters(), and LoadBattleMastersEntry().


The documentation for this class was generated from the following files: