TrinityCore
Loading...
Searching...
No Matches
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
 
Milliseconds GetInProgressDuration () 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, Optional< HonorGainSource > source={})
 
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 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.
 
virtual void PostUpdateImpl (uint32)
 Post-update hook.
 
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_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 258 of file Battleground.h.

Member Typedef Documentation

◆ BattlegroundPlayerMap

◆ BattlegroundScoreMap

Definition at line 331 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 113 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 200 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 467 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 466 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 471 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 485 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 317 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 449 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 252 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 230 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 281 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 1078 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 968 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 1345 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 453 of file Battleground.h.

+ Here is the caller graph for this function:

◆ AddToBGFreeSlotQueue()

void Battleground::AddToBGFreeSlotQueue ( )

Definition at line 1155 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 792 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 1256 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 432 of file Battleground.h.

◆ CastSpellOnTeam()

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

Definition at line 561 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 397 of file Battleground.h.

+ Here is the caller graph for this function:

◆ DecreaseInvitedCount()

void Battleground::DecreaseInvitedCount ( Team  team)
inline

Definition at line 316 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 609 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 1360 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 1114 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 1133 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ FindBgMap()

BattlegroundMap * Battleground::FindBgMap ( ) const
inline

Definition at line 345 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetAlivePlayersCountByTeam()

uint32 Battleground::GetAlivePlayersCountByTeam ( Team  team) const

Definition at line 1455 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 401 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetArenaType()

uint8 Battleground::GetArenaType ( ) const
inline

Definition at line 292 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 444 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetBattlegroundScore()

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

Definition at line 1281 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 499 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 376 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetBonusHonorFromKill()

uint32 Battleground::GetBonusHonorFromKill ( uint32  kills) const

Definition at line 785 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 1513 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 278 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetElapsedTime()

uint32 Battleground::GetElapsedTime ( ) const
inline

Definition at line 279 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetExploitTeleportLocation()

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

Definition at line 411 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetFreeSlotsForTeam()

uint32 Battleground::GetFreeSlotsForTeam ( Team  team) const

Definition at line 1176 of file Battleground.cpp.

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

◆ GetInProgressDuration()

Milliseconds Battleground::GetInProgressDuration ( ) const
inline

Definition at line 280 of file Battleground.h.

◆ GetInstanceID()

uint32 Battleground::GetInstanceID ( ) const
inline

Definition at line 276 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetInvitedCount()

uint32 Battleground::GetInvitedCount ( Team  team) const
inline

Definition at line 319 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetMapId()

uint32 Battleground::GetMapId ( ) const

Definition at line 1306 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetMaxLevel()

uint32 Battleground::GetMaxLevel ( ) const

Definition at line 1541 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 1523 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 1549 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 1533 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 1528 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ GetMinPlayersPerTeam()

uint32 Battleground::GetMinPlayersPerTeam ( ) const

Definition at line 1569 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 1503 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetPlayers()

BattlegroundPlayerMap const & Battleground::GetPlayers ( ) const
inline

Definition at line 328 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetPlayerScoresSize()

uint32 Battleground::GetPlayerScoresSize ( ) const
inline

Definition at line 332 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetPlayersCountByTeam()

uint32 Battleground::GetPlayersCountByTeam ( Team  team) const
inline

Definition at line 387 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetPlayersSize()

uint32 Battleground::GetPlayersSize ( ) const
inline

Definition at line 329 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetPlayerTeam()

Team Battleground::GetPlayerTeam ( ObjectGuid  guid) const

Definition at line 1419 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetPrematureWinner()

Team Battleground::GetPrematureWinner ( )

Definition at line 270 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 308 of file Battleground.h.

◆ GetRemainingTime()

uint32 Battleground::GetRemainingTime ( ) const
inline

Definition at line 281 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetScriptId()

uint32 Battleground::GetScriptId ( ) const

Definition at line 780 of file Battleground.cpp.

◆ GetStartDelayTime()

int32 Battleground::GetStartDelayTime ( ) const
inline

Definition at line 291 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetStartMaxDist()

float Battleground::GetStartMaxDist ( ) const

Definition at line 511 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetStatus()

BattlegroundStatus Battleground::GetStatus ( ) const
inline

Definition at line 277 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetTeamIndexByTeamId()

static TeamId Battleground::GetTeamIndexByTeamId ( Team  team)
inlinestatic

Definition at line 386 of file Battleground.h.

+ Here is the caller graph for this function:

◆ GetTeamScore()

uint32 Battleground::GetTeamScore ( TeamId  teamId) const

Definition at line 1494 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 505 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetTypeID()

BattlegroundTypeId Battleground::GetTypeID ( ) const

Definition at line 1508 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ GetUniqueBracketId()

uint8 Battleground::GetUniqueBracketId ( ) const

Definition at line 1518 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 457 of file Battleground.h.

◆ GetWinner()

PvPTeamId Battleground::GetWinner ( ) const
inline

Definition at line 293 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 1367 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 1411 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ HandlePlayerUnderMap()

virtual bool Battleground::HandlePlayerUnderMap ( Player )
inlinevirtual

Definition at line 421 of file Battleground.h.

+ Here is the caller graph for this function:

◆ HasFreeSlots()

bool Battleground::HasFreeSlots ( ) const

Definition at line 1251 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 317 of file Battleground.h.

+ Here is the caller graph for this function:

◆ isArena()

bool Battleground::isArena ( ) const

Definition at line 1241 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 1246 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 1427 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ IsPlayerMercenaryInBattleground()

bool Battleground::IsPlayerMercenaryInBattleground ( ObjectGuid  guid) const

Definition at line 1435 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ isRated()

bool Battleground::isRated ( ) const
inline

Definition at line 325 of file Battleground.h.

+ Here is the caller graph for this function:

◆ ModifyStartDelayTime()

void Battleground::ModifyStartDelayTime ( int  diff)
inline

Definition at line 310 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 1443 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 551 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 556 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 498 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 485 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 1330 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 568 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 1165 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 510 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 798 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 1350 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 455 of file Battleground.h.

◆ Reset()

void Battleground::Reset ( )

Definition at line 922 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 575 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 582 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 1485 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 538 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 533 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 1320 of file Battleground.cpp.

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

◆ SendPacketToAll()

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

Definition at line 516 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 523 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 400 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetArenaType()

void Battleground::SetArenaType ( uint8  type)
inline

Definition at line 306 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetBgMap()

void Battleground::SetBgMap ( BattlegroundMap map)

Definition at line 1311 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 1470 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 1480 of file Battleground.cpp.

+ Here is the caller graph for this function:

◆ SetClientInstanceID()

void Battleground::SetClientInstanceID ( uint32  InstanceID)
inline

Definition at line 302 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetDeleteThis()

void Battleground::SetDeleteThis ( )
inline

Definition at line 429 of file Battleground.h.

◆ SetElapsedTime()

void Battleground::SetElapsedTime ( uint32  Time)
inline

Definition at line 303 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetInstanceID()

void Battleground::SetInstanceID ( uint32  InstanceID)
inline

Definition at line 300 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetRated()

void Battleground::SetRated ( bool  state)
inline

Definition at line 305 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetRemainingTime()

void Battleground::SetRemainingTime ( uint32  Time)
inline

Definition at line 304 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetStartDelayTime()

void Battleground::SetStartDelayTime ( int  Time)
inline

Definition at line 311 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetStatus()

void Battleground::SetStatus ( BattlegroundStatus  Status)
inline

Definition at line 301 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 454 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 458 of file Battleground.h.

+ Here is the caller graph for this function:

◆ SetWinner()

void Battleground::SetWinner ( PvPTeamId  winnerTeamId)
inline

Definition at line 307 of file Battleground.h.

+ Here is the caller graph for this function:

◆ StartBattleground()

void Battleground::StartBattleground ( )

Definition at line 947 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 962 of file Battleground.cpp.

+ Here is the call graph for this function:

◆ ToBeDeleted()

bool Battleground::ToBeDeleted ( ) const
inline

Definition at line 428 of file Battleground.h.

+ Here is the caller graph for this function:

◆ Update()

void Battleground::Update ( uint32  diff)

Definition at line 134 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,
Optional< HonorGainSource source = {} 
)

Definition at line 1286 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 389 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 1300 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 604 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 564 of file Battleground.h.

◆ _playerPositions

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

Definition at line 568 of file Battleground.h.

◆ _preparationStartTime

time_t Battleground::_preparationStartTime
private

Definition at line 571 of file Battleground.h.

◆ _pvpDifficultyEntry

PVPDifficultyEntry const* Battleground::_pvpDifficultyEntry
private

Definition at line 565 of file Battleground.h.

◆ _pvpStatIds

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

Definition at line 566 of file Battleground.h.

◆ _winnerTeamId

PvPTeamId Battleground::_winnerTeamId
private

Definition at line 536 of file Battleground.h.

◆ m_ArenaTeamMMR

uint32 Battleground::m_ArenaTeamMMR[PVP_TEAMS_COUNT]
private

Definition at line 558 of file Battleground.h.

◆ m_ArenaType

uint8 Battleground::m_ArenaType
private

Definition at line 532 of file Battleground.h.

◆ m_BgRaids

Group* Battleground::m_BgRaids[PVP_TEAMS_COUNT]
private

Definition at line 553 of file Battleground.h.

◆ m_ClientInstanceID

uint32 Battleground::m_ClientInstanceID
private

Definition at line 527 of file Battleground.h.

◆ m_EndTime

int32 Battleground::m_EndTime
private

Definition at line 531 of file Battleground.h.

◆ m_Events

uint8 Battleground::m_Events
protected

Definition at line 516 of file Battleground.h.

◆ m_InBGFreeSlotQueue

bool Battleground::m_InBGFreeSlotQueue
private

Definition at line 533 of file Battleground.h.

◆ m_InstanceID

uint32 Battleground::m_InstanceID
private

Definition at line 525 of file Battleground.h.

◆ m_InvitedAlliance

uint32 Battleground::m_InvitedAlliance
private

Definition at line 549 of file Battleground.h.

◆ m_InvitedHorde

uint32 Battleground::m_InvitedHorde
private

Definition at line 550 of file Battleground.h.

◆ m_IsRated

bool Battleground::m_IsRated
private

Definition at line 538 of file Battleground.h.

◆ m_LastPlayerPositionBroadcast

uint32 Battleground::m_LastPlayerPositionBroadcast
private

Definition at line 541 of file Battleground.h.

◆ m_Map

BattlegroundMap* Battleground::m_Map
private

Definition at line 561 of file Battleground.h.

◆ m_OfflineQueue

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

Definition at line 544 of file Battleground.h.

◆ m_Players

BattlegroundPlayerMap Battleground::m_Players
protected

Definition at line 513 of file Battleground.h.

◆ m_PlayersCount

uint32 Battleground::m_PlayersCount[PVP_TEAMS_COUNT]
private

Definition at line 556 of file Battleground.h.

◆ m_PrematureCountDown

bool Battleground::m_PrematureCountDown
private

Definition at line 539 of file Battleground.h.

◆ m_PrematureCountDownTimer

uint32 Battleground::m_PrematureCountDownTimer
private

Definition at line 540 of file Battleground.h.

◆ m_ResetStatTimer

uint32 Battleground::m_ResetStatTimer
private

Definition at line 529 of file Battleground.h.

◆ m_SetDeleteThis

bool Battleground::m_SetDeleteThis
private

Definition at line 534 of file Battleground.h.

◆ m_StartDelayTime

int32 Battleground::m_StartDelayTime
private

Definition at line 537 of file Battleground.h.

◆ m_StartTime

uint32 Battleground::m_StartTime
private

Definition at line 528 of file Battleground.h.

◆ m_Status

BattlegroundStatus Battleground::m_Status
private

Definition at line 526 of file Battleground.h.

◆ m_TeamScores

int32 Battleground::m_TeamScores[PVP_TEAMS_COUNT]
protected

Definition at line 521 of file Battleground.h.

◆ m_ValidStartPositionTimer

uint32 Battleground::m_ValidStartPositionTimer
private

Definition at line 530 of file Battleground.h.

◆ m_weakRef

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

Definition at line 573 of file Battleground.h.

◆ PlayerScores

BattlegroundScoreMap Battleground::PlayerScores
protected

Definition at line 508 of file Battleground.h.

◆ StartDelayTimes

BattlegroundStartTimeIntervals Battleground::StartDelayTimes[BG_STARTING_EVENT_COUNT]
protected

Definition at line 517 of file Battleground.h.

◆ StartMessageIds

uint32 Battleground::StartMessageIds[BG_STARTING_EVENT_COUNT]
protected

Definition at line 519 of file Battleground.h.

◆ StartPosition

Position Battleground::StartPosition[PVP_TEAMS_COUNT]
private

Definition at line 562 of file Battleground.h.


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