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
@@ -13,7 +13,7 @@ class MapStorage implements LocalStoragePort {
}
function resolve(search = '?profile=local') {
return resolveLocalStartup({ mode: 'debug', hostKind: 'h5', win: {}, search,
return resolveLocalStartup({ hostKind: 'h5', win: {}, search,
fetcher: { async fetch() { return { player_server_tcp: 'remote.example:3088' }; } } });
}
@@ -1,3 +1,4 @@
import { STARTUP_CONFIG } from '../../YouleNexus/assets/framework/config/profiles.ts';
import { remoteFixture } from '../fixtures/remote-config.ts';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
@@ -12,7 +13,7 @@ import type { GameHost } from '../../YouleNexus/assets/framework/sdk/index.ts';
import { FakeTransport } from '../helpers/fake-transport.ts';
const CONFIG: RuntimeConfig = {
mode: 'debug', isDebugger: true,
startupConfig: STARTUP_CONFIG, mode: 'debug', isDebugger: true,
identity: { agentid: 'A', channelid: 'C', gameid: '41', version: 1, marketid: 4 },
source: 'remote', servers: ['ws://agent'], gameserver: 'https://fixture/config', ...remoteFixture(),
};
@@ -1,3 +1,4 @@
import { STARTUP_CONFIG } from '../../YouleNexus/assets/framework/config/profiles.ts';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { test } from 'node:test';
@@ -121,7 +122,7 @@ test('real modern vertical replay preserves wire contracts, room ordering and te
const runtime = new PlatformRuntime({
gameEntry: entry,
resolveRuntimeConfig: () => resolveRuntimeConfig({
mode: 'release', hostKind: 'native-settings', search: '',
startupConfig: {...STARTUP_CONFIG,mode:'release',useLocalServer:false}, hostKind: 'native-settings', search: '',
win: { settings: {
getothername(name: string) {
nativeCalls.push(`getothername:${name}`);