Add MineGeo gameplay systems and interface

This commit is contained in:
2026-10-10 10:27:47 +05:00
parent bf01d9801d
commit 9af71c85c2
47 changed files with 9954 additions and 93 deletions

View File

@@ -0,0 +1,29 @@
import { timingSafeEqual } from "node:crypto";
import { NextRequest, NextResponse } from "next/server";
import { dispatchDiscordAnnouncements } from "@/lib/discord-announcements";
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
export const maxDuration = 300;
export async function GET(request: NextRequest) {
const secret = process.env.CRON_SECRET;
const actual = Buffer.from(request.headers.get("authorization") ?? "");
const expected = Buffer.from(`Bearer ${secret ?? ""}`);
if (
!secret ||
actual.length !== expected.length ||
!timingSafeEqual(actual, expected)
)
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
try {
await dispatchDiscordAnnouncements();
return NextResponse.json(
{ ok: true },
{ headers: { "Cache-Control": "no-store" } },
);
} catch {
return NextResponse.json(
{ error: "Discord dispatch will retry" },
{ status: 503 },
);
}
}