(dependencies): Updated socket.io and socket.io-client to 4.8.2, along with other dependency upgrades
This commit is contained in:
parent
dc62f3a98e
commit
39f71bb4d9
1 changed files with 3 additions and 2 deletions
|
|
@ -7,7 +7,6 @@ import * as auth from '@shared/auth';
|
||||||
import * as swagger from '@shared/swagger';
|
import * as swagger from '@shared/swagger';
|
||||||
import * as utils from '@shared/utils';
|
import * as utils from '@shared/utils';
|
||||||
import { Server } from 'socket.io';
|
import { Server } from 'socket.io';
|
||||||
import type { TicTacToeImpl } from '@shared/database/mixin/tictactoe';
|
|
||||||
|
|
||||||
declare const __SERVICE_NAME: string;
|
declare const __SERVICE_NAME: string;
|
||||||
|
|
||||||
|
|
@ -78,12 +77,14 @@ async function onReady(fastify: FastifyInstance, game: TTC) {
|
||||||
socket.emit('error', 'Invalid Move');
|
socket.emit('error', 'Invalid Move');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (result !== 'ongoing') {
|
||||||
|
fastify.db.setGameOutcome('011001', 'Aless', 'Clara', result);
|
||||||
|
}
|
||||||
fastify.io.emit('gameState', {
|
fastify.io.emit('gameState', {
|
||||||
board: game.board,
|
board: game.board,
|
||||||
turn: game.currentPlayer,
|
turn: game.currentPlayer,
|
||||||
lastResult: result,
|
lastResult: result,
|
||||||
});
|
});
|
||||||
fastify.db.setGameOutcome("011001", result);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue