From 3c774279aa60f6fb086c936566b62d06d5926bb9 Mon Sep 17 00:00:00 2001
From: Z8MB1E
Date: Tue, 20 Oct 2026 12:48:27 -0400
Subject: [PATCH] feat(minigames): superuser developer console dock across all
ten games
Adds a shared fixed-position debugging dock (Controls/State/Log tabs) gated
to dynamic superusers, mounted per minigame. Multiplayer games gain synced
server-authoritative admin commands with [dev-admin] audit logging: poker
(force fold, force street, per-viewer reveal-all, clock control, stack
adjust, force expire), blackjack (bankroll adjust, next-card injection,
dealer override, force expire), bomperator (pure applyAdminCommand: crates,
pickups, eliminate, freeze, sudden death, timer, end round; mirrored over
the arena REST path), and CFF Versus (reveal fleets, force shot outcome,
skip turn). Solo games get client-side tuning via persisted dev settings:
flappy physics sliders plus pause and invincibility, EOD layout reveal and
seeded boards, radio transcript view and timer freeze, aim trainer seed and
difficulty overrides plus hitbox overlay, OPORD answer reveal and study
window, call-for-fire target reveal, seeded grids, and free corrections.
Includes 26 new integration specs (command purity, gating, audit lines) and
a poker e2e smoke for the dock. Plan: Minigame Developer Console.
---
.../(frontend)/minigames/blackjack/actions.ts | 73 +++-
.../minigames/bomperator/actions.ts | 78 +++-
.../(frontend)/minigames/bomperator/page.tsx | 4 +
.../minigames/call-for-fire-versus/actions.ts | 57 ++-
.../minigames/call-for-fire-versus/page.tsx | 4 +
.../minigames/call-for-fire/page.tsx | 9 +-
src/app/(frontend)/minigames/eod/page.tsx | 5 +-
src/app/(frontend)/minigames/flappy/page.tsx | 8 +-
src/app/(frontend)/minigames/opord/page.tsx | 9 +-
src/app/(frontend)/minigames/poker/actions.ts | 87 ++++
.../minigames/qualification/page.tsx | 5 +-
src/app/(frontend)/minigames/radio/page.tsx | 9 +-
src/arena/games/bomperator.ts | 26 +-
src/arena/server.ts | 11 +
.../minigames/blackjack/BlackjackArena.tsx | 15 +
.../minigames/bomperator/BomperatorArena.tsx | 15 +
.../CallForFireVersusArena.tsx | 15 +
.../call-for-fire/CallForFireArena.tsx | 22 +-
.../call-for-fire/FireMissionBoard.tsx | 186 ++++++--
.../minigames/dev/BlackjackDevControls.tsx | 183 ++++++++
.../minigames/dev/BomperatorDevControls.tsx | 250 +++++++++++
.../minigames/dev/CallForFireDevControls.tsx | 207 +++++++++
.../frontend/minigames/dev/EodDevControls.tsx | 190 +++++++++
.../minigames/dev/FlappyDevControls.tsx | 196 +++++++++
.../minigames/dev/MinigameDevDock.tsx | 229 ++++++++++
.../minigames/dev/OpordDevControls.tsx | 176 ++++++++
.../minigames/dev/PokerDevControls.tsx | 301 +++++++++++++
.../dev/QualificationDevControls.tsx | 190 +++++++++
.../minigames/dev/RadioDevControls.tsx | 147 +++++++
.../minigames/dev/VersusDevControls.tsx | 128 ++++++
.../frontend/minigames/dev/devLog.ts | 86 ++++
.../frontend/minigames/dev/devSettings.ts | 48 +++
.../frontend/minigames/dev/primitives.tsx | 123 ++++++
.../frontend/minigames/dev/useDevLog.ts | 31 ++
.../frontend/minigames/eod/EodArena.tsx | 3 +
.../minigames/eod/MinesweeperBoard.tsx | 154 ++++++-
.../frontend/minigames/flappy/FlappyArena.tsx | 15 +-
.../frontend/minigames/flappy/FlappyBird.tsx | 231 +++++++---
.../frontend/minigames/flappy/devConfig.ts | 59 +++
.../frontend/minigames/opord/OpordArena.tsx | 58 ++-
.../frontend/minigames/opord/OpordGame.tsx | 173 ++++++--
.../frontend/minigames/poker/PokerArena.tsx | 16 +-
.../minigames/poker/PokerDevPanel.tsx | 241 +----------
.../minigames/poker/PokerGameTable.tsx | 5 -
.../frontend/minigames/poker/PokerTable.tsx | 3 -
.../qualification/AimTrainerArena.tsx | 105 ++++-
.../qualification/AimTrainerCanvas.ts | 22 +-
.../qualification/AimTrainerGame.tsx | 37 +-
.../minigames/qualification/devConfig.ts | 73 ++++
.../frontend/minigames/radio/RadioArena.tsx | 3 +
.../frontend/minigames/radio/RadioTraffic.tsx | 92 +++-
src/lib/minigames/blackjack/tables.ts | 108 +++++
src/lib/minigames/bomperator/engine.ts | 86 ++++
src/lib/minigames/bomperator/registry.ts | 27 +-
src/lib/minigames/bomperator/types.ts | 34 ++
src/lib/minigames/bomperator/views.ts | 1 +
.../minigames/call-for-fire-versus/engine.ts | 85 +++-
.../call-for-fire-versus/registry.ts | 22 +-
.../minigames/call-for-fire-versus/types.ts | 28 ++
.../minigames/call-for-fire-versus/views.ts | 2 +
src/lib/minigames/poker/actions.ts | 35 ++
src/lib/minigames/poker/engine.ts | 38 +-
src/lib/minigames/poker/tables.ts | 98 ++++-
src/lib/minigames/poker/views.ts | 21 +-
tests/e2e/minigame-dev-console.e2e.spec.ts | 56 +++
.../minigame-dev-admin-commands.int.spec.ts | 276 ++++++++++++
.../minigame-dev-console-gating.int.spec.ts | 400 ++++++++++++++++++
67 files changed, 5304 insertions(+), 426 deletions(-)
create mode 100644 src/components/frontend/minigames/dev/BlackjackDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/BomperatorDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/CallForFireDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/EodDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/FlappyDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/MinigameDevDock.tsx
create mode 100644 src/components/frontend/minigames/dev/OpordDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/PokerDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/QualificationDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/RadioDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/VersusDevControls.tsx
create mode 100644 src/components/frontend/minigames/dev/devLog.ts
create mode 100644 src/components/frontend/minigames/dev/devSettings.ts
create mode 100644 src/components/frontend/minigames/dev/primitives.tsx
create mode 100644 src/components/frontend/minigames/dev/useDevLog.ts
create mode 100644 src/components/frontend/minigames/flappy/devConfig.ts
create mode 100644 src/components/frontend/minigames/qualification/devConfig.ts
create mode 100644 tests/e2e/minigame-dev-console.e2e.spec.ts
create mode 100644 tests/int/minigame-dev-admin-commands.int.spec.ts
create mode 100644 tests/int/minigame-dev-console-gating.int.spec.ts
diff --git a/src/app/(frontend)/minigames/blackjack/actions.ts b/src/app/(frontend)/minigames/blackjack/actions.ts
index 9efa5e3a..a5e3ba0d 100644
--- a/src/app/(frontend)/minigames/blackjack/actions.ts
+++ b/src/app/(frontend)/minigames/blackjack/actions.ts
@@ -7,17 +7,21 @@
import config from "@payload-config";
import { getPayload } from "payload";
-import type { BlackjackActionKind } from "@/lib/minigames/blackjack/types";
+import type { Payload } from "payload";
+import type { BlackjackActionKind, Card } from "@/lib/minigames/blackjack/types";
import { isSuperuser } from "@/utils/access-control/hasPermission";
import {
+ adjustBankroll,
applyBlackjackAction,
createTable,
forceExpireTable,
getSnapshotFor,
+ injectNextCard,
joinTableWithBuyIn,
leaveTableWithBuyIn,
listSummaries,
renameTable,
+ setDealerHand,
spectateTable,
startGameWithBuyIn,
type BlackjackSnapshot,
@@ -69,6 +73,13 @@ function userName(user: UserLike): string {
return `Player ${user.id}`;
}
+/** Audit line for every multiplayer admin action taken from the dev console. */
+function auditDevAction(payload: Payload, userId: number, action: string, target: string): void {
+ payload.logger.info(
+ `[dev-admin] user=${userId} game=blackjack action=${action} target=${target}`,
+ );
+}
+
export async function createBlackjackTable(): Promise> {
try {
const { user } = await authenticate();
@@ -95,6 +106,7 @@ export async function forceExpireBlackjackTable(tableId: string): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ const snapshot = adjustBankroll(tableId, Number(user.id), seatId, delta);
+ auditDevAction(payload, Number(user.id), "adjust-bankroll", `${tableId}/seat-${seatId}`);
+ return { success: true, data: snapshot };
+ } catch (error) {
+ return toError(error);
+ }
+}
+
+export async function forceBlackjackNextCard(
+ tableId: string,
+ card: Card,
+): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ const snapshot = injectNextCard(tableId, Number(user.id), card);
+ auditDevAction(payload, Number(user.id), "force-next-card", tableId);
+ return { success: true, data: snapshot };
+ } catch (error) {
+ return toError(error);
+ }
+}
+
+export async function setBlackjackDealerHand(
+ tableId: string,
+ cards: Card[],
+): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ const snapshot = setDealerHand(tableId, Number(user.id), cards);
+ auditDevAction(payload, Number(user.id), "set-dealer-hand", tableId);
+ return { success: true, data: snapshot };
+ } catch (error) {
+ return toError(error);
+ }
+}
diff --git a/src/app/(frontend)/minigames/bomperator/actions.ts b/src/app/(frontend)/minigames/bomperator/actions.ts
index 94a1dbc1..d2e79cc2 100644
--- a/src/app/(frontend)/minigames/bomperator/actions.ts
+++ b/src/app/(frontend)/minigames/bomperator/actions.ts
@@ -17,14 +17,17 @@
import config from "@payload-config";
import { getPayload } from "payload";
+import type { Payload } from "payload";
import { SignJWT } from "jose";
import { isSuperuser } from "@/utils/access-control/hasPermission";
import type {
+ BomperatorAdminCommand,
BomperatorMatchSummary,
BomperatorView,
} from "@/lib/minigames/bomperator/types";
import type { BomperatorInput } from "@/lib/minigames/bomperator/engine";
import {
+ applyAdminCommandFor,
createMatch,
endMatch,
forceExpireMatch,
@@ -36,7 +39,7 @@ import {
submitInput,
} from "@/lib/minigames/bomperator/registry";
-export type { BomperatorMatchSummary, BomperatorView, BomperatorInput };
+export type { BomperatorAdminCommand, BomperatorMatchSummary, BomperatorView, BomperatorInput };
interface ActionResult {
success: boolean;
@@ -81,6 +84,48 @@ function userName(user: UserLike): string {
return `Operator ${user.id}`;
}
+/** Audit line for every multiplayer admin action taken from the dev console. */
+function auditDevAction(payload: Payload, userId: number, action: string, target: string): void {
+ payload.logger.info(
+ `[dev-admin] user=${userId} game=bomperator action=${action} target=${target}`,
+ );
+}
+
+const ADMIN_COMMAND_KINDS = new Set([
+ "destroyCrates",
+ "grantPickup",
+ "eliminate",
+ "freeze",
+ "suddenDeathNow",
+ "setRoundTimer",
+ "endRound",
+]);
+
+/** Reject anything that is not a known command shape before it reaches the engine. */
+function isValidAdminCommand(cmd: unknown): cmd is BomperatorAdminCommand {
+ if (typeof cmd !== "object" || cmd === null) return false;
+ const kind = (cmd as { kind?: unknown }).kind;
+ if (typeof kind !== "string" || !ADMIN_COMMAND_KINDS.has(kind)) return false;
+ const record = cmd as Record;
+ switch (kind) {
+ case "grantPickup":
+ return (
+ typeof record.seat === "number" &&
+ ["bomb", "range", "speed", "kick"].includes(String(record.pickup))
+ );
+ case "eliminate":
+ return typeof record.seat === "number";
+ case "freeze":
+ return typeof record.frozen === "boolean";
+ case "setRoundTimer":
+ return typeof record.ticks === "number" && Number.isFinite(record.ticks);
+ case "endRound":
+ return record.winnerSeat === null || typeof record.winnerSeat === "number";
+ default:
+ return true;
+ }
+}
+
/* ------------------------------------------------------------------ arena */
/** Internal (server-reachable) base URL of the arena process. */
@@ -288,6 +333,7 @@ export async function forceExpireBomperatorMatch(
if (!allowed) {
return { success: false, error: "Only administrators can force-end matches." };
}
+ auditDevAction(payload, Number(user.id), "force-expire-match", matchId);
if (ARENA_ENABLED) {
await arenaCall("POST", "/matches/force-expire", { matchId });
return { success: true };
@@ -298,3 +344,33 @@ export async function forceExpireBomperatorMatch(
return toError(error);
}
}
+
+/**
+ * Dev-console admin command for a live Ordnance Disposal match. Superuser-only;
+ * the command is validated against the known set before it reaches either
+ * transport (arena REST proxy or in-process registry). Cheats ride the normal
+ * snapshot fan-out, so every client sees them by next tick.
+ */
+export async function bomperatorAdminCommand(
+ matchId: string,
+ cmd: BomperatorAdminCommand,
+): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ if (!isValidAdminCommand(cmd)) {
+ return { success: false, error: "Invalid admin command." };
+ }
+ auditDevAction(payload, Number(user.id), `cmd:${cmd.kind}`, matchId);
+ if (ARENA_ENABLED) {
+ return await arenaCall("POST", "/matches/admin", { matchId, cmd });
+ }
+ applyAdminCommandFor(matchId, cmd);
+ return { success: true };
+ } catch (error) {
+ return toError(error);
+ }
+}
diff --git a/src/app/(frontend)/minigames/bomperator/page.tsx b/src/app/(frontend)/minigames/bomperator/page.tsx
index 25ea6634..4c1b40f5 100644
--- a/src/app/(frontend)/minigames/bomperator/page.tsx
+++ b/src/app/(frontend)/minigames/bomperator/page.tsx
@@ -7,6 +7,7 @@ import { Bomb } from "lucide-react";
import { MinigameComingSoon } from "@/components/frontend/minigames/MinigameComingSoon";
import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBanner";
import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry";
+import { isSuperuser } from "@/utils/access-control/hasPermission";
import { BomperatorArena } from "@/components/frontend/minigames/bomperator/BomperatorArena";
export const metadata: Metadata = {
@@ -35,6 +36,8 @@ export default async function BomperatorPage({ searchParams }: BomperatorPagePro
return ;
}
+ const superuser = await isSuperuser(payload, user);
+
const profileRes = await payload.find({
collection: "profiles",
where: { user: { equals: Number(user.id) } },
@@ -81,6 +84,7 @@ export default async function BomperatorPage({ searchParams }: BomperatorPagePro
initialStats={stats}
currentUserId={Number(user.id)}
initialMatchId={initialMatchId}
+ isSuperuser={superuser}
/>
);
diff --git a/src/app/(frontend)/minigames/call-for-fire-versus/actions.ts b/src/app/(frontend)/minigames/call-for-fire-versus/actions.ts
index b5a0f785..1bf00ec1 100644
--- a/src/app/(frontend)/minigames/call-for-fire-versus/actions.ts
+++ b/src/app/(frontend)/minigames/call-for-fire-versus/actions.ts
@@ -8,14 +8,17 @@
import config from "@payload-config";
import { getPayload } from "payload";
+import type { Payload } from "payload";
import { isSuperuser } from "@/utils/access-control/hasPermission";
import type {
+ VersusAdminCommand,
VersusMatchSummary,
VersusMatchView,
} from "@/lib/minigames/call-for-fire-versus/types";
import type { FobPlacement } from "@/lib/minigames/call-for-fire-versus/constants";
import type { VersusShotInput } from "@/lib/minigames/call-for-fire-versus/engine";
import {
+ applyAdminCommandFor,
createMatch,
fireShotFor,
forceExpireMatch,
@@ -26,7 +29,7 @@ import {
placeFleetFor,
} from "@/lib/minigames/call-for-fire-versus/registry";
-export type { VersusMatchSummary, VersusMatchView, VersusShotInput, FobPlacement };
+export type { VersusAdminCommand, VersusMatchSummary, VersusMatchView, VersusShotInput, FobPlacement };
interface ActionResult {
success: boolean;
@@ -71,6 +74,31 @@ function userName(user: UserLike): string {
return `Operator ${user.id}`;
}
+/** Audit line for every multiplayer admin action taken from the dev console. */
+function auditDevAction(payload: Payload, userId: number, action: string, target: string): void {
+ payload.logger.info(
+ `[dev-admin] user=${userId} game=cff-versus action=${action} target=${target}`,
+ );
+}
+
+/** Reject anything that is not a known command shape before it reaches the engine. */
+function isValidAdminCommand(cmd: unknown): cmd is VersusAdminCommand {
+ if (typeof cmd !== "object" || cmd === null) return false;
+ const record = cmd as Record;
+ switch (record.kind) {
+ case "revealFleets":
+ return typeof record.on === "boolean";
+ case "forceShotResult":
+ return (
+ record.outcome === null || record.outcome === "hit" || record.outcome === "miss"
+ );
+ case "skipTurn":
+ return true;
+ default:
+ return false;
+ }
+}
+
export async function createVersusMatch(): Promise> {
try {
const { user } = await authenticate();
@@ -149,9 +177,36 @@ export async function forceExpireVersusMatch(matchId: string): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ if (!isValidAdminCommand(cmd)) {
+ return { success: false, error: "Invalid admin command." };
+ }
+ auditDevAction(payload, Number(user.id), `cmd:${cmd.kind}`, matchId);
+ applyAdminCommandFor(matchId, cmd);
+ return { success: true };
+ } catch (error) {
+ return toError(error);
+ }
+}
diff --git a/src/app/(frontend)/minigames/call-for-fire-versus/page.tsx b/src/app/(frontend)/minigames/call-for-fire-versus/page.tsx
index 5a7b24f6..f090c272 100644
--- a/src/app/(frontend)/minigames/call-for-fire-versus/page.tsx
+++ b/src/app/(frontend)/minigames/call-for-fire-versus/page.tsx
@@ -7,6 +7,7 @@ import { Swords } from "lucide-react";
import { MinigameComingSoon } from "@/components/frontend/minigames/MinigameComingSoon";
import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBanner";
import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry";
+import { isSuperuser } from "@/utils/access-control/hasPermission";
import { CallForFireVersusArena } from "@/components/frontend/minigames/call-for-fire-versus/CallForFireVersusArena";
export const metadata: Metadata = {
@@ -35,6 +36,8 @@ export default async function CallForFireVersusPage({ searchParams }: VersusPage
return ;
}
+ const superuser = await isSuperuser(payload, user);
+
const profileRes = await payload.find({
collection: "profiles",
where: { user: { equals: Number(user.id) } },
@@ -81,6 +84,7 @@ export default async function CallForFireVersusPage({ searchParams }: VersusPage
initialStats={stats}
currentUserId={Number(user.id)}
initialMatchId={initialMatchId}
+ isSuperuser={superuser}
/>
);
diff --git a/src/app/(frontend)/minigames/call-for-fire/page.tsx b/src/app/(frontend)/minigames/call-for-fire/page.tsx
index 918a8828..18293170 100644
--- a/src/app/(frontend)/minigames/call-for-fire/page.tsx
+++ b/src/app/(frontend)/minigames/call-for-fire/page.tsx
@@ -7,6 +7,7 @@ import { Target } from "lucide-react";
import { CallForFireArena } from "@/components/frontend/minigames/call-for-fire/CallForFireArena";
import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBanner";
import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry";
+import { isSuperuser } from "@/utils/access-control/hasPermission";
export const metadata: Metadata = {
title: "Call for Fire (Polaris Task Force)",
@@ -23,6 +24,8 @@ export default async function CallForFirePage() {
redirect(`/login?returnTo=${encodeURIComponent("/minigames/call-for-fire")}`);
}
+ const superuser = await isSuperuser(payload, user);
+
const release = await getMinigameReleaseState(payload, "callForFire");
const profileRes = await payload.find({
@@ -66,7 +69,11 @@ export default async function CallForFirePage() {
-
+
);
}
diff --git a/src/app/(frontend)/minigames/eod/page.tsx b/src/app/(frontend)/minigames/eod/page.tsx
index 2afb02ac..05f5ec97 100644
--- a/src/app/(frontend)/minigames/eod/page.tsx
+++ b/src/app/(frontend)/minigames/eod/page.tsx
@@ -6,6 +6,7 @@ import { redirect } from "next/navigation";
import { MinigameComingSoon } from "@/components/frontend/minigames/MinigameComingSoon";
import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBanner";
import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry";
+import { isSuperuser } from "@/utils/access-control/hasPermission";
import { Bomb } from "lucide-react";
import { EodArena } from "@/components/frontend/minigames/eod/EodArena";
@@ -29,6 +30,8 @@ export default async function EodPage() {
return ;
}
+ const superuser = await isSuperuser(payload, user);
+
const profileRes = await payload.find({
collection: "profiles",
where: { user: { equals: user.id as number } },
@@ -70,7 +73,7 @@ export default async function EodPage() {
-
+
);
}
diff --git a/src/app/(frontend)/minigames/flappy/page.tsx b/src/app/(frontend)/minigames/flappy/page.tsx
index 510c4ccd..d4ee24d5 100644
--- a/src/app/(frontend)/minigames/flappy/page.tsx
+++ b/src/app/(frontend)/minigames/flappy/page.tsx
@@ -8,6 +8,7 @@ import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBann
import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry";
import { Bird } from "lucide-react";
import { FlappyArena } from "@/components/frontend/minigames/flappy/FlappyArena";
+import { isSuperuser } from "@/utils/access-control/hasPermission";
export const metadata: Metadata = {
title: "Flight Simulator: Polaris Task Force",
@@ -29,6 +30,8 @@ export default async function FlappyPage() {
return ;
}
+ const superuser = await isSuperuser(payload, user);
+
const profileRes = await payload.find({
collection: "profiles",
where: { user: { equals: user.id as number } },
@@ -63,12 +66,11 @@ export default async function FlappyPage() {
Flight Simulator
- An unofficial side activity. Earn 1 XP per 15 obstacles
- passed in a single run.
+ An unofficial side activity. Earn 1 XP per 15 obstacles passed in a single run.
-
+
);
}
diff --git a/src/app/(frontend)/minigames/opord/page.tsx b/src/app/(frontend)/minigames/opord/page.tsx
index 71071c59..484ecb63 100644
--- a/src/app/(frontend)/minigames/opord/page.tsx
+++ b/src/app/(frontend)/minigames/opord/page.tsx
@@ -6,6 +6,7 @@ import { redirect } from "next/navigation";
import { MinigameComingSoon } from "@/components/frontend/minigames/MinigameComingSoon";
import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBanner";
import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry";
+import { isSuperuser } from "@/utils/access-control/hasPermission";
import { ScrollText } from "lucide-react";
import { OpordArena } from "@/components/frontend/minigames/opord/OpordArena";
@@ -24,6 +25,8 @@ export default async function OpordPage() {
redirect(`/login?returnTo=${encodeURIComponent("/minigames/opord")}`);
}
+ const superuser = await isSuperuser(payload, user);
+
const release = await getMinigameReleaseState(payload, "opord");
if (release.upcoming && release.game) {
return ;
@@ -71,7 +74,11 @@ export default async function OpordPage() {
-
+
);
}
diff --git a/src/app/(frontend)/minigames/poker/actions.ts b/src/app/(frontend)/minigames/poker/actions.ts
index ace523b1..d77fa5fb 100644
--- a/src/app/(frontend)/minigames/poker/actions.ts
+++ b/src/app/(frontend)/minigames/poker/actions.ts
@@ -8,16 +8,21 @@
import config from "@payload-config";
import { getPayload } from "payload";
+import type { Payload } from "payload";
import type { Card, PokerActionKind, PrivatePlayerView } from "@/lib/minigames/poker/types";
import { isSuperuser } from "@/utils/access-control/hasPermission";
import {
adjustStack,
applyPlayerAction,
+ clockControl,
createTable,
forceExpireTable,
+ forceFold,
+ forceStreet,
getSnapshotFor,
joinTableWithBuyIn,
leaveTableWithBuyIn,
+ setRevealAll,
spectateTable,
listSummaries,
renameTable,
@@ -74,6 +79,15 @@ function userName(user: UserLike): string {
return `Player ${user.id}`;
}
+/**
+ * Audit line for every multiplayer admin action taken from the dev console.
+ * Deliberately a logger line, not a game event: these are operator tooling
+ * traces, not player-facing history (dev console plan decision).
+ */
+function auditDevAction(payload: Payload, userId: number, action: string, target: string): void {
+ payload.logger.info(`[dev-admin] user=${userId} game=poker action=${action} target=${target}`);
+}
+
export async function createPokerTable(): Promise> {
try {
const { user } = await authenticate();
@@ -100,6 +114,7 @@ export async function forceExpirePokerTable(tableId: string): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ const snapshot = forceFold(tableId, Number(user.id), seatId);
+ auditDevAction(payload, Number(user.id), "force-fold", `${tableId}/seat-${seatId}`);
+ return { success: true, data: snapshot };
+ } catch (error) {
+ return toError(error);
+ }
+}
+
+export async function forcePokerStreet(tableId: string): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ const snapshot = forceStreet(tableId, Number(user.id));
+ auditDevAction(payload, Number(user.id), "force-street", tableId);
+ return { success: true, data: snapshot };
+ } catch (error) {
+ return toError(error);
+ }
+}
+
+export async function setPokerRevealAll(
+ tableId: string,
+ enabled: boolean,
+): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ const snapshot = setRevealAll(tableId, Number(user.id), enabled);
+ auditDevAction(payload, Number(user.id), enabled ? "reveal-on" : "reveal-off", tableId);
+ return { success: true, data: snapshot };
+ } catch (error) {
+ return toError(error);
+ }
+}
+
+export async function pokerClockControl(
+ tableId: string,
+ mode: "reset" | "now",
+): Promise> {
+ try {
+ const { payload, user } = await authenticate();
+ const allowed = await isSuperuser(payload, user);
+ if (!allowed) {
+ return { success: false, error: "Only administrators can use dev controls." };
+ }
+ const snapshot = clockControl(tableId, Number(user.id), mode);
+ auditDevAction(payload, Number(user.id), `clock-${mode}`, tableId);
return { success: true, data: snapshot };
} catch (error) {
return toError(error);
diff --git a/src/app/(frontend)/minigames/qualification/page.tsx b/src/app/(frontend)/minigames/qualification/page.tsx
index 95d79d6a..51c5f1ae 100644
--- a/src/app/(frontend)/minigames/qualification/page.tsx
+++ b/src/app/(frontend)/minigames/qualification/page.tsx
@@ -6,6 +6,7 @@ import { redirect } from "next/navigation";
import { MinigameComingSoon } from "@/components/frontend/minigames/MinigameComingSoon";
import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBanner";
import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry";
+import { isSuperuser } from "@/utils/access-control/hasPermission";
import { Crosshair } from "lucide-react";
import type { AimTrainerStats } from "@/app/(frontend)/minigames/qualification/actions";
@@ -26,6 +27,8 @@ export default async function QualificationPage() {
redirect(`/login?returnTo=${encodeURIComponent("/minigames/qualification")}`);
}
+ const superuser = await isSuperuser(payload, user);
+
const release = await getMinigameReleaseState(payload, "qualification");
if (release.upcoming && release.game) {
return ;
@@ -75,7 +78,7 @@ export default async function QualificationPage() {
-
+
);
}
diff --git a/src/app/(frontend)/minigames/radio/page.tsx b/src/app/(frontend)/minigames/radio/page.tsx
index 38079f3b..2353f7dc 100644
--- a/src/app/(frontend)/minigames/radio/page.tsx
+++ b/src/app/(frontend)/minigames/radio/page.tsx
@@ -6,6 +6,7 @@ import { redirect } from "next/navigation";
import { MinigameComingSoon } from "@/components/frontend/minigames/MinigameComingSoon";
import { PhasingOutBanner } from "@/components/frontend/minigames/PhasingOutBanner";
import { getMinigameReleaseState } from "@/lib/minigames/loadRegistry";
+import { isSuperuser } from "@/utils/access-control/hasPermission";
import { Radio } from "lucide-react";
import { RadioArena } from "@/components/frontend/minigames/radio/RadioArena";
@@ -24,6 +25,8 @@ export default async function RadioPage() {
redirect(`/login?returnTo=${encodeURIComponent("/minigames/radio")}`);
}
+ const superuser = await isSuperuser(payload, user);
+
const release = await getMinigameReleaseState(payload, "radio");
if (release.upcoming && release.game) {
return ;
@@ -79,7 +82,11 @@ export default async function RadioPage() {
-
+
);
}
diff --git a/src/arena/games/bomperator.ts b/src/arena/games/bomperator.ts
index c96f824e..a39d9679 100644
--- a/src/arena/games/bomperator.ts
+++ b/src/arena/games/bomperator.ts
@@ -33,6 +33,7 @@ import {
TICK_MS,
} from "@/lib/minigames/bomperator/constants";
import {
+ applyAdminCommand,
applyInput,
createMatchState,
dissolveMatch,
@@ -41,7 +42,12 @@ import {
tick as engineTick,
type BomperatorInput,
} from "@/lib/minigames/bomperator/engine";
-import type { BomperatorMatchSummary, BomperatorState, BomperatorView } from "@/lib/minigames/bomperator/types";
+import type {
+ BomperatorAdminCommand,
+ BomperatorMatchSummary,
+ BomperatorState,
+ BomperatorView,
+} from "@/lib/minigames/bomperator/types";
import { buildBomperatorView } from "@/lib/minigames/bomperator/views";
import type { ServerMessage } from "../protocol";
import type { RealtimeGameModule } from "./types";
@@ -568,6 +574,24 @@ export class BomperatorGameModule implements RealtimeGameModule {
this.disposeMatch(record);
}
+ /**
+ * Dev-console command entry point (WS transport). Mirrors the registry's
+ * applyAdminCommandFor exactly: pure command application, version bump,
+ * snapshot fan-out over sockets, immediate completion handling.
+ */
+ adminCommand(matchId: string, cmd: BomperatorAdminCommand): void {
+ const record = this.matches.get(matchId);
+ if (!record) throw new Error("Match not found.");
+ record.state = applyAdminCommand(record.state, cmd);
+ record.version += 1;
+ record.lastActivityAt = Date.now();
+ this.pushSnapshots(record);
+ if (record.state.phase === "complete") {
+ this.stopTickLoop(record);
+ this.awardCompleted(record);
+ }
+ }
+
listSummaries(viewerId?: number): BomperatorMatchSummary[] {
return [...this.matches.values()].map((record) => ({
matchId: record.id,
diff --git a/src/arena/server.ts b/src/arena/server.ts
index 21332352..85060d10 100644
--- a/src/arena/server.ts
+++ b/src/arena/server.ts
@@ -248,6 +248,17 @@ export async function startArena(options: ArenaOptions = {}): Promise game.forceExpire(str("matchId")));
return;
}
+ if (url.pathname === "/matches/admin" && req.method === "POST") {
+ // Dev-console commands (superuser-gated in the Next action that proxies
+ // here; this endpoint shares the same x-arena-secret trust as the rest).
+ const cmd = body.cmd as { kind?: unknown } | undefined;
+ if (!cmd || typeof cmd.kind !== "string") {
+ sendJson(res, 200, { success: false, error: "Invalid admin command." });
+ return;
+ }
+ await run(() => game.adminCommand(str("matchId"), cmd as never));
+ return;
+ }
sendJson(res, 404, { success: false, error: "Not found." });
}
diff --git a/src/components/frontend/minigames/blackjack/BlackjackArena.tsx b/src/components/frontend/minigames/blackjack/BlackjackArena.tsx
index 1839874b..255d999f 100644
--- a/src/components/frontend/minigames/blackjack/BlackjackArena.tsx
+++ b/src/components/frontend/minigames/blackjack/BlackjackArena.tsx
@@ -14,6 +14,8 @@ import type { BlackjackPhase } from "@/lib/minigames/blackjack";
import { useRealtimePresence } from "@/hooks/useRealtimePresence";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { ChipBankCard } from "@/components/frontend/minigames/ChipBankCard";
+import { BlackjackDevControls } from "@/components/frontend/minigames/dev/BlackjackDevControls";
+import { MinigameDevDock } from "@/components/frontend/minigames/dev/MinigameDevDock";
import { BlackjackGuide } from "./BlackjackGuide";
import {
BLACKJACK_STATE_EVENT,
@@ -332,6 +334,19 @@ export function BlackjackArena({
+
+ {view === "table" && snapshot && (
+
+ {snapshot.you && (
+
+ )}
+
+ )}
);
}
diff --git a/src/components/frontend/minigames/bomperator/BomperatorArena.tsx b/src/components/frontend/minigames/bomperator/BomperatorArena.tsx
index db728e4c..d5a1d251 100644
--- a/src/components/frontend/minigames/bomperator/BomperatorArena.tsx
+++ b/src/components/frontend/minigames/bomperator/BomperatorArena.tsx
@@ -11,6 +11,8 @@ import {
import { toast } from "sonner";
import { useRealtimePresence } from "@/hooks/useRealtimePresence";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
+import { BomperatorDevControls } from "@/components/frontend/minigames/dev/BomperatorDevControls";
+import { MinigameDevDock } from "@/components/frontend/minigames/dev/MinigameDevDock";
import { BomperatorLobby } from "./BomperatorLobby";
import { BomperatorGame } from "./BomperatorGame";
import {
@@ -41,10 +43,12 @@ export function BomperatorArena({
initialStats,
currentUserId,
initialMatchId,
+ isSuperuser = false,
}: {
initialStats: BomperatorStats;
currentUserId: number | string;
initialMatchId?: string;
+ isSuperuser?: boolean;
}) {
const [view, setView] = useState(initialMatchId ? "match" : "lobby");
const [match, setMatch] = useState(null);
@@ -246,6 +250,17 @@ export function BomperatorArena({
) : (
- Read the spotting report, correct range and deflection, and walk the rounds onto the target
- before time runs out
+ Read the spotting report, correct range and deflection, and walk the rounds onto the
+ target before time runs out
+
+
+ Lifts the client-side round cap so you can keep correcting past max rounds, and keeps
+ the full observer net history instead of the last six transmissions. Rounds fired are
+ still reported as-is, so the unchanged server validation rejects a result that exceeds
+ the cap; accepted scores are unaffected.
+
+
+ Target and spotting round are generated when a mission begins, so a seed reproduces the
+ same scenario on the next Begin. Leave the field empty and apply to use Math.random.
+
+ Layouts are generated on the first dig, with a safe pocket around that click, so a seed
+ reproduces the same field for the same first click. Changing the seed restarts the sector.
+
+ );
+}
diff --git a/src/components/frontend/minigames/dev/OpordDevControls.tsx b/src/components/frontend/minigames/dev/OpordDevControls.tsx
new file mode 100644
index 00000000..7cfd3df5
--- /dev/null
+++ b/src/components/frontend/minigames/dev/OpordDevControls.tsx
@@ -0,0 +1,176 @@
+"use client";
+
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import { Switch } from "@/components/ui/switch";
+import { clearDevSetting, readDevSetting, writeDevSetting } from "./devSettings";
+import { pushDevLog } from "./devLog";
+import { DevSection } from "./primitives";
+
+/**
+ * OPORD Recall controls for the shared minigame dev dock.
+ *
+ * Both controls are client-only debugging aids (the solo game keeps no server
+ * state):
+ * - "Reveal answers" marks the correct option of the question on screen. The
+ * quiz is built client-side from the seeded scenario, so the questions,
+ * their `correctIndex` values, and typed answers are already in the browser.
+ * - "Study time override" turns the self-paced briefing into a countdown that
+ * starts the recall quiz when it expires.
+ *
+ * Neither touches the submission: the result payload, its bounds, the timer
+ * check, and the scoring math stay exactly as before.
+ */
+
+export const OPORD_DEV_GAME_KEY = "opord";
+export const OPORD_DEV_SETTINGS_EVENT = "ptf:dev-settings-changed";
+
+export interface OpordDevSettings {
+ readonly revealAnswers: boolean;
+ /** Study countdown in seconds; null keeps the self-paced briefing. */
+ readonly studySeconds: number | null;
+}
+
+const MIN_STUDY_SECONDS = 5;
+const MAX_STUDY_SECONDS = 3600;
+
+function readStudySeconds(): number | null {
+ const value = readDevSetting(OPORD_DEV_GAME_KEY, "studySeconds", null);
+ if (typeof value !== "number" || !Number.isFinite(value)) return null;
+ const rounded = Math.round(value);
+ if (rounded < MIN_STUDY_SECONDS || rounded > MAX_STUDY_SECONDS) return null;
+ return rounded;
+}
+
+/** Snapshot of both overrides; safe to call during SSR (falls back to defaults). */
+export function readOpordDevSettings(): OpordDevSettings {
+ return {
+ revealAnswers: readDevSetting(OPORD_DEV_GAME_KEY, "revealAnswers", false) === true,
+ studySeconds: readStudySeconds(),
+ };
+}
+
+export function OpordDevControls({
+ isSuperuser = false,
+}: {
+ readonly isSuperuser?: boolean;
+}) {
+ const [revealAnswers, setRevealAnswers] = useState(() => readOpordDevSettings().revealAnswers);
+ const [studySeconds, setStudySeconds] = useState(
+ () => readOpordDevSettings().studySeconds,
+ );
+ const [studyDraft, setStudyDraft] = useState(() => {
+ const seconds = readOpordDevSettings().studySeconds;
+ return seconds === null ? "" : String(seconds);
+ });
+ const [error, setError] = useState(null);
+
+ const updateRevealAnswers = (checked: boolean) => {
+ writeDevSetting(OPORD_DEV_GAME_KEY, "revealAnswers", checked);
+ setRevealAnswers(checked);
+ window.dispatchEvent(new Event(OPORD_DEV_SETTINGS_EVENT));
+ pushDevLog("action", `opord: revealAnswers = ${checked}`);
+ };
+
+ const clearStudyOverride = () => {
+ clearDevSetting(OPORD_DEV_GAME_KEY, "studySeconds");
+ setStudySeconds(null);
+ setStudyDraft("");
+ setError(null);
+ window.dispatchEvent(new Event(OPORD_DEV_SETTINGS_EVENT));
+ pushDevLog("action", "opord: studySeconds = default");
+ };
+
+ const applyStudySeconds = () => {
+ const trimmed = studyDraft.trim();
+ if (trimmed.length === 0) {
+ clearStudyOverride();
+ return;
+ }
+ const parsed = Number(trimmed);
+ if (!Number.isInteger(parsed) || parsed < MIN_STUDY_SECONDS || parsed > MAX_STUDY_SECONDS) {
+ setError(
+ `Enter a whole number of seconds between ${MIN_STUDY_SECONDS} and ${MAX_STUDY_SECONDS}.`,
+ );
+ return;
+ }
+ writeDevSetting(OPORD_DEV_GAME_KEY, "studySeconds", parsed);
+ setStudySeconds(parsed);
+ setStudyDraft(String(parsed));
+ setError(null);
+ window.dispatchEvent(new Event(OPORD_DEV_SETTINGS_EVENT));
+ pushDevLog("action", `opord: studySeconds = ${parsed}`);
+ };
+
+ if (!isSuperuser) return null;
+
+ return (
+ <>
+
+
+
+ Highlights the correct option while the recall quiz is on screen; typed questions show
+ the expected answer. The quiz is generated in the browser, so no server data is involved.
+
+ Counts down during the briefing and starts the recall quiz when it reaches zero. Clear
+ the field and Apply (or press Default) to return to self-paced study.
+ {studySeconds === null ? "" : ` Active override: ${studySeconds}s.`}
+
+
+ >
+ );
+}
diff --git a/src/components/frontend/minigames/dev/PokerDevControls.tsx b/src/components/frontend/minigames/dev/PokerDevControls.tsx
new file mode 100644
index 00000000..036d4239
--- /dev/null
+++ b/src/components/frontend/minigames/dev/PokerDevControls.tsx
@@ -0,0 +1,301 @@
+"use client";
+
+import { useState } from "react";
+import { Trash2 } from "lucide-react";
+import type { Card } from "@/lib/minigames/poker";
+import type { PokerSnapshot } from "@/app/(frontend)/minigames/poker/actions";
+import {
+ adjustPokerStack,
+ forceExpirePokerTable,
+ forceFoldPokerPlayer,
+ forcePokerStreet,
+ pokerClockControl,
+ setPokerBoardQueue,
+ setPokerHoleQueue,
+ setPokerRevealAll,
+} from "@/app/(frontend)/minigames/poker/actions";
+import { Button } from "@/components/ui/button";
+import { Combobox } from "@/components/ui/combobox";
+import { Input } from "@/components/ui/input";
+import { cardLabel, CardPicker } from "../poker/PokerDevPanel";
+import { pushDevLog } from "./devLog";
+import { DevButton, DevSection } from "./primitives";
+
+/**
+ * Poker controls for the shared minigame dev dock. Migrated from the old
+ * inline PokerDevPanel dialog (board queue / hole queue / stack adjust) and
+ * extended with moderation overrides: force-fold a seat, force the next
+ * street, reveal all hands (per-viewer), turn-clock control, and force-end.
+ * Sync back to every client is free via the registry's pushTable -> SSE.
+ */
+
+interface PokerDevControlsProps {
+ readonly tableId: string;
+ readonly view: NonNullable;
+}
+
+export function PokerDevControls({ tableId, view }: PokerDevControlsProps) {
+ const [boardQueue, setBoardQueue] = useState([]);
+ const [boardDraft, setBoardDraft] = useState(null);
+ const [seatId, setSeatId] = useState("");
+ const [holeA, setHoleA] = useState(null);
+ const [holeB, setHoleB] = useState(null);
+ const [adjustSeat, setAdjustSeat] = useState("");
+ const [adjustAmount, setAdjustAmount] = useState("");
+ const [foldSeat, setFoldSeat] = useState("");
+ const [revealOn, setRevealOn] = useState(false);
+ const [error, setError] = useState(null);
+
+ const run = async (name: string, action: () => Promise<{ success: boolean; error?: string }>) => {
+ pushDevLog("action", `poker: ${name} sent`);
+ try {
+ const result = await action();
+ if (!result.success) {
+ const message = result.error ?? "The dev action failed.";
+ setError(message);
+ pushDevLog("error", `poker: ${name} failed (${message})`);
+ } else {
+ setError(null);
+ pushDevLog("action", `poker: ${name} applied`);
+ }
+ return result.success;
+ } catch (caught) {
+ const message = caught instanceof Error ? caught.message : "The dev action failed.";
+ setError(message);
+ pushDevLog("error", `poker: ${name} threw (${message})`);
+ return false;
+ }
+ };
+
+ const queueBoard = () => {
+ if (boardQueue.length === 0) return;
+ void run("set-board-queue", async () => {
+ const result = await setPokerBoardQueue(tableId, boardQueue);
+ if (result.success) setBoardQueue([]);
+ return result;
+ });
+ };
+
+ const queueHole = () => {
+ if (seatId === "" || !holeA || !holeB) return;
+ void run("set-hole-queue", async () => {
+ const result = await setPokerHoleQueue(tableId, Number(seatId), [holeA, holeB]);
+ if (result.success) {
+ setHoleA(null);
+ setHoleB(null);
+ }
+ return result;
+ });
+ };
+
+ const adjust = (sign: 1 | -1) => {
+ if (adjustSeat === "") return;
+ const amount = Number(adjustAmount);
+ if (!Number.isInteger(amount) || amount <= 0) {
+ setError("Enter a positive whole number of chips.");
+ return;
+ }
+ void run("adjust-stack", async () => {
+ const result = await adjustPokerStack(tableId, Number(adjustSeat), sign * amount);
+ if (result.success) setAdjustAmount("");
+ return result;
+ });
+ };
+
+ const seatedPlayers = view.players.filter((player) => !player.eliminated);
+ const boardSlotsLeft = 5 - view.communityCards.length - boardQueue.length;
+
+ return (
+ <>
+ {error &&
+ {config.seed === null
+ ? "Random placement. Apply a seed to make target spawns reproducible."
+ : `Spawn placement draws from a fixed sequence seeded with ${config.seed}. Takes effect on the next run.`}
+
+ {error &&
{error}
}
+
+
+
+
+
+ {config.difficultyOverride === null
+ ? "The lane picked on the range card decides the tier."
+ : `All runs use ${config.difficultyOverride} until this is set back to none.`}
+
+
+
+
+
+
+
+
+
+ Draws every target's exact head circle and torso hit rectangle on the canvas.
+
+
+ >
+ );
+}
diff --git a/src/components/frontend/minigames/dev/RadioDevControls.tsx b/src/components/frontend/minigames/dev/RadioDevControls.tsx
new file mode 100644
index 00000000..634e8d3e
--- /dev/null
+++ b/src/components/frontend/minigames/dev/RadioDevControls.tsx
@@ -0,0 +1,147 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { Label } from "@/components/ui/label";
+import { Switch } from "@/components/ui/switch";
+import { readDevSetting, writeDevSetting } from "./devSettings";
+import { pushDevLog } from "./devLog";
+import { CopyButton, DevSection } from "./primitives";
+
+/**
+ * Radio Traffic controls for the shared minigame dev dock.
+ *
+ * Both toggles are client-only debugging conveniences for the solo game:
+ * - "Show transcript" reveals the generated ground truth beside the game.
+ * - "Freeze timer" pauses the sprint stopwatch and the watch countdown.
+ *
+ * Neither touches submissions: results still carry the same payload and are
+ * validated server side exactly as before. Frozen runs are never flagged or
+ * recorded differently, they are just easier to inspect.
+ */
+
+export const RADIO_DEV_GAME_KEY = "radio";
+export const RADIO_DEV_SETTINGS_EVENT = "ptf:dev-settings-changed";
+
+type RadioDevSettingKey = "showTranscript" | "freezeTimer";
+
+/** Plain-text dump of the round's generated messages, one per line. */
+export function formatTranscript(messages: readonly string[]): string {
+ return messages.map((message, index) => `${index + 1}. ${message}`).join("\n");
+}
+
+export function RadioDevControls({
+ transcript,
+ messageCount,
+}: {
+ readonly transcript: string;
+ readonly messageCount: number;
+}) {
+ const [showTranscript, setShowTranscript] = useState(() =>
+ readDevSetting(RADIO_DEV_GAME_KEY, "showTranscript", false),
+ );
+ const [freezeTimer, setFreezeTimer] = useState(() =>
+ readDevSetting(RADIO_DEV_GAME_KEY, "freezeTimer", false),
+ );
+
+ // Settings are shared with the arena, which also listens for this event, so
+ // the transcript panel and the paused clock follow the dock immediately.
+ useEffect(() => {
+ const sync = () => {
+ setShowTranscript(readDevSetting(RADIO_DEV_GAME_KEY, "showTranscript", false));
+ setFreezeTimer(readDevSetting(RADIO_DEV_GAME_KEY, "freezeTimer", false));
+ };
+ window.addEventListener(RADIO_DEV_SETTINGS_EVENT, sync);
+ return () => window.removeEventListener(RADIO_DEV_SETTINGS_EVENT, sync);
+ }, []);
+
+ const update = (key: RadioDevSettingKey, value: boolean) => {
+ writeDevSetting(RADIO_DEV_GAME_KEY, key, value);
+ if (key === "showTranscript") setShowTranscript(value);
+ else setFreezeTimer(value);
+ pushDevLog("action", `radio: ${key} = ${value}`);
+ window.dispatchEvent(new Event(RADIO_DEV_SETTINGS_EVENT));
+ };
+
+ return (
+ <>
+
+
+
+ {messageCount} message{messageCount === 1 ? "" : "s"} generated this round. The full text
+ renders beside the game while enabled.
+
+ Pauses the sprint stopwatch and the watch countdown. Debugging convenience only; the run
+ still submits the same payload.
+
+
+ >
+ );
+}
+
+/**
+ * Ground-truth transcript rendered next to the game (not inside the dock) so
+ * the operator can read the full generated round while typing.
+ */
+export function RadioTranscriptPanel({
+ messages,
+ messageIndex,
+}: {
+ readonly messages: readonly string[];
+ readonly messageIndex: number;
+}) {
+ return (
+
+ Watch mode appends transmissions as the round generates them.
+
+
+ );
+}
diff --git a/src/components/frontend/minigames/dev/VersusDevControls.tsx b/src/components/frontend/minigames/dev/VersusDevControls.tsx
new file mode 100644
index 00000000..ce6d3746
--- /dev/null
+++ b/src/components/frontend/minigames/dev/VersusDevControls.tsx
@@ -0,0 +1,128 @@
+"use client";
+
+import { useState } from "react";
+import type { VersusAdminCommand } from "@/app/(frontend)/minigames/call-for-fire-versus/actions";
+import {
+ forceExpireVersusMatch,
+ versusAdminCommand,
+} from "@/app/(frontend)/minigames/call-for-fire-versus/actions";
+import type { VersusMatchView } from "@/lib/minigames/call-for-fire-versus/types";
+import { Button } from "@/components/ui/button";
+import { pushDevLog } from "./devLog";
+import { DevButton, DevSection } from "./primitives";
+
+/**
+ * Call for Fire: Versus controls for the shared minigame dev dock. Reveal
+ * fleets flips a match-level flag so views.ts serves both fleets to everyone
+ * (the revealed layout shows up in this dock's State tab); force shot result
+ * arms a one-shot override the acting player's next round consumes; skip turn
+ * passes the clock; force expire tears the match down. Sync rides the existing
+ * polling path every versus client already runs.
+ */
+
+interface VersusDevControlsProps {
+ readonly matchId: string;
+ readonly match: VersusMatchView;
+}
+
+export function VersusDevControls({ matchId, match }: VersusDevControlsProps) {
+ const [error, setError] = useState(null);
+ const revealOn = match.opponentFleet !== undefined;
+
+ const send = async (cmd: VersusAdminCommand) => {
+ pushDevLog("action", `cff-versus: ${cmd.kind} sent`);
+ try {
+ const result = await versusAdminCommand(matchId, cmd);
+ if (!result.success) {
+ const message = result.error ?? "The admin command failed.";
+ setError(message);
+ pushDevLog("error", `cff-versus: ${cmd.kind} failed (${message})`);
+ } else {
+ setError(null);
+ pushDevLog("action", `cff-versus: ${cmd.kind} applied`);
+ }
+ } catch (caught) {
+ const message = caught instanceof Error ? caught.message : "The admin command failed.";
+ setError(message);
+ pushDevLog("error", `cff-versus: ${cmd.kind} threw (${message})`);
+ }
+ };
+
+ return (
+ <>
+ {error &&
{error}
}
+
+
+
+
+ While revealed, every snapshot carries both fleets; inspect them in
+ the State tab.
+
+
+
+
+
+ Arms a one-shot override for the acting player's next round:
+ "hit" snaps an errant round onto the nearest un-struck enemy
+ cell, "miss" suppresses damage even on a struck cell.
+
+
+
+
+
+
+
+
+
+ void send({ kind: "skipTurn" })}
+ >
+ Skip current turn
+
+
+
+
+ {
+ pushDevLog("action", "cff-versus: force-expire-match sent");
+ const result = await forceExpireVersusMatch(matchId);
+ pushDevLog(
+ result.success ? "action" : "error",
+ result.success
+ ? "cff-versus: force-expire-match applied"
+ : `cff-versus: force-expire-match failed (${result.error ?? "unknown"})`,
+ );
+ }}
+ >
+ Force expire match
+
+
+ >
+ );
+}
diff --git a/src/components/frontend/minigames/dev/devLog.ts b/src/components/frontend/minigames/dev/devLog.ts
new file mode 100644
index 00000000..f0a5d158
--- /dev/null
+++ b/src/components/frontend/minigames/dev/devLog.ts
@@ -0,0 +1,86 @@
+/**
+ * Client-side dev console log for the minigame developer dock.
+ *
+ * A module-level ring buffer (newest last, capped at MAX_ENTRIES) shared by
+ * every panel in the dock: game panels push entries when they send actions,
+ * the dock itself pushes snapshot-received entries, and the Log tab renders
+ * the buffer live. Optional console mirroring writes each entry to
+ * `console.debug` as well so a devtools console tells the same story.
+ */
+
+export type DevLogKind = "info" | "action" | "state" | "error";
+
+export interface DevLogEntry {
+ readonly id: number;
+ /** ISO instant the entry was recorded. */
+ readonly at: string;
+ readonly kind: DevLogKind;
+ readonly text: string;
+}
+
+const MAX_ENTRIES = 200;
+const MIRROR_KEY = "ptf.dev.consoleMirror";
+
+let entries: DevLogEntry[] = [];
+let nextId = 1;
+const listeners = new Set<() => void>();
+
+function readMirrorFlag(): boolean {
+ if (typeof window === "undefined") return false;
+ try {
+ return window.localStorage.getItem(MIRROR_KEY) === "1";
+ } catch {
+ return false;
+ }
+}
+
+let mirror = readMirrorFlag();
+
+function emit(): void {
+ for (const listener of listeners) listener();
+}
+
+/** Append an entry, dropping the oldest when the buffer is full. */
+export function pushDevLog(kind: DevLogKind, text: string): void {
+ const entry: DevLogEntry = { id: nextId++, at: new Date().toISOString(), kind, text };
+ entries = [...entries, entry].slice(-MAX_ENTRIES);
+ if (mirror) console.debug(`[dev-console] ${kind}: ${text}`);
+ emit();
+}
+
+export function clearDevLog(): void {
+ if (entries.length === 0) return;
+ entries = [];
+ emit();
+}
+
+/** Stable snapshot reference for useSyncExternalStore (replaced on every push). */
+export function getDevLogEntries(): readonly DevLogEntry[] {
+ return entries;
+}
+
+export function subscribeDevLog(listener: () => void): () => void {
+ listeners.add(listener);
+ return () => listeners.delete(listener);
+}
+
+export function isDevLogMirrored(): boolean {
+ return mirror;
+}
+
+export function setDevLogMirror(on: boolean): void {
+ mirror = on;
+ if (typeof window !== "undefined") {
+ try {
+ window.localStorage.setItem(MIRROR_KEY, on ? "1" : "0");
+ } catch {
+ // Storage unavailable (private mode): the flag just stays session-only.
+ }
+ }
+ emit();
+}
+
+/** Plain-text dump of the whole buffer, newest last. */
+export function formatDevLog(entriesToFormat: readonly DevLogEntry[] = entries): string {
+ return entriesToFormat.map((entry) => `${entry.at} [${entry.kind}] ${entry.text}`).join("\n");
+}
diff --git a/src/components/frontend/minigames/dev/devSettings.ts b/src/components/frontend/minigames/dev/devSettings.ts
new file mode 100644
index 00000000..c88fa284
--- /dev/null
+++ b/src/components/frontend/minigames/dev/devSettings.ts
@@ -0,0 +1,48 @@
+/**
+ * localStorage-backed per-game developer settings for the minigame dev dock.
+ *
+ * Two consumers:
+ * - The dock itself persists its UI state (open/collapsed, active tab).
+ * - Games read tuning overrides at parameter sites (Phase 2 sliders: flappy
+ * gravity/speed/pipe-gap, aim-trainer seeds, etc.). Values are namespaced
+ * per game key so one game's overrides never leak into another.
+ *
+ * Everything degrades to the caller's fallback when storage is unavailable
+ * (private mode, SSR render): dev tooling must never break a game page.
+ */
+
+const PREFIX = "ptf.dev";
+
+function storageKey(gameKey: string, key: string): string {
+ return `${PREFIX}.${gameKey}.${key}`;
+}
+
+export function readDevSetting(gameKey: string, key: string, fallback: T): T {
+ if (typeof window === "undefined") return fallback;
+ try {
+ const raw = window.localStorage.getItem(storageKey(gameKey, key));
+ if (raw === null) return fallback;
+ return JSON.parse(raw) as T;
+ } catch {
+ return fallback;
+ }
+}
+
+export function writeDevSetting(gameKey: string, key: string, value: unknown): void {
+ if (typeof window === "undefined") return;
+ try {
+ window.localStorage.setItem(storageKey(gameKey, key), JSON.stringify(value));
+ } catch {
+ // Storage full or blocked: the setting simply does not persist.
+ }
+}
+
+/** Remove one override so the next read falls back to the game default. */
+export function clearDevSetting(gameKey: string, key: string): void {
+ if (typeof window === "undefined") return;
+ try {
+ window.localStorage.removeItem(storageKey(gameKey, key));
+ } catch {
+ // Nothing to do when storage is unavailable.
+ }
+}
diff --git a/src/components/frontend/minigames/dev/primitives.tsx b/src/components/frontend/minigames/dev/primitives.tsx
new file mode 100644
index 00000000..3432527a
--- /dev/null
+++ b/src/components/frontend/minigames/dev/primitives.tsx
@@ -0,0 +1,123 @@
+"use client";
+
+import { useEffect, useRef, useState, type ReactNode } from "react";
+import { Copy, Check } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { cn } from "@/lib/utils";
+
+/**
+ * Shared building blocks for minigame developer panels. The section chrome
+ * matches the original PokerDevPanel look (bordered box, uppercase header) so
+ * every game's dev controls read as one surface.
+ */
+
+export function DevSection({
+ title,
+ children,
+ className,
+}: {
+ readonly title: string;
+ readonly children?: ReactNode;
+ readonly className?: string;
+}) {
+ return (
+
+
{title}
+ {children}
+
+ );
+}
+
+interface DevButtonProps extends React.ComponentProps {
+ /** Destructive actions arm on the first click and fire on the second. */
+ readonly confirm?: boolean;
+ readonly confirmLabel?: string;
+}
+
+export function DevButton({
+ confirm = false,
+ confirmLabel = "Click again to confirm",
+ onClick,
+ children,
+ className,
+ ...rest
+}: DevButtonProps) {
+ const [armed, setArmed] = useState(false);
+ const timerRef = useRef | null>(null);
+
+ useEffect(
+ () => () => {
+ if (timerRef.current) clearTimeout(timerRef.current);
+ },
+ [],
+ );
+
+ return (
+
+ );
+}
+
+/** Small copy-to-clipboard icon button with a brief "copied" confirmation. */
+export function CopyButton({
+ getText,
+ label,
+ className,
+}: {
+ readonly getText: () => string;
+ readonly label?: string;
+ readonly className?: string;
+}) {
+ const [copied, setCopied] = useState(false);
+ const timerRef = useRef | null>(null);
+
+ useEffect(
+ () => () => {
+ if (timerRef.current) clearTimeout(timerRef.current);
+ },
+ [],
+ );
+
+ return (
+
+ );
+}
diff --git a/src/components/frontend/minigames/dev/useDevLog.ts b/src/components/frontend/minigames/dev/useDevLog.ts
new file mode 100644
index 00000000..45bd9dc1
--- /dev/null
+++ b/src/components/frontend/minigames/dev/useDevLog.ts
@@ -0,0 +1,31 @@
+"use client";
+
+import { useSyncExternalStore } from "react";
+import {
+ clearDevLog,
+ formatDevLog,
+ getDevLogEntries,
+ isDevLogMirrored,
+ pushDevLog,
+ setDevLogMirror,
+ subscribeDevLog,
+ type DevLogEntry,
+ type DevLogKind,
+} from "./devLog";
+
+export type { DevLogEntry, DevLogKind };
+export { clearDevLog, formatDevLog, isDevLogMirrored, pushDevLog, setDevLogMirror };
+
+/**
+ * The dock's live view over the dev console ring buffer. Panels outside the
+ * dock tree can import `pushDevLog` directly from ./devLog; this hook is the
+ * React binding used by the Log tab.
+ */
+export function useDevLog(): {
+ readonly entries: readonly DevLogEntry[];
+ readonly push: (kind: DevLogKind, text: string) => void;
+ readonly clear: () => void;
+} {
+ const entries = useSyncExternalStore(subscribeDevLog, getDevLogEntries, getDevLogEntries);
+ return { entries, push: pushDevLog, clear: clearDevLog };
+}
diff --git a/src/components/frontend/minigames/eod/EodArena.tsx b/src/components/frontend/minigames/eod/EodArena.tsx
index 32eb25e8..ed5e0686 100644
--- a/src/components/frontend/minigames/eod/EodArena.tsx
+++ b/src/components/frontend/minigames/eod/EodArena.tsx
@@ -15,9 +15,11 @@ import { MinesweeperBoard } from "./MinesweeperBoard";
export function EodArena({
initialStats,
currentUserId,
+ isSuperuser = false,
}: {
initialStats: EodStats;
currentUserId: number | string;
+ isSuperuser?: boolean;
}) {
const [refreshKey, setRefreshKey] = useState(0);
const [playing, setPlaying] = useState(false);
@@ -65,6 +67,7 @@ export function EodArena({
onGameRecorded={() => setRefreshKey((key) => key + 1)}
onPhaseChange={onPhaseChange}
onDifficultyChange={setSelectedDifficulty}
+ isSuperuser={isSuperuser}
/>
number {
+ let state = seed >>> 0;
+ return () => {
+ state = (state + 0x6d2b79f5) >>> 0;
+ let value = state;
+ value = Math.imul(value ^ (value >>> 15), value | 1);
+ value ^= value + Math.imul(value ^ (value >>> 7), value | 61);
+ return ((value ^ (value >>> 14)) >>> 0) / 4_294_967_296;
+ };
+}
+
+function createBoard(config: GameConfig, safeIndex: number, seed: number | null = null): Board {
const size = config.rows * config.cols;
const safe = new Set([safeIndex, ...neighbors(safeIndex, config.rows, config.cols)]);
+ const random = seed === null ? Math.random : mulberry32(seed);
const mines = new Set();
while (mines.size < config.mines) {
- const candidate = Math.floor(Math.random() * size);
+ const candidate = Math.floor(random() * size);
if (!safe.has(candidate)) mines.add(candidate);
}
const mined = emptyBoard(size).map((cell, index) => ({ ...cell, mine: mines.has(index) }));
@@ -192,11 +225,13 @@ export function MinesweeperBoard({
onGameRecorded,
onPhaseChange,
onDifficultyChange,
+ isSuperuser = false,
}: {
initialStats: EodStats;
onGameRecorded: () => void;
onPhaseChange: (phase: Phase) => void;
onDifficultyChange: (difficulty: EodDifficulty) => void;
+ isSuperuser?: boolean;
}) {
const router = useRouter();
const { expired, expiredRef } = useSessionExpired();
@@ -220,6 +255,10 @@ export function MinesweeperBoard({
const [isMobile, setIsMobile] = useState(false);
const [isLandscape, setIsLandscape] = useState(false);
const [isNarrow, setIsNarrow] = useState(false);
+ const [devRevealLayout, setDevRevealLayout] = useState(false);
+ const [devDigAnywhere, setDevDigAnywhere] = useState(false);
+ const [devSeed, setDevSeed] = useState(null);
+ const devSeedRef = useRef(null);
const generatedRef = useRef(false);
const previousViewportRef = useRef(null);
const submittingRef = useRef(false);
@@ -304,6 +343,34 @@ export function MinesweeperBoard({
[customConfig, difficulty, expiredRef, isLandscape, isMobile, onDifficultyChange, setPhaseSafe],
);
+ // The dev dock persists its overrides in localStorage and announces each
+ // change; the board re-reads them here so a toggle lands without prop
+ // plumbing. These settings only affect local rendering and click handling,
+ // never the submitted result payload.
+ const resetRef = useRef(reset);
+ useEffect(() => {
+ resetRef.current = reset;
+ }, [reset]);
+
+ useEffect(() => {
+ const applyDevSettings = () => {
+ setDevRevealLayout(readDevSetting(EOD_DEV_GAME_KEY, "revealLayout", false));
+ setDevDigAnywhere(readDevSetting(EOD_DEV_GAME_KEY, "digAnywhere", false));
+ const stored = readDevSetting(EOD_DEV_GAME_KEY, "seed", null);
+ const nextSeed =
+ typeof stored === "number" && Number.isFinite(stored) ? Math.trunc(stored) : null;
+ if (devSeedRef.current === nextSeed) return;
+ devSeedRef.current = nextSeed;
+ setDevSeed(nextSeed);
+ // A seed is consumed when the field is generated on the first dig, so
+ // restart the sector to make the change visible right away.
+ resetRef.current();
+ };
+ applyDevSettings();
+ window.addEventListener(DEV_SETTINGS_CHANGED_EVENT, applyDevSettings);
+ return () => window.removeEventListener(DEV_SETTINGS_CHANGED_EVENT, applyDevSettings);
+ }, []);
+
useEffect(() => {
const viewportKey = `${isMobile}-${isLandscape}`;
if (previousViewportRef.current === null) {
@@ -443,18 +510,32 @@ export function MinesweeperBoard({
if (expiredRef.current) return;
const existing = board[index];
if (!existing || existing.flagged || existing.revealed) return;
- const workingBoard = generatedRef.current ? board : createBoard(config, index);
+ const workingBoard = generatedRef.current ? board : createBoard(config, index, devSeed);
generatedRef.current = true;
const cell = workingBoard[index];
if (!cell) return;
if (phase === "ready") setPhaseSafe("playing");
if (cell.mine) {
- finishGame(
- false,
- workingBoard.map((item, cellIndex) =>
- cellIndex === index ? { ...item, exploded: true } : item,
- ),
+ if (!devDigAnywhere) {
+ finishGame(
+ false,
+ workingBoard.map((item, cellIndex) =>
+ cellIndex === index ? { ...item, exploded: true } : item,
+ ),
+ );
+ return;
+ }
+ // Dev tool: "dig anywhere" clears the charge instead of ending the run.
+ // Local to this client; the submitted payload keeps its normal shape.
+ const row = Math.floor(index / config.cols) + 1;
+ const col = (index % config.cols) + 1;
+ pushDevLog("action", `eod: dig-anywhere cleared a charge at row ${row} col ${col}`);
+ playReveal();
+ const safeBoard = workingBoard.map((item, cellIndex) =>
+ cellIndex === index ? { ...item, revealed: true } : item,
);
+ setBoard(safeBoard);
+ if (safeBoard.every((item) => item.mine || item.revealed)) finishGame(true, safeBoard);
return;
}
playReveal();
@@ -462,7 +543,7 @@ export function MinesweeperBoard({
setBoard(nextBoard);
if (nextBoard.every((item) => item.mine || item.revealed)) finishGame(true, nextBoard);
},
- [board, config, expiredRef, finishGame, phase, setPhaseSafe],
+ [board, config, devDigAnywhere, devSeed, expiredRef, finishGame, phase, setPhaseSafe],
);
const toggleFlag = useCallback(
@@ -492,6 +573,42 @@ export function MinesweeperBoard({
(count, cell) => count + (cell.incorrectFlagged ? 1 : 0),
0,
);
+
+ // Cheap plain-object view of the live board for the dev dock State tab.
+ const devSnapshot = useMemo(
+ () => ({
+ phase,
+ difficulty,
+ sector: config.label,
+ grid: { rows: config.rows, cols: config.cols },
+ cells: board.length,
+ revealed: board.reduce((count, cell) => count + (cell.revealed ? 1 : 0), 0),
+ flagged: flaggedCount,
+ mines: config.mines,
+ minesRemaining: config.mines - flaggedCount,
+ seconds,
+ dev: {
+ revealLayout: devRevealLayout,
+ digAnywhere: devDigAnywhere,
+ seed: devSeed,
+ },
+ }),
+ [
+ board,
+ config.cols,
+ config.label,
+ config.mines,
+ config.rows,
+ devDigAnywhere,
+ devRevealLayout,
+ devSeed,
+ difficulty,
+ flaggedCount,
+ phase,
+ seconds,
+ ],
+ );
+
const statusClass =
phase === "over"
? lastRun?.won
@@ -555,6 +672,10 @@ export function MinesweeperBoard({
"border-amber-300 bg-amber-500/25 text-amber-200 shadow-[inset_0_1px_0_rgb(255_255_255_/_0.14),0_1px_2px_rgb(0_0_0_/_0.35)]",
revealedMine && "border-destructive bg-destructive/30 text-red-300",
cell.exploded && "border-destructive bg-destructive text-destructive-foreground",
+ devRevealLayout &&
+ cell.mine &&
+ !cell.revealed &&
+ "ring-2 ring-inset ring-red-500/80",
cell.revealed && cell.adjacent > 0 && NUMBER_CLASSES[cell.adjacent],
)}
onClick={() => {
@@ -915,6 +1036,10 @@ export function MinesweeperBoard({
revealedMine && "border-destructive bg-destructive/30 text-red-300",
cell.exploded &&
"border-destructive bg-destructive text-destructive-foreground",
+ devRevealLayout &&
+ cell.mine &&
+ !cell.revealed &&
+ "ring-2 ring-inset ring-red-500/80",
cell.revealed && cell.adjacent > 0 && NUMBER_CLASSES[cell.adjacent],
)}
onClick={() => {
@@ -1001,6 +1126,15 @@ export function MinesweeperBoard({
{stats.eodXp}
+
+
+
+
);
}
diff --git a/src/components/frontend/minigames/flappy/FlappyArena.tsx b/src/components/frontend/minigames/flappy/FlappyArena.tsx
index 15bbf2f9..e963d20e 100644
--- a/src/components/frontend/minigames/flappy/FlappyArena.tsx
+++ b/src/components/frontend/minigames/flappy/FlappyArena.tsx
@@ -11,9 +11,11 @@ import { FlappyLeaderboard } from "./FlappyLeaderboard";
export function FlappyArena({
initialStats,
currentUserId,
+ isSuperuser = false,
}: {
initialStats: FlappyStats;
currentUserId: number | string;
+ isSuperuser?: boolean;
}) {
const [refreshKey, setRefreshKey] = useState(0);
@@ -25,7 +27,12 @@ export function FlappyArena({
return (
Acquire
- Up to {AIM_TRAINER_DIFFICULTIES[difficulty].maxConcurrentTargets} hostile silhouettes
- are active at once, plus an occasional blue civilian that never counts toward the
- limit. Targets rebound off each other and the range walls.
+ Up to {activeConfig.maxConcurrentTargets} hostile silhouettes are active at once, plus
+ an occasional blue civilian that never counts toward the limit. Targets rebound off
+ each other and the range walls.
@@ -166,7 +246,7 @@ export function AimTrainerArena({
Qualify
The course adds an accuracy bonus and records the best score for each lane. Current
- target window: {AIM_TRAINER_DIFFICULTIES[difficulty].targetLifetimeMs / 1000}s.
+ target window: {activeConfig.targetLifetimeMs / 1000}s.