From 2273a9824aa2a15ab41fbee008f3411a304da578 Mon Sep 17 00:00:00 2001 From: Hartmut Seichter Date: Fri, 27 Jun 2025 12:24:18 +0200 Subject: [PATCH] WIP --- SocketClient.gd | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/SocketClient.gd b/SocketClient.gd index 7d73917..d0b4924 100644 --- a/SocketClient.gd +++ b/SocketClient.gd @@ -31,7 +31,7 @@ func _process(delta: float) -> void: if new_status == _stream.STATUS_CONNECTED: var available_bytes: int = _stream.get_available_bytes() if available_bytes > 0: - print("available bytes: ", available_bytes) + #print("available bytes: ", available_bytes) var res = _stream.get_partial_data(available_bytes) if res[0] != OK: emit_signal("error") @@ -59,18 +59,19 @@ func _on_data(data : Array): var bytes = PackedByteArray(data) var as_cookie = bytes.get_string_from_ascii() - # Cookie Hack! if as_cookie.begins_with("vrpn: ver."): - print("VRPN magic cookie '{0}'".format([as_cookie])) + #print("VRPN magic cookie '{0}'".format([as_cookie])) + # kaboom we just send back the same cookie :) self.send(bytes) else: - if true: - var header_bytes = bytes.slice(0,24) - var header_i32 = header_bytes.to_int32_array() - #var vrpn_h = VRPN_Header.new(header_bytes) - print(header_i32) - print(header_bytes) + # non-cookie messages + var header_bytes = bytes.slice(0,24) + var header_i32 = header_bytes.to_int32_array() + #var vrpn_h = VRPN_Header.new(header_bytes) + #print(header_i32) + #print(header_bytes) + print(bytes) func _on_connected(s : StreamPeerTCP): print("Connected to",s.get_connected_host()) # Replace with function body.