Phase 2: client military/social screens, WebSocket push, trade + endgame, review findings pending

Built: units/movements/reports/send/expansion screens, alliance/messages/rankings screens, ws client + server /ws push
(docs/PROTOCOL.md), Internet exchange trade, backbone endgame + world end, shared reports, buildDone relative levels.
Tested: npm test 175/175. Two adversarial reviews found issues (trade-leg recall exploit, __proto__ via validate.js,
rankings DoS, static headers, ...): fixes follow in the next commit.
NOT done: bots/balance, e2e suite, real-device checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q2MJaQ5LXAHzGnTDgceT14
This commit is contained in:
jvanvik 2026-10-11 19:05:03 +02:00
parent 249818a7aa
commit b18645dca1
87 changed files with 10201 additions and 71 deletions

View file

@ -372,5 +372,17 @@
// Fictional AS numbers come from the private 32-bit range; shown as "AS4200000123".
const fmtAs = (n) => 'AS' + n;
return { LANGS, strings, t, fill, detectLang, fmtNum, fmtDec, fmtDuration, fmtClock, fmtAgo, fmtAs };
// Screens added by later stages bring their own strings: public/js/strings/<area>.js calls
// UpstreamI18n.extend({ en: {...}, nb: {...} }). Duplicate keys are an error (loud, not last-one-wins).
function extend(dicts) {
for (const l of LANGS) {
const d = dicts[l] || {};
for (const k of Object.keys(d)) {
if (Object.prototype.hasOwnProperty.call(strings[l], k)) throw new Error('duplicate i18n key ' + k + ' (' + l + ')');
strings[l][k] = d[k];
}
}
}
return { LANGS, strings, extend, t, fill, detectLang, fmtNum, fmtDec, fmtDuration, fmtClock, fmtAgo, fmtAs };
}));