feat(dashboard): add matchNumber to track games played per session
Some checks failed
CI/CD - Francia Ocupada (La Resistencia) / build-and-deploy (push) Failing after 7s

This commit is contained in:
Resistencia Dev
2025-12-22 23:24:07 +01:00
parent c4c08c64c3
commit 904bd80bd5
4 changed files with 7 additions and 3 deletions

View File

@@ -252,7 +252,7 @@ export default function Dashboard() {
</div>
{game.currentRound > 0 && (
<div className="bg-white/10 px-3 py-1 rounded text-[10px] font-black uppercase tracking-widest border border-white/10">
Ronda {game.currentRound}
{game.matchNumber > 1 ? `P${game.matchNumber} - R${game.currentRound}` : `Ronda ${game.currentRound}`}
</div>
)}
<ChevronDown

View File

@@ -91,6 +91,7 @@ const getAdminData = async () => {
currentPlayers: g.state.players.length,
maxPlayers: g.maxPlayers,
currentRound: g.state.currentRound,
matchNumber: g.state.matchNumber,
players: g.state.players.map(p => ({ id: p.id, name: p.name }))
}));

View File

@@ -43,7 +43,8 @@ export class Game {
missionHistory: [],
revealedVotes: [],
history: [],
hostId: hostId
hostId: hostId,
matchNumber: 1
};
}
@@ -369,7 +370,8 @@ export class Game {
restartGame() {
this.log('=== REINICIANDO PARTIDA ===');
// Resetear variables de juego
// Incrementar contador de partidas y resetear variables de juego
this.state.matchNumber++;
this.state.currentRound = 1;
this.state.failedVotesCount = 0;
this.state.questResults = [null, null, null, null, null];

View File

@@ -89,6 +89,7 @@ export interface GameState {
winner?: Faction;
history: string[]; // Log de acciones para mostrar en pantalla
matchNumber: number; // Número de partida en esta operación (se incrementa con cada restart)
}
// Configuración de jugadores por partida (según tus reglas)