web/website/docs/KIT-EXCHANGE-INGAME-HANDOFF.md
Dev 6deb4a2e7d DuneRealms V2 clean baseline
Owner-authorised history reset; current source tree preserved exactly.
2026-11-13 00:05:14 +01:00

3.4 KiB
Raw Blame History

Kit Exchange: website-to-game integration handoff

Scope: Alpha 1.0.0.5 / Task 09. Website, control panel, and gateway preparation only. Do not change, build, publish or deploy Minecraft plugins as part of this work. In-game implementation is deferred to the next game update.

Existing routes (preserve these contracts)

Consumer Method CP path Native path Notes
CP market GET /api/kits/catalogue /kits/catalogue Public catalogue; no identity query override
Linked player GET /api/kits/arc /kits/arc?uuid=<linked UUID> Linked UUID comes from DB, not browser
Linked player GET /api/kits/orders /kits/orders?uuid=<linked UUID> Response identity must match linked UUID
Linked player POST /api/kits/redeem /kits/redeem {uuid,code}; server-side UUID injection
Linked player POST /api/kits/arc/claim /kits/arc/claim {uuid,index}; chapter 0–4
Linked buyer POST /api/kits/cart/checkout /kits/cart/checkout {buyerUuid,cartId,lines}; validate versions/prices
Kit studio GET/POST /api/kits/studio Native /kits/arc and /kits/player lookups Workshop and publishing actions; DB-backed
Protected network studio GET/POST /api/kits/server-studio Native /kits/arc and /kits/player lookups Protected rank and registered owner required

The website's read-token-protected catalogue bridge is /internal/kits/catalogue, which obtains native /kits/catalogue and applies the kit-policy-v2-publish-enabled setting. The public market uses the internal catalogue bridge. Do not expose native bearer tokens in browser code.

Rollout gates and safe behavior

  • kit-policy-v2-publish-enabled controls non-personal kit purchases and publishing availability. Keep it disabled until the next game update implements and verifies the full in-game delivery path. Existing personal-sale behavior is deliberately unchanged.
  • kit-legendary-upgrade-delivery-ready is independent; do not enable until upgrade delivery is verified.
  • Website preparation must not grant items, mark orders fulfilled, invent receipts, or treat a successful CP request as proof of in-game delivery.
  • Existing CP authorization, origin checks, linked UUID binding, JSON-only writes, and native service authentication remain mandatory.
  • Verify end-to-end ordering, one-time redemption, retry/idempotency, delivery after disconnect, duplicate claims, refunds/failures and account unlink/relink behavior after the plugin update, before enabling the gate.

Next game-update integration checklist

  1. Implement/verify native endpoints listed above with the same request and response identity semantics.
  2. Persist purchase orders and claim state transactionally; preserve receipts across retries and restarts.
  3. Connect in-game claim UI to the native order/redeem path; do not let clients choose a different UUID.
  4. Exercise staging purchases and claims with Java and Bedrock clients, including reconnect/restart and insufficient balance.
  5. Enable the publish/delivery gate only after staged verification and an authorized release decision.

Verification in this branch

Run node --test website/tests/kit-market-identity.test.mjs website/tests/kit-studio-fetch-policy.test.mjs website/tests/kit-ingame-contract.test.mjs. These are website/gateway checks, not Minecraft plugin or live-delivery tests.