Skip to content

Feature/chess#78

Open
gaganalexa wants to merge 5 commits into
mainfrom
feature/chess
Open

Feature/chess#78
gaganalexa wants to merge 5 commits into
mainfrom
feature/chess

Conversation

@gaganalexa
Copy link
Copy Markdown
Collaborator

F501 + F502 + F503: Chess Game Implementation

Implemented the complete multiplayer chess feature, including gameplay UI, real-time synchronization, and multiple integration fixes discovered during development.

Features Implemented

  • Custom chessboard with:

    • Drag-and-drop piece movement
    • Legal move highlighting
    • Captured pieces display
    • Move history tracking
  • Full game interface with:

    • Player clocks
    • Game alerts/status handling
    • Draw offer modal
    • Resign functionality
  • Multiplayer support with:

    • Lobby and room matching
    • Real-time gameplay using sockets

Logic & Integration Fixes

  • Fixed isBoardDisabled logic to allow moves while in "check" state instead of incorrectly disabling the board

  • Fixed deriveStatus evaluation order to check for checkmate before stalemate/draw conditions

  • Fixed getMaterialAdvantage FEN parsing issue where uppercase pieces were skipped due to case-sensitive includes() checks, causing incorrect captured piece counts

  • Fixed capturedColor prop mismatch in GameScreen where player/opponent captured pieces were displayed on the wrong side

  • Fixed duplicate game:move socket emissions by restricting emission to the active player through proper playerColor validation in makeMove

  • Fixed clock initialization issue where backend time values were sent in milliseconds while frontend expected seconds

  • Fixed missing persistence fields in createGame:

    • white_time_left
    • black_time_left
    • last_move_at

    This previously caused immediate timeout behavior after the first move

  • Fixed updateGameState partial update handling to prevent unspecified fields from being overwritten with null

  • Fixed database capture column type mismatch where the schema expected boolean but the application passed captured piece identifiers

gaganalexa added 5 commits May 6, 2026 13:19
- Added chess event handlers for game actions (start, resign, draw) in backend.
- Implemented socket connection management for chess screens in frontend.
- Enhanced game state management with draw offer handling and clock synchronization.
- Updated Zustand store to include socket management and game state.
- Refactored game and room screens to utilize new socket functionality.
- Added chess.js library for chess logic handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant