Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
InstanceSave Class Reference

#include <InstanceSaveMgr.h>

Public Types

typedef std::list< Group * > GroupListType
typedef std::list< Player * > PlayerListType

Public Member Functions

void AddGroup (Group *group)
void AddPlayer (Player *player)
bool CanReset () const
void DeleteFromDB ()
DifficultyID GetDifficulty () const
uint8 GetGroupCount () const
uint32 GetInstanceId () const
MapEntry const * GetMapEntry ()
uint32 GetMapId () const
uint8 GetPlayerCount () const
time_t GetResetTime () const
time_t GetResetTimeForDB ()
InstanceTemplate const * GetTemplate ()
 InstanceSave (uint16 MapId, uint32 InstanceId, DifficultyID difficulty, time_t resetTime, bool canReset)
bool RemoveGroup (Group *group)
bool RemovePlayer (Player *player)
void SaveToDB ()
void SetCanReset (bool canReset)
void SetResetTime (time_t resetTime)
void SetToDelete (bool toDelete)
 ~InstanceSave ()

Private Member Functions

bool UnloadIfEmpty ()

Private Attributes

std::mutex _lock
bool m_canReset
DifficultyID m_difficulty
GroupListType m_groupList
uint32 m_instanceid
uint32 m_mapid
PlayerListType m_playerList
time_t m_resetTime
bool m_toDelete

Friends

class InstanceSaveManager

Detailed Description

Definition at line 31 of file InstanceSaveMgr.h.

Member Typedef Documentation

◆ GroupListType

typedef std::list<Group*> InstanceSave::GroupListType

Definition at line 112 of file InstanceSaveMgr.h.

◆ PlayerListType

typedef std::list<Player*> InstanceSave::PlayerListType

Definition at line 111 of file InstanceSaveMgr.h.

Constructor & Destructor Documentation

◆ InstanceSave()

InstanceSave::InstanceSave ( uint16 MapId,
uint32 InstanceId,
DifficultyID difficulty,
time_t resetTime,
bool canReset )

Definition at line 151 of file InstanceSaveMgr.cpp.

References m_canReset, m_difficulty, m_instanceid, m_mapid, m_resetTime, and m_toDelete.

◆ ~InstanceSave()

InstanceSave::~InstanceSave ( )

Definition at line 155 of file InstanceSaveMgr.cpp.

References ASSERT, m_groupList, and m_playerList.

Member Function Documentation

◆ AddGroup()

void InstanceSave::AddGroup ( Group * group)
inline

Definition at line 85 of file InstanceSaveMgr.h.

References m_groupList.

Referenced by Group::BindToInstance().

◆ AddPlayer()

void InstanceSave::AddPlayer ( Player * player)
inline

Definition at line 70 of file InstanceSaveMgr.h.

References _lock, and m_playerList.

Referenced by Player::BindToInstance().

◆ CanReset()

◆ DeleteFromDB()

void InstanceSave::DeleteFromDB ( )

◆ GetDifficulty()

◆ GetGroupCount()

uint8 InstanceSave::GetGroupCount ( ) const
inline

Definition at line 46 of file InstanceSaveMgr.h.

References m_groupList.

Referenced by InstanceMap::AddPlayerToMap().

◆ GetInstanceId()

◆ GetMapEntry()

MapEntry const * InstanceSave::GetMapEntry ( )

Definition at line 207 of file InstanceSaveMgr.cpp.

References m_mapid, and sMapStore.

◆ GetMapId()

◆ GetPlayerCount()

uint8 InstanceSave::GetPlayerCount ( ) const
inline

Definition at line 45 of file InstanceSaveMgr.h.

References m_playerList.

Referenced by InstanceMap::AddPlayerToMap().

◆ GetResetTime()

◆ GetResetTimeForDB()

time_t InstanceSave::GetResetTimeForDB ( )

◆ GetTemplate()

InstanceTemplate const * InstanceSave::GetTemplate ( )

Definition at line 202 of file InstanceSaveMgr.cpp.

References m_mapid, and sObjectMgr.

◆ RemoveGroup()

bool InstanceSave::RemoveGroup ( Group * group)
inline

Definition at line 86 of file InstanceSaveMgr.h.

References m_groupList, m_toDelete, and UnloadIfEmpty().

Referenced by Group::BindToInstance(), and Group::ResetInstances().

◆ RemovePlayer()

bool InstanceSave::RemovePlayer ( Player * player)
inline

Definition at line 71 of file InstanceSaveMgr.h.

References _lock, m_playerList, m_toDelete, and UnloadIfEmpty().

Referenced by Player::BindToInstance(), and Player::ResetInstances().

◆ SaveToDB()

◆ SetCanReset()

void InstanceSave::SetCanReset ( bool canReset)
inline

Definition at line 99 of file InstanceSaveMgr.h.

References m_canReset.

Referenced by Player::BindToInstance().

◆ SetResetTime()

void InstanceSave::SetResetTime ( time_t resetTime)
inline

Definition at line 62 of file InstanceSaveMgr.h.

References m_resetTime.

◆ SetToDelete()

void InstanceSave::SetToDelete ( bool toDelete)
inline

Definition at line 106 of file InstanceSaveMgr.h.

References m_toDelete.

◆ UnloadIfEmpty()

bool InstanceSave::UnloadIfEmpty ( )
private

Definition at line 218 of file InstanceSaveMgr.cpp.

References GetInstanceId(), m_groupList, m_playerList, and sInstanceSaveMgr.

Referenced by RemoveGroup(), and RemovePlayer().

◆ InstanceSaveManager

friend class InstanceSaveManager
friend

Definition at line 33 of file InstanceSaveMgr.h.

References InstanceSaveManager.

Referenced by InstanceSaveManager.

Member Data Documentation

◆ _lock

std::mutex InstanceSave::_lock
private

Definition at line 127 of file InstanceSaveMgr.h.

Referenced by AddPlayer(), and RemovePlayer().

◆ m_canReset

bool InstanceSave::m_canReset
private

Definition at line 124 of file InstanceSaveMgr.h.

Referenced by CanReset(), InstanceSave(), and SetCanReset().

◆ m_difficulty

DifficultyID InstanceSave::m_difficulty
private

Definition at line 123 of file InstanceSaveMgr.h.

Referenced by GetDifficulty(), and InstanceSave().

◆ m_groupList

GroupListType InstanceSave::m_groupList
private

◆ m_instanceid

uint32 InstanceSave::m_instanceid
private

Definition at line 121 of file InstanceSaveMgr.h.

Referenced by GetInstanceId(), InstanceSave(), and SaveToDB().

◆ m_mapid

uint32 InstanceSave::m_mapid
private

Definition at line 122 of file InstanceSaveMgr.h.

Referenced by GetMapEntry(), GetMapId(), GetTemplate(), and InstanceSave().

◆ m_playerList

PlayerListType InstanceSave::m_playerList
private
Todo
: Check if maybe it's enough to just store the number of players/groups

Definition at line 118 of file InstanceSaveMgr.h.

Referenced by AddPlayer(), GetPlayerCount(), RemovePlayer(), UnloadIfEmpty(), ~InstanceSave(), and InstanceSaveManager::~InstanceSaveManager().

◆ m_resetTime

time_t InstanceSave::m_resetTime
private

Definition at line 120 of file InstanceSaveMgr.h.

Referenced by GetResetTime(), InstanceSave(), and SetResetTime().

◆ m_toDelete

bool InstanceSave::m_toDelete
private

Definition at line 125 of file InstanceSaveMgr.h.

Referenced by InstanceSave(), RemoveGroup(), RemovePlayer(), and SetToDelete().


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