DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ConnectErrorScriptModule.c
См. документацию.
2{
3 UNKNOWN = -1, // -1 must always be UNKNOWN
4 OK = 0, // 0 must always be OK
5
6 ALREADY_CONNECTING, // Already joining a server
7 ALREADY_CONNECTING_THIS, // Already joining this exact server
8}
9
11{
13 {
14 SetCategory(ErrorCategory.ConnectErrorScript);
15 }
17 override void InitOptionalVariables()
18 {
19 super.InitOptionalVariables();
20
21 m_Header = "#server_browser_connecting_failed";
22#ifndef NO_GUI
24#endif
25 }
26
27 override void FillErrorDataMap()
28 {
29 super.FillErrorDataMap();
30
31 InsertDialogueErrorProperties(EConnectErrorScript.ALREADY_CONNECTING, "#STR_script_already_connecting", DBT_YESNOCANCEL, DBB_NO);
32 InsertDialogueErrorProperties(EConnectErrorScript.ALREADY_CONNECTING_THIS, "#STR_script_already_connecting_this");
33 }
34
35 override void OnEvent(EventType eventTypeId, Param params)
36 {
37 switch (eventTypeId)
38 {
40#ifndef NO_GUI
41 g_Game.GetUIManager().CloseSpecificDialog(m_LastErrorThrown);
42#endif
43 break;
44
45 default:
46 break;
47 }
48 }
49}
50
52{
53 protected static void DisconnectSession(bool loadMpPrivilege)
54 {
55 g_Game.DisconnectSessionForce();
56 g_Game.DisconnectSessionScript();
57
58 if (loadMpPrivilege)
59 {
61 }
62 }
63
64 override bool OnModalResult(Widget w, int x, int y, int code, int result)
65 {
66 super.OnModalResult(w, x, y, code, result);
67
68 int error = ErrorModuleHandler.GetCodeFromError(code);
69 switch ( error )
70 {
71 case EConnectErrorScript.ALREADY_CONNECTING:
72 {
73 switch ( result )
74 {
75 case DBB_YES:
76 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).Call(DisconnectSession, true);
77 break;
78 case DBB_CANCEL:
79 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).Call(DisconnectSession, false);
80 break;
81
82 default:
83 break;
84 }
85 break;
86 }
87
88 default:
89 break;
90 }
91
92 return true;
93 }
94}
@ OK
0 - No error. Can be returned from any call.
Определения BIOSErrorModule.c:9
@ UNKNOWN
24 - Any other error. Can be returned from any call.
Определения BIOSErrorModule.c:56
@ ALREADY_CONNECTING
Определения ConnectErrorClientModule.c:7
override void InitOptionalVariables()
Определения ConnectErrorScriptModule.c:17
override void OnEvent(EventType eventTypeId, Param params)
Handles VON-related events.
Определения ConnectErrorScriptModule.c:35
EConnectErrorScript
Определения ConnectErrorScriptModule.c:2
enum EConnectErrorScript ConnectErrorScriptModule()
Определения ConnectErrorScriptModule.c:12
override void FillErrorDataMap()
Определения ConnectErrorScriptModule.c:27
ALREADY_CONNECTING_THIS
Определения ConnectErrorScriptModule.c:17
DayZGame g_Game
Определения DayZGame.c:3868
class ErrorHandlerModule m_Header
This is where to input logic and extend functionality of ErrorHandlerModule.
void ErrorHandlerModuleScript()
Constructor, by default calls the function that will fill the ErrorDataMap.
Определения ErrorHandlerModule.c:81
int m_LastErrorThrown
Holds the last thrown error in this module, defaults to 0.
Определения ErrorHandlerModule.c:69
ref UIScriptedMenu m_UIHandler
Optional: The UI the handler might generally use
Определения ErrorHandlerModule.c:67
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.
Определения ErrorHandlerModule.c:233
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
Определения ErrorModuleHandler.c:5
Icon x
Icon y
static void DisconnectSession(bool loadMpPrivilege)
Определения ConnectErrorScriptModule.c:53
override bool OnModalResult(Widget w, int x, int y, int code, int result)
Определения ConnectErrorScriptModule.c:64
static proto int GetCodeFromError(int errorCode)
Returns the code of the error.
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
Определения ErrorModuleHandler.c:29
static void LoadMPPrivilege()
Определения OnlineServices.c:412
Определения OnlineServices.c:2
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
Определения DayZGame.c:64
Определения EnWidgets.c:190
const EventType MPSessionPlayerReadyEventTypeID
no params
Определения gameplay.c:481
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8
TypeID EventType
Определения EnWidgets.c:55