diff --git a/backend/utils/player-count-checker.js b/backend/utils/player-count-checker.js index acbb4a3..15d8f00 100644 --- a/backend/utils/player-count-checker.js +++ b/backend/utils/player-count-checker.js @@ -406,24 +406,20 @@ async function startPlayerCountCheck(sessionId, gameId, roomCode, maxPlayers = 8 return false; } - // If full, we know the count immediately - if (roomStatus.full) { - console.log(`[Player Count] Room is FULL - ${roomStatus.maxPlayers} players`); - updatePlayerCount(sessionId, gameId, roomStatus.maxPlayers, 'completed'); - stopPlayerCountCheck(sessionId, gameId); - return false; - } - // If locked, game has started - ready to watch if (roomStatus.locked) { console.log(`[Player Count] Room is LOCKED - game in progress, starting watch`); - // Return both status and real maxPlayers from Jackbox return { ready: true, maxPlayers: roomStatus.maxPlayers }; } - // Not ready yet - console.log(`[Player Count] Room not ready yet (lobby still open)`); - return null; + // Log if full but not yet started + if (roomStatus.full) { + console.log(`[Player Count] Room is FULL but not locked yet - waiting for game start`); + } else { + console.log(`[Player Count] Room not ready yet (lobby still open)`); + } + + return null; // Not ready, keep polling }; // Wait 10 seconds before first check