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:
@@ -362,7 +362,9 @@ export class WireClient {
|
||||
if (!this.open || this.stopped || this.transport === null) {
|
||||
throw new Error('connection is not open');
|
||||
}
|
||||
this.transport.send(serializeOutbound(envelope));
|
||||
const frame = serializeOutbound(envelope);
|
||||
this.logPacket('发送', frame);
|
||||
this.transport.send(frame);
|
||||
}
|
||||
|
||||
switchServer(url: string): void {
|
||||
@@ -454,12 +456,19 @@ export class WireClient {
|
||||
|
||||
private onMessage(frame: string): void {
|
||||
const decoded = decodeFrame(frame);
|
||||
if (decoded.kind !== 'heartbeat') this.logPacket('接收', frame);
|
||||
if (decoded.kind === 'ignore') return;
|
||||
this.watchdog.feed();
|
||||
if (decoded.kind !== 'message') return;
|
||||
this.emit({ type: 'message', message: decoded.message });
|
||||
}
|
||||
|
||||
private logPacket(direction: '发送' | '接收', frame: string): void {
|
||||
if (STARTUP_CONFIG.debugIO) {
|
||||
console.log(`[收发包] ${direction}`, {server:this.policy.current(),time:new Date().toISOString()}, frame);
|
||||
}
|
||||
}
|
||||
|
||||
private onReceiveTimeout(): void {
|
||||
if (!this.open || this.stopped) return;
|
||||
this.emit({ type: 'slow' });
|
||||
|
||||
Reference in New Issue
Block a user