A simulation container based on Celluloid
Ruby JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
examples
lib
log
node
spec
tasks
tmp/sockets
.gitignore
.gitkeep
.rspec
.ruby-version
.travis.yml
Gemfile
Gemfile.lock
Guardfile
LICENSE.txt
README.md
Rakefile
Simulator.gemspec
circle.yml

README.md

Readme

Build Status Code Climate

A simulation container based on Celluloid.

Usage

Example

routes:

Sim::Net::Router.define do |router|

  router.forward :test, to: Example::SimpleHandler # allow everybody

  router.forward :admin, to: Example::SimpleHandler do |player_id|
    player_id.to_i == 123
  end

end

####JSON API

{sope: 'test', action: 'reverse', args: 'hello world'}

Examples

see examples directory

Requirements

  • ruby 2.3.x
  • node 6.9.x

Install

sim server:

$> bundle

middleware:

$> cd examples/node
$> npm install
$> webpack

Run Examples

sim server:

$> ruby examples/server/boot.rb

middleware:

$> node --harmony examples/node/app.js

Development

create a npm link to have all the recent changes in the examples

in folder node issue: $>npm link

then in examples/node create the sym link like so: $>npm link simulator-middleware

Testing

for better output comment out Celluloid.logger = nil in spec_helper.rb

Debug PlayerServer

test unix socket with netcat:

$> nc -U tmp/sockets/pong.sock