Multiplayer mahjong
JavaScript
Pull request Compare This branch is 68 commits behind masylum:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
maps
public
views
.gitignore
README.md
app.js
default.conf.js
game.js
package.json

README.md

Whatajong

This is an example of an html5 multiplayer game with nodejs and socket.io.

Installation

git clone https://github.com/masylm/whatajong
npm install
cp default.conf.js conf.js

Edit the conf.js file with your specific configuration and you are ready to go!

How does it work?

Half the game work in the client, and the other half in the server. Both parts are communciated via socket.io exchanging events and state.

.-----------.                   .-------------.
| Server    |                   | Browser 1   |
+-----------+                   +-------------+
|           |                   |             |
|           | <=== Events ======| public/js/* |
|           |                   |             |
|           |                   '-------------'
|           |
| serverjs  |===== State (broadcast) ====>
|           |
|           |                   .-------------.
|           |                   | Browser n   |
|           |                   +-------------+
|           |                   |             |
|           | <=== Ecents ======| public/js/* |
|           |                   |             |
'-----------'                   '-------------'