mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 14:41:28 -07:00
update some naming conventions
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Account storage on the shared `rec-rooms` D1 database. Each account is a single
|
||||
* Account storage on the shared `recflare` D1 database. Each account is a single
|
||||
* JSON blob in the `data` column; queryable fields (AccountId, Username) are
|
||||
* SQLite generated (virtual) columns extracted from that JSON and indexed —
|
||||
* the same JSON-blob pattern the `rooms` worker uses.
|
||||
|
||||
@@ -87,7 +87,7 @@ async function placeNewPlayerInOrientation(env: App['Bindings'], accountId: numb
|
||||
platform: 0,
|
||||
appVersion: '20230302',
|
||||
}
|
||||
await env.MATCH_PRESENCE.put(`presence:${accountId}`, JSON.stringify(presence), {
|
||||
await env.RECFLARE_MATCH_PRESENCE.put(`presence:${accountId}`, JSON.stringify(presence), {
|
||||
expirationTtl: PRESENCE_TTL,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export type Env = SharedHonoEnv & {
|
||||
// Shared match-presence KV (owned by the `match` worker). On account creation
|
||||
// the new player's presence is seeded to the Orientation room so the match
|
||||
// heartbeat keeps them there instead of bouncing them to the dorm.
|
||||
MATCH_PRESENCE: KVNamespace
|
||||
RECFLARE_MATCH_PRESENCE: KVNamespace
|
||||
}
|
||||
|
||||
/** Variables can be extended */
|
||||
|
||||
@@ -139,7 +139,7 @@ describe('auth worker routes', () => {
|
||||
test('POST /connect/token create_account seeds the new player into Orientation', async () => {
|
||||
const payload = await tokenFor('grant_type=create_account&platform_id=steam-456')
|
||||
const sub = payload.sub as string
|
||||
const presence = await env.MATCH_PRESENCE.get<{
|
||||
const presence = await env.RECFLARE_MATCH_PRESENCE.get<{
|
||||
roomInstance: { roomInstanceId: number; roomId: number; location: string; name: string }
|
||||
}>(`presence:${sub}`, 'json')
|
||||
expect(presence).not.toBeNull()
|
||||
|
||||
@@ -4,14 +4,16 @@
|
||||
"main": "src/auth.app.ts",
|
||||
"compatibility_date": "2025-09-20",
|
||||
"compatibility_flags": ["nodejs_compat"],
|
||||
// Shared D1 database (also used by the rooms worker). The `auth` worker owns
|
||||
// the `accounts` table; a dedicated migrations_table keeps its migration
|
||||
// history separate from the rooms worker's migrations on the same database.
|
||||
// Shared `recflare` D1 database (also used by the rooms worker). The `auth` worker
|
||||
// owns the `accounts` table; a dedicated migrations_table keeps its migration
|
||||
// history separate from the rooms worker's migrations on the same database. The
|
||||
// "local" placeholder is replaced with the real id from RECFLARE_D1 (see .env) at
|
||||
// deploy time.
|
||||
"d1_databases": [
|
||||
{
|
||||
"binding": "DB",
|
||||
"database_name": "rec-rooms",
|
||||
"database_id": "d44083e1-5bfe-4467-aa9a-f13c5c2496d5",
|
||||
"database_name": "recflare",
|
||||
"database_id": "local",
|
||||
"migrations_dir": "migrations",
|
||||
"migrations_table": "d1_migrations_auth"
|
||||
}
|
||||
@@ -20,7 +22,7 @@
|
||||
// accounts into the Orientation room on signup.
|
||||
"kv_namespaces": [
|
||||
{
|
||||
"binding": "MATCH_PRESENCE",
|
||||
"binding": "RECFLARE_MATCH_PRESENCE",
|
||||
"id": "9f53f04b7dd244658d59f515a14748b6"
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user