(tic-tac-toe): Starting work to implement "New Game" button
This commit is contained in:
parent
fc9e10f286
commit
ca9b2a7320
5 changed files with 31 additions and 3 deletions
|
|
@ -28,6 +28,7 @@ export interface ClientToServer {
|
|||
gameMove: (up: GameMove) => void;
|
||||
keepalive: () => void;
|
||||
connectedToGame: (gameId: string) => void;
|
||||
requestNewGame: () => void;
|
||||
};
|
||||
|
||||
export interface ServerToClient {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ export class StateI {
|
|||
socket.on('enqueue', () => this.enqueueUser(socket));
|
||||
socket.on('dequeue', () => this.dequeueUser(socket));
|
||||
socket.on('debugInfo', () => this.debugSocket(socket));
|
||||
// TODO
|
||||
socket.on('requestNewGame', () => this.requestNewGame(socket));
|
||||
|
||||
socket.on('gameMove', (e) => this.gameMove(socket, e));
|
||||
socket.on('keepalive', () => this.keepAlive(socket));
|
||||
|
|
@ -202,6 +204,13 @@ export class StateI {
|
|||
|
||||
game?.makeMove(socket.authUser.id, update.index);
|
||||
}
|
||||
|
||||
// TODO
|
||||
private requestNewGame(socket: SSocket) {
|
||||
void socket;
|
||||
// TODO
|
||||
this.fastify.log.info('===== NEW GAME REQUESTED =====');
|
||||
}
|
||||
}
|
||||
|
||||
// this value will be overriten
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue