Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
connecterrorservermodule.c
Go to the documentation of this file.
2{
3 UNKNOWN = -1, // -1 must always be UNKNOWN
4 OK = 0, // 0 must always be OK
5
6 WRONG_PASSWORD, // User entered wrong password
7 WRONG_VERSION, // Server and client do not have the same build while "forceSameBuild" is true
8 CONNECT_ERROR, // Unknown error
9 SESSION_FULL, // Server is full
10 FILE_PATCHING, // Bad file patching
11
12 ALREADY_CONNECTED, // Client is already connected
13 HOST_ADDRESS, // Was unable to resolve host address
14 NET_CHANNEL, // Client failed to create NetChannel
15 CONNECT, // Connecting itself has failed
16 REQUEST_PLAYER, // Failed to request player
17 CREATE_PLAYER, // Failed to create player
18 TIMEOUT, // Packages timed out
19 UID, // Failed to find uid
20 NET_CHANNEL_SERVER, // Server failed to create NetChannel
21 ACTIVATE, // Failed to activate session
22 SERVER_LOCKED, // Server is locked by admin
23 SERVER_SHUTDOWN, // Server is shutting down soon
24 BUILD_SMALLER, // Client has a build smaller than the Server
25 BUILD_GREATER, // Client has a build greater than the Server
26 VERSION_SMALLER, // Client has a version smaller than the Server
27 VERSION_GREATER, // Client has a version greater than the Server
28 EQUAL_MOD, // Server and Client do not have equal mods while "equalModRequired" is true
29 CLIENT_DIAG, // Client is using Diag exe while Server is not
30 SERVER_DIAG, // Server is using Diag exe while Client is not
31 NO_DEVICE_ID, // Client has not acquired device id
32};
33
34class ConnectErrorServerModule : ErrorHandlerModuleScript
35{
37 {
38 SetCategory(ErrorCategory.ConnectErrorServer);
39 }
40
41 override void InitOptionalVariables()
42 {
43 super.InitOptionalVariables();
44
45 m_Header = "#server_browser_connecting_failed";
46 }
47
48 override void FillErrorDataMap()
49 {
50 super.FillErrorDataMap();
51
52 InsertDialogueErrorProperties(EConnectErrorServer.WRONG_PASSWORD, "#server_browser_wrong_password");
53 InsertDialogueErrorProperties(EConnectErrorServer.WRONG_VERSION, "#server_browser_wrong_version");
54 InsertDialogueErrorProperties(EConnectErrorServer.CONNECT_ERROR, "#server_browser_wrong_connect_error");
55 InsertDialogueErrorProperties(EConnectErrorServer.SESSION_FULL, "#server_browser_session_full");
56 InsertDialogueErrorProperties(EConnectErrorServer.FILE_PATCHING, "#server_browser_bad_file_patching");
57
58 InsertDialogueErrorProperties(EConnectErrorServer.ALREADY_CONNECTED, "#STR_already_connected");
59 InsertDialogueErrorProperties(EConnectErrorServer.HOST_ADDRESS, "#STR_host_address");
60 InsertDialogueErrorProperties(EConnectErrorServer.NET_CHANNEL, "#STR_net_channel");
62 InsertDialogueErrorProperties(EConnectErrorServer.REQUEST_PLAYER, "#STR_request_player");
63 InsertDialogueErrorProperties(EConnectErrorServer.CREATE_PLAYER, "#STR_create_player");
66 InsertDialogueErrorProperties(EConnectErrorServer.NET_CHANNEL_SERVER, "#STR_net_channel_server");
67 InsertDialogueErrorProperties(EConnectErrorServer.ACTIVATE, "#STR_activate");
68 InsertDialogueErrorProperties(EConnectErrorServer.SERVER_LOCKED, "#STR_MP_SESSION_LOCKED");
69 InsertDialogueErrorProperties(EConnectErrorServer.SERVER_SHUTDOWN, "#STR_shutdown_server");
70 InsertDialogueErrorProperties(EConnectErrorServer.BUILD_SMALLER, "#STR_build_smaller"+"\n"+"#STR_PLEASE_UPDATE");
71 InsertDialogueErrorProperties(EConnectErrorServer.BUILD_GREATER, "#STR_build_greater"+"\n"+"#STR_PLEASE_WAIT");
72 InsertDialogueErrorProperties(EConnectErrorServer.VERSION_SMALLER, "#STR_version_smaller"+"\n"+"#STR_PLEASE_UPDATE");
73 InsertDialogueErrorProperties(EConnectErrorServer.VERSION_GREATER, "#STR_version_greater"+"\n"+"#STR_PLEASE_WAIT");
74 InsertDialogueErrorProperties(EConnectErrorServer.EQUAL_MOD, "#STR_equal_mod");
75 InsertDialogueErrorProperties(EConnectErrorServer.CLIENT_DIAG, "#STR_client_diag");
76 InsertDialogueErrorProperties(EConnectErrorServer.SERVER_DIAG, "#STR_server_diag");
77 InsertDialogueErrorProperties(EConnectErrorServer.NO_DEVICE_ID, "#STR_no_device_id");
78 }
79
80 override void OnEvent(EventType eventTypeId, Param params)
81 {
82 switch (eventTypeId)
83 {
85#ifndef NO_GUI
86 g_Game.GetUIManager().CloseSpecificDialog(m_LastErrorThrown);
87#endif
88 break;
89
90 default:
91 break;
92 }
93 }
94}
95
96/*class ConnectErrorServerModuleUI : UIScriptedMenu
97{
98 override bool OnModalResult(Widget w, int x, int y, int code, int result)
99 {
100 super.OnModalResult(w, x, y, code, result);
101
102 int error = ErrorModuleHandler.GetCodeFromError(code);
103 switch ( error )
104 {
105 default:
106 break;
107 }
108
109 return true;
110 }
111}*/
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
DayZGame g_Game
Definition dayzgame.c:3868
class ErrorHandlerModule m_Header
This is where to input logic and extend functionality of ErrorHandlerModule.
int m_LastErrorThrown
Holds the last thrown error in this module, defaults to 0.
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.
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
const EventType MPSessionPlayerReadyEventTypeID
no params
Definition gameplay.c:481
TypeID EventType
Definition enwidgets.c:55