Update/add file headers for documentation purposes
This commit is contained in:
parent
d204378ea5
commit
1380a7919b
3 changed files with 16 additions and 2 deletions
|
|
@ -1,6 +1,9 @@
|
|||
/*
|
||||
Get's the current player list. This is only really used by the host. This is
|
||||
almost never called by the client itself
|
||||
|
||||
Emissions:
|
||||
PlayerListResponse->sender - Sends the list of players to the client
|
||||
*/
|
||||
import * as db from '../utils/db';
|
||||
import { Socket } from 'socket.io';
|
||||
|
|
|
|||
|
|
@ -3,8 +3,9 @@ Starts a game on the server, this also acts as the `JoinGame` event for the
|
|||
host, except that it doesn't send any events out to other players as there
|
||||
are none yet.
|
||||
|
||||
This will also emit the `HostInformation` event to the host client, which will
|
||||
allow us to send them information about what the game code is
|
||||
Emissions:
|
||||
HostInformation - Data containing if the game created successfully or not
|
||||
and the game code for the game if it was successful.
|
||||
|
||||
Client Side: After the host receives the `HostInformation` event, the Query
|
||||
String parameters should be updated with the Websocket URI and the game code so
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
/*
|
||||
Connects to an already existing game on the server.
|
||||
|
||||
Emissions:
|
||||
NewPlayer->A!sender - This event is sent to other players who are in
|
||||
the lobby to allow them to update their view so that they see all the
|
||||
players in the lobby at all times.
|
||||
GameJoined->sender - Sent to the client to tell them the current list of
|
||||
players and that they were added to the game either successfully or not
|
||||
*/
|
||||
import { Socket } from 'socket.io';
|
||||
export const JoinGame = (socket: Socket, data: JoinGame) => {
|
||||
console.log(`User: ${data.username} (${data.game_code})`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue