handle invalid move exceptioin & support promotion

This commit is contained in:
Nathaniel Tampus
2023-01-16 14:36:55 +08:00
parent f108262622
commit e823fb15e9
2 changed files with 28 additions and 21 deletions

View File

@@ -127,7 +127,7 @@ export async function sendMove(this: Socket, m: { from: string; to: string; prom
this.emit("receivedLatestGame", game);
} else {
game.pgn = chess.pgn();
this.to(game.code as string).emit("receivedMove", { from: m.from, to: m.to });
this.to(game.code as string).emit("receivedMove", m);
}
}