Integrate unfinished server-rs refactor worklists
This commit is contained in:
@@ -127,6 +127,7 @@ describe('runtimeSnapshot', () => {
|
||||
},
|
||||
runtimeActionVersion: 3,
|
||||
runtimeSessionId: 'runtime-main',
|
||||
storySessionId: null,
|
||||
} as GameState,
|
||||
currentStory: createStory('服务端恢复故事'),
|
||||
bottomTab: 'inventory',
|
||||
|
||||
@@ -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 &&
|
||||
|
||||
@@ -10,6 +10,7 @@ export type HydratedGameState = GameState & {
|
||||
playerEquipment: GameState['playerEquipment'];
|
||||
runtimeActionVersion: number;
|
||||
runtimeSessionId: string | null;
|
||||
storySessionId: string | null;
|
||||
};
|
||||
|
||||
export type SnapshotState = {
|
||||
|
||||
Reference in New Issue
Block a user