teeworlds_network/lib/game_server.rb

23 lines
521 B
Ruby
Raw Normal View History

2022-11-09 15:46:04 +00:00
# frozen_string_literal: true
class GameServer
attr_accessor :pred_game_tick, :ack_game_tick
def initialize(server)
@server = server
@ack_game_tick = -1
@pred_game_tick = 0
end
def on_info(chunk)
u = Unpacker.new(chunk.data[1..])
net_version = u.get_string
password = u.get_string
client_version = u.get_int
puts "vers=#{net_version} vers=#{client_version} pass=#{password}"
# TODO: respond with map info
# here tho? Check tw code when to send map info
end
end