diff --git a/binaries/data/mods/public/gui/common/network.js b/binaries/data/mods/public/gui/common/network.js index 5df9573189..7ba591125f 100644 --- a/binaries/data/mods/public/gui/common/network.js +++ b/binaries/data/mods/public/gui/common/network.js @@ -13,7 +13,7 @@ function getDisconnectReason(id) switch (id) { case 0: return translate("Unknown reason"); - case 1: return translate("Unexpected shutdown"); + case 1: return translate("The host has ended the game"); case 2: return translate("Incorrect network protocol version"); case 3: return translate("Game is loading, please try later"); case 4: return translate("Game has already started, no observers allowed"); diff --git a/binaries/data/mods/public/gui/session/messages.js b/binaries/data/mods/public/gui/session/messages.js index 1f2114a735..1172acdf13 100644 --- a/binaries/data/mods/public/gui/session/messages.js +++ b/binaries/data/mods/public/gui/session/messages.js @@ -60,8 +60,7 @@ var g_StatusMessageTypes = { "connected": msg => translate("Connected to the server."), "disconnected": msg => translate("Connection to the server has been lost.") + "\n" + // Translation: States the reason why the client disconnected from the server. - sprintf(translate("Reason: %(reason)s."), { "reason": getDisconnectReason(msg.reason) }) + "\n" + - translate("The game has ended."), + sprintf(translate("Reason: %(reason)s."), { "reason": getDisconnectReason(msg.reason) }), "waiting_for_players": msg => translate("Waiting for other players to connect..."), "join_syncing": msg => translate("Synchronising gameplay with other players..."), "active": msg => "" diff --git a/source/network/NetHost.h b/source/network/NetHost.h index e0dea1f247..c57259941a 100644 --- a/source/network/NetHost.h +++ b/source/network/NetHost.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2016 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -60,7 +60,7 @@ typedef std::map PlayerAssignmentMap; // map from GUID - enum NetDisconnectReason { NDR_UNKNOWN = 0, - NDR_UNEXPECTED_SHUTDOWN, + NDR_SERVER_SHUTDOWN, NDR_INCORRECT_PROTOCOL_VERSION, NDR_SERVER_LOADING, NDR_SERVER_ALREADY_IN_GAME, diff --git a/source/network/NetServer.cpp b/source/network/NetServer.cpp index cc6807f8f4..e0bcfeb40a 100644 --- a/source/network/NetServer.cpp +++ b/source/network/NetServer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2016 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -151,7 +151,7 @@ CNetServerWorker::~CNetServerWorker() for (size_t i = 0; i < m_Sessions.size(); ++i) { - m_Sessions[i]->DisconnectNow(NDR_UNEXPECTED_SHUTDOWN); + m_Sessions[i]->DisconnectNow(NDR_SERVER_SHUTDOWN); delete m_Sessions[i]; } diff --git a/source/network/NetSession.cpp b/source/network/NetSession.cpp index 6618f3bac8..3e97124927 100644 --- a/source/network/NetSession.cpp +++ b/source/network/NetSession.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2016 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -39,7 +39,7 @@ CNetClientSession::~CNetClientSession() if (m_Host && m_Server) { // Disconnect immediately (we can't wait for acks) - enet_peer_disconnect_now(m_Server, NDR_UNEXPECTED_SHUTDOWN); + enet_peer_disconnect_now(m_Server, NDR_SERVER_SHUTDOWN); enet_host_destroy(m_Host); m_Host = NULL;