diff options
| author | Anson Bridges <bridges.anson@gmail.com> | 2025-08-22 12:46:04 -0700 |
|---|---|---|
| committer | Anson Bridges <bridges.anson@gmail.com> | 2025-08-22 12:46:04 -0700 |
| commit | 64f37f4209d80bfad976dd4a139c98002caef15f (patch) | |
| tree | 94c91953986e960573ae0092f8ad7120c1c266f0 /network/websocket_client_basic.gd | |
| parent | 255fbf19cc9499ef384d41f68515da5e49e8a3ce (diff) | |
Diffstat (limited to 'network/websocket_client_basic.gd')
| -rw-r--r-- | network/websocket_client_basic.gd | 5 |
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() |
