Opsi mixup in example (i should start testing those)
This commit is contained in:
parent
db106ba70e
commit
3810a333f7
|
@ -5,14 +5,14 @@ require_relative '../lib/teeworlds-client'
|
||||||
client = TeeworldsClient.new
|
client = TeeworldsClient.new
|
||||||
|
|
||||||
client.on_client_info do |ctx|
|
client.on_client_info do |ctx|
|
||||||
unless ctx.data[:silent]
|
|
||||||
reason = ctx.data[:reason] ? " (#{ctx.data[:reason]})" : ''
|
|
||||||
puts "'#{ctx.data[:player].name}' joined the game#{reason}"
|
puts "'#{ctx.data[:player].name}' joined the game#{reason}"
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
client.on_client_drop do |ctx|
|
client.on_client_drop do |ctx|
|
||||||
puts "'#{ctx.data[:player].name}' has left the game"
|
unless ctx.data[:silent]
|
||||||
|
reason = ctx.data[:reason] ? " (#{ctx.data[:reason]})" : ''
|
||||||
|
puts "'#{ctx.data[:player].name}' left the game#{reason}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Signal.trap('INT') do
|
Signal.trap('INT') do
|
||||||
|
|
Loading…
Reference in a new issue