Conferences, guided tutorial, Kyiv; changelog
This commit is contained in:
parent
0ae6f881c1
commit
2cfdaa13e4
3 changed files with 116 additions and 14 deletions
23
CHANGELOG.md
23
CHANGELOG.md
|
|
@ -4,6 +4,29 @@ All notable changes to this project are documented here. The project follows
|
|||
[Semantic Versioning](https://semver.org/). Each release is deployed to
|
||||
[seriesoftub.es](https://seriesoftub.es).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Traceroute and looking glass: tap 🔍 Traceroute on any of your cities, or
|
||||
open it from the NOC tab. See the exact path to any network or POP, hop by
|
||||
hop, with latency, the exit it leaves through and the AS path, plus why
|
||||
that exit won.
|
||||
- Share card: an image of your network with a mini map, your stats and your
|
||||
rarest badges, ready to post. Find it in the menu, after winning and after
|
||||
a scenario.
|
||||
- Scenarios: six hand-built challenges with a goal and a deadline (Only
|
||||
Spätzle-IX, Red Sea Crisis, The Cogentle Spat, Carnaval, Mind the Gap and
|
||||
Anchors Away), plus a weekly challenge where everyone gets the same world,
|
||||
the same start city and the same two twists for a week.
|
||||
- Sandbox mode: a billion dollars, every unlock and nothing ever breaks.
|
||||
No badges, though.
|
||||
- Conference season: NANOG-ish, RIPE-ish, DENOG-ish, APRICOT-ish and more
|
||||
come round every year. Register in the Deals tab and selective networks in
|
||||
that region need half the usual traffic to peer with you for 45 days.
|
||||
- A guided first game for new players, step by step, with a skip button.
|
||||
- Kyiv, with Varenyky-IX and KyivStar-ish. Blackouts are frequent, so bring
|
||||
a generator. Nobody sells capacity between Kyiv and Moscow.
|
||||
- 7 more badges for scenarios, the weekly challenge and conferences.
|
||||
|
||||
## [1.7.0] — 2026-10-23
|
||||
|
||||
- Auto-TE: from customer level 3 you can install a traffic-engineering
|
||||
|
|
|
|||
|
|
@ -243,6 +243,12 @@ section h3{font-size:17px;margin-bottom:6px;display:flex;align-items:center;gap:
|
|||
.trsel label{display:flex;flex-direction:column;font:800 12px Nunito,sans-serif;gap:2px}
|
||||
.trsel select{font:700 14px Nunito,sans-serif;padding:4px 6px;border:2px solid var(--ink);border-radius:8px;max-width:240px}
|
||||
.fact.trb{cursor:pointer;font:inherit;border:2px solid var(--ink);background:#fff}
|
||||
#coach{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 74px);z-index:16;width:min(520px,calc(100% - 24px));background:#fff;border:3px solid var(--ink);border-radius:14px;box-shadow:0 4px 0 var(--ink);padding:8px 10px;display:flex;gap:8px;align-items:center}
|
||||
#coach .ct{flex:1;font-weight:800;font-size:14px;line-height:1.35}
|
||||
#coach .cs{display:block;font:900 10px Nunito,sans-serif;color:var(--me);text-transform:uppercase;letter-spacing:.05em}
|
||||
.coach-glow{animation:coachglow 1s ease-in-out infinite;position:relative;z-index:2}
|
||||
@keyframes coachglow{0%,100%{box-shadow:0 0 0 0 rgba(255,79,154,.9)}50%{box-shadow:0 0 0 6px rgba(255,79,154,.35)}}
|
||||
@media (prefers-reduced-motion:reduce){.coach-glow{animation:none;outline:3px solid #FF4F9A}}
|
||||
.menu-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}
|
||||
.menu-list .b{justify-content:space-between;width:100%}
|
||||
#mega{position:fixed;left:0;right:0;bottom:0;z-index:17;background:#7A86B8;border-top:3px solid var(--ink);overflow:hidden;white-space:nowrap;pointer-events:none;animation:megaflash 1.2s steps(2) infinite}
|
||||
|
|
@ -390,6 +396,7 @@ input.t{width:100%;box-sizing:border-box;border:3px solid var(--ink);border-radi
|
|||
</aside>
|
||||
|
||||
<div id="hint" hidden></div>
|
||||
<div id="coach" hidden role="status"></div>
|
||||
<div id="toasts" aria-live="polite"></div>
|
||||
<div id="mega" hidden role="alert"><div class="mtrack"><span>🐘 BREAKING: CVE-2026-31337 IN PHP TAKES DOWN HALF THE INTERNET</span><span>Every WordPress-ish site on Earth is now a crypto miner</span><span><?php echo "sorry"; ?></span><span>Eyeball traffic down 30%</span><span>Hosting customers patching at 3 a.m.</span><span>Security team asks: “are we on PHP?” Everyone: “define we”</span><span>🐘 BREAKING: CVE-2026-31337 IN PHP TAKES DOWN HALF THE INTERNET</span><span>Every WordPress-ish site on Earth is now a crypto miner</span><span><?php echo "sorry"; ?></span><span>Eyeball traffic down 30%</span><span>Hosting customers patching at 3 a.m.</span><span>Security team asks: “are we on PHP?” Everyone: “define we”</span></div></div>
|
||||
<div id="update" class="toast goal" hidden role="status"></div>
|
||||
|
|
@ -495,7 +502,7 @@ const LANDS_LL=[{id:'am',ll:[[-166,68],[-157,71.2],[-141,69.8],[-128,70],[-115,6
|
|||
LANDS_LL.push({id:'lk',ll:[[79.9, 9.8], [80.6, 9.6], [81.4, 8.5], [81.9, 7.4], [81.6, 6.4], [80.6, 5.9], [80.0, 6.2], [79.75, 7.2], [79.75, 8.3]]},{id:'sa',hide:true,ll:[[-77.5, 8.6], [-75, 10.8], [-71.5, 12.3], [-68, 10.6], [-62, 10.5], [-60, 8], [-57, 6], [-52, 5], [-50, 1.5], [-48, -1], [-44, -2.5], [-39, -3.5], [-35, -5.5], [-35, -9], [-37.5, -12.5], [-39, -15], [-39.7, -19], [-41, -22], [-44, -23], [-48, -26], [-48.6, -28.5], [-51, -31], [-53, -34], [-58, -34.5], [-57, -37], [-62, -39], [-65, -41], [-64, -43], [-67.5, -46], [-66, -48], [-69, -51], [-68.5, -53], [-70, -55], [-73, -53], [-75, -48], [-73.5, -43], [-73.5, -37], [-71.5, -32], [-71.3, -27], [-70.5, -20], [-71.5, -17], [-76, -14], [-78, -10], [-81, -6], [-80.5, -3], [-80, 0], [-79, 1.5], [-77.5, 4], [-77.4, 7.5]]},{id:'tw',ll:[[121.5, 25.35], [122.05, 25.0], [121.85, 24.3], [121.4, 23.0], [120.85, 21.9], [120.6, 22.3], [120.15, 22.9], [120.1, 23.6], [120.55, 24.5], [121.0, 25.1]]});
|
||||
const LANDS=LANDS_LL.map(l=>({id:l.id,hide:!!l.hide,pts:l.ll.map(q=>proj(q[0],q[1]))}));
|
||||
const DECOR=[[[-73,78],[-60,81.5],[-35,82.5],[-20,81.5],[-18,77],[-20,72],[-23,70],[-30,68],[-38,65.5],[-43,60],[-48,61],[-52,64.5],[-54,68],[-55,71],[-60,76],[-68,77]],[[-80,73.5],[-72,71.5],[-67,69.5],[-62,66.5],[-64,63],[-71,62.5],[-78,64],[-83,66],[-88,70],[-85,73]],[[-110,76],[-95,77],[-80,79],[-70,82],[-90,82.3],[-105,79]],[[-118,73],[-105,72],[-100,69.5],[-110,68.8],[-118,70]],[[140,41.5],[141.6,42.4],[143.3,42],[145.6,43.3],[144.5,44],[141.9,45.5],[141.4,43.4],[140,42.6]],[[120.1,23],[121,25.2],[121.9,25],[121.5,22.5],[120.8,21.9]],[[122,11],[125.5,11.5],[126.5,9.5],[126.2,6.5],[124,6.5],[122,7]],[[95.3,5.6],[98,4],[100.3,2],[103.8,-1],[106,-3],[106,-5.9],[104.5,-5.9],[102.3,-4],[100.3,-1],[97.5,2.4],[95.2,4]],[[109.6,2],[111,1.6],[113,3.2],[115.5,5.2],[117.2,6.9],[119,5],[118,2],[117.5,0.6],[116.2,-2.5],[116,-4],[114.5,-3.4],[111.7,-3],[110,-1.6],[109,0.5]],[[119,-5.5],[120.5,-1],[121.5,1],[125,1.5],[123,-1],[121.5,-4.5]],[[131,-1.2],[134,-0.8],[138,-1.6],[141,-2.6],[145,-4.3],[147.5,-6],[147.5,-8],[146,-8],[143.4,-9.1],[141,-9.1],[139,-8],[138,-8.5],[137.7,-5.6],[134,-4],[132,-2.8]],[[172.6,-40.5],[174.3,-41.7],[173,-43.5],[171.2,-44.5],[170.6,-45.9],[169.2,-46.6],[166.5,-46],[167,-45],[168.4,-44],[170.8,-42.6],[171.5,-41.7]],[[144.6,-40.7],[148.3,-40.9],[148,-43.2],[146,-43.5]],[[49.3,-12],[50.5,-15.5],[49.5,-17.5],[47.1,-24.9],[45,-25.5],[43.8,-23.6],[43.3,-21],[44.4,-16.2],[46.5,-15.7],[48,-13.5]],[[79.8,9.8],[81.9,7.5],[81.2,6.2],[80,6],[79.7,8.2]],[[-85,21.9],[-82,23.2],[-77.5,22.3],[-74.2,20.2],[-77.7,19.9],[-80.5,21.8]],[[-74.5,18.5],[-72,19.9],[-68.4,18.6],[-70,18.2]],[[12.4,38.1],[15.6,38.3],[15.1,36.7]],[[8.2,41],[9.8,41.1],[9.6,39.1],[8.4,39]],[[11,78],[17,80],[27,80],[20,77]],[[52,71],[56,74],[64,76.5],[68,77],[58,74],[54,71]],[[142,46],[143.5,49],[143,54],[142,53],[141.8,48]],[[108.7,19],[111,19.7],[110,18.2]]].map(poly=>poly.map(q=>proj(q[0],q[1])));
|
||||
const CITY_LL={"mel":[144.96, -37.81],"bne":[153.03, -27.47],"drw":[131.05,-12.46],"osa":[135.5, 34.69],"kul":[101.69, 3.14],"bkk":[100.5, 13.76],"sgn":[106.66, 10.76],"khi":[67.14,25.0],"dac":[90.41, 23.81],"cbo":[80.0, 6.95],"waw":[21.01, 52.23],"prg":[14.42, 50.08],"vie":[16.37, 48.21],"bud":[19.04, 47.5],"buh":[26.1, 44.43],"tll":[24.45,58.9],"ist":[28.98, 41.01],"for":[-38.54, -3.73],"rio":[-43.11,-22.57],"bue":[-58.38, -34.6],"scl":[-70.67, -33.45],"lim":[-76.85,-12.05],"bog":[-74.07, 4.71],"pan":[-79.52, 8.98],"del":[77.21, 28.61],"maa":[80.18,13.25],"blr":[77.59, 12.97],"hyd":[78.49, 17.39],"tpe":[121.56, 25.03],"auh":[54.37, 24.45],"fuj":[56.15,25.07],"cpt":[18.42, -33.92],"stg":[9.18,48.78],"ber":[13.4,52.52],"zrh":[8.54,47.37],"nbo":[36.82,-1.29],"cai":[31.24,30.04],"sea":[-122.33,47.61],"sjc":[-121.89,37.34],"lax":[-118.24,34.05],"dal":[-96.8,32.78],"chi":[-87.63,41.88],"ash":[-77.49,39.04],"nyc":[-74.0,40.71],"mia":[-80.19,25.76],"tor":[-79.38,43.65],"mtl":[-73.57,45.5],"mex":[-99.13,19.43],"sao":[-46.63,-23.55],"lon":[-0.13,51.51],"dub":[-6.26,53.35],"rek":[-21.94,64.15],"ams":[4.9,52.37],"fra":[8.68,50.11],"par":[2.35,48.86],"mrs":[5.37,43.3],"mad":[-3.7,40.42],"sto":[18.07,59.33],"osl":[10.75,59.91],"cph":[12.57,55.68],"hel":[24.94,60.17],"beg":[20.46,44.79],"sof":[23.32,42.7],"mos":[37.62,55.76],"lag":[3.38,6.52],"jnb":[28.05,-26.2],"dxb":[55.27,25.2],"bom":[72.88,19.08],"sin":[103.82,1.35],"jkt":[106.85,-6.2],"mnl":[120.98,14.6],"hkg":[114.17,22.32],"sha":[121.47,31.23],"pek":[116.4,39.9],"icn":[126.98,37.57],"tok":[139.69,35.69],"syd":[151.21,-33.87],"per":[115.86,-31.95],"akl":[174.76,-36.85]};
|
||||
const CITY_LL={"kyv":[30.52,50.45],"mel":[144.96, -37.81],"bne":[153.03, -27.47],"drw":[131.05,-12.46],"osa":[135.5, 34.69],"kul":[101.69, 3.14],"bkk":[100.5, 13.76],"sgn":[106.66, 10.76],"khi":[67.14,25.0],"dac":[90.41, 23.81],"cbo":[80.0, 6.95],"waw":[21.01, 52.23],"prg":[14.42, 50.08],"vie":[16.37, 48.21],"bud":[19.04, 47.5],"buh":[26.1, 44.43],"tll":[24.45,58.9],"ist":[28.98, 41.01],"for":[-38.54, -3.73],"rio":[-43.11,-22.57],"bue":[-58.38, -34.6],"scl":[-70.67, -33.45],"lim":[-76.85,-12.05],"bog":[-74.07, 4.71],"pan":[-79.52, 8.98],"del":[77.21, 28.61],"maa":[80.18,13.25],"blr":[77.59, 12.97],"hyd":[78.49, 17.39],"tpe":[121.56, 25.03],"auh":[54.37, 24.45],"fuj":[56.15,25.07],"cpt":[18.42, -33.92],"stg":[9.18,48.78],"ber":[13.4,52.52],"zrh":[8.54,47.37],"nbo":[36.82,-1.29],"cai":[31.24,30.04],"sea":[-122.33,47.61],"sjc":[-121.89,37.34],"lax":[-118.24,34.05],"dal":[-96.8,32.78],"chi":[-87.63,41.88],"ash":[-77.49,39.04],"nyc":[-74.0,40.71],"mia":[-80.19,25.76],"tor":[-79.38,43.65],"mtl":[-73.57,45.5],"mex":[-99.13,19.43],"sao":[-46.63,-23.55],"lon":[-0.13,51.51],"dub":[-6.26,53.35],"rek":[-21.94,64.15],"ams":[4.9,52.37],"fra":[8.68,50.11],"par":[2.35,48.86],"mrs":[5.37,43.3],"mad":[-3.7,40.42],"sto":[18.07,59.33],"osl":[10.75,59.91],"cph":[12.57,55.68],"hel":[24.94,60.17],"beg":[20.46,44.79],"sof":[23.32,42.7],"mos":[37.62,55.76],"lag":[3.38,6.52],"jnb":[28.05,-26.2],"dxb":[55.27,25.2],"bom":[72.88,19.08],"sin":[103.82,1.35],"jkt":[106.85,-6.2],"mnl":[120.98,14.6],"hkg":[114.17,22.32],"sha":[121.47,31.23],"pek":[116.4,39.9],"icn":[126.98,37.57],"tok":[139.69,35.69],"syd":[151.21,-33.87],"per":[115.86,-31.95],"akl":[174.76,-36.85]};
|
||||
const CITIES=[
|
||||
{id:'sea',name:'Seattle',x:205,y:245,land:'am',reg:'AM',P:300,ix:'Sea-IX',dc:'Westin-ish Carrier Hotel'},
|
||||
{id:'sjc',name:'San Jose',x:240,y:345,land:'am',reg:'AM',P:500,ix:'Silly-Con Valley IX',dc:'Equinox SV-ish'},
|
||||
|
|
@ -576,6 +583,7 @@ const CITIES=[
|
|||
{id:'buh',name:'Bucharest',x:0,y:0,land:'eu',reg:'EU',P:400,ix:'Sarmale-IX',dc:'Parliament-sized DC',note:'Gigabit home broadband for the price of a coffee. Customers here expect a lot for very little.'},
|
||||
{id:'tll',name:'Tallinn',x:0,y:0,land:'eu',reg:'EU',P:80,ix:'E-Stonia-IX',dc:'Medieval Wall DC',note:'Digital everything, e-residency for anyone, and Baltic cables that ships keep dragging their anchors over.'},
|
||||
{id:'ist',name:'Istanbul',x:0,y:0,land:'eu',reg:'EU',P:900,ix:'Baklava-IX',dc:'Bosphorus Bridge DC',note:'One foot in Europe, one in Asia. Every land route between them crosses here.'},
|
||||
{id:'kyv',name:'Kyiv',x:0,y:0,land:'eu',reg:'EU',P:500,blackout:true,ix:'Varenyky-IX',dc:'Generator-backed Bunker DC',note:'Ukrainian network engineers kept the internet running through blackouts and much worse. Generators, spare fiber and redundant everything are standard here, and the peering scene is famously tough.'},
|
||||
];
|
||||
// Display-only nudges for cities that sit on top of each other at map scale; distances still use real lon/lat.
|
||||
const CITY_NUDGE={stg:[30,6],fra:[-8,-8],auh:[-30,3],fuj:[8,30],dxb:[6,-8],rio:[14,-16],tll:[-4,22],osa:[-10,6],khi:[-2,-6]};
|
||||
|
|
@ -655,17 +663,17 @@ function cablePair(cid,a,b){const c=CABLE_PAIRS.find(x=>x.cid===cid&&((x.a===a&&
|
|||
const ALLC=CITIES.filter(c=>!c.cn&&!c.ru&&!c.ixOnly).map(c=>c.id);
|
||||
const ruCity=c=>!!CITY[c].ru;
|
||||
const cnCity=c=>!!CITY[c].cn;
|
||||
const BIGC=['mel','bne','osa','kul','bkk','sgn','khi','dac','waw','prg','vie','bud','buh','ist','rio','bue','scl','bog','lim','del','maa','blr','hyd','tpe','cpt','auh','ber','zrh','nbo','cai','jkt','mnl','per','akl','dub','lax','tor','mex','dxb','cph','icn','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mrs','mad','sto','bom','sin','hkg','tok','syd','jnb','lag'];
|
||||
const BIGC=['kyv','mel','bne','osa','kul','bkk','sgn','khi','dac','waw','prg','vie','bud','buh','ist','rio','bue','scl','bog','lim','del','maa','blr','hyd','tpe','cpt','auh','ber','zrh','nbo','cai','jkt','mnl','per','akl','dub','lax','tor','mex','dxb','cph','icn','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mrs','mad','sto','bom','sin','hkg','tok','syd','jnb','lag'];
|
||||
const MIDC=['mel','osa','kul','bkk','waw','vie','ist','rio','bue','scl','bog','del','maa','blr','tpe','auh','ber','zrh','jkt','mnl','dub','lax','tor','dxb','icn','sjc','ash','nyc','chi','dal','mia','lon','ams','fra','par','mad','sin','hkg','tok','syd','bom','sao'];
|
||||
|
||||
/* ================= NETWORKS ================= */
|
||||
const NETS=[
|
||||
{id:'lvl',name:'Level Tree',asn:3535,type:'t1',pol:'restrictive',share:.07,price:9,col:'#7B61FF',pops:['ber','zrh','dub','cph','osl','tor','lax','mex','mtl','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','rio','bue','scl','bog','lim','pan','waw','prg','vie','bud','buh','ist'],ix:[],blurb:'Grew from a seedling into a global backbone. Leaves no route behind.'},
|
||||
{id:'ntt',name:'Not That Telecom',asn:2941,type:'t1',pol:'restrictive',share:.06,price:8,col:'#4B3FC4',pops:['jkt','mnl','per','lax','dxb','icn','sea','sjc','dal','ash','nyc','lon','ams','fra','sin','hkg','tok','syd','tpe','del','maa','blr','hyd','osa','kul','bkk','sgn'],ix:[],blurb:'Huge in Asia. "Which telecom?" "Not that one."'},
|
||||
{id:'tly',name:'Tell-Ya Carrier',asn:1229,type:'t1',pol:'restrictive',share:.05,price:8,col:'#9D4EDD',pops:['ber','osl','cph','hel','beg','sof','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','mrs','hkg','sin','tpe','tll','waw','vie','bud','buh','prg'],ix:[],blurb:'Nordic backbone that tells you exactly where your packets went.'},
|
||||
{id:'cog',name:'Cogentle',asn:714,type:'t1',pol:'restrictive',share:.04,price:3,col:'#B35CF0',pops:['ber','zrh','dub','hel','sof','beg','tor','lax','mex','cph','icn','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','mrs','sto','sin','hkg','tok','rio','bue','scl','bog','lim','osa','waw','prg','vie','bud','buh','ist'],ix:[],blurb:'Cheapest transit on the map. Famously gentle, except during peering spats.'},
|
||||
{id:'tly',name:'Tell-Ya Carrier',asn:1229,type:'t1',pol:'restrictive',share:.05,price:8,col:'#9D4EDD',pops:['ber','osl','cph','hel','beg','sof','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','mrs','hkg','sin','tpe','tll','waw','vie','bud','buh','prg','kyv'],ix:[],blurb:'Nordic backbone that tells you exactly where your packets went.'},
|
||||
{id:'cog',name:'Cogentle',asn:714,type:'t1',pol:'restrictive',share:.04,price:3,col:'#B35CF0',pops:['ber','zrh','dub','hel','sof','beg','tor','lax','mex','cph','icn','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','mrs','sto','sin','hkg','tok','rio','bue','scl','bog','lim','osa','waw','prg','vie','bud','buh','ist','kyv'],ix:[],blurb:'Cheapest transit on the map. Famously gentle, except during peering spats.'},
|
||||
{id:'tat',name:'Ta-Ta Comms',asn:6543,type:'t1',pol:'restrictive',share:.04,price:9,col:'#6A4C93',pops:['nbo','cai','jkt','dxb','nyc','ash','lon','fra','mrs','lag','jnb','bom','sin','hkg','tok','del','maa','blr','hyd','cpt','fuj','auh','tpe','khi','dac','cbo','kul','bkk'],ix:[],blurb:'Waves goodbye to latency across the Indian Ocean.'},
|
||||
{id:'drz',name:'Drizzle Electric',asn:9369,type:'t2',pol:'open',share:.04,price:4,col:'#1E90FF',pops:['ber','zrh','nbo','akl','per','jkt','mnl','dub','rek','tor','mtl','lax','mex','sof','osl','icn','sea','sjc','dal','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','hkg','sin','tok','syd','jnb','for','rio','bue','scl','lim','bog','pan','del','maa','blr','hyd','tpe','auh','cpt','mel','bne','osa','kul','bkk','sgn','khi','dac','cbo','waw','prg','vie','bud','buh','tll','ist'],ix:'ALL',blurb:'Will peer with anyone, anywhere. Rumored to mail out IPv6 cakes.'},
|
||||
{id:'drz',name:'Drizzle Electric',asn:9369,type:'t2',pol:'open',share:.04,price:4,col:'#1E90FF',pops:['ber','zrh','nbo','akl','per','jkt','mnl','dub','rek','tor','mtl','lax','mex','sof','osl','icn','sea','sjc','dal','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','hkg','sin','tok','syd','jnb','for','rio','bue','scl','lim','bog','pan','del','maa','blr','hyd','tpe','auh','cpt','mel','bne','osa','kul','bkk','sgn','khi','dac','cbo','waw','prg','vie','bud','buh','tll','ist','kyv'],ix:'ALL',blurb:'Will peer with anyone, anywhere. Rumored to mail out IPv6 cakes.'},
|
||||
{id:'tng',name:'Tangerine Telecom',asn:5115,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:6,col:'#FF8C42',pops:['cai','nbo','dxb','par','mrs','mad','lon','ams','lag','jnb','waw','buh'],ix:['par','mrs','mad','lon','ams','lag','jnb','waw'],blurb:'Juicy reach into Europe and Africa.'},
|
||||
{id:'sgt',name:'SingTell',asn:7474,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:7,col:'#00A6A6',pops:['jkt','mnl','per','akl','icn','sin','hkg','tok','syd','bom','tpe','maa','kul','bkk','sgn','mel'],ix:['sin','hkg','tok','syd','bom','tpe','maa','kul','bkk'],blurb:'Sings your packets across Asia-Pacific.'},
|
||||
{id:'vdp',name:'Voda-Phony',asn:1373,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:6,col:'#E63946',pops:['nbo','cai','ber','dub','dxb','lon','fra','ams','mad','mrs','jnb','bom','lag','cpt','del','maa','ist','prg','bud','buh'],ix:['lon','fra','ams','mad','mrs','jnb','bom','lag','cpt','del','maa'],blurb:'Mobile giant. The signal is real, the name is not.'},
|
||||
|
|
@ -720,7 +728,8 @@ NETS.push(
|
|||
{id:'tmy',name:'Telekom Ma-lazy-sia',asn:4877,type:'t2',pol:'selective',minIx:10,minPni:30,share:.004,price:6,col:'#1F2A6B',pops:['kul','sin'],ix:['kul'],blurb:'Malaysia’s incumbent. In no hurry whatsoever.'},
|
||||
{id:'ttk',name:'Türk Tele-komik',asn:9211,type:'t2',pol:'selective',minIx:10,minPni:30,share:.008,price:6,col:'#1D3F8F',pops:['ist','fra','sof','lon'],ix:['ist'],blurb:'Bridges Europe and Asia, and occasionally your BGP table.'},
|
||||
{id:'dgi',name:'Digi-tally Cheap',asn:8798,type:'eye',pol:'open',share:.006,col:'#2A5CAA',pops:['buh','bud','mad'],ix:['buh','bud','mad'],blurb:'Gigabit to every flat for the price of a coffee. Peers with anyone.'},
|
||||
{id:'ups',name:'UPC-You-Later',asn:6380,type:'eye',pol:'selective',minIx:8,minPni:25,share:.006,col:'#D8001B',pops:['waw','prg','vie','bud','zrh'],ix:['waw','prg','vie'],blurb:'Cable broadband across Central Europe. See you later, in a support queue.'});
|
||||
{id:'ups',name:'UPC-You-Later',asn:6380,type:'eye',pol:'selective',minIx:8,minPni:25,share:.006,col:'#D8001B',pops:['waw','prg','vie','bud','zrh','kyv'],ix:['waw','prg','vie','kyv'],blurb:'Cable broadband across Central Europe. See you later, in a support queue.'});
|
||||
NETS.push({id:'kys',name:'KyivStar-ish',asn:15859,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#0055B8',pops:['kyv','waw','fra'],ix:['kyv'],blurb:'Ukraine’s biggest mobile network. Has kept working through things most networks never have to plan for.'});
|
||||
const NET=Object.fromEntries(NETS.map(n=>[n.id,n]));
|
||||
const NSH={}; {const t=NETS.reduce((a,n)=>a+n.share,0); NETS.forEach(n=>NSH[n.id]=n.share/t);}
|
||||
const CN_W={ctc:.2,cun:.14,cmb:.08,tcs:.22,abc:.14,byd:.08,bdc:.08,akm:.02,msf:.02,amz:.01,drz:.01};
|
||||
|
|
@ -897,7 +906,37 @@ function beginGame(nm,city,o={}){newGame(nm,city);S.mode=o.mode||'normal';
|
|||
track('game_new');UI.started=true;closeModal();compute();cam.x=CITY[city].x;cam.y=CITY[city].y;cam.z=innerWidth<760?1.1:1.4;selectCity(city);
|
||||
toast(S.scn?`<b>${esc(S.scn.name)}</b><br>${esc(o.scn.goal||'Serve as much traffic as you can in one year.')} You have ${S.scn.days} days.`:S.mode==='sandbox'?`<b>Sandbox mode</b><br>A billion dollars, every unlock, and nothing ever breaks. Build the internet you always wanted.`:`<b>Welcome, ${esc(nm)}!</b><br>The RIPE-ish NCC assigned you AS${S.asn}. Your first router is humming in ${CITY[city].name}.`,'goal');
|
||||
renderAll();save();if(!S.scn&&S.mode!=='sandbox')tutorialStart();}
|
||||
function tutorialStart(){}
|
||||
/* ---------- conference season ---------- */
|
||||
const CONFS=[{n:'NANOG-ish',c:'chi',m:1},{n:'APRICOT-ish',c:'sin',m:1},{n:'Peering Days-ish',c:'waw',m:2},{n:'UKNOF-ish',c:'lon',m:3},{n:'MENOG-ish',c:'dxb',m:3},{n:'NZNOG-ish',c:'akl',m:3},{n:'RIPE-ish',c:'ams',m:4},{n:'NANOG-ish',c:'sea',m:5},{n:'IX Forum-ish',c:'tok',m:6},{n:'AfPIF-ish',c:'nbo',m:7},{n:'AusNOG-ish',c:'syd',m:8},{n:'LACNOG-ish',c:'sao',m:9},{n:'NANOG-ish',c:'ash',m:9},{n:'DENOG-ish',c:'fra',m:10},{n:'RIPE-ish',c:'ber',m:10},{n:'PTT Forum-ish',c:'sao',m:11}];
|
||||
const CONF_COST=8000,CONF_DAYS=45;
|
||||
const confDay=(cf,y)=>y*360+cf.m*30+9;
|
||||
function confKey(cf,y){return cf.n+'@'+cf.c+'@'+y;}
|
||||
function upcomingConfs(within){const y0=Math.floor(S.day/360),out=[];for(const y of [y0,y0+1])for(const cf of CONFS){const d=confDay(cf,y);if(d>=S.day&&d-S.day<=within)out.push({...cf,day:d,key:confKey(cf,y)});}return out.sort((a,b)=>a.day-b.day);}
|
||||
function confBoost(id){const cb=S.conf;if(!cb||!(cb.until>S.day))return 1;const n=NET[id];return n&&n.pops.some(c=>CITY[c]&&CITY[c].reg===cb.reg)?0.5:1;}
|
||||
function confTick(d){S.confReg=S.confReg||{};
|
||||
for(const cf of upcomingConfs(30)){if(cf.day-d===30&&!S.confReg[cf.key])toast(`<b>${esc(cf.n)} comes to ${esc(CITY[cf.c].name)} in 30 days.</b><br>Peering coordinators, hallway track, free stickers. Register in the Deals tab.`,'goal',[{l:'Show me',act:'leftTab',args:{t:'deals'}}]);}
|
||||
for(const cf of upcomingConfs(0)){if(cf.day!==d||!S.confReg[cf.key])continue;const reg=CITY[cf.c].reg;S.conf={until:d+CONF_DAYS,reg,name:cf.n};S.stats.confs=(S.stats.confs||0)+1;
|
||||
const r=Math.random();let extra='';if(r<0.3){const cash=5000+Math.floor(Math.random()*4)*5000;S.cash+=cash;extra=` You also won the raffle: ${fmt$(cash)} worth of optics, sold on eBuy the same evening.`;}else if(r<0.5)extra=' Someone from Goggle bought you a beer. You did not get their name, only a sticker.';
|
||||
toast(`<b>${esc(cf.n)} in ${esc(CITY[cf.c].name)}</b><br>You shook a lot of hands. For ${CONF_DAYS} days, selective networks with a presence in ${esc(REG[reg])} want half the usual traffic before they peer.${extra}`,'goal');sfx('coin');}}
|
||||
function confSection(){const up=upcomingConfs(75).slice(0,3),cb=S.conf&&S.conf.until>S.day?S.conf:null;if(!up.length&&!cb)return '';
|
||||
return `<h3 style="font-size:15px;margin:10px 0 4px">Conferences</h3>${cb?`<div class="inc" style="background:#EAF7EE"><div class="nm">${esc(cb.name)} glow: ${cb.until-S.day} days left</div><div class="meta">Selective networks in ${esc(REG[cb.reg])} need half the usual traffic to peer. Now is the time to ask for that PNI.</div></div>`:''}${up.map(cf=>{const reg=S.confReg&&S.confReg[cf.key];return `<div class="row"><div class="grow"><div class="nm">${esc(cf.n)} · ${esc(CITY[cf.c].name)}</div><div class="meta">${cf.day===S.day?'Today':`in ${cf.day-S.day} days`} · ${esc(REG[CITY[cf.c].reg])}</div></div>${reg?'<span class="tag st on">Registered</span>':btn(`Attend <small>${fmt$(CONF_COST)}</small>`,'confGo',{key:cf.key},'sm',S.cash<CONF_COST)}</div>`;}).join('')}`;}
|
||||
|
||||
/* ---------- guided first game ---------- */
|
||||
const TUT=[
|
||||
{t:'Your router is live. Press “Launch broadband” to sell internet to the people of your city.',sel:'[data-act="launchBB"]',ok:()=>S.pops[S.home]&&S.pops[S.home].bb},
|
||||
{t:'Your customers want the whole internet. Open the Transit tab and buy a port from a carrier.',sel:'[data-act="tab"][data-args*=\'"up"\'],[data-act="buyTransit"]',ok:()=>S.transit.length>0,skip:()=>!NETS.some(n=>n.price&&n.pops.includes(S.home))},
|
||||
{t:'Transit costs money per gigabit. Peering is free: open the Peering tab, buy an IX port, then join the route server.',sel:'[data-act="tab"][data-args*=\'"peer"\'],[data-act="buyIx"],[data-act="rs"]',ok:()=>Object.keys(S.rs).length>0,skip:()=>!ixName(S.home)},
|
||||
{t:'Start the clock with 1× and watch traffic and money flow. You can pause any time.',sel:'#sp1',ok:()=>S.day>=5},
|
||||
{t:'Grow: drag from your pink router onto a nearby city to lay fiber and open a second POP.',sel:null,ok:()=>S.links.length>0},
|
||||
{t:'Businesses pop up as $ bubbles on the map. Open Deals and sign your first customer.',sel:'[data-act="leftTab"][data-args*=\'"deals"\']',ok:()=>S.biz.length>0},
|
||||
];
|
||||
function tutorialStart(){let done=false;try{done=!!localStorage.getItem('sot-tut');}catch(e){}if(done||window.__TUBES_TEST__&&!window.__TUBES_TUT__)return;S.tut=0;renderCoach();}
|
||||
function renderCoach(){const el=$('coach');if(!el)return;document.querySelectorAll('.coach-glow').forEach(x=>x.classList.remove('coach-glow'));
|
||||
if(!S||S.tut===undefined||S.tut===null||S.lost){el.hidden=true;return;}
|
||||
while(S.tut<TUT.length){const st=TUT[S.tut];let ok=false;try{ok=st.ok()||(st.skip&&st.skip());}catch(e){}if(!ok)break;S.tut++;}
|
||||
if(S.tut>=TUT.length){S.tut=null;el.hidden=true;try{localStorage.setItem('sot-tut','1');}catch(e){}toast('<b>You know the basics.</b><br>The goals on the left take it from here. Things will break. That is the fun part.','goal');return;}
|
||||
const st=TUT[S.tut];el.innerHTML=`<div class="ct"><span class="cs">Step ${S.tut+1} of ${TUT.length}</span>${esc(st.t)}</div>${btn('Skip tutorial','tutSkip',{},'ghost sm')}`;el.hidden=false;
|
||||
if(st.sel){const t=document.querySelector(st.sel);if(t)t.classList.add('coach-glow');}}
|
||||
/* ---------- traceroute and looking glass ---------- */
|
||||
const slug=t=>String(t).toLowerCase().normalize('NFKD').replace(/[̀-ͯ]/g,'').replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'x';
|
||||
function trPaths(src){const live=S.links.filter(l=>!linkDown(l)),rem=remoteCities(),ok=c=>popUp(c)||rem.includes(c),adj={};
|
||||
|
|
@ -1076,7 +1115,7 @@ function peerOk(id,via,city){
|
|||
const sn=snub(id,city);if(sn&&(via==='ix'||sn.all))return {ok:false,snub:true,why:snubWhy(sn)};
|
||||
if(via==='ix'&&city&&isRemote(city)&&noRemote(id))return {ok:false,remote:true,why:REMOTE_WHY[hstr(id)%REMOTE_WHY.length]};
|
||||
if(n.pol==='open')return {ok:true};
|
||||
if(n.pol==='selective'){const need=via==='pni'?n.minPni:n.minIx;return dem>=need?{ok:true}:{ok:false,why:`Wants ≥ ${need} Gbps of traffic from you (you send ${dem.toFixed(1)})`};}
|
||||
if(n.pol==='selective'){const need=Math.round((via==='pni'?n.minPni:n.minIx)*confBoost(id));return dem>=need?{ok:true}:{ok:false,why:`Wants ≥ ${need} Gbps of traffic from you (you send ${dem.toFixed(1)})`};}
|
||||
if(n.pol==='paid')return via==='pni'?{ok:true,fee:n.paidFee}:{ok:false,why:'Paid peering only, over a PNI'};
|
||||
if(via!=='pni')return {ok:false,why:'Tier 1s never peer at IXs'};
|
||||
const c=t1Club();return c.ok?{ok:true}:{ok:false,why:'Not big enough yet: '+c.missing.join(', ')};
|
||||
|
|
@ -1411,12 +1450,13 @@ function fireFailure(){
|
|||
const msg=vn(l)&&Math.random()<0.8?pick([`Another of Vietnam’s subsea cables is broken: your ${A}–${B} link. The repair ship will come after the holidays. Which holidays is unclear.`,`Your ${A}–${B} cable broke in the same spot as last time. The repair crew recognised it.`]):!l.sub&&(l.a==='drw'||l.b==='drw')&&Math.random()<0.7?pick([`A crocodile took a bite out of your ${A}–${B} fiber. It was not impressed.`,`Termites ate the duct on ${A}–${B}. Then the fiber. Then the replacement duct.`]):tw(l)&&Math.random()<0.8?pick([`A cargo ship “forgot” to raise its anchor and dragged it across your ${A}–${B} cable. The owners are very sorry, and somewhat hard to reach.`,`Another anchor, another cut: your ${A}–${B} cable. The ship’s flag changed twice during the investigation.`,`A fishing boat with an unusually heavy anchor cut ${A}–${B}. It was not fishing.`]):!l.sub&&andesPair(l.a,l.b)?pick([`A landslide in the Andes buried your ${A}–${B} fiber.`,`Snow closed the mountain pass, and the repair crew with it: ${A}–${B} is down.`,`An earthquake shook your ${A}–${B} fiber loose somewhere above 4,000 metres.`,`A llama herd trampled the fiber marker on ${A}–${B}. Then a backhoe found the fiber.`]):!l.sub&&(CITY[l.a].india||CITY[l.b].india)?pick([`Road widening near ${A} cut your fiber to ${B}. It is always road widening.`,`The monsoon flooded a manhole on ${A}–${B}. The fiber is now underwater, as is the manhole.`,`A JCB-ish digger found your ${A}–${B} fiber. A different JCB-ish digger is coming to fix it.`]):l.sub?pick([`A curious shark bit your subsea cable ${A}–${B}.`,`A ship dragged its anchor across your ${A}–${B} cable.`,`An undersea landslide snapped ${A}–${B}.`]):pick([`A backhoe found your fiber between ${A} and ${B}.`,`Squirrels chewed through ${A}–${B}. They regret nothing.`,`Road works cut ${A}–${B}. Nobody called before digging.`]);
|
||||
addInc({type,ref:tr,until:S.day+dur,msg:msg+(hit.length>1?` All ${hit.length} links in that trench went down with it.`:''),cost:Math.max(4000,Math.round(hit.reduce((a,x)=>a+x.mo,0)*0.5))});
|
||||
}else if(type==='crash'||type==='power'){
|
||||
const c=pick(Object.keys(S.pops).flatMap(x=>type==='power'&&CITY[x].za?[x,x,x]:[x])),pp=S.pops[c],slow=slowBoot(c),dur=(type==='crash'?2+Math.floor(Math.random()*2):3+Math.floor(Math.random()*3))*(type==='crash'&&S.ev.sanction>S.day?2:1)+(slow?2+Math.floor(Math.random()*3):0);
|
||||
const c=pick(Object.keys(S.pops).flatMap(x=>type==='power'&&(CITY[x].za||CITY[x].blackout)?[x,x,x]:[x])),pp=S.pops[c],slow=slowBoot(c),dur=(type==='crash'?2+Math.floor(Math.random()*2):3+Math.floor(Math.random()*3))*(type==='crash'&&S.ev.sanction>S.day?2:1)+(slow?2+Math.floor(Math.random()*3):0);
|
||||
if(type==='crash'&&(pp.routers||1)>=2){pp.rdown=S.day+dur;S.stats.incidents++;S.stats.survived++;toast(`<b>Router crash in ${CITY[c].name}</b><br>One router panicked and its twin took over.${slow?` The crashed one ${esc(pick(SLOW_BOOT))}.`:''} Capacity there is down one router for ${dur} days.`,'good');sfx('alert');return;}
|
||||
if(type==='power'&&!pp.gen&&pp.site2){const sd=Math.random()<0.5?'a':'b';pp.sdown={until:S.day+dur,s:sd};addInc({type:'site',ref:c,until:S.day+dur,msg:`${CITY[c].za?'Load shedding':'A power cut'} took out ${siteName(c,sd)} in ${CITY[c].name}. ${siteName(c,sd==='a'?'b':'a')} kept going, so the POP runs at half capacity. Anything plugged in only at the dark site is offline.`,cost:5000,fix:'Rent a generator'});S.stats.survived++;return;}
|
||||
if(type==='power'&&pp.gen&&CITY[c].blackout){S.stats.incidents++;S.stats.survived++;S.stats.shed=(S.stats.shed||0)+1;toast(`<b>Blackout in ${CITY[c].name}</b><br>The grid went dark again. Your generator started on the first try, like it always does here.`,'good');sfx('alert');return;}
|
||||
if(type==='power'&&pp.gen){S.stats.incidents++;S.stats.survived++;if(CITY[c].za)S.stats.shed=(S.stats.shed||0)+1;toast(CITY[c].za?`<b>Load shedding in ${CITY[c].name}</b><br>Stage ${2+Math.floor(Math.random()*5)} today. Your generator coughed, then kept the lights on.`:`<b>Power cut in ${CITY[c].name}</b><br>Your backup generator kicked in. Lights stayed on.`,'good');sfx('alert');return;}
|
||||
pp.down=Math.max(pp.down||0,S.day+dur);
|
||||
const msg=type==='crash'?(slow?`Your router in ${CITY[c].name} crashed and is rebooting. It ${pick(SLOW_BOOT)}. Boot time on this one: about ${bootMin(c)} minutes per attempt, and it is on attempt ${2+Math.floor(Math.random()*5)}.`:pick([`Your router in ${CITY[c].name} crashed. Kernel panic, packet panic.`,`A firmware update bricked your router in ${CITY[c].name}.`])):CITY[c].za?`Load shedding stage ${3+Math.floor(Math.random()*4)} in ${CITY[c].name}, and you have no generator. Buy one: here it is not optional.`:`Power outage at ${CITY[c].dc} in ${CITY[c].name}. The generator did not start.`;
|
||||
const msg=type==='crash'?(slow?`Your router in ${CITY[c].name} crashed and is rebooting. It ${pick(SLOW_BOOT)}. Boot time on this one: about ${bootMin(c)} minutes per attempt, and it is on attempt ${2+Math.floor(Math.random()*5)}.`:pick([`Your router in ${CITY[c].name} crashed. Kernel panic, packet panic.`,`A firmware update bricked your router in ${CITY[c].name}.`])):CITY[c].blackout?`A blackout hit ${CITY[c].name} and your POP has no generator. Every other network here has one. Buy one.`:CITY[c].za?`Load shedding stage ${3+Math.floor(Math.random()*4)} in ${CITY[c].name}, and you have no generator. Buy one: here it is not optional.`:`Power outage at ${CITY[c].dc} in ${CITY[c].name}. The generator did not start.`;
|
||||
addInc({type,ref:c,until:S.pops[c].down,msg,slow:type==='crash'&&slow,cost:type==='crash'?2500:7000,fix:type==='crash'?(slow?'Turn it off and on again (it will take a while)':'Turn it off and on again'):'Rent a generator'});
|
||||
}else if(type==='transit'){
|
||||
const t=pick(S.transit.filter(t=>!(t.down>S.day)));t.down=S.day+3+Math.floor(Math.random()*3);
|
||||
|
|
@ -1554,6 +1594,7 @@ function dayTick(){
|
|||
if(d%30===0){for(const c in S.pops){let v=(R.cityEye[c]*sfOf(R,c)*EYE_RATE)+S.biz.filter(b=>b.city===c).reduce((a,b)=>a+b.bw*b.rate,0);v=v-R.cityEye[c]*sfOf(R,c)*EYE_RATE*(1-(CITY[c].arpu||1));if(v>500)floater(CITY[c].x,CITY[c].y-30,'+'+fmt$(v),'#16A866');}sfx('coin');}
|
||||
checkGoals();
|
||||
scnTick(d);
|
||||
confTick(d);
|
||||
// money trouble
|
||||
if(S.cash<0){S.neg++;if(S.neg===1)toast('<b>You are in the red.</b><br>Cancel something expensive, wait for revenue, or check the bank for a loan. At −$100k the bank takes your routers.','bad');}
|
||||
else S.neg=0;
|
||||
|
|
@ -1634,6 +1675,9 @@ const BADGES=[
|
|||
{id:'blitz',i:'🚀',t:'Blitz',d:'Reach Tier 1 within two years.',r:'l',ok:()=>!!S.won&&S.day<=730},
|
||||
{id:'peta',i:'🌌',t:'Hundred Terabits',d:'Serve 100 Tbps.',r:'l',ok:()=>R.served>=100000},
|
||||
{id:'llama',i:'🦙',t:'Llama Drama',d:'Lose fiber to a llama herd.',r:'l',secret:true,ok:()=>!!(st().f||{}).llama},
|
||||
{id:'hallway',i:'🎤',t:'Hallway Track',d:'Attend a conference.',r:'r',ok:()=>(st().confs||0)>=1},
|
||||
{id:'beer',i:'🍺',t:'Peering Over Beer',d:'Set up a PNI while the conference glow lasts.',r:'e',ok:()=>!!st().beerPni},
|
||||
{id:'circuit',i:'✈️',t:'Conference Circuit',d:'Attend six conferences in one game.',r:'l',ok:()=>(st().confs||0)>=6},
|
||||
{id:'scen1',i:'🎯',t:'Scenario Solver',d:'Complete any scenario.',r:'r',ok:()=>Object.keys(scnHof()).some(k=>k!=='weekly')},
|
||||
{id:'weekly',i:'📅',t:'Weekly Regular',d:'Finish a weekly challenge.',r:'r',ok:()=>!!scnHof().weekly},
|
||||
{id:'scen3',i:'🏅',t:'Scenario Specialist',d:'Complete three different scenarios.',r:'e',ok:()=>Object.keys(scnHof()).filter(k=>k!=='weekly').length>=3},
|
||||
|
|
@ -1715,13 +1759,15 @@ const ACT={
|
|||
share:()=>shareModal(),
|
||||
shareDl:()=>shareFile(f=>{if(!f)return;const a=document.createElement('a');a.href=URL.createObjectURL(f);a.download=f.name;document.body.appendChild(a);a.click();setTimeout(()=>{URL.revokeObjectURL(a.href);a.remove();},1000);track('share_download');}),
|
||||
shareGo:()=>shareFile(f=>{const d={title:'Series of Tubes',text:`${S.name} (AS${S.asn}): ${tierLabel()}, ${fmtG(S.stats.peak||0)} peak. Build your own internet at`,url:'https://seriesoftub.es/'};try{if(f&&navigator.canShare&&navigator.canShare({files:[f]}))d.files=[f];navigator.share(d).then(()=>track('share_done')).catch(()=>{});}catch(e){}}),
|
||||
confGo:({key})=>{S.confReg=S.confReg||{};if(S.confReg[key])return;if(!spend(CONF_COST))return;S.confReg[key]=true;toast('<b>Registered.</b><br>Flights booked, badge printed, business cards ordered in the wrong font.','good');after();},
|
||||
tutSkip:()=>{S.tut=null;try{localStorage.setItem('sot-tut','1');}catch(e){}renderCoach();},
|
||||
addSite:({city})=>{const p=S.pops[city];if(!p||p.site2)return;if(!spend(SITE2_COST))return;p.site2=true;p.site2Day=S.day;toast(`<b>Second site live in ${CITY[city].name}.</b><br>${esc(siteName(city,'b'))} is joined to ${esc(siteName(city,'a'))} by your own metro ring. Move some uplinks there from the Transit and Peering tabs.`,'good');sfx('build');after();},
|
||||
rmSite:({city})=>{const p=S.pops[city];if(!p||!p.site2)return;if(UI.confirm!=='site'+city){UI.confirm='site'+city;renderPanel();return;}UI.confirm=null;p.site2=0;p.sdown=null;p.ringcut=0;for(const t of S.transit)if(t.city===city)t.site='a';for(const x of S.pni)if(x.city===city)x.site='a';if(S.ixSite)delete S.ixSite[city];after();},
|
||||
siteSet:({k,id,s})=>{if(s!=='a'&&s!=='b')return;if(k==='t'){const t=S.transit.find(x=>x.id===id);if(t)t.site=s;}else if(k==='p'){const x=S.pni.find(x=>x.id===id);if(x)x.site=s;}else if(k==='ix'&&S.ixp[id]!==undefined){S.ixSite=S.ixSite||{};S.ixSite[id]=s;}after();},
|
||||
peer:({city,net})=>{const r=peerOk(net,'ix',city);if(!r.ok){toast(`<b>${esc(NET[net].name)} declined.</b><br>${esc(r.why)}`,'bad');sfx('err');return;}S.peers[net+'@'+city]=true;
|
||||
toast(`<b>${esc(NET[net].name)} accepted!</b><br>${NET[net].pol==='selective'?'They checked your PearingDB page and liked the traffic numbers.':'BGP session established.'}`,'good');sfx('build');after();},
|
||||
unpeer:({city,net})=>{delete S.peers[net+'@'+city];after();},
|
||||
pni:({city,net,tier})=>{tier=+tier;if(!S.pops[city]||!NET[net]||!NET[net].pops.includes(city)||!PORT[tier])return;if(!portOk(city,tier)){toast(`<b>Your router can't take a ${PORT[tier].n} port.</b><br>Upgrade it in the Infra tab.`,'bad');sfx('err');return;}const r=peerOk(net,'pni',city);if(!r.ok){toast(`<b>${esc(NET[net].name)} declined the PNI.</b><br>${esc(r.why)}`,'bad');sfx('err');return;}
|
||||
pni:({city,net,tier})=>{tier=+tier;if(!S.pops[city]||!NET[net]||!NET[net].pops.includes(city)||!PORT[tier])return;if(!portOk(city,tier)){toast(`<b>Your router can't take a ${PORT[tier].n} port.</b><br>Upgrade it in the Infra tab.`,'bad');sfx('err');return;}const r=peerOk(net,'pni',city);if(!r.ok){toast(`<b>${esc(NET[net].name)} declined the PNI.</b><br>${esc(r.why)}`,'bad');sfx('err');return;}if(S.conf&&S.conf.until>S.day)S.stats.beerPni=1;
|
||||
const ex=S.pni.find(p=>p.city===city&&p.net===net);if(ex&&tier<=ex.tier)return;if(!spend((1500+PORT[tier].setup/2)*(ex&&ex.n||1)))return;if(ex)ex.tier=tier;else S.pni.push({id:uid(),city,net,tier});
|
||||
toast(`<b>PNI with ${esc(NET[net].name)} is up.</b><br>A cross-connect in ${esc(CITY[city].dc)}. Private and fast.`,'good');after();},
|
||||
cancelPni:({id})=>{if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.pni=S.pni.filter(p=>p.id!==id);UI.confirm=null;after();},
|
||||
|
|
@ -1873,7 +1919,7 @@ const $=id=>document.getElementById(id);
|
|||
const btn=(label,act,args={},cls='',dis=false,title='')=>`<button class="b ${cls}" data-act="${act}" data-args='${JSON.stringify(args)}'${dis?' disabled':''}${title?` title="${esc(title)}"`:''}>${label}</button>`;
|
||||
const logo=n=>`<span class="logo" style="--c:${n.col}">${initials(n)}</span>`;
|
||||
const barCls=u=>u>=0.9?'bad':u>=0.65?'warn':'';
|
||||
function renderAll(){renderHUD();renderLeft();renderPanel();renderHint();renderMega();}
|
||||
function renderAll(){renderHUD();renderLeft();renderPanel();renderHint();renderMega();renderCoach();}
|
||||
function renderMega(){const el=$('mega');if(!el)return;const on=!!(S&&S.ev&&S.ev.php>S.day);if(el.hidden===!on)return;el.hidden=!on;}
|
||||
function renderHUD(){
|
||||
for(const v of [0,1,2,4,8]){const b=$('sp'+v);if(b)b.classList.toggle('on',UI.speed===v);}
|
||||
|
|
@ -1903,6 +1949,7 @@ function renderLeft(){
|
|||
h+=GOALS.map(g=>{const d=S.done[g.id]!==undefined,c=g===cur;return `<div class="goal ${d?'done':''} ${c?'cur':''}"><div class="ck">${d?'✓':''}</div><div><div class="gt">${esc(g.t)}</div>${c||!d?`<div class="gd">${esc(g.d)}</div>`:''}${!d&&g.r?`<div class="gr">Reward ${fmt$(g.r)}</div>`:''}</div></div>`;}).join('');
|
||||
h+=badgeGrid();
|
||||
}else if(UI.left==='deals'){
|
||||
h+=confSection();
|
||||
{const lv=S.lvl||1,nx=LEVELS[lv];h+=`<div class="inc" style="background:#FFF6CF"><div class="nm">Customer level ${lv}: ${LEVELS[lv-1].n}</div><div class="meta">${nx?`Next: ${nx.req} unlocks ${nx.unlock.toLowerCase()}`:'Every customer type is unlocked. Go get those terabits.'}</div></div>`;}
|
||||
if(!S.offers.length)h+=`<p class="empty">No open offers right now. Businesses look for networks with POPs in their city. New ones pop up every few weeks.</p>`;
|
||||
for(const o of S.offers.slice().sort((a,b)=>a.exp-b.exp)){const has=bHas(o);
|
||||
|
|
@ -2185,7 +2232,7 @@ function renderBank(){
|
|||
if(h!==UI._bh){UI._bh=h;$('bankCard').innerHTML=h;}
|
||||
}
|
||||
function renderHint(){
|
||||
const hn=$('hint');if(!S||UI.hintOff||(innerWidth<760&&(UI.sel||UI.leftOpen)&&!(UI.drag&&UI.drag.mode==='link'))){hn.hidden=true;return;}
|
||||
const hn=$('hint');if(!S||UI.hintOff||(S.tut!==undefined&&S.tut!==null)||(innerWidth<760&&(UI.sel||UI.leftOpen)&&!(UI.drag&&UI.drag.mode==='link'))){hn.hidden=true;return;}
|
||||
let t='';
|
||||
if(UI.drag&&UI.drag.mode==='link')t=UI.snap?'Release to plan a link':'Drag onto another city';
|
||||
else if(!S.links.length&&S.done.tr)t='Tip: drag from your pink router to another city to lay fiber';
|
||||
|
|
@ -2249,12 +2296,13 @@ function showHelp(){
|
|||
<dt>Embedded cache</dt><dd>A CDN's server in your rack. Serves most of that CDN's traffic locally, for the price of power.</dd>
|
||||
<dt>DE-KICKS</dt><dd>The group behind several big exchanges (Frankfurt, Madrid, Marseille, Dubai, Mumbai, New York) treats price lists as a state secret. Ports are quoted per customer and go up the bigger you look. Haggling can work, backfire or stall for a week. Prices get "harmonised" upwards once a year, add-ons appear on your invoice until you opt out, and trying to leave earns you a retention discount that ends with a fee.</dd><dt>Remote peering</dt><dd>Reach an IX over a fabric circuit without a POP there. It works, and the route server still gets you every open network, but it is discouraged: the reseller charges 1.5× for the port and oversubscribes it to 80%, latency rides the fabric, one fabric outage drops every session, and many selective networks refuse remote members outright.</dd><dt>Peering policy</dt><dd>Open peers with anyone. Selective wants to see traffic first. Restrictive (Tier 1s) only peers with giants, over PNIs. Paid means exactly that. Big selective networks also have moods: in some cities they refuse new peers for a few months, or only take PNIs, and now and then they tear down a session you already had. Try another city or a PNI, and ask again later.</dd>
|
||||
<dt>Waves</dt><dd>Your fiber links are leased waves at a flat monthly rate. Longer and bigger costs more (10G → 6.4T), and subsea is 1.8× the price.</dd><dt>95th percentile</dt><dd>Transit bills sample your usage every day and charge the 95th percentile of the last 30 days, so short spikes are forgiven but long ones are not.</dd><dt>Routers</dt><dd>Each POP's router model caps its fastest port (100G, 400G, 800G, 1.6T) and how much it can forward. Bigger waves and ports need better routers at both ends. Better models unlock with your customer level. With one router, upgrades mean a day of downtime.</dd><dt>Dark fiber</dt><dd>Lease an IRU or build your own (slow, with delays), then buy a line system with amplifiers and light channels with 400ZR+, 800ZR+ or 1.6T transponders. Much cheaper than waves at scale, but the gear can fail. A spares kit speeds up repairs.</dd><dt>Subsea cables</dt><dd>Subsea waves can only follow real-ish cable systems, drawn faintly on the map (tap a city to highlight its cables). Teal ones are new and cheap, purple ones pricey, dashed ones old and cut-prone. All your waves on one cable die together when it is cut. Between continents on land, you can often choose overland (2.5×, many borders) or a cable.</dd><dt>Latency</dt><dd>Every link has latency. High-frequency traders pay a fortune for a circuit within their latency budget; route them “Lowest latency”. Bulk backup customers do not care, so route them “Scenic” over your quiet links to keep busy ones free.</dd><dt>NOC dashboard</dt><dd>The chart button at the top opens traffic graphs by exit (caches, PNIs, IX, transit), money over time, per-ASN traffic with how it reaches you and what its transit costs, plus your busiest links and routers.</dd><dt>Asia</dt><dd>A weird, underserved market. Transit costs 2.5× what it does in Europe (Africa 2×, Oceania 1.8×), local incumbents mostly peer only for pay, and IXs are fragmented. But demand is enormous and users sign up 60% faster than anywhere else. Peering and caches pay off most here.</dd><dt>Russia</dt><dd>Moscow needs a mandatory government box in every POP, Western CDNs are mostly gone, Goggle video is throttled to half speed, and the sovereign internet drills now and then cut Moscow off for a day.</dd><dt>Events, chains and wholesale</dt><dd>Event networks (a final, a festival, a keynote) need a burst of capacity in one city for a few days and pay once at the end, prorated by how much of the crowd you served; below 70% you pay a penalty. SD-WAN chains connect 3–6 of your POPs hub-and-spoke, so one broken spoke upsets the whole contract. Once you run your own dark fiber, carriers want to rent spare channels as alien waves, and on fiber you built yourself, a spare pair.</dd><dt>Bank</dt><dd>Tap your cash to open the bank. Lenders make offers now and then, and much more often when you are in the red. Each loan has a monthly payment and some odd conditions; break one and you pay a penalty. Your credit rating decides which banks talk to you. The loan shark is always there. Do not be late.</dd><dt>LAGs</dt><dd>Out of port speed? Bundle up to 8 identical ports to the same transit provider, IX or PNI into a LAG. Each member costs a full port; flow hashing is never perfectly even, so a bundle carries about 95% of the sum.</dd><dt>Traffic engineering</dt><dd>Tap a link to see which networks, which entry points and which customer cities fill it. Raise a link's metric to steer traffic around it, or set an egress (transit, IX, PNI) to Prefer or Backup only.</dd><dt>China</dt><dd>Mainland China needs a license and a local joint venture. Many foreign services are blocked there, and traffic crossing the border loses packets unless you pay for premium routes.</dd><dt>Weird requirements</dt><dd>Some customers come with conditions: no Cogentle anywhere, no subsea cables because of sharks, two routers, a generator, NetChill on-net, low-loss China reach and more. Each pays a bonus. Unmet ones make them grumpy until you fix it or they leave.</dd><dt>Customer levels</dt><dd>As your peak traffic and footprint grow, bigger customers show up: streaming startups and universities, then AI GPU data centers and cloud on-ramps, then AI training interconnects and hyperscaler DCI deals measured in terabits. Pink $$ bubbles mark the big ones.</dd><dt>L2VPN & DDoS protection</dt><dd>Businesses may want a private circuit between two of your POPs (it rides your backbone), or DDoS protection (needs your own scrubbing center).</dd><dt>NNI fabrics</dt><dd>Megapork, PocketFabric and Consolation Connect sell a port plus virtual circuits between cities. Great for small links and remote peering at an IX where you have no POP.</dd>
|
||||
<dt>Badges</dt><dd>Below your goals sits a wall of badges, from common to legendary. Some take luck, some take years, and a couple are secret. Badges you earned in earlier games stay on this device with a dashed outline.</dd><dt>The giants</dt><dd>At customer level 3 and 4, hyperscalers and AI clouds show up with deals only they would ask for: terabit AI WANs between gigawatt campuses, training runs spread over several sites, week-long dataset ingests, and hundreds of fiber pairs in a trench you dug yourself. They pay like nobody else, and they want diverse paths, two sites per metro and zero excuses. Cities near their campuses list them under “Who’s here”.</dd><dt>Auto-TE</dt><dd>Traffic follows the shortest path by distance and link metric, and reroutes by itself when links fail. When a path is merely full, the overflow is dropped, just like a real IGP. From customer level 3 you can install Auto-TE in the NOC tab: it spills overflow onto up to two alternate paths with free capacity, as long as they are no more than twice as long.</dd><dt>Metro diversity</dt><dd>A POP is one building until you add a second site in the Infra tab. Then a power cut, cleaner or A/C failure only takes out half the city, and you choose which site each transit, PNI and IX port plugs into. Spread them out, or both halves of your redundancy will sit in the same dark room. Watch out for metro ring cuts, which cut site B off.</dd><dt>Regional quirks</dt><dd>South America hangs off Miami: transit is pricier, nothing crosses the Darién Gap by land, and fiber over the Andes costs double and breaks often. IX.brrr in Brazil is run by a nonprofit with cheap public prices, and small Brazilian provedores buy transit in bulk. Inside the UAE only the duopoly may run fiber, so no dark fiber and 3× waves. Taiwan’s cables meet a lot of anchors, Indian fiber meets road widening and the monsoon, and South Africa has load shedding: bring a generator.</dd><dt>Boot times</dt><dd>Some routers take forever to boot. The Infra tab shows how long yours takes. Slow booters make crashes last longer and turn a one-router swap into a three-day outage. Bigger chassis, especially anything with a PacketOinker™ inside, are slow more often. Twin routers make it someone else’s problem.</dd><dt>Failures</dt><dd>Things break all the time: fiber cuts, router crashes, power cuts, IX loops, fabric outages, route leaks, DDoS, fat fingers, cooling failures, and geopolitics: sanctions, tariffs, BGP hijacks, landing permit disputes, exam-day shutdowns and Red Sea cable cuts. Traffic reroutes automatically over other paths and upstreams. Parallel links on diverse routes, a second router and a backup generator all help. Or pay to rush repairs.</dd>
|
||||
<dt>Conferences</dt><dd>NANOG-ish, RIPE-ish, DENOG-ish and friends come round every year. Register in the Deals tab for $8k. For 45 days after, selective networks with a presence in that region need only half the usual traffic before they peer with you. Sometimes you also win the raffle.</dd><dt>Modes</dt><dd>Sandbox gives you a billion dollars, every unlock and no failures, but no badges. Scenarios are hand-built challenges with a goal and a deadline, and the weekly challenge gives everyone the same world for a week. Share your result with the card in the menu.</dd><dt>Traceroute</dt><dd>Tap 🔍 Traceroute on any of your cities, or open it from the NOC tab, to see the exact path to a network or POP, hop by hop, with latency, the exit and the AS path.</dd><dt>Badges</dt><dd>Below your goals sits a wall of badges, from common to legendary. Some take luck, some take years, and a couple are secret. Badges you earned in earlier games stay on this device with a dashed outline.</dd><dt>The giants</dt><dd>At customer level 3 and 4, hyperscalers and AI clouds show up with deals only they would ask for: terabit AI WANs between gigawatt campuses, training runs spread over several sites, week-long dataset ingests, and hundreds of fiber pairs in a trench you dug yourself. They pay like nobody else, and they want diverse paths, two sites per metro and zero excuses. Cities near their campuses list them under “Who’s here”.</dd><dt>Auto-TE</dt><dd>Traffic follows the shortest path by distance and link metric, and reroutes by itself when links fail. When a path is merely full, the overflow is dropped, just like a real IGP. From customer level 3 you can install Auto-TE in the NOC tab: it spills overflow onto up to two alternate paths with free capacity, as long as they are no more than twice as long.</dd><dt>Metro diversity</dt><dd>A POP is one building until you add a second site in the Infra tab. Then a power cut, cleaner or A/C failure only takes out half the city, and you choose which site each transit, PNI and IX port plugs into. Spread them out, or both halves of your redundancy will sit in the same dark room. Watch out for metro ring cuts, which cut site B off.</dd><dt>Regional quirks</dt><dd>South America hangs off Miami: transit is pricier, nothing crosses the Darién Gap by land, and fiber over the Andes costs double and breaks often. IX.brrr in Brazil is run by a nonprofit with cheap public prices, and small Brazilian provedores buy transit in bulk. Inside the UAE only the duopoly may run fiber, so no dark fiber and 3× waves. Taiwan’s cables meet a lot of anchors, Indian fiber meets road widening and the monsoon, and South Africa has load shedding: bring a generator.</dd><dt>Boot times</dt><dd>Some routers take forever to boot. The Infra tab shows how long yours takes. Slow booters make crashes last longer and turn a one-router swap into a three-day outage. Bigger chassis, especially anything with a PacketOinker™ inside, are slow more often. Twin routers make it someone else’s problem.</dd><dt>Failures</dt><dd>Things break all the time: fiber cuts, router crashes, power cuts, IX loops, fabric outages, route leaks, DDoS, fat fingers, cooling failures, and geopolitics: sanctions, tariffs, BGP hijacks, landing permit disputes, exam-day shutdowns and Red Sea cable cuts. Traffic reroutes automatically over other paths and upstreams. Parallel links on diverse routes, a second router and a backup generator all help. Or pay to rush repairs.</dd>
|
||||
</dl><div class="btns" style="margin-top:14px">${btn(UI.started?'Back to the map':'Got it','helpClose',{},'big')}${RELEASE_NOTES.length?btn(`What’s new in ${esc(APP_VERSION)}`,'whatsNewShow',{},'ghost'):''}${UI.started&&S&&!S.lost?btn('Start a new network','resetAsk',{},'ghost sm'):''}</div><div class="btns" style="margin-top:6px">${UI.started&&S&&!S.lost?btn('Export save','exportSave',{},'ghost sm'):''}${btn('Import a save','importPick',{},'ghost sm')}</div>`);
|
||||
}
|
||||
function showWin(){setTimeout(()=>{const m=$('modalCard');if(m&&!m.querySelector('[data-act=share]'))m.insertAdjacentHTML('beforeend',`<div class="btns" style="margin-top:8px">${btn('Share my network','share',{},'pink')}</div>`);},0);openModal(`<h1 style="font-family:var(--display);font-size:44px;margin:0">You're a <span style="color:var(--me)">Tier 1</span>!</h1><p class="tagline">${esc(S.name)} (AS${S.asn}) is transit-free. You peer with every giant on the planet and pay nobody to reach the internet. Took you ${S.day} days and ${S.stats.incidents} incidents.</p>${btn('Keep building','keepPlaying',{},'pink big')}`);sfx('coin');}
|
||||
function showLose(){openModal(`<h1 style="font-family:var(--display);font-size:40px;margin:0">Bankrupt</h1><p class="tagline">The bank repossessed your routers and sold them on eBuy. ${esc(S.name)} lasted ${S.day} days and peaked at ${fmtG(S.stats.peak)}.</p>${btn('Try again','newgame',{},'pink big')}`);try{localStorage.removeItem('sot-save-v1');}catch(e){}}
|
||||
function openLinkModal(a,b){
|
||||
if([a,b].includes('kyv')&&[a,b].includes('mos')){openModal(`<div style="display:flex;align-items:center"><h2 style="font-size:24px">Not happening</h2><button class="x" data-act="closeModal" aria-label="Close">×</button></div><p class="lead" style="margin-top:8px">Nobody sells capacity between Kyiv and Moscow, and nobody is going to. Route through Warsaw, Bucharest or Helsinki instead.</p>`);return;}
|
||||
if((cnCity(a)||cnCity(b))&&!cnOk()){openModal(`<div style="display:flex;align-items:center"><h2 style="font-size:24px">Not without a license</h2><button class="x" data-act="closeModal" aria-label="Close">×</button></div><p class="lead" style="margin-top:8px">Building into mainland China needs a joint venture and an operating license. Open ${CITY[cnCity(a)?a:b].name} to apply.</p>`);return;}
|
||||
let route='';UI.pending={a,b};const km=kmBetween(a,b),sub=isSub(a,b),pop=S.pops[b]?0:popCost(b),sib=pairLinks(a,b).filter(l=>l.kind!=='vxc');
|
||||
if(!sib.length)UI.route='diverse';const border=cnCity(a)!==cnCity(b),same=sib.length>0&&UI.route==='same',mult=(sib.length&&!same?DIVERSE:1)*(border?3*(UI.cnPrem&&(a==='hkg'||b==='hkg')?1.6:1):1);
|
||||
|
|
|
|||
|
|
@ -71,3 +71,34 @@ test('traceroute shows hops, the exit and the AS path', () => {
|
|||
ev("ACT.share()");
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('conferences: register, attend, and selective peers get easier for a while', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0");
|
||||
ev("S.day=confDay(CONFS.find(c=>c.c==='fra'),0)-20;ACT.leftTab({t:'deals'})");
|
||||
assert.match(ev("document.body.textContent"), /DENOG-ish/);
|
||||
const key = ev("upcomingConfs(30).find(c=>c.c==='fra').key");
|
||||
ev(`ACT.confGo({key:'${key}'})`);
|
||||
const need0 = ev("(()=>{R.demTo.nfx=0;return peerOk('nfx','ix','fra').why})()");
|
||||
ev("for(let i=0;i<21;i++)dayTick()");
|
||||
assert.ok(ev("S.conf&&S.conf.until>S.day"), 'conference glow is on');
|
||||
const need1 = ev("(()=>{R.demTo.nfx=0;return peerOk('nfx','ix','fra').why})()");
|
||||
assert.notEqual(need0, need1, 'threshold dropped');
|
||||
ev("checkGoals()");
|
||||
assert.ok(ev("S.ach.hallway!==undefined"));
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the guided tutorial walks through the first steps and can be skipped', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
dom.window.__TUBES_TUT__ = true;
|
||||
ev("localStorage.removeItem('sot-tut');ACT.start({})");
|
||||
assert.equal(ev("document.getElementById('coach').hidden"), false);
|
||||
assert.match(ev("document.getElementById('coach').textContent"), /Launch broadband/);
|
||||
ev("ACT.launchBB({city:S.home});renderAll()");
|
||||
assert.match(ev("document.getElementById('coach').textContent"), /Step 2/);
|
||||
ev("ACT.tutSkip()");
|
||||
assert.equal(ev("document.getElementById('coach').hidden"), true);
|
||||
assert.equal(ev("localStorage.getItem('sot-tut')"), '1');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue