Integrate unfinished server-rs refactor worklists

This commit is contained in:
2026-04-30 13:39:06 +08:00
parent 62934b0809
commit 7ab0933f6d
676 changed files with 24487 additions and 21531 deletions

View File

@@ -127,6 +127,7 @@ describe('runtimeSnapshot', () => {
},
runtimeActionVersion: 3,
runtimeSessionId: 'runtime-main',
storySessionId: null,
} as GameState,
currentStory: createStory('服务端恢复故事'),
bottomTab: 'inventory',

View File

@@ -287,6 +287,11 @@ export function normalizeSavedGameState(gameState: GameState) {
typeof hydratableState.runtimeSessionId === 'string'
? hydratableState.runtimeSessionId
: null,
storySessionId:
typeof hydratableState.storySessionId === 'string' &&
hydratableState.storySessionId.trim()
? hydratableState.storySessionId.trim()
: null,
} satisfies HydratedGameState);
}
@@ -315,6 +320,8 @@ export function isHydratedSnapshotState(
typeof gameState.runtimeActionVersion === 'number' &&
(gameState.runtimeSessionId === null ||
typeof gameState.runtimeSessionId === 'string') &&
(gameState.storySessionId === null ||
typeof gameState.storySessionId === 'string') &&
(!gameState.playerCharacter ||
Boolean(
gameState.playerEquipment &&

View File

@@ -10,6 +10,7 @@ export type HydratedGameState = GameState & {
playerEquipment: GameState['playerEquipment'];
runtimeActionVersion: number;
runtimeSessionId: string | null;
storySessionId: string | null;
};
export type SnapshotState = {