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

#include <InstanceSaveMgr.h>

Public Types

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

Public Member Functions

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

Private Member Functions

bool UnloadIfEmpty ()
 
void SetToDelete (bool toDelete)
 

Private Attributes

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

Friends

class InstanceSaveManager
 

Detailed Description

Definition at line 43 of file InstanceSaveMgr.h.

Member Typedef Documentation

◆ GroupListType

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

Definition at line 123 of file InstanceSaveMgr.h.

◆ PlayerListType

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

Definition at line 122 of file InstanceSaveMgr.h.

Constructor & Destructor Documentation

◆ InstanceSave()

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

Definition at line 181 of file InstanceSaveMgr.cpp.

◆ ~InstanceSave()

InstanceSave::~InstanceSave ( )

Definition at line 185 of file InstanceSaveMgr.cpp.

References ASSERT, m_groupList, and m_playerList.

Member Function Documentation

◆ AddGroup()

void InstanceSave::AddGroup ( Group *  group)
inline

Definition at line 102 of file InstanceSaveMgr.h.

Referenced by Group::BindToInstance().

◆ AddPlayer()

void InstanceSave::AddPlayer ( Player *  player)
inline

Definition at line 82 of file InstanceSaveMgr.h.

Referenced by Player::BindToInstance().

◆ CanReset()

◆ DeleteFromDB()

void InstanceSave::DeleteFromDB ( )

◆ GetDifficultyID()

◆ GetGroupCount()

uint8 InstanceSave::GetGroupCount ( ) const
inline

Definition at line 58 of file InstanceSaveMgr.h.

Referenced by InstanceMap::AddPlayerToMap().

◆ GetInstanceId()

◆ GetMapEntry()

MapEntry const * InstanceSave::GetMapEntry ( )

Definition at line 237 of file InstanceSaveMgr.cpp.

References m_mapid, and sMapStore.

◆ GetMapId()

◆ GetPlayerCount()

uint8 InstanceSave::GetPlayerCount ( ) const
inline

Definition at line 57 of file InstanceSaveMgr.h.

Referenced by InstanceMap::AddPlayerToMap().

◆ GetResetTime()

◆ GetResetTimeForDB()

time_t InstanceSave::GetResetTimeForDB ( )

◆ GetTemplate()

InstanceTemplate const * InstanceSave::GetTemplate ( )

Definition at line 232 of file InstanceSaveMgr.cpp.

References m_mapid, and sObjectMgr.

◆ RemoveGroup()

bool InstanceSave::RemoveGroup ( Group *  group)
inline

Definition at line 103 of file InstanceSaveMgr.h.

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

◆ RemovePlayer()

bool InstanceSave::RemovePlayer ( Player *  player)
inline

Definition at line 88 of file InstanceSaveMgr.h.

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

◆ SaveToDB()

◆ SetCanReset()

void InstanceSave::SetCanReset ( bool  canReset)
inline

Definition at line 116 of file InstanceSaveMgr.h.

Referenced by Player::BindToInstance().

◆ SetResetTime()

void InstanceSave::SetResetTime ( time_t  resetTime)
inline

Definition at line 74 of file InstanceSaveMgr.h.

◆ SetToDelete()

void InstanceSave::SetToDelete ( bool  toDelete)
inlineprivate

Definition at line 127 of file InstanceSaveMgr.h.

◆ UnloadIfEmpty()

bool InstanceSave::UnloadIfEmpty ( )
private

Friends And Related Symbol Documentation

◆ InstanceSaveManager

friend class InstanceSaveManager
friend

Definition at line 45 of file InstanceSaveMgr.h.

Member Data Documentation

◆ _playerListLock

std::mutex InstanceSave::_playerListLock
private

Definition at line 144 of file InstanceSaveMgr.h.

◆ m_canReset

bool InstanceSave::m_canReset
private

Definition at line 141 of file InstanceSaveMgr.h.

◆ m_difficulty

Difficulty InstanceSave::m_difficulty
private

Definition at line 140 of file InstanceSaveMgr.h.

◆ m_groupList

GroupListType InstanceSave::m_groupList
private

Definition at line 136 of file InstanceSaveMgr.h.

Referenced by InstanceSaveManager::Unload(), UnloadIfEmpty(), and ~InstanceSave().

◆ m_instanceid

uint32 InstanceSave::m_instanceid
private

Definition at line 138 of file InstanceSaveMgr.h.

Referenced by SaveToDB().

◆ m_mapid

uint32 InstanceSave::m_mapid
private

Definition at line 139 of file InstanceSaveMgr.h.

Referenced by GetMapEntry(), and GetTemplate().

◆ 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 135 of file InstanceSaveMgr.h.

Referenced by InstanceSaveManager::Unload(), UnloadIfEmpty(), and ~InstanceSave().

◆ m_resetTime

time_t InstanceSave::m_resetTime
private

Definition at line 137 of file InstanceSaveMgr.h.

◆ m_toDelete

bool InstanceSave::m_toDelete
private

Definition at line 142 of file InstanceSaveMgr.h.


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