From efadf96e5f803d9e1bb8cf888ffa2af5801dfe20 Mon Sep 17 00:00:00 2001 From: Joe Klauza Date: Sun, 2 Apr 2023 12:39:08 -0400 Subject: [PATCH] Fix array pack string slice Adjust by two characters instead of one to account for endian ordering character as well Fixes warning in Ruby 3.2 that will be an error in Ruby 3.3 --- admin-interface/lib/rcon-client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-interface/lib/rcon-client.rb b/admin-interface/lib/rcon-client.rb index 17003cf..f3f0e6b 100644 --- a/admin-interface/lib/rcon-client.rb +++ b/admin-interface/lib/rcon-client.rb @@ -172,7 +172,7 @@ def build_packet(body, type=2, id=1, hide_content: false) packet_body = body packet_empty_string = '' packet = [packet_id, packet_type, packet_body, packet_empty_string] # Skip size for now - size = packet.pack(@@pack_string[1..]).length # Get packet size by packing what we have and checking length. + size = packet.pack(@@pack_string[2..]).length # Get packet size by packing what we have and checking length. packet.unshift(size) # log "Packet: " << packet.inspect packed = packet.pack(@@pack_string)