feat(tour): better frontend for tournament start phase, and auto start after X seconds

This commit is contained in:
Maieul BOYER 2026-01-10 17:43:04 +01:00 committed by Maix0
parent 3c95af8ede
commit 901e3e5a8e
6 changed files with 140 additions and 42 deletions

View file

@ -32,7 +32,7 @@ export type GameMove = {
export type TourInfo = {
ownerId: string;
state: 'prestart' | 'playing' | 'ended';
state: 'prestart' | 'playing' | 'ended' | 'canceled';
players: { id: string; name: string; score: number }[];
currentGameInfo: GameUpdate | null;
};
@ -42,17 +42,19 @@ export interface ClientToServer {
dequeue: () => void;
readyUp: () => void;
readyDown: () => void;
debugInfo: () => void;
gameMove: (up: GameMove) => void;
connectedToGame: (gameId: string) => void;
localGame: () => void;
hello: () => void;
// TOURNAMENT
tourRegister: () => void;
tourUnregister: () => void;
tourCreate: () => void;
tourStart: () => void;
}
export interface ServerToClient {
@ -74,6 +76,8 @@ export interface ServerToClient {
msg?: string;
}) => void;
tournamentInfo: (info: TourInfo | null) => void;
tourEnding: (msg: string) => void;
}
export type SSocket = Socket<ClientToServer, ServerToClient>;