$ rebar3 shell
open http://localhost:8080/connect4
in 2 browser tabs (one for each player)
- Serves the HTML + JS for the list of games located in
priv
folder - manages the pool of players who joined a specific game, and broadcast each moves.
recv
incoming websocket messageresp
respond to clientbcast
message to a group of clients
- recv
{msg:"players", game: "connect4"}
- resp
{key:"joined", val: "Joe"}
- recv
{msg:"join", game: "connect4", player: "Joe"}
- bcast
{key:"joined", val: "Joe"}
- recv
{msg:"start", players: ["Joe", "Mike"]}
- bcast
{key:"started", val: "56576-767867-6876786-786768"}
"3,4@1" means: 'player 1 moved to coordinates 3,4 on the board'
- recv
{msg:"move", move: "3,4"}
- bcast
{key:"move", val: "3,4@1"}
- recv
{msg:"quit"}
- bcast
{key:"quit", val: "Joe"}