Ruby binding for SmartFox’s client. docs2x.smartfoxserver.com/api-docs/javadoc/client/
Gem | Source | Documentation
Add this line to your application’s Gemfile:
gem'rubyfox-client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rubyfox-client
require'rubyfox/client'ARGV.size==3orabort"usage: simple.rb username password zone"Rubyfox::Client.boot!# optionaloptions = { host:'127.0.0.1', debug:true } client = Rubyfox::Client.new(options) client.on_event:connectiondo|event|p:connected!client.send:login, *ARGVendclient.on_event:logindo|event|p:login=>event.params[:zone] client.disconnectendclient.on_event:login_errordo|event|p:login_failedclient.disconnectendclient.on_event:connection_lostdo|event|p:disconnectedclient.exitendclient.connect
See github.com/neopoly/rubyfox-client/tree/master/examples for more examples.
Tests!
Fork it
Create your feature branch (‘git checkout -b my-new-feature`)
Commit your changes (‘git commit -am ’Add some feature’‘)
Push to the branch (‘git push origin my-new-feature`)
Create new Pull Request