TrinityCore
Loading...
Searching...
No Matches
MapInstanced Class Reference

#include <MapInstanced.h>

+ Inheritance diagram for MapInstanced:

Public Types

typedef std::unordered_map< uint32, Trinity::unique_trackable_ptr< Map > > InstancedMaps
 
- Public Types inherited from Map
enum  EnterState {
  CAN_ENTER = 0 , CANNOT_ENTER_ALREADY_IN_MAP = 1 , CANNOT_ENTER_NO_ENTRY , CANNOT_ENTER_UNINSTANCED_DUNGEON ,
  CANNOT_ENTER_DIFFICULTY_UNAVAILABLE , CANNOT_ENTER_NOT_IN_RAID , CANNOT_ENTER_CORPSE_IN_DIFFERENT_INSTANCE , CANNOT_ENTER_INSTANCE_BIND_MISMATCH ,
  CANNOT_ENTER_TOO_MANY_INSTANCES , CANNOT_ENTER_MAX_PLAYERS , CANNOT_ENTER_ZONE_IN_COMBAT , CANNOT_ENTER_UNSPECIFIED_REASON
}
 
typedef MapRefManager PlayerList
 
typedef std::unordered_multimap< ObjectGuid::LowType, Creature * > CreatureBySpawnIdContainer
 
typedef std::unordered_multimap< ObjectGuid::LowType, GameObject * > GameObjectBySpawnIdContainer
 
typedef std::function< void(Map *)> FarSpellCallback
 
- Public Types inherited from GridRefManager< NGridType >
typedef LinkedListHead::Iterator< GridReference< NGridType > > iterator
 
- Public Types inherited from RefManager< TO, FROM >
typedef LinkedListHead::Iterator< Reference< TO, FROM > > iterator
 
typedef LinkedListHead::Iterator< Reference< TO, FROM > const > const_iterator
 
- Public Types inherited from LinkedListHead
typedef Iterator< LinkedListElementiterator
 

Public Member Functions

 MapInstanced (uint32 id, time_t expiry)
 
 ~MapInstanced ()
 
void Update (uint32 diff) override
 
void DelayedUpdate (uint32 diff) override
 
void UnloadAll () override
 
EnterState CannotEnter (Player *) override
 
MapCreateInstanceForPlayer (uint32 mapId, Player *player, uint32 loginInstanceId=0)
 
MapFindInstanceMap (uint32 instanceId) const
 
bool DestroyInstance (InstancedMaps::iterator &itr)
 
void AddGridMapReference (GridCoord const &p)
 
void RemoveGridMapReference (GridCoord const &p)
 
InstancedMapsGetInstancedMaps ()
 
virtual void InitVisibilityDistance () override
 
- Public Member Functions inherited from Map
 Map (uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode, Map *_parent=nullptr)
 
virtual ~Map ()
 
MapEntry const * GetEntry () const
 
bool CanUnload (uint32 diff)
 
virtual bool AddPlayerToMap (Player *)
 
virtual void RemovePlayerFromMap (Player *, bool)
 
template<class T >
bool AddToMap (T *)
 
template<class T >
void RemoveFromMap (T *, bool)
 
void VisitNearbyCellsOf (WorldObject *obj, TypeContainerVisitor< Trinity::ObjectUpdater, GridTypeMapContainer > &gridVisitor, TypeContainerVisitor< Trinity::ObjectUpdater, WorldTypeMapContainer > &worldVisitor)
 
float GetVisibilityRange () const
 
void PlayerRelocation (Player *, float x, float y, float z, float orientation)
 
void CreatureRelocation (Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail=true)
 
void GameObjectRelocation (GameObject *go, float x, float y, float z, float orientation, bool respawnRelocationOnFail=true)
 
void DynamicObjectRelocation (DynamicObject *go, float x, float y, float z, float orientation)
 
template<class T , class CONTAINER >
void Visit (Cell const &cell, TypeContainerVisitor< T, CONTAINER > &visitor)
 
bool IsRemovalGrid (float x, float y) const
 
bool IsRemovalGrid (Position const &pos) const
 
bool IsGridLoaded (uint32 gridId) const
 
bool IsGridLoaded (float x, float y) const
 
bool IsGridLoaded (Position const &pos) const
 
bool GetUnloadLock (GridCoord const &p) const
 
void SetUnloadLock (GridCoord const &p, bool on)
 
void LoadGrid (float x, float y)
 
void LoadAllCells ()
 
bool UnloadGrid (NGridType &ngrid, bool pForce)
 
void GridMarkNoUnload (uint32 x, uint32 y)
 
void GridUnmarkNoUnload (uint32 x, uint32 y)
 
void ResetGridExpiry (NGridType &grid, float factor=1) const
 
time_t GetGridExpiry (void) const
 
uint32 GetId () const
 
Map const * GetParent () const
 
void GetFullTerrainStatusForPosition (uint32 phaseMask, float x, float y, float z, PositionFullTerrainStatus &data, Optional< uint8 > reqLiquidType={}, float collisionHeight=2.03128f) const
 
ZLiquidStatus GetLiquidStatus (uint32 phaseMask, float x, float y, float z, Optional< uint8 > ReqLiquidType, LiquidData *data=nullptr, float collisionHeight=2.03128f) const
 
bool GetAreaInfo (uint32 phaseMask, float x, float y, float z, uint32 &mogpflags, int32 &adtId, int32 &rootId, int32 &groupId) const
 
uint32 GetAreaId (uint32 phaseMask, float x, float y, float z) const
 
uint32 GetAreaId (uint32 phaseMask, Position const &pos) const
 
uint32 GetZoneId (uint32 phaseMask, float x, float y, float z) const
 
uint32 GetZoneId (uint32 phaseMask, Position const &pos) const
 
void GetZoneAndAreaId (uint32 phaseMask, uint32 &zoneid, uint32 &areaid, float x, float y, float z) const
 
void GetZoneAndAreaId (uint32 phaseMask, uint32 &zoneid, uint32 &areaid, Position const &pos) const
 
float GetWaterLevel (float x, float y) const
 
bool IsInWater (uint32 phaseMask, float x, float y, float z, LiquidData *data=nullptr) const
 
bool IsUnderWater (uint32 phaseMask, float x, float y, float z) const
 
void MoveAllCreaturesInMoveList ()
 
void MoveAllGameObjectsInMoveList ()
 
void MoveAllDynamicObjectsInMoveList ()
 
void RemoveAllObjectsInRemoveList ()
 
virtual void RemoveAllPlayers ()
 
bool CreatureRespawnRelocation (Creature *c, bool diffGridOnly)
 
bool GameObjectRespawnRelocation (GameObject *go, bool diffGridOnly)
 
bool CheckGridIntegrity (Creature *c, bool moved) const
 
uint32 GetInstanceId () const
 
uint8 GetSpawnMode () const
 
Trinity::unique_weak_ptr< MapGetWeakPtr () const
 
void SetWeakPtr (Trinity::unique_weak_ptr< Map > weakRef)
 
char const * GetMapName () const
 
Difficulty GetDifficulty () const
 
bool IsRegularDifficulty () const
 
MapDifficulty const * GetMapDifficulty () const
 
bool Instanceable () const
 
bool IsWorldMap () const
 
bool IsDungeon () const
 
bool IsNonRaidDungeon () const
 
bool IsRaid () const
 
bool IsRaidOrHeroicDungeon () const
 
bool IsHeroic () const
 
bool Is25ManRaid () const
 
bool IsBattleground () const
 
bool IsBattleArena () const
 
bool IsBattlegroundOrArena () const
 
bool GetEntrancePos (int32 &mapid, float &x, float &y) const
 
void AddObjectToRemoveList (WorldObject *obj)
 
void AddObjectToSwitchList (WorldObject *obj, bool on)
 
void resetMarkedCells ()
 
bool isCellMarked (uint32 pCellId)
 
void markCell (uint32 pCellId)
 
bool HavePlayers () const
 
uint32 GetPlayersCountExceptGMs () const
 
bool ActiveObjectsNearGrid (NGridType const &ngrid) const
 
void AddWorldObject (WorldObject *obj)
 
void RemoveWorldObject (WorldObject *obj)
 
void SendToPlayers (WorldPacket const *data) const
 
bool SendZoneMessage (uint32 zone, WorldPacket const *packet, WorldSession const *self=nullptr, uint32 team=0) const
 Send a packet to all players (or players selected team) in the zone (except self if mentioned)
 
PlayerList const & GetPlayers () const
 
void ScriptsStart (std::map< uint32, std::multimap< uint32, ScriptInfo > > const &scripts, uint32 id, Object *source, Object *target)
 Put scripts in the execution queue.
 
void ScriptCommandStart (ScriptInfo const &script, uint32 delay, Object *source, Object *target)
 
void AddToActive (WorldObject *obj)
 
void RemoveFromActive (WorldObject *obj)
 
template<class T >
void SwitchGridContainers (T *obj, bool on)
 
void UpdateIteratorBack (Player *player)
 
TempSummonSummonCreature (uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
 
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=nullptr)
 
PlayerGetPlayer (ObjectGuid const &guid)
 
CorpseGetCorpse (ObjectGuid const &guid)
 
CreatureGetCreature (ObjectGuid const &guid)
 
GameObjectGetGameObject (ObjectGuid const &guid)
 
CreatureGetCreatureBySpawnId (ObjectGuid::LowType spawnId) const
 
GameObjectGetGameObjectBySpawnId (ObjectGuid::LowType spawnId) const
 
WorldObjectGetWorldObjectBySpawnId (SpawnObjectType type, ObjectGuid::LowType spawnId) const
 
TransportGetTransport (ObjectGuid const &guid)
 
DynamicObjectGetDynamicObject (ObjectGuid const &guid)
 
PetGetPet (ObjectGuid const &guid)
 
MapStoredObjectTypesContainerGetObjectsStore ()
 
CreatureBySpawnIdContainerGetCreatureBySpawnIdStore ()
 
CreatureBySpawnIdContainer const & GetCreatureBySpawnIdStore () const
 
GameObjectBySpawnIdContainerGetGameObjectBySpawnIdStore ()
 
GameObjectBySpawnIdContainer const & GetGameObjectBySpawnIdStore () const
 
std::unordered_set< Corpse * > const * GetCorpsesInCell (uint32 cellId) const
 
CorpseGetCorpseByPlayer (ObjectGuid const &ownerGuid) const
 
MapInstancedToMapInstanced ()
 
MapInstanced const * ToMapInstanced () const
 
InstanceMapToInstanceMap ()
 
InstanceMap const * ToInstanceMap () const
 
BattlegroundMapToBattlegroundMap ()
 
BattlegroundMap const * ToBattlegroundMap () const
 
float GetWaterOrGroundLevel (uint32 phasemask, float x, float y, float z, float *ground=nullptr, bool swim=false, float collisionHeight=2.03128f) const
 
float GetMinHeight (float x, float y) const
 
float GetHeight (float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
float GetGridHeight (float x, float y) const
 
float GetHeight (Position const &pos, bool vmap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
float GetHeight (uint32 phasemask, float x, float y, float z, bool vmap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
float GetHeight (uint32 phasemask, Position const &pos, bool vmap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
bool isInLineOfSight (float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask, LineOfSightChecks checks, VMAP::ModelIgnoreFlags ignoreFlags) const
 
void Balance ()
 
void RemoveGameObjectModel (GameObjectModel const &model)
 
void InsertGameObjectModel (GameObjectModel const &model)
 
bool ContainsGameObjectModel (GameObjectModel const &model) const
 
float GetGameObjectFloor (uint32 phasemask, float x, float y, float z, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
bool getObjectHitPos (uint32 phasemask, float x1, float y1, float z1, float x2, float y2, float z2, float &rx, float &ry, float &rz, float modifyDist)
 
time_t GetLinkedRespawnTime (ObjectGuid guid) const
 
time_t GetRespawnTime (SpawnObjectType type, ObjectGuid::LowType spawnId) const
 
time_t GetCreatureRespawnTime (ObjectGuid::LowType spawnId) const
 
time_t GetGORespawnTime (ObjectGuid::LowType spawnId) const
 
void UpdatePlayerZoneStats (uint32 oldZone, uint32 newZone)
 
void SaveRespawnTime (SpawnObjectType type, ObjectGuid::LowType spawnId, uint32 entry, time_t respawnTime, uint32 gridId, CharacterDatabaseTransaction dbTrans=nullptr, bool startup=false)
 
void SaveRespawnInfoDB (RespawnInfo const &info, CharacterDatabaseTransaction dbTrans=nullptr)
 
void LoadRespawnTimes ()
 
void DeleteRespawnTimes ()
 
void LoadCorpseData ()
 
void DeleteCorpseData ()
 
void AddCorpse (Corpse *corpse)
 
void RemoveCorpse (Corpse *corpse)
 
CorpseConvertCorpseToBones (ObjectGuid const &ownerGuid, bool insignia=false)
 
void RemoveOldCorpses ()
 
void SendInitTransports (Player *player)
 
void SendRemoveTransports (Player *player)
 
void SendZoneDynamicInfo (uint32 zoneId, Player *player) const
 
void SendZoneWeather (uint32 zoneId, Player *player) const
 
void SendZoneWeather (ZoneDynamicInfo const &zoneDynamicInfo, Player *player) const
 
void SendZoneText (uint32 zoneId, const char *text, WorldSession const *self=nullptr, uint32 team=0) const
 Send a System Message to all players in the zone (except self if mentioned)
 
void SetZoneMusic (uint32 zoneId, uint32 musicId)
 
WeatherGetOrGenerateZoneDefaultWeather (uint32 zoneId)
 
void SetZoneWeather (uint32 zoneId, WeatherState weatherId, float intensity)
 
void SetZoneOverrideLight (uint32 zoneId, uint32 areaLightId, uint32 overrideLightId, Milliseconds transitionTime)
 
void UpdateAreaDependentAuras ()
 
template<HighGuid high>
ObjectGuid::LowType GenerateLowGuid ()
 
template<HighGuid high>
ObjectGuid::LowType GetMaxLowGuid ()
 
void AddUpdateObject (Object *obj)
 
void RemoveUpdateObject (Object *obj)
 
size_t GetActiveNonPlayersCount () const
 
virtual std::string GetDebugInfo () const
 
void ProcessRespawns ()
 
void ApplyDynamicModeRespawnScaling (WorldObject const *obj, ObjectGuid::LowType spawnId, uint32 &respawnDelay, uint32 mode) const
 
void GetRespawnInfo (std::vector< RespawnInfo const * > &respawnData, SpawnObjectTypeMask types) const
 
void Respawn (SpawnObjectType type, ObjectGuid::LowType spawnId, CharacterDatabaseTransaction dbTrans=nullptr)
 
void RemoveRespawnTime (SpawnObjectType type, ObjectGuid::LowType spawnId, CharacterDatabaseTransaction dbTrans=nullptr, bool alwaysDeleteFromDB=false)
 
size_t DespawnAll (SpawnObjectType type, ObjectGuid::LowType spawnId)
 
bool ShouldBeSpawnedOnGridLoad (SpawnObjectType type, ObjectGuid::LowType spawnId) const
 
template<typename T >
bool ShouldBeSpawnedOnGridLoad (ObjectGuid::LowType spawnId) const
 
SpawnGroupTemplateData const * GetSpawnGroupData (uint32 groupId) const
 
bool IsSpawnGroupActive (uint32 groupId) const
 
bool SpawnGroupSpawn (uint32 groupId, bool ignoreRespawn=false, bool force=false, std::vector< WorldObject * > *spawnedObjects=nullptr)
 
bool SpawnGroupDespawn (uint32 groupId, bool deleteRespawnTimes=false, size_t *count=nullptr)
 
void SetSpawnGroupInactive (uint32 groupId)
 
void AddFarSpellCallback (FarSpellCallback &&callback)
 
template<>
void AddToGrid (Creature *obj, Cell const &cell)
 
template<>
void AddToGrid (GameObject *obj, Cell const &cell)
 
template<>
void AddToGrid (DynamicObject *obj, Cell const &cell)
 
template<>
void AddToGrid (Corpse *obj, Cell const &cell)
 
template<>
void SwitchGridContainers (Creature *obj, bool on)
 
template<>
void SwitchGridContainers (GameObject *obj, bool on)
 
template<>
void DeleteFromWorld (Player *player)
 
template<>
void DeleteFromWorld (Transport *transport)
 
template<>
void InitializeObject (Creature *obj)
 
template<>
void InitializeObject (GameObject *obj)
 
template<>
bool AddToMap (Transport *obj)
 
template<>
void RemoveFromMap (Transport *obj, bool remove)
 
- Public Member Functions inherited from GridRefManager< NGridType >
GridReference< NGridType > * getFirst ()
 
GridReference< NGridType > * getLast ()
 
iterator begin ()
 
iterator end ()
 
- Public Member Functions inherited from RefManager< TO, FROM >
 RefManager ()
 
Reference< TO, FROM > * getFirst ()
 
Reference< TO, FROM > const * getFirst () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
virtual ~RefManager ()
 
void clearReferences ()
 
- Public Member Functions inherited from LinkedListHead
 LinkedListHead ()
 
bool isEmpty () const
 
LinkedListElementgetFirst ()
 
LinkedListElement const * getFirst () const
 
LinkedListElementgetLast ()
 
LinkedListElement const * getLast () const
 
void insertFirst (LinkedListElement *pElem)
 
void insertLast (LinkedListElement *pElem)
 
uint32 getSize () const
 
void incSize ()
 
void decSize ()
 

Private Member Functions

InstanceMapCreateInstance (uint32 InstanceId, InstanceSave *save, Difficulty difficulty, TeamId InstanceTeam)
 
BattlegroundMapCreateBattleground (uint32 InstanceId, Battleground *bg)
 

Private Attributes

InstancedMaps m_InstancedMaps
 
uint16 GridMapReference [MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]
 

Friends

class MapManager
 

Additional Inherited Members

- Static Public Member Functions inherited from Map
static bool ExistMap (uint32 mapid, int gx, int gy)
 
static bool ExistVMap (uint32 mapid, int gx, int gy)
 
static void InitStateMachine ()
 
static void DeleteStateMachine ()
 
static void DeleteRespawnTimesInDB (uint16 mapId, uint32 instanceId)
 
- Public Attributes inherited from Map
std::unordered_map< ObjectGuid::LowType, CreatureGroup * > CreatureGroupHolder
 
- Protected Types inherited from Map
typedef std::set< WorldObject * > ActiveNonPlayers
 
typedef std::set< Transport * > TransportsContainer
 
- Protected Member Functions inherited from Map
void SetUnloadReferenceLock (GridCoord const &p, bool on)
 
- Protected Member Functions inherited from LinkedListHead
 ~LinkedListHead ()
 
- Protected Attributes inherited from Map
std::mutex _mapLock
 
std::mutex _gridLock
 
MapEntry const * i_mapEntry
 
uint8 i_spawnMode
 
uint32 i_InstanceId
 
Trinity::unique_weak_ptr< Mapm_weakRef
 
uint32 m_unloadTimer
 
float m_VisibleDistance
 
DynamicMapTree _dynamicTree
 
MapRefManager m_mapRefManager
 
MapRefManager::iterator m_mapRefIter
 
int32 m_VisibilityNotifyPeriod
 
ActiveNonPlayers m_activeNonPlayers
 
ActiveNonPlayers::iterator m_activeNonPlayersIter
 
TransportsContainer _transports
 
TransportsContainer::iterator _transportsUpdateIter
 

Detailed Description

Definition at line 26 of file MapInstanced.h.

Member Typedef Documentation

◆ InstancedMaps

Definition at line 30 of file MapInstanced.h.

Constructor & Destructor Documentation

◆ MapInstanced()

MapInstanced::MapInstanced ( uint32  id,
time_t  expiry 
)

Definition at line 33 of file MapInstanced.cpp.

◆ ~MapInstanced()

MapInstanced::~MapInstanced ( )
inline

Definition at line 33 of file MapInstanced.h.

Member Function Documentation

◆ AddGridMapReference()

void MapInstanced::AddGridMapReference ( GridCoord const &  p)
inline

Definition at line 50 of file MapInstanced.h.

+ Here is the call graph for this function:

◆ CannotEnter()

Map::EnterState MapInstanced::CannotEnter ( Player )
overridevirtual

Reimplemented from Map.

Definition at line 311 of file MapInstanced.cpp.

◆ CreateBattleground()

BattlegroundMap * MapInstanced::CreateBattleground ( uint32  InstanceId,
Battleground bg 
)
private

Definition at line 249 of file MapInstanced.cpp.

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

◆ CreateInstance()

InstanceMap * MapInstanced::CreateInstance ( uint32  InstanceId,
InstanceSave save,
Difficulty  difficulty,
TeamId  InstanceTeam 
)
private

Definition at line 205 of file MapInstanced.cpp.

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

◆ CreateInstanceForPlayer()

Map * MapInstanced::CreateInstanceForPlayer ( uint32  mapId,
Player player,
uint32  loginInstanceId = 0 
)

Definition at line 116 of file MapInstanced.cpp.

+ Here is the call graph for this function:

◆ DelayedUpdate()

void MapInstanced::DelayedUpdate ( uint32  diff)
overridevirtual

Reimplemented from Map.

Definition at line 79 of file MapInstanced.cpp.

+ Here is the call graph for this function:

◆ DestroyInstance()

bool MapInstanced::DestroyInstance ( InstancedMaps::iterator &  itr)

Definition at line 279 of file MapInstanced.cpp.

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

◆ FindInstanceMap()

Map * MapInstanced::FindInstanceMap ( uint32  instanceId) const
inline

Definition at line 43 of file MapInstanced.h.

+ Here is the caller graph for this function:

◆ GetInstancedMaps()

InstancedMaps & MapInstanced::GetInstancedMaps ( )
inline

Definition at line 63 of file MapInstanced.h.

+ Here is the caller graph for this function:

◆ InitVisibilityDistance()

void MapInstanced::InitVisibilityDistance ( )
overridevirtual

Reimplemented from Map.

Definition at line 39 of file MapInstanced.cpp.

◆ RemoveGridMapReference()

void MapInstanced::RemoveGridMapReference ( GridCoord const &  p)
inline

Definition at line 56 of file MapInstanced.h.

+ Here is the call graph for this function:

◆ UnloadAll()

void MapInstanced::UnloadAll ( )
overridevirtual

Reimplemented from Map.

Definition at line 95 of file MapInstanced.cpp.

+ Here is the call graph for this function:

◆ Update()

void MapInstanced::Update ( uint32  diff)
overridevirtual

Reimplemented from Map.

Definition at line 50 of file MapInstanced.cpp.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ MapManager

friend class MapManager
friend

Definition at line 28 of file MapInstanced.h.

Member Data Documentation

◆ GridMapReference

uint16 MapInstanced::GridMapReference[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]
private

Definition at line 72 of file MapInstanced.h.

◆ m_InstancedMaps

InstancedMaps MapInstanced::m_InstancedMaps
private

Definition at line 70 of file MapInstanced.h.


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