Add Korea's sender-pays market, Sparkly Seabone as a Tier 1, and release 1.12.0

Seoul transit costs four times the usual price and the three Korean
incumbents only peer over paid PNIs billed per gigabit sent. Glitch can
leave Korea and Faceplant can reroute it via Hong Kong. Adds the Gangnam
Style Peering scenario and the Sender Pays badge.

Sparkly Seabone becomes a Tier 1 across the Mediterranean, Europe and the
Americas; older saves keep the five Tier 1s they were playing for.

A wave supplier's optical control plane can melt down and take every
leased wave in a region dark at once.

Closes #23
This commit is contained in:
Frederic Jung 2026-10-24 22:39:36 +02:00
parent 5e0ee53617
commit cc28dfeb74
No known key found for this signature in database
8 changed files with 127 additions and 21 deletions

View file

@ -42,6 +42,8 @@ function tour(ev) {
assert.ok(patched.includes(`['${kind}',1]`) && patched.includes(`f.includes('${t}')`), 'fireFailure still has the hooks this tour forces');
step('failure ' + t, `window.__ff=${patched};S.links.forEach(l=>{l.cut=0;l.eqDown=0;l.chFail=null});S.transit.forEach(t=>t.down=0);for(const c in S.pops)S.pops[c].down=0;compute();__ff();dayTick();ACT.leftTab({t:'noc'})`);
}
// A cable the Baltic event can hit, so the anchor badge does not depend on what the random days built.
step('baltic cable', "if(!S.pops.hel)ACT.buildPop({city:'hel'});UI.via='clion';openLinkModal('fra','hel');ACT.buildLink({tier:0});closeModal();UI.via=null");
const evSrc = ev('fireEvent.toString()');
for (const e of ['viral', 'price', 'grant', 'sanction', 'tariff', 'hijack', 'landban', 'shutdown', 'redsea', 'baltic', 'runet', 'typhoon', 'golden', 'gfw', 'gulf']) {
const patched = evSrc.replace(/^function fireEvent/, 'function').replace('const e=pick(opts);', `const e='${e}';`);

View file

@ -270,3 +270,18 @@ test('LACP trouble, partial packet loss and PMTUD black holes fire, hurt and cle
assert.equal(ev("!!(S.transit[0].lacp||S.ev.pmtud||S.links.some(l=>l.loss)||(S.ev.ixlacp&&Object.keys(S.ev.ixlacp).length))"), false, 'everything clears');
assert.deepEqual(errors, []);
});
test('an optical control plane meltdown darkens every leased wave in a region, not your own fiber', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})");
ev("for(const c of ['ams','par','ber'])ACT.buildPop({city:c});const L=(a,b)=>{UI.via=null;openLinkModal(a,b);ACT.buildLink({tier:1});closeModal();};L('fra','ams');L('fra','par');L('fra','ber');S.links.push({id:'dfx',a:'ams',b:'ber',kind:'df',km:580,sys:'lite',ch:['zr4'],ready:0,mo:500,day:0,cut:0});S.day=120;compute()");
const src = ev('fireEvent.toString()').replace(/^function fireEvent/, 'function').replace('const e=pick(opts);', "const e='ctrlplane';");
ev('window.__fe=' + src + ';__fe();compute()');
assert.equal(ev("S.links.filter(l=>l.kind==='wave').every(l=>linkDown(l))"), true, 'all leased waves in Europe are dark');
assert.equal(ev("linkDown(S.links.find(l=>l.id==='dfx'))"), false, 'own dark fiber keeps working');
const inc = "S.inc.find(i=>i.type==='ctrlplane')";
assert.ok(ev(`${inc}.cost>0`));
ev(`ACT.fixInc({id:${inc}.id});compute()`);
assert.equal(ev("S.links.filter(l=>l.kind==='wave').some(l=>linkDown(l))"), false, 'escalating brings them back');
assert.deepEqual(errors, []);
});

View file

@ -331,3 +331,35 @@ test('Barcelona is wired up: a coastal cable, CDNs and a proper Tokyo challenger
assert.ok(ev("ixMul('tok~2')<1"), 'challengers undercut the incumbent');
assert.deepEqual(errors, []);
});
test('Korea: sender pays, pricey transit, Glitch leaves and Faceplant detours', () => {
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.buildPop({city:'icn'});ACT.buildPop({city:'sin'})");
assert.ok(ev("regionMult('icn')>regionMult('sin')"), 'Seoul transit costs more than the rest of Asia');
for (const n of ['ktt', 'skb', 'lgu']) {
assert.equal(ev(`NET.${n}.pol`), 'paid');
assert.match(ev(`peerOk('${n}','ix','icn').why`), /Sender pays/);
}
ev("S.pops.icn.bb={d:400};ACT.buyTransit({city:'icn',net:'ntt',tier:1});ACT.pni({city:'icn',net:'ktt',tier:1});compute()");
const used = ev("R.usePni[S.pni[0].id]||0");
assert.ok(used > 0, 'traffic flows over the Kay-Tea PNI');
assert.equal(ev("R.cost.pni"), ev(`PORT[1].pni+NET.ktt.paidFee+Math.round(NET.ktt.perG*${used})`), 'billed per gigabit sent');
const amz0 = ev("R.demTo.amz"); ev("S.krExit=S.day+1;compute()");
assert.ok(ev("R.demTo.amz") < amz0, 'Glitch leaving cuts its Seoul traffic');
const evSrc = ev('fireEvent.toString()').replace(/^function fireEvent/, 'function').replace('const e=pick(opts);', "const e='krroute';");
ev('window.__fe=' + evSrc + ';__fe();compute()');
assert.ok(ev("S.ev.krroute>S.day&&S.inc.some(i=>i.type==='krroute')"));
assert.ok(ev("SCN.some(s=>s.id==='gangnam'&&s.city==='icn')"));
assert.deepEqual(errors, []);
});
test('Sparkly Seabone is a Tier 1 now, but old saves keep the five they played for', () => {
const { ev, errors } = load();
ev("ACT.start({})");
assert.equal(ev("NET.skl.type"), 't1');
assert.ok(ev("NET.skl.pops.includes('nyc')&&NET.skl.pops.includes('sao')&&NET.skl.pops.includes('pmo')"));
assert.equal(ev("t1Need().length"), 6, 'new games need all six');
ev("delete S.t1v");
assert.equal(ev("t1Need().length"), 5, 'older saves keep five');
assert.deepEqual(errors, []);
});