feat: v0.7.0 — server-authoritative sim engine: tick-on-read clock (time-scale + pause via POST /api/sim), contract expiry + market spawn, analytic plane movement/finalization

This commit is contained in:
2026-09-17 12:38:52 +00:00
parent 7fdc43bc7e
commit 96835e935d
22 changed files with 1393 additions and 55 deletions
+4
View File
@@ -1,7 +1,11 @@
import { tickNow } from '@/lib/sim/engine';
import { getStateSnapshot } from '@/lib/game/state';
export async function GET() {
try {
// Tick-on-read (v0.7.0): advance the sim clock before snapshotting so every
// read reflects current game time (expiry/finalize/spawn run inside the tick).
await tickNow();
return Response.json(await getStateSnapshot());
} catch (err) {
console.error('failed to load game state', err);