diff options
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() |
