feat: integrate room framework and isolated subgame bundles
Complete room UI and protocol integration, move game definitions and resources behind bundle entries, publish authoritative version XML, and document single-game builds. Include all current resource changes and experiment artifacts.
This commit is contained in:
@@ -34,11 +34,13 @@ function bootstrapHostKind(options: BootstrapOptions): HostKind {
|
||||
/** 兼容启动编排外观;所有运行契约均由唯一的 RuntimeConfig 边界产出。 */
|
||||
export async function resolveBootstrap(options: BootstrapOptions): Promise<BootstrapResult> {
|
||||
const runtime = await resolveRuntimeConfig({
|
||||
buildIdentity: options.buildIdentity,
|
||||
startupConfig: options.startupConfig,
|
||||
hostKind: bootstrapHostKind(options),
|
||||
win: options.win,
|
||||
search: options.search,
|
||||
fetcher: options.fetcher,
|
||||
localFetcher: options.localFetcher,
|
||||
cacheBust: options.cacheBust,
|
||||
});
|
||||
return Object.freeze({
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/** Explicit client lifecycle budget; no protocol fields or game rules are inferred. */
|
||||
export const ROOM_LIFECYCLE_CONFIG=Object.freeze({capacity:256,maxWaitMs:30000});
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "57882ffe-3e00-46d9-ab47-362e6dd4467d",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ChannelIdentity, IdentitySource } from './identity.ts';
|
||||
import type { ChannelIdentity } from './identity.ts';
|
||||
import { resolveIdentity } from './identity.ts';
|
||||
import {
|
||||
STARTUP_CONFIG,
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
type RemoteConfig,
|
||||
} from './remote-config.ts';
|
||||
import type { RuntimeMode } from './runtime-mode.ts';
|
||||
import { BUILD_IDENTITY } from './sources/defaults.ts';
|
||||
import {
|
||||
getothername,
|
||||
nativeIdentitySource,
|
||||
@@ -40,6 +39,7 @@ export interface RuntimeConfig {
|
||||
}
|
||||
|
||||
export interface ResolveRuntimeConfigOptions {
|
||||
readonly buildIdentity: Readonly<ChannelIdentity>;
|
||||
readonly startupConfig?: Readonly<StartupConfig>;
|
||||
readonly hostKind: HostKind;
|
||||
readonly win: NativeHost;
|
||||
@@ -50,16 +50,14 @@ export interface ResolveRuntimeConfigOptions {
|
||||
readonly cacheBust?: () => string;
|
||||
}
|
||||
|
||||
function buildIdentitySource(): IdentitySource {
|
||||
return () => ({ gameid: BUILD_IDENTITY.gameid, version: BUILD_IDENTITY.version });
|
||||
}
|
||||
|
||||
function resolveHostIdentity(options: ResolveRuntimeConfigOptions): Readonly<ChannelIdentity> {
|
||||
if (!options.buildIdentity || typeof options.buildIdentity !== 'object') throw Error('Missing buildIdentity from application composition');
|
||||
const buildIdentity = resolveIdentity([() => options.buildIdentity]);
|
||||
if (options.hostKind === 'h5') {
|
||||
return resolveIdentity([() => BUILD_IDENTITY, queryStringSource(options.search)]);
|
||||
return resolveIdentity([() => buildIdentity, queryStringSource(options.search)]);
|
||||
}
|
||||
return resolveIdentity([
|
||||
buildIdentitySource(),
|
||||
() => ({gameid:buildIdentity.gameid,version:buildIdentity.version}),
|
||||
nativeIdentitySource(options.win, options.hostKind),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,2 @@
|
||||
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 覆盖。
|
||||
*/
|
||||
export const BUILD_IDENTITY: ChannelIdentity = {
|
||||
// This game's entry in config_test/update_jsonv2.txt belongs to this agent/channel.
|
||||
agentid: '1B2h0ccl205c390Y28m1Ajdplkuu4wgy',
|
||||
channelid: 'aouv0LotK0pYyQ0Pdrx0CsdcaezfzrcG',
|
||||
// agentid: 'veRa0qrBf0df2K1G4de2tgfmVxB2jxpv',
|
||||
// channelid: 'FtJf073aa0d6rI1xD8J1Y42fINTm0ziK',
|
||||
gameid: 'J9r4022t80pxlb01zOK76DN1WD4QewFl',
|
||||
marketid: 4,
|
||||
version: 1, // 数字 versionCode(联调时改成本地服要求的版本号)
|
||||
};
|
||||
/** Legacy launchWaitTime, in milliseconds. */
|
||||
export const DEFAULT_LAUNCH_WAIT_TIME_MS = 10;
|
||||
|
||||
Reference in New Issue
Block a user