|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
#include <InstanceSaveMgr.h>
Classes | |
| struct | InstResetEvent |
Public Types | |
| typedef UNORDERED_MAP< uint32, InstanceSave * > | InstanceSaveHashMap |
| typedef std::multimap< time_t, InstResetEvent > | ResetTimeQueue |
Public Member Functions | |
| InstanceSave * | AddInstanceSave (uint32 mapId, uint32 instanceId, DifficultyID difficulty, time_t resetTime, bool canReset, bool load=false) |
| InstanceSave * | GetInstanceSave (uint32 InstanceId) |
| uint32 | GetNumBoundGroupsTotal () |
| uint32 | GetNumBoundPlayersTotal () |
| uint32 | GetNumInstanceSaves () |
| time_t | GetResetTimeFor (uint32 mapid, DifficultyID d) const |
| ResetTimeByMapDifficultyMap const & | GetResetTimeMap () const |
| void | LoadInstances () |
| void | LoadResetTimes () |
| void | RemoveInstanceSave (uint32 InstanceId) |
| void | ScheduleReset (bool add, time_t time, InstResetEvent event) |
| void | SetResetTimeFor (uint32 mapid, DifficultyID d, time_t t) |
| void | Update () |
Static Public Member Functions | |
| static void | DeleteInstanceFromDB (uint32 instanceid) |
Static Protected Attributes | |
| static uint16 | ResetTimeDelay [] = { 3600, 900, 300, 60 } |
Private Member Functions | |
| void | _ResetInstance (uint32 mapid, uint32 instanceId) |
| void | _ResetOrWarnAll (uint32 mapid, DifficultyID difficulty, bool warn, time_t resetTime) |
| void | _ResetSave (InstanceSaveHashMap::iterator &itr) |
| InstanceSaveManager () | |
| ~InstanceSaveManager () | |
Private Attributes | |
| bool | lock_instLists |
| InstanceSaveHashMap | m_instanceSaveById |
| ResetTimeByMapDifficultyMap | m_resetTimeByMapDifficulty |
| ResetTimeQueue | m_resetTimeQueue |
Friends | |
| class | InstanceSave |
| class | Skyfire::Singleton< InstanceSaveManager, Skyfire::Mutex > |
Definition at line 132 of file InstanceSaveMgr.h.
Definition at line 142 of file InstanceSaveMgr.h.
| typedef std::multimap<time_t , InstResetEvent> InstanceSaveManager::ResetTimeQueue |
Definition at line 158 of file InstanceSaveMgr.h.
|
inlineprivate |
Definition at line 138 of file InstanceSaveMgr.h.
References InstanceSaveManager(), and lock_instLists.
Referenced by InstanceSaveManager().
|
private |
Definition at line 27 of file InstanceSaveMgr.cpp.
References InstanceSave::GetDifficulty(), InstanceSave::GetMapId(), InstanceSave, lock_instLists, InstanceSave::m_groupList, m_instanceSaveById, and InstanceSave::m_playerList.
Definition at line 512 of file InstanceSaveMgr.cpp.
References _ResetSave(), DeleteInstanceFromDB(), Map::DeleteRespawnTimes(), Map::DeleteRespawnTimesInDB(), INSTANCE_RESET_RESPAWN_DELAY, Map::Instanceable(), Map::IsInstance(), m_instanceSaveById, SF_LOG_DEBUG, and sMapMgr.
Referenced by Update().
|
private |
Definition at line 539 of file InstanceSaveMgr.cpp.
References _ResetSave(), CHAR_DEL_CHAR_INSTANCE_BY_MAP_DIFF, CHAR_DEL_GROUP_INSTANCE_BY_MAP_DIFF, CHAR_DEL_INSTANCE_BY_MAP_DIFF, CHAR_UPD_GLOBAL_INSTANCE_RESETTIME, CharacterDatabase, CONFIG_INSTANCE_RESET_TIME_HOUR, DAY, GetMapDifficultyData(), HOUR, INSTANCE_RESET_GLOBAL, MapEntry::Instanceable(), Map::IsInstance(), m_instanceSaveById, MINUTE, RATE_INSTANCE_RESET_TIME, MapDifficulty::resetTime, ScheduleReset(), SetResetTimeFor(), PreparedStatement::setUInt16(), PreparedStatement::setUInt32(), PreparedStatement::setUInt8(), SF_LOG_ERROR, sMapMgr, sMapStore, and sWorld.
Referenced by Update().
|
private |
Definition at line 486 of file InstanceSaveMgr.cpp.
References lock_instLists, m_instanceSaveById, Group::UnbindInstance(), and Player::UnbindInstance().
Referenced by _ResetInstance(), and _ResetOrWarnAll().
| InstanceSave * InstanceSaveManager::AddInstanceSave | ( | uint32 | mapId, |
| uint32 | instanceId, | ||
| DifficultyID | difficulty, | ||
| time_t | resetTime, | ||
| bool | canReset, | ||
| bool | load = false ) |
Definition at line 56 of file InstanceSaveMgr.cpp.
References DIFFICULTY_NORMAL, GetInstanceSave(), GetResetTimeFor(), HOUR, InstanceSave, m_instanceSaveById, MAP_RAID, MapEntry::map_type, InstanceSave::SaveToDB(), ScheduleReset(), SF_LOG_DEBUG, SF_LOG_ERROR, and sMapStore.
|
static |
Definition at line 110 of file InstanceSaveMgr.cpp.
References CHAR_DEL_CHAR_INSTANCE_BY_INSTANCE, CHAR_DEL_GROUP_INSTANCE_BY_INSTANCE, CHAR_DEL_INSTANCE_BY_INSTANCE, CharacterDatabase, and PreparedStatement::setUInt32().
Referenced by _ResetInstance(), and InstanceSave::DeleteFromDB().
| InstanceSave * InstanceSaveManager::GetInstanceSave | ( | uint32 | InstanceId | ) |
Definition at line 104 of file InstanceSaveMgr.cpp.
References InstanceSave, and m_instanceSaveById.
Referenced by AddInstanceSave().
| uint32 InstanceSaveManager::GetNumBoundGroupsTotal | ( | ) |
Definition at line 645 of file InstanceSaveMgr.cpp.
References m_instanceSaveById.
| uint32 InstanceSaveManager::GetNumBoundPlayersTotal | ( | ) |
Definition at line 636 of file InstanceSaveMgr.cpp.
References m_instanceSaveById.
|
inline |
Definition at line 190 of file InstanceSaveMgr.h.
References m_instanceSaveById.
|
inline |
Definition at line 163 of file InstanceSaveMgr.h.
References m_resetTimeByMapDifficulty, and MAKE_PAIR32().
Referenced by AddInstanceSave(), LoadResetTimes(), and Update().
|
inline |
Definition at line 174 of file InstanceSaveMgr.h.
References m_resetTimeByMapDifficulty.
| void InstanceSaveManager::LoadInstances | ( | ) |
Definition at line 231 of file InstanceSaveMgr.cpp.
References CharacterDatabase, getMSTime(), GetMSTimeDiffToNow(), SF_LOG_INFO, sInstanceSaveMgr, and sMapMgr.
| void InstanceSaveManager::LoadResetTimes | ( | ) |
Definition at line 265 of file InstanceSaveMgr.cpp.
References CHAR_SEL_MAX_CREATURE_RESPAWNS, CharacterDatabase, CONFIG_INSTANCE_RESET_TIME_HOUR, DAY, GetMapDifficultyData(), GetResetTimeFor(), Field::GetUInt16(), Field::GetUInt32(), Field::GetUInt8(), HOUR, MAKE_PAIR32(), PAIR32_HIPART(), PAIR32_LOPART(), RATE_INSTANCE_RESET_TIME, MapDifficulty::resetTime, ResetTimeDelay, ScheduleReset(), SetResetTimeFor(), SF_LOG_ERROR, sMapDifficultyMap, sMapMgr, sWorld, and UI64FMTD.
| void InstanceSaveManager::RemoveInstanceSave | ( | uint32 | InstanceId | ) |
Definition at line 130 of file InstanceSaveMgr.cpp.
References CHAR_UPD_INSTANCE_RESETTIME, CharacterDatabase, m_instanceSaveById, and PreparedStatement::setUInt32().
| void InstanceSaveManager::ScheduleReset | ( | bool | add, |
| time_t | time, | ||
| InstResetEvent | event ) |
Definition at line 415 of file InstanceSaveMgr.cpp.
References InstanceSaveManager::InstResetEvent::instanceId, m_resetTimeQueue, InstanceSaveManager::InstResetEvent::mapid, SF_LOG_ERROR, and InstanceSaveManager::InstResetEvent::type.
Referenced by _ResetOrWarnAll(), AddInstanceSave(), LoadResetTimes(), and Update().
|
inline |
Definition at line 169 of file InstanceSaveMgr.h.
References m_resetTimeByMapDifficulty, and MAKE_PAIR32().
Referenced by _ResetOrWarnAll(), and LoadResetTimes().
| void InstanceSaveManager::Update | ( | ) |
Definition at line 452 of file InstanceSaveMgr.cpp.
References _ResetInstance(), _ResetOrWarnAll(), GetResetTimeFor(), m_resetTimeQueue, ResetTimeDelay, and ScheduleReset().
|
friend |
Definition at line 135 of file InstanceSaveMgr.h.
References InstanceSave.
Referenced by AddInstanceSave(), GetInstanceSave(), InstanceSave, and ~InstanceSaveManager().
|
friend |
Definition at line 127 of file InstanceSaveMgr.h.
|
private |
Definition at line 202 of file InstanceSaveMgr.h.
Referenced by _ResetSave(), InstanceSaveManager(), and ~InstanceSaveManager().
|
private |
Definition at line 204 of file InstanceSaveMgr.h.
Referenced by _ResetInstance(), _ResetOrWarnAll(), _ResetSave(), AddInstanceSave(), GetInstanceSave(), GetNumBoundGroupsTotal(), GetNumBoundPlayersTotal(), GetNumInstanceSaves(), RemoveInstanceSave(), and ~InstanceSaveManager().
|
private |
Definition at line 206 of file InstanceSaveMgr.h.
Referenced by GetResetTimeFor(), GetResetTimeMap(), and SetResetTimeFor().
|
private |
Definition at line 207 of file InstanceSaveMgr.h.
Referenced by ScheduleReset(), and Update().
|
staticprotected |
Definition at line 25 of file InstanceSaveMgr.h.
Referenced by LoadResetTimes(), and Update().