CPersistence

Persistence manager

Type: Reference type

Methods

Declaration Description
bool Exists(const string& in szName) const Returns whether the given persistence instance exists.
bool IsValidHandle(const PersistID_t ID) const Returns whether the given persistence instance handle is valid.
bool ShouldKeep() const Returns whether the previous map's persistence instances will be kept.
void SetKeep(bool fValue) Sets whether the previous map's persistence instances will be kept.
bool KeepIfPrevious(const array<string>@ pArray) Will make the persistence manager keep the previous map's persistence instancesif the previous map's name matches any of the elements in the array.
bool KeepIfPrevious(const string& in szMapName) Will make the persistence manager keep the previous map's persistence instancesif the previous map's name matches the given map name.
PersistID_t RegisterInstance(const string& in szName) Returns a persistence instance tied to the given name. Will be created if it does not already exist.
const string& GetPreviousMapName() const Returns the name of the previous map. Can be empty if the server has just started.
const string& GetCurrentMapName() const Returns the name of the current map.
void ClearInstance(const string& in szName) Clears the specified persistence instance.
void ClearInstance(const PersistID_t ID) Clears the specified persistence instance.
void Clear() Clears all persistence instances.
Make sure to avoid calling handles referencing the cleared instances.
const string& GetName(const PersistID_t ID) const Returns the name of this instance.
size_t Size(int iId) const Returns the number of persisted items in this instance.
bool Exists(const PersistID_t ID, const string& in szKey) Returns whether the given key exists in this instance.
const string& GetString(const PersistID_t ID, const string& in szKey) Returns the given value as a string, or if it does not exist.
bool GetBoolean(const PersistID_t ID, const string& in szKey) Returns the given value as a boolean, or false if it does not exist.
int32 GetLong(const PersistID_t ID, const string& in szKey, int iRadix = 10) Returns the given value as a long, or 0 if it does not exist.
uint32 GetUlong(const PersistID_t ID, const string& in szKey, int iRadix = 10) Returns the given value as a unsigned long, or 0 if it does not exist.
float GetFloat(const PersistID_t ID, const string& in szKey) Returns the given value as a float, or 0.0 if it does not exist.
void Set(const PersistID_t ID, const string& in szKey, const string& in szValue) Sets the given value as a string.
void Set(const PersistID_t ID, const string& in szKey, bool fValue) Sets the given value as a boolean.
void Set(const PersistID_t ID, const string& in szKey, int32 iValue) Sets the given value as a string.
void Set(const PersistID_t ID, const string& in szKey, uint32 uiValue) Sets the given value as a string.
void Set(const PersistID_t ID, const string& in szKey, float flValue) Sets the given value as a string.
void Clear(const PersistID_t ID, const string& in szKey) Clears the given value.
void Clear(const PersistID_t ID) Clears all values.

Properties

Declaration Description
const PersistID_t INVALID_ID Id used by invalid persistence objects.