DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ErrorModuleHandler.c
См. документацию.
1
20
29{
43 static proto int ThrowError(ErrorCategory category, int code, string additionalInfo = "");
44
57 static proto int ThrowErrorCode(int errorCode, string additionalInfo = "");
58
71 static proto int CreateError(ErrorCategory category, int code);
72
84 static proto ErrorCategory GetCategoryFromError(int errorCode);
85
97 static proto int GetCodeFromError(int errorCode);
98
110 static proto owned string GetErrorHex(int errorCode);
111
112
113
120 static proto bool AddModule(ErrorCategory category, notnull ErrorHandlerModule errorModule);
121
127 static proto bool RemoveModule(ErrorCategory category);
128
129
130
138 static proto string GetClientMessage(ErrorCategory category, int code, string additionalInfo = "");
139
146 static proto string GetClientMessageByCode(int errorCode, string additionalInfo = "");
147
154 static proto string GetLastClientMessage(ErrorCategory category, int code);
155
161 static proto string GetLastClientMessageByCode(int errorCode);
162
170 static proto string GetServerMessage(ErrorCategory category, int code, string additionalInfo = "");
171
178 static proto string GetServerMessageByCode(int errorCode, string additionalInfo = "");
179
186 static proto string GetLastServerMessage(ErrorCategory category, int code);
187
193 static proto string GetLastServerMessageByCode(int errorCode);
194
195
196
201 static proto native ErrorModuleHandler GetInstance();
202
203 static proto void GetErrorModules(notnull out array<ErrorHandlerModule> errorModules);
204
205
206
211 void SafeAddModule(notnull ErrorHandlerModule errorModule)
212 {
213 if ( !AddModule(errorModule.GetCategory(), errorModule) )
214 Error(string.Format("[EMH] Adding %1 failed. (Category: %2)", errorModule, errorModule.GetCategory()));
215 }
216
221 void SafeRemoveModule(notnull ErrorHandlerModule errorModule)
222 {
223 if ( !RemoveModule(errorModule.GetCategory()) )
224 Error(string.Format("[EMH] Removing %1 failed. (Category: %2)", errorModule, errorModule.GetCategory()));
225 }
226
232 {
233 if ( !RemoveModule(category) )
234 Error(string.Format("[EMH] Removing %1 failed.", category));
235 }
236
240 private void Init()
241 {
242 if (!g_Game.IsDedicatedServer())
243 {
247 }
250 }
251
255 void OnEvent(EventType eventTypeId, Param params)
256 {
258 GetErrorModules(errorModules);
259
260 foreach (ErrorHandlerModule module : errorModules)
261 {
262 module.OnEvent(eventTypeId, params);
263 }
264 }
265}
enum EConnectErrorScript ConnectErrorScriptModule()
Определения ConnectErrorScriptModule.c:12
DayZGame g_Game
Определения DayZGame.c:3868
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
Определения ErrorModuleHandler.c:5
@ ConnectErrorServer
Error group for when the Client did connect to the Server, but the server rejected the connection.
Определения ErrorModuleHandler.c:12
@ ConnectErrorClient
Error group for when something went wrong while trying to connect to the server.
Определения ErrorModuleHandler.c:10
@ Unknown
Определения ErrorModuleHandler.c:6
@ ConnectErrorScript
Error group for connect errors thrown from Script.
Определения ErrorModuleHandler.c:14
@ Generic
Generic error group.
Определения ErrorModuleHandler.c:8
@ BIOSError
Error group for BIOS errors.
Определения ErrorModuleHandler.c:18
@ ClientKicked
Error group for when Client is kicked from server.
Определения ErrorModuleHandler.c:16
Definition and API of an ErrorHandlerModule - Do not insert any logic here! (as this class is not mod...
Определения ErrorHandlerModule.c:6
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.
Определения ErrorModuleHandler.c:221
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.
Определения ErrorModuleHandler.c:240
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.
Определения ErrorModuleHandler.c:255
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.
Определения ErrorModuleHandler.c:231
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.
Определения ErrorModuleHandler.c:211
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Определения ErrorModuleHandler.c:29
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
TypeID EventType
Определения EnWidgets.c:55