Ticket #3570: 3570.5.diff

File 3570.5.diff, 3.1 KB (added by Stan, 8 years ago)

Rebased

  • binaries/data/mods/public/gui/common/network.js

     
    4646/**
    4747 * Must be kept in sync with source/network/NetHost.h
    4848 */
    49 function getDisconnectReason(id)
     49function getDisconnectReason(id, wasConnected)
    5050{
    5151    switch (id)
    5252    {
    53     case 0: return translateWithContext("network disconnect", "Unknown reason");
     53    case 0: return wasConnected ? translate("Unknown reason.") : translate("This is generally due to port 20595 not being forwarded on the host side. Also, check if you have any firewall or anti-virus blocking the connection.");
    5454    case 1: return translate("The host has ended the game");
    5555    case 2: return translate("Incorrect network protocol version");
    5656    case 3: return translate("Game is loading, please try later");
  • binaries/data/mods/public/gui/gamesetup/gamesetup.js

     
    623623    }
    624624
    625625    cancelSetup();
    626     reportDisconnect(message.reason);
     626    reportDisconnect(message.reason, true);
    627627}
    628628
    629629/**
  • binaries/data/mods/public/gui/gamesetup/gamesetup_mp.js

     
    9292                {
    9393                case "disconnected":
    9494                    cancelSetup();
    95                     reportDisconnect(message.reason);
     95                    reportDisconnect(message.reason, false);
    9696                    return;
    9797
    9898                default:
     
    165165
    166166                case "disconnected":
    167167                    cancelSetup();
    168                     reportDisconnect(message.reason);
     168                    reportDisconnect(message.reason, false);
    169169                    return;
    170170
    171171                default:
  • binaries/data/mods/public/gui/session/messages.js

     
    5959var g_StatusMessageTypes = {
    6060    "authenticated": msg => translate("Connection to the server has been authenticated."),
    6161    "connected": msg => translate("Connected to the server."),
     62    // Translation: States the reason why the client disconnected from the server.
    6263    "disconnected": msg => translate("Connection to the server has been lost.") + "\n" +
    63                     // Translation: States the reason why the client disconnected from the server.
    64                     sprintf(translate("Reason: %(reason)s."), { "reason": getDisconnectReason(msg.reason) }),
     64        sprintf(translate("Reason: %(reason)s."), { "reason": getDisconnectReason(msg.reason, true) }),
    6565    "waiting_for_players": msg => translate("Waiting for other players to connect..."),
    6666    "join_syncing": msg => translate("Synchronising gameplay with other players..."),
    6767    "active": msg => ""