connecterrorclientmodule.c 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. enum EConnectErrorClient
  2. {
  3. UNKNOWN = -1, // -1 must always be UNKNOWN
  4. OK = 0, // 0 must always be OK
  5. SERVER_UNREACHABLE, // Could not connect to server because it is not reachable (offline, restarting, ..)
  6. ALREADY_CONNECTING, // Client is already attempting to join a server
  7. ERROR_MSG_SHOWED, // Indicates there is an error on screen that has yet to be confirmed
  8. INCORRECT_CLIENT_STATE, // The client is already connected or is connecting to a server
  9. INVALID_SESSION, // The guid of the session is empty
  10. VERSION_MISMATCH, // Mismatch between server and client version
  11. VERSION_MISMATCH_RB, // Client build is lower than "requiredBuild" (server config)
  12. VERSION_MISMATCH_AB, // Client build is higher than "allowedBuild" (server config)
  13. DLC_CHECK_FAILED, // Client does not have required DLC
  14. EMPTY_PASSWORD, // Player input an empty password
  15. PASSWORD, // Server is password protected
  16. BE_LICENCE, // Server is using BE and it has not yet been agreed to
  17. ALREADY_ON_ANOTHER_SERVER, // Player is already playing on a different server
  18. COMMUNICATION_TIMED_OUT, // Communication timed out
  19. ALREADY_ON_SERVER, // Player is already playing on this server
  20. };
  21. class ConnectErrorClientModule : ErrorHandlerModuleScript
  22. {
  23. void ConnectErrorClientModule()
  24. {
  25. SetCategory(ErrorCategory.ConnectErrorClient);
  26. }
  27. override void InitOptionalVariables()
  28. {
  29. super.InitOptionalVariables();
  30. m_Header = "#server_browser_connecting_failed";
  31. }
  32. override void FillErrorDataMap()
  33. {
  34. super.FillErrorDataMap();
  35. InsertDialogueErrorProperties(EConnectErrorClient.SERVER_UNREACHABLE, "#STR_server_unreachable");
  36. InsertDialogueErrorProperties(EConnectErrorClient.ALREADY_CONNECTING, "#STR_already_connecting");
  37. InsertDialogueErrorProperties(EConnectErrorClient.ERROR_MSG_SHOWED, "#STR_error_msg_showed");
  38. InsertDialogueErrorProperties(EConnectErrorClient.INCORRECT_CLIENT_STATE, "#STR_incorrect_client_state");
  39. InsertDialogueErrorProperties(EConnectErrorClient.INVALID_SESSION, "#STR_invalid_session");
  40. InsertDialogueErrorProperties(EConnectErrorClient.VERSION_MISMATCH, "#multi_server_not_compatible_message");
  41. InsertDialogueErrorProperties(EConnectErrorClient.VERSION_MISMATCH_RB, "#multi_server_not_compatible_message");
  42. InsertDialogueErrorProperties(EConnectErrorClient.VERSION_MISMATCH_AB, "#multi_server_not_compatible_message");
  43. InsertDialogueErrorProperties(EConnectErrorClient.DLC_CHECK_FAILED, "#mod_detail_info_warning");
  44. InsertDialogueErrorProperties(EConnectErrorClient.EMPTY_PASSWORD, "#STR_empty_password");
  45. InsertErrorProperties(EConnectErrorClient.PASSWORD);
  46. InsertErrorProperties(EConnectErrorClient.BE_LICENCE);
  47. InsertDialogueErrorProperties(EConnectErrorClient.ALREADY_ON_ANOTHER_SERVER,"#STR_already_on_another_server");
  48. InsertDialogueErrorProperties(EConnectErrorClient.COMMUNICATION_TIMED_OUT, "#STR_BIOS_CommTimeOutError");
  49. InsertDialogueErrorProperties(EConnectErrorClient.ALREADY_ON_SERVER, "#ps4_already_in_session");
  50. }
  51. #ifndef NO_GUI
  52. override void OnEvent(EventType eventTypeId, Param params)
  53. {
  54. switch (eventTypeId)
  55. {
  56. case MPSessionPlayerReadyEventTypeID:
  57. g_Game.GetUIManager().CloseSpecificDialog(m_LastErrorThrown);
  58. break;
  59. default:
  60. break;
  61. }
  62. }
  63. #endif
  64. }
  65. /*class ConnectErrorClientModuleUI : UIScriptedMenu
  66. {
  67. override bool OnModalResult(Widget w, int x, int y, int code, int result)
  68. {
  69. super.OnModalResult(w, x, y, code, result);
  70. int error = ErrorModuleHandler.GetCodeFromError(code);
  71. switch ( error )
  72. {
  73. default:
  74. break;
  75. }
  76. return true;
  77. }
  78. }*/