Correct error message when the host disconnects

After 78900842b1, the following message was shown to clients when the
host disconnected during game setup:
"Lost connection to the server.
[Invalid value undefined]"

This patch fixes that.
This commit is contained in:
Vantha
2025-03-20 19:04:14 +01:00
committed by Dunedan
parent 933f49722e
commit 4d323177b8
3 changed files with 3 additions and 3 deletions
@@ -28,7 +28,7 @@ class ChatInputPanel
{
if (message.status == "disconnected")
{
reportDisconnect(message.reason, true);
reportDisconnect(message, true);
this.chatInput.hidden = true;
this.chatSubmitButton.hidden = true;
}
@@ -252,7 +252,7 @@ function pollAndHandleNetworkClient(loadSavedGame)
if (message.reason === 16)
reportHandshakeDisconnect(message.mismatch_type, message.client_mismatch, message.server_mismatch);
else
reportDisconnect(message.reason, false);
reportDisconnect(message, false);
return true;
default:
@@ -38,7 +38,7 @@ NetworkStatusOverlay.prototype.StatusCaption = {
"authenticated": msg => translate("Connection to the server has been authenticated."),
"connected": msg => translate("Connected to the server."),
"disconnected": msg => translate("Connection to the server has been lost.") + "\n" +
getDisconnectReason(msg.reason, true),
getDisconnectReason(msg.reason),
"waiting_for_players": msg => translate("Waiting for players to connect:"),
"join_syncing": msg => translate("Synchronizing gameplay with other players…"),
"active": msg => ""