• Mahmoud Aglan's avatar
    fix: chess reconnection loads server FEN + opponent profile fetched from match data · 4704435b
    Mahmoud Aglan authored
    Problem 1: Reconnection reset board to starting position
    - engine.create() always starts fresh
    - FIX: if params.recovered, fetch match from server → engine.load(current_fen)
    - Also restores clock times + determines whose turn from FEN
    
    Problem 2: Opponent name stuck on 'جاري التحميل'
    - params.opponentId was undefined (not passed on reconnect or matchmaking)
    - FIX: if no opponentId in params, fetch match → get white/black_player_id → find opponent
    - Uses fetchAndRenderOpponent() helper to update avatar/name/level
    
    Problem 3: Other player can't see moves after reconnect
    - This was because board reset to start position
    - Now board loads current_fen from server → correct position displayed
    - Polling continues from correct move_count
    Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
    4704435b
Name
Last commit
Last update
.claude Loading commit data...
ChessPieces Loading commit data...
Connections and docs Loading commit data...
Logo El3ab Loading commit data...
admin Loading commit data...
api Loading commit data...
app icons Loading commit data...
config Loading commit data...
docs Loading commit data...
includes Loading commit data...
ludo-playtest Loading commit data...
public Loading commit data...
screenshots Loading commit data...
.gitignore Loading commit data...
.htaccess Loading commit data...
ARCHITECTURE.md Loading commit data...
ASSET_REGISTRY.json Loading commit data...
ASSET_REGISTRY.md Loading commit data...
BUILD_ORDER.md Loading commit data...
DATABASE_REFERENCE.md Loading commit data...
DESIGN.md Loading commit data...
Dockerfile Loading commit data...
PLAN.md Loading commit data...
Stockfishbotsapi.txt Loading commit data...
bell.png Loading commit data...
captain-definition Loading commit data...
index.php Loading commit data...