From 1876038d828b8849c19914e6dcade5acf886f049 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Fri, 11 Nov 2022 17:32:03 +0100 Subject: [PATCH] Reached "invalid standard map" with a few hax --- lib/teeworlds_server.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/teeworlds_server.rb b/lib/teeworlds_server.rb index f37baf9..c536dea 100644 --- a/lib/teeworlds_server.rb +++ b/lib/teeworlds_server.rb @@ -108,7 +108,7 @@ class TeeworldsServer def send_ctrl_with_token(addr, token) msg = [NET_CTRLMSG_TOKEN] + str_bytes(@server_token) - @netbase.peer_token = token.pack('C*') + @netbase.peer_token = token @netbase.send_packet(msg, 0, control: true, addr:) # @netbase.peer_token = @server_token end @@ -156,7 +156,8 @@ class TeeworldsServer def on_ctrl_token(packet) u = Unpacker.new(packet.payload[1..]) token = u.get_raw(4) - # puts "got token #{token.map { |b| b.to_s(16).rjust(2, '0') }.join('')}" + token = token.map { |b| b.to_s(16).rjust(2, '0') }.join + puts "got token #{token}" send_ctrl_with_token(packet.addr, token) end