diff --git a/CHANGELOG.md b/CHANGELOG.md index 0555bce..418720c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,30 @@ 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] + +- South America is on the map properly: Fortaleza, Rio de Janeiro, Buenos + Aires, Santiago, Lima, Bogotá and Panama City, with new cables including a + ring round Cape Horn, a direct São Paulo–New York cable and the first + cable from Chile to Sydney. Nothing crosses the Darién Gap by land, transit + is pricier because so much traffic hairpins through Miami, and fiber over + the Andes costs double and breaks often. IX.brrr is run by a nonprofit + with cheap public prices, and small Brazilian provedores now buy transit + from you. +- More India: Delhi, Chennai, Bengaluru and Hyderabad, with east-coast cables + to Singapore and a lot of road widening. +- Taiwan: Taipei, with cables to Tokyo, Hong Kong, Los Angeles, Seattle and + Shanghai, and ships that keep dragging their anchors over them. +- The UAE: Abu Dhabi and Fujairah join Dubai. Only the licensed duopoly may + run fiber inside the country, so there is no dark fiber, waves cost 3×, and + POPs need a free-zone license. Most cables land in Fujairah. +- Cape Town, with Atlantic cables up the west coast of Africa and load + shedding: bring a generator. +- New local networks: Clarovision, Vivo-ish, Mercado Livre-ly, Jio-graphy, + Airtel-tale, Chunghwa Tele-calm and do-ish. +- Tap your network's name in the top left for a menu to export or import a + save, or start a new network. + ## [1.5.0] — 2026-10-23 - Several transits in the same city now share the load instead of filling one diff --git a/package.json b/package.json index e414e02..f88cb4a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "homepage": "https://seriesoftub.es/", "repository": { "type": "git", "url": "git+https://github.com/fjaeckel/seriesoftubes.git" }, "scripts": { - "test": "node --test --test-concurrency=1 tests/game.test.js tests/build.test.js tests/persist.test.js tests/services.test.js tests/peering.test.js tests/issues.test.js", + "test": "node --test --test-concurrency=1 tests/game.test.js tests/build.test.js tests/persist.test.js tests/services.test.js tests/peering.test.js tests/issues.test.js tests/regions.test.js", "build": "bash scripts/build.sh", "serve": "npm run build && npx --yes serve@14.2.4 _site" }, diff --git a/site/in.png b/site/in.png new file mode 100644 index 0000000..624b75e Binary files /dev/null and b/site/in.png differ diff --git a/site/index.html b/site/index.html index e5b2076..9c90957 100644 --- a/site/index.html +++ b/site/index.html @@ -224,12 +224,23 @@ section h3{font-size:17px;margin-bottom:6px;display:flex;align-items:center;gap: #hint{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 76px);background:var(--ink);color:#fff;border-radius:12px;padding:6px 12px;font-weight:800;font-size:12.5px;z-index:3;pointer-events:none;max-width:min(440px,calc(100% - 32px));text-align:center;box-shadow:3px 3px 0 rgba(30,38,64,.25)} /* modal */ +.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} +#mega .mtrack{display:inline-block;padding:7px 0;animation:megascroll 40s linear infinite;font:900 16px "Baloo 2",sans-serif;color:#fff;text-shadow:0 2px 0 var(--ink)} +#mega span{margin:0 28px} +#mega span::after{content:"🐘";margin-left:56px} +@keyframes megascroll{from{transform:translateX(0)}to{transform:translateX(-50%)}} +@keyframes megaflash{0%{background:#7A86B8}50%{background:#FF4D5E}} +@media (prefers-reduced-motion:reduce){#mega,#mega .mtrack{animation:none}} #update{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 70px);z-index:18;width:min(520px,calc(100% - 24px));pointer-events:auto} #update .b{pointer-events:auto} .notes{margin:10px 0 0;padding-left:20px;line-height:1.5} .notes li{margin:4px 0} #bankBox{position:fixed;inset:0;background:rgba(30,38,64,.35);z-index:16;overflow:auto;padding:calc(env(safe-area-inset-top,0px) + 12px) max(12px,env(safe-area-inset-right,0px)) 16px max(12px,env(safe-area-inset-left,0px))} #bankCard{max-width:760px;margin:0 auto;padding:16px 18px 18px;background:var(--paper)} +.menubtn{cursor:pointer;text-align:left;font:inherit;border-color:var(--ink)} +.menubtn .caret{font-size:13px;margin-left:2px;opacity:.85} .cashbtn{cursor:pointer;text-align:left;font:inherit;color:inherit;position:relative} .cashbtn .badge{position:absolute;top:-8px;right:-8px;background:var(--me);color:#fff;border:2.5px solid var(--ink);border-radius:10px;font:900 11px Nunito,sans-serif;padding:0 6px;line-height:16px} .loan{border:2.5px solid var(--ink);border-radius:14px;padding:10px 12px;margin-top:10px;display:flex;gap:10px;align-items:flex-start} @@ -326,10 +337,10 @@ input.t{width:100%;box-sizing:border-box;border:3px solid var(--ink);border-radi
-
+
+
Series of Tubes
AS —
+
Traffic served
0
Reach
0%
@@ -361,6 +372,7 @@ input.t{width:100%;box-sizing:border-box;border:3px solid var(--ink);border-radi
+ @@ -394,7 +406,8 @@ const W=2000, H=1000, KM=14; const POP_COST=20000, POP_MO=1500, EYE_RATE=150, CACHE_CAP=100, CACHE_MO=400; const DAY_MS=2500, ROUTER_COST=15000, ROUTER_MO=1500, GEN_COST=12000, GEN_MO=600, DIVERSE=1.4; const RU_BOX=40000, RU_BOX_MO=2000; -const popCost=c=>POP_COST+(c&&CITY[c]&&CITY[c].ru?RU_BOX:0); +const UAE_LIC=15000; +const popCost=c=>POP_COST+(c&&CITY[c]&&CITY[c].ru?RU_BOX:0)+(c&&CITY[c]&&CITY[c].uae?UAE_LIC:0); const CN_LIC=150000, CN_JV_MO=6000, SCRUB_COST=60000, SCRUB_MO=5000; const MYIX_COST=80000, MYIX_MO=3000, MYIX_FEE=1500, START_CASH=200000; const LT=[{n:'10G',g:10,m:1},{n:'100G',g:100,m:2.8},{n:'400G',g:400,m:6},{n:'1.6T',g:1600,m:13},{n:'6.4T',g:6400,m:28}]; @@ -429,7 +442,7 @@ const ampCount=km=>Math.max(0,Math.floor(km/AMP_EVERY)); const fmtCap=g=>g>=1000?(+(g/1000).toFixed(1))+'T':g+'G'; const WAVECO=['Zay-No Fiber','Loomin’ Technologies','Clown Castle Fiber','Bolt Technology','youNetworks','GTT (Got Tangled Twice)']; const MONTHS=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; -const REG={AM:'Americas',EU:'Europe',AF:'Africa',AS:'Asia',OC:'Oceania'}; +const REG={AM:'Americas',SA:'South America',EU:'Europe',AF:'Africa',AS:'Asia',OC:'Oceania'}; const waveMo=(km,sub,tier)=>Math.round((300+km*1.2)*LT[tier].m*(sub?1.8:1)); const FABS=[ {id:'mgp',name:'Megapork',col:'#FF5A1F',cities:['icn','sea','sjc','dal','chi','ash','nyc','mia','lon','ams','fra','par','mrs','sto','mad','sin','hkg','tok','syd','jnb'],blurb:'Elastic interconnection, now with bacon. Spin up a circuit in 59 seconds, oink in 60.'}, @@ -450,15 +463,17 @@ const capName=l=>l.kind==='vxc'?VXC[l.vt].n:l.kind==='df'?(l.ready>S.day?'buildi /* ================= WORLD ================= */ // Real-ish geography: lon/lat outlines, equirectangular, with gentle "magnifying lenses" over the busy regions. -const LENSES=[{lon:9,lat:49,r:170,m:1.25},{lon:121,lat:32,r:120,m:0.45},{lon:-80,lat:40,r:110,m:0.5}]; +const LENSES=[{lon:55.3,lat:24.9,r:26,m:1.2},{lon:78.5,lat:15,r:48,m:1.1},{lon:-44.5,lat:-23.5,r:30,m:1.2},{lon:9,lat:49,r:170,m:1.25},{lon:121,lat:32,r:120,m:0.45},{lon:-80,lat:40,r:110,m:0.5}]; function proj0(lon,lat){return [(lon+180)/360*W,(84-lat)*6.4];} for(const L of LENSES){const q=proj0(L.lon,L.lat);L.x=q[0];L.y=q[1];} function proj(lon,lat){const q=proj0(lon,lat);let dx=0,dy=0;for(const L of LENSES){let ex=q[0]-L.x;ex-=W*Math.round(ex/W);const ey=q[1]-L.y,f=L.m*Math.exp(-(ex*ex+ey*ey)/(L.r*L.r));dx+=ex*f;dy+=ey*f;}return [q[0]+dx,q[1]+dy];} function hav(lo1,la1,lo2,la2){const r=Math.PI/180,dLa=(la2-la1)*r,dLo=(lo2-lo1)*r,a=Math.sin(dLa/2)**2+Math.cos(la1*r)*Math.cos(la2*r)*Math.sin(dLo/2)**2;return 2*6371*Math.asin(Math.min(1,Math.sqrt(a)));} const LANDS_LL=[{id:'am',ll:[[-166,68],[-157,71.2],[-141,69.8],[-128,70],[-115,68.5],[-97,68],[-94,62],[-92.5,57.5],[-85,55.2],[-80,51.5],[-78.5,58],[-77,62],[-70,61],[-64.5,60],[-61.5,56.5],[-57,52],[-55.6,49.5],[-53,47],[-59,46.5],[-61,45.2],[-66,44.5],[-70,43.3],[-70,42],[-74,40.6],[-76,38],[-75.8,35.5],[-77.5,34.5],[-79,33],[-81,31],[-80.05,27],[-80.1,25.3],[-81.5,25],[-82.7,27.5],[-84,30],[-89,30.2],[-94,29.5],[-97,28],[-97.5,25],[-97.7,22],[-96,19],[-94,18.3],[-91,18.5],[-90.4,21],[-87,21.5],[-88,17],[-88.5,15.8],[-84,15.8],[-83.4,12],[-83.7,10.5],[-81.5,9],[-79.5,9.5],[-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],[-80,7.3],[-82.5,8.2],[-85.7,10],[-87,12.5],[-91,14],[-94,16],[-96.5,15.7],[-100,17],[-105.5,20],[-105.5,22.5],[-108,25.5],[-110.8,27.9],[-113,31.3],[-114.7,31.7],[-113.5,29],[-112,26.5],[-110,24],[-109.5,23],[-112,24.8],[-114,27.5],[-115.5,29.8],[-117,32.5],[-118.5,34],[-120.6,34.6],[-122.5,37.5],[-124,40.5],[-124.5,43],[-124,46.2],[-124.7,48.4],[-123,49],[-126,50.5],[-130,54.5],[-133,57.5],[-137,58.5],[-141,60],[-146,61],[-150,59.5],[-152,58.5],[-156,57.5],[-158,56.8],[-162,55.5],[-164.5,54.5],[-158,58.5],[-162,60],[-165,61.5],[-166,64],[-164,65.5]]},{id:'eu',ll:[[-9,39],[-9.5,43],[-8,43.7],[-1.8,43.4],[-1.2,46],[-2.5,47.3],[-4.5,48],[-1.6,48.6],[1.5,50.2],[3,51.2],[4.5,52.5],[5,53.4],[7,53.6],[8.6,54],[8.2,55.5],[8.1,57],[10.5,57.7],[10.5,56.5],[11.2,56],[12.6,56.1],[12.7,55.6],[12.1,54.9],[11,54.3],[14,54],[18.5,54.8],[21,55.3],[21,57],[24,57.5],[24,59.2],[28,59.5],[30,60],[28,60.5],[25,60.1],[22.5,60.3],[21.5,61.5],[21.5,63],[25,65],[25.5,65.6],[22,65.8],[20.5,63.5],[18,62.5],[17.4,61],[19,59.8],[18,59],[16.5,57],[16,56.2],[14.2,55.4],[13,55.4],[12.9,56.5],[11.5,58],[10.5,59.3],[8,58],[5.5,58.5],[5,60],[5,62],[7,63],[10,64],[12.5,66],[15,68.5],[18,69.8],[21.5,70.2],[26,71],[30,70],[33,69.3],[41,67],[44,68.5],[53,68.5],[58,69],[68,69],[69,72.8],[73,72.5],[80,73.5],[87,74.8],[100,76],[104,77.7],[112,74],[113.5,73.5],[127,73.5],[132,71.5],[140,72.5],[150,71.5],[160,70],[170,70],[180,69],[190,66.5],[186,64.5],[182,65],[178,62.5],[173,61],[170,60],[164,60],[164,57],[162,55],[159,52],[156.7,51],[156,55.5],[157,58],[155,59.5],[150,59.5],[143,59.3],[137,54.5],[141,53],[140,48.5],[135,43.5],[131,42.7],[129.5,41],[129.4,37],[129.4,35.5],[127.5,34.6],[126.3,34.8],[126.5,37],[125,37.8],[124.5,39.7],[121.5,39],[121.7,40.8],[119,39.3],[117.8,38.5],[119,37.2],[122.5,37.3],[120.5,36],[119.2,35],[121,32],[121.9,30.8],[121.5,28],[119.5,25.5],[116.5,23],[114.3,22.1],[111,21.5],[109.7,20.5],[108.5,21.6],[106.5,20],[106,18],[108.5,15],[109.3,12],[107,10.5],[105,8.6],[104.8,10.3],[103,11],[100.9,12.6],[100,13.4],[99.3,10.5],[100.3,7],[101,6.8],[103.4,4],[104.3,1.4],[103.6,1.25],[101.3,2.8],[100.2,5.3],[98.3,8],[98.6,13],[97.7,16.5],[94.4,16.2],[94.2,18.8],[92.3,20.6],[91.8,22.6],[90,22],[88.3,21.6],[86.9,20.6],[85,19.5],[82.3,16.6],[80.3,15.8],[80.3,13.5],[79.8,10.3],[78.3,8.9],[77.5,8.1],[76.5,8.9],[75.8,11.5],[74.8,12.9],[73.5,16],[72.8,19],[72.7,21.2],[70,22.5],[68.5,23.5],[66.6,25.4],[61.6,25.2],[57.3,25.8],[56.4,27.1],[54.7,26.5],[51.5,27.9],[50,30],[48,30],[48.4,28.5],[49.5,26.7],[50.8,24.8],[51.6,24.2],[52.6,24.2],[54.6,24.5],[56,26.2],[56.4,24.5],[57.8,23.8],[58.8,22.5],[59.8,22.4],[58.5,20.5],[57.7,19],[55.4,17.7],[52.2,15.7],[48.7,14],[45,12.8],[43.4,12.6],[42.7,15.7],[42.5,17.2],[41,19.5],[39.1,21.6],[38.4,23.6],[37,25.5],[35.2,28],[34.9,29.5],[34.3,27.8],[33,28.8],[32.6,30],[32.3,31.2],[34.2,31.3],[34.9,32.8],[35.6,34.5],[36,35.8],[36.2,36.7],[34.5,36.8],[32.5,36.1],[30.5,36.4],[29,36.6],[27.3,37.4],[26.3,38.6],[26.5,40],[26.2,40.6],[24,40.8],[22.6,40.4],[23.5,38],[22.3,36.5],[21.7,36.8],[21.2,38.4],[19.5,40],[19.5,41.8],[18.5,42.5],[16,43.5],[13.7,45.6],[12.3,45.3],[12.4,44.2],[13.6,43.5],[15.9,41.6],[18.5,40.2],[17,39],[16.6,38],[15.6,38],[16.1,39],[15.6,40.1],[14.3,40.6],[12.5,41.6],[11,42.5],[10.2,43.9],[8.8,44.4],[7.5,43.8],[6,43.1],[4,43.5],[3.1,43.1],[3.2,41.9],[0.8,41],[0,39.5],[-0.3,38.4],[-0.8,37.6],[-2.1,36.7],[-4.4,36.7],[-5.6,36],[-6.3,36.8],[-7.4,37.2],[-8.9,37]]},{id:'af',ll:[[-17.5,14.7],[-17,21],[-16,24],[-13,27.5],[-9.8,30],[-9.2,32.5],[-6.8,34],[-5.9,35.8],[-2,35.1],[1,36.5],[5,36.8],[9.8,37.3],[11,36.9],[10.2,35.2],[11.1,33.3],[15.2,32.3],[19,30.3],[20.1,32],[23,32.6],[25,31.7],[29,30.9],[32.2,31.3],[32.6,30],[33.5,28],[35.5,24],[37.2,21],[38.5,18],[39.6,15.5],[41.6,13.5],[43.3,12.4],[44,10.4],[47,11.1],[51.2,11.8],[51,10.4],[49.5,7],[47.8,4.5],[45,1.6],[42,-1],[40.2,-2.8],[39.3,-4.8],[38.8,-6.5],[39.6,-10],[40.5,-11],[40.6,-14.6],[37,-17.5],[35.4,-22],[35.5,-24],[32.9,-25.9],[32.5,-28.6],[31,-29.9],[28,-32.7],[25.6,-33.9],[22.5,-34],[20,-34.8],[18.4,-34],[17.9,-32.5],[16.5,-28.6],[15.2,-27],[14.4,-23],[12.8,-19],[11.8,-16.8],[12.2,-14.5],[13.6,-12.2],[13.2,-8.8],[12.3,-6],[11.8,-3.5],[9.5,-1],[9.4,1],[9.8,3.2],[8.9,4.5],[6,4.3],[4.3,6.3],[1.6,6.2],[-2,4.8],[-4.6,5.2],[-7.5,4.4],[-9.4,5.4],[-11.5,6.9],[-13.2,8.7],[-15,10.9],[-16.7,12.4]]},{id:'uk',ll:[[-5.7,50.1],[-3,50.6],[1.4,51.2],[1.7,52.7],[0.3,53.4],[-0.2,54.3],[-1.6,55.6],[-2,56.4],[-1.8,57.6],[-3.4,58.6],[-5,58.6],[-6.2,57.5],[-5.6,56.3],[-5,55],[-3.2,54.9],[-3.4,54],[-3,53.4],[-4.6,53.3],[-4.2,52.2],[-5.2,51.7],[-3.2,51.4],[-4.6,51]]},{id:'ie',ll:[[-6,52.2],[-6.2,53.5],[-5.6,54.6],[-6.4,55.2],[-7.4,55.4],[-8.5,54.5],[-10,54.2],[-9.6,53.2],[-10.2,51.9],[-9.6,51.5],[-8.2,51.8]]},{id:'is',ll:[[-22.5,63.9],[-24,65.5],[-22,66.4],[-16,66.5],[-14.5,65.3],[-14.6,64.4],[-18,63.4]]},{id:'jp',ll:[[129.6,33.3],[130.2,31.3],[131.4,31.5],[132,33],[133.5,33.4],[135.2,33.6],[136.8,34.3],[138.8,34.6],[140,35],[140.8,35.7],[141,38.2],[141.9,39.5],[141.4,41.4],[140,41.4],[139.9,40.3],[139.8,38.5],[138.8,37.8],[137.3,36.9],[136,36],[135.4,35.6],[133,35.5],[131.5,34.6],[130.9,34]]},{id:'oc',ll:[[113.5,-22],[114,-26.5],[115,-30],[115.7,-33.6],[115,-34.3],[117.9,-35.1],[123.5,-33.9],[126,-32.3],[131,-31.5],[134,-32.8],[135.6,-34.8],[137.6,-35.6],[138.5,-34.6],[139.6,-36.9],[141.5,-38.4],[144.9,-37.9],[146.4,-39.1],[150,-37.5],[150.8,-34.5],[152.5,-32.4],[153.6,-28.5],[153,-25],[150.8,-22.5],[149,-20.6],[146.3,-18.9],[145.4,-16],[145.3,-14.9],[143.5,-12.3],[142.5,-10.7],[141.6,-12.8],[141.6,-16],[140.6,-17.6],[139.3,-17.4],[137,-15.9],[135.8,-15],[136.8,-12.2],[135,-12],[132.6,-11.5],[131,-12.2],[129.5,-14.9],[128,-15.4],[126.5,-13.9],[124.5,-16.5],[122.2,-18.2],[121,-19.7],[118.5,-20.3],[116.7,-20.6],[114.6,-21.8]]},{id:'nz',ll:[[172.7,-34.4],[174.5,-36],[175.9,-37.5],[178.5,-37.7],[177.9,-39.2],[176.9,-39.6],[175.2,-41.6],[174.6,-41.2],[174.9,-39.9],[173.8,-39.3],[174.6,-38.1],[174.5,-37.3],[173.1,-35.3]]},{id:'idn',ll:[[105.2,-6.8],[106.8,-6.1],[108.5,-6.4],[110.5,-6.9],[112.6,-6.9],[114.6,-7.7],[114.4,-8.7],[111,-8.3],[108,-7.8],[105.5,-7]]},{id:'ph',ll:[[120.6,18.5],[122.2,18.5],[122,16.5],[121.6,14.2],[124,13.8],[124,12.5],[123.3,13],[121,13.6],[120.6,14.5],[119.8,16.2]]}]; -const LANDS=LANDS_LL.map(l=>({id:l.id,pts:l.ll.map(q=>proj(q[0],q[1]))})); +// South America is drawn as part of 'am' but counts as its own landmass: nothing crosses the Darién Gap. +LANDS_LL.push({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={"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={"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'}, @@ -467,7 +482,7 @@ const CITIES=[ {id:'ash',name:'Ashburn',x:572,y:332,land:'am',reg:'AM',P:250,ix:'Equinox Ashburn IX',dc:'Data Center Alley',note:'The data-center capital. Rumor says 70% of the internet passes through here, and nobody has checked.'}, {id:'nyc',name:'New York',x:615,y:283,land:'am',reg:'AM',P:1200,ix:'NY-Yikes',dc:'60 Hudson-ish'}, {id:'mia',name:'Miami',x:530,y:482,land:'am',reg:'AM',P:400,ix:'Miam-IX',dc:'NAP of the Americas-ish',note:'Cable landing hub for South America.'}, - {id:'sao',name:'São Paulo',x:640,y:730,land:'am',reg:'AM',P:900,ix:'IX.brrr',dc:'Digital Reality SP'}, + {id:'sao',name:'São Paulo',x:640,y:730,land:'sa',reg:'SA',P:900,br:true,andes:'e',ix:'IX.brrr',ixCheap:0.3,dc:'Digital Reality SP',note:'South America’s biggest market, and home of IX.brrr: run by a nonprofit, public prices, and nearly everyone is on it.'}, {id:'lon',name:'London',x:935,y:275,land:'uk',reg:'EU',P:1000,ix:'LYNX',dc:'Telehouse-ish Docklands',note:'On an island, so every link off it is a subsea cable.'}, {id:'ams',name:'Amsterdam',x:1015,y:245,land:'eu',reg:'EU',P:350,ix:'HAMS-IX',dc:'Science Park-ish'}, {id:'fra',name:'Frankfurt',x:1075,y:295,land:'eu',reg:'EU',P:600,ix:'DE-KICKS',dc:'Kleyer-ish Campus',note:'Europe\'s crossroads. Lots of networks, lots of sausages.'}, @@ -484,7 +499,7 @@ const CITIES=[ {id:'hel',name:'Helsinki',x:1168,y:140,land:'eu',reg:'EU',P:200,ix:'Sauna-IX',dc:'Underground Sauna Bunker',note:'Fast fiber east and west, and one very nervous subsea cable to Germany.'}, {id:'beg',name:'Belgrade',x:1122,y:338,land:'eu',reg:'EU',P:250,ix:'',dc:'Danube Docks DC'}, {id:'sof',name:'Sofia',x:1165,y:358,land:'eu',reg:'EU',P:250,ix:'Rakija-IX',dc:'Vitosha-ish DC',note:'Balkan peering hub with famously cheap ports.'}, - {id:'dxb',name:'Dubai',x:1292,y:428,land:'eu',reg:'AS',P:400,ix:'Sand-IX',dc:'Air-conditioned Mirage DC',note:'Crossroads for cables between Europe, Asia and Africa. Some voice apps are blocked, and the A/C bill is legendary.'}, + {id:'dxb',name:'Dubai',x:1292,y:428,land:'eu',reg:'AS',P:400,uae:true,ix:'Sand-IX',dc:'Air-conditioned Mirage DC',note:'Crossroads for cables between Europe, Asia and Africa. Some voice apps are blocked, and the A/C bill is legendary.'}, {id:'mos',name:'Moscow',x:1235,y:192,land:'eu',reg:'EU',P:900,ru:true,arpu:0.5,ix:'Borscht-IX',dc:'Very Secure Bunker',note:'Sovereign internet rules: every POP needs a government box in the rack, Goggle video is throttled, and the national firewall runs drills.'}, {id:'akl',name:'Auckland',x:1964,y:826,land:'nz',reg:'OC',P:250,ix:'Kiwi-IX',dc:'Sheep-cooled Shed',note:'Far from everything. Every packet here has a long journey home.'}, {id:'per',name:'Perth',x:1712,y:785,land:'oc',reg:'OC',P:200,ix:'',dc:'Very Remote DC',note:'The most isolated big city on Earth. Asia is closer than Sydney.'}, @@ -498,8 +513,8 @@ const CITIES=[ {id:'sto',name:'Stockholm',x:1110,y:160,land:'eu',reg:'EU',P:300,ix:'NodNod',dc:'Bunker-ish DC'}, {id:'mad',name:'Madrid',x:935,y:392,land:'eu',reg:'EU',P:600,ix:'Siesta-IX',dc:'Interaction MAD'}, {id:'lag',name:'Lagos',x:1010,y:565,land:'af',reg:'AF',P:500,ix:'Jollof-IX',dc:'Rack Centre-ish'}, - {id:'jnb',name:'Johannesburg',x:1130,y:730,land:'af',reg:'AF',P:400,ix:'Braai-IX',dc:'Teraco-ish'}, - {id:'bom',name:'Mumbai',x:1385,y:488,land:'eu',reg:'AS',P:1100,ix:'Mumb-IX',dc:'Nesco-ish'}, + {id:'jnb',name:'Johannesburg',x:1130,y:730,land:'af',reg:'AF',P:400,za:true,ix:'Braai-IX',dc:'Teraco-ish'}, + {id:'bom',name:'Mumbai',x:1385,y:488,land:'eu',reg:'AS',P:1100,india:true,ix:'Mumb-IX',dc:'Nesco-ish'}, {id:'sin',name:'Singapore',x:1556,y:568,land:'eu',reg:'AS',P:450,ix:'Lah-IX',dc:'Equinox SG-ish',note:'Asia\'s hub. Expensive, humid, very well connected.'}, {id:'hkg',name:'Hong Kong',x:1645,y:440,land:'eu',reg:'AS',P:600,ix:'HK-Kicks',dc:'Mega-ish Plus'}, {id:'icn',name:'Seoul',x:1722,y:302,land:'eu',reg:'AS',P:900,ix:'Kimch-IX',dc:'Gasan-ish Digital Complex',note:'Some of the fastest home broadband on the planet. The eyeballs here expect a lot.'}, @@ -507,9 +522,24 @@ const CITIES=[ {id:'sha',name:'Shanghai',x:1680,y:388,land:'eu',reg:'AS',P:2200,cn:true,arpu:0.6,ix:'',dc:'Lujiazui-ish Data Center',note:'Mainland China. Enormous market, strict rules, and a famously congested border.'}, {id:'tok',name:'Tokyo',x:1795,y:320,land:'jp',reg:'AS',P:1400,ix:'JP-Naptime',dc:'Otemachi-ish'}, {id:'syd',name:'Sydney',x:1860,y:790,land:'oc',reg:'OC',P:500,ix:'Roo-IX',dc:'Global Swish'}, +{id:'for',name:'Fortaleza',x:0,y:0,land:'sa',reg:'SA',P:250,br:true,andes:'e',ix:'IX.brrr Fortaleza',ixCheap:0.3,dc:'Praia Landing Station',note:'Where South America’s cables actually land. Europe, Africa and the US come ashore here, then ride a long backhaul south.'}, + {id:'rio',name:'Rio de Janeiro',x:0,y:0,land:'sa',reg:'SA',P:600,br:true,andes:'e',ix:'IX.brrr Rio',ixCheap:0.3,dc:'Copacabana Colo',note:'Beaches, cable landings and a Carnival that melts traffic graphs every February.'}, + {id:'bue',name:'Buenos Aires',x:0,y:0,land:'sa',reg:'SA',P:500,andes:'e',arpu:0.7,ix:'Asado-IX',dc:'Puerto Madero-ish DC',note:'Tango, steak and a currency that changes value while you read this.'}, + {id:'scl',name:'Santiago',x:0,y:0,land:'sa',reg:'SA',P:350,andes:'w',ix:'Empanada-IX',dc:'Andes-view Bunker',note:'The Pacific gateway. The Andes sit between it and everything else, and the ground shakes now and then.'}, + {id:'lim',name:'Lima',x:0,y:0,land:'sa',reg:'SA',P:400,andes:'w',ix:'Ceviche-IX',dc:'Fog-cooled DC',note:'It almost never rains, but the sea fog keeps the racks cool.'}, + {id:'bog',name:'Bogotá',x:0,y:0,land:'sa',reg:'SA',P:400,andes:'m',ix:'Arepa-IX',dc:'2,600 m Above Sea Level DC',note:'High up in the Andes. No fiber crosses the Darién Gap jungle to Panama, so the way north is under the sea.'}, + {id:'pan',name:'Panama City',x:0,y:0,land:'am',reg:'AM',P:80,ix:'Canal-IX',dc:'Isthmus Interconnect',note:'Every cable between the Americas squeezes past here. Nothing crosses the Darién Gap by land, so South America is always a subsea hop away.'}, + {id:'del',name:'Delhi',x:0,y:0,land:'eu',reg:'AS',P:1600,arpu:0.4,india:true,ix:'Butter-Chicken-IX',dc:'Smog-filtered DC',note:'An enormous, very online city a long way from the sea. Every subsea byte rides a backhaul from Mumbai or Chennai.'}, + {id:'maa',name:'Chennai',x:0,y:0,land:'eu',reg:'AS',P:500,arpu:0.5,india:true,ix:'Dosa-IX',dc:'Cyclone-rated Landing Bay',note:'India’s east-coast landing hub, with cables to Singapore. Cyclone season is a thing.'}, + {id:'blr',name:'Bengaluru',x:0,y:0,land:'eu',reg:'AS',P:600,arpu:0.6,india:true,ix:'Filter-Kaapi-IX',dc:'Traffic-jam-adjacent Campus',note:'India’s tech capital. Packets move faster than the cars outside.'}, + {id:'hyd',name:'Hyderabad',x:0,y:0,land:'eu',reg:'AS',P:400,arpu:0.5,india:true,ix:'Biryani-IX',dc:'Hyperscale Hills',note:'Every hyperscaler is building a region here. The land is cheap and the biryani is excellent.'}, + {id:'tpe',name:'Taipei',x:0,y:0,land:'tw',reg:'AS',P:450,ix:'Bubble-Tea-IX',dc:'Typhoon-proof Tower',note:'Makes most of the world’s chips and hangs on a handful of subsea cables. Ships keep “accidentally” dragging their anchors over them.'}, + {id:'auh',name:'Abu Dhabi',x:0,y:0,land:'eu',reg:'AS',P:200,arpu:1.4,uae:true,ix:'',dc:'Oasis-cooled Campus',note:'The capital. Sovereign AI money and very big data centers. Inside the UAE only the two licensed operators may run fiber.'}, + {id:'fuj',name:'Fujairah',x:0,y:0,land:'eu',reg:'AS',P:20,uae:true,ix:'',dc:'Cable Landing Sandcastle',note:'Most UAE cables land on this coast, outside the Strait of Hormuz. Getting from here to Dubai means renting from the duopoly.'}, + {id:'cpt',name:'Cape Town',x:0,y:0,land:'af',reg:'AF',P:250,za:true,ix:'Biltong-IX',dc:'Table Mountain Colo',note:'Where the Atlantic cables to Africa’s south land. Penguins on the beach, load shedding on the grid.'}, ]; // 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]}; +const CITY_NUDGE={stg:[30,6],fra:[-8,-8],auh:[-30,3],fuj:[8,30],dxb:[6,-8],rio:[14,-16]}; for(const c of CITIES){const q=CITY_LL[c.id];if(q){c.lon=q[0];c.lat=q[1];const pt=proj(q[0],q[1]),n=CITY_NUDGE[c.id]||[0,0];c.x=pt[0]+n[0];c.y=pt[1]+n[1];}} const CITY=Object.fromEntries(CITIES.map(c=>[c.id,c])); const CABLES=[ @@ -519,19 +549,19 @@ const CABLES=[ {"id":"amitie","name":"Amitié-ish","price":0.9,"age":"new","blurb":"A friendly cable with French manners.","pairs":[["nyc","lon",[[-70,41.5],[-50,46],[-25,49],[-8,50.3]]],["nyc","par",[[-70,41.3],[-50,45],[-25,47.5],[-5,47.6]]]]}, {"id":"hibx","name":"Hibernia Express-o","price":1.7,"age":"mid","blurb":"The straightest line across the Atlantic. Traders pay double to save a few milliseconds.","pairs":[["nyc","lon",[[-68,42],[-55,46.5],[-30,52.5],[-12,52.5]]]],"lat":0.9}, {"id":"tat","name":"TAT-14 Retirement Home","price":1.3,"age":"old","blurb":"Laid last century. Cuts often, costs more, still somehow running.","pairs":[["nyc","ams",[[-70,41],[-45,48],[-20,52],[0,54],[3,53.5]]]]}, - {"id":"ella","name":"EllaLink-ing","price":1.0,"age":"new","blurb":"Brazil straight to Iberia, skipping the US entirely.","pairs":[["sao","mad",[[-44,-24.5],[-38,-14],[-34,-6],[-30,5],[-22,20],[-14,33],[-10,37.5]]]]}, - {"id":"sacs","name":"SACS-y Cable","price":1.0,"age":"mid","blurb":"South Atlantic, cool and confident.","pairs":[["sao","lag",[[-44,-24.5],[-35,-10],[-15,-3],[0,2],[3,5.5]]]]}, + {"id":"ella","name":"EllaLink-ing","price":1.0,"age":"new","blurb":"Brazil straight to Iberia, skipping the US entirely.","pairs":[["for","mad",[[-37,-2.2],[-32,5],[-22,20],[-14,33],[-10,37.5]]],["sao","mad",[[-44,-24.5],[-38,-14],[-34,-6],[-30,5],[-22,20],[-14,33],[-10,37.5]]]]}, + {"id":"sacs","name":"SACS-y Cable","price":1.0,"age":"mid","blurb":"South Atlantic, cool and confident.","pairs":[["for","lag",[[-36,-3],[-20,0],[0,3]]],["sao","lag",[[-44,-24.5],[-35,-10],[-15,-3],[0,2],[3,5.5]]]]}, {"id":"col3","name":"Columbus III-and-a-half","price":1.4,"age":"old","blurb":"Discovered the Atlantic again. Old, pricey and fragile.","pairs":[["mia","mad",[[-79,26],[-60,30],[-30,35],[-10,36.5]]]]}, {"id":"twoaf","name":"2Africa-n-Back","price":0.75,"age":"new","blurb":"All the way around Africa and back. Cheapest capacity on the map.","pairs":[["lon","lag",[[-6,49],[-12,40],[-20,20],[-18,8],[-5,3],[3,5.5]]],["jnb","mrs",[[32,-30],[40,-20],[45,-5],[52,10],[45,12.3],[44,12.4],[41,15.1],[38,21.1],[35,26.1],[33,29.6],[32.4,31.3],[30,32.1],[20,34.1],[12,37.6],[6,42.5]]],["mrs","bom",[[6,42.5],[12,37.6],[20,34.1],[30,32.1],[32.4,31.3],[33,29.6],[35,26.1],[38,21.1],[41,15.1],[44,12.4],[52,13],[62,18],[70,19]]]]}, - {"id":"equi","name":"Equi-yes","price":0.8,"age":"new","blurb":"Always agrees with you. Iberia to West Africa.","pairs":[["mad","lag",[[-10,38],[-15,28],[-18,15],[-14,5],[-2,3],[3,5.8]]]]}, + {"id":"equi","name":"Equi-yes","price":0.8,"age":"new","blurb":"Always agrees with you. Iberia to West Africa.","pairs":[["lag","cpt",[[4,3],[6,-5],[10,-20],[16,-33]]],["mad","lag",[[-10,38],[-15,28],[-18,15],[-14,5],[-2,3],[3,5.8]]]]}, {"id":"smw6","name":"SEE-ME-WAVE 6","price":0.95,"age":"new","blurb":"Sixth in a long-running series. Europe to India to Singapore.","pairs":[["mrs","bom",[[6.4,42.74],[12.4,37.84],[20.4,34.34],[30.4,32.34],[32.8,31.54],[33.4,29.84],[35.4,26.34],[38.4,21.34],[41.4,15.34],[44.4,12.64],[52,13.4],[62,18.4],[70,19.4]]],["bom","sin",[[72,17],[76,8],[80.5,5],[90,5],[96,5.5],[100,4],[103,1.5]]],["mrs","sin",[[6.4,42.74],[12.4,37.84],[20.4,34.34],[30.4,32.34],[32.8,31.54],[33.4,29.84],[35.4,26.34],[38.4,21.34],[41.4,15.34],[44.4,12.64],[52,12.8],[62,12.5],[75,6.8],[80.5,5.2],[92,5.8],[97,5.8],[100.5,4],[103,1.7]]]]}, {"id":"peace","name":"PEACE-out","price":0.85,"age":"new","blurb":"Marseille to Singapore, then it leaves the party.","pairs":[["mrs","sin",[[5.6,42.26],[11.6,37.36],[19.6,33.86],[29.6,31.860000000000003],[32.0,31.060000000000002],[32.6,29.360000000000003],[34.6,25.860000000000003],[37.6,20.860000000000003],[40.6,14.86],[43.6,12.16],[52,12.2],[62,11.8],[75,6.3],[80.5,4.6],[92,5.2],[97,5.3],[100.5,3.6],[103,1.4]]]]}, {"id":"aae","name":"AAE-1-ish","price":1.0,"age":"mid","blurb":"Asia, Africa, Europe, and one more thing.","pairs":[["mrs","hkg",[[6.8,42.98],[12.8,38.08],[20.8,34.58],[30.8,32.58],[33.199999999999996,31.78],[33.8,30.080000000000002],[35.8,26.580000000000002],[38.8,21.580000000000002],[41.8,15.58],[44.8,12.88],[52,11.8],[62,11.4],[75,6],[80.5,4.4],[92,5],[97,5],[100.5,3.3],[104.5,1.5],[107,5],[110,10],[113,18],[114.2,21.8]]],["sin","hkg",[[104.5,1.5],[108,6],[111,12],[114,20],[114.2,22]]]]}, - {"id":"apg","name":"A Pretty Gateway","price":0.9,"age":"mid","blurb":"The pretty way around East Asia.","pairs":[["sin","hkg",[[105,2],[109,7],[112,13],[114.6,20],[114.4,22]]],["hkg","tok",[[116,21.5],[122,24],[126,28],[132,32],[137,33.8],[139.8,35]]],["hkg","icn",[[116,22],[122,26],[125,32],[126,35],[126.2,36.8]]],["tok","icn",[[136,33.8],[130,33.5],[128,34.5],[126.5,35.5]]],["tok","sha",[[135,33.5],[128,31.5],[122.5,31.2]]]]}, + {"id":"apg","name":"A Pretty Gateway","price":0.9,"age":"mid","blurb":"The pretty way around East Asia.","pairs":[["tpe","tok",[[123,25.5],[130,29.5],[137,33.5]]],["hkg","tpe",[[116.5,21.8],[119.5,22.8]]],["sin","hkg",[[105,2],[109,7],[112,13],[114.6,20],[114.4,22]]],["hkg","tok",[[116,21.5],[122,24],[126,28],[132,32],[137,33.8],[139.8,35]]],["hkg","icn",[[116,22],[122,26],[125,32],[126,35],[126.2,36.8]]],["tok","icn",[[136,33.8],[130,33.5],[128,34.5],[126.5,35.5]]],["tok","sha",[[135,33.5],[128,31.5],[122.5,31.2]]]]}, {"id":"jup","name":"Jupiterrible","price":0.9,"age":"new","blurb":"Named after a planet, behaves like one: big and far away.","pairs":[["lax","tok",[[-121,33.5],[-145,32],[-175,32],[-200,33],[-218,34.5]]]]}, {"id":"fast","name":"FASTEST","price":0.85,"age":"mid","blurb":"Its predecessor was FASTER. Marketing had a good day.","pairs":[["sea","tok",[[-125,46],[-150,45],[-180,42],[-205,38],[-218,35]]]]}, - {"id":"ncp","name":"New Cross Pacific-ish","price":1.0,"age":"mid","blurb":"Crosses the Pacific, mildly annoyed about it.","pairs":[["sea","icn",[[-125,46.5],[-155,46.5],[-185,42],[-212,33],[-229,33.8],[-232,36]]],["sea","sha",[[-125,46.2],[-155,45.5],[-185,40],[-212,31],[-236,30.5]]]]}, - {"id":"plcn","name":"Pacific Light-ish","price":1.1,"age":"mid","blurb":"Lighter on paperwork than its namesake. Still heavy on paperwork.","pairs":[["lax","hkg",[[-121,33],[-150,25],[-180,22],[-215,21],[-240,21.5]]]]}, + {"id":"ncp","name":"New Cross Pacific-ish","price":1.0,"age":"mid","blurb":"Crosses the Pacific, mildly annoyed about it.","pairs":[["sea","tpe",[[-125,46],[-155,45],[-185,38],[-212,28],[-235,25.6]]],["sea","icn",[[-125,46.5],[-155,46.5],[-185,42],[-212,33],[-229,33.8],[-232,36]]],["sea","sha",[[-125,46.2],[-155,45.5],[-185,40],[-212,31],[-236,30.5]]]]}, + {"id":"plcn","name":"Pacific Light-ish","price":1.1,"age":"mid","blurb":"Lighter on paperwork than its namesake. Still heavy on paperwork.","pairs":[["lax","tpe",[[-121,33],[-150,25],[-180,22],[-215,22],[-236,24]]],["lax","hkg",[[-121,33],[-150,25],[-180,22],[-215,21],[-240,21.5]]]]}, {"id":"scx","name":"Southern Cross-ed Fingers","price":1.2,"age":"old","blurb":"Old Pacific workhorse. Everyone hopes it holds.","pairs":[["sjc","syd",[[-123,37],[-150,20],[-175,0],[-190,-20],[-200,-30],[-207,-33.5]]],["akl","syd",[[168,-37],[158,-35]]]]}, {"id":"hwk","name":"Hawaiki-wiki","price":0.95,"age":"new","blurb":"Quick Pacific crossing with a stop for snacks.","pairs":[["sea","syd",[[-125,45],[-150,20],[-170,-5],[-185,-25],[-200,-32],[-206,-33.8]]],["akl","sea",[[178,-34],[190,-20],[210,10],[230,40],[234.5,47]]]]}, {"id":"indigo","name":"Indigo-go","price":0.9,"age":"new","blurb":"Singapore to Sydney in one go, via Perth.","pairs":[["sin","syd",[[104.5,0],[107,-8],[113,-12],[112,-25],[114,-35],[130,-37],[145,-41],[152,-36]]],["sin","per",[[104.6,0],[107.2,-8],[113,-14],[112.5,-25],[115,-31.8]]]]}, @@ -547,7 +577,7 @@ const CABLES=[ {"id":"aec","name":"AEConnect-the-Dots","price":0.85,"age":"new","blurb":"New York to Ireland: the tech-tax express.","pairs":[["nyc","dub",[[-70,41],[-50,47],[-25,52],[-11,52.8]]]]}, {"id":"havf","name":"Havfun","price":0.8,"age":"new","blurb":"Danish for “sea fun”. Probably.","pairs":[["nyc","cph",[[-70,41.5],[-50,49],[-25,55],[-10,58],[0,58],[7,57.5],[10,57.6]]],["dub","cph",[[-10,54.5],[-8,57],[-2,59],[6,58],[10,57.6]]]]}, {"id":"celtix","name":"Celtix Connected","price":0.7,"age":"mid","blurb":"Dublin to London across the Irish Sea.","pairs":[["dub","lon",[[-5,53.4]]]]}, - {"id":"falcon","name":"Falcon Punch","price":0.9,"age":"mid","blurb":"Dubai to Mumbai. Hits hard.","pairs":[["dxb","bom",[[57,25.5],[60,23],[66,21],[71,19]]]]}, + {"id":"falcon","name":"Falcon Punch","price":0.9,"age":"mid","blurb":"Dubai to Mumbai. Hits hard.","pairs":[["fuj","bom",[[58,24.8],[63,22.3],[70,19.2]]],["dxb","bom",[[57,25.5],[60,23],[66,21],[71,19]]]]}, {"id":"eig","name":"Eye-Gee","price":1.0,"age":"mid","blurb":"Europe-India Gateway-ish, through the Red Sea.","pairs":[["dxb","mrs",[[57,25],[59,22],[55,16],[48,12.8],[43.2,11.92],[40.2,14.62],[37.2,20.62],[34.2,25.62],[32.2,29.12],[31.599999999999998,30.82],[29.2,31.62],[19.2,33.620000000000005],[11.2,37.120000000000005],[5.2,42.02]]]]}, {"id":"clion","name":"C-Lion King","price":1.0,"age":"new","blurb":"Helsinki to Germany under the Baltic. Anchors keep finding it.","pairs":[["hel","fra",[[24,59.8],[20,57.5],[15,55.2],[12.2,54.3]]]]}, {"id":"uly","name":"Ulysses-ish","price":0.8,"age":"old","blurb":"Short hop across the North Sea. An odyssey it is not.","pairs":[["lon","ams",[[2,51.8]]]]}, @@ -555,6 +585,19 @@ const CABLES=[ {"id":"medn","name":"Med-Nauti-lust","price":0.9,"age":"mid","blurb":"Across the Mediterranean, Egypt to France. Romantic, in a cable way.","pairs":[["cai","mrs",[[29.9,31.4],[28,32.5],[20,34.5],[12,38],[6.5,42.6]]]]}, {"id":"eassy","name":"EASSy Peasy","price":0.95,"age":"mid","blurb":"East Africa up to Europe via the Red Sea. Lemon squeezy.","pairs":[["nbo","mrs",[[39.7,-4],[42,-1],[45,2],[51,10.5],[45,12.3],[43.4,12.0],[40.4,14.7],[37.4,20.700000000000003],[34.4,25.700000000000003],[32.4,29.200000000000003],[31.799999999999997,30.900000000000002],[29.4,31.700000000000003],[19.4,33.7],[11.4,37.2],[5.4,42.1]]]]}, {"id":"teams","name":"TEAMS-work","price":0.9,"age":"mid","blurb":"Kenya to the Gulf. Makes the dream work.","pairs":[["nbo","dxb",[[39.7,-4],[44,0],[52,8],[58,18],[59,22.5],[57,25]]]]}, + {"id":"monet","name":"Mo-Net-y","price":0.9,"age":"new","blurb":"Brazil to Florida. The invoice arrives just as fast.","pairs":[["sao","mia",[[-44,-25.5],[-36,-14],[-33,-4],[-45,4],[-62,16],[-76,25]]],["for","mia",[[-37,-2.2],[-45,4.5],[-62,16.5],[-76,25.3]]]]}, + {"id":"seabras","name":"Sea-Bras","price":0.9,"age":"new","blurb":"Straight from São Paulo to New York, skipping the Miami hairpin.","pairs":[["sao","nyc",[[-44,-25.5],[-34,-10],[-33,0],[-50,18],[-66,33],[-72,39.5]]]]}, + {"id":"sam1","name":"SAM-1-and-Done","price":1.2,"age":"old","blurb":"An old ring around the whole continent, the long way round Cape Horn.","pairs":[["mia","for",[[-75,24],[-62,16],[-45,4],[-37,-2.5]]],["for","rio",[[-36,-4],[-34,-9],[-37,-16],[-41,-23.6]]],["rio","sao",[[-44,-24.3]]],["sao","bue",[[-47,-27],[-52,-35],[-56,-36]]],["bue","scl",[[-56,-37.5],[-62,-45],[-65,-56],[-72,-56],[-77,-45],[-74,-34]]],["scl","lim",[[-73.5,-30],[-74,-20],[-78,-13]]],["lim","pan",[[-81,-6],[-82,0],[-80,7]]],["pan","mia",[[-79.5,10],[-77,15],[-74,19.5],[-75,23],[-79,25]]]]}, + {"id":"curie","name":"Curie-osity","price":0.85,"age":"new","blurb":"Los Angeles to Chile, with a small detour for Panama.","pairs":[["lax","scl",[[-120,30],[-108,14],[-92,0],[-80,-20],[-73,-33]]],["lax","pan",[[-120,30],[-105,15],[-90,7],[-80,7.5]]]]}, + {"id":"pccs","name":"Caribbean Crossing-ish","price":1.0,"age":"mid","blurb":"Hops the Caribbean so Bogotá can skip the jungle.","pairs":[["mia","bog",[[-80,24],[-77.5,19],[-76,12],[-75,10.5]]],["pan","bog",[[-79.6,9.6],[-77,9.9],[-75.5,10.5]]]]}, + {"id":"tannat","name":"Tannat-ish","price":0.9,"age":"mid","blurb":"Named after a wine. São Paulo to Buenos Aires, past Uruguay.","pairs":[["sao","bue",[[-46,-26],[-50,-32],[-55,-35.5]]]]}, + {"id":"humb","name":"Humboldt Penguin","price":1.3,"age":"new","blurb":"The first cable from South America to Oceania. 14,000 km of very lonely glass.","pairs":[["scl","syd",[[-75,-34],[-110,-38],[-150,-40],[-180,-38],[-200,-35],[-206,-34]]]]}, + {"id":"wacs","name":"WACS-a-Mole","price":1.1,"age":"mid","blurb":"Up the west coast of Africa. Something on it is always down.","pairs":[["cpt","lag",[[16,-34],[10,-20],[6,-5],[4,3]]],["lag","lon",[[3,4],[-10,8],[-20,20],[-15,35],[-10,45],[-6,49.5]]]]}, + {"id":"safe","name":"SAFE-ish (Not Very)","price":1.4,"age":"old","blurb":"An old cable from Cape Town round to India, via some very small islands.","pairs":[["cpt","bom",[[22,-36],[45,-30],[57,-20],[65,0],[70,15]]]]}, + {"id":"bbg","name":"Bay of Bengal Gateway-ish","price":0.95,"age":"mid","blurb":"Fujairah to Mumbai, round the tip of India to Chennai, then on to Singapore.","pairs":[["fuj","bom",[[58,24.5],[63,22],[69.5,19.5]]],["bom","maa",[[72,15],[75,8],[78.5,6.6],[81.8,8],[81,12]]],["maa","sin",[[82,12],[90,8],[96.5,6],[100,3.5],[102.5,2],[103.6,1.25]]]]}, + {"id":"i2i","name":"i2i-ish (Eye to Eye)","price":0.85,"age":"mid","blurb":"Chennai to Singapore, looking it straight in the eye.","pairs":[["maa","sin",[[82,13],[91,9.5],[97,6.6],[100.2,3.8],[102.6,2.2],[103.7,1.3]]]]}, + {"id":"tse","name":"Strait-ish Express","price":1.5,"age":"old","blurb":"A short cable across a very tense strait.","pairs":[["tpe","sha",[[122.2,26.5],[122.6,29],[122.2,31]]]]}, + {"id":"gbi","name":"Gulf Bridge Over Troubled Water","price":1.0,"age":"mid","blurb":"Leaves the Gulf from Fujairah and runs up the Red Sea to Europe.","pairs":[["fuj","mrs",[[57.5,23.5],[59.5,21.5],[55,15.5],[48,12.6],[43.2,11.8],[40.2,14.5],[37.2,20.5],[34.2,25.5],[32.2,29],[31.6,30.7],[29.2,31.5],[19.2,33.5],[11.2,37],[5.2,42]]]]} ]; const CAB=Object.fromEntries(CABLES.map(c=>[c.id,c])); const CABLE_PAIRS=CABLES.flatMap(c=>c.pairs.map(([a,b,mid])=>{const A=CITY[a],B=CITY[b];const near=(x,ref)=>x+W*Math.round((ref-x)/W); @@ -567,20 +610,20 @@ 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=['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=['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']; +const BIGC=['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=['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'],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'],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'],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'],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'],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'],ix:'ALL',blurb:'Will peer with anyone, anywhere. Rumored to mail out IPv6 cakes.'}, + {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'],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'],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'],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'],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'],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'],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'],ix:['par','mrs','mad','lon','ams','lag','jnb'],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'],ix:['sin','hkg','tok','syd','bom'],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'],ix:['lon','fra','ams','mad','mrs','jnb','bom','lag'],blurb:'Mobile giant. The signal is real, the name is not.'}, + {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'],ix:['sin','hkg','tok','syd','bom','tpe','maa'],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'],ix:['lon','fra','ams','mad','mrs','jnb','bom','lag','cpt','del','maa'],blurb:'Mobile giant. The signal is real, the name is not.'}, {id:'ctc',name:'China Telecomet',asn:4314,type:'t2',pol:'restrictive',share:.02,price:22,premium:2.5,cn:true,col:'#0B5CAD',pops:['pek','sha','hkg','sin','tok','lon','fra','nyc','sjc'],ix:[],blurb:'The biggest network in China. Its CN-Too premium route skips the congested border, for a price.'}, {id:'cun',name:'China Unicorn',asn:4837,type:'t2',pol:'restrictive',share:.015,price:16,cn:true,col:'#D7000F',pops:['pek','sha','hkg','fra','sjc','lon'],ix:[],blurb:'Number two in China, with a horn for every backbone.'}, {id:'cmb',name:'China Moble',asn:9880,type:'eye',pol:'paid',paidFee:12000,share:.01,cn:true,col:'#0085CA',pops:['pek','sha','hkg'],ix:[],blurb:'The largest mobile network on Earth. Paid peering only.'}, @@ -604,17 +647,25 @@ NETS.push( {id:'rtc',name:'Rostelecomedy',asn:12389,type:'t2',pol:'selective',minIx:20,minPni:40,share:.01,price:6,col:'#7700FF',pops:['mos','hel','sto','fra','ams'],ix:['mos','fra','ams'],blurb:'The national carrier. Every punchline is pre-approved.'}, {id:'ydx',name:'Yawndex',asn:13238,type:'cdn',pol:'open',share:.008,col:'#FC3F1D',pops:['mos','hel','fra','ams'],ix:['mos','hel','fra','ams'],blurb:'Search, taxis and maps. Slightly sleepy.'}, {id:'vkl',name:'VKontakt-lens',asn:47541,type:'cdn',pol:'open',share:.006,col:'#0077FF',pops:['mos','hel'],ix:['mos','hel'],blurb:'Social network with perfect vision.'}, - {id:'ets',name:'Etis-a-lot',asn:5384,type:'eye',pol:'paid',paidFee:8000,share:.006,col:'#719E19',pops:['dxb','mrs','lon','fra','sin'],ix:[],blurb:'Charges a lot. Paid peering only, and the name says it all.'}, + {id:'ets',name:'Etis-a-lot',asn:5384,type:'eye',pol:'paid',paidFee:8000,share:.006,col:'#719E19',pops:['dxb','mrs','lon','fra','sin','auh','fuj'],ix:[],blurb:'Charges a lot. Paid peering only, and the name says it all.'}, {id:'tmx',name:'Tel-Mess',asn:8151,type:'eye',pol:'paid',paidFee:7000,share:.008,col:'#00A0DF',pops:['mex','dal','lax','mia'],ix:[],blurb:'Mexico’s giant. Paid peering only, and the pricing is a mess.'}, {id:'bcd',name:'Bell Canad-eh',asn:577,type:'eye',pol:'selective',minIx:10,minPni:30,share:.01,col:'#00549A',pops:['tor','mtl','nyc','chi'],ix:['tor','mtl'],blurb:'Polite, enormous, and sorry about the bill.'}); NETS.push( {id:'tsf',name:'Telkom-selfie',asn:7713,type:'eye',pol:'selective',minIx:10,minPni:30,share:.01,col:'#E4002B',pops:['jkt','sin'],ix:['jkt','sin'],blurb:'Indonesia’s mobile giant. Every packet poses for a photo first.'}, {id:'pld',name:'PLDTea Time',asn:9299,type:'eye',pol:'selective',minIx:10,minPni:30,share:.008,col:'#D62027',pops:['mnl','hkg','sin'],ix:['mnl','hkg'],blurb:'Philippine giant. Peering requests are reviewed over a cup of tea.'}, {id:'spk',name:'Spark-le',asn:4771,type:'eye',pol:'open',share:.005,col:'#6A2C91',pops:['akl','syd'],ix:['akl','syd'],blurb:'New Zealand’s shiniest ISP.'}, - {id:'tsy',name:'Telstraya',asn:1221,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:9,col:'#0099F8',pops:['syd','per','sin','hkg','lax'],ix:['syd','per','sin','hkg'],blurb:'Australia’s big one. G’day, that will be nine dollars a megabit. Sorry, gigabit.'}); + {id:'tsy',name:'Telstraya',asn:1221,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:9,col:'#0099F8',pops:['syd','per','sin','hkg','lax','tpe'],ix:['syd','per','sin','hkg'],blurb:'Australia’s big one. G’day, that will be nine dollars a megabit. Sorry, gigabit.'}); NETS.push( {id:'sfc',name:'Safari-Comic',asn:33771,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#4CB848',pops:['nbo'],ix:['nbo'],blurb:'Kenya’s mobile giant. Pays you in M-Pesos.'}, {id:'teg',name:'Tele-Comet Egypt',asn:8452,type:'t2',pol:'selective',minIx:15,minPni:40,share:.006,price:8,col:'#5B2D8E',pops:['cai','mrs','fra','lon'],ix:['cai','mrs'],blurb:'Owns the land crossing every Red Sea cable needs. Collects tolls like a pharaoh.'}); +NETS.push( + {id:'clr',name:'Clarovision',asn:28537,type:'t2',pol:'selective',minIx:10,minPni:30,share:.012,price:5,col:'#DA291C',pops:['sao','rio','for','bue','scl','lim','bog','pan','mex','mia'],ix:['sao','rio','for','bue','scl','lim','bog'],blurb:'The big regional carrier. Sees everything clearly, especially your invoice.'}, + {id:'viv',name:'Vivo-ish',asn:26959,type:'eye',pol:'selective',minIx:8,minPni:25,share:.01,col:'#660099',pops:['sao','rio','for'],ix:['sao','rio','for'],blurb:'Brazil’s mobile giant. Very much alive.'}, + {id:'mlv',name:'Mercado Livre-ly',asn:52850,type:'cdn',pol:'open',share:.006,col:'#FFE600',pops:['sao','rio','bue','scl','bog','lim','mia'],ix:['sao','rio','bue','scl','bog','lim'],blurb:'Ships parcels and packets, both overnight.'}, + {id:'jio',name:'Jio-graphy',asn:55863,type:'eye',pol:'selective',minIx:10,minPni:30,share:.02,col:'#0F3CC9',pops:['bom','del','maa','blr','hyd'],ix:['bom','del','maa','blr','hyd'],blurb:'Gave a billion people cheap data. Knows exactly where every one of them is.'}, + {id:'atl',name:'Airtel-tale',asn:9849,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:7,col:'#E40000',pops:['bom','del','maa','blr','hyd','sin','lon','dxb'],ix:['bom','del','maa','blr'],blurb:'India’s other giant. Every outage comes with a story.'}, + {id:'cht',name:'Chunghwa Tele-calm',asn:3426,type:'t2',pol:'selective',minIx:10,minPni:30,share:.008,price:7,col:'#00A0E9',pops:['tpe','hkg','tok','lax','sin'],ix:['tpe','hkg'],blurb:'Taiwan’s incumbent. Stays calm while ships drag their anchors over its cables.'}, + {id:'duu',name:'do-ish',asn:15820,type:'eye',pol:'paid',paidFee:6000,share:.004,col:'#00A9CE',pops:['dxb','auh','fuj'],ix:[],blurb:'The other half of the UAE duopoly. Does what Etis-a-lot does, in a different colour.'}); 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}; @@ -640,11 +691,12 @@ const BIZ_T={ hyper:{l:'Hyperscaler DCI',opts:[1600,3200,6400],rate:0,l2:true,div:true,km:0.5,lv:4,names:["Amazin' Web Services DCI","Microsnoft Azzure DCI",'Goggle Cloud DCI','Faceplant Infra DCI','AliBubble Cloud DCI']}, hft:{l:'High-frequency trading link',opts:[1,5,10],rate:0,l2:true,lat:true,km:6,lv:2,names:['Flash Boys Capital','Nanosecond Nancy Trading','Speed of Light Securities','Arbitrage & Sons','Front-Run Fund','Microwave Tower Capital','Tick-Tock Quant','Low Latency Larry LLC']}, bulk:{l:'Bulk backup transfer (latency does not matter)',opts:[100,200,400],rate:0,l2:true,scenic:true,km:0.1,lv:2,names:['Glacier Slow Storage','Tape Backup Tortoise','Scenic Route Archives','Cold Storage Cold Cuts','Sloth Sync','Eventually Consistent Inc.','Snail Mail Data Co.']}, - event:{l:'Event network',opts:[100,200,400,800,1600,3200],rate:0,event:true,lv:2,names:['The World Cup-ish Final','NANOG-ish 99','Burning Router Festival','Eurovisión-ish Song Contest','Formula Ping Grand Prix','The Big Game','Olympic Pings','A Pop Megastar Stadium Tour','LAN Party of the Century','The Keynote (One More Thing)','Gamescom-ish Expo','Oktoberfest-ish Livestream']}, + event:{l:'Event network',opts:[100,200,400,800,1600,3200],rate:0,event:true,lv:2,names:['Carnaval-ish Parade','Diwali-ish Streaming Night','The World Cup-ish Final','NANOG-ish 99','Burning Router Festival','Eurovisión-ish Song Contest','Formula Ping Grand Prix','The Big Game','Olympic Pings','A Pop Megastar Stadium Tour','LAN Party of the Century','The Keynote (One More Thing)','Gamescom-ish Expo','Oktoberfest-ish Livestream']}, sdwan:{l:'SD-WAN for a chain',opts:[1,2,5,10],rate:0,l2:true,sdwan:true,km:0,lv:2,names:['Kebab Kingdom','Pretzel Palace','Burger Router Inc.','Café Latte-ncy','Hardware Hut Stores','Pharma-See Pharmacies','Bank of Tiny Branches','Supermarket Superhighway','Fitness Pings Gyms','Hotel Hops Group','Doughnut Data Diners']}, wwave:{l:'Wholesale wave',opts:[1],rate:0,fiber:true,lv:2,names:['Zay-No Fiber','Loomin’ Technologies','Clown Castle Fiber','GTT (Got Tangled Twice)','A Hyperscaler Who Shall Not Be Named','Megapork','youNetworks']}, dfpair:{l:'Dark fiber pair lease',opts:[1],rate:0,fiber:true,lv:3,names:['A Hyperscaler Who Shall Not Be Named','Goggle Fiber Division','Faceplant Infra','Amazin’ Backbone Team','A Very Secretive Trading Firm']}, scrub:{l:'DDoS protection + DIA',opts:[1,5,10,20],rate:900}, + provedor:{l:'Provedor (small regional ISP)',opts:[5,10,20,40],rate:20,br:true,names:['Provedor Capivara Net','Fibra do Sertão','Rapidinho Telecom','Net Jabuticaba','Caipirinha Online','Wi-Fi do Zé','Pão de Queijo Fibra','Açaí Net','Tucano Telecom','Forró Fibra','Saci Net','Brigadeiro Banda Larga','Mandioca Online','Churrasco Connect']}, }; const LEVELS=[ {n:'Local ISP',req:'Start here',unlock:'Enterprises, game servers, hosting, L2VPNs and DDoS protection.'}, @@ -711,7 +763,7 @@ const COVS={ spaetzle:{l:'Peer at the Spätzle-IX in Stuttgart. Local money for local packets.',ok:()=>S.ixp.stg!==undefined}, kehrwoche:{l:'Do the Kehrwoche: keep your NOC free of incidents older than a week.',ok:()=>!S.inc.some(i=>S.day-i.start>7)}, app:{l:'Download our app and enable all notifications.',ok:()=>true}, - rural:{l:'Run home broadband somewhere underserved (Asia, Africa or Oceania).',ok:()=>Object.keys(S.pops).some(c=>S.pops[c].bb&&['AS','AF','OC'].includes(CITY[c].reg))}, + rural:{l:'Run home broadband somewhere underserved (Asia, Africa, Oceania or South America).',ok:()=>Object.keys(S.pops).some(c=>S.pops[c].bb&&['AS','AF','OC','SA'].includes(CITY[c].reg))}, forms:{l:'Fill in form T-17b in triplicate, every month, forever.',ok:()=>true}, hodl:{l:'Never sell your TubeCoin. Diamond hands.',ok:()=>true}, blitz:{l:'Open a new POP at least every 90 days. Blitzscale or die.',ok:l=>S.day-Math.max(l.start,...Object.values(S.pops).map(p=>p.day||0))<=90}, @@ -817,7 +869,7 @@ const REMOTE_WARN=`

Remote peering is const REMOTE_WHY=['Policy: no remote peers. Be in the building or be in the transit bill.','Saw your session come in over a fabric and said "we can smell the VXC from here".','Only peers with members they can reach without a 1,500 km hairpin.','Their PearingDB entry says "Remote peering: No (we mean it)".','Tried a remote peer once. It flapped during a product launch. Never again.']; function isRemote(c){return S.ixp[c]!==undefined&&!S.pops[c]&&!S.myIx[c];} function noRemote(id){const n=NET[id];if(!n||n.pol!=='selective')return false;return hstr(id+'|remote')%100<(n.share>=0.03?60:30);} -function ixPortMo(c,tier){return Math.round(PORT[tier].ix*(S.pops[c]?1:REMOTE_FEE)*dkMult(c));} +function ixPortMo(c,tier){return Math.round(PORT[tier].ix*(S.pops[c]?1:REMOTE_FEE)*dkMult(c)*(CITY[c].ixCheap||1));} /* DE-KICKS Group: runs several big exchanges and really, really hates open pricing. No price list, personalised quotes, haggling, yearly "harmonisation", auto-enrolled add-ons you have to opt out of, and a retention offer when you try to leave. */ @@ -846,6 +898,8 @@ function dkTick(d){if(!S.dk)return;const dk=S.dk; toast(`Good news! You've been enrolled in ${esc(n)}.
${esc(blurb)} ${fmt$(mo)}/mo, added to your ${esc(ixName(c))} invoice. Opt out any time in the IX panel.`,'bad');}}} } +function elephant(){S.phpDone=true;S.ev.php=S.day+4; + toast(`🐘 BREAKING: CVE-2026-31337 just took down half the internet.
A bug in PHP turned every WordPress-ish site on Earth into a crypto miner. Eyeball traffic is down 30% for a few days while the world patches. Your hosting customers are doing it at 3 a.m.`,'bad');sfx('alert');renderMega();} function snubWhy(sn){const d=Math.max(1,sn.until-S.day);return `${sn.why} They will reconsider in ${d} day${d===1?'':'s'}.`;} function peerOk(id,via,city){ const n=NET[id],dem=R.demTo[id]||0; @@ -897,7 +951,7 @@ function compute(){ {const rp=ev.rpki&&ev.rpki.until>day?new Set(ev.rpki.nets):null;if(rp)for(const e of E){if(e.k==='c')continue;const o=e.ok;e.ok=n=>!rp.has(n)&&o(n);}} for(const n of NETS){R2.reachable[n.id]=E.some(e=>e.rank>0&&e.ok(n.id));if(R2.reachable[n.id])R2.reach+=NSH[n.id];} const cacheNets=new Set(S.caches.filter(c=>popUp(c.city)).map(c=>c.net)); - const viral=ev.viral>day?1.25:1; + const viral=(ev.viral>day?1.25:1)*(ev.php&&ev.php>day?0.7:1); const flows=[]; for(const c of Object.keys(S.pops)){ const p=S.pops[c],SH=cnCity(c)?NSH_CN:ruCity(c)?NSH_RU:NSH;const eye=(p.bb?p.bb.d:0)*viral*(cnCity(c)&&ev.golden>day?1.4:1);const biz=S.biz.filter(b=>b.city===c&&!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber&&(!BIZ_T[b.type].event||eventLive(b))).reduce((a,b)=>a+b.bw,0);const d=eye+biz; @@ -1044,16 +1098,20 @@ function spawnSpecial(t){const T=BIZ_T[t],mine=Object.keys(S.pops),lv=S.lvl||1; S.offers.push({id:uid(),city:l.a,city2:l.b,link:l.id,what:`a spare fiber pair in your ${CITY[l.a].name}–${CITY[l.b].name} trench`,name:nm(),type:t,bw:1,rate:Math.round(dfLeaseMo(l.km)*0.9),reqs:[],exp:S.day+30});} } function cnOk(){return S.cnLic&&S.cnLic.state==='ok';} -function regionMult(c){const C=CITY[c];if(!C||C.cn)return 1;return C.reg==='AS'?2.5:C.reg==='AF'?2:C.reg==='OC'?1.8:1;} -function landMult(a,b){return !isSub(a,b)&&CITY[a].reg!==CITY[b].reg?2.5:1;} +function regionMult(c){const C=CITY[c];if(!C||C.cn)return 1;return C.reg==='AS'?2.5:C.reg==='AF'?2:C.reg==='OC'?1.8:C.reg==='SA'?1.6:1;} +const uaePair=(a,b)=>!!CITY[a].uae&&!!CITY[b].uae; +const andesPair=(a,b)=>!!CITY[a].andes&&!!CITY[b].andes&&CITY[a].andes!==CITY[b].andes; +function landMult(a,b){if(isSub(a,b))return 1;if(uaePair(a,b))return 3;return (CITY[a].reg!==CITY[b].reg?2.5:1)*(andesPair(a,b)?2:1);} +function landWhy(a,b){if(isSub(a,b))return '';if(uaePair(a,b))return 'Inside the UAE only the two licensed operators, Etis-a-lot and do-ish, may run fiber. No dark fiber, no digging your own, and waves cost 3×.'; + const r=[];if(CITY[a].reg!==CITY[b].reg)r.push('Overland between continents crosses a dozen borders: 2.5× the price.');if(andesPair(a,b))r.push('This route crosses the Andes: 2× the price, and landslides and snow cut it far more often than flat fiber.');return r.join(' ');} function linkLat(l){const f=l.kind==='df'?(l.own?1.1:1.25):l.kind==='vxc'?1.4:l.cable?(CAB[l.cable].lat||1):1.3;return l.km*f/200;} function waveRoute(a,b,mult,border){const cabs=cablesOk(a,b),sub=isSub(a,b);let via=UI.via; if(!cabs.find(c=>c.cid===via))via=sub?(cabs[0]?cabs[0].cid:null):(via==='land'||!via?'land':'land'); if(!via)return null;const bf=border?3*(UI.cnPrem&&(a==='hkg'||b==='hkg')?1.6:1):1; if(via==='land')return {via,cabs,cab:null,km:kmBetween(a,b),sub:false,wm:mult*landMult(a,b)}; const c=cabs.find(x=>x.cid===via);return {via,cabs,cab:via,km:c.km,sub:true,wm:bf*CAB[via].price};} -function viaSeg(a,b){const cabs=cablesOk(a,b),sub=isSub(a,b);if(!cabs.length)return landMult(a,b)>1?`

Overland between continents crosses a dozen borders: 2.5× the price.

`:'';const wr=waveRoute(a,b,1,false); - const opts=(sub?[]:[{v:'land',l:`Overland ${landMult(a,b)>1?'2.5× · ':''}${(kmBetween(a,b)*1.3/200).toFixed(1)} ms`}]).concat(cabs.map(c=>({v:c.cid,l:`${esc(CAB[c.cid].name)} ${CAB[c.cid].price}× · ${(c.km*(CAB[c.cid].lat||1)/200).toFixed(1)} ms${CAB[c.cid].age==='old'?' · old, cuts often':''}`}))); +function viaSeg(a,b){const cabs=cablesOk(a,b),sub=isSub(a,b);if(!cabs.length)return landMult(a,b)>1?`

${landWhy(a,b)}

`:'';const wr=waveRoute(a,b,1,false); + const opts=(sub?[]:[{v:'land',l:`Overland ${landMult(a,b)>1?landMult(a,b)+'× · ':''}${(kmBetween(a,b)*1.3/200).toFixed(1)} ms`}]).concat(cabs.map(c=>({v:c.cid,l:`${esc(CAB[c.cid].name)} ${CAB[c.cid].price}× · ${(c.km*(CAB[c.cid].lat||1)/200).toFixed(1)} ms${CAB[c.cid].age==='old'?' · old, cuts often':''}`}))); return `

Route

${opts.map(o=>btn(o.l,'via',{v:o.v},wr&&wr.via===o.v?'pink':'ghost')).join('')}
${wr&&wr.cab?`

${esc(CAB[wr.cab].blurb)} All your waves on one cable share its fate when it is cut.

`:''}`;} function bestLat(a,b){const ls=S.links.filter(l=>!linkDown(l));const dist={[a]:0},done=new Set();for(;;){let u=null,ud=Infinity;for(const k in dist)if(!done.has(k)&&dist[k]x.cable&&CAB[x.cable].age==='old'?[x,x,x]:[x])),dur=10+Math.floor(Math.random()*8),tr=l.trench||l.id,hit=S.links.filter(x=>(x.trench||x.id)===tr);hit.forEach(x=>x.cut=Math.max(x.cut||0,S.day+dur)); + const mon=Math.floor((S.day%365)/30.42),monsoon=mon>=5&&mon<=8,tw=x=>x.sub&&(x.a==='tpe'||x.b==='tpe'),inl=x=>!x.sub&&(CITY[x.a].india||CITY[x.b].india); + const l=pick(live.flatMap(x=>{const w=(x.cable&&CAB[x.cable].age==='old'?3:1)*(tw(x)?4:1)*(!x.sub&&andesPair(x.a,x.b)?4:1)*(monsoon&&inl(x)?3:1);return Array(w).fill(x);})),dur=10+Math.floor(Math.random()*8),tr=l.trench||l.id,hit=S.links.filter(x=>(x.trench||x.id)===tr);hit.forEach(x=>x.cut=Math.max(x.cut||0,S.day+dur)); const A=CITY[l.a].name,B=CITY[l.b].name; - const msg=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.`]); + const msg=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)),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?[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(`Router crash in ${CITY[c].name}
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){S.stats.incidents++;S.stats.survived++;toast(`Power cut in ${CITY[c].name}
Your backup generator kicked in. Lights stayed on.`,'good');sfx('alert');return;} + if(type==='power'&&pp.gen){S.stats.incidents++;S.stats.survived++;toast(CITY[c].za?`Load shedding in ${CITY[c].name}
Stage ${2+Math.floor(Math.random()*5)} today. Your generator coughed, then kept the lights on.`:`Power cut in ${CITY[c].name}
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}.`])):`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].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); @@ -1233,6 +1292,8 @@ function dayTick(){ S.day++; const d=S.day; dkTick(d); + if(!S.phpDone&&d>45&&Math.random()<1/400)elephant(); + if(S.ev.php===d)toast('The internet is back.
Half of it, anyway. Everything was patched in a hurry and nobody learned anything.','good'); for(const k in S.peers){const [id,c]=k.split('@'),sn=snub(id,c);if(!sn)continue;delete S.peers[k]; toast(`${esc(NET[id].name)} de-peered you in ${esc(CITY[c].name)}.
${esc(sn.why)} Traffic falls back to your next best path.`,'bad');} if(S.cnLic&&S.cnLic.state==='pending'&&d>=S.cnLic.ready){S.cnLic.state='ok';toast('License granted!
Your joint venture can now build POPs in mainland China.','goal');sfx('coin');} @@ -1287,6 +1348,7 @@ function spawnOffer(){ const types=['dia','dia','game','host'];if(mine.length>=2)types.push('l2vpn','l2vpn');if(S.day>60)types.push('scrub'); if(lv>=2)types.push('isp','stream','edu','host','hft','bulk','event','event');if(mine.length>=3&&lv>=2)types.push('sdwan','sdwan'); if(S.links.some(l=>l.kind==='df'&&l.ready<=S.day))types.push('wwave','wwave');if(S.links.some(l=>l.kind==='df'&&l.own&&l.ready<=S.day))types.push('dfpair');if(lv>=3)types.push('gpu','gpu','onramp','onramp');if(lv>=4)types.push('ai','ai','hyper','hyper'); + const br=mine.filter(c=>CITY[c].br);if(br.length)types.push('provedor','provedor','provedor'); const t=pick(types),T=BIZ_T[t]; if(T.event||T.sdwan||T.fiber){spawnSpecial(t);return;} let city=(Math.random()<0.65&&mine.length)?pick(mine):pick(ALLC.concat(cnOk()?['pek','sha']:[])),city2=null; @@ -1295,6 +1357,7 @@ function spawnOffer(){ const list=(T.names||BIZ_N).filter(n=>!S.usedNames.includes(n)); let name=list.length?pick(list):(T.names?pick(T.names):'Startup #'+Math.floor(Math.random()*999)); S.usedNames.push(name); + if(t==='provedor')city=pick(br); if(t==='hft'){const fin=['nyc','chi','lon','fra','tok','sin','hkg','ams','ash'],mf=mine.filter(c=>fin.includes(c));city=mf.length?pick(mf):pick(mine);city2=pick(fin.filter(c=>c!==city));} const rate=T.l2?Math.round((150+kmBetween(city,city2)*0.08)*T.km):T.rate; const reqs=T.div?['diverse']:T.lat?['lat']:[];const pool=Object.keys(REQS).filter(k=>!reqs.includes(k)&&!REQS[k].only&&(!REQS[k].l2||T.l2)&&(!REQS[k].ip||!T.l2)); @@ -1443,6 +1506,16 @@ const ACT={ exportSave:()=>exportSave(), importPick:()=>{let f=$('importIn');if(!f){f=document.createElement('input');f.type='file';f.accept='.json,application/json';f.id='importIn';f.hidden=true;document.body.appendChild(f);f.addEventListener('change',()=>{importFile(f.files[0]);f.value='';});}f.click();}, importGo:()=>{const s0=UI.importing;if(!s0)return;UI.importing=null;S=migrate(s0);UI.started=true;UI.sel=null;UI.speed=S.uiSpeed===undefined?1:S.uiSpeed;if(S.cam&&isFinite(S.cam.x))Object.assign(cam,S.cam);else{const h=CITY[S.home];if(h){cam.x=h.x;cam.y=h.y;}}closeModal();$('modal').hidden=true;compute();renderAll();save();toast(`Welcome back, ${esc(S.name)}.
Imported and saved on this device.`,'good');sfx('coin');track('game_import');}, + menu:()=>{if(!S||!UI.started){showTitle();return;}openModal(`
AS${S.asn} · ${esc(dateStr(S.day))} · ${tierLabel()}

${esc(S.name)}

+

Your game saves itself every few seconds on this device.

+ `);}, resetAsk:()=>openModal(`

Start a new network?

${esc(S?S.name:'Your network')} and everything it owns will be deleted. This cannot be undone.

${btn('Delete and start over','newgame',{},'red big')}${btn('Keep playing','closeModal',{},'ghost big')}
`), whatsNewShow:()=>whatsNew(true,true), updateNow:()=>{save();location.reload();}, @@ -1450,7 +1523,7 @@ const ACT={ helpClose:()=>{if(UI.started)closeModal();else showTitle();}, }; function pairLinks(a,b){return S.links.filter(l=>(l.a===a&&l.b===b)||(l.a===b&&l.b===a));} -function dfAllowed(a,b){return !isSub(a,b)&&cnCity(a)===cnCity(b);} +function dfAllowed(a,b){return !isSub(a,b)&&cnCity(a)===cnCity(b)&&!uaePair(a,b);} function optCost(o){return Math.round(OPT[o].cost*(S&&S.ev&&S.ev.tariff>S.day?1.4:1));} function chWhy(l,o){const O=OPT[o];if(O.lvl>lvl())return `Unlocks at customer level ${O.lvl}.`;if(O.sys==='roadm'&&l.sys!=='roadm')return 'Needs a ROADMaster 9000 line system.';if(l.km>O.reach)return `Reach is ${O.reach.toLocaleString()} km; this route is ${l.km.toLocaleString()} km.`; if((l.ch||[]).length+soldSlots(l)>=DF_SYS[l.sys].max)return `${DF_SYS[l.sys].n} is full (${DF_SYS[l.sys].max} channels${soldSlots(l)?`, ${soldSlots(l)} sold to customers`:''}).`; @@ -1499,7 +1572,8 @@ const $=id=>document.getElementById(id); const btn=(label,act,args={},cls='',dis=false,title='')=>``; const logo=n=>``; const barCls=u=>u>=0.9?'bad':u>=0.65?'warn':''; -function renderAll(){renderHUD();renderLeft();renderPanel();renderHint();} +function renderAll(){renderHUD();renderLeft();renderPanel();renderHint();renderMega();} +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);} $('muteBtn').style.opacity=UI.muted?.4:1; @@ -1659,7 +1733,7 @@ function ixSection(c){const C=CITY[c],ix=ixName(c);let h=''; h+=`

Internet Exchange

`; if(!ix&&C.cn){h+=`

Running an exchange in mainland China takes a different license entirely. Peer with Chinese networks over PNIs, or meet them in Hong Kong.

`;} else if(!ix){h+=`

There's no IX in ${C.name} yet. Found one: networks join over time, pay you for ports, and peer with you for free.

${S.pops[c]?btn(`Found your own IX ${fmt$(MYIX_COST)} + ${fmt$(MYIX_MO)}/mo`,'foundIx',{city:c},'pink',S.cashBuild a POP here first.

'}`;} - else if(S.ixp[c]===undefined){h+=`

${esc(ix)} is a shared switch. One port lets you peer with every member for free. Members: ${ixMembers(c).map(id=>esc(NET[id].name)).join(', ')||'nobody yet'}.

${S.pops[c]?'':REMOTE_WARN}${isDk(c)?`

Run by DE-KICKS Group. No public price list. Ask sales for a personalised quote and bring your haggling face.

`:''}
${PORT.map((P2,i)=>btn(`${P2.n} port ${isDk(c)?'Price on request ☎':fmt$(ixPortMo(c,i))+'/mo'}`,'buyIx',{city:c,tier:i},'',(!isDk(c)&&S.cash1))).join('')}
`;} + else if(S.ixp[c]===undefined){h+=`

${esc(ix)} is a shared switch. One port lets you peer with every member for free. Members: ${ixMembers(c).map(id=>esc(NET[id].name)).join(', ')||'nobody yet'}.

${S.pops[c]?'':REMOTE_WARN}${CITY[c].ixCheap?`

Run by a nonprofit. Public prices at a fraction of what other exchanges charge, and almost everyone is here.

`:''}${isDk(c)?`

Run by DE-KICKS Group. No public price list. Ask sales for a personalised quote and bring your haggling face.

`:''}
${PORT.map((P2,i)=>btn(`${P2.n} port ${isDk(c)?'Price on request ☎':fmt$(ixPortMo(c,i))+'/mo'}`,'buyIx',{city:c,tier:i},'',(!isDk(c)&&S.cash1))).join('')}
`;} else{const mine=!!S.myIx[c],u=R.useIx[c]||0,cap=ixCap(c),set=ixSessions(c),xdown=S.ev.ixdown&&S.ev.ixdown[c]>S.day; h+=`
${mine?'Your own fabric · 400G':lagName(S.ixp[c],(S.ixn||{})[c])}${xdown?' · FABRIC DOWN':''}${fmtG(u)}
${prefCtl('ix',c,S.ixPref&&S.ixPref[c])}`; if(isDk(c)&&S.dk){const ad=S.dk.add[c]||[],rt=S.dk.ret[c];h+=`

DE-KICKS personalised pricing: ${Math.round(dkMult(c)*100)}% of what a normal IX would charge${rt&&rt>S.day?` (promo, ${rt-S.day} days left)`:''}.

`; @@ -1866,7 +1940,7 @@ function showHelp(){
Embedded cache
A CDN's server in your rack. Serves most of that CDN's traffic locally, for the price of power.
DE-KICKS
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.
Remote peering
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.
Peering policy
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.
Waves
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.
95th percentile
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.
Routers
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.
Dark fiber
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.
Subsea cables
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.
Latency
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.
NOC dashboard
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.
Asia
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.
Russia
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.
Events, chains and wholesale
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.
Bank
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.
LAGs
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.
Traffic engineering
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.
China
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.
Weird requirements
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.
Customer levels
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.
L2VPN & DDoS protection
Businesses may want a private circuit between two of your POPs (it rides your backbone), or DDoS protection (needs your own scrubbing center).
NNI fabrics
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.
-
Boot times
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.
Failures
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.
+
Regional quirks
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.
Boot times
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.
Failures
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.
${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'):''}
${UI.started&&S&&!S.lost?btn('Export save','exportSave',{},'ghost sm'):''}${btn('Import a save','importPick',{},'ghost sm')}
`); } function showWin(){openModal(`

You're a Tier 1!

${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.

${btn('Keep building','keepPlaying',{},'pink big')}`);sfx('coin');} @@ -1883,14 +1957,16 @@ function openLinkModal(a,b){ if(mode==='df'){openModal(head+dfModalBody(a,b,km,pop));return;} if(sub&&!cablesFor(a,b).length){const fr=[...new Set(CABLE_PAIRS.filter(c=>c.a===a||c.b===a).map(c=>CITY[c.a===a?c.b:c.a].name))];openModal(head+`

No subsea cable lands in both ${CITY[a].name} and ${CITY[b].name}. Cables from ${CITY[a].name} reach ${fr.join(', ')||'nowhere'}. Hop through one of those.

`);return;} if(isSub(a,b)&&S.ev.landban&&S.ev.landban.until>S.day&&[a,b].includes(S.ev.landban.city)){openModal(head+`

The landing permit dispute in ${CITY[S.ev.landban.city].name} blocks new subsea links for ${S.ev.landban.until-S.day} more days.

`);return;} + if(uaePair(a,b)||andesPair(a,b))route+=`

${landWhy(a,b)}

`; const wr=waveRoute(a,b,mult,border); openModal(`${head}

Waves are leased at a flat monthly rate. Bigger and longer costs more, and subsea is 1.8×. First month is due now.

- ${pop?`

Includes a new POP in ${CITY[b].name} (${fmt$(popCost(b))}${ruCity(b)?', government box included':''}).

`:''}${route}${viaSeg(a,b)} + ${pop?`

Includes a new POP in ${CITY[b].name} (${fmt$(popCost(b))}${ruCity(b)?', government box included':CITY[b].uae?', free-zone license included':''}).

`:''}${route}${viaSeg(a,b)}
${LT.map((T,i)=>{const lc=Math.round(waveMo(wr.km,wr.sub,i)*wr.wm),c=lc+pop,ok=waveOk(a,b,i);return ``;}).join('')}
`); } function dfModalBody(a,b,km,pop){ if(isSub(a,b))return `

Nobody sells dark fiber on a subsea cable here. Subsea capacity comes as leased waves.

`; + if(uaePair(a,b))return `

No dark fiber inside the UAE. Only the two licensed operators may run fiber here, and they only sell waves.

`; if(!dfAllowed(a,b))return `

Dark fiber across the Chinese border is not for sale. Buy a cross-border wave instead.

`; if(lvl()<2)return `

Dark fiber unlocks at customer level 2. You need the scale to justify buying your own optical gear.

`; const src=UI.dfSrc==='build'&&lvl()>=3?'build':'lease',sys=DF_SYS[UI.dfSys]&&DF_SYS[UI.dfSys].lvl<=lvl()?UI.dfSys:'lite',amps=ampCount(km); @@ -1928,8 +2004,8 @@ addEventListener('resize',()=>{resize();WL.key=null;renderLeft();});resize(); function rng(seed){return()=>{seed|=0;seed=seed+0x6D2B79F5|0;let t=Math.imul(seed^seed>>>15,1|seed);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296;};} function inPoly(x,y,pts){let ins=false;for(let i=0,j=pts.length-1;iy)!==(yj>y))&&(x<(xj-xi)*(y-yi)/(yj-yi)+xi))ins=!ins;}return ins;} function smoothPath(pts){const p=new Path2D();const n=pts.length;const mid=(a,b)=>[(a[0]+b[0])/2,(a[1]+b[1])/2];let m=mid(pts[n-1],pts[0]);p.moveTo(m[0],m[1]);for(let i=0;ismoothPath(l.pts)).concat(DECOR.map(smoothPath)); -const ALLPOLY=LANDS.map(l=>l.pts).concat(DECOR); +const LANDP=LANDS.filter(l=>!l.hide).map(l=>smoothPath(l.pts)).concat(DECOR.map(smoothPath)); +const ALLPOLY=LANDS.filter(l=>!l.hide).map(l=>l.pts).concat(DECOR); const onLand=(x,y)=>ALLPOLY.some(p=>inPoly(x,y,p)); const R1=rng(7),WAVES=[],HILLS=[]; while(WAVES.length<220){const x=R1()*W,y=R1()*H;if(!onLand(x,y)&&!onLand(x+12,y)&&!onLand(x-12,y))WAVES.push([x,y,R1()]);} diff --git a/site/menu.png b/site/menu.png new file mode 100644 index 0000000..2dea4a0 Binary files /dev/null and b/site/menu.png differ diff --git a/site/sa.png b/site/sa.png new file mode 100644 index 0000000..9e29649 Binary files /dev/null and b/site/sa.png differ diff --git a/site/tw.png b/site/tw.png new file mode 100644 index 0000000..21a57ca Binary files /dev/null and b/site/tw.png differ diff --git a/site/uae.png b/site/uae.png new file mode 100644 index 0000000..fd82c48 Binary files /dev/null and b/site/uae.png differ diff --git a/site/za.png b/site/za.png new file mode 100644 index 0000000..07abc68 Binary files /dev/null and b/site/za.png differ diff --git a/tests/issues.test.js b/tests/issues.test.js index f486627..599c48f 100644 --- a/tests/issues.test.js +++ b/tests/issues.test.js @@ -85,3 +85,30 @@ test('some routers take forever to boot, PacketOinkers most of all', () => { assert.match(ev("document.getElementById('panelBody').textContent"), /a slow one/); assert.deepEqual(errors, []); }); + +test('the network name opens a menu with save, load and start over', () => { + const { ev, errors } = load(); + base(ev); + ev("document.querySelector('[data-act=menu]').click()"); + const t = ev("document.getElementById('modalCard').textContent"); + for (const w of ['Export save', 'Import a save', 'Start a new network', 'Back to the map']) assert.ok(t.includes(w), w); + ev("document.querySelector('#modalCard [data-act=resetAsk]').click()"); + assert.match(ev("document.getElementById('modalCard').textContent"), /cannot be undone/); + ev("document.querySelector('#modalCard [data-act=newgame]').click()"); + assert.equal(ev("!!localStorage.getItem('sot-save-v1')&&JSON.parse(localStorage.getItem('sot-save-v1')).day>0"), false); + assert.deepEqual(errors, []); +}); + +test('a rare global outage shows a banner, dents traffic and only happens once', () => { + const { ev, errors } = load(); + base(ev); + ev("compute()");const before = ev("R.demand"); + ev("elephant();compute();renderAll()"); + assert.ok(ev("R.demand") < before * 0.8); + assert.equal(ev("document.getElementById('mega').hidden"), false); + for (let i = 0; i < 5; i++) ev("dayTick()"); + ev("renderAll()"); + assert.equal(ev("document.getElementById('mega').hidden"), true); + assert.equal(ev("S.phpDone"), true); + assert.deepEqual(errors, []); +}); diff --git a/tests/regions.test.js b/tests/regions.test.js new file mode 100644 index 0000000..cbaf851 --- /dev/null +++ b/tests/regions.test.js @@ -0,0 +1,90 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const { load } = require('./harness'); + +function start(ev) { ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0"); } + +test('new cities exist, sit on land and have sellers, cables and IX members', () => { + const { ev, errors } = load(); + start(ev); + const ids = ['for', 'rio', 'bue', 'scl', 'lim', 'bog', 'pan', 'del', 'maa', 'blr', 'hyd', 'tpe', 'auh', 'fuj', 'cpt']; + for (const c of ids) { + assert.ok(ev(`!!CITY['${c}']`), c); + assert.ok(ev(`NETS.some(n=>n.price&&n.pops.includes('${c}'))`), `${c} has a transit seller`); + } + for (const c of ['for', 'rio', 'bue', 'scl', 'lim', 'bog', 'pan', 'maa', 'tpe', 'fuj', 'cpt']) + assert.ok(ev(`CABLE_PAIRS.some(p=>p.a==='${c}'||p.b==='${c}')`), `${c} has a cable`); + assert.ok(ev("ixMembers('sao').includes('clr')&&ixMembers('del').includes('jio')&&ixMembers('tpe').includes('cht')")); + assert.ok(ev("CABLE_PAIRS.some(p=>(p.a==='scl'&&p.b==='syd')||(p.a==='syd'&&p.b==='scl'))"), 'Humboldt-ish cable to Sydney'); + assert.deepEqual(errors, []); +}); + +test('South America: no land route over the Darién Gap, the Andes cost double, IX.brrr is cheap', () => { + const { ev } = load(); + start(ev); + assert.equal(ev("isSub('pan','bog')"), true, 'Panama to Bogotá is subsea'); + assert.equal(ev("isSub('mia','sao')"), true); + assert.equal(ev("isSub('bue','sao')"), false); + assert.equal(ev("landMult('scl','bue')"), 2); + assert.equal(ev("landMult('bue','sao')"), 1); + assert.match(ev("landWhy('scl','bue')"), /Andes/); + assert.equal(ev("regionMult('sao')"), 1.6); + ev("ACT.buildPop({city:'sao'})"); + assert.ok(ev("ixPortMo('sao',1)") < ev("PORT[1].ix*0.5"), 'nonprofit IX ports are cheap'); + ev("selectCity('sao');ACT.tab({t:'peer'})"); + assert.match(ev("document.getElementById('panelBody').textContent"), /Run by a nonprofit/); +}); + +test('Brazilian POPs attract provedores', () => { + const { ev } = load(); + start(ev); + ev("ACT.buildPop({city:'rio'})"); + const seen = JSON.parse(ev("(()=>{const o=[];for(let i=0;i<300;i++){S.offers=[];spawnOffer();o.push(...S.offers.filter(x=>x.type==='provedor').map(x=>x.city));}return JSON.stringify(o)})()")); + assert.ok(seen.length > 0, 'provedor offers appear'); + assert.ok(seen.every(c => c === 'rio'), 'only in Brazilian POPs'); +}); + +test('UAE: duopoly fiber only, no dark fiber, free-zone license', () => { + const { ev, errors } = load(); + start(ev); + assert.equal(ev("dfAllowed('dxb','auh')"), false); + assert.equal(ev("dfAllowed('dxb','bom')"), true); + assert.equal(ev("landMult('dxb','fuj')"), 3); + assert.equal(ev("popCost('auh')-popCost('fra')"), ev('UAE_LIC')); + ev("ACT.buildPop({city:'dxb'});UI.lmode='df';openLinkModal('dxb','auh')"); + assert.match(ev("document.getElementById('modalCard').textContent"), /No dark fiber inside the UAE/); + ev("UI.lmode='wave';openLinkModal('dxb','auh')"); + assert.match(ev("document.getElementById('modalCard').textContent"), /licensed operators/); + ev("closeModal()"); + assert.deepEqual(errors, []); +}); + +test('regional incidents: Taiwan anchors, Andes landslides, load shedding', () => { + const { ev, errors } = load(); + start(ev); + ev("for(const c of ['tpe','scl','bue','cpt'])ACT.buildPop({city:c})"); + ev("UI.via=null;openLinkModal('tpe','hkg');ACT.buildLink({tier:1});closeModal()"); + ev("UI.via='land';openLinkModal('scl','bue');ACT.buildLink({tier:1});closeModal()"); + assert.ok(ev("S.links.some(l=>l.a==='tpe'&&l.sub)") && ev("S.links.some(l=>l.a==='scl'&&!l.sub)"), 'links built'); + let anchors = 0, andes = 0, shed = 0; + for (let i = 0; i < 400; i++) { + ev("S.inc=[];for(const l of S.links)l.cut=0;for(const c in S.pops){S.pops[c].down=0;S.pops[c].gen=false}fireFailure()"); + const m = ev("S.inc.map(x=>x.msg).join(' ')"); + if (/anchor/.test(m) && /Taipei/.test(m)) anchors++; + if (/Andes|mountain pass|llama|4,000/.test(m)) andes++; + if (/Load shedding/.test(m)) shed++; + } + assert.ok(anchors > 0, 'anchors drag over Taiwan cables'); + assert.ok(andes > 0, 'the Andes break fiber'); + assert.ok(shed > 0, 'South Africa sheds load'); + assert.deepEqual(errors, []); +}); + +test('every new city panel renders', () => { + const { ev, errors } = load(); + start(ev); + for (const c of ['for', 'pan', 'del', 'tpe', 'auh', 'fuj', 'cpt', 'bog']) { + ev(`selectCity('${c}');for(const t of ['cust','up','peer','links','infra'])ACT.tab({t})`); + } + assert.deepEqual(errors, []); +});