fix: 가오픈 동안 서버 게임 시계를 정지한다
정식 오픈 시각을 게임 시계 anchor로 전달하고, API가 실제 진행 상태와 시작 경계를 반환하게 한다. 프론트는 추가 조회 없이 경계에서 자동으로 시계를 시작한다.
This commit is contained in:
@@ -396,6 +396,7 @@ const parseInstallOptions = (
|
||||
joinMode: joinMode === 'full' || joinMode === 'onlyRandom' ? joinMode : undefined,
|
||||
autorunUser: autorunUser ?? null,
|
||||
preopenAt: preopenAt ?? null,
|
||||
openAt: openAt ?? null,
|
||||
installOperationId: action.installOperationId,
|
||||
};
|
||||
|
||||
@@ -2173,6 +2174,7 @@ export class GatewayOrchestrator implements GatewayOrchestratorHandle {
|
||||
? {
|
||||
...options.installOptions,
|
||||
preopenAt: options.installOptions.preopenAt?.toISOString() ?? null,
|
||||
openAt: options.installOptions.openAt?.toISOString() ?? null,
|
||||
}
|
||||
: undefined,
|
||||
adminUser: options.adminUser,
|
||||
|
||||
@@ -9,7 +9,10 @@ interface ProfileSeedRequest {
|
||||
scenarioId: number;
|
||||
tickSeconds?: number;
|
||||
now: string;
|
||||
installOptions?: Omit<ScenarioInstallOptions, 'preopenAt'> & { preopenAt?: string | null };
|
||||
installOptions?: Omit<ScenarioInstallOptions, 'preopenAt' | 'openAt'> & {
|
||||
preopenAt?: string | null;
|
||||
openAt?: string | null;
|
||||
};
|
||||
adminUser?: AdminSeedUser | null;
|
||||
}
|
||||
|
||||
@@ -49,6 +52,11 @@ export const runProfileSeedCli = async (env: NodeJS.ProcessEnv = process.env): P
|
||||
if (preopenAt && Number.isNaN(preopenAt.getTime())) {
|
||||
throw new Error('Profile seed preopenAt must be an ISO date-time.');
|
||||
}
|
||||
const rawOpenAt = request.installOptions?.openAt;
|
||||
const openAt = typeof rawOpenAt === 'string' ? new Date(rawOpenAt) : null;
|
||||
if (openAt && Number.isNaN(openAt.getTime())) {
|
||||
throw new Error('Profile seed openAt must be an ISO date-time.');
|
||||
}
|
||||
const resourceRoot = path.join(process.cwd(), 'resources');
|
||||
|
||||
await seedProfileDatabase({
|
||||
@@ -61,6 +69,7 @@ export const runProfileSeedCli = async (env: NodeJS.ProcessEnv = process.env): P
|
||||
? {
|
||||
...request.installOptions,
|
||||
preopenAt,
|
||||
openAt,
|
||||
}
|
||||
: undefined,
|
||||
scenarioOptions: { scenarioRoot: path.join(resourceRoot, 'scenario') },
|
||||
|
||||
Reference in New Issue
Block a user