TrinityCore
BattlegroundMgr Class Reference

#include <BattlegroundMgr.h>

Classes

struct  ScheduledQueueUpdate
 

Public Member Functions

 BattlegroundMgr (BattlegroundMgr const &right)=delete
 
 BattlegroundMgr (BattlegroundMgr &&right)=delete
 
BattlegroundMgroperator= (BattlegroundMgr const &right)=delete
 
BattlegroundMgroperator= (BattlegroundMgr &&right)=delete
 
void Update (uint32 diff)
 
void SendBattlegroundList (Player *player, ObjectGuid const &guid, BattlegroundTypeId bgTypeId)
 
void BuildBattlegroundStatusHeader (WorldPackets::Battleground::BattlefieldStatusHeader *battlefieldStatus, Player *player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId)
 
void BuildBattlegroundStatusNone (WorldPackets::Battleground::BattlefieldStatusNone *battlefieldStatus, Player *player, uint32 ticketId, uint32 joinTime)
 
void BuildBattlegroundStatusNeedConfirmation (WorldPackets::Battleground::BattlefieldStatusNeedConfirmation *battlefieldStatus, Battleground *bg, Player *player, uint32 ticketId, uint32 joinTime, uint32 timeout, BattlegroundQueueTypeId queueId)
 
void BuildBattlegroundStatusActive (WorldPackets::Battleground::BattlefieldStatusActive *battlefieldStatus, Battleground *bg, Player *player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId)
 
void BuildBattlegroundStatusQueued (WorldPackets::Battleground::BattlefieldStatusQueued *battlefieldStatus, Player *player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId, uint32 avgWaitTime, bool asGroup)
 
void BuildBattlegroundStatusFailed (WorldPackets::Battleground::BattlefieldStatusFailed *battlefieldStatus, BattlegroundQueueTypeId queueId, Player *pPlayer, uint32 ticketId, GroupJoinBattlegroundResult result, ObjectGuid const *errorGuid=nullptr)
 
BattlegroundGetBattleground (uint32 InstanceID, BattlegroundTypeId bgTypeId)
 
BattlegroundCreateNewBattleground (BattlegroundQueueTypeId queueId, BattlegroundBracketId bracketId)
 
void AddBattleground (Battleground *bg)
 
void AddToBGFreeSlotQueue (Battleground *bg)
 
void RemoveFromBGFreeSlotQueue (uint32 mapId, uint32 instanceId)
 
BGFreeSlotQueueContainerGetBGFreeSlotQueueStore (uint32 mapId)
 
void LoadBattlegroundTemplates ()
 
void DeleteAllBattlegrounds ()
 
void SendToBattleground (Player *player, uint32 InstanceID, BattlegroundTypeId bgTypeId)
 
BattlegroundQueueGetBattlegroundQueue (BattlegroundQueueTypeId bgQueueTypeId)
 
void ScheduleQueueUpdate (uint32 arenaMatchmakerRating, BattlegroundQueueTypeId bgQueueTypeId, BattlegroundBracketId bracket_id)
 
uint32 GetPrematureFinishTime () const
 
void ToggleArenaTesting ()
 
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)
 

Static Public Member Functions

static BattlegroundMgrinstance ()
 
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)
 

Private Types

typedef std::map< BattlegroundTypeId, BattlegroundDataBattlegroundDataContainer
 
typedef std::map< BattlegroundTypeId, BattlegroundTemplateBattlegroundTemplateMap
 
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, BattlegroundQueuem_BattlegroundQueues
 
std::map< uint32, BGFreeSlotQueueContainerm_BGFreeSlotQueue
 
std::vector< ScheduledQueueUpdatem_QueueUpdateScheduler
 
uint32 m_NextRatedArenaUpdate
 
uint32 m_UpdateTimer
 
bool m_ArenaTesting
 
bool m_Testing
 
BattleMastersMap mBattleMastersMap
 
BattlegroundTemplateMap _battlegroundTemplates
 
BattlegroundMapTemplateContainer _battlegroundMapTemplates
 

Detailed Description

Definition at line 76 of file BattlegroundMgr.h.

Member Typedef Documentation

◆ BattlegroundDataContainer

◆ BattlegroundMapTemplateContainer

◆ BattlegroundTemplateMap

Constructor & Destructor Documentation

◆ BattlegroundMgr() [1/3]

BattlegroundMgr::BattlegroundMgr ( )
private

Definition at line 75 of file BattlegroundMgr.cpp.

◆ ~BattlegroundMgr()

BattlegroundMgr::~BattlegroundMgr ( )
private

Definition at line 80 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ BattlegroundMgr() [2/3]

BattlegroundMgr::BattlegroundMgr ( BattlegroundMgr const &  right)
delete

◆ BattlegroundMgr() [3/3]

BattlegroundMgr::BattlegroundMgr ( BattlegroundMgr &&  right)
delete

Member Function Documentation

◆ AddBattleground()

void BattlegroundMgr::AddBattleground ( Battleground bg)

Definition at line 731 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ AddToBGFreeSlotQueue()

void BattlegroundMgr::AddToBGFreeSlotQueue ( Battleground bg)

Definition at line 715 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ BGQueueTypeId()

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

Definition at line 498 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BGTypeToWeekendHolidayId()

HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId ( BattlegroundTypeId  bgTypeId)
static

Definition at line 647 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ BuildBattlegroundStatusActive()

void BattlegroundMgr::BuildBattlegroundStatusActive ( WorldPackets::Battleground::BattlefieldStatusActive battlefieldStatus,
Battleground bg,
Player player,
uint32  ticketId,
uint32  joinTime,
BattlegroundQueueTypeId  queueId 
)

Definition at line 202 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ BuildBattlegroundStatusFailed()

void BattlegroundMgr::BuildBattlegroundStatusFailed ( WorldPackets::Battleground::BattlefieldStatusFailed battlefieldStatus,
BattlegroundQueueTypeId  queueId,
Player pPlayer,
uint32  ticketId,
GroupJoinBattlegroundResult  result,
ObjectGuid const *  errorGuid = nullptr 
)

Definition at line 222 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ BuildBattlegroundStatusHeader()

void BattlegroundMgr::BuildBattlegroundStatusHeader ( WorldPackets::Battleground::BattlefieldStatusHeader battlefieldStatus,
Player player,
uint32  ticketId,
uint32  joinTime,
BattlegroundQueueTypeId  queueId 
)

Definition at line 171 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BuildBattlegroundStatusNeedConfirmation()

void BattlegroundMgr::BuildBattlegroundStatusNeedConfirmation ( WorldPackets::Battleground::BattlefieldStatusNeedConfirmation battlefieldStatus,
Battleground bg,
Player player,
uint32  ticketId,
uint32  joinTime,
uint32  timeout,
BattlegroundQueueTypeId  queueId 
)

Definition at line 194 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ BuildBattlegroundStatusNone()

void BattlegroundMgr::BuildBattlegroundStatusNone ( WorldPackets::Battleground::BattlefieldStatusNone battlefieldStatus,
Player player,
uint32  ticketId,
uint32  joinTime 
)

Definition at line 186 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ BuildBattlegroundStatusQueued()

void BattlegroundMgr::BuildBattlegroundStatusQueued ( WorldPackets::Battleground::BattlefieldStatusQueued battlefieldStatus,
Player player,
uint32  ticketId,
uint32  joinTime,
BattlegroundQueueTypeId  queueId,
uint32  avgWaitTime,
bool  asGroup 
)

Definition at line 212 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ CheckBattleMasters()

void BattlegroundMgr::CheckBattleMasters ( )

Definition at line 634 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ CreateClientVisibleInstanceId()

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

Definition at line 265 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateNewBattleground()

Battleground * BattlegroundMgr::CreateNewBattleground ( BattlegroundQueueTypeId  queueId,
BattlegroundBracketId  bracketId 
)

Definition at line 291 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ DeleteAllBattlegrounds()

void BattlegroundMgr::DeleteAllBattlegrounds ( )

Definition at line 85 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ GetBattleground()

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

Definition at line 234 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetBattlegroundQueue()

BattlegroundQueue & BattlegroundMgr::GetBattlegroundQueue ( BattlegroundQueueTypeId  bgQueueTypeId)
inline

Definition at line 117 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundTemplateByMapId()

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

Definition at line 181 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundTemplateByTypeId()

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

Definition at line 146 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ GetBattleMasterBG()

BattlegroundTypeId BattlegroundMgr::GetBattleMasterBG ( uint32  entry) const
inline

Definition at line 138 of file BattlegroundMgr.h.

◆ GetBGFreeSlotQueueStore()

BGFreeSlotQueueContainer & BattlegroundMgr::GetBGFreeSlotQueueStore ( uint32  mapId)

Definition at line 710 of file BattlegroundMgr.cpp.

◆ GetMaxRatingDifference()

uint32 BattlegroundMgr::GetMaxRatingDifference ( ) const

Definition at line 565 of file BattlegroundMgr.cpp.

◆ GetPrematureFinishTime()

uint32 BattlegroundMgr::GetPrematureFinishTime ( ) const

Definition at line 579 of file BattlegroundMgr.cpp.

◆ GetRandomBG()

BattlegroundTypeId BattlegroundMgr::GetRandomBG ( BattlegroundTypeId  id)
private

Definition at line 684 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRatingDiscardTimer()

uint32 BattlegroundMgr::GetRatingDiscardTimer ( ) const

Definition at line 574 of file BattlegroundMgr.cpp.

◆ instance()

BattlegroundMgr * BattlegroundMgr::instance ( )
static

Definition at line 91 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isArenaTesting()

bool BattlegroundMgr::isArenaTesting ( ) const
inline

Definition at line 124 of file BattlegroundMgr.h.

◆ IsArenaType()

bool BattlegroundMgr::IsArenaType ( BattlegroundTypeId  bgTypeId)
staticprivate

Definition at line 483 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ IsBGWeekend()

bool BattlegroundMgr::IsBGWeekend ( BattlegroundTypeId  bgTypeId)
static

Definition at line 679 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsRandomBattleground()

bool BattlegroundMgr::IsRandomBattleground ( uint32  battlemasterListId)
static

Definition at line 493 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ isTesting()

bool BattlegroundMgr::isTesting ( ) const
inline

Definition at line 125 of file BattlegroundMgr.h.

◆ IsValidQueueId()

bool BattlegroundMgr::IsValidQueueId ( BattlegroundQueueTypeId  bgQueueTypeId)
static

Definition at line 515 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ LoadBattlegroundTemplates()

void BattlegroundMgr::LoadBattlegroundTemplates ( )

Definition at line 376 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ LoadBattleMastersEntry()

void BattlegroundMgr::LoadBattleMastersEntry ( )

Definition at line 584 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ RemoveFromBGFreeSlotQueue()

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

Definition at line 720 of file BattlegroundMgr.cpp.

◆ ScheduleQueueUpdate()

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

Definition at line 556 of file BattlegroundMgr.cpp.

◆ SendBattlegroundList()

void BattlegroundMgr::SendBattlegroundList ( Player player,
ObjectGuid const &  guid,
BattlegroundTypeId  bgTypeId 
)

Definition at line 452 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ SendToBattleground()

void BattlegroundMgr::SendToBattleground ( Player player,
uint32  InstanceID,
BattlegroundTypeId  bgTypeId 
)

Definition at line 468 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ ToggleArenaTesting()

void BattlegroundMgr::ToggleArenaTesting ( )

Definition at line 509 of file BattlegroundMgr.cpp.

◆ ToggleTesting()

void BattlegroundMgr::ToggleTesting ( )

Definition at line 503 of file BattlegroundMgr.cpp.

◆ Update()

void BattlegroundMgr::Update ( uint32  diff)

Definition at line 98 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ WeekendHolidayIdToBGType()

BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType ( HolidayIds  holiday)
static

Definition at line 663 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _battlegroundMapTemplates

BattlegroundMapTemplateContainer BattlegroundMgr::_battlegroundMapTemplates
private

Definition at line 192 of file BattlegroundMgr.h.

◆ _battlegroundTemplates

BattlegroundTemplateMap BattlegroundMgr::_battlegroundTemplates
private

Definition at line 191 of file BattlegroundMgr.h.

◆ bgDataStore

BattlegroundDataContainer BattlegroundMgr::bgDataStore
private

Definition at line 160 of file BattlegroundMgr.h.

◆ m_ArenaTesting

bool BattlegroundMgr::m_ArenaTesting
private

Definition at line 177 of file BattlegroundMgr.h.

◆ m_BattlegroundQueues

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

Definition at line 162 of file BattlegroundMgr.h.

◆ m_BGFreeSlotQueue

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

Definition at line 163 of file BattlegroundMgr.h.

◆ m_NextRatedArenaUpdate

uint32 BattlegroundMgr::m_NextRatedArenaUpdate
private

Definition at line 175 of file BattlegroundMgr.h.

◆ m_QueueUpdateScheduler

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

Definition at line 174 of file BattlegroundMgr.h.

◆ m_Testing

bool BattlegroundMgr::m_Testing
private

Definition at line 178 of file BattlegroundMgr.h.

◆ m_UpdateTimer

uint32 BattlegroundMgr::m_UpdateTimer
private

Definition at line 176 of file BattlegroundMgr.h.

◆ mBattleMastersMap

BattleMastersMap BattlegroundMgr::mBattleMastersMap
private

Definition at line 179 of file BattlegroundMgr.h.


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