TrinityCore
Arena Class Reference

#include <Arena.h>

+ Inheritance diagram for Arena:

Public Member Functions

 Arena (BattlegroundTemplate const *battlegroundTemplate)
 
- Public Member Functions inherited from Battleground
 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)
 

Protected Member Functions

void AddPlayer (Player *player, BattlegroundQueueTypeId queueId) override
 
void RemovePlayer (Player *, ObjectGuid, uint32) override
 
void UpdateArenaWorldState ()
 
void HandleKillPlayer (Player *player, Player *killer) override
 
void BuildPvPLogDataPacket (WorldPackets::Battleground::PVPMatchStatistics &pvpLogData) const override
 
- Protected Member Functions inherited from Battleground
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)
 

Private Member Functions

void RemovePlayerAtLeave (ObjectGuid guid, bool transport, bool sendPacket) override
 
void CheckWinConditions () override
 
void EndBattleground (Team winner) override
 

Private Attributes

ArenaTeamScore _arenaTeamScores [PVP_TEAMS_COUNT]
 

Additional Inherited Members

- Public Types inherited from Battleground
typedef std::map< ObjectGuid, BattlegroundPlayerBattlegroundPlayerMap
 
typedef std::map< ObjectGuid, BattlegroundScore * > BattlegroundScoreMap
 
- Static Public Member Functions inherited from Battleground
static TeamId GetTeamIndexByTeamId (Team team)
 
- Protected Attributes inherited from Battleground
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]
 

Detailed Description

Definition at line 56 of file Arena.h.

Constructor & Destructor Documentation

◆ Arena()

Arena::Arena ( BattlegroundTemplate const *  battlegroundTemplate)

Definition at line 31 of file Arena.cpp.

Member Function Documentation

◆ AddPlayer()

void Arena::AddPlayer ( Player player,
BattlegroundQueueTypeId  queueId 
)
overrideprotectedvirtual

Reimplemented from Battleground.

Definition at line 44 of file Arena.cpp.

+ Here is the call graph for this function:

◆ BuildPvPLogDataPacket()

void Arena::BuildPvPLogDataPacket ( WorldPackets::Battleground::PVPMatchStatistics pvpLogData) const
overrideprotectedvirtual

Reimplemented from Battleground.

Definition at line 92 of file Arena.cpp.

+ Here is the call graph for this function:

◆ CheckWinConditions()

void Arena::CheckWinConditions ( )
overrideprivatevirtual

Reimplemented from Battleground.

Definition at line 137 of file Arena.cpp.

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

◆ EndBattleground()

void Arena::EndBattleground ( Team  winner)
overrideprivatevirtual

Reimplemented from Battleground.

Definition at line 145 of file Arena.cpp.

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

◆ HandleKillPlayer()

void Arena::HandleKillPlayer ( Player player,
Player killer 
)
overrideprotectedvirtual

Reimplemented from Battleground.

Definition at line 81 of file Arena.cpp.

+ Here is the call graph for this function:

◆ RemovePlayer()

void Arena::RemovePlayer ( Player ,
ObjectGuid  ,
uint32   
)
overrideprotectedvirtual

Reimplemented from Battleground.

Definition at line 66 of file Arena.cpp.

+ Here is the call graph for this function:

◆ RemovePlayerAtLeave()

void Arena::RemovePlayerAtLeave ( ObjectGuid  guid,
bool  transport,
bool  sendPacket 
)
overrideprivatevirtual

Reimplemented from Battleground.

Definition at line 109 of file Arena.cpp.

+ Here is the call graph for this function:

◆ UpdateArenaWorldState()

void Arena::UpdateArenaWorldState ( )
protected

Definition at line 75 of file Arena.cpp.

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

Member Data Documentation

◆ _arenaTeamScores

ArenaTeamScore Arena::_arenaTeamScores[PVP_TEAMS_COUNT]
private

Definition at line 75 of file Arena.h.


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