TrinityCore
Battleground Class Reference

#include <Battleground.h>

+ Inheritance diagram for Battleground:

Public Types

typedef std::map< ObjectGuid, BattlegroundPlayerBattlegroundPlayerMap
 
typedef std::map< ObjectGuid, BattlegroundScore * > BattlegroundScoreMap
 

Public Member Functions

 Battleground (BattlegroundTemplate const *battlegroundTemplate)
 
 Battleground (Battleground const &)
 
virtual ~Battleground ()
 
Battlegroundoperator= (Battleground const &)=delete
 
void Update (uint32 diff)
 
void Reset ()
 
char const * GetName () const
 
BattlegroundTypeId GetTypeID () const
 
BattlegroundBracketId GetBracketId () const
 
uint32 GetInstanceID () const
 
BattlegroundStatus GetStatus () const
 
uint32 GetClientInstanceID () const
 
uint32 GetElapsedTime () const
 
uint32 GetRemainingTime () const
 
uint32 GetMaxPlayers () const
 
uint32 GetMinPlayers () const
 
uint32 GetMinLevel () const
 
uint32 GetMaxLevel () const
 
uint32 GetMaxPlayersPerTeam () const
 
uint32 GetMinPlayersPerTeam () const
 
int32 GetStartDelayTime () const
 
uint8 GetArenaType () const
 
PvPTeamId GetWinner () const
 
uint32 GetScriptId () const
 
uint32 GetBonusHonorFromKill (uint32 kills) const
 
void SetBracket (PVPDifficultyEntry const *bracketEntry)
 
void SetInstanceID (uint32 InstanceID)
 
void SetStatus (BattlegroundStatus Status)
 
void SetClientInstanceID (uint32 InstanceID)
 
void SetElapsedTime (uint32 Time)
 
void SetRemainingTime (uint32 Time)
 
void SetRated (bool state)
 
void SetArenaType (uint8 type)
 
void SetWinner (PvPTeamId winnerTeamId)
 
std::unordered_set< uint32 > const * GetPvpStatIds () const
 
void ModifyStartDelayTime (int diff)
 
void SetStartDelayTime (int Time)
 
void AddToBGFreeSlotQueue ()
 
void RemoveFromBGFreeSlotQueue ()
 
void DecreaseInvitedCount (Team team)
 
void IncreaseInvitedCount (Team team)
 
uint32 GetInvitedCount (Team team) const
 
bool HasFreeSlots () const
 
uint32 GetFreeSlotsForTeam (Team team) const
 
bool isArena () const
 
bool isBattleground () const
 
bool isRated () const
 
BattlegroundPlayerMap const & GetPlayers () const
 
uint32 GetPlayersSize () const
 
uint32 GetPlayerScoresSize () const
 
void StartBattleground ()
 
GameObjectGetBGObject (uint32 type, bool logError=true)
 
CreatureGetBGCreature (uint32 type, bool logError=true)
 
uint32 GetMapId () const
 
void SetBgMap (BattlegroundMap *map)
 
BattlegroundMapGetBgMap () const
 
BattlegroundMapFindBgMap () const
 
WorldSafeLocsEntry const * GetTeamStartPosition (TeamId teamId) const
 
float GetStartMaxDist () const
 
void SendPacketToTeam (Team team, WorldPacket const *packet, Player *except=nullptr) const
 
void SendPacketToAll (WorldPacket const *packet) const
 
void SendChatMessage (Creature *source, uint8 textId, WorldObject *target=nullptr)
 
void SendBroadcastText (uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
 
template<class Do >
void BroadcastWorker (Do &_do)
 
void PlaySoundToTeam (uint32 SoundID, Team team)
 
void PlaySoundToAll (uint32 SoundID)
 
void CastSpellOnTeam (uint32 SpellID, Team team)
 
void RemoveAuraOnTeam (uint32 SpellID, Team team)
 
void RewardHonorToTeam (uint32 Honor, Team team)
 
void RewardReputationToTeam (uint32 faction_id, uint32 Reputation, Team team)
 
void UpdateWorldState (int32 worldStateId, int32 value, bool hidden=false)
 
virtual void EndBattleground (Team winner)
 
void BlockMovement (Player *player)
 
void SendMessageToAll (uint32 entry, ChatMsg type, Player const *source=nullptr)
 
void PSendMessageToAll (uint32 entry, ChatMsg type, Player const *source,...)
 
GroupGetBgRaid (Team team) const
 
void SetBgRaid (Team team, Group *bg_raid)
 
virtual void BuildPvPLogDataPacket (WorldPackets::Battleground::PVPMatchStatistics &pvpLogData) const
 
BattlegroundScore const * GetBattlegroundScore (Player *player) const
 
bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true)
 
void UpdatePvpStat (Player *player, uint32 pvpStatId, uint32 value)
 
uint32 GetPlayersCountByTeam (Team team) const
 
uint32 GetAlivePlayersCountByTeam (Team team) const
 
void UpdatePlayersCountByTeam (Team team, bool remove)
 
virtual void CheckWinConditions ()
 
void SetArenaTeamIdForTeam (Team team, uint32 ArenaTeamId)
 
uint32 GetArenaTeamIdForTeam (Team team) const
 
uint32 GetArenaTeamIdByIndex (TeamId teamId) const
 
void SetArenaMatchmakerRating (Team team, uint32 MMR)
 
uint32 GetArenaMatchmakerRating (Team team) const
 
virtual void HandleKillPlayer (Player *player, Player *killer)
 
virtual void HandleKillUnit (Creature *, Unit *)
 
void EventPlayerLoggedIn (Player *player)
 
void EventPlayerLoggedOut (Player *player)
 
virtual WorldSafeLocsEntry const * GetExploitTeleportLocation (Team)
 
void TeleportPlayerToExploitLocation (Player *player)
 
virtual void AddPlayer (Player *player, BattlegroundQueueTypeId queueId)
 
void AddOrSetPlayerToCorrectBgGroup (Player *player, Team team)
 
virtual void RemovePlayerAtLeave (ObjectGuid guid, bool Transport, bool SendPacket)
 
virtual bool HandlePlayerUnderMap (Player *)
 
Team GetPlayerTeam (ObjectGuid guid) const
 
bool IsPlayerInBattleground (ObjectGuid guid) const
 
bool IsPlayerMercenaryInBattleground (ObjectGuid guid) const
 
bool ToBeDeleted () const
 
void SetDeleteThis ()
 
void RewardXPAtKill (Player *killer, Player *victim)
 
bool CanAwardArenaPoints () const
 
uint32 GetTeamScore (TeamId teamId) const
 
Team GetPrematureWinner ()
 
uint8 GetUniqueBracketId () const
 
void AddPlayerPosition (WorldPackets::Battleground::BattlegroundPlayerPosition const &position)
 
void RemovePlayerPosition (ObjectGuid guid)
 
BattlegroundPlayer const * GetBattlegroundPlayerData (ObjectGuid const &playerGuid) const
 
void AddPoint (Team team, uint32 points=1)
 
void SetTeamPoint (Team team, uint32 points=0)
 
void RemovePoint (Team team, uint32 points=1)
 
Trinity::unique_weak_ptr< BattlegroundGetWeakPtr () const
 
void SetWeakPtr (Trinity::unique_weak_ptr< Battleground > weakRef)
 

Static Public Member Functions

static TeamId GetTeamIndexByTeamId (Team team)
 

Protected Member Functions

void EndNow ()
 
void PlayerAddedToBGCheckIfBGIsRunning (Player *player)
 
Player_GetPlayer (ObjectGuid guid, bool offlineRemove, char const *context) const
 
Player_GetPlayer (BattlegroundPlayerMap::iterator itr, char const *context)
 
Player_GetPlayer (BattlegroundPlayerMap::const_iterator itr, char const *context) const
 
Player_GetPlayerForTeam (Team team, BattlegroundPlayerMap::const_iterator itr, char const *context) const
 
virtual bool PreUpdateImpl (uint32)
 Pre-update hook. More...
 
virtual void PostUpdateImpl (uint32)
 Post-update hook. More...
 
void _ProcessOfflineQueue ()
 
void _ProcessProgress (uint32 diff)
 
void _ProcessLeave (uint32 diff)
 
void _ProcessJoin (uint32 diff)
 
void _CheckSafePositions (uint32 diff)
 
void _ProcessPlayerPositionBroadcast (uint32 diff)
 
virtual void RemovePlayer (Player *, ObjectGuid, uint32)
 

Protected Attributes

BattlegroundScoreMap PlayerScores
 
BattlegroundPlayerMap m_Players
 
uint8 m_Events
 
BattlegroundStartTimeIntervals StartDelayTimes [BG_STARTING_EVENT_COUNT]
 
uint32 StartMessageIds [BG_STARTING_EVENT_COUNT]
 
int32 m_TeamScores [PVP_TEAMS_COUNT]
 

Private Attributes

uint32 m_InstanceID
 
BattlegroundStatus m_Status
 
uint32 m_ClientInstanceID
 
uint32 m_StartTime
 
uint32 m_ResetStatTimer
 
uint32 m_ValidStartPositionTimer
 
int32 m_EndTime
 
uint8 m_ArenaType
 
bool m_InBGFreeSlotQueue
 
bool m_SetDeleteThis
 
PvPTeamId _winnerTeamId
 
int32 m_StartDelayTime
 
bool m_IsRated
 
bool m_PrematureCountDown
 
uint32 m_PrematureCountDownTimer
 
uint32 m_LastPlayerPositionBroadcast
 
std::deque< ObjectGuidm_OfflineQueue
 
uint32 m_InvitedAlliance
 
uint32 m_InvitedHorde
 
Groupm_BgRaids [PVP_TEAMS_COUNT]
 
uint32 m_PlayersCount [PVP_TEAMS_COUNT]
 
uint32 m_ArenaTeamIds [PVP_TEAMS_COUNT]
 
uint32 m_ArenaTeamMMR [PVP_TEAMS_COUNT]
 
BattlegroundMapm_Map
 
Position StartPosition [PVP_TEAMS_COUNT]
 
BattlegroundTemplate const * _battlegroundTemplate
 
PVPDifficultyEntry const * _pvpDifficultyEntry
 
std::unordered_set< uint32 > const * _pvpStatIds
 
std::vector< WorldPackets::Battleground::BattlegroundPlayerPosition_playerPositions
 
time_t _preparationStartTime
 
Trinity::unique_weak_ptr< Battlegroundm_weakRef
 

Detailed Description

Definition at line 255 of file Battleground.h.

Member Typedef Documentation

◆ BattlegroundPlayerMap

◆ BattlegroundScoreMap

Definition at line 327 of file Battleground.h.

Constructor & Destructor Documentation

◆ Battleground() [1/2]

Battleground::Battleground ( BattlegroundTemplate const *  battlegroundTemplate)

Definition at line 60 of file Battleground.cpp.

◆ Battleground() [2/2]

Battleground::Battleground ( Battleground const &  )
default

◆ ~Battleground()

Battleground::~Battleground ( )
virtual

Definition at line 116 of file Battleground.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ _CheckSafePositions()

void Battleground::_CheckSafePositions ( uint32  diff)
inlineprotected

Definition at line 203 of file Battleground.cpp.

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

◆ _GetPlayer() [1/3]

Player * Battleground::_GetPlayer ( BattlegroundPlayerMap::const_iterator  itr,
char const *  context 
) const
inlineprotected

Definition at line 466 of file Battleground.h.

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

◆ _GetPlayer() [2/3]

Player * Battleground::_GetPlayer ( BattlegroundPlayerMap::iterator  itr,
char const *  context 
)
inlineprotected

Definition at line 465 of file Battleground.h.

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

◆ _GetPlayer() [3/3]

Player * Battleground::_GetPlayer ( ObjectGuid  guid,
bool  offlineRemove,
char const *  context 
) const
protected

Definition at line 474 of file Battleground.cpp.

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

◆ _GetPlayerForTeam()

Player * Battleground::_GetPlayerForTeam ( Team  team,
BattlegroundPlayerMap::const_iterator  itr,
char const *  context 
) const
protected

Definition at line 488 of file Battleground.cpp.

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

◆ _ProcessJoin()

void Battleground::_ProcessJoin ( uint32  diff)
inlineprotected
Todo:
add arena sound PlaySoundToAll(SOUND_ARENA_START);

Definition at line 320 of file Battleground.cpp.

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

◆ _ProcessLeave()

void Battleground::_ProcessLeave ( uint32  diff)
inlineprotected

Definition at line 452 of file Battleground.cpp.

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

◆ _ProcessOfflineQueue()

void Battleground::_ProcessOfflineQueue ( )
inlineprotected

Definition at line 255 of file Battleground.cpp.

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

◆ _ProcessPlayerPositionBroadcast()

void Battleground::_ProcessPlayerPositionBroadcast ( uint32  diff)
protected

Definition at line 233 of file Battleground.cpp.

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

◆ _ProcessProgress()

void Battleground::_ProcessProgress ( uint32  diff)
inlineprotected

Definition at line 284 of file Battleground.cpp.

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

◆ AddOrSetPlayerToCorrectBgGroup()

void Battleground::AddOrSetPlayerToCorrectBgGroup ( Player player,
Team  team 
)

Definition at line 1077 of file Battleground.cpp.

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

◆ AddPlayer()

void Battleground::AddPlayer ( Player player,
BattlegroundQueueTypeId  queueId 
)
virtual

Reimplemented in Arena.

Definition at line 967 of file Battleground.cpp.

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

◆ AddPlayerPosition()

void Battleground::AddPlayerPosition ( WorldPackets::Battleground::BattlegroundPlayerPosition const &  position)

Definition at line 1344 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ AddPoint()

void Battleground::AddPoint ( Team  team,
uint32  points = 1 
)
inline

Definition at line 452 of file Battleground.h.

+ Here is the caller graph for this function:

◆ AddToBGFreeSlotQueue()

void Battleground::AddToBGFreeSlotQueue ( )

Definition at line 1154 of file Battleground.cpp.

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

◆ BlockMovement()

void Battleground::BlockMovement ( Player player)

Definition at line 791 of file Battleground.cpp.

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

◆ BroadcastWorker()

template<class Do >
void Battleground::BroadcastWorker ( Do &  _do)

Definition at line 53 of file Battleground.cpp.

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

◆ BuildPvPLogDataPacket()

void Battleground::BuildPvPLogDataPacket ( WorldPackets::Battleground::PVPMatchStatistics pvpLogData) const
virtual

Reimplemented in Arena.

Definition at line 1255 of file Battleground.cpp.

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

◆ CanAwardArenaPoints()

bool Battleground::CanAwardArenaPoints ( ) const
inline

Definition at line 431 of file Battleground.h.

◆ CastSpellOnTeam()

void Battleground::CastSpellOnTeam ( uint32  SpellID,
Team  team 
)

Definition at line 564 of file Battleground.cpp.

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

◆ CheckWinConditions()

virtual void Battleground::CheckWinConditions ( )
inlinevirtual

Reimplemented in Arena.

Definition at line 393 of file Battleground.h.

+ Here is the caller graph for this function:

◆ DecreaseInvitedCount()

void Battleground::DecreaseInvitedCount ( Team  team)
inline

Definition at line 312 of file Battleground.h.

+ Here is the caller graph for this function:

◆ EndBattleground()

void Battleground::EndBattleground ( Team  winner)
virtual

Reimplemented in Arena.

Definition at line 612 of file Battleground.cpp.

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

◆ EndNow()

void Battleground::EndNow ( )
protected

Definition at line 1359 of file Battleground.cpp.

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

◆ EventPlayerLoggedIn()

void Battleground::EventPlayerLoggedIn ( Player player)

Definition at line 1113 of file Battleground.cpp.

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

◆ EventPlayerLoggedOut()

void Battleground::EventPlayerLoggedOut ( Player player)

Definition at line 1132 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ FindBgMap()

BattlegroundMap * Battleground::FindBgMap ( ) const
inline

Definition at line 341 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetAlivePlayersCountByTeam()

uint32 Battleground::GetAlivePlayersCountByTeam ( Team  team) const

Definition at line 1454 of file Battleground.cpp.

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

◆ GetArenaMatchmakerRating()

uint32 Battleground::GetArenaMatchmakerRating ( Team  team) const
inline

Definition at line 400 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetArenaTeamIdByIndex()

uint32 Battleground::GetArenaTeamIdByIndex ( TeamId  teamId) const
inline

Definition at line 398 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetArenaTeamIdForTeam()

uint32 Battleground::GetArenaTeamIdForTeam ( Team  team) const
inline

Definition at line 397 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetArenaType()

uint8 Battleground::GetArenaType ( ) const
inline

Definition at line 288 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundPlayerData()

BattlegroundPlayer const * Battleground::GetBattlegroundPlayerData ( ObjectGuid const &  playerGuid) const
inline

Definition at line 443 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundScore()

BattlegroundScore const * Battleground::GetBattlegroundScore ( Player player) const

Definition at line 1280 of file Battleground.cpp.

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

◆ GetBGCreature()

Creature * Battleground::GetBGCreature ( uint32  type,
bool  logError = true 
)

◆ GetBgMap()

BattlegroundMap * Battleground::GetBgMap ( ) const

Definition at line 502 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetBGObject()

GameObject * Battleground::GetBGObject ( uint32  type,
bool  logError = true 
)

◆ GetBgRaid()

Group * Battleground::GetBgRaid ( Team  team) const
inline

Definition at line 372 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetBonusHonorFromKill()

uint32 Battleground::GetBonusHonorFromKill ( uint32  kills) const

Definition at line 784 of file Battleground.cpp.

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

◆ GetBracketId()

BattlegroundBracketId Battleground::GetBracketId ( ) const

Definition at line 1512 of file Battleground.cpp.

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

◆ GetClientInstanceID()

uint32 Battleground::GetClientInstanceID ( ) const
inline

Definition at line 275 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetElapsedTime()

uint32 Battleground::GetElapsedTime ( ) const
inline

Definition at line 276 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetExploitTeleportLocation()

virtual WorldSafeLocsEntry const * Battleground::GetExploitTeleportLocation ( Team  )
inlinevirtual

Definition at line 410 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetFreeSlotsForTeam()

uint32 Battleground::GetFreeSlotsForTeam ( Team  team) const

Definition at line 1175 of file Battleground.cpp.

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

◆ GetInstanceID()

uint32 Battleground::GetInstanceID ( ) const
inline

Definition at line 273 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetInvitedCount()

uint32 Battleground::GetInvitedCount ( Team  team) const
inline

Definition at line 315 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetMapId()

uint32 Battleground::GetMapId ( ) const

Definition at line 1305 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetMaxLevel()

uint32 Battleground::GetMaxLevel ( ) const

Definition at line 1540 of file Battleground.cpp.

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

◆ GetMaxPlayers()

uint32 Battleground::GetMaxPlayers ( ) const

Definition at line 1522 of file Battleground.cpp.

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

◆ GetMaxPlayersPerTeam()

uint32 Battleground::GetMaxPlayersPerTeam ( ) const

Definition at line 1548 of file Battleground.cpp.

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

◆ GetMinLevel()

uint32 Battleground::GetMinLevel ( ) const

Definition at line 1532 of file Battleground.cpp.

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

◆ GetMinPlayers()

uint32 Battleground::GetMinPlayers ( ) const

Definition at line 1527 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ GetMinPlayersPerTeam()

uint32 Battleground::GetMinPlayersPerTeam ( ) const

Definition at line 1568 of file Battleground.cpp.

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

◆ GetName()

char const * Battleground::GetName ( ) const

Definition at line 1502 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetPlayers()

BattlegroundPlayerMap const & Battleground::GetPlayers ( ) const
inline

Definition at line 324 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetPlayerScoresSize()

uint32 Battleground::GetPlayerScoresSize ( ) const
inline

Definition at line 328 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetPlayersCountByTeam()

uint32 Battleground::GetPlayersCountByTeam ( Team  team) const
inline

Definition at line 383 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetPlayersSize()

uint32 Battleground::GetPlayersSize ( ) const
inline

Definition at line 325 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetPlayerTeam()

Team Battleground::GetPlayerTeam ( ObjectGuid  guid) const

Definition at line 1418 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetPrematureWinner()

Team Battleground::GetPrematureWinner ( )

Definition at line 273 of file Battleground.cpp.

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

◆ GetPvpStatIds()

std::unordered_set< uint32 > const * Battleground::GetPvpStatIds ( ) const
inline

Definition at line 304 of file Battleground.h.

◆ GetRemainingTime()

uint32 Battleground::GetRemainingTime ( ) const
inline

Definition at line 277 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetScriptId()

uint32 Battleground::GetScriptId ( ) const

Definition at line 779 of file Battleground.cpp.

◆ GetStartDelayTime()

int32 Battleground::GetStartDelayTime ( ) const
inline

Definition at line 287 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetStartMaxDist()

float Battleground::GetStartMaxDist ( ) const

Definition at line 514 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetStatus()

BattlegroundStatus Battleground::GetStatus ( ) const
inline

Definition at line 274 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetTeamIndexByTeamId()

static TeamId Battleground::GetTeamIndexByTeamId ( Team  team)
inlinestatic

Definition at line 382 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetTeamScore()

uint32 Battleground::GetTeamScore ( TeamId  teamId) const

Definition at line 1493 of file Battleground.cpp.

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

◆ GetTeamStartPosition()

WorldSafeLocsEntry const * Battleground::GetTeamStartPosition ( TeamId  teamId) const

Definition at line 508 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetTypeID()

BattlegroundTypeId Battleground::GetTypeID ( ) const

Definition at line 1507 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetUniqueBracketId()

uint8 Battleground::GetUniqueBracketId ( ) const

Definition at line 1517 of file Battleground.cpp.

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

◆ GetWeakPtr()

Trinity::unique_weak_ptr< Battleground > Battleground::GetWeakPtr ( ) const
inline

Definition at line 456 of file Battleground.h.

◆ GetWinner()

PvPTeamId Battleground::GetWinner ( ) const
inline

Definition at line 289 of file Battleground.h.

+ Here is the caller graph for this function:

◆ HandleKillPlayer()

void Battleground::HandleKillPlayer ( Player player,
Player killer 
)
virtual

Reimplemented in Arena.

Definition at line 1366 of file Battleground.cpp.

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

◆ HandleKillUnit()

void Battleground::HandleKillUnit ( Creature victim,
Unit killer 
)
virtual

Definition at line 1410 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ HandlePlayerUnderMap()

virtual bool Battleground::HandlePlayerUnderMap ( Player )
inlinevirtual

Definition at line 420 of file Battleground.h.

+ Here is the caller graph for this function:

◆ HasFreeSlots()

bool Battleground::HasFreeSlots ( ) const

Definition at line 1250 of file Battleground.cpp.

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

◆ IncreaseInvitedCount()

void Battleground::IncreaseInvitedCount ( Team  team)
inline

Definition at line 313 of file Battleground.h.

+ Here is the caller graph for this function:

◆ isArena()

bool Battleground::isArena ( ) const

Definition at line 1240 of file Battleground.cpp.

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

◆ isBattleground()

bool Battleground::isBattleground ( ) const

Definition at line 1245 of file Battleground.cpp.

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

◆ IsPlayerInBattleground()

bool Battleground::IsPlayerInBattleground ( ObjectGuid  guid) const

Definition at line 1426 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ IsPlayerMercenaryInBattleground()

bool Battleground::IsPlayerMercenaryInBattleground ( ObjectGuid  guid) const

Definition at line 1434 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ isRated()

bool Battleground::isRated ( ) const
inline

Definition at line 321 of file Battleground.h.

+ Here is the caller graph for this function:

◆ ModifyStartDelayTime()

void Battleground::ModifyStartDelayTime ( int  diff)
inline

Definition at line 306 of file Battleground.h.

+ Here is the caller graph for this function:

◆ operator=()

Battleground & Battleground::operator= ( Battleground const &  )
delete

◆ PlayerAddedToBGCheckIfBGIsRunning()

void Battleground::PlayerAddedToBGCheckIfBGIsRunning ( Player player)
protected

Definition at line 1442 of file Battleground.cpp.

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

◆ PlaySoundToAll()

void Battleground::PlaySoundToAll ( uint32  SoundID)

Definition at line 554 of file Battleground.cpp.

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

◆ PlaySoundToTeam()

void Battleground::PlaySoundToTeam ( uint32  SoundID,
Team  team 
)

Definition at line 559 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ PostUpdateImpl()

virtual void Battleground::PostUpdateImpl ( uint32  )
inlineprotectedvirtual

Post-update hook.

Will be called after battleground update has passed. May be used to implement custom update effects in subclasses.

Parameters
diffa time difference between two worldserver update loops in milliseconds.
See also
Update(), PreUpdateImpl().

Definition at line 497 of file Battleground.h.

+ Here is the caller graph for this function:

◆ PreUpdateImpl()

virtual bool Battleground::PreUpdateImpl ( uint32  )
inlineprotectedvirtual

Pre-update hook.

Will be called before battleground update is started. Depending on the result of this call actual update body may be skipped.

Parameters
diffa time difference between two worldserver update loops in milliseconds.
Returns
true if update must be performed, false otherwise.
See also
Update(), PostUpdateImpl().

Definition at line 484 of file Battleground.h.

+ Here is the caller graph for this function:

◆ PSendMessageToAll()

void Battleground::PSendMessageToAll ( uint32  entry,
ChatMsg  type,
Player const *  source,
  ... 
)

Definition at line 1329 of file Battleground.cpp.

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

◆ RemoveAuraOnTeam()

void Battleground::RemoveAuraOnTeam ( uint32  SpellID,
Team  team 
)

Definition at line 571 of file Battleground.cpp.

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

◆ RemoveFromBGFreeSlotQueue()

void Battleground::RemoveFromBGFreeSlotQueue ( )

Definition at line 1164 of file Battleground.cpp.

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

◆ RemovePlayer()

virtual void Battleground::RemovePlayer ( Player ,
ObjectGuid  ,
uint32   
)
inlineprotectedvirtual

Reimplemented in Arena.

Definition at line 509 of file Battleground.h.

+ Here is the caller graph for this function:

◆ RemovePlayerAtLeave()

void Battleground::RemovePlayerAtLeave ( ObjectGuid  guid,
bool  Transport,
bool  SendPacket 
)
virtual

Reimplemented in Arena.

Definition at line 797 of file Battleground.cpp.

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

◆ RemovePlayerPosition()

void Battleground::RemovePlayerPosition ( ObjectGuid  guid)

Definition at line 1349 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ RemovePoint()

void Battleground::RemovePoint ( Team  team,
uint32  points = 1 
)
inline

Definition at line 454 of file Battleground.h.

◆ Reset()

void Battleground::Reset ( )

Definition at line 921 of file Battleground.cpp.

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

◆ RewardHonorToTeam()

void Battleground::RewardHonorToTeam ( uint32  Honor,
Team  team 
)

Definition at line 578 of file Battleground.cpp.

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

◆ RewardReputationToTeam()

void Battleground::RewardReputationToTeam ( uint32  faction_id,
uint32  Reputation,
Team  team 
)

Definition at line 585 of file Battleground.cpp.

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

◆ RewardXPAtKill()

void Battleground::RewardXPAtKill ( Player killer,
Player victim 
)

Definition at line 1484 of file Battleground.cpp.

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

◆ SendBroadcastText()

void Battleground::SendBroadcastText ( uint32  id,
ChatMsg  msgType,
WorldObject const *  target = nullptr 
)

Definition at line 541 of file Battleground.cpp.

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

◆ SendChatMessage()

void Battleground::SendChatMessage ( Creature source,
uint8  textId,
WorldObject target = nullptr 
)

Definition at line 536 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ SendMessageToAll()

void Battleground::SendMessageToAll ( uint32  entry,
ChatMsg  type,
Player const *  source = nullptr 
)

Definition at line 1319 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ SendPacketToAll()

void Battleground::SendPacketToAll ( WorldPacket const *  packet) const

Definition at line 519 of file Battleground.cpp.

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

◆ SendPacketToTeam()

void Battleground::SendPacketToTeam ( Team  team,
WorldPacket const *  packet,
Player except = nullptr 
) const

Definition at line 526 of file Battleground.cpp.

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

◆ SetArenaMatchmakerRating()

void Battleground::SetArenaMatchmakerRating ( Team  team,
uint32  MMR 
)
inline

Definition at line 399 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetArenaTeamIdForTeam()

void Battleground::SetArenaTeamIdForTeam ( Team  team,
uint32  ArenaTeamId 
)
inline

Definition at line 396 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetArenaType()

void Battleground::SetArenaType ( uint8  type)
inline

Definition at line 302 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetBgMap()

void Battleground::SetBgMap ( BattlegroundMap map)

Definition at line 1310 of file Battleground.cpp.

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

◆ SetBgRaid()

void Battleground::SetBgRaid ( Team  team,
Group bg_raid 
)

Definition at line 1469 of file Battleground.cpp.

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

◆ SetBracket()

void Battleground::SetBracket ( PVPDifficultyEntry const *  bracketEntry)

Definition at line 1479 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ SetClientInstanceID()

void Battleground::SetClientInstanceID ( uint32  InstanceID)
inline

Definition at line 298 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetDeleteThis()

void Battleground::SetDeleteThis ( )
inline

Definition at line 428 of file Battleground.h.

◆ SetElapsedTime()

void Battleground::SetElapsedTime ( uint32  Time)
inline

Definition at line 299 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetInstanceID()

void Battleground::SetInstanceID ( uint32  InstanceID)
inline

Definition at line 296 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetRated()

void Battleground::SetRated ( bool  state)
inline

Definition at line 301 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetRemainingTime()

void Battleground::SetRemainingTime ( uint32  Time)
inline

Definition at line 300 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetStartDelayTime()

void Battleground::SetStartDelayTime ( int  Time)
inline

Definition at line 307 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetStatus()

void Battleground::SetStatus ( BattlegroundStatus  Status)
inline

Definition at line 297 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetTeamPoint()

void Battleground::SetTeamPoint ( Team  team,
uint32  points = 0 
)
inline

Definition at line 453 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetWeakPtr()

void Battleground::SetWeakPtr ( Trinity::unique_weak_ptr< Battleground weakRef)
inline

Definition at line 457 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetWinner()

void Battleground::SetWinner ( PvPTeamId  winnerTeamId)
inline

Definition at line 303 of file Battleground.h.

+ Here is the caller graph for this function:

◆ StartBattleground()

void Battleground::StartBattleground ( )

Definition at line 946 of file Battleground.cpp.

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

◆ TeleportPlayerToExploitLocation()

void Battleground::TeleportPlayerToExploitLocation ( Player player)

Definition at line 961 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ ToBeDeleted()

bool Battleground::ToBeDeleted ( ) const
inline

Definition at line 427 of file Battleground.h.

+ Here is the caller graph for this function:

◆ Update()

void Battleground::Update ( uint32  diff)

Definition at line 137 of file Battleground.cpp.

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

◆ UpdatePlayerScore()

bool Battleground::UpdatePlayerScore ( Player player,
uint32  type,
uint32  value,
bool  doAddHonor = true 
)

Definition at line 1285 of file Battleground.cpp.

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

◆ UpdatePlayersCountByTeam()

void Battleground::UpdatePlayersCountByTeam ( Team  team,
bool  remove 
)
inline

Definition at line 385 of file Battleground.h.

+ Here is the caller graph for this function:

◆ UpdatePvpStat()

void Battleground::UpdatePvpStat ( Player player,
uint32  pvpStatId,
uint32  value 
)

Definition at line 1299 of file Battleground.cpp.

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

◆ UpdateWorldState()

void Battleground::UpdateWorldState ( int32  worldStateId,
int32  value,
bool  hidden = false 
)

Definition at line 607 of file Battleground.cpp.

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

Member Data Documentation

◆ _battlegroundTemplate

BattlegroundTemplate const* Battleground::_battlegroundTemplate
private

Definition at line 566 of file Battleground.h.

◆ _playerPositions

std::vector<WorldPackets::Battleground::BattlegroundPlayerPosition> Battleground::_playerPositions
private

Definition at line 570 of file Battleground.h.

◆ _preparationStartTime

time_t Battleground::_preparationStartTime
private

Definition at line 573 of file Battleground.h.

◆ _pvpDifficultyEntry

PVPDifficultyEntry const* Battleground::_pvpDifficultyEntry
private

Definition at line 567 of file Battleground.h.

◆ _pvpStatIds

std::unordered_set<uint32> const* Battleground::_pvpStatIds
private

Definition at line 568 of file Battleground.h.

◆ _winnerTeamId

PvPTeamId Battleground::_winnerTeamId
private

Definition at line 535 of file Battleground.h.

◆ m_ArenaTeamIds

uint32 Battleground::m_ArenaTeamIds[PVP_TEAMS_COUNT]
private

Definition at line 558 of file Battleground.h.

◆ m_ArenaTeamMMR

uint32 Battleground::m_ArenaTeamMMR[PVP_TEAMS_COUNT]
private

Definition at line 560 of file Battleground.h.

◆ m_ArenaType

uint8 Battleground::m_ArenaType
private

Definition at line 531 of file Battleground.h.

◆ m_BgRaids

Group* Battleground::m_BgRaids[PVP_TEAMS_COUNT]
private

Definition at line 552 of file Battleground.h.

◆ m_ClientInstanceID

uint32 Battleground::m_ClientInstanceID
private

Definition at line 526 of file Battleground.h.

◆ m_EndTime

int32 Battleground::m_EndTime
private

Definition at line 530 of file Battleground.h.

◆ m_Events

uint8 Battleground::m_Events
protected

Definition at line 515 of file Battleground.h.

◆ m_InBGFreeSlotQueue

bool Battleground::m_InBGFreeSlotQueue
private

Definition at line 532 of file Battleground.h.

◆ m_InstanceID

uint32 Battleground::m_InstanceID
private

Definition at line 524 of file Battleground.h.

◆ m_InvitedAlliance

uint32 Battleground::m_InvitedAlliance
private

Definition at line 548 of file Battleground.h.

◆ m_InvitedHorde

uint32 Battleground::m_InvitedHorde
private

Definition at line 549 of file Battleground.h.

◆ m_IsRated

bool Battleground::m_IsRated
private

Definition at line 537 of file Battleground.h.

◆ m_LastPlayerPositionBroadcast

uint32 Battleground::m_LastPlayerPositionBroadcast
private

Definition at line 540 of file Battleground.h.

◆ m_Map

BattlegroundMap* Battleground::m_Map
private

Definition at line 563 of file Battleground.h.

◆ m_OfflineQueue

std::deque<ObjectGuid> Battleground::m_OfflineQueue
private

Definition at line 543 of file Battleground.h.

◆ m_Players

BattlegroundPlayerMap Battleground::m_Players
protected

Definition at line 512 of file Battleground.h.

◆ m_PlayersCount

uint32 Battleground::m_PlayersCount[PVP_TEAMS_COUNT]
private

Definition at line 555 of file Battleground.h.

◆ m_PrematureCountDown

bool Battleground::m_PrematureCountDown
private

Definition at line 538 of file Battleground.h.

◆ m_PrematureCountDownTimer

uint32 Battleground::m_PrematureCountDownTimer
private

Definition at line 539 of file Battleground.h.

◆ m_ResetStatTimer

uint32 Battleground::m_ResetStatTimer
private

Definition at line 528 of file Battleground.h.

◆ m_SetDeleteThis

bool Battleground::m_SetDeleteThis
private

Definition at line 533 of file Battleground.h.

◆ m_StartDelayTime

int32 Battleground::m_StartDelayTime
private

Definition at line 536 of file Battleground.h.

◆ m_StartTime

uint32 Battleground::m_StartTime
private

Definition at line 527 of file Battleground.h.

◆ m_Status

BattlegroundStatus Battleground::m_Status
private

Definition at line 525 of file Battleground.h.

◆ m_TeamScores

int32 Battleground::m_TeamScores[PVP_TEAMS_COUNT]
protected

Definition at line 520 of file Battleground.h.

◆ m_ValidStartPositionTimer

uint32 Battleground::m_ValidStartPositionTimer
private

Definition at line 529 of file Battleground.h.

◆ m_weakRef

Trinity::unique_weak_ptr<Battleground> Battleground::m_weakRef
private

Definition at line 575 of file Battleground.h.

◆ PlayerScores

BattlegroundScoreMap Battleground::PlayerScores
protected

Definition at line 507 of file Battleground.h.

◆ StartDelayTimes

BattlegroundStartTimeIntervals Battleground::StartDelayTimes[BG_STARTING_EVENT_COUNT]
protected

Definition at line 516 of file Battleground.h.

◆ StartMessageIds

uint32 Battleground::StartMessageIds[BG_STARTING_EVENT_COUNT]
protected

Definition at line 518 of file Battleground.h.

◆ StartPosition

Position Battleground::StartPosition[PVP_TEAMS_COUNT]
private

Definition at line 564 of file Battleground.h.


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