A teeworlds 0.7 network protocol library written in ruby
Go to file
2022-11-04 16:57:50 +01:00
docs Stabilize api yikes 2022-11-04 16:57:50 +01:00
examples Stabilize api yikes 2022-11-04 16:57:50 +01:00
lib Stabilize api yikes 2022-11-04 16:57:50 +01:00
.gitignore Decompress packet payload 2022-10-25 20:17:07 +02:00
Gemfile Decompress packet payload 2022-10-25 20:17:07 +02:00
README.md Stabilize api yikes 2022-11-04 16:57:50 +01:00
sample.rb Proper chat message support 2022-11-04 16:26:24 +01:00

teeworlds-client

A teeworlds 0.7 client library written in ruby

Sample

Here a simple sample usage of the library. Connecting a client to localhost on port 8303. And printing out every chat message the server sends. Also properly disconnect when the program is killed gracefully.

For more sample usages checkout the examples/ folder.

require_relative 'lib/teeworlds-client'

client = TeeworldsClient.new(verbose: false)

client.hook_chat do |msg|
  puts "[chat] #{msg}"
end

Signal.trap('INT') do
  client.disconnect
end

client.connect('localhost', 8303, detach: false)

Documentation

Checkout docs/01.md for a full library documentation.