• Mahmoud Aglan's avatar
    feat: realtime multiplayer system for Chess and Ludo · e1001508
    Mahmoud Aglan authored
    New core module: realtime.js
    - WebSocket connection to Supabase Realtime
    - Auto-reconnect on disconnect (3s retry)
    - Heartbeat every 30s
    - Subscribe to any table row by filter
    - subscribeMatch(), subscribeLudoMatch(), subscribeQueue() helpers
    - Unsubscribe cleanup on leave
    
    Chess live (logic/live.js) rewritten:
    - startMatchmaking() — joins queue + subscribes for match found
    - joinMatch() — subscribes to match row, fires onMove/onStateChange
    - sendMove() — updates match with fen, move, move_count
    - sendResign(), sendDrawOffer(), sendEmote()
    - Properly increments move_count for realtime detection
    
    Ludo live (logic/live.js) new:
    - joinMatch() — subscribes to ludo_matches row
    - sendRoll() — updates positions, current_turn, dice_value
    - sendEnd() — marks game complete
    
    API game.php updated:
    - handleGameMove now supports: move_count, game_state, time remaining
    - All fields optional (only updates what's sent)
    - updated_at timestamp on every move (triggers realtime broadcast)
    
    Architecture: Player A updates row → Supabase broadcasts → Player B receives
    Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
    e1001508
Name
Last commit
Last update
.claude Loading commit data...
Connections and docs Loading commit data...
admin Loading commit data...
api Loading commit data...
config Loading commit data...
docs Loading commit data...
includes 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...
captain-definition Loading commit data...
index.php Loading commit data...