Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ErrorModuleHandler

The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerModule instances inserted in Init. API comes with several functions to Create, Throw and extract data from error codes. The format used is an int which is made up of two shorts, one that holds the category and one that holds the code. Therefore when looking at an error code, it is much easier to identify when looking at the hex value. Подробнее...

Закрытые члены

void SafeAddModule (notnull ErrorHandlerModule errorModule)
 Wrapper for AddModule to give feedback whether it succeeded or not.
 
void SafeRemoveModule (notnull ErrorHandlerModule errorModule)
 Wrapper for RemoveModule to give feedback whether it succeeded or not.
 
void SafeRemoveModule (ErrorCategory category)
 Wrapper for RemoveModule to give feedback whether it succeeded or not.
 
void Init ()
 Gets called shortly after creation of ErrorModuleHandler.
 
void OnEvent (EventType eventTypeId, Param params)
 is called by DayZGame to pass Events.
 

Закрытые статические члены

static proto int ThrowError (ErrorCategory category, int code, string additionalInfo="")
 Creates and throws the error code, sending it to the handler of the category.
 
static proto int ThrowErrorCode (int errorCode, string additionalInfo="")
 Throws the error code and sends it to the handler of the category.
 
static proto int CreateError (ErrorCategory category, int code)
 Creates full error code.
 
static proto ErrorCategory GetCategoryFromError (int errorCode)
 Returns the category the error was thrown from.
 
static proto int GetCodeFromError (int errorCode)
 Returns the code of the error.
 
static proto owned string GetErrorHex (int errorCode)
 Returns a formatted string of the error code.
 
static proto bool AddModule (ErrorCategory category, notnull ErrorHandlerModule errorModule)
 Adds a module handler to the ErrorModuleHandler.
 
static proto bool RemoveModule (ErrorCategory category)
 Removes a module handler from the ErrorModuleHandler.
 
static proto string GetClientMessage (ErrorCategory category, int code, string additionalInfo="")
 Gets the Client Message for specified error.
 
static proto string GetClientMessageByCode (int errorCode, string additionalInfo="")
 Gets the Client Message for specified error.
 
static proto string GetLastClientMessage (ErrorCategory category, int code)
 Gets the Client Message for specified error, while attempting to restore information on the most recent error.
 
static proto string GetLastClientMessageByCode (int errorCode)
 Gets the Client Message for specified error, while attempting to restore information on the most recent error.
 
static proto string GetServerMessage (ErrorCategory category, int code, string additionalInfo="")
 Gets the Server Message for specified error.
 
static proto string GetServerMessageByCode (int errorCode, string additionalInfo="")
 Gets the Server Message for specified error.
 
static proto string GetLastServerMessage (ErrorCategory category, int code)
 Gets the Server Message for specified error, while attempting to restore information on the most recent error.
 
static proto string GetLastServerMessageByCode (int errorCode)
 Gets the Server Message for specified error, while attempting to restore information on the most recent error.
 
static proto native ErrorModuleHandler GetInstance ()
 Gets the EMH Instance.
 
static proto void GetErrorModules (notnull out array< ErrorHandlerModule > errorModules)
 

Подробное описание

The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerModule instances inserted in Init. API comes with several functions to Create, Throw and extract data from error codes. The format used is an int which is made up of two shorts, one that holds the category and one that holds the code. Therefore when looking at an error code, it is much easier to identify when looking at the hex value.

Методы

◆ AddModule()

static proto bool AddModule ( ErrorCategory category,
notnull ErrorHandlerModule errorModule )
staticprivate

Adds a module handler to the ErrorModuleHandler.

Аргументы
categoryErrorCategory Category the module is for
errorModuleErrorHandlerModule The class containing the information and codes for the category.
Возвращает
bool Whether the adding of the module was successful or not

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

◆ CreateError()

static proto int CreateError ( ErrorCategory category,
int code )
staticprivate

Creates full error code.

Аргументы
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
Возвращает
int The full error code
int errorCode = ErrorModuleHandler.CreateError( ErrorCategory.ConnectErrorClient, -1 );
>> errorCode = 196607
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
Definition ErrorModuleHandler.c:5
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Definition ErrorModuleHandler.c:29
static proto int CreateError(ErrorCategory category, int code)
Creates full error code.
Definition EntityAI.c:95
proto void Print(void var)
Prints content of variable to console/log.

◆ GetCategoryFromError()

static proto ErrorCategory GetCategoryFromError ( int errorCode)
staticprivate

Returns the category the error was thrown from.

Аргументы
errorCodeint The full error code
Возвращает
ErrorCategory The ErrorCategory the error was thrown from
>> category = 2
static proto ErrorCategory GetCategoryFromError(int errorCode)
Returns the category the error was thrown from.

◆ GetClientMessage()

static proto string GetClientMessage ( ErrorCategory category,
int code,
string additionalInfo = "" )
staticprivate

Gets the Client Message for specified error.

Аргументы
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
additionalInfostring Any additional info regarding the error, usually data
Возвращает
string The message which would appear on Client

Используется в OnlineServices::ErrorCaught() и ServerBrowserTab::OnLoadServersAsyncConsole().

◆ GetClientMessageByCode()

static proto string GetClientMessageByCode ( int errorCode,
string additionalInfo = "" )
staticprivate

Gets the Client Message for specified error.

Аргументы
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data
Возвращает
string The message which would appear on Client

◆ GetCodeFromError()

static proto int GetCodeFromError ( int errorCode)
staticprivate

Returns the code of the error.

Аргументы
errorCodeint The full error code
Возвращает
int The code of the error
>> code = -1
static proto int GetCodeFromError(int errorCode)
Returns the code of the error.

Используется в GetProperties() и ConnectErrorScriptModuleUI::OnModalResult().

◆ GetErrorHex()

static proto owned string GetErrorHex ( int errorCode)
staticprivate

Returns a formatted string of the error code.

Аргументы
errorCodeint The full error code
Возвращает
string A formatted string of the error code
>> formattedCode = '0x0002FFFF'
static proto owned string GetErrorHex(int errorCode)
Returns a formatted string of the error code.

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

◆ GetErrorModules()

static proto void GetErrorModules ( notnull out array< ErrorHandlerModule > errorModules)
staticprivate

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

◆ GetInstance()

static proto native ErrorModuleHandler GetInstance ( )
staticprivate

Gets the EMH Instance.

Возвращает
ErrorModuleHandler The ErrorModuleHandler Instance

Используется в CGame::OnEvent() и EnProfilerTests::TestFuncCountData().

◆ GetLastClientMessage()

static proto string GetLastClientMessage ( ErrorCategory category,
int code )
staticprivate

Gets the Client Message for specified error, while attempting to restore information on the most recent error.

Аргументы
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
Возвращает
string The message which would appear on Client

◆ GetLastClientMessageByCode()

static proto string GetLastClientMessageByCode ( int errorCode)
staticprivate

Gets the Client Message for specified error, while attempting to restore information on the most recent error.

Аргументы
errorCodeint The full error code
Возвращает
string The message which would appear on Client

◆ GetLastServerMessage()

static proto string GetLastServerMessage ( ErrorCategory category,
int code )
staticprivate

Gets the Server Message for specified error, while attempting to restore information on the most recent error.

Аргументы
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
Возвращает
string The message which would appear on Server

◆ GetLastServerMessageByCode()

static proto string GetLastServerMessageByCode ( int errorCode)
staticprivate

Gets the Server Message for specified error, while attempting to restore information on the most recent error.

Аргументы
errorCodeint The full error code
Возвращает
string The message which would appear on Server

◆ GetServerMessage()

static proto string GetServerMessage ( ErrorCategory category,
int code,
string additionalInfo = "" )
staticprivate

Gets the Server Message for specified error.

Аргументы
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
additionalInfostring Any additional info regarding the error, usually data
Возвращает
string The message which would appear on Server

◆ GetServerMessageByCode()

static proto string GetServerMessageByCode ( int errorCode,
string additionalInfo = "" )
staticprivate

Gets the Server Message for specified error.

Аргументы
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data
Возвращает
string The message which would appear on Server

◆ Init()

void Init ( )
inlineprivate

Gets called shortly after creation of ErrorModuleHandler.

241 {
242 if (!g_Game.IsDedicatedServer())
243 {
247 }
250 }
enum EConnectErrorScript ConnectErrorScriptModule()
Definition ConnectErrorScriptModule.c:12
DayZGame g_Game
Definition DayZGame.c:3746
Definition BIOSErrorModule.c:71
Definition ClientKickedModule.c:178
Definition ConnectErrorClientModule.c:24
Definition ConnectErrorServerModule.c:35
void SafeAddModule(notnull ErrorHandlerModule errorModule)
Wrapper for AddModule to give feedback whether it succeeded or not.
Definition ErrorModuleHandler.c:211

Перекрестные ссылки ConnectErrorScriptModule(), g_Game и SafeAddModule().

◆ OnEvent()

void OnEvent ( EventType eventTypeId,
Param params )
inlineprivate

is called by DayZGame to pass Events.

256 {
259
261 {
262 module.OnEvent(eventTypeId, params);
263 }
264 }
Definition and API of an ErrorHandlerModule - Do not insert any logic here! (as this class is not mod...
Definition ErrorHandlerModule.c:6
static proto void GetErrorModules(notnull out array< ErrorHandlerModule > errorModules)

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

◆ RemoveModule()

static proto bool RemoveModule ( ErrorCategory category)
staticprivate

Removes a module handler from the ErrorModuleHandler.

Аргументы
categoryErrorCategory Category the module is for
Возвращает
bool Whether the removing of the module was successful or not

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

◆ SafeAddModule()

void SafeAddModule ( notnull ErrorHandlerModule errorModule)
inlineprivate

Wrapper for AddModule to give feedback whether it succeeded or not.

Аргументы
errorModuleErrorHandlerModule The ErrorHandlerModule to add
212 {
213 if ( !AddModule(errorModule.GetCategory(), errorModule) )
214 Error(string.Format("[EMH] Adding %1 failed. (Category: %2)", errorModule, errorModule.GetCategory()));
215 }
static proto bool AddModule(ErrorCategory category, notnull ErrorHandlerModule errorModule)
Adds a module handler to the ErrorModuleHandler.
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

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

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

◆ SafeRemoveModule() [1/2]

void SafeRemoveModule ( ErrorCategory category)
inlineprivate

Wrapper for RemoveModule to give feedback whether it succeeded or not.

Аргументы
categoryErrorCategory Category to remove
232 {
233 if ( !RemoveModule(category) )
234 Error(string.Format("[EMH] Removing %1 failed.", category));
235 }
static proto bool RemoveModule(ErrorCategory category)
Removes a module handler from the ErrorModuleHandler.

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

◆ SafeRemoveModule() [2/2]

void SafeRemoveModule ( notnull ErrorHandlerModule errorModule)
inlineprivate

Wrapper for RemoveModule to give feedback whether it succeeded or not.

Аргументы
errorModuleErrorHandlerModule The ErrorHandlerModule to add
222 {
223 if ( !RemoveModule(errorModule.GetCategory()) )
224 Error(string.Format("[EMH] Removing %1 failed. (Category: %2)", errorModule, errorModule.GetCategory()));
225 }

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

◆ ThrowError()

static proto int ThrowError ( ErrorCategory category,
int code,
string additionalInfo = "" )
staticprivate

Creates and throws the error code, sending it to the handler of the category.

Аргументы
categoryErrorCategory Category the error is thrown from
codeint The code that the error belongs to inside the category between [-32768, 32767]
additionalInfostring Any additional info regarding the error, usually data
Возвращает
int The full error code
int errorCode = ErrorModuleHandler.ThrowError( ErrorCategory.ConnectErrorClient, -1 );
>> errorCode = 196607
static proto int ThrowError(ErrorCategory category, int code, string additionalInfo="")
Creates and throws the error code, sending it to the handler of the category.

Используется в CGame::TryConnect().

◆ ThrowErrorCode()

static proto int ThrowErrorCode ( int errorCode,
string additionalInfo = "" )
staticprivate

Throws the error code and sends it to the handler of the category.

Аргументы
errorCodeint The full error code
additionalInfostring Any additional info regarding the error, usually data
Возвращает
int The full error code
>> errorCode = 196607
static proto int ThrowErrorCode(int errorCode, string additionalInfo="")
Throws the error code and sends it to the handler of the category.

Объявления и описания членов класса находятся в файле: