Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
errorhandlermodule.c File Reference

Go to the source code of this file.

Data Structures

class  ErrorHandlerModule
 Definition and API of an ErrorHandlerModule - Do not insert any logic here! (as this class is not moddable). More...

Functions

void ~ErrorHandlerModuleScript ()
void ErrorHandlerModuleScript ()
 Constructor, by default calls the function that will fill the ErrorDataMap.
void FillErrorDataMap ()
 Function to fill up m_ErrorDataMap, gets called in the Constructor.
override string GetClientMessage (int errorCode, string additionalInfo="")
 Fetches the Client message for the error code.
override string GetLastClientMessage (int errorCode)
 Fetches the Client message for the error code, attempting to retrieve the data from the latest.
override string GetLastServerMessage (int errorCode)
 Fetches the Server message for the error code, attempting to retrieve the data from the latest.
ErrorProperties GetProperties (int errorCode)
 Fetches the ErrorProperties for the error code.
override string GetServerMessage (int errorCode, string additionalInfo="")
 Fetches the Server message for the error code.
void InitOptionalVariables ()
 Function which gets called before FillErrorDataMap, designed to set Optional Variales before ErrorProperties are created.
void InsertDialogueErrorProperties (int code, string message, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling, using the Optional Variables.
void InsertErrorProperties (int code, string message="")
 Insert an error with no handling.
void InsertExtendedPrefixDialogueErrorProperties (int code, string message, string prefix, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with extended prefix.
void InsertExtendedPrefixSplitDialogueErrorProperties (int code, string message, string prefix, string serverMessage, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with extended prefix and separate server message.
void InsertHeaderDialogueErrorProperties (int code, string message, string header, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with custom header.
void InsertPrefixDialogueErrorProperties (int code, string message, string prefix, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with custom prefix.
void InsertSplitDialogueErrorProperties (int code, string message, string serverMessage, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
 Insert an error with Dialogue as handling with separate server message.
override void OnErrorThrown (int errorCode, owned string additionalInfo="")
 Event that gets triggered when an error of the owned category is thrown.

Variables

ref map< int, ref ErrorPropertiesm_ErrorDataMap = new map<int, ref ErrorProperties>()
 Map containing the codes that exist for the ErrorHandlerModule The code links to ErrorProperties This contains at the very least the Message for the error Additionally, it can contain the way to handle the error (e.g.
class ErrorHandlerModule m_Header = ""
 This is where to input logic and extend functionality of ErrorHandlerModule.
string m_LastAdditionalInfo = ""
 Holds the last additional info passed in.
int m_LastErrorThrown = 0
 Holds the last thrown error in this module, defaults to 0.
string m_Prefix = ""
 Optional: Prefix (e.g.
ref UIScriptedMenu m_UIHandler = null
 Optional: The UI the handler might generally use

Function Documentation

◆ ~ErrorHandlerModuleScript()

void ~ErrorHandlerModuleScript ( )
protected

Definition at line 87 of file errorhandlermodule.c.

References m_UIHandler.

◆ ErrorHandlerModuleScript()

void ErrorHandlerModuleScript ( )
protected

Constructor, by default calls the function that will fill the ErrorDataMap.

Definition at line 81 of file errorhandlermodule.c.

References FillErrorDataMap(), and InitOptionalVariables().

◆ FillErrorDataMap()

void FillErrorDataMap ( )
protected

Function to fill up m_ErrorDataMap, gets called in the Constructor.

Already insert the default "UNKNOWN ERROR" message for code "-1"

Definition at line 101 of file errorhandlermodule.c.

References InsertDialogueErrorProperties().

◆ GetClientMessage()

override string GetClientMessage ( int errorCode,
string additionalInfo = "" )
protected

Fetches the Client message for the error code.

Parameters
errorCodeint The full error code
Returns
string The Client message for the error

Definition at line 130 of file errorhandlermodule.c.

References ErrorProperties::GetClientMessage(), and GetProperties().

Referenced by GetLastClientMessage().

◆ GetLastClientMessage()

override string GetLastClientMessage ( int errorCode)
protected

Fetches the Client message for the error code, attempting to retrieve the data from the latest.

Parameters
errorCodeint The full error code to check against
Returns
string The Client message for the error

Definition at line 149 of file errorhandlermodule.c.

References ErrorEx, GetClientMessage(), ErrorModuleHandler::GetErrorHex(), m_LastAdditionalInfo, and m_LastErrorThrown.

◆ GetLastServerMessage()

override string GetLastServerMessage ( int errorCode)
protected

Fetches the Server message for the error code, attempting to retrieve the data from the latest.

Parameters
errorCodeint The full error code to check against
Returns
string The Server message for the error

Definition at line 186 of file errorhandlermodule.c.

References ErrorEx, ErrorModuleHandler::GetErrorHex(), GetServerMessage(), m_LastAdditionalInfo, and m_LastErrorThrown.

◆ GetProperties()

ErrorProperties GetProperties ( int errorCode)
protected

Fetches the ErrorProperties for the error code.

Parameters
errorCodeint The full error code
Returns
ErrorProperties The data and handling for the error

Definition at line 112 of file errorhandlermodule.c.

References Error(), ErrorModuleHandler::GetCodeFromError(), ErrorModuleHandler::GetErrorHex(), and m_ErrorDataMap.

Referenced by GetClientMessage(), GetServerMessage(), and OnErrorThrown().

◆ GetServerMessage()

override string GetServerMessage ( int errorCode,
string additionalInfo = "" )
protected

Fetches the Server message for the error code.

Parameters
errorCodeint The full error code
Returns
string The Server message for the error

Definition at line 167 of file errorhandlermodule.c.

References GetProperties(), and ErrorProperties::GetServerMessage().

Referenced by GetLastServerMessage().

◆ InitOptionalVariables()

void InitOptionalVariables ( )
protected

Function which gets called before FillErrorDataMap, designed to set Optional Variales before ErrorProperties are created.

Definition at line 96 of file errorhandlermodule.c.

◆ InsertDialogueErrorProperties()

void InsertDialogueErrorProperties ( int code,
string message,
int dialogButtonType = DBT_OK,
int defaultButton = DBB_OK,
int dialogMeaningType = DMT_EXCLAMATION,
bool displayAdditionalInfo = true )
protected

◆ InsertErrorProperties()

void InsertErrorProperties ( int code,
string message = "" )
protected

◆ InsertExtendedPrefixDialogueErrorProperties()

void InsertExtendedPrefixDialogueErrorProperties ( int code,
string message,
string prefix,
int dialogButtonType = DBT_OK,
int defaultButton = DBB_OK,
int dialogMeaningType = DMT_EXCLAMATION,
bool displayAdditionalInfo = true )
protected

Insert an error with Dialogue as handling with extended prefix.

Definition at line 251 of file errorhandlermodule.c.

References DialogueErrorProperties(), m_ErrorDataMap, m_Header, m_Prefix, and m_UIHandler.

Referenced by ClientKickedModule::FillErrorDataMap().

◆ InsertExtendedPrefixSplitDialogueErrorProperties()

void InsertExtendedPrefixSplitDialogueErrorProperties ( int code,
string message,
string prefix,
string serverMessage,
int dialogButtonType = DBT_OK,
int defaultButton = DBB_OK,
int dialogMeaningType = DMT_EXCLAMATION,
bool displayAdditionalInfo = true )
protected

Insert an error with Dialogue as handling with extended prefix and separate server message.

Definition at line 257 of file errorhandlermodule.c.

References DialogueErrorProperties(), m_ErrorDataMap, m_Header, m_Prefix, and m_UIHandler.

Referenced by ClientKickedModule::FillErrorDataMap().

◆ InsertHeaderDialogueErrorProperties()

void InsertHeaderDialogueErrorProperties ( int code,
string message,
string header,
int dialogButtonType = DBT_OK,
int defaultButton = DBB_OK,
int dialogMeaningType = DMT_EXCLAMATION,
bool displayAdditionalInfo = true )
protected

Insert an error with Dialogue as handling with custom header.

Definition at line 239 of file errorhandlermodule.c.

References DialogueErrorProperties(), m_ErrorDataMap, m_Prefix, and m_UIHandler.

◆ InsertPrefixDialogueErrorProperties()

void InsertPrefixDialogueErrorProperties ( int code,
string message,
string prefix,
int dialogButtonType = DBT_OK,
int defaultButton = DBB_OK,
int dialogMeaningType = DMT_EXCLAMATION,
bool displayAdditionalInfo = true )
protected

Insert an error with Dialogue as handling with custom prefix.

Definition at line 245 of file errorhandlermodule.c.

References DialogueErrorProperties(), m_ErrorDataMap, m_Header, and m_UIHandler.

Referenced by ClientKickedModule::FillErrorDataMap().

◆ InsertSplitDialogueErrorProperties()

void InsertSplitDialogueErrorProperties ( int code,
string message,
string serverMessage,
int dialogButtonType = DBT_OK,
int defaultButton = DBB_OK,
int dialogMeaningType = DMT_EXCLAMATION,
bool displayAdditionalInfo = true )
protected

Insert an error with Dialogue as handling with separate server message.

Definition at line 263 of file errorhandlermodule.c.

References DialogueErrorProperties(), m_ErrorDataMap, m_Header, m_Prefix, and m_UIHandler.

Referenced by ClientKickedModule::FillErrorDataMap().

◆ OnErrorThrown()

override void OnErrorThrown ( int errorCode,
owned string additionalInfo = "" )
protected

Event that gets triggered when an error of the owned category is thrown.

Do not call directly! Call ErrorModuleHandler.ThrowError instead

Parameters
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data

Definition at line 206 of file errorhandlermodule.c.

References ErrorEx, GetCategory(), ErrorModuleHandler::GetErrorHex(), GetProperties(), ErrorProperties::HandleError(), m_ErrorDataMap, m_LastAdditionalInfo, m_LastErrorThrown, and ToString().

Variable Documentation

◆ m_ErrorDataMap

ref map<int, ref ErrorProperties> m_ErrorDataMap = new map<int, ref ErrorProperties>()
protected

Map containing the codes that exist for the ErrorHandlerModule The code links to ErrorProperties This contains at the very least the Message for the error Additionally, it can contain the way to handle the error (e.g.

Throw a Dialogue with the message)

Definition at line 78 of file errorhandlermodule.c.

Referenced by GetProperties(), InsertDialogueErrorProperties(), InsertErrorProperties(), InsertExtendedPrefixDialogueErrorProperties(), InsertExtendedPrefixSplitDialogueErrorProperties(), InsertHeaderDialogueErrorProperties(), InsertPrefixDialogueErrorProperties(), InsertSplitDialogueErrorProperties(), and OnErrorThrown().

◆ m_Header

◆ m_LastAdditionalInfo

string m_LastAdditionalInfo = ""
protected

Holds the last additional info passed in.

Definition at line 70 of file errorhandlermodule.c.

Referenced by GetLastClientMessage(), GetLastServerMessage(), and OnErrorThrown().

◆ m_LastErrorThrown

int m_LastErrorThrown = 0
protected

Holds the last thrown error in this module, defaults to 0.

Definition at line 69 of file errorhandlermodule.c.

Referenced by GetLastClientMessage(), GetLastServerMessage(), OnErrorThrown(), ConnectErrorClientModule::OnEvent(), ConnectErrorServerModule::OnEvent(), and OnEvent().

◆ m_Prefix

◆ m_UIHandler