xl4624/multiplayer-chess

When someone resigns, the game doesn't technically end

Closed this issue · 2 comments

When a player resigns from the game, they can still go back to the same link and continue playing. Should we have some sort of field for Game that's like if the game is active or not? And if it isn't then don't allow any moves? What do you guys think? @kcao20 @austinngan

I'm thinking about modifying this, since I'm assuming chess.js handles draws, checkmates, stalemates, etc... in isGameOver() so we just need to add one more condition

function onDragStart(source, piece, position, orientation) {
    if (game.isGameOver() === true ||
        (game.turn() === 'w' && piece.search(/^b/) !== -1) ||
        (game.turn() === 'b' && piece.search(/^w/) !== -1)) {
        return false;
    }
}
Screen.Recording.2024-01-07.at.11.44.36.PM.mov

I'll work on this after #24 is completed