IPv4 address space: scarce, bought, leased, leased out; IPv6 is free (#150)

A rule (ip4), on in On-call and BGP at 3 a.m., off in the gentler
presets, sandbox and puzzles; scenarios only when they opt in. You start
with a /21 from the registry, sized so the early game never notices
(a gameplay-rules F1 test plays six start cities for 50 days). Business
customers need a block by kind and size; broadband homes take what is
left and the rest go behind CGNAT, which costs a box per home and
annoys some customers. An offer that does not fit cannot be signed and
says why, and a customer that cannot grow at renewal stays its size.

The bank's Address space section buys and sells blocks on a transfer
market with a gentle trend, leases blocks in, and leases spare blocks
out for monthly income, in real CIDR sizes (/24 to /16), at most 256
blocks (what a save keeps). Old saves get what they already use, plus
room, so nothing changes on load. The dashboard's AS box now lists the
blocks you announce.
This commit is contained in:
jvanvik 2026-11-07 01:04:00 +01:00
parent 2cd6b71198
commit eac0604300
34 changed files with 957 additions and 32 deletions

View file

@ -185,5 +185,8 @@
return { a, b, c };
};
const acts = () => Object.keys(ACT);
window.__fz = { acts, direct, lists, start, state, screen, press, close, poke, day, routing, parts, sKeys, sDigest, sParts, check, errs, modalOpen };
// Scarce IPv4 off (#150, rule ip4), the same rules object with its keys in the same order on both pages: the driver calls
// it only while the base has no such rule, so the pages play the same game until it lands.
const noIp4 = () => { if (S && S.rules) { const { ip4, mods, ...r } = S.rules; S.rules = { ...r, ip4: false, mods }; } };
window.__fz = { acts, direct, lists, start, state, screen, press, close, poke, day, routing, parts, sKeys, sDigest, sParts, check, errs, modalOpen, noIp4 };
})();

View file

@ -95,6 +95,8 @@ function playGame(pages, seed, opts = {}) {
preset: kind === 'sandbox' ? r.pick(['none', 'calm', 'normal', 'spicy']) : r.pick(PRESETS),
id: kind === 'scenario' ? r.pick(L.scn) : kind === 'puzzle' ? r.pick(L.pz) : kind === 'architect' ? r.pick(L.ar) : undefined };
const [s0, s1] = both('start', st);
// A base without scarce IPv4 (#150) plays the classic game: both pages switch the rule off. Once it is on main, both play it.
if (!base.call('acts').includes('ip4Buy')) both('noIp4');
same('start', s0, s1);
note('start ' + JSON.stringify(st));
// A normal game signs its charter first: a popup on newer pages (which seeded pages skip), a card on older ones. Both