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
 
BattlegroundMgroperator= (BattlegroundMgr const &right)=delete
 
BattlegroundMgroperator= (BattlegroundMgr &&right)=delete
 
void Update (uint32 diff)
 
void SendBattlegroundList (Player *player, ObjectGuid const &guid, BattlegroundTypeId bgTypeId)
 
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 ()
 
BattlegroundQueueGetBattlegroundQueue (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 BattlegroundMgrinstance ()
 
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, 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
 
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.

+ 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 749 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ AddToBGFreeSlotQueue()

void BattlegroundMgr::AddToBGFreeSlotQueue ( Battleground bg)

Definition at line 733 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 509 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 671 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ BuildBattlegroundStatusActive()

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

Definition at line 188 of file BattlegroundMgr.cpp.

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

◆ BuildBattlegroundStatusFailed()

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

Definition at line 208 of file BattlegroundMgr.cpp.

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

◆ BuildBattlegroundStatusHeader()

void BattlegroundMgr::BuildBattlegroundStatusHeader ( WorldPackets::Battleground::BattlefieldStatusHeader header,
Player const *  player,
uint32  ticketId,
uint32  joinTime,
BattlegroundQueueTypeId  queueId 
)
static

Definition at line 157 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 const *  bg,
Player const *  player,
uint32  ticketId,
uint32  joinTime,
uint32  timeout,
BattlegroundQueueTypeId  queueId 
)
static

Definition at line 180 of file BattlegroundMgr.cpp.

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

◆ BuildBattlegroundStatusNone()

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

Definition at line 172 of file BattlegroundMgr.cpp.

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

◆ BuildBattlegroundStatusQueued()

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

Definition at line 198 of file BattlegroundMgr.cpp.

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

◆ CheckBattleMasters()

void BattlegroundMgr::CheckBattleMasters ( )

Definition at line 658 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 313 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 339 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ DeleteAllBattlegrounds()

void BattlegroundMgr::DeleteAllBattlegrounds ( )

Definition at line 76 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ FindBattlegroundScriptTemplate()

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

Definition at line 295 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ GetBattleground()

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

Definition at line 220 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ GetBattlegroundQueue()

BattlegroundQueue & BattlegroundMgr::GetBattlegroundQueue ( BattlegroundQueueTypeId  bgQueueTypeId)
inline

Definition at line 125 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundTemplateByMapId()

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

Definition at line 195 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundTemplateByTypeId()

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

Definition at line 155 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ GetBattleMasterBG()

BattlegroundTypeId BattlegroundMgr::GetBattleMasterBG ( uint32  entry) const
inline

Definition at line 147 of file BattlegroundMgr.h.

◆ GetBGFreeSlotQueueStore()

BGFreeSlotQueueContainer & BattlegroundMgr::GetBGFreeSlotQueueStore ( uint32  mapId)

Definition at line 728 of file BattlegroundMgr.cpp.

◆ GetMaxRatingDifference()

uint32 BattlegroundMgr::GetMaxRatingDifference ( ) const

Definition at line 589 of file BattlegroundMgr.cpp.

◆ GetPrematureFinishTime()

uint32 BattlegroundMgr::GetPrematureFinishTime ( ) const

Definition at line 603 of file BattlegroundMgr.cpp.

◆ GetRandomBG()

BattlegroundTypeId BattlegroundMgr::GetRandomBG ( BattlegroundTypeId  id)
private

Definition at line 708 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 598 of file BattlegroundMgr.cpp.

◆ instance()

BattlegroundMgr * BattlegroundMgr::instance ( )
static

Definition at line 82 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 133 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ IsArenaType()

bool BattlegroundMgr::IsArenaType ( BattlegroundTypeId  bgTypeId)
staticprivate

Definition at line 494 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ IsBGWeekend()

bool BattlegroundMgr::IsBGWeekend ( BattlegroundTypeId  bgTypeId)
static

Definition at line 703 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 504 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ isTesting()

bool BattlegroundMgr::isTesting ( ) const
inline

Definition at line 134 of file BattlegroundMgr.h.

◆ IsValidQueueId()

bool BattlegroundMgr::IsValidQueueId ( BattlegroundQueueTypeId  bgQueueTypeId)
static

Definition at line 539 of file BattlegroundMgr.cpp.

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

◆ LoadBattlegroundScriptTemplate()

void BattlegroundMgr::LoadBattlegroundScriptTemplate ( )

Definition at line 251 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ LoadBattlegroundTemplates()

void BattlegroundMgr::LoadBattlegroundTemplates ( )

Definition at line 378 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ LoadBattleMastersEntry()

void BattlegroundMgr::LoadBattleMastersEntry ( )

Definition at line 608 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

◆ QueuePlayerForArena()

void BattlegroundMgr::QueuePlayerForArena ( Player const *  player,
uint8  teamSize,
uint8  roles 
)
static

Definition at line 304 of file BattlegroundMgr.cpp.

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

◆ RemoveFromBGFreeSlotQueue()

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

Definition at line 738 of file BattlegroundMgr.cpp.

◆ ScheduleQueueUpdate()

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

Definition at line 580 of file BattlegroundMgr.cpp.

◆ SendBattlegroundList()

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

Definition at line 460 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ SendToBattleground()

void BattlegroundMgr::SendToBattleground ( Player player,
Battleground const *  battleground 
)
static

Definition at line 478 of file BattlegroundMgr.cpp.

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

◆ ToggleArenaTesting()

bool BattlegroundMgr::ToggleArenaTesting ( uint32  battlemasterListId)

Definition at line 520 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ ToggleTesting()

void BattlegroundMgr::ToggleTesting ( )

Definition at line 514 of file BattlegroundMgr.cpp.

◆ Update()

void BattlegroundMgr::Update ( uint32  diff)

Definition at line 89 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ WeekendHolidayIdToBGType()

BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType ( HolidayIds  holiday)
static

Definition at line 687 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _battlegroundMapTemplates

BattlegroundMapTemplateContainer BattlegroundMgr::_battlegroundMapTemplates
private

Definition at line 206 of file BattlegroundMgr.h.

◆ _battlegroundScriptTemplates

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

Definition at line 208 of file BattlegroundMgr.h.

◆ _battlegroundTemplates

BattlegroundTemplateMap BattlegroundMgr::_battlegroundTemplates
private

Definition at line 205 of file BattlegroundMgr.h.

◆ bgDataStore

BattlegroundDataContainer BattlegroundMgr::bgDataStore
private

Definition at line 174 of file BattlegroundMgr.h.

◆ m_ArenaTesting

uint32 BattlegroundMgr::m_ArenaTesting
private

Definition at line 191 of file BattlegroundMgr.h.

◆ m_BattlegroundQueues

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

Definition at line 176 of file BattlegroundMgr.h.

◆ m_BGFreeSlotQueue

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

Definition at line 177 of file BattlegroundMgr.h.

◆ m_NextRatedArenaUpdate

uint32 BattlegroundMgr::m_NextRatedArenaUpdate
private

Definition at line 189 of file BattlegroundMgr.h.

◆ m_QueueUpdateScheduler

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

Definition at line 188 of file BattlegroundMgr.h.

◆ m_Testing

bool BattlegroundMgr::m_Testing
private

Definition at line 192 of file BattlegroundMgr.h.

◆ m_UpdateTimer

uint32 BattlegroundMgr::m_UpdateTimer
private

Definition at line 190 of file BattlegroundMgr.h.

◆ mBattleMastersMap

BattleMastersMap BattlegroundMgr::mBattleMastersMap
private

Definition at line 193 of file BattlegroundMgr.h.


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