teeworlds_network/server_sample.rb

15 lines
281 B
Ruby
Raw Normal View History

2022-11-08 15:20:46 +00:00
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative 'lib/teeworlds_server'
2022-11-08 15:20:46 +00:00
srv = TeeworldsServer.new(verbose: false)
2024-01-20 13:39:21 +00:00
srv.on_chat do |context, msg|
context.cancel
puts "[chat] #{msg.author.name}: #{msg.message}"
end
2024-01-20 13:50:55 +00:00
srv.run('127.0.0.1', 8303, detach: false)