From 62b28beed31ef966b5402579f3b51e8e8a33c01b Mon Sep 17 00:00:00 2001 From: DeNNiiInc Date: Mon, 22 Dec 2025 18:09:55 +1100 Subject: [PATCH] Fix: Add opponentId to game_started events for surrender/rematch functionality - Added opponentId field to both game_started socket emissions in acceptChallenge - This allows client to properly track opponent for rematch requests - Fixes surrender button not showing issue (client needs opponentId to enable features) --- gameManager.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gameManager.js b/gameManager.js index 72a9631..011abb3 100644 --- a/gameManager.js +++ b/gameManager.js @@ -236,6 +236,7 @@ class GameManager { this.io.to(challengerSocket).emit('game_started', { gameId: gameId, opponent: challenge.targetUsername, + opponentId: challenge.targetId, yourSymbol: gameData.player1Symbol, boardSize: challenge.boardSize, yourTurn: true @@ -245,6 +246,7 @@ class GameManager { this.io.to(socket.id).emit('game_started', { gameId: gameId, opponent: challenge.challengerUsername, + opponentId: challenge.challengerId, yourSymbol: gameData.player2Symbol, boardSize: challenge.boardSize, yourTurn: false