teletilting
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user