add version check for 20230414 client

This commit is contained in:
Devin Zuczek
2026-07-23 12:23:30 -04:00
parent 7ab171b646
commit 2f6a40279d
10 changed files with 42 additions and 23 deletions
+8
View File
@@ -24,6 +24,14 @@
/** Presence is kept this long (s) after the last matchmake/heartbeat refresh. */
export const PRESENCE_TTL_SECONDS = 900
/**
* Game build version reported in presence (and echoed in the auth token's `rn.ver`
* claim). This is a server-side constant — the client doesn't supply it, and an
* empty value breaks the client's presence/version handling. Matches our target
* 2023 client build.
*/
export const GAME_VERSION = '20230414'
/** Schema DDL (mirror of migrations/0006_presence.sql). */
export const PRESENCE_SCHEMA_DDL: string[] = [
`CREATE TABLE IF NOT EXISTS presence (
+1
View File
@@ -10,6 +10,7 @@
"check:types": "run-tsc"
},
"dependencies": {
"@repo/domain": "workspace:*",
"hono": "4.12.27"
},
"devDependencies": {
+3 -2
View File
@@ -10,6 +10,8 @@
import { sign, verify } from 'hono/jwt'
import { GAME_VERSION } from '@repo/domain'
/** Token lifetime in seconds (mirrored in the `expires_in` response field). */
export const TOKEN_TTL_SECONDS = 3600
@@ -127,8 +129,7 @@ export async function generateToken(
idp: 'local',
platform,
platform_id: platformId,
'rn.ver': '20230302',
// Same PlatformType int as the `platform` claim — it was pinned to Steam.
'rn.ver': GAME_VERSION,
'rn.plat': platform,
role: [...BASE_ROLES, ...extraRoles],
scope: TOKEN_SCOPES,