Doitsche Telekomm and Tangerine Telecom are Tier 1s (#194)

Both are typed t1 and count for the Tier 1 goal in new games only (t1v 4);
older saves keep the Tier 1s they were playing for. Doitsche sells transit
at 12/Gbps, the dearest in Europe outside the China crossing, and keeps its
paid peering and 1G PNIs. Tangerine keeps its selective policy, sells at 6,
and gains a Frankfurt PoP like every other Tier 1.

W2 now counts Tier 1 incumbents with home markets; the N3 exceptions for
both are gone, since Tier 1s are not checked there.
This commit is contained in:
Frederic Jung 2026-11-01 12:23:30 +00:00
parent 19b546f5ab
commit fda5607238
No known key found for this signature in database
12 changed files with 88 additions and 19 deletions

View file

@ -41,7 +41,6 @@ const EXCEPTIONS = {
cun: 'China (#59)',
cxc: 'buys from Spectre-um, which is transit-free',
drz: 'a transit-free Tier 2',
dtk: 'transit-free incumbent',
etc: 'Cuba: buys from Sparkly Seabone, a Tier 1 only for games since 1.12',
ets: 'transit-free in the Gulf',
ftr: 'buys from Very-Zone, which is transit-free',
@ -69,7 +68,6 @@ const EXCEPTIONS = {
tmt: 'buys from Sparkly Seabone, a Tier 1 only for games since 1.12',
tmx: 'transit-free in Mexico',
tmy: 'Malaysian incumbent, peers for its own reach',
tng: 'a transit-free Tier 2',
tpr: 'Australian (#148)',
tsf: 'Indonesian incumbent, peers for its own reach',
tsy: 'Australian, transit-free (#148)',
@ -121,9 +119,9 @@ test('W1: every city has a country code, a region and real coordinates', () => {
test('W2: every country on the map has at least two consumer networks of its own', () => {
// "Own": the network names the country in its home markets (cc) and has a PoP there. Consumer networks are the
// eyeballs, and the Tier 2 incumbents that sell to homes and phones in their home markets.
// eyeballs, and the Tier 1 and Tier 2 incumbents (Doitsche, Tangerine) that sell to homes and phones there.
const rows = J(`(()=>{const cs={};for(const c of CITIES)if(!c.off)(cs[c.cc]=cs[c.cc]||[]).push(c.id);
return Object.keys(cs).sort().map(cc=>[cc,NETS.filter(n=>(n.type==='eye'||n.type==='t2')&&[].concat(n.cc||[]).includes(cc)&&n.pops.some(p=>CITY[p].cc===cc)).map(n=>n.name)]);})()`);
return Object.keys(cs).sort().map(cc=>[cc,NETS.filter(n=>n.type!=='cdn'&&[].concat(n.cc||[]).includes(cc)&&n.pops.some(p=>CITY[p].cc===cc)).map(n=>n.name)]);})()`);
const bad = rows.filter(([cc, own]) => own.length < 2 && !ex('W2', cc))
.map(([cc, own]) => `${country(cc)} (${cc}) has ${own.length} own eyeball network${own.length === 1 ? '' : 's'}${own.length ? ': ' + own.join(', ') : ''}`);
fail('W2', bad, 'add a real operator of that country (src/game/30-networks/32-homegrown-eyeballs.js) or list it in EXCEPTIONS with a reason');

View file

@ -572,8 +572,8 @@ test('buttons behind an open modal stay quiet, and a declined PNI clears its sta
const { ev, errors } = load();
ev("ACT.start({});S.cash=1e7;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buildPop({city:'mrs'});ACT.buyTransit({city:'mrs',net:'cog',tier:1});compute()");
// the PNI button was drawn while Tangerine still wanted our traffic; by the click it doesn't
// Tier 2 is folded when nothing there is worth a PNI (#175): open it, as a player would.
ev("UI.pniOpen={t2:true};R.demTo.tng=50;UI.sel={type:'city',id:'mrs'};UI.tab='peer';renderAll();R.demTo.tng=0;window.__n=0;const o=toast;toast=function(h){if(/declined/.test(h))window.__n++;return o.apply(this,arguments);}");
// Tier 1 is folded when nothing there is worth a PNI (#175): open it, as a player would.
ev("UI.pniOpen={t1:true};R.demTo.tng=50;UI.sel={type:'city',id:'mrs'};UI.tab='peer';renderAll();R.demTo.tng=0;window.__n=0;const o=toast;toast=function(h){if(/declined/.test(h))window.__n++;return o.apply(this,arguments);}");
const btn = "document.querySelector('#panel [data-act=pni][data-args*=tng]')";
assert.ok(ev(`!!${btn}`), 'a stale button to start with');
ev(`${btn}.focus();${btn}.click()`);

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"), 7, 'new games need all seven, AT&Tease included (#155)');
assert.equal(ev("t1Need().length"), 9, 'new games need all nine, AT&Tease (#155), Doitsche and Tangerine (#194) included');
ev("S.t1v=3");
assert.equal(ev("t1Need().length"), 7, 'saves from before Doitsche and Tangerine keep seven');
ev("S.t1v=2");
assert.equal(ev("t1Need().length"), 6, 'saves from before AT&Tease keep six');
ev("delete S.t1v");

View file

@ -57,9 +57,9 @@ test('a transit-free network with PNIs to every Tier 1 reaches the long tail thr
test('a network in nobody\'s cone still needs reaching directly', () => {
const { ev, errors } = load();
t1Club(ev);
// Doitsche Telekomm buys from no one: no Tier 1 PNI reaches it
assert.equal(ev("(NET.dtk.up||[]).length"), 0);
assert.equal(ev("R.reachable.dtk"), false);
// Comecast buys from no one: no Tier 1 PNI reaches it
assert.equal(ev("(NET.cmc.up||[]).length"), 0);
assert.equal(ev("R.reachable.cmc"), false);
assert.equal(ev("isTier1()"), false);
assert.match(ev('t1Why()'), /nobody you peer with sells transit to/);
// peer with every island directly and the win comes
@ -92,7 +92,8 @@ test('a peer\'s cone comes after direct peering and before transit, so peering w
assert.ok(ev(`(R.netEg.${id}||{}).p`) > 0, 'over the PNI with its upstream, not over transit');
assert.equal(ev(`(R.netEg.${id}||{}).t||0`), 0);
// a direct session beats the cone: peer with it at the exchange and its traffic moves there
ev(`S.pops.fra.bb.d=500;ACT.buyIx({city:'fra',tier:1,signed:true});ACT.rs({city:'fra'});compute()`);
// eight Tier 1 PNIs and the transit port fill the router (#194): a second one makes room for the exchange port
ev(`S.pops.fra.bb.d=500;S.pops.fra.routers=2;ACT.buyIx({city:'fra',tier:1,signed:true});ACT.rs({city:'fra'});compute()`);
if (ev(`ixSessions('fra').has('${id}')`)) {
assert.ok(ev(`(R.netEg.${id}||{}).ix`) > 0, 'direct peering wins over the cone');
assert.equal(ev(`(R.netEg.${id}||{}).p||0`), 0);

View file

@ -0,0 +1,66 @@
// #194: Doitsche Telekomm and Tangerine Telecom are Tier 1s, as in real life. They count for the Tier 1 goal
// in games started after the change; older saves keep the Tier 1s they were playing for.
const test = require('node:test');
const assert = require('node:assert/strict');
const { load } = require('./harness');
test('#194 Doitsche Telekomm and Tangerine Telecom are Tier 1s', () => {
const { ev, errors } = load();
ev("ACT.start({})");
assert.equal(ev("NET.dtk.type"), 't1');
assert.equal(ev("NET.tng.type"), 't1');
assert.equal(ev("TYPE_L[NET.dtk.type]"), 'Tier 1');
assert.deepEqual(errors, []);
});
test('#194 new games need both for Tier 1, old saves keep their set', () => {
const { ev, errors } = load();
ev("ACT.start({})");
const need = () => ev("t1Need().map(n=>n.id).sort().join()");
assert.equal(need(), 'att,cog,dtk,lvl,ntt,skl,tat,tly,tng', 'new games need all nine');
ev("S.t1v=3");
assert.equal(need(), 'att,cog,lvl,ntt,skl,tat,tly', 'saves from 1.x and 2.x keep seven');
ev("S.t1v=4;const o=JSON.parse(JSON.stringify(S));S=migrate(o)");
assert.equal(ev("S.t1v"), 4, 'the version survives a save');
ev("delete S.t1v");
assert.equal(ev("t1Need().length"), 5, 'the oldest saves keep five');
assert.deepEqual(errors, []);
});
test('#194 the Road to Tier 1 names them when the PNIs are missing', () => {
const { ev, errors } = load();
ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.cash=1e9;S.lvl=6;for(const g of GOALS)S.done[g.id]=0;delete S.done.t1;ACT.launchBB({city:'fra'})");
ev("S.transit=[];S.pni=[];for(const n of t1Need())if(n.id!=='dtk'&&n.id!=='tng')S.pni.push({id:'p'+n.id,net:n.id,city:'fra',tier:2});compute()");
assert.equal(ev("isTier1()"), false);
assert.match(ev("t1Why()"), /Doitsche Telekomm/);
assert.match(ev("t1Why()"), /Tangerine Telecom/);
assert.deepEqual(errors, []);
});
test('#194 Doitsche sells the dearest transit in Europe and still charges for peering; Tangerine sells it cheaper', () => {
const { ev, errors } = load();
ev("ACT.start({})");
assert.equal(ev("sellsAt(NET.dtk,'fra')"), true, 'Doitsche sells transit in Frankfurt');
assert.equal(ev("NETS.filter(n=>n.id!=='dtk'&&!n.cn&&n.price&&n.pops.some(c=>CITY[c].reg==='EU')).every(n=>n.price<NET.dtk.price)"), true, 'dearer than every carrier in Europe but the Chinese ones, whose price is the crossing into China');
assert.ok(ev("NET.tng.price") < ev("NET.dtk.price"));
// its peering stays paid only over a PNI, and it still sells PNIs down to 1G
assert.equal(ev("NET.dtk.pol"), 'paid');
assert.equal(ev("peerOk('dtk','ix','fra').ok"), false);
assert.equal(ev("peerOk('dtk','pni','fra').fee"), ev("NET.dtk.paidFee"));
assert.equal(ev("pniMin('dtk')"), 0);
assert.match(ev("offTransitHint('dtk','fra')"), /Paid peering only/);
// Tangerine keeps its selective policy: enough traffic gets you a PNI, no Tier 1 club needed
ev("R.demTo.tng=50");
assert.equal(ev("peerOk('tng','pni','par').ok"), true);
assert.deepEqual(errors, []);
});
test('#194 the network list shows them as Tier 1 on a phone', () => {
const { ev, dom, errors } = load();
ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip()");
dom.window.innerWidth = 360;
ev("UI.sel={type:'city',id:'fra'};UI.tab='up';renderAll()");
const html = dom.window.document.getElementById('panel').innerHTML;
assert.match(html, /Doitsche Telekomm <span class="tag t1">Tier 1</, 'Doitsche sells transit in Frankfurt, tagged Tier 1');
assert.deepEqual(errors, []);
});