Show explicit blackjack settlements across the stack
All checks were successful
CI / Deploy / test (push) Successful in 1m18s
CI / Deploy / deploy (push) Successful in 1m4s

- Replace round payout multipliers with per-player settlement amounts
- Update blackjack panel to display wager, payout, and net results
This commit is contained in:
syntaxbullet
2026-04-10 11:03:58 +02:00
parent f796cac6be
commit de15cb4206
11 changed files with 754 additions and 674 deletions

View File

@@ -8,7 +8,7 @@ interface PlayerInfo {
}
interface RoundResult {
payouts: Record<string, { net: number }>;
settlements: Record<string, { wager: number; payout: number; net: number }>;
}
interface GameRoomState {
@@ -99,7 +99,15 @@ export function useGameRoom(roomId: string, userId: string, role?: string, prefe
case "GAME_UPDATE":
// Broadcast with spectator view — only update state for spectators
setState(prev => prev.isSpectator ? { ...prev, gameState: msg.state } : prev);
setState(prev => {
if (!prev.isSpectator) return prev;
const phase = (msg.state as any)?.phase;
return {
...prev,
gameState: msg.state,
roundResult: phase === "betting" ? null : prev.roundResult,
};
});
break;
case "PLAYER_JOINED":
@@ -135,7 +143,7 @@ export function useGameRoom(roomId: string, userId: string, role?: string, prefe
case "ROUND_SETTLED":
setState(prev => ({
...prev,
roundResult: { payouts: msg.payouts },
roundResult: { settlements: msg.settlements },
}));
break;