Table of Contents
ci_g_debug
Cerea 2 Debug functions. Normally used by including ci_g_basic in the script. sub includes for basic add this directly.
Debug functions
These are meant to help debugging.
C_DebugState
(Debug function)
Sets debugging on and off depending on iDebug for the whole module. Debug levels range from CI_D_FATAL (0 = only fatal errors) to CI_D_NICETOKNOW (20 = All debug messages)
void C_DebugState(int iDebug);
C_PrintDebug
(Debug function)
Send debug output when debugging is enabled. Use instead of SendMessageToPC funtions. iDebugLevel gives minimum debuglevel to print the text. Use the CI_D_* constants from the ci_g_constants.
void C_PrintDebug(int iDebugLevel, object oPC, string sDebug);
C_DebugStatePlayer
(Debug function)
Sets the debugging level for the player to iDebug. This can only be used to raise the debugging level from the module global, i.e. if the module global is higher than this then for example all DMs still get messages regardless of this setting.
void C_DebugStatePlayer(object oPC, int iDebug);
Display functions
these are to display information
C_SendMessagetoRadius
(Displayfunction)
Send the message with text to everyone in given radius near the object
void C_SendMessagetoRadius(string sMessage, object oNearMe = OBJECT_SELF, float fRadius = RADIUS_SIZE_GARGANTUAN);
C_SendMessagetoArea
(Displayfunction)
Send the message with text to everyone in a given area
void C_SendMessagetoArea(string sMessage, object oArea);
C_SendMessagetoPC
(Displayfunction)
Send the message with text to one PC
void C_SendMessagetoPC(string sMessage, object oPC);
C_SendMessagetoParty
(Displayfunction)
Send the message with text to everyone in a given party
void C_SendMessagetoParty(string sMessage, object oMember);
CI_D_* constants
CI_D_FATAL
int = 0
Fatal error, not recoverable, should not happen, after this we better shutdown server… (Example: Database write failed, and database is now corrupted)
CI_D_CRITICAL
int = 2
Critical error, affects the whole module (Example: some mandatory resource is missing)
CI_D_CHAR_CRITICAL
int = 3
Character critical error, affects the whole char (Example: some mandatory items from char is missing, i.e. soulstone, moneypouch)
CI_D_CHEAT
int = 4
Cheating attempt detected (or error in the code) (Example: some object is changed in the middle of the operation where user should not have possibility to change it)
CI_D_ERROR
int = 6
Normal error case, some variable missing which should be there etc, affects only one one area or creature (Example: Creature is missing treasure or exp variable etc).
CI_D_WARNING
int = 10
User did something funny, something that shouldn't be done, but which should not be considered cheating (Example: User tries to use device on item where it should not be used (I.e. tries to write with pen to the armor or similar)).
CI_D_UNCOMMON
int = 8
Something uncommon happened, this can happen normally, but should be quite rare. (Example: Killing dragonlord in cerea1 or killing the old one in cerea2, should not happen that often).
CI_D_START
int = 14
Operation was started, usually once per user action (Example: User starts using the forge to enchant item)
CI_D_SUCCESS
int = 12
Operation was successfull, and finished now, usually once per user action (Example: User finishes enchanting item and the operation was successfull).
CI_D_FAILURE
int = 11
Operation was failure, and finished now, usually once per user action (Example: User finishes enchanting item and the operation was failure (because of the skill check failed etc)).
CI_D_NICETOKNOW
int = 20
Information that might be useful for debugging.
CI_D_LOWSTART
int = 18
Lower level operation started (Example: Some library function which can be called from several different places, and perhaps even several times was called, for example C_TakeMoney)
CI_D_LOWSUCCESS
int = 16
Lower level operation finished successfully (Example: The library function returned success back, C_TakeMoney returns after taking the money).
CI_D_LOWFAILURE
int = 15
Lower level operation failed and is now finished (Example: The library function returned failure back, C_HasMoney returns telling that user didn't have enough money, if the C_TakeMoney detects user does not have enough money, then it should probably use CHEAT level, as either this is cheating attempt or bug in the code which allows cheating).