![]() |
TrinityCore
|
#include <BattlegroundMgr.h>
Classes | |
| struct | ScheduledQueueUpdate |
Private Types | |
| typedef std::map< BattlegroundTypeId, BattlegroundData > | BattlegroundDataContainer |
| typedef std::map< BattlegroundTypeId, BattlegroundTemplate > | BattlegroundTemplateMap |
| typedef std::map< uint32, BattlegroundTemplate * > | BattlegroundMapTemplateContainer |
Private Member Functions | |
| BattlegroundMgr () | |
| ~BattlegroundMgr () | |
| uint32 | CreateClientVisibleInstanceId (BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id) |
| BattlegroundTypeId | GetRandomBG (BattlegroundTypeId id) |
| BattlegroundTemplate const * | GetBattlegroundTemplateByMapId (uint32 mapId) |
Static Private Member Functions | |
| static bool | IsArenaType (BattlegroundTypeId bgTypeId) |
Private Attributes | |
| BattlegroundDataContainer | bgDataStore |
| std::map< BattlegroundQueueTypeId, BattlegroundQueue > | m_BattlegroundQueues |
| std::map< uint32, BGFreeSlotQueueContainer > | m_BGFreeSlotQueue |
| std::vector< ScheduledQueueUpdate > | m_QueueUpdateScheduler |
| uint32 | m_NextRatedArenaUpdate |
| uint32 | m_UpdateTimer |
| uint32 | m_ArenaTesting |
| bool | m_Testing |
| BattleMastersMap | mBattleMastersMap |
| BattlegroundTemplateMap | _battlegroundTemplates |
| BattlegroundMapTemplateContainer | _battlegroundMapTemplates |
| std::map< std::pair< int32, uint32 >, BattlegroundScriptTemplate > | _battlegroundScriptTemplates |
Definition at line 84 of file BattlegroundMgr.h.
|
private |
Definition at line 173 of file BattlegroundMgr.h.
|
private |
Definition at line 204 of file BattlegroundMgr.h.
|
private |
Definition at line 203 of file BattlegroundMgr.h.
|
private |
Definition at line 66 of file BattlegroundMgr.cpp.
|
private |
Definition at line 71 of file BattlegroundMgr.cpp.
References DeleteAllBattlegrounds().
|
delete |
|
delete |
| void BattlegroundMgr::AddBattleground | ( | Battleground * | bg | ) |
Definition at line 752 of file BattlegroundMgr.cpp.
References bgDataStore, Battleground::GetInstanceID(), Battleground::GetTypeID(), Trinity::unique_trackable_ptr< T >::reset(), and Battleground::SetWeakPtr().
| void BattlegroundMgr::AddToBGFreeSlotQueue | ( | Battleground * | bg | ) |
Definition at line 737 of file BattlegroundMgr.cpp.
References Battleground::GetMapId(), and m_BGFreeSlotQueue.
|
static |
Definition at line 513 of file BattlegroundMgr.cpp.
References AsUnderlyingType(), and BattlegroundQueueTypeId::BattlemasterListId.
Referenced by Group::CanJoinBattlegroundQueue(), WorldSession::HandleBattlemasterJoinArena(), WorldSession::HandleBattlemasterJoinOpcode(), and Update().
|
static |
Definition at line 675 of file BattlegroundMgr.cpp.
References BATTLEGROUND_AB, BATTLEGROUND_AV, BATTLEGROUND_BFG, BATTLEGROUND_EY, BATTLEGROUND_IC, BATTLEGROUND_SA, BATTLEGROUND_TP, BATTLEGROUND_WS, HOLIDAY_CALL_TO_ARMS_AB, HOLIDAY_CALL_TO_ARMS_AV, HOLIDAY_CALL_TO_ARMS_BG, HOLIDAY_CALL_TO_ARMS_ES, HOLIDAY_CALL_TO_ARMS_IC, HOLIDAY_CALL_TO_ARMS_SA, HOLIDAY_CALL_TO_ARMS_TP, HOLIDAY_CALL_TO_ARMS_WG, and HOLIDAY_NONE.
Referenced by IsBGWeekend().
|
static |
Definition at line 192 of file BattlegroundMgr.cpp.
References WorldPackets::Battleground::BattlefieldStatusActive::ArenaFaction, BuildBattlegroundStatusHeader(), Player::GetBGTeam(), Battleground::GetElapsedTime(), Battleground::GetMapId(), Battleground::GetRemainingTime(), WorldPackets::Battleground::BattlefieldStatusActive::Hdr, HORDE, WorldPackets::Battleground::BattlefieldStatusActive::LeftEarly, WorldPackets::Battleground::BattlefieldStatusActive::Mapid, PVP_TEAM_ALLIANCE, PVP_TEAM_HORDE, WorldPackets::Battleground::BattlefieldStatusActive::ShutdownTimer, and WorldPackets::Battleground::BattlefieldStatusActive::StartTimer.
Referenced by Battleground::_ProcessProgress(), WorldSession::HandleBattleFieldPortOpcode(), and WorldSession::HandleRequestBattlefieldStatusOpcode().
|
static |
Definition at line 212 of file BattlegroundMgr.cpp.
References WorldPackets::LFG::Battlegrounds, WorldPackets::Battleground::BattlefieldStatusFailed::ClientID, ERR_BATTLEGROUND_JOIN_TIMED_OUT, ERR_BATTLEGROUND_NOT_IN_BATTLEGROUND, Player::GetBattlegroundQueueJoinTime(), BaseEntity::GetGUID(), BattlegroundQueueTypeId::GetPacked(), WorldPackets::LFG::RideTicket::Id, WorldPackets::Battleground::BattlefieldStatusFailed::QueueID, WorldPackets::Battleground::BattlefieldStatusFailed::Reason, WorldPackets::LFG::RideTicket::RequesterGuid, WorldPackets::Battleground::BattlefieldStatusFailed::Ticket, WorldPackets::LFG::RideTicket::Time, and WorldPackets::LFG::RideTicket::Type.
Referenced by WorldSession::HandleBattleFieldPortOpcode(), WorldSession::HandleBattlemasterJoinArena(), and WorldSession::HandleBattlemasterJoinOpcode().
|
static |
Definition at line 161 of file BattlegroundMgr.cpp.
References WorldPackets::LFG::Battlegrounds, CURRENT_EXPANSION, BaseEntity::GetGUID(), GetMaxLevelForExpansion(), BattlegroundQueueTypeId::GetPacked(), WorldPackets::LFG::RideTicket::Id, WorldPackets::Battleground::BattlefieldStatusHeader::InstanceID, WorldPackets::Battleground::BattlefieldStatusHeader::QueueID, WorldPackets::Battleground::BattlefieldStatusHeader::RangeMax, WorldPackets::Battleground::BattlefieldStatusHeader::RangeMin, BattlegroundQueueTypeId::Rated, WorldPackets::Battleground::BattlefieldStatusHeader::RegisteredMatch, WorldPackets::LFG::RideTicket::RequesterGuid, BattlegroundQueueTypeId::TeamSize, WorldPackets::Battleground::BattlefieldStatusHeader::TeamSize, WorldPackets::Battleground::BattlefieldStatusHeader::Ticket, WorldPackets::LFG::RideTicket::Time, WorldPackets::Battleground::BattlefieldStatusHeader::TournamentRules, and WorldPackets::LFG::RideTicket::Type.
Referenced by BuildBattlegroundStatusActive(), BuildBattlegroundStatusNeedConfirmation(), and BuildBattlegroundStatusQueued().
|
static |
Definition at line 184 of file BattlegroundMgr.cpp.
References BuildBattlegroundStatusHeader(), Battleground::GetMapId(), WorldPackets::Battleground::BattlefieldStatusNeedConfirmation::Hdr, WorldPackets::Battleground::BattlefieldStatusNeedConfirmation::Mapid, WorldPackets::Battleground::BattlefieldStatusNeedConfirmation::Role, and WorldPackets::Battleground::BattlefieldStatusNeedConfirmation::Timeout.
Referenced by BGQueueInviteEvent::Execute(), WorldSession::HandleRequestBattlefieldStatusOpcode(), and BattlegroundQueue::InviteGroupToBG().
|
static |
Definition at line 176 of file BattlegroundMgr.cpp.
References WorldPackets::LFG::Battlegrounds, BaseEntity::GetGUID(), WorldPackets::LFG::RideTicket::Id, WorldPackets::LFG::RideTicket::RequesterGuid, WorldPackets::Battleground::BattlefieldStatusNone::Ticket, WorldPackets::LFG::RideTicket::Time, and WorldPackets::LFG::RideTicket::Type.
Referenced by BGQueueRemoveEvent::Execute(), BattlegroundQueue::RemovePlayer(), and Battleground::RemovePlayerAtLeave().
|
static |
Definition at line 202 of file BattlegroundMgr.cpp.
References WorldPackets::Battleground::BattlefieldStatusQueued::AsGroup, WorldPackets::Battleground::BattlefieldStatusQueued::AverageWaitTime, BuildBattlegroundStatusHeader(), WorldPackets::Battleground::BattlefieldStatusQueued::EligibleForMatchmaking, GetMSTimeDiffToNow(), WorldPackets::Battleground::BattlefieldStatusQueued::Hdr, WorldPackets::Battleground::BattlefieldStatusQueued::SuspendedQueue, and WorldPackets::Battleground::BattlefieldStatusQueued::WaitTime.
Referenced by WorldSession::HandleBattlemasterJoinArena(), WorldSession::HandleBattlemasterJoinOpcode(), and WorldSession::HandleRequestBattlefieldStatusOpcode().
| void BattlegroundMgr::CheckBattleMasters | ( | ) |
Definition at line 662 of file BattlegroundMgr.cpp.
References mBattleMastersMap, sObjectMgr, TC_LOG_ERROR, and UNIT_NPC_FLAG_BATTLEMASTER.
Referenced by LoadBattleMastersEntry().
|
private |
Definition at line 317 of file BattlegroundMgr.cpp.
References bgDataStore, and IsArenaType().
Referenced by CreateNewBattleground().
| Battleground * BattlegroundMgr::CreateNewBattleground | ( | BattlegroundQueueTypeId | queueId, |
| BattlegroundBracketId | bracketId | ||
| ) |
Definition at line 343 of file BattlegroundMgr.cpp.
References BattlegroundQueueTypeId::BattlemasterListId, CreateClientVisibleInstanceId(), DB2Manager::GetBattlegroundBracketById(), GetBattlegroundTemplateByTypeId(), PVPDifficultyEntry::GetBracketId(), GetRandomBG(), BattlegroundTemplate::IsArena(), BattlegroundTemplate::MapIDs, BattlegroundQueueTypeId::Rated, Battleground::Reset(), Battleground::SetArenaType(), Battleground::SetBracket(), Battleground::SetClientInstanceID(), Battleground::SetInstanceID(), Battleground::SetRated(), Battleground::SetStatus(), sMapMgr, STATUS_WAIT_JOIN, TC_LOG_ERROR, and BattlegroundQueueTypeId::TeamSize.
| void BattlegroundMgr::DeleteAllBattlegrounds | ( | ) |
Definition at line 76 of file BattlegroundMgr.cpp.
References bgDataStore, and m_BGFreeSlotQueue.
Referenced by ~BattlegroundMgr().
| BattlegroundScriptTemplate const * BattlegroundMgr::FindBattlegroundScriptTemplate | ( | uint32 | mapId, |
| BattlegroundTypeId | bgTypeId | ||
| ) | const |
Definition at line 299 of file BattlegroundMgr.cpp.
References _battlegroundScriptTemplates, BATTLEGROUND_TYPE_NONE, and Trinity::Containers::MapGetValuePtr().
| Battleground * BattlegroundMgr::GetBattleground | ( | uint32 | InstanceID, |
| BattlegroundTypeId | bgTypeId | ||
| ) |
Definition at line 224 of file BattlegroundMgr.cpp.
References BATTLEGROUND_TYPE_NONE, bgDataStore, and IsRandomBattleground().
|
inline |
Definition at line 125 of file BattlegroundMgr.h.
Referenced by Update().
|
inlineprivate |
Definition at line 195 of file BattlegroundMgr.h.
Referenced by GetRandomBG().
|
inline |
Definition at line 155 of file BattlegroundMgr.h.
Referenced by CreateNewBattleground(), GetRandomBG(), SendBattlegroundList(), and ToggleArenaTesting().
|
inline |
Definition at line 147 of file BattlegroundMgr.h.
References BATTLEGROUND_TYPE_NONE.
| BGFreeSlotQueueContainer & BattlegroundMgr::GetBGFreeSlotQueueStore | ( | uint32 | mapId | ) |
Definition at line 732 of file BattlegroundMgr.cpp.
References m_BGFreeSlotQueue.
| uint32 BattlegroundMgr::GetMaxRatingDifference | ( | ) | const |
Definition at line 593 of file BattlegroundMgr.cpp.
References CONFIG_ARENA_MAX_RATING_DIFFERENCE, and sWorld.
| uint32 BattlegroundMgr::GetPrematureFinishTime | ( | ) | const |
Definition at line 607 of file BattlegroundMgr.cpp.
References CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER, and sWorld.
|
private |
Definition at line 712 of file BattlegroundMgr.cpp.
References BATTLEGROUND_TYPE_NONE, GetBattlegroundTemplateByMapId(), GetBattlegroundTemplateByTypeId(), isArenaTesting(), m_ArenaTesting, Trinity::Containers::SelectRandomWeightedContainerElement(), and BattlegroundTemplate::Weight.
Referenced by CreateNewBattleground().
| uint32 BattlegroundMgr::GetRatingDiscardTimer | ( | ) | const |
Definition at line 602 of file BattlegroundMgr.cpp.
References CONFIG_ARENA_RATING_DISCARD_TIMER, and sWorld.
|
static |
|
inline |
Definition at line 133 of file BattlegroundMgr.h.
Referenced by GetRandomBG().
|
staticprivate |
Definition at line 498 of file BattlegroundMgr.cpp.
References BATTLEGROUND_AA, BATTLEGROUND_BE, BATTLEGROUND_DS, BATTLEGROUND_NA, BATTLEGROUND_RL, and BATTLEGROUND_RV.
Referenced by CreateClientVisibleInstanceId().
|
static |
Definition at line 707 of file BattlegroundMgr.cpp.
References BGTypeToWeekendHolidayId(), and IsHolidayActive().
Referenced by Battleground::EndBattleground(), and battleground_warsong_gulch::OnCaptureFlag().
|
static |
Definition at line 508 of file BattlegroundMgr.cpp.
References BATTLEGROUND_RANDOM_EPIC, and BATTLEGROUND_RB.
Referenced by Group::CanJoinBattlegroundQueue(), Player::CanJoinToBattleground(), Battleground::EndBattleground(), GetBattleground(), WorldSession::HandleBattlemasterJoinOpcode(), and LoadBattlegroundTemplates().
|
inline |
Definition at line 134 of file BattlegroundMgr.h.
|
static |
Definition at line 543 of file BattlegroundMgr.cpp.
References Arena, ARENA_TYPE_3v3, ArenaSkirmish, Battleground, BattlegroundQueueTypeId::BattlemasterListId, BattlemasterListEntry::GetType(), BattlegroundQueueTypeId::Rated, sBattlemasterListStore, BattlegroundQueueTypeId::TeamSize, BattlegroundQueueTypeId::Type, and Wargame.
Referenced by WorldSession::HandleBattlemasterJoinOpcode().
| void BattlegroundMgr::LoadBattlegroundScriptTemplate | ( | ) |
Definition at line 255 of file BattlegroundMgr.cpp.
References _battlegroundScriptTemplates, _battlegroundTemplates, BATTLEGROUND_TYPE_NONE, getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), BattlegroundScriptTemplate::Id, MapEntry::IsBattlegroundOrArena(), Trinity::Containers::MapGetValuePtr(), BattlegroundScriptTemplate::MapId, BattlegroundScriptTemplate::ScriptId, sMapStore, sObjectMgr, TC_LOG_ERROR, TC_LOG_INFO, and WorldDatabase.
| void BattlegroundMgr::LoadBattlegroundTemplates | ( | ) |
Definition at line 382 of file BattlegroundMgr.cpp.
References _battlegroundMapTemplates, _battlegroundTemplates, BATTLEGROUND_AA, BattlegroundTemplate::BattlemasterEntry, DISABLE_TYPE_BATTLEGROUND, Field::GetFloat(), getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), Field::GetUInt8(), BattlegroundTemplate::Id, DisableMgr::IsDisabledFor(), IsRandomBattleground(), BattlegroundTemplate::MapIDs, BattlegroundTemplate::MaxStartDistSq, sBattlemasterListStore, sBattlemasterListXMapStore, BattlegroundTemplate::ScriptId, sMapStore, sObjectMgr, BattlegroundTemplate::StartLocation, TC_LOG_ERROR, TC_LOG_INFO, TEAM_ALLIANCE, TEAM_HORDE, BattlegroundTemplate::Weight, and WorldDatabase.
| void BattlegroundMgr::LoadBattleMastersEntry | ( | ) |
Definition at line 612 of file BattlegroundMgr.cpp.
References CheckBattleMasters(), getMSTime(), GetMSTimeDiffToNow(), Field::GetUInt32(), mBattleMastersMap, sBattlemasterListStore, sObjectMgr, TC_LOG_ERROR, TC_LOG_INFO, UNIT_NPC_FLAG_BATTLEMASTER, and WorldDatabase.
|
delete |
|
delete |
|
static |
Definition at line 308 of file BattlegroundMgr.cpp.
References CMSG_BATTLEMASTER_JOIN_ARENA, Player::GetSession(), WorldSession::HandleBattlemasterJoinArena(), WorldPackets::Battleground::BattlemasterJoinArena::Roles, and WorldPackets::Battleground::BattlemasterJoinArena::TeamSizeIndex.
Referenced by debug_commandscript::HandleDebugArenaCommand().
Definition at line 742 of file BattlegroundMgr.cpp.
References Battleground::GetInstanceID(), m_BGFreeSlotQueue, and Trinity::Containers::MapGetValuePtr().
| void BattlegroundMgr::ScheduleQueueUpdate | ( | uint32 | arenaMatchmakerRating, |
| BattlegroundQueueTypeId | bgQueueTypeId, | ||
| BattlegroundBracketId | bracket_id | ||
| ) |
Definition at line 584 of file BattlegroundMgr.cpp.
References m_QueueUpdateScheduler.
| void BattlegroundMgr::SendBattlegroundList | ( | Player * | player, |
| ObjectGuid const & | guid, | ||
| BattlegroundTypeId | bgTypeId | ||
| ) |
Definition at line 464 of file BattlegroundMgr.cpp.
References BattleMaster, WorldPackets::Battleground::BattlefieldList::BattlemasterGuid, WorldPackets::Battleground::BattlefieldList::BattlemasterListID, GetBattlegroundTemplateByTypeId(), BattlegroundTemplate::GetMaxLevel(), BattlegroundTemplate::GetMinLevel(), Player::GetRandomWinner(), WorldPackets::Battleground::BattlefieldList::HasRandomWinToday, ObjectGuid::IsEmpty(), WorldPackets::Battleground::BattlefieldList::MaxLevel, WorldPackets::Battleground::BattlefieldList::MinLevel, Player::PlayerTalkClass, WorldPackets::Battleground::BattlefieldList::PvpAnywhere, Player::SendDirectMessage(), and WorldPackets::Battleground::BattlefieldList::Write().
|
static |
Definition at line 482 of file BattlegroundMgr.cpp.
References ObjectGuid::Empty, Player::GetBGTeam(), Battleground::GetMapId(), WorldObject::GetName(), Battleground::GetTeamIndexByTeamId(), Battleground::GetTeamStartPosition(), Battleground::GetTypeID(), WorldSafeLocsEntry::Loc, TC_LOG_DEBUG, TC_LOG_ERROR, Player::TeleportTo(), and WorldSafeLocsEntry::TransportSpawnId.
Referenced by WorldSession::HandleBattleFieldPortOpcode().
| bool BattlegroundMgr::ToggleArenaTesting | ( | uint32 | battlemasterListId | ) |
Definition at line 524 of file BattlegroundMgr.cpp.
References GetBattlegroundTemplateByTypeId(), BattlegroundTemplate::IsArena(), LANG_DEBUG_ARENA_OFF, LANG_DEBUG_ARENA_ON, m_ArenaTesting, and sWorld.
| void BattlegroundMgr::ToggleTesting | ( | ) |
Definition at line 518 of file BattlegroundMgr.cpp.
References LANG_DEBUG_BG_OFF, LANG_DEBUG_BG_ON, m_Testing, and sWorld.
| void BattlegroundMgr::Update | ( | uint32 | diff | ) |
Definition at line 93 of file BattlegroundMgr.cpp.
References Arena, ARENA_TYPE_2v2, ARENA_TYPE_3v3, ARENA_TYPE_5v5, BATTLEGROUND_AA, BATTLEGROUND_OBJECTIVE_UPDATE_INTERVAL, BattlegroundQueue::BattlegroundQueueUpdate(), BG_BRACKET_ID_FIRST, bgDataStore, BGQueueTypeId(), CONFIG_ARENA_MAX_RATING_DIFFERENCE, CONFIG_ARENA_RATED_UPDATE_TIMER, GetBattlegroundQueue(), Battleground::GetBracketId(), Battleground::GetClientInstanceID(), m_BattlegroundQueues, m_NextRatedArenaUpdate, m_QueueUpdateScheduler, m_UpdateTimer, MAX_BATTLEGROUND_BRACKETS, sWorld, TC_LOG_TRACE, Battleground::ToBeDeleted(), and Battleground::Update().
|
static |
Definition at line 691 of file BattlegroundMgr.cpp.
References BATTLEGROUND_AB, BATTLEGROUND_AV, BATTLEGROUND_BFG, BATTLEGROUND_EY, BATTLEGROUND_IC, BATTLEGROUND_SA, BATTLEGROUND_TP, BATTLEGROUND_TYPE_NONE, BATTLEGROUND_WS, HOLIDAY_CALL_TO_ARMS_AB, HOLIDAY_CALL_TO_ARMS_AV, HOLIDAY_CALL_TO_ARMS_BG, HOLIDAY_CALL_TO_ARMS_ES, HOLIDAY_CALL_TO_ARMS_IC, HOLIDAY_CALL_TO_ARMS_SA, HOLIDAY_CALL_TO_ARMS_TP, and HOLIDAY_CALL_TO_ARMS_WG.
Referenced by GameEventMgr::LoadFromDB().
|
private |
Definition at line 206 of file BattlegroundMgr.h.
Referenced by LoadBattlegroundTemplates().
|
private |
Definition at line 208 of file BattlegroundMgr.h.
Referenced by FindBattlegroundScriptTemplate(), and LoadBattlegroundScriptTemplate().
|
private |
Definition at line 205 of file BattlegroundMgr.h.
Referenced by LoadBattlegroundScriptTemplate(), and LoadBattlegroundTemplates().
|
private |
Definition at line 174 of file BattlegroundMgr.h.
Referenced by AddBattleground(), CreateClientVisibleInstanceId(), DeleteAllBattlegrounds(), GetBattleground(), and Update().
|
private |
Definition at line 191 of file BattlegroundMgr.h.
Referenced by GetRandomBG(), and ToggleArenaTesting().
|
private |
Definition at line 176 of file BattlegroundMgr.h.
Referenced by Update().
|
private |
Definition at line 177 of file BattlegroundMgr.h.
Referenced by AddToBGFreeSlotQueue(), DeleteAllBattlegrounds(), GetBGFreeSlotQueueStore(), and RemoveFromBGFreeSlotQueue().
|
private |
Definition at line 189 of file BattlegroundMgr.h.
Referenced by Update().
|
private |
Definition at line 188 of file BattlegroundMgr.h.
Referenced by ScheduleQueueUpdate(), and Update().
|
private |
Definition at line 192 of file BattlegroundMgr.h.
Referenced by ToggleTesting().
|
private |
Definition at line 190 of file BattlegroundMgr.h.
Referenced by Update().
|
private |
Definition at line 193 of file BattlegroundMgr.h.
Referenced by CheckBattleMasters(), and LoadBattleMastersEntry().