feat(ui): restore Logo countdown and gated skip
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { ChannelIdentity } from './identity.ts';
|
||||
import { DEFAULT_LAUNCH_WAIT_TIME_MS } from './sources/defaults.ts';
|
||||
|
||||
/** One in-memory view over the JSON root received by legacy getConfig_Succ. */
|
||||
export interface RemoteConfig {
|
||||
@@ -10,6 +11,21 @@ export interface ConfigFetcher {
|
||||
fetch(gameserver: string, cacheBust?: () => string): Promise<unknown>;
|
||||
}
|
||||
|
||||
/** Legacy initial value -> hall_config merge -> scoped top-level override. */
|
||||
export function resolveLaunchWaitTime(remote: RemoteConfig): number {
|
||||
let value: unknown = DEFAULT_LAUNCH_WAIT_TIME_MS;
|
||||
const hall = remote.getValue('hall_config');
|
||||
if (typeof hall === 'object' && hall !== null && Object.prototype.hasOwnProperty.call(hall, 'launchWaitTime')) {
|
||||
value = (hall as Record<string, unknown>).launchWaitTime;
|
||||
}
|
||||
const override = remote.getValue('launchWaitTime');
|
||||
if (override !== null && override !== undefined) value = override;
|
||||
if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {
|
||||
throw new Error('Invalid launchWaitTime: expected finite nonnegative milliseconds');
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
export class ConfigFetchError extends Error {}
|
||||
export class ConfigParseError extends Error {}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import type { ChannelIdentity } from '../identity.ts';
|
||||
|
||||
/** Legacy GameData launchWaitTime (04_Data.js): timer units are milliseconds. */
|
||||
export const DEFAULT_LAUNCH_WAIT_TIME_MS = 10;
|
||||
|
||||
/**
|
||||
* 构建期默认渠道身份(旧 version.js 等价物)。
|
||||
* gameid 每子游戏固定写死;agentid/channelid/marketid/version 为默认,运行期由 query/native/profile 覆盖。
|
||||
|
||||
Reference in New Issue
Block a user