mirror of
https://github.com/DeNNiiInc/Connect-5.git
synced 2026-04-17 20:36:00 +00:00
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)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user