From 64f37f4209d80bfad976dd4a139c98002caef15f Mon Sep 17 00:00:00 2001 From: Anson Bridges Date: Fri, 22 Aug 2025 12:46:04 -0700 Subject: the harmonious transition from menu to game --- network/websocket_client_basic.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'network/websocket_client_basic.gd') diff --git a/network/websocket_client_basic.gd b/network/websocket_client_basic.gd index 353dd81..846e721 100644 --- a/network/websocket_client_basic.gd +++ b/network/websocket_client_basic.gd @@ -39,12 +39,13 @@ func on_connection_success(protocol): send(msg) func on_connection_close_success(clean): - print("WebSocket closed successfully.") socket = null if clean: state = 0 # DISCONNECTED + print("WebSocket closed successfully.") else: state = -1 # DISCONNECT DIRTY + print("WebSocket closed unsuccessfully!") func on_connection_error(): # connection failed print("WebSocket connection failed!") @@ -59,7 +60,9 @@ func send(message, as_bytes=false) -> int: func send_json(message) -> int: + print("sending") if state != 2: + print("adding to queue") message_queue.push_back(JSON.print(message).to_utf8()) return -1 var message_json = JSON.print(message).to_utf8() -- cgit v1.2.3