Sets the username of the connection string
sets the password of the connection string
Finds all connected client sockets to this room and emits a 'loaded' event. If the game is full, then a 'full' event is emitted.
Finds the requested game room and joins it. When 2 players have joined the room it requests the appropriate application shortcuts list. If such list is found, and both players are still presents, server emits a 'start' game event and then the first 'query' event is also emitted. If the game is full, then a 'full' event is emitted.
Checks if the shortcut combination in the answer is correct and emits a 'progress' event. If the progress of one of the players reaches the length of the shortcuts list, the game ends. Winner is the player with highest score.
Example:
{
"answer": "ctrl+s",
"user": "Player"
}
Notifies the other person in the game room that his partner has left
##Client
Receives game setup.
Example:
{
"players": 1,
"user": "Player",
"id": "id"
}
Occurs when game is started.
Example:
{
"id": "id",
"users": ["Player", "Opponent"],
"total": "11"
}
Occurs when a new query is received.
Example:
{
"query": "Select all text."
}
Reports progress change of a player to all players in the current game room.
Example:
{
"id": "id",
"score": "3",
"user": "Opponent"
}
Indicates end of game and the winner.
Example:
{
"winner": "Player"
}
If a player leaves the game room this event will occur.
Example:
{
"room": "id",
"user": "Player"
}
Indicates that the game is full, and no more players can join it.