Merge remote-tracking branch 'upstream/main' into own-carrier-egress

This commit is contained in:
Christopher Hawker 2026-11-01 01:37:42 +11:00
commit a469844f61
42 changed files with 757 additions and 42 deletions

View file

@ -18,6 +18,12 @@ const AU_TRANSIT=3,AU_WAVE={land:1.8,sub:2.6,ew:1.3},AU_IX=0.8,AU_ARPU=1.8,AU_WH
// Fibre to the Basement: on your own fibre you skip the wholesale cut, but competing networks pay the
// Regional Broadband Scheme levy instead (about $7 a month on a ~$90 bill).
const AU_LEVY=0.08;
/* The Philippines: few, thin routes out and an incumbent that owns most of them. 100 GigE transit in Manila
costs about 1.9 times Jakarta's (TeleGeography, 2026: $2.25 against $1.21 per Mbps), so the islands pay
1.9 times the Asian rate. Homes pay about ₱1,450 (US$25) a month, the incumbent's own figure (PLDT, 2025).
Between the islands capacity is dearer than out of the country: a Manila–Cebu wave costs about what
Manila–Singapore does, twice Manila–Hong Kong. */
const PH_TRANSIT=4.7,PH_ARPU=0.7,PH_WAVE=3.7;
const SITE2_COST=45000,SITE2_MO=3000,TE_COST=60000,TE_MO=4000;
const SITE2_N=[tr('economy.the_other_building'),tr('economy.campus_b_the_one_with_parking'),tr('economy.across_the_river_dc'),tr('common.the_annex'),tr('economy.suburban_mega_shed'),tr('economy.the_cheaper_one'),tr('economy.formerly_a_shopping_mall'),tr('common.bunker_two')];
// A city's buildings: '#' becomes a site number from 1 to dcN (dc2N for the second building) that stays put for this network.

View file

@ -79,4 +79,9 @@ LANDS_LL.push(
LANDS_LL.push(
{id:'mv',ll:[[73.11,4.48],[73.91,4.48],[73.91,3.88],[73.11,3.88]]},
);
// The Visayas and Mindanao: Cebu and Davao are islands of their own, reached from Luzon only by cable.
LANDS_LL.push(
{id:'ceb',ll:[[123.3,11.3],[124.1,11.3],[124.1,9.4],[123.3,9.4]]},
{id:'mdn',ll:[[121.9,7],[123,8.4],[125.4,9.8],[126.6,7.5],[126.2,5.6],[125,5.6],[122,6.6]]},
);
const LANDS=LANDS_LL.map(l=>({id:l.id,hide:true,pts:l.ll.map(q=>proj(q[0],q[1]))}));

File diff suppressed because one or more lines are too long

View file

@ -44,6 +44,7 @@ const CITY_LL={
"cbo":[80.0, 6.95],
"cbr":[149.13,-35.28],
"ccs":[-66.9,10.49],
"ceb":[123.89,10.32],
"cgb":[-56.1,-15.6],
"cgr":[-54.65,-20.47],
"chc":[172.55,-43.53],
@ -70,6 +71,7 @@ const CITY_LL={
"dur":[31.03,-29.86],
"dus":[6.78,51.22],
"dut":[-166.53,53.88],
"dvo":[125.6,7.08],
"dxb":[55.27,25.2],
"dyr":[177.4,64.7],
"ebj":[8.52,55.48],

View file

@ -35,7 +35,7 @@ const CITIES=[
{id:'akl',name:'Auckland',x:1964,y:826,land:'nz',reg:'OC',cc:'NZ',P:250,ix:'Kiwi-IX',dc:'Sheep-cooled Shed',note:tr('cities.far_from_everything_every_packet')},
{id:'per',name:'Perth',x:1712,y:785,land:'oc',reg:'OC',cc:'AU',au:true,arpu:AU_ARPU,P:200,ix:'Beard-IX',dc:'Very Remote DC',dc2:'Next-Door-DC P#',dc2N:2,note:tr('cities.the_most_isolated_big_city_on')},
{id:'jkt',name:'Jakarta',x:1614,y:624,land:'idn',reg:'AS',cc:'ID',P:900,ix:'Nasi-IX',dc:'Monsoon-proof DC',note:tr('cities.270_million_people_on_17_000')},
{id:'mnl',name:'Manila',x:1714,y:494,land:'ph',reg:'AS',cc:'PH',P:600,ix:'',dc:'Typhoon-rated DC',note:tr('cities.typhoons_earthquakes_and_a_lot_of')},
{id:'mnl',name:'Manila',x:1714,y:494,land:'ph',reg:'AS',cc:'PH',ph:true,arpu:PH_ARPU,P:1000,ix:'GotchaFIX Manila',ixCheap:1.8,dc:'Typhoon-rated DC',note:tr('cities.typhoons_earthquakes_and_a_lot_of')},
{id:'ber',name:'Berlin',x:0,y:0,land:'eu',reg:'EU',cc:'DE',P:450,ix:'Currywurst-IX',dc:'Former Brewery DC',note:tr('cities.startups_techno_and_a_surprising')},
{id:'ham',name:'Hamburg',x:0,y:0,land:'eu',reg:'EU',cc:'DE',P:250,ix:'Moin-IX',dc:'Speicherstadt Colo',note:tr('cities.germany_s_port_city_everyone_says')},
{id:'dus',name:'Düsseldorf',x:0,y:0,land:'eu',reg:'EU',cc:'DE',P:300,ix:'Altbier-IX',dc:'Königsallee Cage',note:tr('cities.the_rhine_ruhr_hub_more_carrier')},
@ -240,6 +240,9 @@ const CITIES=[
{id:'mct',name:'Muscat',x:0,y:0,land:'eu',reg:'AS',cc:'OM',P:50,ix:'Halwa-IX',dc:'Frankincense Colo',note:tr('cities.oman_s_capital_just_outside_the')},
{id:'mle',name:'Malé',x:0,y:0,land:'mv',reg:'AS',cc:'MV',P:4,ix:'',dc:'One-Metre-Up DC',note:tr('cities.the_maldives_capital_a_stop_on')},
{id:'fuk',name:'Fukuoka',x:0,y:0,land:'jp',reg:'AS',cc:'JP',P:120,ix:'Mentaiko-IX',dc:'Hakata Ramen Racks',note:tr('cities.japan_s_closest_city_to_korea')},
// The Philippines beyond Luzon
{id:'ceb',name:'Cebu',x:0,y:0,land:'ceb',reg:'AS',cc:'PH',ph:true,arpu:PH_ARPU,P:125,ix:'GotchaFIX Cebu',ixCheap:1.8,dc:"Magellan's Last Rack",note:tr('cities.the_philippines_second_city_reached')},
{id:'dvo',name:'Davao',x:0,y:0,land:'mdn',reg:'AS',cc:'PH',ph:true,arpu:PH_ARPU,P:135,ix:'GotchaFIX Davao',ixCheap:1.8,dc:"Heimdall's Hut",note:tr('cities.mindanao_s_big_city_and_the')},
];
// Display-only nudges for cities that sit on top of each other at map scale; distances still use real lon/lat.
const CITY_NUDGE={

View file

@ -49,6 +49,7 @@ const CITY_PDB={
cbo:[1,0,33],
cbr:[5,60,3196], // est.
ccs:[6,32,296],
ceb:[4,25,750], // est.
cgb:[4,5,9693],
cgr:[4,4,9693],
chc:[4,30,755], // est.
@ -75,6 +76,7 @@ const CITY_PDB={
dur:[4,137,879],
dus:[13,350,3705], // 14 listed, one closed; Digital Realty DUS1-3 alone has 141 networks
dut:[0,0,33300], // est.
dvo:[2,10,750], // est.
dxb:[8,135,231],
dyr:[0,0,6683], // est.
ebj:[1,5,529], // est.

View file

@ -31,7 +31,7 @@ const CABLES=[
{"id":"cook","name":"Cook Strait Talking","price":1.0,"age":"mid","blurb":tr('cables.down_the_west_coast_and_across'),"pairs":[["akl","chc",[[175.75,-36.25],[178,-37],[179,-38],[178.5,-39.25],[174.25,-43.5]]]]},
{"id":"ring","name":"Lord of the Tasman Rings","price":0.9,"age":"new","blurb":tr('cables.one_ring_to_bind_invercargill_to'),"pairs":[["ivc","syd",[[167.6,-46.9],[160,-42],[153,-35]]],["ivc","mel",[[167.6,-46.9],[156,-43.5],[146.2,-39.4]]],["ivc","akl",[[169,-47.25],[170.5,-47.25],[178.5,-39.25],[179,-38],[178,-37],[175.75,-36.25]]]]},
{"id":"tasman","name":"Tasman Global Excess","price":0.95,"age":"new","blurb":tr('cables.sydney_to_auckland_with_plenty_to'),"pairs":[["akl","syd",[[170,-36],[158,-34.5]]]]},
{"id":"bifrost","name":"Bi-Frosted","price":0.9,"age":"new","blurb":tr('cables.a_rainbow_bridge_from_singapore_to'),"pairs":[["sin","jkt",[[107,-2]]],["jkt","mnl",[[108.5,1.5]]],["mnl","lax",[[123,15],[140,20],[180,25],[210,30],[235,33.5]]],["mnl","gum",[[123,15],[136,14.5],[144.3,13.6]]],["gum","lax",[[145.5,14.2],[180,22],[210,30],[235,33.5]]],["jkt","gum",[[107.25,-5.25],[113,-5.25],[116,-4.25],[121,2],[139.42,11.57],[143.5,13.5]]],["gum","sea",[[149.93,19.74],[155.17,25.45],[160.51,30.59],[165.55,34.81],[170.63,38.48],[176.24,41.9],[181.86,44.75],[188.04,47.3],[190.71,48.15],[198.76,49.45],[205.61,50.09],[211.8,50.31],[218.01,50.21],[224.91,49.69],[234.5,48.25],[235.75,48.5],[236,48.25],[237.25,48.25]]]]},
{"id":"bifrost","name":"Bi-Frosted","price":0.9,"age":"new","blurb":tr('cables.a_rainbow_bridge_from_singapore_to'),"pairs":[["sin","jkt",[[107,-2]]],["gum","lax",[[145.5,14.2],[180,22],[210,30],[235,33.5]]],["jkt","gum",[[107.25,-5.25],[113,-5.25],[116,-4.25],[121,2],[139.42,11.57],[143.5,13.5]]],["jkt","dvo",[[107.25,-5.25],[113,-5.25],[116,-4.25],[121,2],[124.5,4.6],[125.5,5.3],[125.75,6.2],[125.7,6.8]]],["dvo","gum",[[125.75,6.4],[126.1,5.6],[127,5.8],[130,8],[139.42,11.57],[143.5,13.5]]],["gum","sea",[[149.93,19.74],[155.17,25.45],[160.51,30.59],[165.55,34.81],[170.63,38.48],[176.24,41.9],[181.86,44.75],[188.04,47.3],[190.71,48.15],[198.76,49.45],[205.61,50.09],[211.8,50.31],[218.01,50.21],[224.91,49.69],[234.5,48.25],[235.75,48.5],[236,48.25],[237.25,48.25]]]]},
{"id":"sjcph","name":"Sushi-Jollibee Cable","price":0.9,"age":"mid","blurb":tr('cables.southeast_asia_to_japan_with_snacks'),"pairs":[["hkg","mnl",[[116,21],[119.5,16],[120.3,14.6]]],["mnl","sin",[[119,12],[115,8],[110,5],[105,2]]],["mnl","tok",[[120,14.25],[119.25,15.25],[119.5,18],[128.03,26.23],[139,34.5]]],["sin","hkg",[[104.75,1.75],[109.75,11.5]]],["hkg","tok",[[116.5,22.25],[127,30],[130.75,30.5],[139,34.5]]]]},
{"id":"farice","name":"Far-Ice-1","price":1.2,"age":"old","blurb":tr('cables.iceland_s_lifeline_to_scotland'),"pairs":[["rek","lon",[[-23,64],[-22.25,63.25],[-20.25,63],[-7,63],[-1.63,57.93],[2,53],[1.75,51.75]]]]},
{"id":"danice","name":"Dance-Ice","price":1.0,"age":"mid","blurb":tr('cables.iceland_to_denmark_choreographed'),"pairs":[["rek","cph",[[-23,64],[-22.25,63.25],[7,57.5],[10.5,57.75],[11,57.5],[10.5,55.25],[12,54.75]]]]},
@ -97,7 +97,7 @@ const CABLES=[
{"id":"ouzo","name":"Ouzo Express","price":0.9,"age":"new","blurb":tr('cables.athens_to_alexandria_and_up_the'),"pairs":[["ath","cai",[[24,37.5],[25.2,35.5],[28,33],[29.9,31.4]]],["ath","ist",[[24.3,38.5],[25.6,39.9],[26.5,40.3],[28.2,40.8]]]]},
{"id":"tea","name":"Boston Tea Party Line","price":0.9,"age":"mid","blurb":tr('cables.boston_to_dublin_nobody_has_thrown'),"pairs":[["bos","dub",[[-65.25,43],[-26,51],[-8.5,51],[-5.75,52.25],[-5.5,53.25]]]]},
{"id":"clementine","name":"Clementine","price":0.6,"age":"new","df":true,"blurb":tr('cables.a_small_sweet_cable_from_broadstairs'),"pairs":[["lon","oos",[[1.44,51.36],[2.92,51.23]]]]},
{"id":"seaus","name":"SEA-US Later","price":1.0,"age":"mid","blurb":tr('cables.los_angeles_to_hawaii_guam_and'),"pairs":[["lax","hnl",[[-119,33.5],[-140,27],[-157.6,21.6]]],["hnl","gum",[[-158.3,21.2],[-180,18],[-200,15],[-214.6,13.5]]],["gum","mnl",[[125.76,13.3],[123.5,12.5],[120.75,13.25],[120.5,14.25]]],["gum","ror",[[144.5,13.1],[139,9.5],[134.8,7.5]]]]},
{"id":"seaus","name":"SEA-US Later","price":1.0,"age":"mid","blurb":tr('cables.los_angeles_to_hawaii_guam_and'),"pairs":[["lax","hnl",[[-119,33.5],[-140,27],[-157.6,21.6]]],["hnl","gum",[[-158.3,21.2],[-180,18],[-200,15],[-214.6,13.5]]],["gum","dvo",[[144,13.7],[135,10.5],[128,6.8],[126.4,5.7],[125.85,6.2],[125.7,6.75]]],["gum","ror",[[144.5,13.1],[139,9.5],[134.8,7.5]]]]},
{"id":"aag","name":"Asia-America Gateaux","price":1.25,"age":"old","blurb":tr('cables.california_to_hong_kong_via_hawaii'),"pairs":[["sjc","hnl",[[-122.8,35],[-140,27.5],[-158.2,21.4]]],["hnl","gum",[[-158.4,21.5],[-180,19],[-200,16],[-214.4,13.7]]],["gum","hkg",[[144.5,14],[130,17.5],[121,20],[115,21.6],[114.3,22.2]]]]},
{"id":"echo","name":"Echo-Chamber","price":0.85,"age":"new","blurb":tr('cables.california_to_singapore_via_guam'),"pairs":[["sjc","gum",[[-125,38],[-150,30],[-180,21],[-214.8,14]]],["gum","sin",[[137.45,12.58],[125,10.25],[123.75,9],[122,9],[108,5],[104.25,1.25]]]]},
{"id":"hantru","name":"HANTRU-ly Yours","price":1.3,"age":"mid","blurb":tr('cables.guam_to_the_marshall_islands_with'),"pairs":[["gum","maj",[[145,13.3],[158,7],[167,8.5],[171.2,7.2]]]]},
@ -161,6 +161,9 @@ const CABLES=[
{"id":"tw1","name":"TW1-light","price":1.1,"age":"mid","blurb":tr('cables.the_emirates_oman_and_pakistan_on'),"pairs":[["fuj","mct",[[58.25,24.25]]],["mct","khi",[[58.75,24]]]]},
{"id":"mct1","name":"MCT (Malaysia, Cambodia, Tuk-tuks)","price":0.95,"age":"new","blurb":tr('cables.malaysia_to_thailand_round_the_gulf'),"pairs":[["kul","bkk",[[101.75,2.5],[102.5,1.5],[103.5,0.75],[103.75,0.75],[104.75,1.75],[104.75,2.75],[100.5,12.75]]]]},
{"id":"kjcn","name":"KJCN (Kimchi-Japan Cable Network)","price":1,"age":"mid","blurb":tr('cables.busan_to_kyushu_the_shortest_way'),"pairs":[["icn","fuk",[[126,36.75],[126,34],[130,34]]]]},
{"id":"pdscn","name":"Pan de Sal Cable Network","price":0.9,"age":"new","blurb":tr('cables.the_philippines_longest_domestic_cable_fresh'),"pairs":[["mnl","ceb",[[120.6,14.4],[120.45,13.95],[120.85,13.6],[121.9,12.9],[122.7,12.3],[123.6,11.6],[124.2,11.2],[124.15,10.5]]],["ceb","dvo",[[124.05,10.2],[124.1,9.6],[124.5,8.9],[124.62,8.55]]],["mnl","dvo",[[121.6,13.85],[122.1,13.2],[122.9,12.45],[123.75,11.7],[124.3,11.1],[124.25,10.3],[124.1,9.6],[124.5,8.9],[124.62,8.55]]]]},
{"id":"dfon","name":"Philippines Long Distance Relationship","price":1.1,"age":"mid","blurb":tr('cables.the_incumbent_s_own_line_south'),"pairs":[["mnl","ceb",[[121.6,13.85],[122.1,13.2],[122.9,12.45],[123.75,11.7],[124.3,11.1],[124.2,10.45]]],["ceb","dvo",[[123.95,10.05],[124.4,9.5],[124.75,9.05]]]]},
{"id":"vismin","name":"Diverge VisMin Express","price":0.9,"age":"new","blurb":tr('cables.the_upstart_s_own_cable_from'),"pairs":[["ceb","dvo",[[124.15,10.9],[124.25,10.2],[124.4,9.3],[124.65,8.6]]]]},
];
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);

View file

@ -37,7 +37,11 @@ NETS.push(
{id:'bcd',name:'Bell Canad-eh',asn:577,type:'eye',cc:'CA',pol:'selective',minIx:10,minPni:30,share:.01,col:'#00549A',pops:['hfx','tor','mtl','nyc','chi','ott','cal','van'],ix:['tor','mtl','ott'],blurb:tr('networks.polite_enormous_and_sorry_about_the')});
NETS.push(
{id:'tsf',name:'Telkom-selfie',asn:7713,type:'eye',cc:'ID',pol:'selective',minIx:10,minPni:30,share:.01,col:'#E4002B',pops:['jkt','sin'],ix:['jkt','sin'],blurb:tr('networks.indonesia_s_mobile_giant_every')},
{id:'pld',name:'PLDTea Time',asn:9299,type:'eye',cc:'PH',pol:'selective',minIx:10,minPni:30,share:.008,up:['ntt','tat'],col:'#D62027',pops:['mnl','hkg','sin'],ix:['hkg'],blurb:tr('networks.philippine_giant_peering_requests')},
{id:'pld',name:'PLDTea Time',asn:9299,type:'t2',cc:'PH',pol:'selective',up:['ntt','tat'],minIx:10,minPni:30,share:.008,price:7,col:'#D62027',pops:['mnl','ceb','dvo','hkg','sin'],ix:['hkg','mnl~3'],blurb:tr('networks.philippine_giant_peering_requests')},
{id:'cvg',name:'Diverge',asn:17639,type:'eye',cc:'PH',pol:'open',up:['ntt','tat'],share:.005,col:'#F26B21',pops:['mnl','ceb','dvo','hkg','sin'],ix:['mnl','mnl~2','hkg','sin'],blurb:tr('networks.the_fiber_upstart_from_the_provinces')},
{id:'smt',name:'Smarty Pants',asn:10139,type:'eye',cc:'PH',pol:'selective',up:['pld'],minIx:10,minPni:30,share:.006,col:'#00A859',pops:['mnl'],ix:[],blurb:tr('networks.pldtea_time_s_mobile_sibling_buy')},
{id:'dto',name:'Ditto',asn:139831,type:'eye',cc:'PH',pol:'open',up:['ntt','tat'],share:.002,col:'#B5121B',pops:['mnl'],ix:['mnl','mnl~2'],blurb:tr('networks.the_third_mobile_network_same_towers')},
{id:'rsh',name:'RISE & Shine',asn:63927,type:'eye',cc:'PH',pol:'open',up:['ntt','tat'],share:.002,col:'#F5A623',pops:['mnl','ceb','dvo','sin','hkg','fra','ams','lon','sto'],ix:['mnl','mnl~2','mnl~3','ceb','dvo','sin','sin~2','hkg','hkg~2','fra','ams','lon','sto'],blurb:tr('networks.up_early_in_cebu_and_already')},
{id:'spk',name:'Spark-le',asn:4771,type:'eye',cc:'NZ',pol:'open',share:.005,col:'#6A2C91',pops:['akl','syd','chc','ivc'],ix:['akl','syd','chc'],blurb:tr('networks.new_zealand_s_shiniest_isp')},
{id:'tsy',name:'Telstraya',asn:1221,type:'t2',cc:'AU',pol:'selective',minIx:15,minPni:40,share:.01,price:9,col:'#0099F8',pops:['hnl','gum','suv','pom','nou','hir','syd','per','sin','hkg','lax','tpe','mel','bne','drw','adl','cbr','hba'],ix:['gum','sin','hkg'],blurb:tr('networks.australia_s_big_one_g_day')});
NETS.push(

View file

@ -23,6 +23,8 @@ const XIX=[
{id:'lax~2',c:'lax',name:'Smog-IX',cheap:0.6,take:0.45,blurb:tr('rival_exchanges.you_can_t_see_the_fabric')},
{id:'sin~2',c:'sin',name:'Kopi-IX',cheap:0.6,take:0.5,blurb:tr('rival_exchanges.strong_sweet_and_cheaper_than_the')},
{id:'hkg~2',c:'hkg',name:'Dim-Sum-IX',cheap:0.6,take:0.5,blurb:tr('rival_exchanges.lots_of_small_sessions_on_little')},
{id:'mnl~2',c:'mnl',name:'Bayanihan-IX',cheap:0.3,take:0.4,blurb:tr('rival_exchanges.the_whole_neighbourhood_carries_the')},
{id:'mnl~3',c:'mnl',name:'In-Vitro-IX',cheap:4.4,take:0.2,core:['pld','smt'],blurb:tr('rival_exchanges.grown_in_a_lab_by_the')},
{id:'tok~2',c:'tok',name:'Bento-IX',cheap:0.65,take:0.5,core:['drz','akm','cfl','sgt','msf','amz'],blurb:tr('rival_exchanges.tokyo_has_more_exchanges_than_anyone')},
{id:'syd~2',c:'syd',name:'At-The-Edge IX',cheap:.7,take:0.5,core:['drz','nfx','ggl','fbk','akm','cfl','amz','msf','bdc','slw','abb','voc','stb','spl','lpt','npt','mag'],blurb:tr('rival_exchanges.the_challenger_to_ix_straya_pops')},
{id:'bom~2',c:'bom',name:'Vada-Pav-IX',cheap:0.45,take:0.45,blurb:tr('rival_exchanges.mumbai_s_street_food_exchange_fast')},

View file

@ -27,7 +27,7 @@ NETS.push(
{id:'fet',name:'Far EasTone-Deaf',asn:9674,type:'eye',cc:'TW',pol:'selective',minIx:3,minPni:12,share:.003,up:['ntt'],col:'#E60012',pops:['tpe','hkg'],ix:['tpe'],blurb:tr('homegrown_eyeballs.taiwan_s_number_three_never_hears')},
{id:'fre',name:'Free as in Beer',asn:12322,type:'eye',cc:'FR',pol:'selective',minIx:6,minPni:20,share:.006,up:['cog','lvl'],col:'#CD1E25',pops:['par','mrs','ams','lon','fra'],ix:['par','mrs'],blurb:tr('homegrown_eyeballs.the_challenger_that_made_french_broadband')},
{id:'frs',name:'Yas Queen Sénégal',asn:37649,type:'eye',cc:'SN',pol:'open',share:.0008,up:['tat','tly'],col:'#FFD100',pops:['dkr'],ix:['dkr'],blurb:tr('homegrown_eyeballs.senegal_s_number_two_freshly_renamed')},
{id:'glb',name:'Globe-Trotter Telecom',asn:4775,type:'eye',cc:'PH',pol:'selective',minIx:3,minPni:15,share:.006,up:['ntt','tat'],col:'#0056A2',pops:['mnl','hkg','sin'],ix:['hkg','sin'],blurb:tr('homegrown_eyeballs.the_philippines_other_mobile_giant_roaming')},
{id:'glb',name:'Globe-Trotter Telecom',asn:4775,type:'t2',cc:'PH',pol:'selective',minIx:3,minPni:15,share:.006,price:6,up:['ntt','tat'],col:'#0056A2',pops:['mnl','ceb','dvo','hkg','sin'],ix:['mnl','mnl~2','hkg','sin'],blurb:tr('homegrown_eyeballs.the_philippines_other_mobile_giant_roaming')},
{id:'gph',name:'Grameen Machine',asn:24389,type:'eye',cc:'BD',pol:'selective',minIx:3,minPni:12,share:.004,up:['tat','ntt'],col:'#19AAF8',pops:['dac','sin'],ix:['dac'],blurb:tr('homegrown_eyeballs.bangladesh_s_biggest_mobile_network_a')},
{id:'hkb',name:'Ding-Ding Broadband',asn:9269,type:'eye',cc:'HK',pol:'open',share:.002,up:['ntt','cog'],col:'#6A2C91',pops:['hkg'],ix:['hkg'],blurb:tr('homegrown_eyeballs.fibre_to_every_tower_block_rung')},
{id:'hkt',name:'Net-Vigour HK',asn:4760,type:'eye',cc:'HK',pol:'selective',minIx:5,minPni:20,share:.004,up:['ntt','tat'],col:'#00A0E1',pops:['hkg','sin','tok','lax'],ix:['hkg'],blurb:tr('homegrown_eyeballs.hong_kong_s_incumbent_broadband_full')},

View file

@ -11,7 +11,7 @@ const INTERNS={
// The orders, in the order the panel shows them. pop: can be switched off per POP. cap: default monthly budget, of setup
// fees, or (mo) of the running costs the order adds, for caches, which are free to rack but cost rent every month.
const OPS=[
{k:'transit',i:'📈',pop:1,cap:50000,t:N_('ops.o_transit'),d:N_('ops.o_transit_d'),p:{x:{d:1.5,v:[1.25,1.5,2,3],l:N_('ops.p_x'),f:v=>v+'×'},prov:{d:'cheap',ok:v=>v==='cheap'||(isNet(v)&&!!NET[v].price),l:N_('ops.p_prov')}}},
{k:'transit',i:'📈',pop:1,cap:50000,t:N_('ops.o_transit'),d:N_('ops.o_transit_d'),p:{x:{d:1.5,v:[1.25,1.5,2,3],l:N_('ops.p_x'),f:v=>v+'×'},prov:{d:'cheap',ok:v=>v==='cheap'||v==='have'||(isNet(v)&&!!NET[v].price),l:N_('ops.p_prov')}}},
{k:'routers',i:'🧠',pop:1,cap:250000,t:N_('ops.o_routers'),d:N_('ops.o_routers_d'),p:{at:{d:80,v:[60,70,80,90],l:N_('ops.p_at'),f:v=>v+'%'},how:{d:'auto',v:['auto','add','swap'],l:N_('ops.p_how'),f:v=>tr({auto:N_('ops.how_auto'),add:N_('ops.how_add'),swap:N_('ops.how_swap')}[v])}}},
{k:'caches',i:'📦',pop:1,cap:5000,mo:1,t:N_('ops.o_caches'),d:N_('ops.o_caches_d'),p:{g:{d:5,v:[1,5,10,25,50],l:N_('ops.p_g'),f:v=>fmtG(v)}}},
{k:'ix',i:'🔀',t:N_('ops.o_ix'),d:N_('ops.o_ix_d'),p:{}},
@ -137,15 +137,19 @@ const OPS_RUN={
for(const c of opsPops('transit')){let ts=S.transit.filter(t=>t.city===c);if(!ts.length)continue;
// Thirty days of 95th-percentile-ish history per port; their peaks summed is a safe (high) estimate of the POP's peak.
const peak=ts.reduce((a,t)=>a+(t.hist||[]).reduce((m,v)=>Math.max(m,v),0),0);if(!(peak>0))continue;
const n=opsProv(c);if(!n)continue;
// "Already connected" (#227): only the providers you buy from here, the smallest first, never a new contract.
const have=opsP('transit','prov')==='have',n=have?null:opsProv(c);if(!have&&!n)continue;
const grow=t=>{const k=t.n||1,up=t.tier+1;
if(k<4&&portOk(c,t.tier))return {cost:PORT[t.tier].setup,go:()=>ACT.lagT({id:t.id,d:1}),w:'+1×'+PORT[t.tier].n};
if(PORT[up]&&portShown(up)&&portOk(c,up))return {cost:PORT[up].setup*k,go:()=>ACT.buyTransit({city:c,net:t.net,tier:up}),w:PORT[t.tier].n+'→'+PORT[up].n};
if(k<LAG_MAX&&portOk(c,t.tier))return {cost:PORT[t.tier].setup,go:()=>ACT.lagT({id:t.id,d:1}),w:'+1×'+PORT[t.tier].n};return null;};
for(let step=0;step<4;step++){const cap=ts.reduce((a,t)=>a+lagCap(PORT[t.tier].g,t.n),0);if(cap>=N*peak)break;
const t=ts.find(x=>x.net===n.id);let job=null;
if(t){const k=t.n||1,up=t.tier+1;
if(k<4&&portOk(c,t.tier))job={cost:PORT[t.tier].setup,go:()=>ACT.lagT({id:t.id,d:1}),w:'+1×'+PORT[t.tier].n};
else if(PORT[up]&&portShown(up)&&portOk(c,up))job={cost:PORT[up].setup*k,go:()=>ACT.buyTransit({city:c,net:n.id,tier:up}),w:PORT[t.tier].n+'→'+PORT[up].n};
else if(k<LAG_MAX&&portOk(c,t.tier))job={cost:PORT[t.tier].setup,go:()=>ACT.lagT({id:t.id,d:1}),w:'+1×'+PORT[t.tier].n};}
else{const need=N*peak-cap,ok=PORT.map((P,i)=>i).filter(i=>portShown(i)&&portOk(c,i)),i=ok.find(i=>PORT[i].g>=need)??ok.at(-1);
if(i!==undefined)job={cost:PORT[i].setup,go:()=>ACT.buyTransit({city:c,net:n.id,tier:i}),w:'+'+PORT[i].n};}
let job=null;
if(have){for(const t of ts.slice().sort((a,b)=>lagCap(PORT[a.tier].g,a.n)-lagCap(PORT[b.tier].g,b.n)||transitPerG(NET[a.net],c,!!a.premium)-transitPerG(NET[b.net],c,!!b.premium))){job=grow(t);if(job)break;}}
else{const t=ts.find(x=>x.net===n.id);
if(t)job=grow(t);
else{const need=N*peak-cap,ok=PORT.map((P,i)=>i).filter(i=>portShown(i)&&portOk(c,i)),i=ok.find(i=>PORT[i].g>=need)??ok.at(-1);
if(i!==undefined)job={cost:PORT[i].setup,go:()=>ACT.buyTransit({city:c,net:n.id,tier:i}),w:'+'+PORT[i].n};}}
if(!job||!X.can('transit',job.cost)||!X.pay('transit',job.go))break;
X.did('transit',c+' '+job.w);ts=S.transit.filter(t=>t.city===c);}}},
optics(X){const at=opsP('optics','at')/100;

View file

@ -21,7 +21,7 @@ function sanitize(s){
if(!isCity(s.home))s.home=Object.keys(s.pops)[0]||'fra';
opsSanitize(s);
const tier=v=>int(v,0,PORT.length-1,0),lag=v=>int(v,1,LAG_MAX,1),sid=v=>String(v==null?uid():v).slice(0,40);
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);if(l.list!==undefined){const L=l.list;if(l.kind==='df'&&L&&typeof L==='object'&&!Array.isArray(L)){const w=int(L.w,0,256,0),p=int(L.p,0,2,0);if(w||p)l.list={w,p};else delete l.list;}else delete l.list;}l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&!own(CAB,l.cable))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);return l;});
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);if(l.list!==undefined){const L=l.list;if(l.kind==='df'&&L&&typeof L==='object'&&!Array.isArray(L)){const w=int(L.w,0,256,0),p=int(L.p,0,2,0);if(w||p)l.list={w,p};else delete l.list;}else delete l.list;}l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&(!own(CAB,l.cable)||!cablePair(l.cable,l.a,l.b)))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);return l;});
for(const l of s.links)repairSubUpgradeDates(l,s.day);
/* Metrics moved from each link to its city pair (#122). Older saves routed a pair at the lowest metric of its
links, with all of them carrying traffic, so the pair keeps that metric and nothing goes on standby. */

View file

@ -5,7 +5,7 @@ const txComp=c=>{const q=CITY_PDB[c];return q?clamp((1000/Math.max(q[1],10))**0.
// No neutral data center means building your own room: POPs cost more to build and to run.
const colo=c=>{const q=CITY_PDB[c];return !q?1:q[0]===0?1.5:q[0]<=2?1.25:1;};
const popMo=c=>Math.round(POP_MO*colo(c));
function regionMult(c){const C=CITY[c];if(!C||C.cn)return 1;if(C.kr)return KR_TRANSIT;if(C.au)return AU_TRANSIT;if(C.tape)return 1.5;const base=C.reg==='AS'?2.5:C.reg==='AF'?2:C.reg==='OC'?1.8:C.reg==='SA'?1.6:1;return Math.round(base*txComp(c)*10)/10;}
function regionMult(c){const C=CITY[c];if(!C||C.cn)return 1;if(C.kr)return KR_TRANSIT;if(C.au)return AU_TRANSIT;if(C.ph)return PH_TRANSIT;if(C.tape)return 1.5;const base=C.reg==='AS'?2.5:C.reg==='AF'?2:C.reg==='OC'?1.8:C.reg==='SA'?1.6:1;return Math.round(base*txComp(c)*10)/10;}
// A network's own markup on top of that, where it is far from home (Glowball Sakura Lager in Asia and New Zealand).
// What a home pays, against the usual bill.
const arpuOf=c=>CITY[c].arpu||(CITY[c].kr&&scnRule('sender')?KR_ARPU:1);
@ -34,7 +34,7 @@ function linkLat(l){const f=l.kind==='df'?(l.own?(l.sub?seaLatencyFactor(l):1.1)
const WAVE_LAND={EU:0.65,AM:1,SA:1.6,AS:1.4,OC:1.2,AF:2.2},WAVE_SUB={EU:0.8,AM:1,SA:2,AS:1.5,OC:1.5,AF:4.5};
const WAVE_NAME={EU:tr('common.europe'),AM:tr('common.north_america'),SA:tr('common.south_america'),AS:tr('common.asia'),OC:tr('common.oceania'),AF:tr('common.africa')};
function waveMarket(a,b,sub){const ra=CITY[a].reg,rb=CITY[b].reg,T=sub?WAVE_SUB:WAVE_LAND,au=sub?AU_WAVE.sub:AU_WAVE.land;
const fa=CITY[a].au?au:(T[ra]||1),fb=CITY[b].au?au:(T[rb]||1),reg=sub&&nullPair(a,b)?AU_WAVE.ew:sub?Math.max(fa,fb):(fa+fb)/2;
const fa=CITY[a].au?au:(T[ra]||1),fb=CITY[b].au?au:(T[rb]||1),reg=sub&&nullPair(a,b)?AU_WAVE.ew:sub&&CITY[a].ph&&CITY[b].ph?PH_WAVE:sub?Math.max(fa,fb):(fa+fb)/2;
const key=a<b?a+b:b+a,mood=0.85+(hstr(key+'|mood')%31)/100;
const ero=Math.max(0.55,Math.pow(0.92,Math.floor((S?S.day:0)/360)));
return {m:reg*mood*ero,reg,mood,ero};}

View file

@ -8,7 +8,7 @@ function fireEvent(){
if(Object.keys(S.pops).some(ruCity))opts.push('runet','runet');
if(S.pops.doh&&Object.keys(S.pops).some(c=>CITY[c].gcc||CITY[c].uae)&&!(S.ev.gulf>S.day))opts.push('gulf');
if(Object.keys(S.pops).some(c=>CITY[c].saudi))opts.push('mega');
if(['mnl','hkg','tok','icn','sha','jkt'].some(c=>S.pops[c]))opts.push('typhoon');
if(['mnl','ceb','hkg','tok','icn','sha','jkt'].some(c=>S.pops[c]))opts.push('typhoon');
if(S.pops.icn&&!S.krExit)opts.push('krexit');if(S.pops.icn&&!(S.ev.krroute>S.day))opts.push('krroute');
if(Object.keys(S.pops).some(cnCity)||R.gfwCross>1)opts.push('golden','gfw');
if(S.transit.some(t=>t.net==='cog'))opts.push('depeer','depeer');
@ -34,7 +34,7 @@ function fireEvent(){
if(e==='hijack'){const nh=NETS.map(n=>n.id).filter(()=>Math.random()<0.6),old=S.ev.rpki&&S.ev.rpki.until>S.day?S.ev.rpki:null;S.ev.rpki=old?{until:Math.max(old.until,S.day+1),nets:[...new Set(old.nets.concat(nh))]}:{until:S.day+1,nets:nh};addInc({type:'hijack',ref:'rpki',until:S.day+1,msg:tr('events.a_state_owned_isp_accidentally'),cost:1500,fix:tr('events.call_everyone_you_know')});toast(tr('events.bgp_hijack_someone_else_is'),'bad');sfx('alert');return;}
if(e==='landban'){const lc=[...new Set(CABLE_PAIRS.flatMap(c=>[c.a,c.b]))];const c=pick(lc);S.ev.landban={city:c,until:S.day+45};toast(tr('events.landing_permit_dispute_in_city_two',{city:CITY[c].name}),'bad');return;}
if(e==='shutdown'){const ps=Object.keys(S.pops).filter(c=>c!==S.home);if(!ps.length)return;const c=pick(ps);S.pops[c].down=Math.max(S.pops[c].down||0,S.day+1);addInc({type:'shutdown',ref:c,until:S.day+1,msg:tr('events.regulators_ordered_every_network_in',{city:CITY[c].name}),cost:0});toast(tr('events.ordered_offline_in_city_a_government',{city:CITY[c].name}),'bad');sfx('alert');return;}
if(e==='typhoon'){const c=pick(['mnl','hkg','tok','icn','sha','jkt'].filter(x=>S.pops[x])),p=S.pops[c],nm=pick([tr('common.typhoon_bandwidth'),tr('common.typhoon_latency'),tr('common.typhoon_jitter'),tr('events.typhoon_packet_loss')]);
if(e==='typhoon'){const c=pick(['mnl','ceb','hkg','tok','icn','sha','jkt'].filter(x=>S.pops[x])),p=S.pops[c],nm=pick([tr('common.typhoon_bandwidth'),tr('common.typhoon_latency'),tr('common.typhoon_jitter'),tr('events.typhoon_packet_loss')]);
if(p.gen){S.stats.survived++;toast(tr('events.name_hits_city_the_grid_is',{name:nm,city:CITY[c].name}),'good');sfx('alert');return;}
p.down=Math.max(p.down||0,S.day+2);addInc({type:'power',ref:c,until:p.down,msg:tr('events.name_knocked_out_power_in_city',{name:nm,city:CITY[c].name}),cost:7000,fix:tr('incidents.rent_a_generator')});toast(tr('events.name_hits_city_power_is_out',{name:nm,city:CITY[c].name}),'bad');sfx('alert');compute();return;}
if(e==='runet'){S.ev.runet=S.day+1;toast(tr('events.sovereign_internet_drill_moscow'),'bad');sfx('alert');compute();return;}

View file

@ -45,6 +45,8 @@ const ACT={
if(o.a==='cust'){if(S.biz.some(b=>b.id===o.v)){ACT.custGo({id:o.v});return;}toast(tr('interface.that_customer_is_gone_the_contract'),'');return;}
if(o.a==='bank'){ACT.bank({});return;}if(o.a==='ops'){ACT.opsOpen();return;}if(o.a==='tab'&&LOG_TABS.includes(o.v))ACT.leftTab({t:o.v});},
logAll:()=>{UI.logAll=!UI.logAll;renderLeft();},
findOpen:()=>findOpen(),
findGo:({city})=>{if(!isCity(city))return;closeModal();$('dash').hidden=true;ACT.focusCity({city});},
focusCity:({city})=>{selectCity(city);const C=CITY[city];cam.x=C.x;cam.y=C.y;cam.z=Math.max(cam.z,1.2);if(innerWidth<760)UI.leftOpen=false;renderLeft();},
selLink:({id})=>selectLink(id),
};

View file

@ -10,7 +10,7 @@ Object.assign(ACT,{
toast(esc(tr('ops.fired',{name:nm})),'');after();opsModal();},
opsToggle:({k})=>{if(!opsHired()||!own(OPSK,k))return;S.ops.on[k]=!S.ops.on[k];sfx('click');after();opsModal();},
opsParam:({k,p})=>{if(!opsHired()||!own(OPSK,k)||!own(OPSK[k].p,p))return;const P=OPSK[k].p[p];let v;
if(p==='prov'){const ids=['cheap',...NETS.filter(n=>n.price&&Object.keys(S.pops).some(c=>sellsAt(n,c))).map(n=>n.id)];v=opsCycle(ids,opsP(k,p));}else v=opsCycle(P.v,opsP(k,p));
if(p==='prov'){const ids=['cheap','have',...NETS.filter(n=>n.price&&Object.keys(S.pops).some(c=>sellsAt(n,c))).map(n=>n.id)];v=opsCycle(ids,opsP(k,p));}else v=opsCycle(P.v,opsP(k,p));
(S.ops.p[k]||(S.ops.p[k]={}))[p]=v;sfx('click');after();opsModal();},
opsCap:({k})=>{if(!opsHired()||!own(OPSK,k)||!OPSK[k].cap)return;S.ops.cap[k]=opsCycle(opsCaps(k),opsCap(k));sfx('click');after();opsModal();},
opsFloor:()=>{if(!opsHired())return;S.ops.floor=opsCycle(OPS_FLOORS,S.ops.floor);sfx('click');after();opsModal();},

View file

@ -5,7 +5,7 @@ function opsCard(){if(!S)return '';const last=opsHired()&&S.ops.log[0];
<div class="meta">${opsHired()?esc(last?opsEntry(last):tr('ops.l_quiet',{name:opsName()})):opsCanHire()?tr('ops.hire_pitch_short'):tr('ops.locked',{lv:2})}</div>
<div class="btns">${btn(opsHired()?tr('ops.standing_orders'):tr('ops.hire_an_intern'),'opsOpen',{},opsHired()?'sm':'pink sm',!opsHired()&&!opsCanHire())}</div></div>`;}
const opsEntry=e=>(e.f!==undefined?opsFFLine(e)+' ':'')+(e.r.length||e.f===undefined?opsLine(e):'');
function opsVal(k,p){const P=OPSK[k].p[p],v=opsP(k,p);return p==='prov'?(v==='cheap'?tr('ops.cheapest'):NET[v].name):P.f(v);}
function opsVal(k,p){const P=OPSK[k].p[p],v=opsP(k,p);return p==='prov'?(v==='cheap'?tr('ops.cheapest'):v==='have'?tr('ops.already_connected'):NET[v].name):P.f(v);}
function opsOrderHtml(d){const k=d.k,on=S.ops.on[k],cap=d.cap?opsCap(k):0,sp=S.ops.spent[k]||0,am=Math.round(S.ops.addMo[k]||0);
return `<div class="ops-o${on?' on':''}"><div class="ops-h"><span class="ops-i" aria-hidden="true">${d.i}</span><div class="grow"><div class="nm">${tr(d.t)}</div><div class="meta">${tr(d.d)}${k==='caches'?' '+tr('ops.caches_rent',{price:fmt$(CACHE_MO)}):''}</div></div>
<button class="b sm ${on?'green':'ghost'}" data-act="opsToggle" data-args='{"k":"${k}"}' aria-pressed="${on}" aria-label="${esc(tr(d.t))}">${on?tr('common.on'):tr('ops.paused')}</button></div>

View file

@ -0,0 +1,30 @@
/* ---------- Find a city (#218): a search box that jumps the map there ----------
Matches the city's name, its country (in the player's language and in English) and its exchange and data center
names, so "Deutschland", "Germany" or "DE-CIX" all find Frankfurt. Press / anywhere, or the 🔍 chip in the HUD. */
const FIND_N=8;
const fold=s=>String(s||'').normalize('NFD').replace(/[̀-ͯ]/g,'').toLowerCase().trim();
// Country names, built once per page: they never change while playing.
let FIND_IX=null;
function findIndex(){if(FIND_IX)return FIND_IX;let dn=null,en=null;try{dn=new Intl.DisplayNames([LANG],{type:'region'});en=new Intl.DisplayNames(['en'],{type:'region'});}catch(e){}
const cn=(d,cc)=>{try{return d?d.of(cc)||'':'';}catch(e){return '';}};
FIND_IX=Object.values(CITY).map(C=>{const land=cn(dn,C.cc)||C.cc||'';return {id:C.id,name:fold(C.name),land,ctry:fold(land+' '+cn(en,C.cc)+' '+(C.cc||'')),xtra:fold((C.ix||'')+' '+(C.dc||''))};});return FIND_IX;}
// Best matches first: the name starts with it, a word of the name does, the name has it, then country, then exchange or DC.
function findCities(q){q=fold(q);const mine=c=>S&&S.pops&&S.pops[c]?0:1;
if(!q)return S&&S.pops?Object.keys(S.pops).filter(isCity).sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name)).slice(0,FIND_N):[];
const out=[];for(const e of findIndex()){const n=e.name;
const s=n.startsWith(q)?0:n.split(/[\s\-.'()]+/).some(w=>w.startsWith(q))?1:n.includes(q)?2:e.ctry.includes(q)?3:e.xtra.includes(q)?4:-1;
if(s>=0)out.push([s,mine(e.id),-(CITY[e.id].P||0),e.id]);}
return out.sort((a,b)=>a[0]-b[0]||a[1]-b[1]||a[2]-b[2]).slice(0,FIND_N).map(r=>r[3]);}
function findRows(q){const ids=findCities(q),land=c=>(findIndex().find(e=>e.id===c)||{}).land||'';
if(!ids.length)return `<p class="meta" style="margin:10px 0">${q.trim()?tr('find.no_city_matches_q',{q:esc(q.trim())}):tr('find.type_a_city_a_country')}</p>`;
return ids.map((c,i)=>{const C=CITY[c],p=S&&S.pops&&S.pops[c];
return `<button class="row findrow${i?'':' on'}" data-act="findGo" data-args="${esc(JSON.stringify({city:c}))}"><span class="grow"><span class="nm">${p?'📍 ':''}${esc(C.name)}</span><span class="meta">${esc([land(c),C.ix].filter(Boolean).join(' · '))}${p?' · '+tr('find.your_pop'):''}</span></span><span aria-hidden="true">›</span></button>`;}).join('');}
function findOpen(){if(!S||!UI.started)return;
openModal(`<h2 style="font-size:24px;margin:0 0 10px">🔍 ${tr('find.find_a_city')}</h2><input class="t" id="findIn" type="search" enterkeyhint="go" autocomplete="off" autocapitalize="off" spellcheck="false" placeholder="${esc(tr('find.city_country_or_exchange'))}" aria-label="${esc(tr('find.find_a_city'))}" aria-controls="findList">
<div id="findList" class="findlist" role="list">${findRows('')}</div>${isPhone()?'':`<p class="meta" style="margin:8px 0 0">${tr('find.press_slash_to_search_from')}</p>`}`,'find');
const el=$('findIn');if(el)el.focus();}
document.addEventListener('input',e=>{if(e.target.id!=='findIn')return;const L=$('findList');if(L)L.innerHTML=findRows(e.target.value);});
document.addEventListener('keydown',e=>{
if(e.target.id==='findIn'){if(e.key==='Escape'){closeModal();return;}if(e.key==='Enter'){e.preventDefault();const c=findCities(e.target.value)[0];if(c)ACT.findGo({city:c});}return;}
if(e.key!=='/'||e.ctrlKey||e.metaKey||e.altKey||(e.target.closest&&e.target.closest('input,textarea,select,[contenteditable]')))return;
if(!S||!UI.started||!$('modal').hidden)return;e.preventDefault();findOpen();});

View file

@ -30,10 +30,13 @@ function segDist(x,y,a,b){const dx=b[0]-a[0],dy=b[1]-a[1],L=dx*dx+dy*dy||1;const
function drawCables(ks){const z=cam.z,selC=UI.drag&&UI.drag.mode==='link'?UI.drag.from:(UI.sel&&UI.sel.type==='city'?UI.sel.id:null),cached=!!(WL.cv&&WL.key&&WL.cab);
if(!selC&&z<1.7&&cached)return;
ctx.font='800 10px Nunito, sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';
// Labels that would sit on another, or on a segment shorter than the name, are left out (a selected city's always show).
const LB=[],lbOk=(x,y,w,sp,hot)=>{const b=[x-w/2-3,y-7,x+w/2+3,y+7];if(!hot){let mn=Infinity,mx=-Infinity,my=Infinity,My=-Infinity;for(const q of sp){mn=Math.min(mn,q[0]);mx=Math.max(mx,q[0]);my=Math.min(my,q[1]);My=Math.max(My,q[1]);}
if(Math.hypot(mx-mn,My-my)<w*0.8)return false;if(LB.some(o=>b[0]<o[2]&&b[2]>o[0]&&b[1]<o[3]&&b[3]>o[1]))return false;}LB.push(b);return true;};
const ar=arOn();for(const cp of CABLE_PAIRS){const C=CAB[cp.cid],hot=!!selC&&(cp.a===selC||cp.b===selC);if(!hot&&cached&&z<1.7)continue;if(ar&&!hot&&!(arKind(cp.a)&&arKind(cp.b)))continue;const col=cableCol(C);
for(const k of ks){const sp=cp.pts.map(p=>toS(p[0],p[1],k));let mn=Infinity,mx=-Infinity;for(const q of sp){if(q[0]<mn)mn=q[0];if(q[0]>mx)mx=q[0];}if(mx<-20||mn>CW+20)continue;
if(hot||!cached){ctx.globalAlpha=hot?0.95:0.4;ctx.strokeStyle=col;ctx.lineWidth=hot?3:1.6;ctx.lineJoin='round';ctx.setLineDash(C.age==='old'?[6,5]:[]);ctx.beginPath();ctx.moveTo(sp[0][0],sp[0][1]);for(let i=1;i<sp.length;i++)ctx.lineTo(sp[i][0],sp[i][1]);ctx.stroke();ctx.setLineDash([]);}
if(hot||(z>=1.7&&!ar)){const m=sp[Math.floor(sp.length/2)];ctx.globalAlpha=hot?1:0.75;ctx.lineWidth=3;ctx.strokeStyle='rgba(255,255,255,.85)';ctx.strokeText(C.name,m[0],m[1]-8);ctx.fillStyle=col;ctx.fillText(C.name,m[0],m[1]-8);}
if((hot||(z>=1.7&&!ar))&&lbOk(sp[Math.floor(sp.length/2)][0],sp[Math.floor(sp.length/2)][1]-8,ctx.measureText(C.name).width,sp,hot)){const m=sp[Math.floor(sp.length/2)];ctx.globalAlpha=hot?1:0.75;ctx.lineWidth=3;ctx.strokeStyle='rgba(255,255,255,.85)';ctx.strokeText(C.name,m[0],m[1]-8);ctx.fillStyle=col;ctx.fillText(C.name,m[0],m[1]-8);}
ctx.globalAlpha=1;}}}
function bezGeom(l,at){const A=CITY[l.a],B=CITY[l.b];const i=at!==undefined?at:lineIdx(l);const key=l.id+'|b'+i;const hit=GEO.get(key);if(hit)return hit;
const bx=A.x+wrapDx(A.x,B.x),by=B.y;const dx=bx-A.x,dy=by-A.y,len=Math.hypot(dx,dy)||1;let nx=-dy/len,ny=dx/len;if(ny>0){nx=-nx;ny=-ny;}

View file

@ -424,7 +424,7 @@
"cables.a_friendly_cable_with_french_manners":"A friendly cable with French manners.",
"cables.a_gateway_from_europe_to_india":"A gateway from Europe to India, through the Red Sea. Pronounced like a very surprised cable.",
"cables.a_quick_hop_across_the_red":"A quick hop across the Red Sea between Egypt and Saudi Arabia.",
"cables.a_rainbow_bridge_from_singapore_to":"A rainbow bridge from Singapore to California, via Jakarta and Manila.",
"cables.a_rainbow_bridge_from_singapore_to":"A rainbow bridge from Singapore to California, via Jakarta, Davao and Guam.",
"cables.a_ring_around_the_caribbean_from":"A ring around the Caribbean from Florida to Central America, older than most of its customers.",
"cables.a_ring_round_east_asia_from":"A ring round East Asia from 2001: Singapore, Hong Kong, Manila, Taipei, Shanghai, Seoul and Tokyo.",
"cables.a_short_cable_across_a_very":"A short cable across a very tense strait.",
@ -570,14 +570,17 @@
"cables.the_emirates_oman_and_pakistan_on":"The Emirates, Oman and Pakistan on one light little cable.",
"cables.the_first_cable_from_south_america":"The first cable from South America to Oceania. 14,000 km of very lonely glass.",
"cables.the_first_subsea_fiber_in_the":"The first subsea fiber in the American Arctic: Nome to Utqiaġvik, then over the North Slope to Anchorage. Sea ice keeps repair ships away half the year.",
"cables.the_incumbent_s_own_line_south":"The incumbent's own line south: overland to Lucena, then under the sea to Cebu. Still calls every night.",
"cables.the_newest_cable_from_south_africa":"The newest cable from South Africa to Madagascar, Réunion and Mauritius, shared by the islands’ own telcos.",
"cables.the_old_workhorse_s_younger_sibling":"The old workhorse’s younger sibling: Los Angeles to Sydney with a branch to Fiji.",
"cables.the_philippines_longest_domestic_cable_fresh":"The Philippines' longest domestic cable, fresh every morning. Luzon to Cebu and Mindanao, island by island.",
"cables.the_pretty_way_around_east_asia":"The pretty way around East Asia.",
"cables.the_previous_generation_still":"The previous generation. Still carries most of Pakistan, Sri Lanka and Bangladesh, held together with hope.",
"cables.the_sea_stallion_blackpool_to":"The Sea Stallion: Blackpool to Denmark, galloping round the north of Scotland.",
"cables.the_sequel_singapore_to_hong_kong":"The sequel: Singapore to Hong Kong, Taiwan, Japan and Korea, lit in 2025.",
"cables.the_seychelles_first_cable_to_tanzania":"The Seychelles’ first cable, to Tanzania, after years on satellite.",
"cables.the_straightest_line_across_the":"The straightest line across the Atlantic. Traders pay double to save a few milliseconds.",
"cables.the_upstart_s_own_cable_from":"The upstart's own cable from Cebu to Mindanao's north coast, then overland to Davao. Laid in a pandemic.",
"cables.tokyo_to_los_angeles_built_by":"Tokyo to Los Angeles, built by a search engine and five telcos holding hands.",
"cables.up_the_west_coast_of_africa":"Up the west coast of Africa. Something on it is always down.",
"cables.west_africa_s_first_big_cable":"West Africa’s first big cable, from Portugal to Cape Town. Old and wobbly, but still holding things up.",
@ -722,6 +725,7 @@
"cities.mexico_s_data_center_boom_town":"Mexico’s data center boom town, high and dry in the middle of the country. Every cloud wants a region here.",
"cities.mexico_s_industrial_capital_a_few":"Mexico’s industrial capital, a few hours from Texas. Factories, steel and grilled goat on weekends.",
"cities.mexico_s_silicon_valley_home_of":"Mexico’s Silicon Valley, home of mariachi and tequila. Chip design by day, music by night.",
"cities.mindanao_s_big_city_and_the":"Mindanao's big city and the Philippines' Pacific door: the trans-Pacific cables land here, south of the typhoon belt.",
"cities.morocco_s_business_capital_on_the":"Morocco’s business capital on the Atlantic, the gateway between Europe and West Africa.",
"cities.most_uae_cables_land_on_this":"Most UAE cables land on this coast, outside the Strait of Hormuz. Getting from here to Dubai means renting from the duopoly.",
"cities.mountains_mines_and_more_bars_per":"Mountains, mines and more bars per head than anywhere else in Brazil. Peering deals get signed over cheese bread.",
@ -794,6 +798,7 @@
"cities.the_old_gateway_to_eastern_europe":"The old gateway to Eastern Europe. Packets still bow politely on the way through.",
"cities.the_only_northeastern_capital_away":"The only northeastern capital away from the sea. Famously hot, with lightning storms that keep the surge protectors busy.",
"cities.the_pacific_gateway_the_andes_sit":"The Pacific gateway. The Andes sit between it and everything else, and the ground shakes now and then.",
"cities.the_philippines_second_city_reached":"The Philippines' second city, reached only by domestic cable. Typhoons pass through on their way north.",
"cities.the_prairie_gateway_between":"The prairie gateway between Vancouver and the rest of Canada. A chinook melts the snow in an afternoon, then it snows again.",
"cities.the_rhine_ruhr_hub_more_carrier":"The Rhine-Ruhr hub: more carrier-neutral data centers than Hamburg or Munich, and an hour from the Dutch border, so fiber to Amsterdam is short and cheap. Order an Altbier here, never a Kölsch.",
"cities.the_seychelles_capital_on_mah":"The Seychelles’ capital on Mahé: 115 islands, giant tortoises and two cables to the mainland.",
@ -2029,6 +2034,13 @@
"fiber_modals.you_need_a_fabric_port_at":"You need a fabric port at one of your POPs first. Open a POP's Infra tab and buy a port on {list}.",
"fiber_modals.your_own_trench_almost_no_rent":"Your own trench: almost no rent, but permits and digging take forever, and delays happen.",
"fiber_modals.your_pop_needs_a_fabric_port":"Your POP · needs a fabric port there",
"find.city_country_or_exchange":"City, country or exchange",
"find.find_a_city":"Find a city",
"find.find_a_city_slash":"Find a city (/)",
"find.no_city_matches_q":"No city matches “{q}”.",
"find.press_slash_to_search_from":"Tip: press <b>/</b> anywhere on the map to search.",
"find.type_a_city_a_country":"Type a city, a country or an exchange.",
"find.your_pop":"your POP",
"game_and_settings.delete_and_start_over":"Delete and start over",
"game_and_settings.export_save_download_a_file":"Export save <small>download a file</small>",
"game_and_settings.import_failed_that_save_is_damaged":"<b>Import failed.</b><br>That save is damaged and could not be loaded. Your current game is untouched.",
@ -2742,6 +2754,7 @@
"networks.philippine_giant_peering_requests":"Philippine giant. Peering requests are reviewed over a cup of tea.",
"networks.pink_eyeball_giant_peering_is":"Pink eyeball giant. Peering is available... for a monthly fee.",
"networks.pink_loud_and_almost_entirely_ipv6":"Pink, loud and almost entirely IPv6-only. Giggles at your IPv4-only CDN.",
"networks.pldtea_time_s_mobile_sibling_buy":"PLDTea Time's mobile sibling. Buy from the big one and you reach this one too.",
"networks.polite_enormous_and_sorry_about_the":"Polite, enormous, and sorry about the bill.",
"networks.portugal_s_incumbent_purrs_when_you":"Portugal’s incumbent. Purrs when you send it traffic.",
"networks.prepaid_mobile_from_paraguay_to":"Prepaid mobile from Paraguay to Guatemala, with a logo that roars.",
@ -2774,6 +2787,7 @@
"networks.the_biggest_network_in_china_its":"The biggest network in China. Its CN-Too premium route skips the congested border, for a price.",
"networks.the_cheapest_plan_in_the_country":"The cheapest plan in the country. Smells like a bargain.",
"networks.the_cloud_it_s_just_someone":"The cloud. It's just someone else's Ashburn.",
"networks.the_fiber_upstart_from_the_provinces":"The fiber upstart from the provinces that went its own way. Open to all.",
"networks.the_kingdom_s_incumbent_once_you":"The Kingdom’s incumbent. Once you are in, you stay in.",
"networks.the_largest_mobile_network_on_earth":"The largest mobile network on Earth. Paid peering only.",
"networks.the_national_carrier_every_punchline":"The national carrier. Every punchline is pre-approved.",
@ -2781,8 +2795,10 @@
"networks.the_other_half_of_the_duopoly":"The other half of the duopoly, on copper and fiber. Strictly domestic: the world reaches it through its wholesale arm.",
"networks.the_other_half_of_the_uae":"The other half of the UAE duopoly. Does what Etis-a-lot does, in a different colour.",
"networks.the_phone_company_s_favourite_child":"The phone company’s favourite child. A hundred million phones behind it, and your peering request has been “under review” since 1996.",
"networks.the_third_mobile_network_same_towers":"The third mobile network: the same again, but newer. Peers openly to catch up.",
"networks.the_tier_1_that_grew_up":"The Tier 1 that grew up in Sicily. Its Seabone backbone owns the Mediterranean and reaches deep into the Americas, and it still calls Palermo home.",
"networks.ukraine_s_biggest_mobile_network_has":"Ukraine’s biggest mobile network. Has kept working through things most networks never have to plan for.",
"networks.up_early_in_cebu_and_already":"Up early in Cebu and already peering across Asia and Europe. Open to all.",
"networks.updates_so_many_updates":"Updates. So many updates.",
"networks.uruguay_s_state_telco_fast":"Uruguay’s state telco. Fast, everywhere, and a little proud of it.",
"networks.vietnam_s_giant_will_tell_you":"Vietnam’s giant. Will tell you which subsea cable is broken this week.",
@ -2793,6 +2809,7 @@
"notifications.n_min_ago":{"one":"{n} min ago","other":"{n} min ago"},
"notifications.nothing_in_the_last_10_minutes":"Nothing in the last 10 minutes.",
"notifications.show_all_n":"Show all {n}",
"ops.already_connected":"Already connected",
"ops.annie":"Annie",
"ops.annie_d":"Answers from whichever desk is closest. Loves a cheap port and a full IX.",
"ops.anycast_annie":"Anycast Annie",
@ -3323,6 +3340,7 @@
"rival_exchanges.dense_filling_and_very_cheap":"Dense, filling and very cheap.",
"rival_exchanges.every_session_comes_with_a_coffee":"Every session comes with a coffee break. Strictly enforced.",
"rival_exchanges.grilled_ports_served_with_mustard":"Grilled ports, served with mustard and a cold beer.",
"rival_exchanges.grown_in_a_lab_by_the":"Grown in a lab by the incumbent. Its own family is on it; everyone else pays to watch.",
"rival_exchanges.layered_resilient_and_somehow_always":"Layered, resilient and somehow always open.",
"rival_exchanges.lots_of_small_sessions_on_little":"Lots of small sessions on little plates.",
"rival_exchanges.member_owned_and_not_for_profit":"Member-owned and not-for-profit. Smaller than LYNX, but the AGM has biscuits.",
@ -3340,6 +3358,7 @@
"rival_exchanges.the_challenger_to_the_de_kicks":"The challenger to the DE-KICKS fabric, wrapped and ready to go.",
"rival_exchanges.the_long_established_madrid_exchange":"The long-established Madrid exchange. Neutral interconnection, local flavour and a route server that never takes a siesta.",
"rival_exchanges.the_older_johannesburg_exchange_run":"The older Johannesburg exchange, run by the local ISP association. Knock on wood before every maintenance window.",
"rival_exchanges.the_whole_neighbourhood_carries_the":"The whole neighbourhood carries the house together. Free to join, run with the government's blessing.",
"rival_exchanges.tokyo_has_more_exchanges_than_anyone":"Tokyo has more exchanges than anyone can name. This one was started by a broadband giant and comes neatly packed, every member in its own compartment.",
"rival_exchanges.warsaw_has_more_exchanges_than":"Warsaw has more exchanges than anyone can count. This is the second biggest, this week.",
"rival_exchanges.you_can_t_see_the_fabric":"You can’t see the fabric, but it is definitely there.",

View file

@ -117,6 +117,7 @@
<button class="chip noc" id="hNoc" data-act="leftTab" data-args='{"t":"noc"}'><span class="lbl">NOC</span><span class="val num" id="hNocVal" data-i18n="common.all_quiet">All quiet</span><span class="badge" id="hNocNew" hidden></span></button>
<div class="spacer"></div>
<div class="chip"><div class="lbl" data-i18n="common.date">Date</div><div class="val num" id="hDate">Y1 · Jan 1</div></div>
<button class="chip find" data-act="findOpen" aria-label="Find a city" data-i18n-aria-label="find.find_a_city" title="Find a city (/)" data-i18n-title="find.find_a_city_slash"><span aria-hidden="true">🔍</span></button>
<div class="chip speed" role="group" aria-label="Game speed" data-i18n-aria-label="common.game_speed">
<button data-act="speed" data-args='{"v":0}' id="sp0" aria-label="Pause" data-i18n-aria-label="common.pause">❚❚</button>
<button data-act="speed" data-args='{"v":0.5}' id="sp0.5" aria-label="Half speed" data-i18n-aria-label="common.half_speed">½×</button>

View file

@ -29,3 +29,5 @@
.minibar{height:6px;border-radius:4px;background:var(--line);overflow:hidden;margin-top:2px;width:100%}
.minibar i{display:block;height:100%;background:var(--ok)}
/* Find a city: a square chip with just the magnifier. */
#hud .chip.find{justify-content:center;align-items:center;padding:0;width:44px;min-width:44px;font-size:19px;cursor:pointer}

View file

@ -196,3 +196,9 @@ h2 .rn{font-size:18px;vertical-align:middle;padding:2px 4px}
.menu-links .lnk{background:none;border:0;padding:4px 2px;font-weight:700;font-size:14px;font-family:inherit;color:var(--ink2);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.menu-plugs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.mplug{border:2px solid var(--line);border-radius:12px;padding:8px 10px;font-weight:700;font-size:13px;line-height:1.25;color:var(--ink);text-decoration:none;background:var(--soft);display:flex;align-items:center}
/* Find a city: big tap targets, the first result (what Enter picks) highlighted. */
.findlist{margin-top:8px}
.findrow{width:100%;text-align:left;background:none;border:0;border-top:1px solid var(--line);font:inherit;color:var(--ink);min-height:48px;padding:6px 8px;cursor:pointer;border-radius:0}
.findrow .nm,.findrow .meta{display:block}
.findrow.on{background:var(--soft);border-radius:10px}
.findrow:hover{background:var(--soft)}

View file

@ -36,3 +36,8 @@
.chip{padding:2px 7px}
}
/* Narrow tablets: a slim find chip and slimmer speed buttons keep the HUD on one row. */
@media (min-width:761px) and (max-width:860px){
#hud .chip.find{width:32px;min-width:32px;font-size:15px}
.speed button{min-width:23px;padding-left:2px;padding-right:2px}
}

View file

@ -119,3 +119,5 @@ button,.chip,.b,a{touch-action:manipulation;-webkit-tap-highlight-color:transpar
}
@media (prefers-reduced-motion:reduce){:root:not(.anim-force) *{animation:none !important;transition:none !important}}
:root.no-anim *{animation:none !important;transition:none !important}
/* The narrowest phones: a slimmer find chip so the date still fits. */
@media (max-width:340px){#hud .chip.find{width:34px;min-width:34px;font-size:15px}#hud .menubtn .caret{display:none}}