Conversation
Changes added on top of this PRPrivate roomsAdded a room-based flow as an alternative to the automatic matchmaking queue. Players can now create a private game and share a 6-character code with a specific opponent instead of being paired randomly. Backend (
Frontend (
Host color selectionThe room creator can now choose whether to play as player 1 (first move) or player 2 in the game config screen. When The "Your color" selector in Game history result fix
i18nAdded Production nginxResolved a merge conflict in |
que nadie se ria |
|



♟️ Online Multiplayer (pvp-online)
This PR implements real-time online multiplayer for Game Y, including matchmaking, WebSocket communication, game history for both players, and connection resilience.
✨ Features
Matchmaking & Lobby
Real-time gameplay via WebSocket
join_game/leave_gamemessages so the server knows which room each client is inDisconnection & Reconnection
join_gameis re-sent automatically so the server can resume relaying movesleave_gameis only sent on intentional navigation away, not on page reloadGame History
GET /api/gamesnow returns games for bothplayer1Idandplayer2Id, merged and sorted byupdatedAt DESCStats & Ranking
pvp-onlinemode feeds into the ranking leaderboard🔧 Backend changes
WebSocketManager.tsjoin_queue,leave_queue,join_game,leave_game,move,surrender; disconnect grace period with auto-forfeitMatchmakingService.tsjoin,leave,tryMatch,contains,size,clearGameService.getUserGamesplayer1Idandplayer2Id, deduplicates, sorts, trims to 50GameService.setPlayer2IdGameController.getGamesGameSummary[]without board/moves/timergameRoutesGET /api/games(authenticated)🖥️ Frontend changes
websocketService.tsreconnectedevent;disconnect()cancels reconnectuseOnlineLobbyController.tsleave_queueon unmount when already matcheduseGameYController.tsgame_update,opponent_disconnected,opponent_reconnected; re-sendsjoin_gameon WS reconnect;handleGoHomesendsleave_gameexplicitlyGameYPage.tsxhandleGoHometo overlay; opponent disconnected bannerOnlineLobbyPage.tsxGameHistoryPage.tsxuseGameHistoryController.tsGET /api/gameswith auth tokengameyService.tsgetUserGames(token)calls the list endpoint