TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MapManager Class Reference

#include <MapManager.h>

Public Member Functions

MapCreateBaseMap (uint32 mapId)
 
MapFindBaseNonInstanceMap (uint32 mapId) const
 
MapCreateMap (uint32 mapId, Player *player, uint32 loginInstanceId=0)
 
MapFindMap (uint32 mapId, uint32 instanceId) const
 
uint32 GetAreaId (uint32 phaseMask, uint32 mapid, float x, float y, float z) const
 
uint32 GetAreaId (uint32 phaseMask, uint32 mapid, Position const &pos) const
 
uint32 GetAreaId (uint32 phaseMask, WorldLocation const &loc) const
 
uint32 GetZoneId (uint32 phaseMask, uint32 mapid, float x, float y, float z) const
 
uint32 GetZoneId (uint32 phaseMask, uint32 mapid, Position const &pos) const
 
uint32 GetZoneId (uint32 phaseMask, WorldLocation const &loc) const
 
void GetZoneAndAreaId (uint32 phaseMask, uint32 &zoneid, uint32 &areaid, uint32 mapid, float x, float y, float z) const
 
void GetZoneAndAreaId (uint32 phaseMask, uint32 &zoneid, uint32 &areaid, uint32 mapid, Position const &pos) const
 
void GetZoneAndAreaId (uint32 phaseMask, uint32 &zoneid, uint32 &areaid, WorldLocation const &loc) const
 
void Initialize (void)
 
void Update (uint32)
 
void SetGridCleanUpDelay (uint32 t)
 
void SetMapUpdateInterval (uint32 t)
 
void UnloadAll ()
 
void DoDelayedMovesAndRemoves ()
 
Map::EnterState PlayerCannotEnter (uint32 mapid, Player *player, bool loginCheck=false)
 
void InitializeVisibilityDistanceInfo ()
 
uint32 GetNumInstances ()
 
uint32 GetNumPlayersInInstances ()
 
void InitInstanceIds ()
 
uint32 GenerateInstanceId ()
 
void RegisterInstanceId (uint32 instanceId)
 
void FreeInstanceId (uint32 instanceId)
 
MapUpdaterGetMapUpdater ()
 
template<typename Worker >
void DoForAllMaps (Worker &&worker)
 
template<typename Worker >
void DoForAllMapsWithMapId (uint32 mapId, Worker &&worker)
 
void IncreaseScheduledScriptsCount ()
 
void DecreaseScheduledScriptCount ()
 
void DecreaseScheduledScriptCount (std::size_t count)
 
bool IsScriptScheduled () const
 

Static Public Member Functions

static MapManagerinstance ()
 
static bool ExistMapAndVMap (uint32 mapid, float x, float y)
 
static bool IsValidMAP (uint32 mapid, bool startUp)
 
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

typedef std::unordered_map< uint32, Trinity::unique_trackable_ptr< Map > > MapMapType
 
typedef boost::dynamic_bitset< size_t > InstanceIds
 

Private Member Functions

 MapManager ()
 
 ~MapManager ()
 
MapFindBaseMap (uint32 mapId) const
 
 MapManager (MapManager const &)=delete
 
MapManageroperator= (MapManager const &)=delete
 

Private Attributes

std::mutex _mapsLock
 
uint32 i_gridCleanUpDelay
 
MapMapType i_maps
 
IntervalTimer i_timer
 
InstanceIds _freeInstanceIds
 
uint32 _nextInstanceId
 
MapUpdater m_updater
 
std::atomic< std::size_t > _scheduledScripts
 

Detailed Description

Definition at line 32 of file MapManager.h.

Member Typedef Documentation

◆ InstanceIds

typedef boost::dynamic_bitset<size_t> MapManager::InstanceIds
private

Definition at line 145 of file MapManager.h.

◆ MapMapType

typedef std::unordered_map<uint32, Trinity::unique_trackable_ptr<Map> > MapManager::MapMapType
private

Definition at line 144 of file MapManager.h.

Constructor & Destructor Documentation

◆ MapManager() [1/2]

MapManager::MapManager ( )
private

Definition at line 39 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ ~MapManager()

MapManager::~MapManager ( )
private

Definition at line 46 of file MapManager.cpp.

◆ MapManager() [2/2]

MapManager::MapManager ( MapManager const &  )
privatedelete

Member Function Documentation

◆ CreateBaseMap()

Map * MapManager::CreateBaseMap ( uint32  mapId)

Definition at line 70 of file MapManager.cpp.

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

◆ CreateMap()

Map * MapManager::CreateMap ( uint32  mapId,
Player player,
uint32  loginInstanceId = 0 
)

Definition at line 109 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ DecreaseScheduledScriptCount() [1/2]

void MapManager::DecreaseScheduledScriptCount ( )
inline

Definition at line 139 of file MapManager.h.

◆ DecreaseScheduledScriptCount() [2/2]

void MapManager::DecreaseScheduledScriptCount ( std::size_t  count)
inline

Definition at line 140 of file MapManager.h.

◆ DoDelayedMovesAndRemoves()

void MapManager::DoDelayedMovesAndRemoves ( )

Definition at line 241 of file MapManager.cpp.

◆ DoForAllMaps()

template<typename Worker >
void MapManager::DoForAllMaps ( Worker &&  worker)

Definition at line 173 of file MapManager.h.

+ Here is the call graph for this function:

◆ DoForAllMapsWithMapId()

template<typename Worker >
void MapManager::DoForAllMapsWithMapId ( uint32  mapId,
Worker &&  worker 
)
inline

Definition at line 192 of file MapManager.h.

+ Here is the call graph for this function:

◆ ExistMapAndVMap()

bool MapManager::ExistMapAndVMap ( uint32  mapid,
float  x,
float  y 
)
static

Definition at line 243 of file MapManager.cpp.

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

◆ FindBaseMap()

Map * MapManager::FindBaseMap ( uint32  mapId) const
inlineprivate

Definition at line 150 of file MapManager.h.

+ Here is the caller graph for this function:

◆ FindBaseNonInstanceMap()

Map * MapManager::FindBaseNonInstanceMap ( uint32  mapId) const

Definition at line 101 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ FindMap()

Map * MapManager::FindMap ( uint32  mapId,
uint32  instanceId 
) const

Definition at line 119 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ FreeInstanceId()

void MapManager::FreeInstanceId ( uint32  instanceId)

Definition at line 365 of file MapManager.cpp.

◆ GenerateInstanceId()

uint32 MapManager::GenerateInstanceId ( )

Definition at line 339 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ GetAreaId() [1/3]

uint32 MapManager::GetAreaId ( uint32  phaseMask,
uint32  mapid,
float  x,
float  y,
float  z 
) const
inline

Definition at line 42 of file MapManager.h.

+ Here is the call graph for this function:

◆ GetAreaId() [2/3]

uint32 MapManager::GetAreaId ( uint32  phaseMask,
uint32  mapid,
Position const &  pos 
) const
inline

Definition at line 47 of file MapManager.h.

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

◆ GetAreaId() [3/3]

uint32 MapManager::GetAreaId ( uint32  phaseMask,
WorldLocation const &  loc 
) const
inline

Definition at line 48 of file MapManager.h.

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

◆ GetMapUpdater()

MapUpdater * MapManager::GetMapUpdater ( )
inline

Definition at line 130 of file MapManager.h.

◆ GetNumInstances()

uint32 MapManager::GetNumInstances ( )

Definition at line 284 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ GetNumPlayersInInstances()

uint32 MapManager::GetNumPlayersInInstances ( )

Definition at line 299 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ GetZoneAndAreaId() [1/3]

void MapManager::GetZoneAndAreaId ( uint32  phaseMask,
uint32 zoneid,
uint32 areaid,
uint32  mapid,
float  x,
float  y,
float  z 
) const
inline

Definition at line 56 of file MapManager.h.

+ Here is the call graph for this function:

◆ GetZoneAndAreaId() [2/3]

void MapManager::GetZoneAndAreaId ( uint32  phaseMask,
uint32 zoneid,
uint32 areaid,
uint32  mapid,
Position const &  pos 
) const
inline

Definition at line 61 of file MapManager.h.

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

◆ GetZoneAndAreaId() [3/3]

void MapManager::GetZoneAndAreaId ( uint32  phaseMask,
uint32 zoneid,
uint32 areaid,
WorldLocation const &  loc 
) const
inline

Definition at line 62 of file MapManager.h.

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

◆ GetZoneId() [1/3]

uint32 MapManager::GetZoneId ( uint32  phaseMask,
uint32  mapid,
float  x,
float  y,
float  z 
) const
inline

Definition at line 49 of file MapManager.h.

+ Here is the call graph for this function:

◆ GetZoneId() [2/3]

uint32 MapManager::GetZoneId ( uint32  phaseMask,
uint32  mapid,
Position const &  pos 
) const
inline

Definition at line 54 of file MapManager.h.

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

◆ GetZoneId() [3/3]

uint32 MapManager::GetZoneId ( uint32  phaseMask,
WorldLocation const &  loc 
) const
inline

Definition at line 55 of file MapManager.h.

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

◆ IncreaseScheduledScriptsCount()

void MapManager::IncreaseScheduledScriptsCount ( )
inline

Definition at line 138 of file MapManager.h.

◆ Initialize()

void MapManager::Initialize ( void  )

Definition at line 48 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ InitializeVisibilityDistanceInfo()

void MapManager::InitializeVisibilityDistanceInfo ( )

Definition at line 58 of file MapManager.cpp.

◆ InitInstanceIds()

void MapManager::InitInstanceIds ( )

Definition at line 315 of file MapManager.cpp.

◆ instance()

MapManager * MapManager::instance ( )
static

Definition at line 64 of file MapManager.cpp.

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

◆ IsScriptScheduled()

bool MapManager::IsScriptScheduled ( ) const
inline

Definition at line 141 of file MapManager.h.

◆ IsValidMAP()

bool MapManager::IsValidMAP ( uint32  mapid,
bool  startUp 
)
static
Todo:
add check for battleground template

Definition at line 253 of file MapManager.cpp.

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

◆ IsValidMapCoord() [1/5]

static bool MapManager::IsValidMapCoord ( uint32  mapid,
float  x,
float  y 
)
inlinestatic

Definition at line 90 of file MapManager.h.

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

◆ IsValidMapCoord() [2/5]

static bool MapManager::IsValidMapCoord ( uint32  mapid,
float  x,
float  y,
float  z 
)
inlinestatic

Definition at line 95 of file MapManager.h.

+ Here is the call graph for this function:

◆ IsValidMapCoord() [3/5]

static bool MapManager::IsValidMapCoord ( uint32  mapid,
float  x,
float  y,
float  z,
float  o 
)
inlinestatic

Definition at line 100 of file MapManager.h.

+ Here is the call graph for this function:

◆ IsValidMapCoord() [4/5]

static bool MapManager::IsValidMapCoord ( uint32  mapid,
Position const &  pos 
)
inlinestatic

Definition at line 105 of file MapManager.h.

+ Here is the call graph for this function:

◆ IsValidMapCoord() [5/5]

static bool MapManager::IsValidMapCoord ( WorldLocation const &  loc)
inlinestatic

Definition at line 110 of file MapManager.h.

+ Here is the call graph for this function:

◆ operator=()

MapManager & MapManager::operator= ( MapManager const &  )
privatedelete

◆ PlayerCannotEnter()

Map::EnterState MapManager::PlayerCannotEnter ( uint32  mapid,
Player player,
bool  loginCheck = false 
)

Definition at line 131 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ RegisterInstanceId()

void MapManager::RegisterInstanceId ( uint32  instanceId)

Definition at line 328 of file MapManager.cpp.

◆ SetGridCleanUpDelay()

void MapManager::SetGridCleanUpDelay ( uint32  t)
inline

Definition at line 67 of file MapManager.h.

◆ SetMapUpdateInterval()

void MapManager::SetMapUpdateInterval ( uint32  t)
inline

Definition at line 75 of file MapManager.h.

◆ UnloadAll()

void MapManager::UnloadAll ( )

Definition at line 265 of file MapManager.cpp.

+ Here is the call graph for this function:

◆ Update()

void MapManager::Update ( uint32  diff)

Definition at line 218 of file MapManager.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _freeInstanceIds

InstanceIds MapManager::_freeInstanceIds
private

Definition at line 164 of file MapManager.h.

◆ _mapsLock

std::mutex MapManager::_mapsLock
private

Definition at line 159 of file MapManager.h.

◆ _nextInstanceId

uint32 MapManager::_nextInstanceId
private

Definition at line 165 of file MapManager.h.

◆ _scheduledScripts

std::atomic<std::size_t> MapManager::_scheduledScripts
private

Definition at line 169 of file MapManager.h.

◆ i_gridCleanUpDelay

uint32 MapManager::i_gridCleanUpDelay
private

Definition at line 160 of file MapManager.h.

◆ i_maps

MapMapType MapManager::i_maps
private

Definition at line 161 of file MapManager.h.

◆ i_timer

IntervalTimer MapManager::i_timer
private

Definition at line 162 of file MapManager.h.

◆ m_updater

MapUpdater MapManager::m_updater
private

Definition at line 166 of file MapManager.h.


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