-
Open a websocket connection to server, gets auto-assigned to new room with random PIN.
Reply:
{ "event": "room", "data": { "id": "1584", "player1": { "score": 0 } } } -
Give PIN to player 2, wait until player 2 connects. Once that happens the following message is received:
{ "event": "room", "data": { "id": "1584", "player1": { "score": 0 }, "player2": { "score": 0 } } }
-
Open a websocket connection to server, gets auto-assigned to new room with random PIN.
Reply:
{ "event": "room", "data": { "id": "7582", "player1": { "score":0 } } } -
Get PIN from player 1, send the following message to join player 1's room:
{ "event": "join", "data": { "id": "1584" } }
Send the following event:
{
"event": "point",
"data": {
"id":"1584",
"playerKey":"player2",
"score":3
}
}
idis the room ID (PIN code)playerKeyis the player whose score to updatescoreis the new score