• Mahmoud Aglan's avatar
    fix: auto-reconnect on homepage + auto-close match after 30s inactivity · c6478774
    Mahmoud Aglan authored
    Player reconnection:
    - On app boot, checks localStorage for active match
    - Verifies match is still 'in_progress' on server before rejoining
    - If match ended/aborted → clears recovery, goes to homepage
    - If server unreachable → tries to rejoin anyway (optimistic)
    
    Match auto-close:
    - handleGet() checks updated_at timestamp on every poll
    - If match hasn't been updated in 30+ seconds → both players inactive
    - Server marks match as 'completed' with result 'aborted'
    - Next player who polls sees status='completed' → game ends cleanly
    - Prevents zombie matches lingering forever
    
    Flow:
    1. Both players disconnect → no pings → updated_at goes stale
    2. After 30s, if either player comes back and polls → server closes match
    3. Match shows as 'aborted' → player sees 'game ended' UI
    4. If only one player comes back within 30s → they keep playing (match alive)
    Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
    c6478774
Name
Last commit
Last update
..
achievements.php Loading commit data...
activity.php Loading commit data...
analysis.php Loading commit data...
auth.php Loading commit data...
avatar.php Loading commit data...
battlepass.php Loading commit data...
bots.php Loading commit data...
branding.php Loading commit data...
challenges.php Loading commit data...
config.php Loading commit data...
daily-reward.php Loading commit data...
domino.php Loading commit data...
friends.php Loading commit data...
game.php Loading commit data...
leaderboard.php Loading commit data...
ludo-match.php Loading commit data...
ludo.php Loading commit data...
match-history.php Loading commit data...
matchmaking.php Loading commit data...
multiplayer.php Loading commit data...
notifications.php Loading commit data...
orgs.php Loading commit data...
profile.php Loading commit data...
puzzles.php Loading commit data...
ratings.php Loading commit data...
shop.php Loading commit data...
swiss.php Loading commit data...
theme.php Loading commit data...
tournaments.php Loading commit data...