Server: - BlindtestRound (GameRound): neutral DJ pick (never the contributor), per-mode scoring (title_artist fuzzy / who_added / mixed), reveal exposes title/artist/submittedBy; contributor doesn't score on own track - track submission: blindtest:submitTrack validates via YouTube oEmbed (exists + embeddable) and captures title/artist; per-player quota; dedup - DJ media relay: media:control (DJ only) → media:sync broadcast (engine) - per-room shuffled track pool; submissions count in room snapshot - shared: blindtest payloads, gameType/tracksPerPlayer in settings - tests: DJ neutrality, scoring per mode, fuzzy match, youtube id extraction Client: - YouTube IFrame player (hidden behind a spinning disc — audio only, no title leak), DJ transport (play/pause/restart), non-DJ follows media:sync with latency compensation - lobby: game-type switch (Quiz/Blindtest), blindtest config + per-player track submission UI - vote forms per mode; reveal card with title/artist/who-added Roadmap V1 step 6 (highest technical risk). Server flow verified end-to-end over the wire (submit→start→DJ relay→vote→reveal→score). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
20 lines
694 B
TypeScript
20 lines
694 B
TypeScript
// Point d'enregistrement de toutes les épreuves. Importé une fois au démarrage
|
|
// pour ses effets de bord (registerRound). Ajouter un mode = une ligne ici.
|
|
|
|
import "./quiz"
|
|
import "./blindtest"
|
|
|
|
import type { ServerRoom } from "../../rooms"
|
|
import { prepareQuizForRoom } from "./quiz/pool"
|
|
import { prepareBlindtestForRoom } from "./blindtest/pool"
|
|
|
|
/** Précharge le contenu nécessaire avant de lancer la partie. */
|
|
export async function prepareRoom(room: ServerRoom): Promise<void> {
|
|
const types = new Set(room.settings.rounds.map((r) => r.type))
|
|
if (types.has("quiz")) {
|
|
await prepareQuizForRoom(room)
|
|
}
|
|
if (types.has("blindtest")) {
|
|
prepareBlindtestForRoom(room)
|
|
}
|
|
}
|