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)
 
void SendAreaSpiritHealerQueryOpcode (Player *player, Battleground *bg, ObjectGuid guid)
 
BattlegroundGetBattlegroundThroughClientInstance (uint32 instanceId, BattlegroundTypeId bgTypeId)
 
BattlegroundGetBattleground (uint32 InstanceID, BattlegroundTypeId bgTypeId)
 
BattlegroundGetBattlegroundTemplate (BattlegroundTypeId bgTypeId)
 
BattlegroundCreateNewBattleground (BattlegroundTypeId bgTypeId, PvPDifficultyEntry const *bracketEntry, uint8 arenaType, bool isRated)
 
void AddBattleground (Battleground *bg)
 
void AddToBGFreeSlotQueue (BattlegroundTypeId bgTypeId, Battleground *bg)
 
void RemoveFromBGFreeSlotQueue (BattlegroundTypeId bgTypeId, uint32 instanceId)
 
BGFreeSlotQueueContainerGetBGFreeSlotQueueStore (BattlegroundTypeId bgTypeId)
 
void LoadBattlegroundTemplates ()
 
void DeleteAllBattlegrounds ()
 
void SendToBattleground (Player *player, uint32 InstanceID, BattlegroundTypeId bgTypeId)
 
bool IsValidQueueId (BattlegroundQueueTypeId bgQueueTypeId)
 
BattlegroundQueueGetBattlegroundQueue (BattlegroundQueueTypeId bgQueueTypeId)
 
void ScheduleQueueUpdate (uint32 arenaMatchmakerRating, BattlegroundQueueTypeId bgQueueTypeId)
 
uint32 GetPrematureFinishTime () const
 
void ToggleArenaTesting ()
 
void ToggleTesting ()
 
void ResetHolidays ()
 
void SetHolidayActive (uint32 battlegroundId)
 
bool isArenaTesting () const
 
bool isTesting () const
 
uint32 GetMaxRatingDifference () const
 
uint32 GetRatingDiscardTimer () const
 
void InitAutomaticArenaPointDistribution ()
 
void LoadBattleMastersEntry ()
 
void CheckBattleMasters ()
 
BattlegroundTypeId GetBattleMasterBG (uint32 entry) const
 

Static Public Member Functions

static BattlegroundMgrinstance ()
 
static void BuildBattlegroundStatusHeader (WorldPackets::Battleground::BattlefieldStatusHeader *header, Battleground const *bg, uint32 queueSlot, BattlegroundQueueTypeId queueId)
 
static void BuildBattlegroundStatusNone (WorldPackets::Battleground::BattlefieldStatusNone *battlefieldStatus, uint32 queueSlot)
 
static void BuildBattlegroundStatusNeedConfirmation (WorldPackets::Battleground::BattlefieldStatusNeedConfirmation *battlefieldStatus, Battleground const *bg, uint32 queueSlot, uint32 timeout, BattlegroundQueueTypeId queueId)
 
static void BuildBattlegroundStatusActive (WorldPackets::Battleground::BattlefieldStatusActive *battlefieldStatus, Battleground const *bg, Player const *player, uint32 queueSlot, BattlegroundQueueTypeId queueId)
 
static void BuildBattlegroundStatusQueued (WorldPackets::Battleground::BattlefieldStatusQueued *battlefieldStatus, Battleground const *bg, uint32 queueSlot, uint32 joinTime, BattlegroundQueueTypeId queueId, uint32 avgWaitTime)
 
static void BuildBattlegroundStatusFailed (WorldPackets::Battleground::BattlefieldStatusFailed *battlefieldStatus, GroupJoinBattlegroundResult result, ObjectGuid const *errorGuid=nullptr)
 
static void BuildGroupJoinedBattlegroundPacket (WorldPackets::Battleground::GroupJoinedBattleground *groupJoinedBattleground, BattlegroundTypeId bgTypeId)
 
static bool IsRandomBattleground (uint32 battlemasterListId)
 
static BattlegroundQueueTypeId BGQueueTypeId (BattlegroundTypeId bgTypeId, uint8 bracketId, uint8 arenaType)
 
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, uint8BattlegroundSelectionWeightMap
 
typedef std::map< BattlegroundTypeId, BattlegroundTemplateBattlegroundTemplateMap
 
typedef std::map< uint32, BattlegroundTemplate * > BattlegroundMapTemplateContainer
 

Private Member Functions

 BattlegroundMgr ()
 
 ~BattlegroundMgr ()
 
bool CreateBattleground (BattlegroundTemplate const *bgTemplate)
 
uint32 CreateClientVisibleInstanceId (BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id)
 
BattlegroundTypeId GetRandomBG (BattlegroundTypeId id)
 
BattlegroundTemplate const * GetBattlegroundTemplateByTypeId (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::vector< ScheduledQueueUpdatem_QueueUpdateScheduler
 
uint32 m_NextRatedArenaUpdate
 
time_t m_NextAutoDistributionTime
 
uint32 m_AutoDistributionTimeChecker
 
uint32 m_UpdateTimer
 
bool m_ArenaTesting
 
bool m_Testing
 
BattleMastersMap mBattleMastersMap
 
BattlegroundTemplateMap _battlegroundTemplates
 
BattlegroundMapTemplateContainer _battlegroundMapTemplates
 

Detailed Description

Definition at line 80 of file BattlegroundMgr.h.

Member Typedef Documentation

◆ BattlegroundDataContainer

◆ BattlegroundMapTemplateContainer

◆ BattlegroundSelectionWeightMap

Definition at line 203 of file BattlegroundMgr.h.

◆ BattlegroundTemplateMap

Constructor & Destructor Documentation

◆ BattlegroundMgr() [1/3]

BattlegroundMgr::BattlegroundMgr ( )
private

Definition at line 60 of file BattlegroundMgr.cpp.

◆ ~BattlegroundMgr()

BattlegroundMgr::~BattlegroundMgr ( )
private

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

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

◆ AddToBGFreeSlotQueue()

void BattlegroundMgr::AddToBGFreeSlotQueue ( BattlegroundTypeId  bgTypeId,
Battleground bg 
)

Definition at line 904 of file BattlegroundMgr.cpp.

◆ BGQueueTypeId()

BattlegroundQueueTypeId BattlegroundMgr::BGQueueTypeId ( BattlegroundTypeId  bgTypeId,
uint8  bracketId,
uint8  arenaType 
)
static

Definition at line 699 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ BGTypeToWeekendHolidayId()

HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId ( BattlegroundTypeId  bgTypeId)
static

Definition at line 849 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  queueSlot,
BattlegroundQueueTypeId  queueId 
)
static

Definition at line 199 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,
GroupJoinBattlegroundResult  result,
ObjectGuid const *  errorGuid = nullptr 
)
static

Definition at line 225 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ BuildBattlegroundStatusHeader()

void BattlegroundMgr::BuildBattlegroundStatusHeader ( WorldPackets::Battleground::BattlefieldStatusHeader header,
Battleground const *  bg,
uint32  queueSlot,
BattlegroundQueueTypeId  queueId 
)
static

Definition at line 177 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,
uint32  queueSlot,
uint32  timeout,
BattlegroundQueueTypeId  queueId 
)
static

Definition at line 192 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,
uint32  queueSlot 
)
static

Definition at line 187 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ BuildBattlegroundStatusQueued()

void BattlegroundMgr::BuildBattlegroundStatusQueued ( WorldPackets::Battleground::BattlefieldStatusQueued battlefieldStatus,
Battleground const *  bg,
uint32  queueSlot,
uint32  joinTime,
BattlegroundQueueTypeId  queueId,
uint32  avgWaitTime 
)
static

Definition at line 218 of file BattlegroundMgr.cpp.

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

◆ BuildGroupJoinedBattlegroundPacket()

void BattlegroundMgr::BuildGroupJoinedBattlegroundPacket ( WorldPackets::Battleground::GroupJoinedBattleground groupJoinedBattleground,
BattlegroundTypeId  bgTypeId 
)
static

Definition at line 232 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ CheckBattleMasters()

void BattlegroundMgr::CheckBattleMasters ( )

Definition at line 836 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ CreateBattleground()

bool BattlegroundMgr::CreateBattleground ( BattlegroundTemplate const *  bgTemplate)
private

Definition at line 423 of file BattlegroundMgr.cpp.

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

◆ CreateClientVisibleInstanceId()

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

Definition at line 303 of file BattlegroundMgr.cpp.

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

◆ CreateNewBattleground()

Battleground * BattlegroundMgr::CreateNewBattleground ( BattlegroundTypeId  bgTypeId,
PvPDifficultyEntry const *  bracketEntry,
uint8  arenaType,
bool  isRated 
)

Definition at line 329 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ DeleteAllBattlegrounds()

void BattlegroundMgr::DeleteAllBattlegrounds ( )

Definition at line 71 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ GetBattleground()

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

Definition at line 261 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ GetBattlegroundQueue()

BattlegroundQueue & BattlegroundMgr::GetBattlegroundQueue ( BattlegroundQueueTypeId  bgQueueTypeId)
inline

Definition at line 126 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundTemplate()

Battleground * BattlegroundMgr::GetBattlegroundTemplate ( BattlegroundTypeId  bgTypeId)

Definition at line 292 of file BattlegroundMgr.cpp.

+ 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)
inlineprivate

Definition at line 187 of file BattlegroundMgr.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundThroughClientInstance()

Battleground * BattlegroundMgr::GetBattlegroundThroughClientInstance ( uint32  instanceId,
BattlegroundTypeId  bgTypeId 
)

Definition at line 237 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ GetBattleMasterBG()

BattlegroundTypeId BattlegroundMgr::GetBattleMasterBG ( uint32  entry) const
inline

Definition at line 151 of file BattlegroundMgr.h.

◆ GetBGFreeSlotQueueStore()

BGFreeSlotQueueContainer & BattlegroundMgr::GetBGFreeSlotQueueStore ( BattlegroundTypeId  bgTypeId)

Definition at line 899 of file BattlegroundMgr.cpp.

◆ GetMaxRatingDifference()

uint32 BattlegroundMgr::GetMaxRatingDifference ( ) const

Definition at line 767 of file BattlegroundMgr.cpp.

◆ GetPrematureFinishTime()

uint32 BattlegroundMgr::GetPrematureFinishTime ( ) const

Definition at line 781 of file BattlegroundMgr.cpp.

◆ GetRandomBG()

BattlegroundTypeId BattlegroundMgr::GetRandomBG ( BattlegroundTypeId  id)
private

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

◆ InitAutomaticArenaPointDistribution()

void BattlegroundMgr::InitAutomaticArenaPointDistribution ( )

Definition at line 599 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ instance()

BattlegroundMgr * BattlegroundMgr::instance ( )
static

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

◆ IsArenaType()

bool BattlegroundMgr::IsArenaType ( BattlegroundTypeId  bgTypeId)
staticprivate

Definition at line 684 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

◆ IsBGWeekend()

bool BattlegroundMgr::IsBGWeekend ( BattlegroundTypeId  bgTypeId)
static

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

+ Here is the caller graph for this function:

◆ isTesting()

bool BattlegroundMgr::isTesting ( ) const
inline

Definition at line 137 of file BattlegroundMgr.h.

◆ IsValidQueueId()

bool BattlegroundMgr::IsValidQueueId ( BattlegroundQueueTypeId  bgQueueTypeId)

Definition at line 729 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ LoadBattlegroundTemplates()

void BattlegroundMgr::LoadBattlegroundTemplates ( )

Definition at line 496 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ LoadBattleMastersEntry()

void BattlegroundMgr::LoadBattleMastersEntry ( )

Definition at line 786 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 ( BattlegroundTypeId  bgTypeId,
uint32  instanceId 
)

Definition at line 909 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ ResetHolidays()

void BattlegroundMgr::ResetHolidays ( )

Definition at line 716 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ ScheduleQueueUpdate()

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

Definition at line 758 of file BattlegroundMgr.cpp.

◆ SendAreaSpiritHealerQueryOpcode()

void BattlegroundMgr::SendAreaSpiritHealerQueryOpcode ( Player player,
Battleground bg,
ObjectGuid  guid 
)

Definition at line 676 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ SendBattlegroundList()

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

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

+ Here is the call graph for this function:

◆ SetHolidayActive()

void BattlegroundMgr::SetHolidayActive ( uint32  battlegroundId)

Definition at line 723 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ ToggleArenaTesting()

void BattlegroundMgr::ToggleArenaTesting ( )

Definition at line 710 of file BattlegroundMgr.cpp.

◆ ToggleTesting()

void BattlegroundMgr::ToggleTesting ( )

Definition at line 704 of file BattlegroundMgr.cpp.

◆ Update()

void BattlegroundMgr::Update ( uint32  diff)

Definition at line 87 of file BattlegroundMgr.cpp.

+ Here is the call graph for this function:

◆ WeekendHolidayIdToBGType()

BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType ( HolidayIds  holiday)
static

Definition at line 863 of file BattlegroundMgr.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _battlegroundMapTemplates

BattlegroundMapTemplateContainer BattlegroundMgr::_battlegroundMapTemplates
private

Definition at line 208 of file BattlegroundMgr.h.

◆ _battlegroundTemplates

BattlegroundTemplateMap BattlegroundMgr::_battlegroundTemplates
private

Definition at line 207 of file BattlegroundMgr.h.

◆ bgDataStore

BattlegroundDataContainer BattlegroundMgr::bgDataStore
private

Definition at line 166 of file BattlegroundMgr.h.

◆ m_ArenaTesting

bool BattlegroundMgr::m_ArenaTesting
private

Definition at line 183 of file BattlegroundMgr.h.

◆ m_AutoDistributionTimeChecker

uint32 BattlegroundMgr::m_AutoDistributionTimeChecker
private

Definition at line 181 of file BattlegroundMgr.h.

◆ m_BattlegroundQueues

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

Definition at line 168 of file BattlegroundMgr.h.

◆ m_NextAutoDistributionTime

time_t BattlegroundMgr::m_NextAutoDistributionTime
private

Definition at line 180 of file BattlegroundMgr.h.

◆ m_NextRatedArenaUpdate

uint32 BattlegroundMgr::m_NextRatedArenaUpdate
private

Definition at line 179 of file BattlegroundMgr.h.

◆ m_QueueUpdateScheduler

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

Definition at line 178 of file BattlegroundMgr.h.

◆ m_Testing

bool BattlegroundMgr::m_Testing
private

Definition at line 184 of file BattlegroundMgr.h.

◆ m_UpdateTimer

uint32 BattlegroundMgr::m_UpdateTimer
private

Definition at line 182 of file BattlegroundMgr.h.

◆ mBattleMastersMap

BattleMastersMap BattlegroundMgr::mBattleMastersMap
private

Definition at line 185 of file BattlegroundMgr.h.


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