feat(gateway): 프로필별 첫 기수 번호를 관리한다
첫 기수 번호를 완료 게임 수의 기준값으로 적용하고 0기를 API와 화면에서 보존한다. 시즌 번호와 독립된 RESET 계약을 관리 패널, 테스트, 운영 문서에 반영한다.
This commit is contained in:
@@ -51,6 +51,7 @@ export interface ScenarioInstallOptions {
|
||||
autorunUser?: ScenarioAutorunOptions | null;
|
||||
preopenAt?: Date | null;
|
||||
season?: number;
|
||||
firstGameIdx?: number;
|
||||
serverId?: string;
|
||||
installOperationId?: string;
|
||||
installCommitSha?: string;
|
||||
@@ -298,6 +299,12 @@ export const seedScenarioToDatabase = async (options: ScenarioSeedOptions): Prom
|
||||
lastTurnTime: formatDateTime(now),
|
||||
};
|
||||
|
||||
const firstGameIdx =
|
||||
typeof install?.firstGameIdx === 'number' && Number.isFinite(install.firstGameIdx) && install.firstGameIdx >= 0
|
||||
? Math.floor(install.firstGameIdx)
|
||||
: 1;
|
||||
worldMeta.firstGameIdx = firstGameIdx;
|
||||
|
||||
if (typeof install?.season === 'number' && Number.isFinite(install.season)) {
|
||||
worldMeta.season = Math.floor(install.season);
|
||||
}
|
||||
@@ -390,7 +397,7 @@ export const seedScenarioToDatabase = async (options: ScenarioSeedOptions): Prom
|
||||
// Ref fixes server_cnt once during ResetHelper initialization. Keep the
|
||||
// frequently rendered game index in the same persisted read model and
|
||||
// exclude abandoned or unfinished rows from the official sequence.
|
||||
worldMeta.gameIdx = completedGameCount + 1;
|
||||
worldMeta.gameIdx = completedGameCount + firstGameIdx;
|
||||
const archivedWorldMeta = { ...worldMeta };
|
||||
delete archivedWorldMeta.hiddenSeed;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user