DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл ErrorHandlerModule.c

См. исходные тексты.

Структуры данных

class  ErrorHandlerModule
 Definition and API of an ErrorHandlerModule - Do not insert any logic here! (as this class is not moddable) Подробнее...
 

Функции

void ErrorHandlerModuleScript ()
 Constructor, by default calls the function that will fill the ErrorDataMap.
 
void ~ErrorHandlerModuleScript ()
 
void InitOptionalVariables ()
 Function which gets called before FillErrorDataMap, designed to set Optional Variales before ErrorProperties are created.
 
void FillErrorDataMap ()
 Function to fill up m_ErrorDataMap, gets called in the Constructor.
 
ErrorProperties GetProperties (int errorCode)
 Fetches the ErrorProperties for the error code.
 
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 GetServerMessage (int errorCode, string additionalInfo="")
 Fetches the Server message for the error code.
 
override string GetLastServerMessage (int errorCode)
 Fetches the Server message for the error code, attempting to retrieve the data from the latest.
 
override void OnErrorThrown (int errorCode, owned string additionalInfo="")
 Event that gets triggered when an error of the owned category is thrown. Do not call directly! Call ErrorModuleHandler.ThrowError instead.
 
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 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 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 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.
 
void InsertErrorProperties (int code, string message="")
 Insert an error with no handling.
 

Переменные

class ErrorHandlerModule m_Header = ""
 This is where to input logic and extend functionality of ErrorHandlerModule.
 
string m_Prefix = ""
 Optional: Prefix (e.g. Fixed text at the start of the messages in the module)
 
ref UIScriptedMenu m_UIHandler = null
 Optional: The UI the handler might generally use
 
int m_LastErrorThrown = 0
 Holds the last thrown error in this module, defaults to 0.
 
string m_LastAdditionalInfo = ""
 Holds the last additional info passed in.
 
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. Throw a Dialogue with the message)
 

Функции

◆ ErrorHandlerModuleScript()

void ErrorHandlerModuleScript ( )
protected

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

82 {
85 }
void FillErrorDataMap()
Function to fill up m_ErrorDataMap, gets called in the Constructor.
Definition ErrorHandlerModule.c:101
void InitOptionalVariables()
Function which gets called before FillErrorDataMap, designed to set Optional Variales before ErrorPro...
Definition ErrorHandlerModule.c:96

Перекрестные ссылки FillErrorDataMap() и 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"

102 {
104 InsertDialogueErrorProperties(-1, "#server_browser_error_unknown");
105 }
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.
Definition ErrorHandlerModule.c:233

Перекрестные ссылки InsertDialogueErrorProperties().

◆ GetClientMessage()

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

Fetches the Client message for the error code.

Аргументы
errorCodeint The full error code
Возвращает
string The Client message for the error
131 {
133
134 if ( properties )
135 {
136 return properties.GetClientMessage(additionalInfo);
137 }
138 else
139 {
140 return additionalInfo;
141 }
142 }
ErrorProperties GetProperties(int errorCode)
Fetches the ErrorProperties for the error code.
Definition ErrorHandlerModule.c:112
Class which holds the properties and handling of an error.
Definition ErrorProperties.c:3
Definition EntityAI.c:95

Перекрестные ссылки GetProperties().

Используется в GetLastClientMessage().

◆ GetLastClientMessage()

override string GetLastClientMessage ( int errorCode)
protected

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

Аргументы
errorCodeint The full error code to check against
Возвращает
string The Client message for the error
150 {
152 {
154 }
155 else
156 {
157 ErrorEx(string.Format("Was unable to get the information on the last error as another has already occurred. (%1 != %2)", ErrorModuleHandler.GetErrorHex(errorCode), ErrorModuleHandler.GetErrorHex(m_LastErrorThrown)));
159 }
160 }
string m_LastAdditionalInfo
Holds the last additional info passed in.
Definition ErrorHandlerModule.c:70
int m_LastErrorThrown
Holds the last thrown error in this module, defaults to 0.
Definition ErrorHandlerModule.c:69
override string GetClientMessage(int errorCode, string additionalInfo="")
Fetches the Client message for the error code.
Definition ErrorHandlerModule.c:130
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Definition ErrorModuleHandler.c:29
static proto owned string GetErrorHex(int errorCode)
Returns a formatted string of the error code.
enum ShapeType ErrorEx

Перекрестные ссылки ErrorEx, GetClientMessage(), ErrorModuleHandler::GetErrorHex(), m_LastAdditionalInfo и 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.

Аргументы
errorCodeint The full error code to check against
Возвращает
string The Server message for the error
187 {
189 {
191 }
192 else
193 {
194 ErrorEx(string.Format("Was unable to get the information on the last error as another has already occurred. (%1 != %2)", ErrorModuleHandler.GetErrorHex(errorCode), ErrorModuleHandler.GetErrorHex(m_LastErrorThrown)), ErrorExSeverity.WARNING);
196 }
197 }
override string GetServerMessage(int errorCode, string additionalInfo="")
Fetches the Server message for the error code.
Definition ErrorHandlerModule.c:167
ErrorExSeverity
Definition EnDebug.c:62

Перекрестные ссылки ErrorEx, ErrorModuleHandler::GetErrorHex(), GetServerMessage(), m_LastAdditionalInfo и m_LastErrorThrown.

◆ GetProperties()

ErrorProperties GetProperties ( int errorCode)
protected

Fetches the ErrorProperties for the error code.

Аргументы
errorCodeint The full error code
Возвращает
ErrorProperties The data and handling for the error
113 {
116
117 if (!m_ErrorDataMap.Find(error, properties))
118 {
119 Error(string.Format("[EHM] Could not find any properties for error %1(%2) in %3", errorCode, ErrorModuleHandler.GetErrorHex(errorCode), this));
120 }
121
122 return properties;
123 }
ref map< int, ref ErrorProperties > m_ErrorDataMap
Map containing the codes that exist for the ErrorHandlerModule The code links to ErrorProperties This...
Definition ErrorHandlerModule.c:78
static proto int GetCodeFromError(int errorCode)
Returns the code of the error.
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

Перекрестные ссылки Error(), ErrorModuleHandler::GetCodeFromError(), ErrorModuleHandler::GetErrorHex() и m_ErrorDataMap.

Используется в GetClientMessage(), GetServerMessage() и OnErrorThrown().

◆ GetServerMessage()

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

Fetches the Server message for the error code.

Аргументы
errorCodeint The full error code
Возвращает
string The Server message for the error
168 {
170
171 if ( properties )
172 {
173 return properties.GetServerMessage(additionalInfo);
174 }
175 else
176 {
177 return additionalInfo;
178 }
179 }

Перекрестные ссылки GetProperties().

Используется в GetLastServerMessage().

◆ InitOptionalVariables()

void InitOptionalVariables ( )
protected

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

97 {
98 }

◆ InsertDialogueErrorProperties()

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

Insert an error with Dialogue as handling, using the Optional Variables.

234 {
236 }
class ErrorHandlerModule m_Header
This is where to input logic and extend functionality of ErrorHandlerModule.
ref UIScriptedMenu m_UIHandler
Optional: The UI the handler might generally use
Definition ErrorHandlerModule.c:67
string m_Prefix
Optional: Prefix (e.g. Fixed text at the start of the messages in the module)
Definition ErrorHandlerModule.c:66
void DialogueErrorProperties(string message, string serverMessage, string header, UIScriptedMenu handler=null, int dialogButtonType=DBT_OK, int defaultButton=DBB_OK, int dialogMeaningType=DMT_EXCLAMATION, bool displayAdditionalInfo=true)
Definition ErrorProperties.c:45

Перекрестные ссылки DialogueErrorProperties(), m_ErrorDataMap, m_Header, m_Prefix и m_UIHandler.

Используется в ClientKickedModule::FillErrorDataMap(), ConnectErrorClientModule::FillErrorDataMap(), FillErrorDataMap(), ConnectErrorServerModule::FillErrorDataMap() и BIOSErrorModule::InsertBIOSError().

◆ InsertErrorProperties()

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

Insert an error with no handling.

270 {
272 }

Перекрестные ссылки m_ErrorDataMap.

Используется в BIOSErrorModule::FillErrorDataMap(), ClientKickedModule::FillErrorDataMap(), ConnectErrorClientModule::FillErrorDataMap() и BIOSErrorModule::InsertBIOSError().

◆ 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.

Перекрестные ссылки DialogueErrorProperties(), m_ErrorDataMap, m_Header, m_Prefix и m_UIHandler.

Используется в 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.

Перекрестные ссылки DialogueErrorProperties(), m_ErrorDataMap, m_Header, m_Prefix и m_UIHandler.

Используется в 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.

Перекрестные ссылки DialogueErrorProperties(), m_ErrorDataMap, m_Prefix и 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.

Перекрестные ссылки DialogueErrorProperties(), m_ErrorDataMap, m_Header и m_UIHandler.

Используется в 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.

Перекрестные ссылки DialogueErrorProperties(), m_ErrorDataMap, m_Header, m_Prefix и m_UIHandler.

Используется в 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.

Аргументы
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data
207 {
208 super.OnErrorThrown(errorCode, additionalInfo);
209
212
214
215 if ( properties )
216 {
217 properties.HandleError(errorCode, additionalInfo);
218 }
219 else
220 {
221 ErrorEx(string.Format("Error code %1(%2) was thrown but no ErrorProperties was found for it in category %3.", errorCode, ErrorModuleHandler.GetErrorHex(errorCode), GetCategory().ToString()));
222 if (m_ErrorDataMap.Find(-1, properties))
223 {
224 properties.HandleError(errorCode, additionalInfo);
225 }
226 }
227 }
proto string ToString()
int GetCategory()
Definition PluginDayzPlayerDebug.c:81

Перекрестные ссылки ErrorEx, GetCategory(), ErrorModuleHandler::GetErrorHex(), GetProperties(), m_ErrorDataMap, m_LastAdditionalInfo, m_LastErrorThrown и ToString().

◆ ~ErrorHandlerModuleScript()

88 {
89 if (m_UIHandler)
90 {
91 delete m_UIHandler;
92 }
93 }

Перекрестные ссылки m_UIHandler.

Переменные

◆ 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)

Используется в GetProperties(), InsertDialogueErrorProperties(), InsertErrorProperties(), InsertExtendedPrefixDialogueErrorProperties(), InsertExtendedPrefixSplitDialogueErrorProperties(), InsertHeaderDialogueErrorProperties(), InsertPrefixDialogueErrorProperties(), InsertSplitDialogueErrorProperties() и OnErrorThrown().

◆ m_Header

◆ m_LastAdditionalInfo

string m_LastAdditionalInfo = ""
protected

Holds the last additional info passed in.

Используется в GetLastClientMessage(), GetLastServerMessage() и OnErrorThrown().

◆ m_LastErrorThrown

int m_LastErrorThrown = 0
protected

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

Используется в GetLastClientMessage(), GetLastServerMessage(), OnErrorThrown(), ConnectErrorClientModule::OnEvent(), OnEvent() и ConnectErrorServerModule::OnEvent().

◆ m_Prefix

◆ m_UIHandler