feat: 메인 화면에 정식 기수 표시

This commit is contained in:
2026-08-20 16:22:05 +00:00
parent b3b6be7a16
commit daa96b79aa
10 changed files with 173 additions and 8 deletions
+14 -3
View File
@@ -323,9 +323,6 @@ export const seedScenarioToDatabase = async (options: ScenarioSeedOptions): Prom
options: install.autorunUser.options,
};
}
const archivedWorldMeta = { ...worldMeta };
delete archivedWorldMeta.hiddenSeed;
await connector.connect();
try {
const result: ScenarioSeedResult = { seed, warnings, applied: true };
@@ -383,6 +380,20 @@ export const seedScenarioToDatabase = async (options: ScenarioSeedOptions): Prom
await prisma.worldState.deleteMany();
}
const serverId = typeof worldMeta.serverId === 'string' ? worldMeta.serverId : undefined;
const completedGameCount = await prisma.gameHistory.count({
where: {
status: 'COMPLETED',
...(serverId ? { serverId: { not: serverId } } : {}),
},
});
// 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;
const archivedWorldMeta = { ...worldMeta };
delete archivedWorldMeta.hiddenSeed;
await prisma.worldState.create({
data: {
scenarioCode: String(options.scenarioId),