Make server log look nice in non verbose mode
This commit is contained in:
parent
3358cc6608
commit
fc48a53bbd
|
@ -68,6 +68,8 @@ class GameServer
|
|||
packet.client.in_game = true
|
||||
@server.send_server_info(packet.client, ServerInfo.new.to_a)
|
||||
@server.send_game_info(packet.client, GameInfo.new.to_a)
|
||||
|
||||
puts "'#{packet.client.player.name}' joined the game"
|
||||
end
|
||||
|
||||
def on_rcon_cmd(chunk, _packet)
|
||||
|
|
|
@ -76,7 +76,7 @@ class NetBase
|
|||
|
||||
header += str_bytes(@peer_token)
|
||||
data = (header + payload).pack('C*')
|
||||
puts "send to #{ip}:#{port}"
|
||||
puts "send to #{ip}:#{port}" if @verbose
|
||||
@s.send(data, 0, ip, port)
|
||||
|
||||
puts Packet.new(data, '>').to_s if @verbose || opts[:test]
|
||||
|
|
|
@ -115,7 +115,7 @@ class TeeworldsServer
|
|||
on_message(chunk, packet)
|
||||
return
|
||||
end
|
||||
puts "proccess chunk with msg: #{chunk.msg}"
|
||||
puts "proccess chunk with msg: #{chunk.msg}" if @verbose
|
||||
case chunk.msg
|
||||
when NETMSG_INFO
|
||||
@game_server.on_info(chunk, packet)
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
|
||||
require_relative 'lib/teeworlds_server'
|
||||
|
||||
srv = TeeworldsServer.new(verbose: true)
|
||||
srv = TeeworldsServer.new(verbose: false)
|
||||
srv.run('127.0.0.1', 8303)
|
||||
|
|
Loading…
Reference in a new issue