mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[10414] Constantify some functions in InstanceSave.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
1ccf1ccd86
commit
6d5559544b
3 changed files with 14 additions and 14 deletions
|
|
@ -86,7 +86,7 @@ void InstanceSave::SaveToDB()
|
|||
CharacterDatabase.PExecute("INSERT INTO instance VALUES ('%u', '%u', '"UI64FMTD"', '%u', '%s')", m_instanceid, GetMapId(), (uint64)GetResetTimeForDB(), GetDifficulty(), data.c_str());
|
||||
}
|
||||
|
||||
time_t InstanceSave::GetResetTimeForDB()
|
||||
time_t InstanceSave::GetResetTimeForDB() const
|
||||
{
|
||||
// only save the reset time for normal instances
|
||||
const MapEntry *entry = sMapStore.LookupEntry(GetMapId());
|
||||
|
|
@ -97,12 +97,12 @@ time_t InstanceSave::GetResetTimeForDB()
|
|||
}
|
||||
|
||||
// to cache or not to cache, that is the question
|
||||
InstanceTemplate const* InstanceSave::GetTemplate()
|
||||
InstanceTemplate const* InstanceSave::GetTemplate() const
|
||||
{
|
||||
return ObjectMgr::GetInstanceTemplate(m_mapid);
|
||||
}
|
||||
|
||||
MapEntry const* InstanceSave::GetMapEntry()
|
||||
MapEntry const* InstanceSave::GetMapEntry() const
|
||||
{
|
||||
return sMapStore.LookupEntry(m_mapid);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,14 +54,14 @@ class InstanceSave
|
|||
or when the instance is reset */
|
||||
~InstanceSave();
|
||||
|
||||
uint8 GetPlayerCount() { return m_playerList.size(); }
|
||||
uint8 GetGroupCount() { return m_groupList.size(); }
|
||||
uint8 GetPlayerCount() const { return m_playerList.size(); }
|
||||
uint8 GetGroupCount() const { return m_groupList.size(); }
|
||||
|
||||
/* A map corresponding to the InstanceId/MapId does not always exist.
|
||||
InstanceSave objects may be created on player logon but the maps are
|
||||
created and loaded only when a player actually enters the instance. */
|
||||
uint32 GetInstanceId() { return m_instanceid; }
|
||||
uint32 GetMapId() { return m_mapid; }
|
||||
uint32 GetInstanceId() const { return m_instanceid; }
|
||||
uint32 GetMapId() const { return m_mapid; }
|
||||
|
||||
/* Saved when the instance is generated for the first time */
|
||||
void SaveToDB();
|
||||
|
|
@ -70,12 +70,12 @@ class InstanceSave
|
|||
|
||||
/* for normal instances this corresponds to max(creature respawn time) + X hours
|
||||
for raid/heroic instances this caches the global respawn time for the map */
|
||||
time_t GetResetTime() { return m_resetTime; }
|
||||
time_t GetResetTime() const { return m_resetTime; }
|
||||
void SetResetTime(time_t resetTime) { m_resetTime = resetTime; }
|
||||
time_t GetResetTimeForDB();
|
||||
time_t GetResetTimeForDB() const;
|
||||
|
||||
InstanceTemplate const* GetTemplate();
|
||||
MapEntry const* GetMapEntry();
|
||||
InstanceTemplate const* GetTemplate() const;
|
||||
MapEntry const* GetMapEntry() const;
|
||||
|
||||
/* online players bound to the instance (perm/solo)
|
||||
does not include the members of the group unless they have permanent saves */
|
||||
|
|
@ -88,12 +88,12 @@ class InstanceSave
|
|||
/* instances cannot be reset (except at the global reset time)
|
||||
if there are players permanently bound to it
|
||||
this is cached for the case when those players are offline */
|
||||
bool CanReset() { return m_canReset; }
|
||||
bool CanReset() const { return m_canReset; }
|
||||
void SetCanReset(bool canReset) { m_canReset = canReset; }
|
||||
|
||||
/* currently it is possible to omit this information from this structure
|
||||
but that would depend on a lot of things that can easily change in future */
|
||||
Difficulty GetDifficulty() { return m_difficulty; }
|
||||
Difficulty GetDifficulty() const { return m_difficulty; }
|
||||
|
||||
void SetUsedByMapState(bool state)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10413"
|
||||
#define REVISION_NR "10414"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue