46 (*i).second->InitVisibilityDistance();
60 if (i->second->CanUnload(t))
70 if (
sMapMgr->GetMapUpdater()->activated())
71 sMapMgr->GetMapUpdater()->schedule_update(*i->second, t);
82 i->second->DelayedUpdate(diff);
100 i->second->UnloadAll();
118 if (
GetId() != mapId || !player)
132 map =
sMapMgr->FindMap(mapId, newInstanceId);
154 if (!pBind || !pBind->
perm)
159 if (!map && pSave && pSave->
GetInstanceId() == loginInstanceId)
174 pSave = groupBind->
save;
191 newInstanceId =
sMapMgr->GenerateInstanceId();
208 std::lock_guard<std::mutex> lock(
_mapLock);
220 TC_LOG_ERROR(
"maps",
"CreateInstance: no instance template for map {}",
GetId());
227 TC_LOG_DEBUG(
"maps",
"MapInstanced::CreateInstance: {} map instance {} for {} created with difficulty {}", save ?
"" :
"new ", InstanceId,
GetId(),
static_cast<uint32>(difficulty));
235 bool load_data = save !=
nullptr;
252 std::lock_guard<std::mutex> lock(
_mapLock);
254 TC_LOG_DEBUG(
"maps",
"MapInstanced::CreateBattleground: map bg {} for {} created.", InstanceId,
GetId());
282 if (itr->second->HavePlayers())
288 itr->second->UnloadAll();
302 if (itr->second->IsBattlegroundOrArena())
303 sMapMgr->FreeInstanceId(itr->second->GetInstanceId());
@ DUNGEON_DIFFICULTY_NORMAL
MapDifficulty const * GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty)
PvPDifficultyEntry const * GetBattlegroundBracketByLevel(uint32 mapid, uint32 level)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
#define MAX_NUMBER_OF_GRIDS
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
void RemoveAllPlayers() override
void SetBG(Battleground *bg)
uint32 GetMinLevel() const
void SetBgMap(BattlegroundMap *map)
Difficulty GetDifficulty(bool isRaid) const
InstanceGroupBind * GetBoundInstance(Player *player)
void CreateInstanceData(bool load)
uint32 GetInstanceId() const
Difficulty GetDifficulty() const
static MMapManager * createOrGetMMapManager()
bool unloadMap(uint32 mapId, int32 x, int32 y)
void DelayedUpdate(uint32 diff) override
virtual void InitVisibilityDistance() override
void Update(uint32 diff) override
Map * CreateInstanceForPlayer(uint32 mapId, Player *player, uint32 loginInstanceId=0)
InstancedMaps m_InstancedMaps
Map * FindInstanceMap(uint32 instanceId) const
EnterState CannotEnter(Player *) override
void UnloadAll() override
uint16 GridMapReference[MAX_NUMBER_OF_GRIDS][MAX_NUMBER_OF_GRIDS]
MapInstanced(uint32 id, time_t expiry)
InstanceMap * CreateInstance(uint32 InstanceId, InstanceSave *save, Difficulty difficulty, TeamId InstanceTeam)
bool DestroyInstance(InstancedMaps::iterator &itr)
BattlegroundMap * CreateBattleground(uint32 InstanceId, Battleground *bg)
bool IsBattlegroundOrArena() const
void SetWeakPtr(Trinity::unique_weak_ptr< Map > weakRef)
virtual void DelayedUpdate(uint32 diff)
virtual void Update(uint32)
time_t GetGridExpiry(void) const
Difficulty GetDifficulty(bool isRaid) const
void UnbindInstance(uint32 mapid, Difficulty difficulty, bool unload=false)
bool TeleportToBGEntryPoint()
Battleground * GetBattleground() const
uint32 GetBattlegroundId() const
InstancePlayerBind * GetBoundInstance(uint32 mapid, Difficulty difficulty, bool withExpired=false)
Specialized variant of std::shared_ptr that enforces unique ownership and/or std::unique_ptr with std...
static VMapManager2 * createOrGetVMapManager()
void unloadMap(unsigned int mapId, int x, int y) override
@ CONFIG_INSTANCEMAP_LOAD_GRIDS