feat: integrate login flow, lobby UI and bitmap font resources

This commit is contained in:
2026-09-06 13:46:57 +08:00
parent e1bcfd91ec
commit 842c68ef55
141 changed files with 11279 additions and 1717 deletions
@@ -0,0 +1,21 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { createRemoteConfig } from '../../YouleNexus/assets/framework/config/remote-config.ts';
import { resolveLobbyPolicy, shouldShowNotice, selectLobbyModel } from '../../YouleNexus/assets/framework/presentation/lobby-model.ts';
const identity = {agentid:'a',gameid:'g',channelid:'c',marketid:'m',version:1};
test('announcement interval preserves strict expiry and never shows on reconnect',()=>{
assert.equal(shouldShowNotice(0, null, 1000, false),true);
assert.equal(shouldShowNotice(-1, null, 1000, false),false);
assert.equal(shouldShowNotice(1, 1000, 3601000, false),false);
assert.equal(shouldShowNotice(1, 1000, 3601001, false),true);
assert.equal(shouldShowNotice(0, null, 1000, true),false);
});
test('notice configuration follows the same channel source and replaces legacy line breaks',()=>{
const p=resolveLobbyPolicy(createRemoteConfig({noticemsg:'global',agentlist:[{agentid:'a',menunotice:{advert0:{type:0,msg:'one#two',url:''}}}]},identity));
assert.equal(p.notices[0].text,'one\ntwo');
assert.equal(p.noticeHours,0);
assert.throws(()=>resolveLobbyPolicy(createRemoteConfig({gameNoticeShow:'bad'},identity)),/gameNoticeShow/);
});
test('lobby rejects incomplete self assets instead of displaying invented zeroes',()=>{
assert.throws(()=>selectLobbyModel({app:{phase:'logged-in'},room:{kind:'outside'},players:{selfPlayerId:7,entities:{7:{playerid:7,nickname:'A',avatar:'',sex:0,bean:0}}}}),/roomcard/);
});