Caribbean, Indian Ocean, Pitcairn, Alaska and Russia's Far East; more US and Australian eyeballs (#125, #152, #124, #145, #155, #154)

Caribbean: San Juan, Santo Domingo, Kingston, Havana, Nassau, Port of Spain,
Bridgetown, Fort-de-France and Willemstad on their own islands, with
ARCOS, Americas-II, ECFS, Southern Caribbean Fiber, ALBA-1, CFX-1,
Fibralink, BICS, AMX-1 and EC Link as puns. Exchanges only where one runs
(PR-IX, JIXP, TTIX, AMS-IX Caribbean).

Indian Ocean: Réunion (REUNIX as Rougail SAUCIX), Mauritius, Madagascar
and the Seychelles on SAFE, LION, METISS, EASSy, SEAS and PEACE.

Pitcairn: no cable and no provider; cables may land there and the UK pays
a monthly grant while the islanders are served.

Alaska, Prince Rupert and Russia's Arctic and Pacific: towns with no road
in are their own landmass. Real cables only (Quintillion, AU, AKORN,
AU-Aleutians, Topaz, Connected Coast, Sakhalin-Kamchatka-Magadan,
Petropavlovsk-Anadyr, RJCN, HSCS). Polar Express never got past Amderma,
so its towns have a beach for your own cable instead.

Eyeballs: AT&Tease (a Tier 1 for new games only, t1v 3), Tee-Hee Mobile,
Coax, Pessimum, Final Frontear, GFibber, Sonic Boomer; Neptoon, Lawn-tel,
Pent-Up Net, Dive-Bomb Magpie, Internope; Musklink in the US. Coax merges
into Spectre-um on day 365, Final Frontear into Very-Zone on day 730.
Coastlines refined from Natural Earth around the new places.
This commit is contained in:
Frederic Jung 2026-10-27 21:34:00 +01:00
parent 8c3ac4e9df
commit 75f343f019
No known key found for this signature in database
28 changed files with 854 additions and 24 deletions

70
tests/eyeballs.test.js Normal file
View file

@ -0,0 +1,70 @@
// More American eyeballs and a merger or two (#155), more Australian eyeballs (#154).
const test = require('node:test');
const assert = require('node:assert');
const { load } = require('./harness');
function start(ev) { ev("ACT.start({});S.cash=1e9;S.lvl=6;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})"); }
test('American eyeballs follow PeeringDB, and the ones with upstreams are reached through their Tier 1s (#155)', () => {
const { ev, errors } = load();
start(ev);
const asn = { att: 7018, tmo: 21928, cxc: 22773, pes: 6128, ftr: 5650, gfb: 16591, snc: 46375 };
for (const [id, a] of Object.entries(asn)) assert.equal(ev(`NET.${id}.asn`), a, id);
assert.equal(ev('NET.att.type'), 't1');
assert.ok(ev("NET.att.price>0&&NET.att.ix.length===0"), 'AT&Tease sells transit and never peers at an IX');
assert.ok(ev("NET.tmo.pol==='selective'&&NET.pes.pol==='open'&&NET.gfb.pol==='open'&&NET.snc.pol==='open'"));
assert.ok(ev("NET.gfb.ix.includes('kcy')"), 'GFibber gives the Kansas City exchange some eyeballs');
assert.ok(ev("NET.tmo.ix.includes('sju')"), 'Tee-Hee Mobile is on the Puerto Rico exchange');
assert.equal(ev("NET.cxc.ix.length"), 0, 'Coax: PNIs only');
assert.deepEqual(JSON.parse(ev('JSON.stringify(NET.cxc.up)')), ['spc']);
assert.deepEqual(JSON.parse(ev('JSON.stringify(NET.ftr.up)')), ['vzn']);
// with PNIs to every Tier 1 and no transit, the small ones with Tier 1 upstreams are still reachable
ev("S.transit=[];S.ixp={};S.pni=[];for(const n of t1Need())S.pni.push({id:n.id,net:n.id,city:'fra',tier:0});compute()");
assert.ok(ev("t1Need().every(n=>n.pops.includes('fra'))"), 'every Tier 1, AT&Tease included, is in Frankfurt');
for (const id of ['tmo', 'pes', 'gfb', 'snc']) assert.equal(ev(`!!R.reachable.${id}`), true, id);
assert.deepEqual(errors, []);
});
test('Coax gets Spectre-um’d a year in, and Final Frontear joins Very-Zone a year later (#155)', () => {
const { ev, errors } = load();
start(ev);
ev("ACT.buildPop({city:'chi'});ACT.buildPop({city:'nyc'});ACT.buyIx({city:'nyc',tier:1,signed:true})");
ev("S.pni.push({id:'p1',net:'cxc',city:'chi',tier:1,ready:0},{id:'p2',net:'ftr',city:'nyc',tier:1,ready:0});S.peers['ftr@nyc']=true;compute()");
assert.doesNotMatch(ev("peerOk('cxc','pni','chi').why||''"), /Spectre-um/, 'Coax still decides for itself');
ev('S.day=364;dayTick()');
assert.equal(ev("merged('cxc')"), true, 'the deal closed');
assert.equal(ev("S.pni.find(p=>p.id==='p1').net"), 'spc', 'the Coax PNI now belongs to Spectre-um');
assert.match(ev("peerOk('cxc','pni','chi').why"), /Spectre-um/);
assert.equal(ev("merged('ftr')"), false);
const before = ev("pniMo(S.pni.find(p=>p.id==='p2'),0)");
ev('S.day=729;dayTick()');
assert.equal(ev("merged('ftr')"), true);
assert.equal(ev("S.pni.find(p=>p.id==='p2').net"), 'vzn');
assert.equal(ev("S.peers['ftr@nyc']"), undefined, 'the IX session ended');
assert.ok(ev("pniMo(S.pni.find(p=>p.id==='p2'),0)") > before, 'your free peer just became a paid one');
// a PNI with the new owner in the same city absorbs the old one instead of doubling up
const { ev: ev2 } = load();
start(ev2);
ev2("ACT.buildPop({city:'chi'});S.pni.push({id:'a',net:'cxc',city:'chi',tier:1,ready:0},{id:'b',net:'spc',city:'chi',tier:1,ready:0});S.day=400;dayTick()");
assert.equal(ev2("S.pni.filter(p=>p.city==='chi').map(p=>p.net).join()"), 'spc');
// the inbox never brings requests from a brand that no longer exists, and saves keep the record
ev("const o=JSON.parse(JSON.stringify(S));S=migrate(o)");
assert.equal(ev("merged('cxc')&&merged('ftr')"), true);
ev("S.merged={cxc:'x',zzz:3};S=migrate(JSON.parse(JSON.stringify(S)))");
assert.equal(ev('S.merged'), undefined, 'junk in a save is dropped');
assert.deepEqual(errors, []);
});
test('Australian eyeballs: Neptoon on every exchange family, Lawn-tel in Hobart, Internope behind its parent (#154)', () => {
const { ev, errors } = load();
start(ev);
const asn = { npt: 151660, lnt: 134697, pnt: 10214, mag: 58511, inp: 4739 };
for (const [id, a] of Object.entries(asn)) assert.equal(ev(`NET.${id}.asn`), a, id);
for (const c of ['syd', 'mel', 'bne', 'per', 'adl']) assert.ok(ev(`ixMembers('${c}').includes('npt')`), `Neptoon on the ${c} exchange`);
assert.ok(ev("XIXM['syd~2'].members.includes('npt')&&XIXM['syd~2'].members.includes('mag')"), 'and on the Sydney challenger');
assert.ok(ev("ixMembers('hba').includes('lnt')&&NET.lnt.pol==='selective'"));
assert.ok(ev("NET.mag.price>0&&NET.mag.pops.includes('akl')&&NET.mag.pops.includes('lon')"), 'the magpie flies far');
assert.ok(ev("NET.inp.pol==='restrictive'&&NET.inp.ix.length===0&&NET.inp.up[0]==='tpr'"));
assert.ok(ev("NET.stb.pops.includes('lax')&&NET.stb.pops.includes('sea')"), 'Musklink is where most of its users are');
assert.deepEqual(errors, []);
});

View file

@ -0,0 +1,143 @@
// The Caribbean (#125), the south-west Indian Ocean (#152), Pitcairn (#124), and Alaska, northern British Columbia
// and Russia's Arctic and Pacific coasts (#145).
const test = require('node:test');
const assert = require('node:assert');
const { load } = require('./harness');
function start(ev) { ev("ACT.start({});S.cash=1e9;S.lvl=6;for(const g of GOALS)S.done[g.id]=0"); }
const lands = (ev, cid, a, b) => ev(`CABLE_PAIRS.some(p=>p.cid==='${cid}'&&[p.a,p.b].sort().join()==='${[a, b].sort().join()}')`);
const wave = (ev, a, b, via) => ev(`UI.via=${via ? `'${via}'` : 'null'};UI.route='same';openLinkModal('${a}','${b}');ACT.buildLink({tier:2});closeModal();S.links.length`);
test('the Caribbean: islands on their own landmass, real landings, exchanges only where one runs (#125)', () => {
const { ev, errors } = load();
start(ev);
const isl = ['sju', 'sdq', 'kin', 'hav', 'nas', 'pos', 'bgi', 'fdf', 'cur'];
for (const c of isl) {
assert.ok(ev(`CABLE_PAIRS.some(p=>p.a==='${c}'||p.b==='${c}')`), `${c} has a cable`);
assert.ok(ev(`isSub('${c}','mia')&&isSub('${c}','ccs')`), `${c} is an island`);
assert.ok(ev(`NETS.some(n=>n.price&&n.pops.includes('${c}'))`), `${c} has a transit seller`);
assert.ok(ev(`onLand(CITY.${c}.x,CITY.${c}.y)`), `${c} is drawn on land`);
}
// PR-IX, the Jamaica exchange, TTIX and AMS-IX Caribbean; none in Santo Domingo (they are in Santiago), Havana,
// Nassau, Bridgetown or Martinique
assert.deepEqual(isl.filter(c => ev(`!!CITY.${c}.ix`)), ['sju', 'kin', 'pos', 'cur']);
for (const c of ['sju', 'kin', 'pos', 'cur']) assert.ok(ev(`ixMembers('${c}').length`) >= 5, `${c} has members`);
// Cuba's only cable comes from Venezuela, nothing from Florida
assert.deepEqual(JSON.parse(ev("JSON.stringify([...new Set(CABLE_PAIRS.filter(p=>p.a==='hav'||p.b==='hav').map(p=>p.cid))])")), ['alba']);
assert.ok(lands(ev, 'alba', 'ccs', 'hav') && lands(ev, 'arcos', 'mia', 'nas') && lands(ev, 'arcos', 'sju', 'cur') && lands(ev, 'am2', 'pos', 'for'));
assert.ok(lands(ev, 'ecfs', 'fdf', 'bgi') && lands(ev, 'cfx', 'mia', 'kin') && lands(ev, 'ecl', 'cur', 'pos') && lands(ev, 'sam1', 'sju', 'sdq'));
// old pairs stay where they were, so saved links keep their cable
assert.equal(ev("CAB.sam1.pairs[0].slice(0,2).join()"), 'mia,for');
// a hop through the islands carries traffic: Miami to San Juan to Curaçao
for (const c of ['mia', 'sju', 'cur']) ev(`ACT.buildPop({city:'${c}'});S.pops.${c}.rgen=3`);
wave(ev, 'mia', 'sju', 'am2'); wave(ev, 'sju', 'cur', 'arcos');
ev('compute()');
assert.equal(ev("S.links.filter(l=>l.sub).length"), 2, 'two subsea waves');
ev('cam.z=0.5;draw(0);cam.z=5;cam.x=CITY.sju.x;cam.y=CITY.sju.y;draw(0)');
assert.deepEqual(errors, []);
});
test('the south-west Indian Ocean: Réunion on SAFE, Mauritius, Madagascar and the Seychelles (#152)', () => {
const { ev, errors } = load();
start(ev);
const isl = ['run', 'mru', 'tnr', 'sez'];
for (const c of isl) {
assert.ok(ev(`CABLE_PAIRS.some(p=>p.a==='${c}'||p.b==='${c}')`), `${c} has a cable`);
assert.ok(ev(`isSub('${c}','dur')&&isSub('${c}','mba')`), `${c} is an island`);
assert.ok(ev(`NETS.some(n=>n.price&&n.pops.includes('${c}'))`), `${c} has a transit seller`);
}
assert.ok(ev("isSub('run','mru')&&isSub('run','tnr')"));
// REUNIX, MIXP and MGIX run today; the Seychelles exchange is not on the books
assert.deepEqual(isl.filter(c => ev(`!!CITY.${c}.ix`)), ['run', 'mru', 'tnr']);
assert.equal(ev('CITY.run.ix'), 'Rougail SAUCIX');
assert.ok(ev("['zeo','srr','cnp'].every(id=>ixMembers('run').includes(id))"), 'Zealot, Signal Frequently Ruined and Canal Minus on REUNIX');
// SAFE gains its island landings and keeps its old pair
assert.equal(ev("CAB.safe.pairs[0].slice(0,2).join()"), 'cpt,bom');
assert.ok(lands(ev, 'safe', 'dur', 'run') && lands(ev, 'safe', 'run', 'mru') && lands(ev, 'lion', 'tnr', 'run') && lands(ev, 'metiss', 'dur', 'tnr'));
assert.ok(lands(ev, 'seas', 'sez', 'dar') && lands(ev, 'peace', 'sez', 'mba') && lands(ev, 'eassy', 'mpm', 'tnr'));
assert.ok(ev("NET.tng.pops.includes('run')&&NET.tng.pops.includes('tnr')"), 'Tangerine on the islands');
ev('cam.z=5;cam.x=CITY.run.x;cam.y=CITY.run.y;draw(0)');
assert.deepEqual(errors, []);
});
test('Pitcairn: no cable and no network, but you may land your own, and the UK pays while the islanders are online (#124)', () => {
const { ev, errors } = load();
start(ev);
assert.equal(ev("CABLE_PAIRS.some(p=>p.a==='pcn'||p.b==='pcn')"), false, 'no cable lands there');
assert.equal(ev("NETS.some(n=>n.type!=='cdn'&&n.pops.includes('pcn'))"), false, 'no provider but you');
assert.equal(ev("landing('pcn')"), true, 'a beach for your own cable');
assert.ok(ev("isFinite(ownCabKm('ppt','pcn'))&&ownCabKm('ppt','pcn')<4000"), 'a sea route from Tahiti');
// the grant needs a POP with broadband that is nearly fully served
ev("ACT.buildPop({city:'pcn'});compute()");
assert.equal(ev('R.rev.grant'), 0, 'no grant without broadband');
ev("ACT.launchBB({city:'pcn'});compute()");
const served = ev("sfOf(R,'pcn')");
assert.equal(ev('R.rev.grant'), served >= 0.9 ? ev('GRANT_MO') : 0);
// islanders served: the grant shows in the monthly revenue
ev("R.citySrv.pcn=R.cityDem.pcn");
assert.equal(ev("grantOn(R)"), true);
ev("S.pops.pcn.down=S.day+3");
assert.equal(ev("grantOn(R)"), false, 'not while the POP is down');
ev("S.pops.pcn.down=0;UI.sel={type:'city',id:'pcn'};renderPanel()");
assert.match(ev("document.body.innerHTML"), /UK grant/);
assert.deepEqual(errors, []);
});
test('Alaska and northern British Columbia: towns with no road in are islands, and the Arctic fiber breaks in the ice (#145)', () => {
const { ev, errors } = load();
start(ev);
for (const c of ['anc', 'jnu', 'ome', 'brw', 'dut', 'prr']) {
assert.ok(ev(`CABLE_PAIRS.some(p=>p.a==='${c}'||p.b==='${c}')`), `${c} has a cable`);
assert.ok(ev(`onLand(CITY.${c}.x,CITY.${c}.y)`), `${c} is drawn on land`);
}
assert.equal(ev("isSub('anc','sea')"), false, 'Anchorage has a road south');
assert.equal(ev("isSub('prr','van')"), false, 'so does Prince Rupert');
for (const c of ['jnu', 'ome', 'brw', 'dut']) assert.ok(ev(`isSub('${c}','anc')`), `${c}: no road in, only the sea`);
assert.ok(lands(ev, 'qtl', 'ome', 'brw') && lands(ev, 'qtl', 'brw', 'anc') && lands(ev, 'aleu', 'anc', 'dut') && lands(ev, 'topaz', 'van', 'tok'));
assert.equal(ev('CAB.qtl.fragile'), true, 'sea ice keeps the repair ships away');
assert.equal(ev('CITY.anc.ix.length>0'), true, 'Anchorage has its exchange');
assert.ok(ev("ixMembers('anc').includes('acs')"));
assert.ok(ev("NET.gci.price>0&&['ome','brw','dut','jnu'].every(c=>NET.gci.pops.includes(c))"), 'Glacier sells transit across Alaska');
ev('cam.z=4;cam.x=CITY.brw.x;cam.y=CITY.brw.y;draw(0)');
assert.deepEqual(errors, []);
});
test("Russia's Arctic and Pacific: government boxes, real cables only, beaches where Polar Express never arrived (#145)", () => {
const { ev, errors } = load();
start(ev);
const ru = ['mmk', 'dks', 'tik', 'pvs', 'dyr', 'pkc', 'gdx', 'uus', 'vvo'];
for (const c of ru) {
assert.ok(ev(`CITY.${c}.ru===true`), `${c} needs the government box`);
assert.ok(ev(`onLand(CITY.${c}.x,CITY.${c}.y)`), `${c} is drawn on land`);
assert.ok(ev(`NET.rtc.pops.includes('${c}')`), `${c} has Rostelecomedy`);
}
// Polar Express only got as far as Amderma: its towns have no cable, but a beach for your own
for (const c of ['mmk', 'dks', 'tik', 'pvs']) {
assert.equal(ev(`cablesFor('${c}','vvo').length+CABLE_PAIRS.filter(p=>p.a==='${c}'||p.b==='${c}').length`), 0, `${c}: no cable yet`);
assert.ok(ev(`landing('${c}')`), `${c}: you may land one`);
}
assert.ok(lands(ev, 'chuk', 'pkc', 'dyr') && lands(ev, 'skm', 'uus', 'pkc') && lands(ev, 'skm', 'uus', 'gdx') && lands(ev, 'rjcn', 'vvo', 'tok') && lands(ev, 'hscs', 'uus', 'tok'));
// nothing crosses the Bering Strait
assert.equal(ev("CABLE_PAIRS.some(p=>CITY[p.a].ru!==CITY[p.b].ru&&(CITY[p.a].cc==='US'||CITY[p.b].cc==='US'))"), false);
assert.equal(ev("isSub('dyr','anc')"), true);
// Kamchatka has no road to the rest of Russia; Magadan and Vladivostok do
assert.equal(ev("isSub('pkc','vvo')"), true);
assert.equal(ev("isSub('gdx','vvo')||isSub('mmk','mos')"), false);
assert.ok(ev("CITY.vvo.ix.length>0&&ixMembers('vvo').includes('mgf')&&ixMembers('vvo').includes('ert')"), 'the Vladivostok exchange');
// a sovereign-internet drill cuts the cable to Japan like any other border link
ev("ACT.buildPop({city:'vvo'});ACT.buildPop({city:'tok'});S.pops.vvo.rgen=3;S.pops.tok.rgen=3");
wave(ev, 'vvo', 'tok', 'rjcn');
ev("S.ev.runet=S.day+5;compute()");
assert.equal(ev("linkDown(S.links.find(l=>l.a==='vvo'||l.b==='vvo'))"), true);
ev('cam.z=4;cam.x=CITY.pkc.x;cam.y=CITY.pkc.y;draw(0)');
assert.deepEqual(errors, []);
});
test('saves with POPs in the new places survive a save and reload', () => {
const { ev, errors } = load();
start(ev);
for (const c of ['sju', 'run', 'anc', 'vvo', 'pcn']) ev(`ACT.buildPop({city:'${c}'})`);
ev("const o=JSON.parse(JSON.stringify(S));S=migrate(o);compute()");
assert.ok(ev("['sju','run','anc','vvo','pcn'].every(c=>!!S.pops[c])"));
assert.deepEqual(errors, []);
});

View file

@ -358,7 +358,9 @@ test('Sparkly Seabone is a Tier 1 now, but old saves keep the five they played f
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');
assert.equal(ev("t1Need().length"), 7, 'new games need all seven, AT&Tease included (#155)');
ev("S.t1v=2");
assert.equal(ev("t1Need().length"), 6, 'saves from before AT&Tease keep six');
ev("delete S.t1v");
assert.equal(ev("t1Need().length"), 5, 'older saves keep five');
assert.deepEqual(errors, []);