move presence to d1

This commit is contained in:
Devin Zuczek
2026-07-11 12:37:22 -04:00
parent aad184181b
commit fb553c2fd0
16 changed files with 452 additions and 131 deletions
+3 -5
View File
@@ -9,12 +9,10 @@ export type Env = SharedHonoEnv & {
// with `await env.JWT_SECRET.get()`; all workers bind the same store so tokens
// signed by `auth` verify here.
JWT_SECRET: SecretsStoreSecret
// D1 database holding rooms (JSON blob + generated columns). See rooms-db.ts.
// Shared `recflare` D1. Owns the rooms tables (JSON blob + generated columns,
// see rooms-db.ts) and migrates the shared `presence` table, which is read here
// to resolve the caller's current room instance for the photon access token.
DB: D1Database
// Shared player-presence KV (owned by the `match` worker). Read here to resolve
// the caller's current room instance for the photon access token — the
// equivalent of the reference server's HeartbeatDB.GetPlayerHeartbeat.
RECFLARE_MATCH_PRESENCE: KVNamespace
// SignalR notifications hub (DO owned by the `notify` worker). Bound here to
// push RoomUpdate notifications when a room is mutated.
RECFLARE_NOTIFICATIONS_HUB: DurableObjectNamespace<NotificationsHub>