DayZ 1.24
Loading...
Searching...
No Matches
ErrorModuleHandler.c
Go to the documentation of this file.
1
20
29{
44
57 static proto int ThrowErrorCode(int errorCode, string additionalInfo = "");
58
72
85
98
110 static proto owned string GetErrorHex(int errorCode);
111
112
120
127
128
137
144 static proto string GetClientMessageByCode(int errorCode, string additionalInfo = "");
145
153
160
169
176 static proto string GetServerMessageByCode(int errorCode, string additionalInfo = "");
177
185
192
193
199
201
202
208 {
209 if (!AddModule(errorModule.GetCategory(), errorModule))
210 Error(string.Format("[EMH] Adding %1 failed. (Category: %2)", errorModule, errorModule.GetCategory()));
211 }
212
218 {
219 if (!RemoveModule(errorModule.GetCategory()))
220 Error(string.Format("[EMH] Removing %1 failed. (Category: %2)", errorModule, errorModule.GetCategory()));
221 }
222
228 {
230 Error(string.Format("[EMH] Removing %1 failed.", category));
231 }
232
236 private void Init()
237 {
238 if (!g_Game.IsDedicatedServer())
239 {
243 }
246 }
247
259}
enum EConnectErrorScript ConnectErrorScriptModule()
DayZGame g_Game
Definition DayZGame.c:3528
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
@ ConnectErrorServer
Error group for when the Client did connect to the Server, but the server rejected the connection.
@ ConnectErrorClient
Error group for when something went wrong while trying to connect to the server.
@ Unknown
@ ConnectErrorScript
Error group for connect errors thrown from Script.
@ Generic
Generic error group.
@ BIOSError
Error group for BIOS errors.
@ ClientKicked
Error group for when Client is kicked from server.
Definition and API of an ErrorHandlerModule - Do not insert any logic here! (as this class is not mod...
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
static proto int ThrowErrorCode(int errorCode, string additionalInfo="")
Throws the error code and sends it to the handler of the category.
void SafeRemoveModule(notnull ErrorHandlerModule errorModule)
Wrapper for RemoveModule to give feedback whether it succeeded or not.
static proto int CreateError(ErrorCategory category, int code)
Creates full error code.
static proto string GetLastClientMessageByCode(int errorCode)
Gets the Client Message for specified error, while attempting to restore information on the most rece...
static proto string GetClientMessage(ErrorCategory category, int code, string additionalInfo="")
Gets the Client Message for specified error.
static proto int GetCodeFromError(int errorCode)
Returns the code of the error.
static proto void GetErrorModules(notnull out array< ErrorHandlerModule > errorModules)
void Init()
Gets called shortly after creation of ErrorModuleHandler.
static proto string GetServerMessage(ErrorCategory category, int code, string additionalInfo="")
Gets the Server 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 rece...
static proto string GetClientMessageByCode(int errorCode, string additionalInfo="")
Gets the Client Message for specified error.
static proto ErrorCategory GetCategoryFromError(int errorCode)
Returns the category the error was thrown from.
static proto bool AddModule(ErrorCategory category, notnull ErrorHandlerModule errorModule)
Adds a module handler to the ErrorModuleHandler.
static proto native ErrorModuleHandler GetInstance()
Gets the EMH Instance.
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.
void SafeRemoveModule(ErrorCategory category)
Wrapper for RemoveModule to give feedback whether it succeeded or not.
static proto string GetLastServerMessage(ErrorCategory category, int code)
Gets the Server Message for specified error, while attempting to restore information on the most rece...
static proto string GetServerMessageByCode(int errorCode, string additionalInfo="")
Gets the Server Message for specified error.
static proto owned string GetErrorHex(int errorCode)
Returns a formatted string of the error code.
static proto string GetLastServerMessageByCode(int errorCode)
Gets the Server Message for specified error, while attempting to restore information on the most rece...
static proto bool RemoveModule(ErrorCategory category)
Removes a module handler from the ErrorModuleHandler.
void SafeAddModule(notnull ErrorHandlerModule errorModule)
Wrapper for AddModule to give feedback whether it succeeded or not.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90