generated from nhcarrigan/template
feat: add schema version system with outdated save detection
Introduces a schema version field to GameState. Saves without the current schema version are flagged on load (showing a modal prompting reset or proceed), and cloud saves from outdated clients are rejected server-side. Removes all backfill code now that outdated saves are handled via the reset flow instead. New POST /game/reset endpoint creates a fresh save for players who choose to reset. Save version and current schema version are displayed in the sidebar below the app version.
This commit is contained in:
@@ -48,6 +48,10 @@ export interface LoadResponse {
|
||||
loginBonus: LoginBonusResult | null;
|
||||
/** Current login streak (always present) */
|
||||
loginStreak: number;
|
||||
/** True when the player's save data is from an older schema version */
|
||||
schemaOutdated: boolean;
|
||||
/** The current expected schema version from the server */
|
||||
currentSchemaVersion: number;
|
||||
}
|
||||
|
||||
export interface BossChallengeRequest {
|
||||
|
||||
@@ -49,4 +49,6 @@ export interface GameState {
|
||||
companions?: CompanionState;
|
||||
/** Story chapter unlock and completion state — optional for backwards compatibility */
|
||||
story?: StoryState;
|
||||
/** Schema version — used to detect saves from older game versions */
|
||||
schemaVersion?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user