Skip to content

Commit

Permalink
add validation for column
Browse files Browse the repository at this point in the history
  • Loading branch information
SneakySensei committed Sep 7, 2024
1 parent 327607d commit b9f5224
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ export const ConnectFourRoutes = async (socket: Socket, io: Namespace) => {
return;
}

// validate invalid move
if (move.column < -1 || move.column >= ConnectFour.columnCount)
return;

if (gameState.winner_id) {
return;
}
Expand Down

0 comments on commit b9f5224

Please sign in to comment.