feat: add anti-cheat awareness step to benchmark wizard

This commit is contained in:
2026-04-30 20:40:45 +08:00
parent 5f4d618d85
commit 1bfddafde4
4 changed files with 138 additions and 13 deletions
+13 -1
View File
@@ -1,6 +1,6 @@
import { notFound } from "next/navigation"
import { db } from "@/lib/db/index"
import { games, gameVersions, performanceEntries } from "@/lib/db/schema"
import { games, gameVersions, performanceEntries, gamePlatformSupport } from "@/lib/db/schema"
import { eq, sql } from "drizzle-orm"
import { GameEntryWizard } from "@/components/wizard/game-entry-wizard"
@@ -68,6 +68,17 @@ export default async function SubmitBenchmarkPage({
.returning()
}
// Fetch platform support for anti-cheat awareness
const platformSupport = await db
.select({
hardwareSlug: gamePlatformSupport.hardwareSlug,
antiCheatRelevant: gamePlatformSupport.antiCheatRelevant,
antiCheatName: gamePlatformSupport.antiCheatName,
antiCheatStatus: gamePlatformSupport.antiCheatStatus,
})
.from(gamePlatformSupport)
.where(eq(gamePlatformSupport.gameId, game.id))
// If editing, fetch the existing performance entry
let editEntry = null
if (edit) {
@@ -95,6 +106,7 @@ export default async function SubmitBenchmarkPage({
gameId={game.id}
gameVersionId={version.id}
editEntry={editEntry}
platformSupport={platformSupport}
/>
</div>
)