User Tools

Site Tools


cerea2:build:ci_g_persist

Persistent storage functions

The PC functions store info about a particular PC with no guarantee that that data is available when PC is offline

The Persistent functions store non PC specific data to a database

Used by including ci_g_basic that also includes this file.

bCache flag to all of the commands specify whether caching is allowed when getting or setting the value. If caching is allowed when getting data, then the data might be gotten directly from the memory cache in the memory, skipping the actual fetching from the database. If caching is not allowed, then the get routines will always fetch the data from the database. This must be used for things that might be edited outside the module, i.e. if there is a web-form or similar which can be used to modify the contents of the database, then all reads from that must be done with bCache set to FALSE.

When storing data to database with bCache set to TRUE means, that the system can postpone the actual storing of the data for later, but instead only set the data in memory. Later (and before the module is shut down) this kind of dirty data is written to database. In case the system crashes before this write has happend then some of the data might be lost. If bCache is set for FALSE when storing data then data is immediately written out to the database.

Note, that in all cases the storing data will also make sure that the cached data in memory is consistent, i.e. if data was cached earlier because of it was read in with *Get* function, then that cached copy is updated. Also if *Get* function is called with bCache set to FALSE, and they read the new data from the database, they will also update the in memory copy of the cache data in case it is already there (but they will not put it there if it wasn't there before).

C_GetPC*

C_GetPCFloat

(PC function)

Gets persistent float with name sVarName from the PC oPC. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

float C_GetPCFloat(object oPC,
		   string sVarName,
		   string sCategory = "basic",
		   int bCache = TRUE);

C_GetPCInt

(PC function)

Gets persistent integer with name sVarName from the PC oPC If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

int C_GetPCInt(object oPC,
	       string sVarName,
	       string sCategory = "basic",
	       int bCache = TRUE);

C_GetPCLocation

(PC function)

Gets persistent location with name sVarName from the PC oPC If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

location C_GetPCLocation(object oPC,
			 string sVarName,
			 string sCategory = "basic",
			 int bCache = TRUE);

C_GetPCString

(PC function)

Gets persistent string with name sVarName from the PC oPC If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

string C_GetPCString(object oPC,
		     string sVarName,
		     string sCategory = "basic",
		     int bCache = TRUE);

C_SetPC*

C_SetPCFloat

(PC function)

Sets persistent float with name sVarName on the PC oPC to value fValue, If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_SetPCFloat(object oPC,
		  string sVarName,
		  float fValue,
		  string sCategory = "basic",
	          int bCache = TRUE);

C_SetPCInt

(PC function)

Sets persistent integer with name sVarName on the PC oPC to value iValue. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_SetPCInt(object oPC,
	        string sVarName,
		int iValue,
		string sCategory = "basic",
		int bCache = TRUE);

C_SetPCLocation

(PC function)

Sets persistent location with name sVarName on the PC oPC to value lValue. Note: stores the area tag and location within area, so that the area and location should stay even if module is changed. In case area is resized or things are moved around the location might still move around if area is modified. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_SetPCLocation(object oPC,
		     string sVarName,
		     location lValue,
		     string sCategory = "basic",
		     int bCache = TRUE);

C_SetPCString

(PC function)

Sets persistent string with name sVarName on the PC oPC to value iValue. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_SetPCString(object oPC,
		   string sVarName,
		   string sValue,
		   string sCategory = "basic",
		   int bCache = TRUE);

C_DeletePC*

C_DeletePCFloat

(PC function)

Delete persistent float with name sVarName from the PC oPC. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePCFloat(object oPC, string sVarName, 
		     string sCategory = "basic", int bCache = TRUE);

C_DeletePCInt

(PC function)

Delete persistent int with name sVarName from the PC oPC. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePCInt(object oPC, 
                   string sVarName, 
		   string sCategory = "basic", 
                   int bCache = TRUE);

C_DeletePCLocation

(PC function)

Delete persistent location with name sVarName from the PC oPC. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePCLocation(object oPC, 
                        string sVarName, 
			string sCategory = "basic", 
                        int bCache = TRUE);

C_DeletePCString

(PC function)

Delete persistent string with name sVarName from the PC oPC. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePCString(object oPC, string sVarName, 
		      string sCategory = "basic", 
                      int bCache = TRUE);

C_GetPersist*

C_GetPersistFloat

(Persistent function)

Gets persistent float with name sVarName from the global storage. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

float C_GetPersistFloat(string sVarName,
			string sCategory = "basic",
			int bCache = TRUE);

C_GetPersistInt

(Persistent function)

Gets persistent integer with name sVarName from the global storage. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

int C_GetPersistInt(string sVarName,
		    string sCategory = "basic",
		    int bCache = TRUE);

C_GetPersistLocation

(Persistent function)

Gets persistent location with name sVarName from the global storage. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

location C_GetPersistLocation(string sVarName,
			      string sCategory = "basic",
			      int bCache = TRUE);

C_GetPersistString

(Persistent function)

Gets persistent string with name sVarName from the global storage. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

string C_GetPersistString(string sVarName,
			  string sCategory = "basic",
			  int bCache = TRUE);

C_SetPersist*

C_SetPersistFloat

(Persistent function)

Sets persistent float with name sVarName to value fValue in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_SetPersistFloat(string sVarName,
		       float fValue,
		       string sCategory = "basic",
		       int bCache = TRUE);

C_SetPersistInt

(Persistent function)

Sets persistent integer with name sVarName to value iValue in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_SetPersistInt(string sVarName,
		     int iValue,
		     string sCategory = "basic",
		     int bCache = TRUE);

C_SetPersistLocation

(Persistent function)

Sets persistent location with name sVarName to value lValue in the global storage. Note: stores the area tag and location within area, so that the area and location should stay even if module is changed. In case area is resized or things are moved around the location might still move around if area is modified. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_SetPersistLocation(string sVarName,
			  location lValue,
			  string sCategory = "basic",
			  int bCache = TRUE);

C_SetPersistString

(Persistent function)

Sets persistent string with name sVarName to value sValue in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_SetPersistString(string sVarName,
			string sValue,
			string sCategory = "basic",
			int bCache = TRUE);

C_DeletePersist*

C_DeletePersistFloat

(Persistent function)

Delete persistent float with name sVarName in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePersistFloat(string sVarName,
			  string sCategory = "basic",
			  int bCache = TRUE);

C_DeletePersistInt

(Persistent function)

Delete persistent integer with name sVarName in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePersistInt(string sVarName, 
			string sCategory = "basic",
			int bCache = TRUE);

C_DeletePersistLocation

(Persistent function)

Delete persistent location with name sVarName in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePersistLocation(string sVarName, 
			     string sCategory = "basic",
			     int bCache = TRUE);

C_DeletePersistString

(Persistent function)

Delete persistent string with name sVarName in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePersistString(string sVarName, 
			   string sCategory = "basic",
			   int bCache = TRUE);

C_*PersistObject

C_StorePersistObject

(Persistent function)

Stores the persistent object oObject with name sVarname in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_StorePersistObject(string sVarName,
			  object oObject,
			  string sCategory = "basic",
			  int bCache = TRUE);

C_RetrievePersistObject

(Persistent function)

Retrives the persistent object with name sVarname to the given location. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

object C_RetrievePersistObject(string sVarName,
			       location locLocation,
			       string sCategory = "basic",
			       int bCache = TRUE);

C_RetrievePersistObjectToCreature

(Persistent function)

Retrieves the persistent object with variable name sVarname to the inventory of given owner. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

object C_RetrievePersistObjectToCreature(string sVarName,
					 object oOwner,
					 string sCategory="basic",
					 int bCache = TRUE);

C_DeletePersistObject

(Persistent function)

Delete the persistent object oObject with name sVarname in the global storage. If bCache is TRUE then the storing data can be postponed (cached) and done later. If it is FALSE then storing must be immediate.

void C_DeletePersistObject(string sVarName, 
			   string sCategory = "basic",
			   int bCache = TRUE);

C_*PCArray*

C_GetPCArrayNext

(Array PC function)

If sIndex is empty, then returns first index from the array sCategory. If sIndex is not empty then returns next index coming after that. This can be used to loop through the varibles in the array. When all items are processed this will return empty string. Each sIndex can store a number of named variables, and those can be retrieved by using C_Get*Array* functions. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

string C_GetPCArrayNext(object oPC,
			string sCategory,
			string sIndex,
			int bCache = TRUE);

C_GetPCArrayCount

(Array PC function)

Get number of indexes in the Array. If array is empty returns 0.

int C_GetPCArrayCount(object oPC,
		      string sCategory,
		      int bCache = TRUE);

C_DeletePCArrayIndex

(Array PC function)

Deletes the sIndex from the Array. Note, that you must first remove all variables stored to the sIndex entity by C_Delete*Array* functions, before calling this function.

void C_DeletePCArrayIndex(object oPC,
			  string sCategory,
			  string sIndex,
			  int bCache = TRUE);

C_GetPCArray*

C_GetPCArrayFloat

(Array PC function)

Returns value of the sVarName variable from the entity sIndex. If only one string is stored to entity, then sVarName can be empty.

float C_GetPCArrayFloat(object oPC,
			string sCategory,
			string sIndex,
			string sVarName = "",
			int bCache = TRUE);

C_GetPCArrayInt

(Array PC function)

Returns value of the sVarName variable from the entity sIndex. If only one string is stored to entity, then sVarName can be empty.

int C_GetPCArrayString(object oPC,
		       string sCategory,
		       string sIndex,
		       string sVarName = "",
		       int bCache = TRUE);

C_GetPCArrayLocation

(Array PC function)

Returns value of the sVarName variable from the entity sIndex. If only one string is stored to entity, then sVarName can be empty.

location C_GetPCArrayString(object oPC,
			    string sCategory,
			    string sIndex,
			    string sVarName = "",
			    int bCache = TRUE);

C_GetPCArrayString

(Array PC function)

Returns value of the sVarName variable from the entity sIndex. If only one string is stored to entity, then sVarName can be empty.

string C_GetPCArrayString(object oPC,
			  string sCategory,
			  string sIndex,
			  string sVarName = "",
			  int bCache = TRUE);

C_SetPCArray*

C_SetPCArrayFloat

(Array PC function)

Stores value of the sValue to sVarName variable of the sIndex entity of the array. If only one string is stored to entity, then sVarName can be empty. Returns TRUE if sIndex already existed, and FALSE if it also created new entity for sIndex while storing data.

int C_SetPCArrayFloat(object oPC,
		      string sCategory,
		      string sIndex,
		      float fValue,
		      string sVarName = "",
		      int bCache = TRUE);

C_SetPCArrayInt

(Array PC function)

Stores value of the sValue to sVarName variable of the sIndex entity of the array. If only one string is stored to entity, then sVarName can be empty. Returns TRUE if sIndex already existed, and FALSE if it also created new entity for sIndex while storing data.

int C_SetPCArrayInt(object oPC,
		    string sCategory,
		    string sIndex,
		    int nValue,
		    string sVarName = "",
		    int bCache = TRUE);

C_SetPCArrayLocation

(Array PC function)

Stores value of the sValue to sVarName variable of the sIndex entity of the array. If only one string is stored to entity, then sVarName can be empty. Returns TRUE if sIndex already existed, and FALSE if it also created new entity for sIndex while storing data.

int C_SetPCArrayLocation(object oPC,
		         string sCategory,
		         string sIndex,
		         location lValue,
		         string sVarName = "",
		         int bCache = TRUE);

C_SetPCArrayString

(Array PC function)

Stores value of the sValue to sVarName variable of the sIndex entity of the array. If only one string is stored to entity, then sVarName can be empty. Returns TRUE if sIndex already existed, and FALSE if it also created new entity for sIndex while storing data.

int C_SetPCArrayString(object oPC,
		       string sCategory,
		       string sIndex,
		       string sValue,
		       string sVarName = "",
		       int bCache = TRUE);

C_DeletePCArray*

C_DeletePCArrayFloat

(Array PC function)

Removes string sVarName from the sIndex entity. This does not remove the sIndex itself, but before sIndex is removed, all variables stored on it must be removed.

void C_DeletePCArrayFloat(object oPC,
			  string sCategory,
			  string sIndex,
			  string sVarName = "",
			  int bCache = TRUE);

C_DeletePCArrayInt

(Array PC function)

Removes string sVarName from the sIndex entity. This does not remove the sIndex itself, but before sIndex is removed, all variables stored on it must be removed.

void C_DeletePCArrayInt(object oPC,
			string sCategory,
			string sIndex,
			string sVarName = "",
			int bCache = TRUE);

C_DeletePCArrayLocation

(Array PC function)

Removes string sVarName from the sIndex entity. This does not remove the sIndex itself, but before sIndex is removed, all variables stored on it must be removed.

void C_DeletePCArrayLocation(object oPC,
			     string sCategory,
			     string sIndex,
			     string sVarName = "",
			     int bCache = TRUE);

C_DeletePCArrayString

(Array PC function)

Removes string sVarName from the sIndex entity. This does not remove the sIndex itself, but before sIndex is removed, all variables stored on it must be removed.

void C_DeletePCArrayString(object oPC,
			   string sCategory,
			   string sIndex,
			   string sVarName = "",
			   int bCache = TRUE);

C_*PersistArray*

C_GetPersistArrayNext

(Array Persistent function)

If sIndex is empty, then returns first index from the array sCategory. If sIndex is not empty then returns next index coming after that. This can be used to loop through the varibles in the array. When all items are processed this will return empty string. Each sIndex can store a number of named variables, and those can be retrieved by using C_Get*Array* functions. If bCache is set to TRUE then data from memory cache can also be used, (and stored there). If bCache is FALSE then this will always read data from persistent storage.

string C_GetPersistArrayNext(string sCategory,
			     string sIndex,
			     int bCache = TRUE);

C_DeletePersistArrayIndex

(Array Persistent function)

Get number of indexes in the Array. If array is empty returns 0. int C_GetPersistArrayCount(string sCategory,

		   int bCache = TRUE)

*Array Persistent function: Deletes the sIndex from the Array. Note, that you must first remove all variables stored to the sIndex entity by C_Delete*Array* functions, before calling this function.

void C_DeletePersistArrayIndex(string sCategory,
			       string sIndex,
			       int bCache = TRUE);

C_GetPersistArray*

C_GetPersistArrayFloat

(Array Persistent function)

Returns value of the sVarName variable from the entity sIndex. If only one string is stored to entity, then sVarName can be empty.

float C_GetPersistArrayFloat(string sCategory,
			     string sIndex,
			     string sVarName = "",
			     int bCache = TRUE);

C_GetPersistArrayInt

(Array Persistent function)

Returns value of the sVarName variable from the entity sIndex. If only one string is stored to entity, then sVarName can be empty.

int C_GetPersistArrayInt(string sCategory,
			 string sIndex,
			 string sVarName = "",
			 int bCache = TRUE);

C_GetPersistArrayLocation

(Array Persistent function)

Returns value of the sVarName variable from the entity sIndex. If only one string is stored to entity, then sVarName can be empty.

location C_GetPersistArrayLocation(string sCategory,
				   string sIndex,
				   string sVarName = "",
				   int bCache = TRUE);

C_GetPersistArrayString

(Array Persistent function)

Returns value of the sVarName variable from the entity sIndex. If only one string is stored to entity, then sVarName can be empty.

string C_GetPersistArrayString(string sCategory,
			       string sIndex,
			       string sVarName = "",
			       int bCache = TRUE);

C_SetPersistArray*

C_SetPersistArrayFloat

(Array Persistent function)

Stores value of the sValue to sVarName variable of the sIndex entity of the array. If only one string is stored to entity, then sVarName can be empty. Returns TRUE if sIndex already existed, and FALSE if it also created new entity for sIndex while storing data.

int C_SetPersistArrayFloat(string sCategory,
			   string sIndex,
			   float fValue,
			   string sVarName = "",
			   int bCache = TRUE);

C_SetPersistArrayInt

(Array Persistent function)

Stores value of the sValue to sVarName variable of the sIndex entity of the array. If only one string is stored to entity, then sVarName can be empty. Returns TRUE if sIndex already existed, and FALSE if it also created new entity for sIndex while storing data.

int C_SetPersistArrayInt(string sCategory,
			 string sIndex,
			 int nValue,
			 string sVarName = "",
			 int bCache = TRUE);

C_SetPersistArrayLocation

(Array Persistent function)

Stores value of the sValue to sVarName variable of the sIndex entity of the array. If only one string is stored to entity, then sVarName can be empty. Returns TRUE if sIndex already existed, and FALSE if it also created new entity for sIndex while storing data.

int C_SetPersistArrayLocation(string sCategory,
			      string sIndex,
			      location lValue,
			      string sVarName = "",
			      int bCache = TRUE);

C_SetPersistArrayString

(Array Persistent function)

Stores value of the sValue to sVarName variable of the sIndex entity of the array. If only one string is stored to entity, then sVarName can be empty. Returns TRUE if sIndex already existed, and FALSE if it also created new entity for sIndex while storing data.

int C_SetPersistArrayString(string sCategory,
			    string sIndex,
			    string sValue,
			    string sVarName = "",
			    int bCache = TRUE);

C_DeletePersistArray*

C_DeletePersistArrayFloat

(Array Persistent function)

Removes sVarName from the sIndex entity. This does not remove the sIndex itself, but before sIndex is removed, all variables stored on it must be removed.

void C_DeletePersistArrayFloat(string sCategory,
			       string sIndex,
			       string sVarName = "",
			       int bCache = TRUE);

C_DeletePersistArrayInt

(Array Persistent function)

Removes sVarName from the sIndex entity. This does not remove the sIndex itself, but before sIndex is removed, all variables stored on it must be removed.

void C_DeletePersistArrayInt(string sCategory,
			     string sIndex,
			     string sVarName = "",
			     int bCache = TRUE);

C_DeletePersistArrayLocation

(Array Persistent function)

Removes sVarName from the sIndex entity. This does not remove the sIndex itself, but before sIndex is removed, all variables stored on it must be removed.

void C_DeletePersistArrayLocation(string sCategory,
				  string sIndex,
				  string sVarName = "",
				  int bCache = TRUE);

C_DeletePersistArrayString

(Array Persistent function)

Removes sVarName from the sIndex entity. This does not remove the sIndex itself, but before sIndex is removed, all variables stored on it must be removed.

void C_DeletePersistArrayString(string sCategory,
				string sIndex,
				string sVarName = "",
				int bCache = TRUE);
cerea2/build/ci_g_persist.txt · Last modified: 2015/05/03 12:32 by 127.0.0.1