Phase 3: trade/end-game client, bot simulator, first balance pass
Built: - Client: trade screen, world/end-game screen (landing sites, shipping, node build, final ranking), report sharing + alliance reports tab, alert describers for all notification types, error-code strings (en+nb) for every server CODE. - tools/bot.js (+ tools/bot/): 50 headless bots against the real server in-process with a fake clock; resource/unit conservation ledger, exit 1 on broken invariants. docs/BALANCE.md has method and every run behind a number. - Balance changes (evidence in docs/BALANCE.md): secondQueueCoreLevel 10 -> 3, TRANSPORT.capacityPerLink 500 -> 1000 (end game was shipping-limited in bot runs). - Server fixes: POST /reports/:id/share 500 without a pending reportCleanup; bounced link shipments were silent about cargo overflow. Tested: npm test 207/207 (new: bot determinism + invariants, client alerts/world/i18n over CODES, two regression tests that failed before their fix); openapi check up to date. Real-browser scratch runs (not in repo): WebSocket push shows an incoming-attack banner ~214 ms after launch, polling fallback ~52 s, 15 scripted flows, 71 screenshots. NOT tested: Playwright suite (e2e/ still empty), real devices/Safari, nginx proxy websockets, throttled networks, HTTP-level bot load. NOT claimed: balance. Bots are not humans; open balance items (loot waste, escrow refund clipping, no garrisons at landing sites, end game not scaling with world speed) are listed in docs/BALANCE.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q2MJaQ5LXAHzGnTDgceT14
This commit is contained in:
parent
d84b0c9d12
commit
931f59e11e
49 changed files with 4750 additions and 59 deletions
|
|
@ -115,6 +115,7 @@
|
|||
isOwn: (t) => t.owner.id === ownOperatorId(),
|
||||
movements: () => moveLines(),
|
||||
threatened: (t) => App.mil.moves.incoming.some((m) => m.to && m.to.townId === t.id),
|
||||
myAllianceId: () => (App.state.operator ? App.state.operator.allianceId : null),
|
||||
};
|
||||
view = new MapRender.MapView(canvas, source, {
|
||||
onTap: onTap,
|
||||
|
|
@ -152,6 +153,7 @@
|
|||
legendEl.appendChild(item('rival', App.t('map.legend.rival')));
|
||||
legendEl.appendChild(item('rural', App.t('map.legend.rural')));
|
||||
legendEl.appendChild(item('incumbent', App.t('map.legend.incumbent')));
|
||||
legendEl.appendChild(item('backbone', App.t('map.legend.backbone')));
|
||||
legendEl.appendChild(item('mv-out', App.t('map.legend.out')));
|
||||
legendEl.appendChild(item('mv-in', App.t('map.legend.in')));
|
||||
}
|
||||
|
|
@ -187,22 +189,31 @@
|
|||
body.push(h('div', { class: 'pill-row' }, h('span', { class: 'pill res-' + special.bonus }, icon(special.bonus), '+' + Math.round(F.ruralBonus * 100) + '% ' + App.resName(special.bonus))));
|
||||
} else if (special && special.type === 'incumbent') {
|
||||
body.push(h('p', { class: 'detail-desc', text: App.t('map.info.incumbent') }));
|
||||
} else if (special && special.type === 'backbone') {
|
||||
const site = special.site || {};
|
||||
const mine = !!(site.holder && site.holder.allianceId && site.holder.allianceId === (App.state.operator && App.state.operator.allianceId));
|
||||
body.push(h('p', { class: 'detail-desc', text: App.t('map.info.backbone', { max: site.maxLevel || UpstreamData.ENDGAME.maxLevel }) }));
|
||||
body.push(h('div', { class: 'pill-row' },
|
||||
site.holder ? h('span', { class: 'pill' + (mine ? ' accent' : '') }, '[' + site.holder.tag + '] ' + site.holder.name) : h('span', { class: 'pill dim', text: App.t('wld.incumbent') }),
|
||||
h('span', { class: 'pill', text: App.t('wld.level', { n: site.level || 0, max: site.maxLevel || UpstreamData.ENDGAME.maxLevel }) })));
|
||||
body.push(h('div', { class: 'bar wld-bar ' + (mine ? 'mine' : site.holder ? 'rival' : 'incumbent'), 'aria-hidden': 'true' }, (() => { const i = h('i'); i.style.setProperty('--p', String(site.maxLevel ? (site.level || 0) / site.maxLevel : 0)); return i; })()));
|
||||
body.push(h('button', { class: 'btn wide', type: 'button', 'data-keep': '', onclick: () => { closeSheet(); App.go('world', { site: site.index }); } }, icon('b-backbone_node'), App.t('map.info.openWorld')));
|
||||
} else if (!known) {
|
||||
body.push(h('p', { class: 'detail-desc dimmer', text: App.t('map.scanning') }));
|
||||
} else {
|
||||
body.push(h('p', { class: 'detail-desc', text: App.t('map.info.land') }));
|
||||
}
|
||||
body.push(row('', App.t('map.info.coords', { x, y })));
|
||||
if (App.openSend && App.state.towns.length && (town || (special && special.type === 'incumbent') || (!special && known))) {
|
||||
if (App.openSend && App.state.towns.length && (town || (special && (special.type === 'incumbent' || (special.type === 'backbone' && !(special.site && special.site.holder && special.site.holder.allianceId === (App.state.operator && App.state.operator.allianceId))))) || (!special && known))) {
|
||||
body.push(h('button', { class: 'btn wide' + (town && town.owner.id === ownOperatorId() ? '' : ' primary'), type: 'button', onclick: () => App.openSend({ x, y }) }, icon('target'), App.t('send.open')));
|
||||
}
|
||||
if (cap && !(town && town.id === cap.id)) body.push(row('', App.t('map.info.distance', { d: App.fmt.dec(R.distance(cap.x, cap.y, x, y)) })));
|
||||
if (town && town.owner.id === ownOperatorId() && App.state.towns.some((t) => t.id === town.id)) {
|
||||
body.push(h('button', { class: 'btn primary wide', type: 'button', onclick: () => { closeSheet(); App.setTown(town.id); App.go('pop'); } }, icon('pop'), App.t('map.info.open')));
|
||||
body.push(h('button', { class: 'btn primary wide', type: 'button', 'data-keep': '', onclick: () => { closeSheet(); App.setTown(town.id); App.go('pop'); } }, icon('pop'), App.t('map.info.open')));
|
||||
}
|
||||
const title = town ? town.name : App.t('tile.' + type);
|
||||
const title = town ? town.name : (type === 'backbone' && special.site && Number.isInteger(special.site.index) ? App.t('wld.site', { n: special.site.index + 1 }) : App.t('tile.' + type));
|
||||
infoSheet = openSheet({
|
||||
title, icon: town ? 'pop' : type === 'rural' ? 'fiber' : type === 'incumbent' ? 'b-core_router' : 'map', iconClass: special && special.type === 'rural' ? 'res-' + special.bonus : (town && town.owner.id === ownOperatorId() ? 'own' : ''),
|
||||
title, icon: town ? 'pop' : type === 'rural' ? 'fiber' : type === 'incumbent' ? 'b-core_router' : type === 'backbone' ? 'b-backbone_node' : 'map', iconClass: special && special.type === 'rural' ? 'res-' + special.bonus : (town && town.owner.id === ownOperatorId() ? 'own' : ''),
|
||||
closeLabel: App.t('common.close'), body: h('div', { class: 'detail' }, body),
|
||||
onClose: () => { if (view) view.setSelected(null); infoSheet = null; },
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue