diff --git a/lib/game_server.rb b/lib/game_server.rb index db6debb..e75d9cc 100644 --- a/lib/game_server.rb +++ b/lib/game_server.rb @@ -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) diff --git a/lib/net_base.rb b/lib/net_base.rb index 4a8747a..b25b58d 100644 --- a/lib/net_base.rb +++ b/lib/net_base.rb @@ -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] diff --git a/lib/teeworlds_server.rb b/lib/teeworlds_server.rb index 56f0dd3..3acdc0f 100644 --- a/lib/teeworlds_server.rb +++ b/lib/teeworlds_server.rb @@ -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) diff --git a/server_sample.rb b/server_sample.rb index 4fc73ee..1abe7f2 100755 --- a/server_sample.rb +++ b/server_sample.rb @@ -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)