summaryrefslogtreecommitdiff
path: root/network/websocket_client_basic.gd
diff options
context:
space:
mode:
authorAnson Bridges <bridges.anson@gmail.com>2025-08-22 12:46:04 -0700
committerAnson Bridges <bridges.anson@gmail.com>2025-08-22 12:46:04 -0700
commit64f37f4209d80bfad976dd4a139c98002caef15f (patch)
tree94c91953986e960573ae0092f8ad7120c1c266f0 /network/websocket_client_basic.gd
parent255fbf19cc9499ef384d41f68515da5e49e8a3ce (diff)
the harmonious transition from menu to gameHEADmaster
Diffstat (limited to 'network/websocket_client_basic.gd')
-rw-r--r--network/websocket_client_basic.gd5
1 files changed, 4 insertions, 1 deletions
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()