Print rcon commands sent by the client

This commit is contained in:
ChillerDragon 2022-11-12 15:46:38 +01:00
parent 11898d0f41
commit 6d7bd0371d
2 changed files with 8 additions and 0 deletions

View file

@ -63,6 +63,12 @@ class GameServer
@server.send_game_info(packet.client, GameInfo.new.to_a)
end
def on_rcon_cmd(chunk, packet)
u = Unpacker.new(chunk.data[1..])
cmd = u.get_string
puts "got rcon_cmd=#{cmd}"
end
def on_input(chunk, packet)
# vanilla server responds to input with 2 chunks
# - input_timing

View file

@ -106,6 +106,8 @@ class TeeworldsServer
@game_server.on_enter_game(chunk, packet)
when NETMSG_INPUT
@game_server.on_input(chunk, packet)
when NETMSG_RCON_CMD
@game_server.on_rcon_cmd(chunk, packet)
else
puts "Unsupported system msg: #{chunk.msg}"
exit(1)