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

#include "Map.h"

Inheritance diagram for InstanceMap:
Map GridRefMgr< MapGridType > 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
 
InstanceScript * GetInstanceScript ()
 
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)
 
template<class T >
bool AddToMap (T *, bool checkTransport=false)
 
template<class T >
void RemoveFromMap (T *, bool)
 
void MarkNearbyCellsOf (WorldObject *obj)
 
float GetVisibilityRange () const
 
void SetVisibilityRange (float range)
 
void OnCreateMap ()
 
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 (Cell const &cell, TypeContainerVisitor< T, CONTAINER > &visitor)
 
bool IsGridLoaded (GridCoord const &gridCoord) const
 
bool IsGridLoaded (float x, float y) const
 
bool IsGridCreated (GridCoord const &gridCoord) const
 
bool IsGridCreated (float x, float y) const
 
void LoadGrid (float x, float y)
 
void LoadAllGrids ()
 
void LoadGridsInRange (Position const &center, float radius)
 
bool UnloadGrid (MapGridType &grid)
 
std::shared_ptr< GridTerrainData > GetGridTerrainDataSharedPtr (GridCoord const &gridCoord)
 
GridTerrainData * GetGridTerrainData (GridCoord const &gridCoord)
 
GridTerrainData * GetGridTerrainData (float x, float y)
 
uint32 GetId () const
 
Map const * GetParent () const
 
void HandleDelayedVisibility ()
 
float GetHeight (float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
float GetHeight (Position const &pos, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
 
float GetGridHeight (float x, float y) const
 
float GetMinHeight (float x, float y) const
 
Transport * GetTransportForPos (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, Optional< uint8 > reqLiquidType={})
 
LiquidData const GetLiquidData (uint32 phaseMask, float x, float y, float z, float collisionHeight, Optional< 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
 
char const * 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)
 
virtual void DelayedUpdate (const uint32 diff)
 
void resetMarkedCells ()
 
bool isCellMarked (uint32 pCellId)
 
void markCell (uint32 pCellId)
 
bool HavePlayers () const
 
uint32 GetPlayersCountExceptGMs (bool aliveOnly=false) const
 
void SendToPlayers (WorldPacket const *data) const
 
void StartPlayersRedirectKickTimer ()
 
void StopPlayersRedirectKickTimer ()
 
bool IsPlayerRedirectKickTimerActive ()
 
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 UpdateIteratorBack (Player *player)
 
TempSummon * SummonCreature (uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, bool visibleBySummonerOnly=false)
 
GameObject * SummonGameObject (uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true)
 
GameObject * SummonGameObject (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)
 
void SummonGameObjectGroup (uint8 group, std::list< GameObject * > *list=nullptr)
 
Corpse * GetCorpse (ObjectGuid const &guid)
 
Creature * GetCreature (ObjectGuid const &guid)
 
GameObject * GetGameObject (ObjectGuid const &guid)
 
Transport * GetTransport (ObjectGuid const &guid)
 
DynamicObject * GetDynamicObject (ObjectGuid const &guid)
 
Pet * GetPet (ObjectGuid const &guid)
 
MapStoredObjectTypesContainer & GetObjectsStore ()
 
CreatureBySpawnIdContainer & GetCreatureBySpawnIdStore ()
 
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore ()
 
std::unordered_set< Corpse * > const * GetCorpsesInGrid (uint32 gridId) const
 
Corpse * GetCorpseByPlayer (ObjectGuid const &ownerGuid) const
 
SpawnedPoolData & GetPoolData ()
 
SpawnedPoolData const & GetPoolData () const
 
MapInstanced * ToMapInstanced ()
 
MapInstanced const * ToMapInstanced () const
 
InstanceMap * ToInstanceMap ()
 
InstanceMap const * ToInstanceMap () const
 
BattlegroundMap * ToBattlegroundMap ()
 
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.
 
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.
 
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
 
void Balance ()
 
void RemoveGameObjectModel (GameObjectModel const &model)
 
void InsertGameObjectModel (GameObjectModel const &model)
 
bool ContainsGameObjectModel (GameObjectModel const &model) const
 
DynamicMapTree const & GetDynamicMapTree () const
 
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)
 
std::unordered_map< ObjectGuid::LowType, time_t > const & GetCreatureRespawnTimes () const
 
std::unordered_map< ObjectGuid::LowType, time_t > const & GetGORespawnTimes () const
 
void LoadRespawnTimes ()
 
void DeleteRespawnTimes ()
 
time_t GetInstanceResetPeriod () const
 
void UpdatePlayerZoneStats (uint32 oldZone, uint32 newZone)
 
uint32 ApplyDynamicModeRespawnScaling (WorldObject const *obj, uint32 respawnDelay) const
 
bool SpawnGroupSpawn (uint32 groupId, bool ignoreRespawn=false, bool force=false)
 
bool SpawnGroupDespawn (uint32 groupId, bool deleteRespawnTimes=false)
 
bool IsSpawnGroupActive (uint32 groupId) const
 
void ProcessRespawns ()
 
void ProcessCreatureRespawn (ObjectGuid::LowType spawnId)
 
void ProcessGameObjectRespawn (ObjectGuid::LowType spawnId)
 
time_t GetRespawnTime (SpawnObjectType type, ObjectGuid::LowType spawnId) const
 
void RemoveRespawnTime (SpawnObjectType type, ObjectGuid::LowType spawnId)
 
void ScheduleCreatureRespawn (ObjectGuid, Milliseconds, Position pos=Position())
 
void LoadCorpseData ()
 
void DeleteCorpseData ()
 
void AddCorpse (Corpse *corpse)
 
void RemoveCorpse (Corpse *corpse)
 
Corpse * ConvertCorpseToBones (ObjectGuid const &ownerGuid, bool insignia=false)
 
void RemoveOldCorpses ()
 
bool SendZoneMessage (uint32 zone, WorldPacket const *packet, WorldSession const *self=nullptr, TeamId teamId=TEAM_NEUTRAL) const
 Send a packet to all players (or players selected team) in the zone (except self if mentioned)
 
void SendZoneText (uint32 zoneId, char const *text, WorldSession const *self=nullptr, TeamId teamId=TEAM_NEUTRAL) const
 Send a System Message to all players in the zone (except self if mentioned)
 
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 SendInitSelf (Player *player)
 
void UpdateWeather (uint32 const diff)
 
void UpdateExpiredCorpses (uint32 const diff)
 
void PlayDirectSoundToMap (uint32 soundId, uint32 zoneId=0)
 
void SetZoneMusic (uint32 zoneId, uint32 musicId)
 
Weather * GetOrGenerateZoneDefaultWeather (uint32 zoneId)
 
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)
 
void EnsureGridCreated (GridCoord 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)
 
size_t GetUpdatableObjectsCount () const
 
uint32 GetCreatedGridsCount ()
 
uint32 GetLoadedGridsCount ()
 
uint32 GetCreatedCellsInGridCount (uint16 const x, uint16 const y)
 
uint32 GetCreatedCellsInMapCount ()
 
void AddObjectToPendingUpdateList (WorldObject *obj)
 
void RemoveObjectFromMapUpdateList (WorldObject *obj)
 
void AddWorldObjectToFarVisibleMap (WorldObject *obj)
 
void RemoveWorldObjectFromFarVisibleMap (WorldObject *obj)
 
void AddWorldObjectToZoneWideVisibleMap (uint32 zoneId, WorldObject *obj)
 
void RemoveWorldObjectFromZoneWideVisibleMap (uint32 zoneId, WorldObject *obj)
 
ZoneWideVisibleWorldObjectsSet const * GetZoneWideVisibleWorldObjectsForZone (uint32 zoneId) const
 
uint32 GetPlayerCountInZone (uint32 zoneId) const
 
MapCollisionData & GetMapCollisionData ()
 
MapCollisionData const & GetMapCollisionData () const
 
template<>
void AddToGrid (Creature *obj, Cell const &cell)
 
template<>
void AddToGrid (GameObject *obj, Cell const &cell)
 
template<>
void AddToGrid (Player *obj, Cell const &cell)
 
template<>
void AddToGrid (Corpse *obj, Cell const &cell)
 
template<>
void DeleteFromWorld (Player *player)
 
template<>
void InitializeObject (Creature *)
 
template<>
void InitializeObject (GameObject *)
 
template<>
bool AddToMap (Transport *obj, bool)
 
template<>
void RemoveFromMap (Transport *obj, bool remove)
 
- Public Member Functions inherited from GridRefMgr< MapGridType >
GridReference< MapGridType > * getFirst ()
 
GridReference< MapGridType > * 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
 
LinkedListElement * getFirst ()
 
LinkedListElement const * getFirst () const
 
LinkedListElement * getLast ()
 
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
 
InstanceScript * instance_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
 
typedef std::vector< WorldObject * > UpdatableObjectList
 
typedef std::unordered_set< WorldObject * > PendingAddUpdatableObjectList
 
- Public Types inherited from GridRefMgr< MapGridType >
typedef LinkedListHead::Iterator< GridReference< MapGridType > > iterator
 
- Public Types inherited from RefMgr< TO, FROM >
typedef LinkedListHead::Iterator< Reference< TO, FROM > > iterator
 
- Public Types inherited from LinkedListHead
typedef Iterator< LinkedListElement > iterator
 
- Static Public Member Functions inherited from Map
static void DeleteRespawnTimesInDB (uint16 mapId, uint32 instanceId)
 
- Public Attributes inherited from Map
std::unordered_set< Unit * > i_objectsForDelayedVisibility
 
CreatureGroupHolderType CreatureGroupHolder
 
EventProcessor Events
 
DataMap CustomData
 
- Protected Member Functions inherited from Map
template<class T >
void AddToGrid (T *object, Cell const &cell)
 
- Protected Attributes inherited from Map
std::mutex Lock
 
MapGridManager _mapGridManager
 
MapEntry const * i_mapEntry
 
MapCollisionData _mapCollisionData
 
uint8 i_spawnMode
 
uint32 i_InstanceId
 
uint32 m_unloadTimer
 
float m_VisibleDistance
 
time_t _instanceResetPeriod
 
MapRefMgr m_mapRefMgr
 
MapRefMgr::iterator m_mapRefIter
 
TransportsContainer _transports
 
TransportsContainer::iterator _transportsUpdateIter
 

Detailed Description

Constructor & Destructor Documentation

◆ InstanceMap()

InstanceMap::InstanceMap ( uint32  id,
uint32  InstanceId,
uint8  SpawnMode,
Map *  _parent 
)
1947 : Map(id, InstanceId, SpawnMode, _parent),
1949 instance_data(nullptr), i_script_id(0)
1950{
1951 //lets initialize visibility distance for dungeons
1953
1954 // the timer is started by default, and stopped when the first player joins
1955 // this make sure it gets unloaded if for some reason no player joins
1957
1958 // pussywizard:
1959 if (IsRaid())
1960 if (time_t resetTime = sInstanceSaveMgr->GetResetTimeFor(id, Difficulty(SpawnMode)))
1961 if (time_t extendedResetTime = sInstanceSaveMgr->GetExtendedResetTimeFor(id, Difficulty(SpawnMode)))
1962 _instanceResetPeriod = extendedResetTime - resetTime;
1963}
Difficulty
Definition DBCEnums.h:266
std::uint32_t uint32
Definition Define.h:107
#define sInstanceSaveMgr
Definition InstanceSaveMgr.h:233
#define MIN_UNLOAD_DELAY
Definition Map.h:95
@ CONFIG_INSTANCE_UNLOAD_DELAY
Definition WorldConfig.h:209
bool m_resetAfterUnload
Definition Map.h:751
bool m_unloadWhenEmpty
Definition Map.h:752
InstanceScript * instance_data
Definition Map.h:753
void InitVisibilityDistance() override
Definition Map.cpp:1972
uint32 i_script_id
Definition Map.h:754
Definition Map.h:168
uint32 m_unloadTimer
Definition Map.h:611
bool IsRaid() const
Definition Map.h:301
time_t _instanceResetPeriod
Definition Map.h:613
#define sWorld
Definition World.h:318

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

◆ ~InstanceMap()

InstanceMap::~InstanceMap ( )
override
1966{
1967 delete instance_data;
1968 instance_data = nullptr;
1969 sInstanceSaveMgr->DeleteInstanceSaveIfNeeded(GetInstanceId(), true);
1970}
uint32 GetInstanceId() const
Definition Map.h:270

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

Member Function Documentation

◆ AddPlayerToMap()

bool InstanceMap::AddPlayerToMap ( Player *  player)
overridevirtual

Reimplemented from Map.

2079{
2080 if (m_resetAfterUnload) // this instance has been reset, it's not meant to be used anymore
2081 return false;
2082
2083 if (IsDungeon())
2084 {
2085 Group* group = player->GetGroup();
2086
2087 // get an instance save for the map
2088 InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
2089 if (!mapSave)
2090 {
2091 LOG_ERROR("maps", "InstanceMap::Add: InstanceSave does not exist for map {} spawnmode {} with instance id {}", GetId(), GetSpawnMode(), GetInstanceId());
2092 return false;
2093 }
2094
2095 // check for existing instance binds
2096 InstancePlayerBind* playerBind = sInstanceSaveMgr->PlayerGetBoundInstance(player->GetGUID(), GetId(), Difficulty(GetSpawnMode()));
2097 if (playerBind && playerBind->perm)
2098 {
2099 if (playerBind->save != mapSave)
2100 {
2101 LOG_ERROR("maps", "InstanceMap::Add: player {} ({}) is permanently bound to instance {}, {}, {}, {} but he is being put into instance {}, {}, {}, {}",
2102 player->GetName(), player->GetGUID().ToString(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(),
2103 playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->CanReset());
2104 return false;
2105 }
2106 }
2107 else if (player->GetSession()->PlayerLoading() && playerBind && playerBind->save != mapSave)
2108 {
2109 // Prevent "Convert to Raid" exploit to reset instances
2110 return false;
2111 }
2112 else
2113 {
2114 playerBind = sInstanceSaveMgr->PlayerBindToInstance(player->GetGUID(), mapSave, false, player);
2115 // pussywizard: bind lider also if not yet bound
2116 if (Group* g = player->GetGroup())
2117 if (g->GetLeaderGUID() != player->GetGUID())
2118 if (!sInstanceSaveMgr->PlayerGetBoundInstance(g->GetLeaderGUID(), mapSave->GetMapId(), mapSave->GetDifficulty()))
2119 {
2120 sInstanceSaveMgr->PlayerCreateBoundInstancesMaps(g->GetLeaderGUID());
2121 sInstanceSaveMgr->PlayerBindToInstance(g->GetLeaderGUID(), mapSave, false, ObjectAccessor::FindConnectedPlayer(g->GetLeaderGUID()));
2122 }
2123 }
2124
2125 // increase current instances (hourly limit)
2126 // xinef: specific instances are still limited
2127 if (!group || !group->isLFGGroup() || !group->IsLfgRandomInstance())
2129
2130 if (!playerBind->perm && !mapSave->CanReset() && group && !group->isLFGGroup() && !group->IsLfgRandomInstance())
2131 {
2133 data << uint32(60000);
2135 data << uint8(0);
2136 player->SendDirectMessage(&data);
2137 player->SetPendingBind(mapSave->GetInstanceId(), 60000);
2138 }
2139 }
2140
2141 // initialize unload state
2142 m_unloadTimer = 0;
2143 m_resetAfterUnload = false;
2144 m_unloadWhenEmpty = false;
2145
2146 // this will acquire the same mutex so it cannot be in the previous block
2147 Map::AddPlayerToMap(player);
2148
2149 if (instance_data)
2151
2152 return true;
2153}
std::uint8_t uint8
Definition Define.h:109
#define LOG_ERROR(filterType__,...)
Definition Log.h:145
Definition Group.h:177
bool isLFGGroup(bool restricted=false) const
Definition Group.cpp:2484
bool IsLfgRandomInstance() const
Definition Group.h:331
Definition InstanceSaveMgr.h:57
uint32 GetInstanceId() const
Definition InstanceSaveMgr.h:62
uint32 GetMapId() const
Definition InstanceSaveMgr.h:63
Difficulty GetDifficulty() const
Definition InstanceSaveMgr.h:64
bool CanReset() const
Definition InstanceSaveMgr.h:82
uint32 GetCompletedEncounterMask() const
Definition InstanceScript.h:272
virtual void OnPlayerEnter(Player *)
Definition InstanceScript.cpp:63
bool IsDungeon() const
Definition Map.h:299
uint8 GetSpawnMode() const
Definition Map.h:271
uint32 GetId() const
Definition Map.h:234
virtual bool AddPlayerToMap(Player *)
Definition Map.cpp:258
std::string ToString() const
Definition ObjectGuid.cpp:48
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:5864
void AddInstanceEnterTime(uint32 instanceId, time_t enterTime)
Definition Player.h:2499
WorldSession * GetSession() const
Definition Player.h:2031
Group * GetGroup()
Definition Player.h:2517
void SetPendingBind(uint32 instanceId, uint32 bindTimer)
Definition Player.h:2487
std::string const & GetName() const
Definition Object.h:535
Definition WorldPacket.h:26
bool PlayerLoading() const
Definition WorldSession.h:450
@ SMSG_INSTANCE_LOCK_WARNING_QUERY
Definition Opcodes.h:357
Seconds GetGameTime()
Definition GameTime.cpp:38
Player * FindConnectedPlayer(ObjectGuid const guid)
Definition ObjectAccessor.cpp:281
Definition InstanceSaveMgr.h:40
InstanceSave * save
Definition InstanceSaveMgr.h:41
bool perm
Definition InstanceSaveMgr.h:42

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, Player::SendDirectMessage(), Player::SetPendingBind(), sInstanceSaveMgr, SMSG_INSTANCE_LOCK_WARNING_QUERY, and ObjectGuid::ToString().

◆ AfterPlayerUnlinkFromMap()

void InstanceMap::AfterPlayerUnlinkFromMap ( )
overridevirtual

Reimplemented from Map.

2179{
2180 if (!m_unloadTimer && !HavePlayers())
2183}
bool HavePlayers() const
Definition Map.h:324
virtual void AfterPlayerUnlinkFromMap()
Definition Map.cpp:740

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.

2009{
2010 if (!loginCheck && player->GetMapRef().getTarget() == this)
2011 {
2012 LOG_ERROR("maps", "InstanceMap::CanEnter - player {} ({}) already in map {}, {}, {}!",
2013 player->GetName(), player->GetGUID().ToString(), GetId(), GetInstanceId(), GetSpawnMode());
2014
2016 }
2017
2018 // allow GM's to enter
2019 if (player->IsGameMaster())
2020 return Map::CannotEnter(player, loginCheck);
2021
2022 // cannot enter if the instance is full (player cap), GMs don't count
2023 uint32 maxPlayers = GetMaxPlayers();
2024 if (GetPlayersCountExceptGMs() >= (loginCheck ? maxPlayers + 1 : maxPlayers))
2025 {
2026 LOG_DEBUG("maps", "MAP: Instance '{}' of map '{}' cannot have more than '{}' players. Player '{}' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
2029 }
2030
2031 // cannot enter while an encounter is in progress on raids
2032 bool checkProgress = (IsRaid() || GetId() == 668 /*HoR*/);
2033 if (checkProgress && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress())
2034 {
2037 }
2038
2039 // xinef: dont allow LFG Group to enter other instance that is selected
2040 if (Group* group = player->GetGroup())
2041 if (group->isLFGGroup())
2042 if (!sLFGMgr->inLfgDungeonMap(group->GetGUID(), GetId(), GetDifficulty()))
2043 {
2046 }
2047
2048 // cannot enter if instance is in use by another party/soloer that have a permanent save in the same instance id
2049 PlayerList const& playerList = GetPlayers();
2050 if (!playerList.IsEmpty())
2051 for (PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i)
2052 if (Player* iPlayer = i->GetSource())
2053 {
2054 if (iPlayer == player) // login case, player already added to map
2055 continue;
2056 if (iPlayer->IsGameMaster()) // bypass GMs
2057 continue;
2058 if (!player->GetGroup()) // player has not group and there is someone inside, deny entry
2059 {
2062 }
2063 // player inside instance has no group or his groups is different to entering player's one, deny entry
2064 if (!iPlayer->GetGroup() || iPlayer->GetGroup() != player->GetGroup())
2065 {
2068 }
2069 break;
2070 }
2071
2072 return Map::CannotEnter(player, loginCheck);
2073}
#define sLFGMgr
Definition LFGMgr.h:665
#define LOG_DEBUG(filterType__,...)
Definition Log.h:157
@ TRANSFER_ABORT_MAP_NOT_ALLOWED
Definition Player.h:785
@ TRANSFER_ABORT_MAX_PLAYERS
Definition Player.h:772
@ TRANSFER_ABORT_ZONE_IN_COMBAT
Definition Player.h:775
uint32 GetMaxPlayers() const
Definition Map.cpp:2342
InstanceScript * GetInstanceScript()
Definition Map.h:736
virtual bool IsEncounterInProgress() const
Definition InstanceScript.cpp:147
LinkedListHead::Iterator< MapReference const > const_iterator
Definition MapRefMgr.h:29
uint32 GetPlayersCountExceptGMs(bool aliveOnly=false) const
Definition Map.cpp:1874
MapRefMgr PlayerList
Definition Map.h:334
virtual EnterState CannotEnter(Player *, bool)
Definition Map.h:289
char const * GetMapName() const
Definition Map.cpp:1641
Difficulty GetDifficulty() const
Definition Map.h:294
PlayerList const & GetPlayers() const
Definition Map.h:335
@ CANNOT_ENTER_MAX_PLAYERS
Definition Map.h:284
@ CANNOT_ENTER_ZONE_IN_COMBAT
Definition Map.h:285
@ CANNOT_ENTER_ALREADY_IN_MAP
Definition Map.h:276
@ CANNOT_ENTER_UNSPECIFIED_REASON
Definition Map.h:286
@ CANNOT_ENTER_INSTANCE_BIND_MISMATCH
Definition Map.h:282
Definition Player.h:1086
bool IsGameMaster() const
Definition Player.h:1178
MapReference & GetMapRef()
Definition Player.h:2540
void SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 arg=0)
Definition Player.cpp:11952
TO * getTarget() const
Definition Reference.h:95

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 
)
2186{
2187 if (instance_data)
2188 {
2189 return;
2190 }
2191
2192 bool isOtherAI = false;
2193
2194 sScriptMgr->OnBeforeCreateInstanceScript(this, &instance_data, load, data, completedEncounterMask);
2195
2196 if (instance_data)
2197 isOtherAI = true;
2198
2199 // if ALE AI was fetched succesfully we should not call CreateInstanceData nor set the unused scriptID
2200 if (!isOtherAI)
2201 {
2202 InstanceTemplate const* mInstance = sObjectMgr->GetInstanceTemplate(GetId());
2203 if (mInstance)
2204 {
2205 i_script_id = mInstance->ScriptId;
2206 instance_data = sScriptMgr->CreateInstanceScript(this);
2207 }
2208 }
2209
2210 if (!instance_data)
2211 return;
2212
2213 // use mangos behavior if we are dealing with ALE AI
2214 // initialize should then be called only if load is false
2215 if (!isOtherAI || !load)
2216 {
2218 }
2219
2220 if (load)
2221 {
2222 instance_data->SetCompletedEncountersMask(completedEncounterMask, false);
2223 if (data != "")
2224 instance_data->Load(data.c_str());
2225 }
2226
2228}
#define sObjectMgr
Definition ObjectMgr.h:1731
#define sScriptMgr
Definition ScriptMgr.h:766
virtual void Load(char const *data)
Definition InstanceScript.cpp:469
void SetCompletedEncountersMask(uint32 newMask, bool save)
Definition InstanceScript.cpp:756
void LoadInstanceSavedGameobjectStateData()
Definition InstanceScript.cpp:806
virtual void Initialize()
Definition InstanceScript.h:152
Definition Map.h:126
uint32 ScriptId
Definition Map.h:128

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

◆ GetDebugInfo()

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

Reimplemented from Map.

3608{
3609 std::stringstream sstr;
3610 sstr << Map::GetDebugInfo() << "\n"
3611 << std::boolalpha
3612 << "ScriptId: " << GetScriptId() << " ScriptName: " << GetScriptName();
3613 return sstr.str();
3614}
uint32 GetScriptId() const
Definition Map.h:734
std::string const & GetScriptName() const
Definition Map.cpp:2275
virtual std::string GetDebugInfo() const
Definition Map.cpp:3578

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

◆ GetInstanceScript() [1/2]

◆ GetInstanceScript() [2/2]

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

References instance_data.

◆ GetMaxPlayers()

uint32 InstanceMap::GetMaxPlayers ( ) const
2343{
2344 MapDifficulty const* mapDiff = GetMapDifficulty();
2345 if (mapDiff && mapDiff->maxPlayers)
2346 return mapDiff->maxPlayers;
2347
2348 return GetEntry()->maxPlayers;
2349}
MapDifficulty const * GetMapDifficulty() const
Definition Map.cpp:2337
MapEntry const * GetEntry() const
Definition Map.h:175
Definition DBCStructure.h:2258
uint32 maxPlayers
Definition DBCStructure.h:2263
uint32 maxPlayers
Definition DBCStructure.h:1382

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

Referenced by CannotEnter(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::CheckAchievementCriteriaMeet(), and AchievementMgr::UpdateAchievementCriteria().

◆ GetMaxResetDelay()

uint32 InstanceMap::GetMaxResetDelay ( ) const
2352{
2353 MapDifficulty const* mapDiff = GetMapDifficulty();
2354 return mapDiff ? mapDiff->resetTime : 0;
2355}
uint32 resetTime
Definition DBCStructure.h:2262

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

◆ GetScriptId()

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

References i_script_id.

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

◆ GetScriptName()

std::string const & InstanceMap::GetScriptName ( ) const
2276{
2277 return sObjectMgr->GetScriptName(i_script_id);
2278}

References i_script_id, and sObjectMgr.

Referenced by GetDebugInfo().

◆ InitVisibilityDistance()

void InstanceMap::InitVisibilityDistance ( )
overridevirtual

Reimplemented from Map.

1973{
1974 //init visibility distance for instances
1976
1977 // pussywizard: this CAN NOT exceed MAX_VISIBILITY_DISTANCE
1978 switch (GetId())
1979 {
1980 case 429: // Dire Maul
1981 case 550: // The Eye
1982 case 578: // The Nexus: The Oculus
1983 m_VisibleDistance = 175.0f;
1984 break;
1985 case 649: // Trial of the Crusader
1986 case 650: // Trial of the Champion
1987 case 595: // Culling of Startholme
1988 case 658: // Pit of Saron
1989 m_VisibleDistance = 150.0f;
1990 break;
1991 case 615: // Obsidian Sanctum
1992 case 616: // Eye of Eternity
1993 case 603: // Ulduar
1994 case 668: // Halls of Reflection
1995 case 631: // Icecrown Citadel
1996 case 724: // Ruby Sanctum
1997 m_VisibleDistance = 200.0f;
1998 break;
1999 case 531: // Ahn'Qiraj Temple
2000 m_VisibleDistance = 300.0f;
2001 break;
2002 }
2003}
float m_VisibleDistance
Definition Map.h:612
static float GetMaxVisibleDistanceInInstances()
Definition World.h:214

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

Referenced by InstanceMap().

◆ PermBindAllPlayers()

void InstanceMap::PermBindAllPlayers ( )
2281{
2282 if (!IsDungeon())
2283 return;
2284
2285 InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
2286 if (!save)
2287 {
2288 LOG_ERROR("maps", "Cannot bind players because no instance save is available for instance map (Name: {}, Entry: {}, InstanceId: {})!", GetMapName(), GetId(), GetInstanceId());
2289 return;
2290 }
2291
2292 Player* player;
2293 Group* group;
2294 // group members outside the instance group don't get bound
2295 for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
2296 {
2297 player = itr->GetSource();
2298 group = player->GetGroup();
2299
2300 // players inside an instance cannot be bound to other instances
2301 // some players may already be permanently bound, in this case nothing happens
2302 InstancePlayerBind* bind = sInstanceSaveMgr->PlayerGetBoundInstance(player->GetGUID(), save->GetMapId(), save->GetDifficulty());
2303
2304 if (!bind || !bind->perm)
2305 {
2307 data << uint32(0);
2308 player->SendDirectMessage(&data);
2309 sInstanceSaveMgr->PlayerBindToInstance(player->GetGUID(), save, true, player);
2310 }
2311
2312 // Xinef: Difficulty change prevention
2313 if (group)
2315 }
2316}
@ DIFFICULTY_PREVENTION_CHANGE_BOSS_KILLED
Definition Group.h:143
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
Definition Group.cpp:2756
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
MapRefMgr m_mapRefMgr
Definition Map.h:615
@ SMSG_INSTANCE_SAVE_CREATED
Definition Opcodes.h:745

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

Referenced by npc_harrison_jones::DoAction(), boss_skeram::JustDied(), boss_sartharion_dragonAI::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::UpdateOutro().

◆ RemovePlayerFromMap()

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

Reimplemented from Map.

2165{
2166 if (instance_data)
2168 // pussywizard: moved m_unloadTimer to InstanceMap::AfterPlayerUnlinkFromMap(), in this function if 2 players run out at the same time the instance won't close
2169 //if (!m_unloadTimer && m_mapRefMgr.getSize() == 1)
2170 // m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld->getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY);
2171 Map::RemovePlayerFromMap(player, remove);
2172
2173 // If remove == true - player already deleted.
2174 if (!remove)
2175 player->SetPendingBind(0, 0);
2176}
virtual void OnPlayerLeave(Player *)
Definition InstanceScript.cpp:69
virtual void RemovePlayerFromMap(Player *, bool)
Definition Map.cpp:719

References instance_data, InstanceScript::OnPlayerLeave(), Map::RemovePlayerFromMap(), and Player::SetPendingBind().

◆ Reset()

bool InstanceMap::Reset ( uint8  method,
GuidList *  globalSkipList = nullptr 
)
2234{
2235 if (method == INSTANCE_RESET_GLOBAL)
2236 {
2237 // pussywizard: teleport out immediately
2238 for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
2239 {
2240 // teleport players that are no longer bound (can be still bound if extended id)
2241 if (!globalResetSkipList || std::find(globalResetSkipList->begin(), globalResetSkipList->end(), itr->GetSource()->GetGUID()) == globalResetSkipList->end())
2242 itr->GetSource()->RepopAtGraveyard();
2243 }
2244
2245 // reset map only if noone is bound
2246 if (!globalResetSkipList || globalResetSkipList->empty())
2247 {
2248 // pussywizard: setting both m_unloadWhenEmpty and m_unloadTimer intended, in case RepopAtGraveyard failed
2249 if (HavePlayers())
2250 m_unloadWhenEmpty = true;
2252 m_resetAfterUnload = true;
2253 }
2254
2255 return m_mapRefMgr.IsEmpty();
2256 }
2257
2258 if (HavePlayers())
2259 {
2260 if (method == INSTANCE_RESET_ALL || method == INSTANCE_RESET_CHANGE_DIFFICULTY)
2261 {
2262 for (MapRefMgr::iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
2263 itr->GetSource()->SendResetFailedNotify(GetId());
2264 }
2265 }
2266 else
2267 {
2269 m_resetAfterUnload = true;
2270 }
2271
2272 return m_mapRefMgr.IsEmpty();
2273}
@ INSTANCE_RESET_CHANGE_DIFFICULTY
Definition Map.h:717
@ INSTANCE_RESET_GLOBAL
Definition Map.h:718
@ INSTANCE_RESET_ALL
Definition Map.h:716
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
2332{
2333 for (MapRefMgr::const_iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
2334 itr->GetSource()->SendInstanceResetWarning(GetId(), itr->GetSource()->GetDifficulty(IsRaid()), timeLeft, false);
2335}

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.

2319{
2320 ASSERT(!HavePlayers());
2321
2323 {
2326 }
2327
2329}
#define ASSERT
Definition Errors.h:68
void DeleteCorpseData()
Definition Map.cpp:3569
void DeleteRespawnTimes()
Definition Map.cpp:2602
virtual void UnloadAll()
Definition Map.cpp:1074

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.

2156{
2157 Map::Update(t_diff, s_diff);
2158
2159 if (t_diff)
2160 if (instance_data)
2161 instance_data->Update(t_diff);
2162}
virtual void Update(uint32)
Definition InstanceScript.cpp:257
virtual void Update(const uint32, const uint32, bool thread=true)
Definition Map.cpp:436

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

Member Data Documentation

◆ i_script_id

uint32 InstanceMap::i_script_id
private

◆ instance_data

◆ m_resetAfterUnload

bool InstanceMap::m_resetAfterUnload
private

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

◆ m_unloadWhenEmpty

bool InstanceMap::m_unloadWhenEmpty
private

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