8000 GitHub - gregorybesson/colyseus: Minimalistic MMO Game Server for Node.js.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gregorybesson/colyseus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

colyseus

Join the chat at https://gitter.im/gamestdio/colyseus Build Status

Minimalistic MMO Game Server for Node.js.

Live demos:

Features

  • WebSocket-based communication
  • Match-making
  • Binary data transfer (through msgpack)
  • Delta-encoded state broadcasts (through fast-json-patch - RFC6902)

TODO:

  • delay/lag compensation
  • "area of interest" updates/broadcasts

Room API

Callbacks

  • onJoin (client) - when a client joins the room
  • onLeave (client) - when a client leaves the room
  • onMessage (client, data) - when a client send a message
  • dispose () - cleanup callback, called after there's no more clients on the room

Methods

  • lock() - lock the room to new clients
  • unlock() - unlock the room to new clients
  • send(client, data) - send data to a particular client
  • broadcast(data) - send data to all connected clients
  • sendState(client) - send current state to a particular client
  • broadcastState() - send current state to all clients
  • broadcastPatch() - send patched (diff) state to all clients (called automatically at configurable interval)
  • disconnect() - disconnect all clients then dispose

Production usage

It's recommended to use a process manager to ensure the server will reload in case your application goes down.

pm2 start server.js --node-args="--harmony"

Redirect port 80 to target deployment port (e.g. 3000), to avoid running harmful code as sudoer: (read more)

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000

License

MIT

About

Minimalistic MMO Game Server for Node.js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%
0