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

#include <InstanceSaveMgr.h>

Classes

struct  InstResetEvent
 

Public Types

typedef std::unordered_map< uint32, InstanceSave * > InstanceSaveHashMap
 
typedef std::multimap< time_t, InstResetEventResetTimeQueue
 

Public Member Functions

void Unload ()
 
void LoadInstances ()
 
void LoadResetTimes ()
 
time_t GetResetTimeFor (uint32 mapid, Difficulty d) const
 
time_t GetSubsequentResetTime (uint32 mapid, Difficulty difficulty, time_t resetTime) const
 
void InitializeResetTimeFor (uint32 mapid, Difficulty d, time_t t)
 
void SetResetTimeFor (uint32 mapid, Difficulty d, time_t t)
 
ResetTimeByMapDifficultyMap const & GetResetTimeMap () const
 
void ScheduleReset (bool add, time_t time, InstResetEvent event)
 
void ForceGlobalReset (uint32 mapId, Difficulty difficulty)
 
void Update ()
 
InstanceSaveAddInstanceSave (uint32 mapId, uint32 instanceId, Difficulty difficulty, time_t resetTime, bool canReset, bool load=false)
 
void RemoveInstanceSave (uint32 InstanceId)
 
void UnloadInstanceSave (uint32 InstanceId)
 
InstanceSaveGetInstanceSave (uint32 InstanceId)
 
uint32 GetNumInstanceSaves () const
 
uint32 GetNumBoundPlayersTotal () const
 
uint32 GetNumBoundGroupsTotal () const
 

Static Public Member Functions

static InstanceSaveManagerinstance ()
 
static void DeleteInstanceFromDB (uint32 instanceid)
 

Static Protected Attributes

static uint16 ResetTimeDelay [] = {3600, 900, 300, 60}
 

Private Member Functions

 InstanceSaveManager ()
 
 ~InstanceSaveManager ()
 
void _ResetOrWarnAll (uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime)
 
void _ResetInstance (uint32 mapid, uint32 instanceId)
 
void _ResetSave (InstanceSaveHashMap::iterator &itr)
 

Private Attributes

bool lock_instLists
 
InstanceSaveHashMap m_instanceSaveById
 
ResetTimeByMapDifficultyMap m_resetTimeByMapDifficulty
 
ResetTimeQueue m_resetTimeQueue
 

Friends

class InstanceSave
 

Detailed Description

Definition at line 149 of file InstanceSaveMgr.h.

Member Typedef Documentation

◆ InstanceSaveHashMap

Definition at line 158 of file InstanceSaveMgr.h.

◆ ResetTimeQueue

typedef std::multimap<time_t , InstResetEvent> InstanceSaveManager::ResetTimeQueue

Definition at line 178 of file InstanceSaveMgr.h.

Constructor & Destructor Documentation

◆ InstanceSaveManager()

InstanceSaveManager::InstanceSaveManager ( )
inlineprivate

Definition at line 154 of file InstanceSaveMgr.h.

◆ ~InstanceSaveManager()

InstanceSaveManager::~InstanceSaveManager ( )
private

Definition at line 39 of file InstanceSaveMgr.cpp.

Member Function Documentation

◆ _ResetInstance()

void InstanceSaveManager::_ResetInstance ( uint32  mapid,
uint32  instanceId 
)
private

Definition at line 597 of file InstanceSaveMgr.cpp.

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

◆ _ResetOrWarnAll()

void InstanceSaveManager::_ResetOrWarnAll ( uint32  mapid,
Difficulty  difficulty,
bool  warn,
time_t  resetTime 
)
private
Todo:
delete creature/gameobject respawn times even if the maps are not loaded

Definition at line 627 of file InstanceSaveMgr.cpp.

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

◆ _ResetSave()

void InstanceSaveManager::_ResetSave ( InstanceSaveHashMap::iterator &  itr)
private

Definition at line 550 of file InstanceSaveMgr.cpp.

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

◆ AddInstanceSave()

InstanceSave * InstanceSaveManager::AddInstanceSave ( uint32  mapId,
uint32  instanceId,
Difficulty  difficulty,
time_t  resetTime,
bool  canReset,
bool  load = false 
)

Definition at line 76 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

◆ DeleteInstanceFromDB()

void InstanceSaveManager::DeleteInstanceFromDB ( uint32  instanceid)
static

Definition at line 130 of file InstanceSaveMgr.cpp.

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

◆ ForceGlobalReset()

void InstanceSaveManager::ForceGlobalReset ( uint32  mapId,
Difficulty  difficulty 
)

Definition at line 505 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

◆ GetInstanceSave()

InstanceSave * InstanceSaveManager::GetInstanceSave ( uint32  InstanceId)

Definition at line 124 of file InstanceSaveMgr.cpp.

+ Here is the caller graph for this function:

◆ GetNumBoundGroupsTotal()

uint32 InstanceSaveManager::GetNumBoundGroupsTotal ( ) const

Definition at line 723 of file InstanceSaveMgr.cpp.

◆ GetNumBoundPlayersTotal()

uint32 InstanceSaveManager::GetNumBoundPlayersTotal ( ) const

Definition at line 714 of file InstanceSaveMgr.cpp.

◆ GetNumInstanceSaves()

uint32 InstanceSaveManager::GetNumInstanceSaves ( ) const
inline

Definition at line 217 of file InstanceSaveMgr.h.

◆ GetResetTimeFor()

time_t InstanceSaveManager::GetResetTimeFor ( uint32  mapid,
Difficulty  d 
) const
inline

Definition at line 183 of file InstanceSaveMgr.h.

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

◆ GetResetTimeMap()

ResetTimeByMapDifficultyMap const & InstanceSaveManager::GetResetTimeMap ( ) const
inline

Definition at line 199 of file InstanceSaveMgr.h.

◆ GetSubsequentResetTime()

time_t InstanceSaveManager::GetSubsequentResetTime ( uint32  mapid,
Difficulty  difficulty,
time_t  resetTime 
) const

Definition at line 444 of file InstanceSaveMgr.cpp.

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

◆ InitializeResetTimeFor()

void InstanceSaveManager::InitializeResetTimeFor ( uint32  mapid,
Difficulty  d,
time_t  t 
)
inline

Definition at line 191 of file InstanceSaveMgr.h.

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

◆ instance()

InstanceSaveManager * InstanceSaveManager::instance ( )
static

Definition at line 43 of file InstanceSaveMgr.cpp.

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

◆ LoadInstances()

void InstanceSaveManager::LoadInstances ( )

Definition at line 266 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

◆ LoadResetTimes()

void InstanceSaveManager::LoadResetTimes ( )

Definition at line 300 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

◆ RemoveInstanceSave()

void InstanceSaveManager::RemoveInstanceSave ( uint32  InstanceId)

Definition at line 150 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

◆ ScheduleReset()

void InstanceSaveManager::ScheduleReset ( bool  add,
time_t  time,
InstResetEvent  event 
)

Definition at line 468 of file InstanceSaveMgr.cpp.

+ Here is the caller graph for this function:

◆ SetResetTimeFor()

void InstanceSaveManager::SetResetTimeFor ( uint32  mapid,
Difficulty  d,
time_t  t 
)

Definition at line 461 of file InstanceSaveMgr.cpp.

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

◆ Unload()

void InstanceSaveManager::Unload ( )

Definition at line 49 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

◆ UnloadInstanceSave()

void InstanceSaveManager::UnloadInstanceSave ( uint32  InstanceId)

Definition at line 171 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

◆ Update()

void InstanceSaveManager::Update ( )

Definition at line 516 of file InstanceSaveMgr.cpp.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ InstanceSave

friend class InstanceSave
friend

Definition at line 151 of file InstanceSaveMgr.h.

Member Data Documentation

◆ lock_instLists

bool InstanceSaveManager::lock_instLists
private

Definition at line 229 of file InstanceSaveMgr.h.

◆ m_instanceSaveById

InstanceSaveHashMap InstanceSaveManager::m_instanceSaveById
private

Definition at line 231 of file InstanceSaveMgr.h.

◆ m_resetTimeByMapDifficulty

ResetTimeByMapDifficultyMap InstanceSaveManager::m_resetTimeByMapDifficulty
private

Definition at line 233 of file InstanceSaveMgr.h.

◆ m_resetTimeQueue

ResetTimeQueue InstanceSaveManager::m_resetTimeQueue
private

Definition at line 234 of file InstanceSaveMgr.h.

◆ ResetTimeDelay

uint16 InstanceSaveManager::ResetTimeDelay = {3600, 900, 300, 60}
staticprotected

Definition at line 37 of file InstanceSaveMgr.h.


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