![]() |
TrinityCore
|
#include <MapManager.h>
Static Public Member Functions | |
| static MapManager * | instance () |
| static bool | IsValidMAP (uint32 mapId) |
| static bool | IsValidMapCoord (uint32 mapid, float x, float y) |
| static bool | IsValidMapCoord (uint32 mapid, float x, float y, float z) |
| static bool | IsValidMapCoord (uint32 mapid, float x, float y, float z, float o) |
| static bool | IsValidMapCoord (uint32 mapid, Position const &pos) |
| static bool | IsValidMapCoord (WorldLocation const &loc) |
Private Types | |
| using | MapKey = std::pair< uint32, uint32 > |
| typedef std::map< MapKey, Trinity::unique_trackable_ptr< Map > > | MapMapType |
| typedef boost::dynamic_bitset< size_t > | InstanceIds |
Private Member Functions | |
| MapManager () | |
| ~MapManager () | |
| Map * | FindMap_i (uint32 mapId, uint32 instanceId) const |
| Map * | CreateWorldMap (uint32 mapId, uint32 instanceId) |
| InstanceMap * | CreateInstance (uint32 mapId, uint32 instanceId, InstanceLock *instanceLock, Difficulty difficulty, TeamId team, Group *group, Optional< uint32 > lfgDungeonsId) |
| BattlegroundMap * | CreateBattleground (uint32 mapId, uint32 instanceId, Battleground *bg) |
| GarrisonMap * | CreateGarrison (uint32 mapId, uint32 instanceId, Player *owner) |
| bool | DestroyMap (Map *map) |
Private Attributes | |
| std::shared_mutex | _mapsLock |
| uint32 | i_gridCleanUpDelay |
| MapMapType | i_maps |
| IntervalTimer | i_timer |
| std::unique_ptr< InstanceIds > | _freeInstanceIds |
| uint32 | _nextInstanceId |
| MapUpdater | m_updater |
| std::atomic< std::size_t > | _scheduledScripts |
Definition at line 42 of file MapManager.h.
|
private |
Definition at line 138 of file MapManager.h.
|
private |
Definition at line 136 of file MapManager.h.
|
private |
Definition at line 137 of file MapManager.h.
|
private |
Definition at line 41 of file MapManager.cpp.
References CONFIG_INTERVAL_GRIDCLEAN, CONFIG_INTERVAL_MAPUPDATE, i_gridCleanUpDelay, i_timer, IntervalTimer::SetInterval(), and sWorld.
|
privatedefault |
|
delete |
|
delete |
| void MapManager::AddSC_BuiltInScripts | ( | ) |
Definition at line 490 of file MapManager.cpp.
References sMapStore, and Trinity::StringFormat().
|
private |
Definition at line 123 of file MapManager.cpp.
References ASSERT, CONFIG_BATTLEGROUNDMAP_LOAD_GRIDS, DIFFICULTY_NONE, BattlegroundMap::GetBattlegroundScript(), i_gridCleanUpDelay, BattlegroundMap::InitScriptData(), Map::InitSpawnGroupState(), Map::IsBattlegroundOrArena(), Map::LoadAllGrids(), BattlegroundScript::OnInit(), BattlegroundMap::SetBG(), Battleground::SetBgMap(), sWorld, and TC_LOG_DEBUG.
Referenced by CreateMap().
|
private |
Definition at line 141 of file MapManager.cpp.
References ASSERT, BaseEntity::GetGUID(), i_gridCleanUpDelay, Map::InitSpawnGroupState(), and Map::IsGarrison().
Referenced by CreateMap().
|
private |
Definition at line 91 of file MapManager.cpp.
References ABORT, ASSERT, CONFIG_INSTANCEMAP_LOAD_GRIDS, DB2Manager::GetDifficultyName(), i_gridCleanUpDelay, InstanceLock::IsNew(), sMapStore, sScenarioMgr, sWorld, TC_LOG_DEBUG, and TC_LOG_ERROR.
Referenced by CreateMap().
| Map * MapManager::CreateMap | ( | uint32 | mapId, |
| Player * | player, | ||
| Optional< uint32 > | lfgDungeonsId = {} |
||
| ) |
Definition at line 154 of file MapManager.cpp.
References _mapsLock, CreateBattleground(), CreateGarrison(), CreateInstance(), CreateWorldMap(), FindMap_i(), GenerateInstanceId(), Trinity::unique_trackable_ptr< T >::get(), Player::GetBattleground(), Player::GetBattlegroundId(), ObjectGuid::GetCounter(), InstanceLock::GetDifficultyId(), Player::GetDifficultyID(), Group::GetDifficultyID(), Player::GetGroup(), BaseEntity::GetGUID(), Map::GetId(), InstanceLock::GetInstanceId(), Map::GetInstanceId(), InstanceMap::GetInstanceLock(), Player::GetRecentInstanceId(), Group::GetRecentInstanceId(), Group::GetRecentInstanceOwner(), Player::GetTeamId(), GetTeamIdForTeam(), i_maps, MapEntry::IsBattlegroundOrArena(), MapEntry::IsDungeon(), MapEntry::IsGarrison(), MapEntry::IsSplitByFaction(), Trinity::unique_trackable_ptr< T >::reset(), sBattlefieldMgr, sCharacterCache, sDB2Manager, InstanceLock::SetInstanceId(), Group::SetRecentInstance(), Player::SetRecentInstance(), Map::SetWeakPtr(), sInstanceLockMgr, sMapStore, sOutdoorPvPMgr, sScriptMgr, Player::TeleportToBGEntryPoint(), and Map::ToInstanceMap().
Definition at line 78 of file MapManager.cpp.
References CONFIG_BASEMAP_LOAD_GRIDS, DIFFICULTY_NONE, i_gridCleanUpDelay, Map::InitSpawnGroupState(), Map::LoadAllGrids(), Map::LoadCorpseData(), Map::LoadRespawnTimes(), and sWorld.
Referenced by CreateMap().
|
inline |
Definition at line 129 of file MapManager.h.
|
inline |
Definition at line 130 of file MapManager.h.
|
private |
Definition at line 356 of file MapManager.cpp.
References Map::GetInstanceId(), Map::GetMapDifficulty(), MapDifficultyEntry::HasResetSchedule(), Map::HavePlayers(), Map::IsBattlegroundOrArena(), Map::IsDungeon(), Map::RemoveAllPlayers(), sBattlefieldMgr, sMapMgr, sOutdoorPvPMgr, sScriptMgr, and Map::UnloadAll().
Referenced by Update().
| void MapManager::DoForAllMaps | ( | Worker && | worker | ) |
Definition at line 164 of file MapManager.h.
| void MapManager::DoForAllMapsWithMapId | ( | uint32 | mapId, |
| Worker && | worker | ||
| ) |
Definition at line 173 of file MapManager.h.
References _mapsLock, i_maps, and Trinity::Containers::MakeIteratorPair().
Definition at line 278 of file MapManager.cpp.
References FindMap(), Player::GetBattlegroundId(), ObjectGuid::GetCounter(), Player::GetDifficultyID(), Group::GetDifficultyID(), Player::GetGroup(), BaseEntity::GetGUID(), InstanceLock::GetInstanceId(), InstanceMap::GetInstanceLock(), Player::GetRecentInstanceId(), Group::GetRecentInstanceId(), Group::GetRecentInstanceOwner(), Player::GetTeamId(), MapEntry::IsBattlegroundOrArena(), MapEntry::IsDungeon(), MapEntry::IsGarrison(), MapEntry::IsSplitByFaction(), sDB2Manager, sInstanceLockMgr, sMapStore, and Map::ToInstanceMap().
Definition at line 272 of file MapManager.cpp.
References _mapsLock, and FindMap_i().
Referenced by FindInstanceIdForPlayer().
Definition at line 72 of file MapManager.cpp.
References RefManager< ReferenceType >::end(), and i_maps.
Referenced by CreateMap(), and FindMap().
| void MapManager::FreeInstanceId | ( | uint32 | instanceId | ) |
Definition at line 468 of file MapManager.cpp.
References _freeInstanceIds, and _nextInstanceId.
| uint32 MapManager::GenerateInstanceId | ( | ) |
Definition at line 442 of file MapManager.cpp.
References _freeInstanceIds, _nextInstanceId, ASSERT, ERROR_EXIT_CODE, World::StopNow(), and TC_LOG_ERROR.
Referenced by CreateMap().
|
inline |
Definition at line 120 of file MapManager.h.
| uint32 MapManager::GetNumInstances | ( | ) | const |
Definition at line 402 of file MapManager.cpp.
| uint32 MapManager::GetNumPlayersInInstances | ( | ) | const |
Definition at line 408 of file MapManager.cpp.
|
inline |
Definition at line 128 of file MapManager.h.
| void MapManager::Initialize | ( | ) |
Definition at line 50 of file MapManager.cpp.
References MapUpdater::activate(), CONFIG_NUMTHREADS, Map::InitStateMachine(), m_updater, and sWorld.
| void MapManager::InitializeVisibilityDistanceInfo | ( | ) |
Definition at line 60 of file MapManager.cpp.
References i_maps.
| void MapManager::InitInstanceIds | ( | ) |
Definition at line 414 of file MapManager.cpp.
References _freeInstanceIds, _nextInstanceId, and CharacterDatabase.
|
static |
|
inline |
Definition at line 131 of file MapManager.h.
|
static |
Definition at line 376 of file MapManager.cpp.
References sMapStore.
Referenced by ObjectMgr::LoadInstanceTemplate().
|
inlinestatic |
Definition at line 83 of file MapManager.h.
References Trinity::IsValidMapCoord().
Referenced by Player::_LoadHomeBind(), Player::_LoadStoredAuraTeleportLocations(), tele_commandscript::DoNameTeleport(), go_commandscript::DoTeleport(), gobject_commandscript::HandleGameObjectMoveCommand(), go_commandscript::HandleGoGraveyardCommand(), go_commandscript::HandleGoGridCommand(), go_commandscript::HandleGoQuestCommand(), go_commandscript::HandleGoXYZCommand(), go_commandscript::HandleGoZoneXYCommand(), WorldSession::HandleMoveWorldportAck(), AreaTriggerDataStore::LoadAreaTriggerSpawns(), ObjectMgr::LoadGameObjects(), ObjectMgr::LoadGameTele(), ObjectMgr::LoadPlayerInfo(), ObjectMgr::LoadWorldSafeLocs(), and Player::TeleportTo().
|
inlinestatic |
Definition at line 88 of file MapManager.h.
References Trinity::IsValidMapCoord().
|
inlinestatic |
Definition at line 93 of file MapManager.h.
References Trinity::IsValidMapCoord().
Definition at line 98 of file MapManager.h.
References Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), and Position::GetPositionZ().
|
inlinestatic |
Definition at line 103 of file MapManager.h.
References WorldLocation::GetMapId().
|
delete |
|
delete |
| void MapManager::RegisterInstanceId | ( | uint32 | instanceId | ) |
Definition at line 431 of file MapManager.cpp.
References _freeInstanceIds, and _nextInstanceId.
|
inline |
Definition at line 62 of file MapManager.h.
References MIN_GRID_DELAY.
|
inline |
Definition at line 70 of file MapManager.h.
References MIN_MAP_UPDATE_DELAY.
| void MapManager::UnloadAll | ( | ) |
Definition at line 381 of file MapManager.cpp.
References MapUpdater::activated(), MapUpdater::deactivate(), Map::DeleteStateMachine(), i_maps, m_updater, sBattlefieldMgr, sOutdoorPvPMgr, and sScriptMgr.
| void MapManager::Update | ( | uint32 | diff | ) |
Definition at line 321 of file MapManager.cpp.
References MapUpdater::activated(), DestroyMap(), IntervalTimer::GetCurrent(), i_maps, i_timer, m_updater, IntervalTimer::Passed(), MapUpdater::schedule_update(), IntervalTimer::SetCurrent(), IntervalTimer::Update(), and MapUpdater::wait().
|
private |
Definition at line 155 of file MapManager.h.
Referenced by FreeInstanceId(), GenerateInstanceId(), InitInstanceIds(), and RegisterInstanceId().
|
mutableprivate |
Definition at line 150 of file MapManager.h.
Referenced by CreateMap(), DoForAllMaps(), DoForAllMapsWithMapId(), FindMap(), GetNumInstances(), and GetNumPlayersInInstances().
|
private |
Definition at line 156 of file MapManager.h.
Referenced by FreeInstanceId(), GenerateInstanceId(), InitInstanceIds(), and RegisterInstanceId().
|
private |
Definition at line 160 of file MapManager.h.
|
private |
Definition at line 151 of file MapManager.h.
Referenced by CreateBattleground(), CreateGarrison(), CreateInstance(), CreateWorldMap(), and MapManager().
|
private |
Definition at line 152 of file MapManager.h.
Referenced by CreateMap(), DoForAllMaps(), DoForAllMapsWithMapId(), FindMap_i(), GetNumInstances(), GetNumPlayersInInstances(), InitializeVisibilityDistanceInfo(), UnloadAll(), and Update().
|
private |
Definition at line 153 of file MapManager.h.
Referenced by MapManager(), and Update().
|
private |
Definition at line 157 of file MapManager.h.
Referenced by Initialize(), UnloadAll(), and Update().