quick fix

This commit is contained in:
Milo
2025-10-20 14:09:32 +02:00
parent 2cb159b91b
commit d93c3c063a
2 changed files with 7 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
// --- Constants for Deck Creation ---
import {sleep} from "openai/core";
import {emitSolitaireUpdate, emitUpdate} from "../server/socket.js";
const SUITS = ['h', 'd', 's', 'c']; // Hearts, Diamonds, Spades, Clubs
const RANKS = ['A', '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K'];
@@ -353,10 +354,11 @@ export async function autoSolveMoves(gameState) {
sourcePileType: 'tableauPiles',
userId: gameState.userId,
}
moveCard(gameState, moveData);
moveCard(gameState, moveData)
emitSolitaireUpdate(gameState.userId, moveData);
moved = true;
await sleep(500); // Pause for visualization
//TODO: maybe needs an emit here to update clients?
}
}
} while (moved)//(foundations.reduce((acc, pile) => acc + pile.length, 0));

View File

@@ -344,4 +344,6 @@ export async function emitPokerToast(data) {
}
export const emitUpdate = (type, room) => io.emit("blackjack:update", { type, room });
export const emitToast = (payload) => io.emit("blackjack:toast", payload);
export const emitToast = (payload) => io.emit("blackjack:toast", payload);
export const emitSolitaireUpdate = (userId, moveData) => io.emit('solitaire:update', {userId, moveData});