aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2025-10-23 20:15:37 +0200
committertpart <tpart120@proton.me>2025-10-23 20:15:43 +0200
commit5d627be4a0c59ab3f5682e5f1a96fbb3595ed511 (patch)
tree26d17a3d9f7f626ecb2e4958870a53cce304ffa5 /client
parent1b1a31bb6d59ad7fc10f122a2763115ffd955c31 (diff)
downloadhurrycurry-5d627be4a0c59ab3f5682e5f1a96fbb3595ed511.tar
hurrycurry-5d627be4a0c59ab3f5682e5f1a96fbb3595ed511.tar.bz2
hurrycurry-5d627be4a0c59ab3f5682e5f1a96fbb3595ed511.tar.zst
Only show warning when sending packets while state is not open
Diffstat (limited to 'client')
-rw-r--r--client/multiplayer.gd3
1 files changed, 3 insertions, 0 deletions
diff --git a/client/multiplayer.gd b/client/multiplayer.gd
index d5221b15..26614b14 100644
--- a/client/multiplayer.gd
+++ b/client/multiplayer.gd
@@ -158,6 +158,9 @@ func send_ready():
func send_packet(p):
var json = JSON.stringify(p)
+ if socket.get_ready_state() != WebSocketPeer.State.STATE_OPEN:
+ push_warning("Can not send packet: Socket not open")
+ return
socket.send_text(json)
func decode_packet(bytes: PackedByteArray):