feat: Add 'Test Solo' feature to Cube Manager for randomized deck play, with server support for solo game state on rejoin.

This commit is contained in:
2025-12-17 16:29:12 +01:00
parent e13aa16766
commit 0fb330e10b
6 changed files with 145 additions and 32 deletions

View File

@@ -294,9 +294,16 @@ io.on('connection', (socket) => {
if (currentDraft) socket.emit('draft_update', currentDraft);
}
// Prepare Game State if exists
let currentGame = null;
if (room.status === 'playing') {
currentGame = gameManager.getGame(roomId);
if (currentGame) socket.emit('game_update', currentGame);
}
// ACK Callback
if (typeof callback === 'function') {
callback({ success: true, room, draftState: currentDraft });
callback({ success: true, room, draftState: currentDraft, gameState: currentGame });
}
} else {
// Room found but player not in it? Or room not found?