aboutsummaryrefslogtreecommitdiff
path: root/client/multiplayer.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@noreply.codeberg.org>2024-09-07 13:37:23 +0000
committermetamuffin <metamuffin@noreply.codeberg.org>2024-09-07 13:37:23 +0000
commit091f8ff9acf04cedf14765e9db5540c876fd7375 (patch)
tree4c115d6cb14df5d68bc72785f1020ed4ad2fb8e2 /client/multiplayer.gd
parentaf108805c8fd87a9d20a8df02072f224d2cd3417 (diff)
parent3ef379fb07df126ea09cb112801a0bef371f8811 (diff)
downloadhurrycurry-091f8ff9acf04cedf14765e9db5540c876fd7375.tar
hurrycurry-091f8ff9acf04cedf14765e9db5540c876fd7375.tar.bz2
hurrycurry-091f8ff9acf04cedf14765e9db5540c876fd7375.tar.zst
Merge pull request 'Refactor settings system and localization' (#123) from new-settings into master
Reviewed-on: https://codeberg.org/hurrycurry/hurrycurry/pulls/123
Diffstat (limited to 'client/multiplayer.gd')
-rw-r--r--client/multiplayer.gd8
1 files changed, 3 insertions, 5 deletions
diff --git a/client/multiplayer.gd b/client/multiplayer.gd
index d8c6c1ff..168e62e6 100644
--- a/client/multiplayer.gd
+++ b/client/multiplayer.gd
@@ -85,10 +85,8 @@ func _process(_delta):
handle_packet(socket.get_packet())
elif state == WebSocketPeer.STATE_CLOSED:
var code = socket.get_close_code()
- var reason = socket.get_close_reason() if code == socket.STATE_CLOSED else tr("unavailable", "The reason for the websocket closing is unavailable")
- connection_closed.emit(
- tr("WebSocket closed with code: %d, reason %s. Clean: %s") % [code, reason, code != -1]
- )
+ var reason = socket.get_close_reason() if code == socket.STATE_CLOSED else tr("c.error.websocket.unavailable")
+ connection_closed.emit(tr("c.error.websocket") % [code, reason, code != -1])
self.queue_free()
func handle_packet(bytes: PackedByteArray):
@@ -108,7 +106,7 @@ func handle_packet(bytes: PackedByteArray):
if major != VERSION_MAJOR and minor >= VERSION_MINOR:
socket.close()
connected = false
- connection_closed.emit(tr("Server and client versions do not match. Server: %d.%d, Client: %d.%d.\nAre you sure the game is up to date?") % [major, minor, VERSION_MAJOR, VERSION_MINOR])
+ connection_closed.emit(tr("c.error.version_mismatch") % [major, minor, VERSION_MAJOR, VERSION_MINOR])
"data":
var item_names = decoded["data"]["item_names"]
var tile_names = decoded["data"]["tile_names"]