feat(config): unify startup mode and server selection

This commit is contained in:
2026-09-05 22:52:14 +08:00
parent 239af0aa39
commit facceeae9b
26 changed files with 204 additions and 240 deletions
@@ -2,14 +2,14 @@ import { remoteFixture } from '../../fixtures/remote-config.ts';
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { BUILD_IDENTITY } from '../../../YouleNexus/assets/framework/config/sources/defaults.ts';
import { PROFILES } from '../../../YouleNexus/assets/framework/config/profiles.ts';
import { STARTUP_CONFIG } from '../../../YouleNexus/assets/framework/config/profiles.ts';
import type { LocalStartupContext } from '../../../YouleNexus/assets/framework/config/local-startup.ts';
import { LOCAL_MACHINE_KEY, localAccountKey, type LocalStoragePort } from '../../../YouleNexus/assets/framework/adapters/local/local-storage.ts';
import { createLocalLoginSources, type LocalHostSnapshot } from '../../../YouleNexus/assets/framework/adapters/local/login-sources.ts';
const context: LocalStartupContext = { hostKind: 'h5', profile: 'local', config: {
mode: 'debug', isDebugger: true, source: 'remote', gameserver: PROFILES.local!.gameserver, ...remoteFixture(),
servers: PROFILES.local!.servers!, identity: BUILD_IDENTITY,
startupConfig: STARTUP_CONFIG, mode: 'debug', isDebugger: true, source: 'remote', gameserver: STARTUP_CONFIG.gameserver, ...remoteFixture(),
servers: STARTUP_CONFIG.localServers, identity: BUILD_IDENTITY,
} };
class MapStorage implements LocalStoragePort {
readonly values = new Map<string, string>();
@@ -2,7 +2,7 @@ import { remoteFixture } from '../../fixtures/remote-config.ts';
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { BUILD_IDENTITY } from '../../../YouleNexus/assets/framework/config/sources/defaults.ts';
import { PROFILES } from '../../../YouleNexus/assets/framework/config/profiles.ts';
import { STARTUP_CONFIG } from '../../../YouleNexus/assets/framework/config/profiles.ts';
import type { LocalStartupContext } from '../../../YouleNexus/assets/framework/config/local-startup.ts';
import { LOCAL_MACHINE_KEY, localAccountKey, type LocalStoragePort } from '../../../YouleNexus/assets/framework/adapters/local/local-storage.ts';
import { createLocalVisitorProvider } from '../../../YouleNexus/assets/framework/adapters/local/visitor-account.ts';
@@ -16,8 +16,8 @@ class MapStorage implements LocalStoragePort {
function context(overrides: Partial<typeof BUILD_IDENTITY> = {}): LocalStartupContext {
return { hostKind: 'h5', profile: 'local', config: {
mode: 'debug', isDebugger: true, source: 'remote', gameserver: PROFILES.local!.gameserver, ...remoteFixture(),
servers: PROFILES.local!.servers!, identity: { ...BUILD_IDENTITY, ...overrides },
startupConfig: STARTUP_CONFIG, mode: 'debug', isDebugger: true, source: 'remote', gameserver: STARTUP_CONFIG.gameserver, ...remoteFixture(),
servers: STARTUP_CONFIG.localServers, identity: { ...BUILD_IDENTITY, ...overrides },
} };
}