AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
InstanceMap Class Reference

#include "Map.h"

Inheritance diagram for InstanceMap:
Map GridRefMgr< NGridType > RefMgr< TO, FROM > LinkedListHead

Public Member Functions

 InstanceMap (uint32 id, uint32 InstanceId, uint8 SpawnMode, Map *_parent)
 
 ~InstanceMap () override
 
bool AddPlayerToMap (Player *) override
 
void RemovePlayerFromMap (Player *, bool) override
 
void AfterPlayerUnlinkFromMap () override
 
void Update (const uint32, const uint32, bool thread=true) override
 
void CreateInstanceScript (bool load, std::string data, uint32 completedEncounterMask)
 
bool Reset (uint8 method, GuidList *globalSkipList=nullptr)
 
uint32 GetScriptId () const
 
std::string const & GetScriptName () const
 
InstanceScriptGetInstanceScript ()
 
InstanceScript const * GetInstanceScript () const
 
void PermBindAllPlayers ()
 
void UnloadAll () override
 
EnterState CannotEnter (Player *player, bool loginCheck=false) override
 
void SendResetWarnings (uint32 timeLeft) const
 
uint32 GetMaxPlayers () const
 
uint32 GetMaxResetDelay () const
 
void InitVisibilityDistance () override
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from Map
 Map (uint32 id, uint32 InstanceId, uint8 SpawnMode, Map *_parent=nullptr)
 
 ~Map () override
 
MapEntry const * GetEntry () const
 
bool CanUnload (uint32 diff)
 
virtual bool AddPlayerToMap (Player *)
 
virtual void RemovePlayerFromMap (Player *, bool)
 
virtual void AfterPlayerUnlinkFromMap ()
 
template<class T >
bool AddToMap (T *, bool checkTransport=false)
 
template<class T >
void RemoveFromMap (T *, bool)
 
void VisitNearbyCellsOf (WorldObject *obj, TypeContainerVisitor< Acore::ObjectUpdater, GridTypeMapContainer > &gridVisitor, TypeContainerVisitor< Acore::ObjectUpdater, WorldTypeMapContainer > &worldVisitor, TypeContainerVisitor< Acore::ObjectUpdater, GridTypeMapContainer > &largeGridVisitor, TypeContainerVisitor< Acore::ObjectUpdater, WorldTypeMapContainer > &largeWorldVisitor)
 
void VisitNearbyCellsOfPlayer (Player *player, TypeContainerVisitor< Acore::ObjectUpdater, GridTypeMapContainer > &gridVisitor, TypeContainerVisitor< Acore::ObjectUpdater, WorldTypeMapContainer > &worldVisitor, TypeContainerVisitor< Acore::ObjectUpdater, GridTypeMapContainer > &largeGridVisitor, TypeContainerVisitor< Acore::ObjectUpdater, WorldTypeMapContainer > &largeWorldVisitor)
 
virtual void Update (const uint32, const uint32, bool thread=true)
 
float GetVisibilityRange () const
 
void SetVisibilityRange (float range)
 
virtual void InitVisibilityDistance ()
 
void PlayerRelocation (Player *, float x, float y, float z, float o)
 
void CreatureRelocation (Creature *creature, float x, float y, float z, float o)
 
void GameObjectRelocation (GameObject *go, float x, float y, float z, float o)
 
void DynamicObjectRelocation (DynamicObject *go, float x, float y, float z, float o)
 
template<class T , class CONTAINER >
void Visit (const Cell &cell, TypeContainerVisitor< T, CONTAINER > &visitor)
 
bool IsRemovalGrid (float x, float y) const
 
bool IsGridLoaded (float x, float y) const
 
void LoadGrid (float x, float y)
 
void LoadAllCells ()
 
bool UnloadGrid (NGridType &ngrid)
 
virtual void UnloadAll ()
 
uint32 GetId () const
 
Map const * GetParent () const
 
std::shared_mutex & GetMMapLock () const
 
void HandleDelayedVisibility ()
 
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 GetMinHeight (float x, float y) const
 
TransportGetTransportForPos (uint32 phase, float x, float y, float z, WorldObject *worldobject=nullptr)
 
void GetFullTerrainStatusForPosition (uint32 phaseMask, float x, float y, float z, float collisionHeight, PositionFullTerrainStatus &data, uint8 reqLiquidType=MAP_ALL_LIQUIDS)
 
LiquidData const GetLiquidData (uint32 phaseMask, float x, float y, float z, float collisionHeight, uint8 ReqLiquidType)
 
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 GetZoneId (uint32 phaseMask, float x, float y, float z) const
 
void GetZoneAndAreaId (uint32 phaseMask, uint32 &zoneid, uint32 &areaid, float x, float y, float z) const
 
float GetWaterLevel (float x, float y) const
 
bool IsInWater (uint32 phaseMask, float x, float y, float z, float collisionHeight) const
 
bool IsUnderWater (uint32 phaseMask, float x, float y, float z, float collisionHeight) const
 
bool HasEnoughWater (WorldObject const *searcher, float x, float y, float z) const
 
bool HasEnoughWater (WorldObject const *searcher, LiquidData const &liquidData) const
 
void MoveAllCreaturesInMoveList ()
 
void MoveAllGameObjectsInMoveList ()
 
void MoveAllDynamicObjectsInMoveList ()
 
void RemoveAllObjectsInRemoveList ()
 
virtual void RemoveAllPlayers ()
 
uint32 GetInstanceId () const
 
uint8 GetSpawnMode () const
 
virtual EnterState CannotEnter (Player *, bool)
 
const char * GetMapName () const
 
Difficulty GetDifficulty () const
 
bool IsRegularDifficulty () const
 
MapDifficulty const * GetMapDifficulty () const
 
bool Instanceable () 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 IsWorldMap () const
 
bool GetEntrancePos (int32 &mapid, float &x, float &y)
 
void AddObjectToRemoveList (WorldObject *obj)
 
void AddObjectToSwitchList (WorldObject *obj, bool on)
 
virtual void DelayedUpdate (const uint32 diff)
 
void resetMarkedCells ()
 
bool isCellMarked (uint32 pCellId)
 
void markCell (uint32 pCellId)
 
void resetMarkedCellsLarge ()
 
bool isCellMarkedLarge (uint32 pCellId)
 
void markCellLarge (uint32 pCellId)
 
bool HavePlayers () const
 
uint32 GetPlayersCountExceptGMs () const
 
void AddWorldObject (WorldObject *obj)
 
void RemoveWorldObject (WorldObject *obj)
 
void SendToPlayers (WorldPacket const *data) const
 
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. More...
 
void ScriptCommandStart (ScriptInfo const &script, uint32 delay, Object *source, Object *target)
 
template<class T >
void AddToActive (T *obj)
 
template<class T >
void RemoveFromActive (T *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, bool visibleBySummonerOnly=false)
 
GameObjectSummonGameObject (uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true)
 
GameObjectSummonGameObject (uint32 entry, Position const &pos, float rotation0=0.0f, float rotation1=0.0f, float rotation2=0.0f, float rotation3=0.0f, uint32 respawnTime=100, bool checkTransport=true)
 
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=nullptr)
 
CorpseGetCorpse (ObjectGuid const guid)
 
CreatureGetCreature (ObjectGuid const guid)
 
GameObjectGetGameObject (ObjectGuid const guid)
 
TransportGetTransport (ObjectGuid const guid)
 
DynamicObjectGetDynamicObject (ObjectGuid const guid)
 
PetGetPet (ObjectGuid const guid)
 
MapStoredObjectTypesContainerGetObjectsStore ()
 
CreatureBySpawnIdContainerGetCreatureBySpawnIdStore ()
 
GameObjectBySpawnIdContainerGetGameObjectBySpawnIdStore ()
 
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=DEFAULT_COLLISION_HEIGHT) const
 
float GetHeight (uint32 phasemask, float x, float y, float z, 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
 
bool CanReachPositionAndGetValidCoords (WorldObject const *source, PathGenerator *path, float &destX, float &destY, float &destZ, bool failOnCollision=true, bool failOnSlopes=true) const
 Check if a given source can reach a specific point following a path and normalize the coords. Use this method for long paths, otherwise use the overloaded method with the start coords when you need to do a quick check on small segments. More...
 
bool CanReachPositionAndGetValidCoords (WorldObject const *source, float &destX, float &destY, float &destZ, bool failOnCollision=true, bool failOnSlopes=true) const
 validate the new destination and set reachable coords Check if a given unit can reach a specific point on a segment and set the correct dest coords NOTE: use this method with small segments. More...
 
bool CanReachPositionAndGetValidCoords (WorldObject const *source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision=true, bool failOnSlopes=true) const
 
bool CheckCollisionAndGetValidCoords (WorldObject const *source, float startX, float startY, float startZ, float &destX, float &destY, float &destZ, bool failOnCollision=true) const
 validate the new destination and set coords Check if a given unit can face collisions in a specific segment More...
 
void Balance ()
 
void RemoveGameObjectModel (const GameObjectModel &model)
 
void InsertGameObjectModel (const GameObjectModel &model)
 
bool ContainsGameObjectModel (const GameObjectModel &model) const
 
DynamicMapTree const & GetDynamicMapTree () 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)
 
float GetGameObjectFloor (uint32 phasemask, float x, float y, float z, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
time_t GetLinkedRespawnTime (ObjectGuid guid) const
 
time_t GetCreatureRespawnTime (ObjectGuid::LowType dbGuid) const
 
time_t GetGORespawnTime (ObjectGuid::LowType dbGuid) const
 
void SaveCreatureRespawnTime (ObjectGuid::LowType dbGuid, time_t &respawnTime)
 
void RemoveCreatureRespawnTime (ObjectGuid::LowType dbGuid)
 
void SaveGORespawnTime (ObjectGuid::LowType dbGuid, time_t &respawnTime)
 
void RemoveGORespawnTime (ObjectGuid::LowType dbGuid)
 
void LoadRespawnTimes ()
 
void DeleteRespawnTimes ()
 
time_t GetInstanceResetPeriod () const
 
void ScheduleCreatureRespawn (ObjectGuid, Milliseconds)
 
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 (Player *player)
 
void SendInitSelf (Player *player)
 
void PlayDirectSoundToMap (uint32 soundId, uint32 zoneId=0)
 
void SetZoneMusic (uint32 zoneId, uint32 musicId)
 
void SetZoneWeather (uint32 zoneId, WeatherState weatherId, float weatherGrade)
 
void SetZoneOverrideLight (uint32 zoneId, uint32 lightId, Milliseconds fadeInTime)
 
void UpdateEncounterState (EncounterCreditType type, uint32 creditEntry, Unit *source)
 
void LogEncounterFinished (EncounterCreditType type, uint32 creditEntry)
 
void DoForAllPlayers (std::function< void(Player *)> exec)
 
GridMapGetGrid (float x, float y)
 
void EnsureGridCreated (const GridCoord &)
 
bool AllTransportsEmpty () const
 
void AllTransportsRemovePassengers ()
 
TransportsContainer const & GetAllTransports () const
 
template<HighGuid high>
ObjectGuid::LowType GenerateLowGuid ()
 
void AddUpdateObject (Object *obj)
 
void RemoveUpdateObject (Object *obj)
 
std::size_t GetActiveNonPlayersCount () const
 
virtual std::string GetDebugInfo () const
 
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 InitializeObject (Creature *)
 
template<>
void InitializeObject (GameObject *)
 
template<>
bool AddToMap (MotionTransport *obj, bool)
 
template<>
void RemoveFromMap (MotionTransport *obj, bool remove)
 
template<>
void AddToActive (Creature *c)
 
template<>
void AddToActive (DynamicObject *d)
 
template<>
void AddToActive (GameObject *d)
 
template<>
void RemoveFromActive (Creature *c)
 
template<>
void RemoveFromActive (DynamicObject *obj)
 
template<>
void RemoveFromActive (GameObject *obj)
 
- Public Member Functions inherited from GridRefMgr< NGridType >
GridReference< NGridType > * getFirst ()
 
GridReference< NGridType > * getLast ()
 
iterator begin ()
 
iterator end ()
 
iterator rbegin ()
 
iterator rend ()
 
- Public Member Functions inherited from RefMgr< TO, FROM >
 RefMgr ()=default
 
virtual ~RefMgr ()
 
Reference< TO, FROM > * getFirst ()
 
Reference< TO, FROM > const * getFirst () const
 
Reference< TO, FROM > * getLast ()
 
Reference< TO, FROM > const * getLast () const
 
iterator begin ()
 
iterator end ()
 
iterator rbegin ()
 
iterator rend ()
 
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 Attributes

bool m_resetAfterUnload
 
bool m_unloadWhenEmpty
 
InstanceScriptinstance_data
 
uint32 i_script_id
 

Additional Inherited Members

- 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 MapRefMgr PlayerList
 
typedef std::unordered_multimap< ObjectGuid::LowType, Creature * > CreatureBySpawnIdContainer
 
typedef std::unordered_multimap< ObjectGuid::LowType, GameObject * > GameObjectBySpawnIdContainer
 
- Public Types inherited from GridRefMgr< NGridType >
typedef LinkedListHead::Iterator< GridReference< NGridType > > iterator
 
- Public Types inherited from RefMgr< TO, FROM >
typedef LinkedListHead::Iterator< Reference< TO, FROM > > iterator
 
- Public Types inherited from LinkedListHead
typedef Iterator< LinkedListElementiterator
 
- 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 DeleteRespawnTimesInDB (uint16 mapId, uint32 instanceId)
 
- Public Attributes inherited from Map
std::unordered_set< Unit * > i_objectsForDelayedVisibility
 
CreatureGroupHolderType CreatureGroupHolder
 
TaskScheduler _creatureRespawnScheduler
 
DataMap CustomData
 
- Protected Types inherited from Map
typedef std::set< WorldObject * > ActiveNonPlayers
 
- Protected Attributes inherited from Map
std::mutex Lock
 
std::mutex GridLock
 
std::shared_mutex MMapLock
 
MapEntry const * i_mapEntry
 
uint8 i_spawnMode
 
uint32 i_InstanceId
 
uint32 m_unloadTimer
 
float m_VisibleDistance
 
DynamicMapTree _dynamicTree
 
time_t _instanceResetPeriod
 
MapRefMgr m_mapRefMgr
 
MapRefMgr::iterator m_mapRefIter
 
ActiveNonPlayers m_activeNonPlayers
 
ActiveNonPlayers::iterator m_activeNonPlayersIter
 
TransportsContainer _transports
 
TransportsContainer::iterator _transportsUpdateIter
 

Detailed Description

Constructor & Destructor Documentation

◆ InstanceMap()

InstanceMap::InstanceMap ( uint32  id,
uint32  InstanceId,
uint8  SpawnMode,
Map _parent 
)
2821 : Map(id, InstanceId, SpawnMode, _parent),
2823 instance_data(nullptr), i_script_id(0)
2824{
2825 //lets initialize visibility distance for dungeons
2827
2828 // the timer is started by default, and stopped when the first player joins
2829 // this make sure it gets unloaded if for some reason no player joins
2831
2832 // pussywizard:
2833 if (IsRaid())
2834 if (time_t resetTime = sInstanceSaveMgr->GetResetTimeFor(id, Difficulty(SpawnMode)))
2835 if (time_t extendedResetTime = sInstanceSaveMgr->GetExtendedResetTimeFor(id, Difficulty(SpawnMode)))
2836 _instanceResetPeriod = extendedResetTime - resetTime;
2837}
std::uint32_t uint32
Definition: Define.h:107
#define sInstanceSaveMgr
Definition: InstanceSaveMgr.h:202
#define MIN_UNLOAD_DELAY
Definition: Map.h:168
@ CONFIG_INSTANCE_UNLOAD_DELAY
Definition: IWorld.h:255
Difficulty
Definition: DBCEnums.h:266
#define sWorld
Definition: World.h:444
Definition: Map.h:313
uint32 m_unloadTimer
Definition: Map.h:711
bool IsRaid() const
Definition: Map.h:450
time_t _instanceResetPeriod
Definition: Map.h:714
bool m_resetAfterUnload
Definition: Map.h:846
bool m_unloadWhenEmpty
Definition: Map.h:847
InstanceScript * instance_data
Definition: Map.h:848
void InitVisibilityDistance() override
Definition: Map.cpp:2846
uint32 i_script_id
Definition: Map.h:849

References Map::_instanceResetPeriod, CONFIG_INSTANCE_UNLOAD_DELAY, InitVisibilityDistance(), Map::IsRaid(), Map::m_unloadTimer, MIN_UNLOAD_DELAY, sInstanceSaveMgr, and sWorld.

◆ ~InstanceMap()

InstanceMap::~InstanceMap ( )
override
2840{
2841 delete instance_data;
2842 instance_data = nullptr;
2843 sInstanceSaveMgr->DeleteInstanceSaveIfNeeded(GetInstanceId(), true);
2844}
uint32 GetInstanceId() const
Definition: Map.h:419

References Map::GetInstanceId(), instance_data, and sInstanceSaveMgr.

Member Function Documentation

◆ AddPlayerToMap()

bool InstanceMap::AddPlayerToMap ( Player player)
overridevirtual

Reimplemented from Map.

2953{
2954 if (m_resetAfterUnload) // this instance has been reset, it's not meant to be used anymore
2955 return false;
2956
2957 if (IsDungeon())
2958 {
2959 Group* group = player->GetGroup();
2960
2961 // get an instance save for the map
2962 InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
2963 if (!mapSave)
2964 {
2965 LOG_ERROR("maps", "InstanceMap::Add: InstanceSave does not exist for map {} spawnmode {} with instance id {}", GetId(), GetSpawnMode(), GetInstanceId());
2966 return false;
2967 }
2968
2969 // check for existing instance binds
2970 InstancePlayerBind* playerBind = sInstanceSaveMgr->PlayerGetBoundInstance(player->GetGUID(), GetId(), Difficulty(GetSpawnMode()));
2971 if (playerBind && playerBind->perm)
2972 {
2973 if (playerBind->save != mapSave)
2974 {
2975 LOG_ERROR("maps", "InstanceMap::Add: player {} ({}) is permanently bound to instance {}, {}, {}, {} but he is being put into instance {}, {}, {}, {}",
2976 player->GetName(), player->GetGUID().ToString(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(),
2977 playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->CanReset());
2978 return false;
2979 }
2980 }
2981 else if (player->GetSession()->PlayerLoading() && playerBind && playerBind->save != mapSave)
2982 {
2983 // Prevent "Convert to Raid" exploit to reset instances
2984 return false;
2985 }
2986 else
2987 {
2988 playerBind = sInstanceSaveMgr->PlayerBindToInstance(player->GetGUID(), mapSave, false, player);
2989 // pussywizard: bind lider also if not yet bound
2990 if (Group* g = player->GetGroup())
2991 if (g->GetLeaderGUID() != player->GetGUID())
2992 if (!sInstanceSaveMgr->PlayerGetBoundInstance(g->GetLeaderGUID(), mapSave->GetMapId(), mapSave->GetDifficulty()))
2993 {
2994 sInstanceSaveMgr->PlayerCreateBoundInstancesMaps(g->GetLeaderGUID());
2995 sInstanceSaveMgr->PlayerBindToInstance(g->GetLeaderGUID(), mapSave, false, ObjectAccessor::FindConnectedPlayer(g->GetLeaderGUID()));
2996 }
2997 }
2998
2999 // increase current instances (hourly limit)
3000 // xinef: specific instances are still limited
3001 if (!group || !group->isLFGGroup() || !group->IsLfgRandomInstance())
3003
3004 if (!playerBind->perm && !mapSave->CanReset() && group && !group->isLFGGroup() && !group->IsLfgRandomInstance())
3005 {
3007 data << uint32(60000);
3009 data << uint8(0);
3010 player->GetSession()->SendPacket(&data);
3011 player->SetPendingBind(mapSave->GetInstanceId(), 60000);
3012 }
3013 }
3014
3015 // initialize unload state
3016 m_unloadTimer = 0;
3017 m_resetAfterUnload = false;
3018 m_unloadWhenEmpty = false;
3019
3020 // this will acquire the same mutex so it cannot be in the previous block
3021 Map::AddPlayerToMap(player);
3022
3023 if (instance_data)
3025
3026 return true;
3027}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:156
std::uint8_t uint8
Definition: Define.h:109
@ SMSG_INSTANCE_LOCK_WARNING_QUERY
Definition: Opcodes.h:357
Player * FindConnectedPlayer(ObjectGuid const guid)
Definition: ObjectAccessor.cpp:260
Seconds GetGameTime()
Definition: GameTime.cpp:38
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
std::string const & GetName() const
Definition: Object.h:458
std::string ToString() const
Definition: ObjectGuid.cpp:47
void AddInstanceEnterTime(uint32 instanceId, time_t enterTime)
Definition: Player.h:2430
WorldSession * GetSession() const
Definition: Player.h:1978
Group * GetGroup()
Definition: Player.h:2448
void SetPendingBind(uint32 instanceId, uint32 bindTimer)
Definition: Player.h:2418
Definition: Group.h:169
bool isLFGGroup(bool restricted=false) const
Definition: Group.cpp:2265
bool IsLfgRandomInstance() const
Definition: Group.h:314
Definition: InstanceSaveMgr.h:39
InstanceSave * save
Definition: InstanceSaveMgr.h:40
bool perm
Definition: InstanceSaveMgr.h:41
Definition: InstanceSaveMgr.h:56
uint32 GetInstanceId() const
Definition: InstanceSaveMgr.h:61
uint32 GetMapId() const
Definition: InstanceSaveMgr.h:62
Difficulty GetDifficulty() const
Definition: InstanceSaveMgr.h:63
bool CanReset() const
Definition: InstanceSaveMgr.h:81
uint32 GetCompletedEncounterMask() const
Definition: InstanceScript.h:253
virtual void OnPlayerEnter(Player *)
Definition: InstanceScript.h:185
bool IsDungeon() const
Definition: Map.h:448
uint8 GetSpawnMode() const
Definition: Map.h:420
uint32 GetId() const
Definition: Map.h:379
virtual bool AddPlayerToMap(Player *)
Definition: Map.cpp:504
Definition: WorldPacket.h:27
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition: WorldSession.cpp:214
bool PlayerLoading() const
Definition: WorldSession.h:337

References Player::AddInstanceEnterTime(), Map::AddPlayerToMap(), InstanceSave::CanReset(), ObjectAccessor::FindConnectedPlayer(), InstanceScript::GetCompletedEncounterMask(), InstanceSave::GetDifficulty(), GameTime::GetGameTime(), Player::GetGroup(), Object::GetGUID(), Map::GetId(), InstanceSave::GetInstanceId(), Map::GetInstanceId(), InstanceSave::GetMapId(), WorldObject::GetName(), Player::GetSession(), Map::GetSpawnMode(), instance_data, Map::IsDungeon(), Group::isLFGGroup(), Group::IsLfgRandomInstance(), LOG_ERROR, m_resetAfterUnload, Map::m_unloadTimer, m_unloadWhenEmpty, InstanceScript::OnPlayerEnter(), InstancePlayerBind::perm, WorldSession::PlayerLoading(), InstancePlayerBind::save, WorldSession::SendPacket(), Player::SetPendingBind(), sInstanceSaveMgr, SMSG_INSTANCE_LOCK_WARNING_QUERY, and ObjectGuid::ToString().

◆ AfterPlayerUnlinkFromMap()

void InstanceMap::AfterPlayerUnlinkFromMap ( )
overridevirtual

Reimplemented from Map.

3051{
3052 if (!m_unloadTimer && !HavePlayers())
3055}
bool HavePlayers() const
Definition: Map.h:477
virtual void AfterPlayerUnlinkFromMap()
Definition: Map.cpp:934

References Map::AfterPlayerUnlinkFromMap(), CONFIG_INSTANCE_UNLOAD_DELAY, Map::HavePlayers(), Map::m_unloadTimer, m_unloadWhenEmpty, MIN_UNLOAD_DELAY, and sWorld.

◆ CannotEnter()

Map::EnterState InstanceMap::CannotEnter ( Player player,
bool  loginCheck = false 
)
overridevirtual

Reimplemented from Map.

2883{
2884 if (!loginCheck && player->GetMapRef().getTarget() == this)
2885 {
2886 LOG_ERROR("maps", "InstanceMap::CanEnter - player {} ({}) already in map {}, {}, {}!",
2887 player->GetName(), player->GetGUID().ToString(), GetId(), GetInstanceId(), GetSpawnMode());
2888
2890 }
2891
2892 // allow GM's to enter
2893 if (player->IsGameMaster())
2894 return Map::CannotEnter(player, loginCheck);
2895
2896 // cannot enter if the instance is full (player cap), GMs don't count
2897 uint32 maxPlayers = GetMaxPlayers();
2898 if (GetPlayersCountExceptGMs() >= (loginCheck ? maxPlayers + 1 : maxPlayers))
2899 {
2900 LOG_DEBUG("maps", "MAP: Instance '{}' of map '{}' cannot have more than '{}' players. Player '{}' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
2903 }
2904
2905 // cannot enter while an encounter is in progress on raids
2906 bool checkProgress = (IsRaid() || GetId() == 668 /*HoR*/);
2907 if (checkProgress && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
2908 {
2911 }
2912
2913 // xinef: dont allow LFG Group to enter other instance that is selected
2914 if (Group* group = player->GetGroup())
2915 if (group->isLFGGroup())
2916 if (!sLFGMgr->inLfgDungeonMap(group->GetGUID(), GetId(), GetDifficulty()))
2917 {
2920 }
2921
2922 // cannot enter if instance is in use by another party/soloer that have a permanent save in the same instance id
2923 PlayerList const& playerList = GetPlayers();
2924 if (!playerList.IsEmpty())
2925 for (PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i)
2926 if (Player* iPlayer = i->GetSource())
2927 {
2928 if (iPlayer == player) // login case, player already added to map
2929 continue;
2930 if (iPlayer->IsGameMaster()) // bypass GMs
2931 continue;
2932 if (!player->GetGroup()) // player has not group and there is someone inside, deny entry
2933 {
2936 }
2937 // player inside instance has no group or his groups is different to entering player's one, deny entry
2938 if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup())
2939 {
2942 }
2943 break;
2944 }
2945
2946 return Map::CannotEnter(player, loginCheck);
2947}
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:168
#define sLFGMgr
Definition: LFGMgr.h:641
@ TRANSFER_ABORT_MAP_NOT_ALLOWED
Definition: Player.h:798
@ TRANSFER_ABORT_MAX_PLAYERS
Definition: Player.h:785
@ TRANSFER_ABORT_ZONE_IN_COMBAT
Definition: Player.h:788
TO * getTarget() const
Definition: Reference.h:95
Definition: Player.h:1064
bool IsGameMaster() const
Definition: Player.h:1158
MapReference & GetMapRef()
Definition: Player.h:2471
void SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 arg=0)
Definition: Player.cpp:11713
virtual bool IsEncounterInProgress() const
Definition: InstanceScript.cpp:122
MapRefMgr PlayerList
Definition: Map.h:485
virtual EnterState CannotEnter(Player *, bool)
Definition: Map.h:438
uint32 GetPlayersCountExceptGMs() const
Definition: Map.cpp:2745
const char * GetMapName() const
Definition: Map.cpp:2524
Difficulty GetDifficulty() const
Definition: Map.h:443
PlayerList const & GetPlayers() const
Definition: Map.h:486
@ CANNOT_ENTER_MAX_PLAYERS
Definition: Map.h:433
@ CANNOT_ENTER_ZONE_IN_COMBAT
Definition: Map.h:434
@ CANNOT_ENTER_ALREADY_IN_MAP
Definition: Map.h:425
@ CANNOT_ENTER_UNSPECIFIED_REASON
Definition: Map.h:435
@ CANNOT_ENTER_INSTANCE_BIND_MISMATCH
Definition: Map.h:431
uint32 GetMaxPlayers() const
Definition: Map.cpp:3214
InstanceScript * GetInstanceScript()
Definition: Map.h:831
LinkedListHead::Iterator< MapReference const > const_iterator
Definition: MapRefMgr.h:29

References MapRefMgr::begin(), Map::CANNOT_ENTER_ALREADY_IN_MAP, Map::CANNOT_ENTER_INSTANCE_BIND_MISMATCH, Map::CANNOT_ENTER_MAX_PLAYERS, Map::CANNOT_ENTER_UNSPECIFIED_REASON, Map::CANNOT_ENTER_ZONE_IN_COMBAT, Map::CannotEnter(), MapRefMgr::end(), Map::GetDifficulty(), Player::GetGroup(), Object::GetGUID(), Map::GetId(), Map::GetInstanceId(), GetInstanceScript(), Map::GetMapName(), Player::GetMapRef(), GetMaxPlayers(), WorldObject::GetName(), Map::GetPlayers(), Map::GetPlayersCountExceptGMs(), Map::GetSpawnMode(), Reference< TO, FROM >::getTarget(), LinkedListHead::IsEmpty(), InstanceScript::IsEncounterInProgress(), Player::IsGameMaster(), Map::IsRaid(), LOG_DEBUG, LOG_ERROR, Player::SendTransferAborted(), sLFGMgr, ObjectGuid::ToString(), TRANSFER_ABORT_MAP_NOT_ALLOWED, TRANSFER_ABORT_MAX_PLAYERS, and TRANSFER_ABORT_ZONE_IN_COMBAT.

◆ CreateInstanceScript()

void InstanceMap::CreateInstanceScript ( bool  load,
std::string  data,
uint32  completedEncounterMask 
)
3058{
3059 if (instance_data)
3060 {
3061 return;
3062 }
3063
3064 bool isOtherAI = false;
3065
3066 sScriptMgr->OnBeforeCreateInstanceScript(this, &instance_data, load, data, completedEncounterMask);
3067
3068 if (instance_data)
3069 isOtherAI = true;
3070
3071 // if Eluna AI was fetched succesfully we should not call CreateInstanceData nor set the unused scriptID
3072 if (!isOtherAI)
3073 {
3074 InstanceTemplate const* mInstance = sObjectMgr->GetInstanceTemplate(GetId());
3075 if (mInstance)
3076 {
3077 i_script_id = mInstance->ScriptId;
3078 instance_data = sScriptMgr->CreateInstanceScript(this);
3079 }
3080 }
3081
3082 if (!instance_data)
3083 return;
3084
3085 // use mangos behavior if we are dealing with Eluna AI
3086 // initialize should then be called only if load is false
3087 if (!isOtherAI || !load)
3088 {
3090 }
3091
3092 if (load)
3093 {
3094 instance_data->SetCompletedEncountersMask(completedEncounterMask, false);
3095 if (data != "")
3096 instance_data->Load(data.c_str());
3097 }
3098
3100}
#define sScriptMgr
Definition: ScriptMgr.h:708
#define sObjectMgr
Definition: ObjectMgr.h:1623
virtual void Load(char const *data)
Definition: InstanceScript.cpp:413
void SetCompletedEncountersMask(uint32 newMask, bool save)
Definition: InstanceScript.cpp:694
void LoadInstanceSavedGameobjectStateData()
Definition: InstanceScript.cpp:744
virtual void Initialize()
Definition: InstanceScript.h:151
Definition: Map.h:274
uint32 ScriptId
Definition: Map.h:276

References Map::GetId(), i_script_id, InstanceScript::Initialize(), instance_data, InstanceScript::Load(), InstanceScript::LoadInstanceSavedGameobjectStateData(), InstanceTemplate::ScriptId, InstanceScript::SetCompletedEncountersMask(), sObjectMgr, and sScriptMgr.

Referenced by MapInstanced::CreateInstance().

◆ GetDebugInfo()

std::string InstanceMap::GetDebugInfo ( ) const
overridevirtual

Reimplemented from Map.

4070{
4071 std::stringstream sstr;
4072 sstr << Map::GetDebugInfo() << "\n"
4073 << std::boolalpha
4074 << "ScriptId: " << GetScriptId() << " ScriptName: " << GetScriptName();
4075 return sstr.str();
4076}
virtual std::string GetDebugInfo() const
Definition: Map.cpp:4060
uint32 GetScriptId() const
Definition: Map.h:829
std::string const & GetScriptName() const
Definition: Map.cpp:3147

References Map::GetDebugInfo(), GetScriptId(), and GetScriptName().

◆ GetInstanceScript() [1/2]

◆ GetInstanceScript() [2/2]

InstanceScript const * InstanceMap::GetInstanceScript ( ) const
inline
832{ return instance_data; }

References instance_data.

◆ GetMaxPlayers()

uint32 InstanceMap::GetMaxPlayers ( ) const
3215{
3216 MapDifficulty const* mapDiff = GetMapDifficulty();
3217 if (mapDiff && mapDiff->maxPlayers)
3218 return mapDiff->maxPlayers;
3219
3220 return GetEntry()->maxPlayers;
3221}
MapDifficulty const * GetMapDifficulty() const
Definition: Map.cpp:3209
MapEntry const * GetEntry() const
Definition: Map.h:319
uint32 maxPlayers
Definition: DBCStructure.h:1346
Definition: DBCStructure.h:2222
uint32 maxPlayers
Definition: DBCStructure.h:2227

References Map::GetEntry(), Map::GetMapDifficulty(), MapEntry::maxPlayers, and MapDifficulty::maxPlayers.

Referenced by CannotEnter(), and AchievementMgr::UpdateAchievementCriteria().

◆ GetMaxResetDelay()

uint32 InstanceMap::GetMaxResetDelay ( ) const
3224{
3225 MapDifficulty const* mapDiff = GetMapDifficulty();
3226 return mapDiff ? mapDiff->resetTime : 0;
3227}
uint32 resetTime
Definition: DBCStructure.h:2226

References Map::GetMapDifficulty(), and MapDifficulty::resetTime.

◆ GetScriptId()

uint32 InstanceMap::GetScriptId ( ) const
inline
829{ return i_script_id; }

References i_script_id.

Referenced by ScriptMgr::CreateInstanceScript(), and GetDebugInfo().

◆ GetScriptName()

std::string const & InstanceMap::GetScriptName ( ) const
3148{
3149 return sObjectMgr->GetScriptName(i_script_id);
3150}

References i_script_id, and sObjectMgr.

Referenced by GetDebugInfo().

◆ InitVisibilityDistance()

void InstanceMap::InitVisibilityDistance ( )
overridevirtual

Reimplemented from Map.

2847{
2848 //init visibility distance for instances
2850
2851 // pussywizard: this CAN NOT exceed MAX_VISIBILITY_DISTANCE
2852 switch (GetId())
2853 {
2854 case 429: // Dire Maul
2855 case 550: // The Eye
2856 case 578: // The Nexus: The Oculus
2857 m_VisibleDistance = 175.0f;
2858 break;
2859 case 649: // Trial of the Crusader
2860 case 650: // Trial of the Champion
2861 case 595: // Culling of Startholme
2862 case 658: // Pit of Saron
2863 m_VisibleDistance = 150.0f;
2864 break;
2865 case 615: // Obsidian Sanctum
2866 case 616: // Eye of Eternity
2867 case 603: // Ulduar
2868 case 668: // Halls of Reflection
2869 case 631: // Icecrown Citadel
2870 case 724: // Ruby Sanctum
2871 m_VisibleDistance = 200.0f;
2872 break;
2873 case 531: // Ahn'Qiraj Temple
2874 m_VisibleDistance = 300.0f;
2875 break;
2876 }
2877}
float m_VisibleDistance
Definition: Map.h:712
static float GetMaxVisibleDistanceInInstances()
Definition: World.h:317

References Map::GetId(), World::GetMaxVisibleDistanceInInstances(), and Map::m_VisibleDistance.

Referenced by InstanceMap().

◆ PermBindAllPlayers()

void InstanceMap::PermBindAllPlayers ( )
3153{
3154 if (!IsDungeon())
3155 return;
3156
3157 InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
3158 if (!save)
3159 {
3160 LOG_ERROR("maps", "Cannot bind players because no instance save is available for instance map (Name: {}, Entry: {}, InstanceId: {})!", GetMapName(), GetId(), GetInstanceId());
3161 return;
3162 }
3163
3164 Player* player;
3165 Group* group;
3166 // group members outside the instance group don't get bound
3167 for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
3168 {
3169 player = itr->GetSource();
3170 group = player->GetGroup();
3171
3172 // players inside an instance cannot be bound to other instances
3173 // some players may already be permanently bound, in this case nothing happens
3174 InstancePlayerBind* bind = sInstanceSaveMgr->PlayerGetBoundInstance(player->GetGUID(), save->GetMapId(), save->GetDifficulty());
3175
3176 if (!bind || !bind->perm)
3177 {
3179 data << uint32(0);
3180 player->GetSession()->SendPacket(&data);
3181 sInstanceSaveMgr->PlayerBindToInstance(player->GetGUID(), save, true, player);
3182 }
3183
3184 // Xinef: Difficulty change prevention
3185 if (group)
3187 }
3188}
@ DIFFICULTY_PREVENTION_CHANGE_BOSS_KILLED
Definition: Group.h:135
@ SMSG_INSTANCE_SAVE_CREATED
Definition: Opcodes.h:745
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
Definition: Group.cpp:2537
MapRefMgr m_mapRefMgr
Definition: Map.h:716
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References MapRefMgr::begin(), DIFFICULTY_PREVENTION_CHANGE_BOSS_KILLED, MapRefMgr::end(), InstanceSave::GetDifficulty(), Player::GetGroup(), Object::GetGUID(), Map::GetId(), Map::GetInstanceId(), InstanceSave::GetMapId(), Map::GetMapName(), Player::GetSession(), Map::IsDungeon(), LOG_ERROR, Map::m_mapRefMgr, InstancePlayerBind::perm, WorldSession::SendPacket(), Group::SetDifficultyChangePrevention(), sInstanceSaveMgr, and SMSG_INSTANCE_SAVE_CREATED.

Referenced by boss_flame_leviathan::boss_flame_leviathanAI::BindPlayers(), boss_skeram::JustDied(), Unit::Kill(), instance_karazhan::instance_karazhan_InstanceMapScript::OnUnitDeath(), instance_karazhan::instance_karazhan_InstanceMapScript::SetData(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::SetData(), and instance_halls_of_reflection::instance_halls_of_reflection_InstanceMapScript::Update().

◆ RemovePlayerFromMap()

void InstanceMap::RemovePlayerFromMap ( Player player,
bool  remove 
)
overridevirtual

Reimplemented from Map.

3039{
3040 // pussywizard: moved m_unloadTimer to InstanceMap::AfterPlayerUnlinkFromMap(), in this function if 2 players run out at the same time the instance won't close
3041 //if (!m_unloadTimer && m_mapRefMgr.getSize() == 1)
3042 // m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld->getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
3043 Map::RemovePlayerFromMap(player, remove);
3044
3045 // If remove == true - player already deleted.
3046 if (!remove)
3047 player->SetPendingBind(0, 0);
3048}
virtual void RemovePlayerFromMap(Player *, bool)
Definition: Map.cpp:911

References Map::RemovePlayerFromMap(), and Player::SetPendingBind().

◆ Reset()

bool InstanceMap::Reset ( uint8  method,
GuidList globalSkipList = nullptr 
)
3106{
3107 if (method == INSTANCE_RESET_GLOBAL)
3108 {
3109 // pussywizard: teleport out immediately
3110 for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
3111 {
3112 // teleport players that are no longer bound (can be still bound if extended id)
3113 if (!globalResetSkipList || std::find(globalResetSkipList->begin(), globalResetSkipList->end(), itr->GetSource()->GetGUID()) == globalResetSkipList->end())
3114 itr->GetSource()->RepopAtGraveyard();
3115 }
3116
3117 // reset map only if noone is bound
3118 if (!globalResetSkipList || globalResetSkipList->empty())
3119 {
3120 // pussywizard: setting both m_unloadWhenEmpty and m_unloadTimer intended, in case RepopAtGraveyard failed
3121 if (HavePlayers())
3122 m_unloadWhenEmpty = true;
3124 m_resetAfterUnload = true;
3125 }
3126
3127 return m_mapRefMgr.IsEmpty();
3128 }
3129
3130 if (HavePlayers())
3131 {
3132 if (method == INSTANCE_RESET_ALL || method == INSTANCE_RESET_CHANGE_DIFFICULTY)
3133 {
3134 for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
3135 itr->GetSource()->SendResetFailedNotify(GetId());
3136 }
3137 }
3138 else
3139 {
3141 m_resetAfterUnload = true;
3142 }
3143
3144 return m_mapRefMgr.IsEmpty();
3145}
@ INSTANCE_RESET_CHANGE_DIFFICULTY
Definition: Map.h:812
@ INSTANCE_RESET_GLOBAL
Definition: Map.h:813
@ INSTANCE_RESET_ALL
Definition: Map.h:811
bool IsEmpty() const
Definition: LinkedList.h:97

References MapRefMgr::begin(), MapRefMgr::end(), Map::GetId(), Map::HavePlayers(), INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GLOBAL, LinkedListHead::IsEmpty(), Map::m_mapRefMgr, m_resetAfterUnload, Map::m_unloadTimer, m_unloadWhenEmpty, and MIN_UNLOAD_DELAY.

Referenced by InstanceSaveMgr::_ResetOrWarnAll(), Player::ResetInstances(), and Group::ResetInstances().

◆ SendResetWarnings()

void InstanceMap::SendResetWarnings ( uint32  timeLeft) const
3204{
3205 for (MapRefMgr::const_iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
3206 itr->GetSource()->SendInstanceResetWarning(GetId(), itr->GetSource()->GetDifficulty(IsRaid()), timeLeft, false);
3207}

References MapRefMgr::begin(), MapRefMgr::end(), Map::GetId(), Map::IsRaid(), and Map::m_mapRefMgr.

Referenced by InstanceSaveMgr::_ResetOrWarnAll().

◆ UnloadAll()

void InstanceMap::UnloadAll ( )
overridevirtual

Reimplemented from Map.

3191{
3192 ASSERT(!HavePlayers());
3193
3195 {
3198 }
3199
3201}
#define ASSERT
Definition: Errors.h:68
void DeleteCorpseData()
Definition: Map.cpp:4051
void DeleteRespawnTimes()
Definition: Map.cpp:3450
virtual void UnloadAll()
Definition: Map.cpp:1275

References ASSERT, Map::DeleteCorpseData(), Map::DeleteRespawnTimes(), Map::HavePlayers(), m_resetAfterUnload, and Map::UnloadAll().

◆ Update()

void InstanceMap::Update ( const uint32  t_diff,
const uint32  s_diff,
bool  thread = true 
)
overridevirtual

Reimplemented from Map.

3030{
3031 Map::Update(t_diff, s_diff);
3032
3033 if (t_diff)
3034 if (instance_data)
3035 instance_data->Update(t_diff);
3036}
virtual void Update(uint32)
Definition: InstanceScript.cpp:223
virtual void Update(const uint32, const uint32, bool thread=true)
Definition: Map.cpp:736

References instance_data, Map::Update(), and InstanceScript::Update().

Member Data Documentation

◆ i_script_id

uint32 InstanceMap::i_script_id
private

◆ instance_data

InstanceScript* InstanceMap::instance_data
private

◆ m_resetAfterUnload

bool InstanceMap::m_resetAfterUnload
private

Referenced by AddPlayerToMap(), Reset(), and UnloadAll().

◆ m_unloadWhenEmpty

bool InstanceMap::m_unloadWhenEmpty
private