teletilting

This commit is contained in:
Gavin McDonald
2025-06-27 18:14:06 -04:00
parent a0e4f54ed9
commit 2ae4c6a77b
7 changed files with 93 additions and 38 deletions

View File

@@ -119,10 +119,10 @@ app.prepare().then(() => {
}
});
socket.on('tilt', ({ gameID, tilt }: { gameID: string; tilt: Tilt }) => {
socket.on('tilt', ({ cardIndex, tilt }: { cardIndex: number; tilt: Tilt }) => {
try {
const gameState = gameStore.getGame(gameID);
broadcast('tilt', gameState);
const gameState = gameStore.tilt(socket.id, cardIndex, tilt);
broadcast('game-update', gameState);
} catch (e) {
const error = e instanceof Error ? e.message : e;
console.error(Date.now(), 'Error[tilt]', error);