Merge remote-tracking branch 'origin/main' into claude/noc-open
# Conflicts: # CHANGELOG.md
This commit is contained in:
commit
2c60af18cc
16 changed files with 84 additions and 14 deletions
|
|
@ -7,6 +7,9 @@ All notable changes to this project are documented here. The project follows
|
|||
## [Unreleased]
|
||||
|
||||
- The chaos monkey's notice in the NOC no longer has an Open button that did nothing; the monkey's own card is right above it (#226).
|
||||
- The puzzle list counts each section's own stars: architect runs show theirs next to their title, and the pack total now sits right above the packs, the stars that unlock the next one (#231).
|
||||
- The intern's notes now name the exchanges it peered at: a city's first exchange showed as the city, so "Apfelwein-IX, London" really meant Apfelwein-IX and LYNX (#228).
|
||||
- Cancelling an IRU, giving up your own fiber or decommissioning a POP now puts the optics on its fibers back on the spares shelf, instead of throwing them away (#229).
|
||||
- Big networks freeze for less on every game day and every click: working out where traffic goes skips exits whose route is already full, so a game day takes about 40% less time (#210). Traffic goes exactly where it went before.
|
||||
- Premium submarine terminals and Optical engineering can no longer be bought on a cable where they would change nothing (#198). The button now says so, and an upgrade that only helps together with the other one stays available.
|
||||
- A wave size that is sold out on a route can no longer be reached by upgrading a smaller wave on it (#201). The upgrade button says how long it is sold out, just like when buying.
|
||||
|
|
|
|||
|
|
@ -2447,6 +2447,7 @@
|
|||
"links.fabric_port_in_city_is_full":"<b>Fabric-Port in {city} ist voll.</b>",
|
||||
"links.fixed_what_resolved_early":"<b>Repariert.</b> {what} vorzeitig behoben.",
|
||||
"links.ix_now_runs_a_fab_fabric":"<b>{ix} betreibt jetzt eine {fab}-Fabric.</b><br>Platz für {max} Mitglieder. Rechne mit ein paar weiteren Beitritten.",
|
||||
"links.n_optic_back_on_the_spares_shelf":{"one":"{n} Optik ist zurück im Ersatzteilregal","other":"{n} Optiken sind zurück im Ersatzteilregal"},
|
||||
"links.name_is_called_off_the_cable":"<b>{name} ist abgesagt.</b><br>Die Kabelfabrik nimmt das Glas zurück, das niemand braucht: {price} zurück.",
|
||||
"links.no_cable_available_for_that_route":"<b>Für diese Route ist gerade kein Kabel verfügbar.</b>",
|
||||
"links.no_wave_capacity_on_this_route":"<b>Auf dieser Route gerade keine {wave}-Kapazität.</b><br>{why} Versuch eine kleinere Wave, eine andere Route oder frag in {n} Tagen nochmal.",
|
||||
|
|
@ -3147,6 +3148,7 @@
|
|||
"puzzles.small_networks_real_traffic":"Kleine Netze, echter Traffic",
|
||||
"puzzles.spent_x":"Ausgegeben {x}",
|
||||
"puzzles.spent_x_of_y":"Ausgegeben {x} / {y}",
|
||||
"puzzles.stars_from_the_packs":"Sterne aus den Paketen",
|
||||
"puzzles.stepping_stone_optional":"Trittstein (optional)",
|
||||
"puzzles.suez_you_later":"Suez bald",
|
||||
"puzzles.survive_any_single_cut_with_the":"Überleb jeden einzelnen Schnitt, und der Traffic fließt weiter. Verbunden sein reicht nicht.",
|
||||
|
|
@ -3172,7 +3174,6 @@
|
|||
"puzzles.with_the_pop_price":"mit POP: {price}",
|
||||
"puzzles.your_pop":"Dein POP",
|
||||
"puzzles.your_routers_pick_the_path":"Deine Router wählen den Weg. Sag ihnen welchen: Metriken, niedrigste Latenz, Best Effort.",
|
||||
"puzzles.your_stars":"Deine Sterne",
|
||||
"puzzles.your_stars_so_far":"Deine Sterne bisher",
|
||||
"puzzles_weekly.detour":"Umleitung",
|
||||
"puzzles_weekly.island_hopping":"Inselhüpfen",
|
||||
|
|
|
|||
|
|
@ -2445,6 +2445,7 @@
|
|||
"links.fabric_port_in_city_is_full":"<b>El puerto de fabric en {city} está lleno.</b>",
|
||||
"links.fixed_what_resolved_early":"<b>Arreglado.</b> {what} se resolvió antes.",
|
||||
"links.ix_now_runs_a_fab_fabric":"<b>{ix} ahora tiene una fabric {fab}.</b><br>Hay sitio para {max} miembros. Espera que se unan algunos más.",
|
||||
"links.n_optic_back_on_the_spares_shelf":{"one":"{n} óptica volvió al estante de repuestos","other":"{n} ópticas volvieron al estante de repuestos"},
|
||||
"links.name_is_called_off_the_cable":"<b>{name} se cancela.</b><br>La fábrica de cables recupera el vidrio que nadie necesita: te devuelve {price}.",
|
||||
"links.no_cable_available_for_that_route":"<b>Ahora mismo no hay cable disponible para esa ruta.</b>",
|
||||
"links.no_wave_capacity_on_this_route":"<b>Ahora no hay capacidad de {wave} en esta ruta.</b><br>{why} Prueba una onda menor, otra ruta, o vuelve a preguntar en {n} días.",
|
||||
|
|
@ -3145,6 +3146,7 @@
|
|||
"puzzles.small_networks_real_traffic":"Redes pequeñas, tráfico de verdad",
|
||||
"puzzles.spent_x":"Gastado {x}",
|
||||
"puzzles.spent_x_of_y":"Gastado {x} / {y}",
|
||||
"puzzles.stars_from_the_packs":"Estrellas de los packs",
|
||||
"puzzles.stepping_stone_optional":"Escala (opcional)",
|
||||
"puzzles.suez_you_later":"Suez luego",
|
||||
"puzzles.survive_any_single_cut_with_the":"Sobrevive a cualquier corte, con el tráfico todavía fluyendo. Estar conectado no basta.",
|
||||
|
|
@ -3170,7 +3172,6 @@
|
|||
"puzzles.with_the_pop_price":"con el POP: {price}",
|
||||
"puzzles.your_pop":"Tu POP",
|
||||
"puzzles.your_routers_pick_the_path":"Tus routers eligen el camino. Diles cuál: métricas, menor latencia, best effort.",
|
||||
"puzzles.your_stars":"Tus estrellas",
|
||||
"puzzles.your_stars_so_far":"Tus estrellas hasta ahora",
|
||||
"puzzles_weekly.detour":"Desvío",
|
||||
"puzzles_weekly.island_hopping":"De isla en isla",
|
||||
|
|
|
|||
|
|
@ -2445,6 +2445,7 @@
|
|||
"links.fabric_port_in_city_is_full":"<b>Le port fabric de {city} est plein.</b>",
|
||||
"links.fixed_what_resolved_early":"<b>Réparé.</b> {what} : résolu en avance.",
|
||||
"links.ix_now_runs_a_fab_fabric":"<b>{ix} tourne maintenant sur un fabric {fab}.</b><br>De la place pour {max} membres. Attends-toi à quelques nouveaux venus.",
|
||||
"links.n_optic_back_on_the_spares_shelf":{"one":"{n} optique est retournée sur l’étagère de rechange","other":"{n} optiques sont retournées sur l’étagère de rechange"},
|
||||
"links.name_is_called_off_the_cable":"<b>{name} est annulé.</b><br>L’usine de câbles reprend le verre dont personne n’a besoin : {price} remboursés.",
|
||||
"links.no_cable_available_for_that_route":"<b>Aucun câble disponible pour cette route pour l’instant.</b>",
|
||||
"links.no_wave_capacity_on_this_route":"<b>Plus de capacité {wave} sur cette route pour l’instant.</b><br>{why} Essayez une onde plus petite, une autre route, ou redemandez dans {n} jours.",
|
||||
|
|
@ -3145,6 +3146,7 @@
|
|||
"puzzles.small_networks_real_traffic":"Petits réseaux, vrai trafic",
|
||||
"puzzles.spent_x":"Dépensé {x}",
|
||||
"puzzles.spent_x_of_y":"Dépensé {x} / {y}",
|
||||
"puzzles.stars_from_the_packs":"Étoiles des packs",
|
||||
"puzzles.stepping_stone_optional":"Escale (facultative)",
|
||||
"puzzles.suez_you_later":"Suez la prochaine",
|
||||
"puzzles.survive_any_single_cut_with_the":"Survis à n'importe quelle coupure, avec le trafic qui passe toujours. Être connecté ne suffit pas.",
|
||||
|
|
@ -3170,7 +3172,6 @@
|
|||
"puzzles.with_the_pop_price":"avec le POP : {price}",
|
||||
"puzzles.your_pop":"Ton POP",
|
||||
"puzzles.your_routers_pick_the_path":"Tes routeurs choisissent le chemin. Dis-leur lequel : métriques, latence minimale, best effort.",
|
||||
"puzzles.your_stars":"Tes étoiles",
|
||||
"puzzles.your_stars_so_far":"Tes étoiles pour l'instant",
|
||||
"puzzles_weekly.detour":"Détour",
|
||||
"puzzles_weekly.island_hopping":"Saut d’île en île",
|
||||
|
|
|
|||
|
|
@ -2445,6 +2445,7 @@
|
|||
"links.fabric_port_in_city_is_full":"<b>La porta fabric a {city} è piena.</b>",
|
||||
"links.fixed_what_resolved_early":"<b>Sistemato.</b> {what}: risolto in anticipo.",
|
||||
"links.ix_now_runs_a_fab_fabric":"<b>{ix} ora gira su un fabric {fab}.</b><br>Spazio per {max} membri. Aspettati qualche nuovo arrivo.",
|
||||
"links.n_optic_back_on_the_spares_shelf":{"one":"{n} ottica è tornata sullo scaffale dei ricambi","other":"{n} ottiche sono tornate sullo scaffale dei ricambi"},
|
||||
"links.name_is_called_off_the_cable":"<b>{name} è annullato.</b><br>La fabbrica di cavi si riprende il vetro che non serve a nessuno: {price} indietro.",
|
||||
"links.no_cable_available_for_that_route":"<b>Al momento non c’è nessun cavo disponibile per quella tratta.</b>",
|
||||
"links.no_wave_capacity_on_this_route":"<b>Nessuna capacità {wave} su questa tratta al momento.</b><br>{why} Prova un’onda più piccola, un’altra tratta, o chiedi di nuovo tra {n} giorni.",
|
||||
|
|
@ -3145,6 +3146,7 @@
|
|||
"puzzles.small_networks_real_traffic":"Reti piccole, traffico vero",
|
||||
"puzzles.spent_x":"Speso {x}",
|
||||
"puzzles.spent_x_of_y":"Speso {x} / {y}",
|
||||
"puzzles.stars_from_the_packs":"Stelle dai pacchetti",
|
||||
"puzzles.stepping_stone_optional":"Tappa (facoltativa)",
|
||||
"puzzles.suez_you_later":"Suez la prossima",
|
||||
"puzzles.survive_any_single_cut_with_the":"Sopravvivi a qualsiasi taglio, con il traffico che scorre ancora. Essere collegati non basta.",
|
||||
|
|
@ -3170,7 +3172,6 @@
|
|||
"puzzles.with_the_pop_price":"con il POP: {price}",
|
||||
"puzzles.your_pop":"Il tuo POP",
|
||||
"puzzles.your_routers_pick_the_path":"I tuoi router scelgono il percorso. Digli quale: metriche, latenza minima, best effort.",
|
||||
"puzzles.your_stars":"Le tue stelle",
|
||||
"puzzles.your_stars_so_far":"Le tue stelle finora",
|
||||
"puzzles_weekly.detour":"Deviazione",
|
||||
"puzzles_weekly.island_hopping":"Di isola in isola",
|
||||
|
|
|
|||
|
|
@ -2445,6 +2445,7 @@
|
|||
"links.fabric_port_in_city_is_full":"<b>A porta de fabric em {city} está cheia.</b>",
|
||||
"links.fixed_what_resolved_early":"<b>Resolvido.</b> {what}: resolvido antes da hora.",
|
||||
"links.ix_now_runs_a_fab_fabric":"<b>{ix} agora roda num fabric {fab}.</b><br>Espaço para {max} membros. Espere mais alguns chegarem.",
|
||||
"links.n_optic_back_on_the_spares_shelf":{"one":"{n} óptico voltou para a prateleira de reservas","other":"{n} ópticos voltaram para a prateleira de reservas"},
|
||||
"links.name_is_called_off_the_cable":"<b>{name} foi cancelado.</b><br>A fábrica de cabos pega de volta o vidro que ninguém precisa: {price} de volta.",
|
||||
"links.no_cable_available_for_that_route":"<b>Nenhum cabo disponível para essa rota agora.</b>",
|
||||
"links.no_wave_capacity_on_this_route":"<b>Sem capacidade de {wave} nesta rota agora.</b><br>{why} Tente uma onda menor, outra rota, ou pergunte de novo em {n} dias.",
|
||||
|
|
@ -3145,6 +3146,7 @@
|
|||
"puzzles.small_networks_real_traffic":"Redes pequenas, tráfego de verdade",
|
||||
"puzzles.spent_x":"Gasto {x}",
|
||||
"puzzles.spent_x_of_y":"Gasto {x} / {y}",
|
||||
"puzzles.stars_from_the_packs":"Estrelas dos pacotes",
|
||||
"puzzles.stepping_stone_optional":"Escala (opcional)",
|
||||
"puzzles.suez_you_later":"Suez mais tarde",
|
||||
"puzzles.survive_any_single_cut_with_the":"Sobreviva a qualquer corte, com o tráfego ainda fluindo. Estar conectado não basta.",
|
||||
|
|
@ -3170,7 +3172,6 @@
|
|||
"puzzles.with_the_pop_price":"com o POP: {price}",
|
||||
"puzzles.your_pop":"Seu POP",
|
||||
"puzzles.your_routers_pick_the_path":"Seus routers escolhem o caminho. Diga qual: métricas, menor latência, best effort.",
|
||||
"puzzles.your_stars":"Suas estrelas",
|
||||
"puzzles.your_stars_so_far":"Suas estrelas até agora",
|
||||
"puzzles_weekly.detour":"Desvio",
|
||||
"puzzles_weekly.island_hopping":"De ilha em ilha",
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ const opsWkNew=w=>({w,i:S.ops.intern,n:{},wh:{},up:0,mo:0,rev:0,ff:0});
|
|||
const opsWkAny=x=>!!x&&(Object.keys(x.n).length>0||x.ff>0);
|
||||
// "Kevin's week: signed 3 customers (+$41k/mo), topped up transit 2 times (Frankfurt +1×100G), declined 17 tiny offers. Week total: …"
|
||||
function opsWeekLine(x){const I=INTERNS[x.i],name=I?tr(I.s):'',ks=Object.keys(x.n).sort((a,b)=>(a==='sales'?-1:b==='sales'?1:0)||(a==='broke')-(b==='broke'));
|
||||
const parts=ks.map(k=>k==='sales'?trn('ops.w_sales',x.n[k],{rev:opsMo$(x.rev)}):trn(OPS_SAY[k],x.n[k],{where:(x.wh[k]||[]).map(opsWhere).join(', ')}));
|
||||
const parts=ks.map(k=>k==='sales'?trn('ops.w_sales',x.n[k],{rev:opsMo$(x.rev)}):trn(OPS_SAY[k],x.n[k],{where:(x.wh[k]||[]).map(w=>opsWhere(w,k)).join(', ')}));
|
||||
if(x.ff)parts.push(trn('ops.w_oops',x.ff));
|
||||
return tr('ops.w_line',{name,list:parts.join(', ')})+(x.up||x.mo?' '+tr('ops.w_money',{cost:fmt$(x.up),mo:opsMo$(x.mo)}):'');}
|
||||
// The intern's mood, from what the week has been like. No dice: the same day always reads the same.
|
||||
|
|
@ -77,8 +77,9 @@ function opsMood(){const O=S.ops,x=O.wk&&O.wk.w===Math.floor(S.day/7)?O.wk:null,
|
|||
return tr({new:N_('ops.mood_new'),oops:N_('ops.mood_oops'),snag:N_('ops.mood_snag'),outage:N_('ops.mood_outage'),sales:N_('ops.mood_sales'),broke:N_('ops.mood_broke'),busy:N_('ops.mood_busy'),quiet:N_('ops.mood_quiet'),
|
||||
annie:N_('ops.mood_annie'),kevin:N_('ops.mood_kevin'),tracy:N_('ops.mood_tracy')}[k],{name:opsName()});}
|
||||
// "fra +1×100G", "fra|ams", "ams~3", "transit" (an order, for the budget line) or "ggl" (a network).
|
||||
function opsWhere(w){const [a,x]=w.split(' '),nm=a.split('|').map(p=>own(OPSK,p)?tr(OPSK[p].t):isCity(p)?CITY[p].name:isNet(p)?NET[p].name:ixName(p)).join('–');return x?nm+' '+(isNet(x)?NET[x].name:x):nm;}
|
||||
function opsLine(e){const I=INTERNS[e.i],name=I?tr(I.s):'',parts=e.r.map(([k,n,w])=>trn(OPS_SAY[k],n,{where:w.map(opsWhere).join(', ')}));
|
||||
// Peering is always at an exchange, and a city's first exchange has the city's id ("lon" is LYNX): name the exchange (#228).
|
||||
function opsWhere(w,k){if(k==='peer'&&isIx(w)&&ixName(w))return ixName(w);const [a,x]=w.split(' '),nm=a.split('|').map(p=>own(OPSK,p)?tr(OPSK[p].t):isCity(p)?CITY[p].name:isNet(p)?NET[p].name:ixName(p)).join('–');return x?nm+' '+(isNet(x)?NET[x].name:x):nm;}
|
||||
function opsLine(e){const I=INTERNS[e.i],name=I?tr(I.s):'',parts=e.r.map(([k,n,w])=>trn(OPS_SAY[k],n,{where:w.map(x=>opsWhere(x,k)).join(', ')}));
|
||||
return (parts.length?tr('ops.l_line',{name,list:parts.join(', ')}):tr('ops.l_quiet',{name}))+opsPaid(e);}
|
||||
const opsMo$=v=>(v>0?'+':'')+fmt$(v);
|
||||
const opsPaid=e=>e.up||e.mo?' '+tr('ops.l_paid',{cost:fmt$(e.up||0),mo:opsMo$(e.mo||0)}):'';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ Object.assign(ACT,{
|
|||
decomOpen:({city})=>{UI.decom=new Set(city&&S.pops[city]?[city]:[]);decomModal();},
|
||||
decomToggle:({city})=>{if(!S.pops[city])return;UI.decom=UI.decom||new Set();if(UI.decom.has(city))UI.decom.delete(city);else UI.decom.add(city);decomModal();},
|
||||
decomGo:()=>{const sel=[...(UI.decom||[])].filter(c=>S.pops[c]);if(!sel.length||sel.length>=Object.keys(S.pops).length)return;closeModal();UI.decom=null;UI.sel=null;decommission(sel);sfx('alert');after();},
|
||||
rmLink:({id})=>{if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}{const l=S.links.find(x=>x.id===id),back=cabBack(l);if(back>0){S.cash+=back;toast(tr('links.name_is_called_off_the_cable',{name:esc(l.cname||tr('common.your_cable')),price:fmt$(back)}),'good');}}S.links=S.links.filter(l=>l.id!==id);prunePairMet();UI.sel=null;UI.confirm=null;after();},
|
||||
rmLink:({id})=>{if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}{const l=S.links.find(x=>x.id===id),back=cabBack(l);if(back>0){S.cash+=back;toast(tr('links.name_is_called_off_the_cable',{name:esc(l.cname||tr('common.your_cable')),price:fmt$(back)}),'good');}
|
||||
const n=chBack(l?[l]:[]);if(n)toast(trn('links.n_optic_back_on_the_spares_shelf',n),'good');}S.links=S.links.filter(l=>l.id!==id);prunePairMet();UI.sel=null;UI.confirm=null;after();},
|
||||
// The chaos monkey takes a banana and goes home early (no bonus).
|
||||
mkBanana:()=>{if(!mkOn())return;if(!spend(mkBananaCost()))return;S.stats.bananas=(S.stats.bananas||0)+1;mkLeave('banana');track('monkey_banana');after();},
|
||||
fixInc:({id})=>{const i=S.inc.find(x=>x.id===id);if(!i||!(i.cost>0))return;if(i.slow&&i.rushed)return;if(!spend(i.cost))return;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ function dfAllowed(a,b){if(isSub(a,b))return !!subDfCable(a,b);return cnCity(a)=
|
|||
/* Optics you unplug go on a spares shelf instead of in the bin (#45): the next channel of that type uses a spare
|
||||
for free (only the regen sites' transponders are new), or you sell it on eBuy for part of the price. */
|
||||
const SPARE_RESALE=0.4,spareN=o=>(S&&S.spares&&S.spares[o])|0,spareValue=o=>Math.round(optCost(o)*SPARE_RESALE);
|
||||
// A fiber given up (a cancelled IRU, a cable called off, a decommissioned POP) keeps its optics: they go on the shelf too (#229).
|
||||
const chBack=links=>{let n=0;for(const l of links)for(const o of (l&&l.ch)||[])if(OPT[o]){S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)+1;n++;}return n;};
|
||||
function chCost(l,o){const r=REGEN_CH*(l.regen|0);return Math.round(optCost(o)*(spareN(o)>0?r:1+r));}
|
||||
function optCost(o){return Math.round(OPT[o].cost*techMul(OPT[o].lvl)*hwMul('opt')*(S&&S.ev&&S.ev.tariff>S.day?1.4:1));}
|
||||
// Line systems upgrade in place: Rainbow → ROADMaster → C+L. Every lit pair gets the new gear.
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ function decomModal(){const sel=[...(UI.decom||[])],im=decomImpact(sel),all=Obje
|
|||
${left<1?`<p class="why">${tr('decommission.keep_at_least_one_pop')}</p>`:''}
|
||||
<div class="btns" style="margin-top:10px">${btn(sel.length?trn('decommission.decommission_n_pop_pay_fee',sel.length,{fee:fmt$(im.fee)}):tr('decommission.pick_a_pop'),'decomGo',{},'red',!sel.length||left<1)}${btn(tr('common.keep_them'),'closeModal',{},'ghost')}</div>`);}
|
||||
function decommission(cities){const set=new Set(cities),im=decomImpact(cities),lids=new Set(im.links.map(l=>l.id)),bids=new Set(im.biz.map(b=>b.id));
|
||||
S.links=S.links.filter(l=>!lids.has(l.id));prunePairMet();S.biz=S.biz.filter(b=>!bids.has(b.id));S.offers=S.offers.filter(o=>!bCities(o).some(c=>set.has(c)));
|
||||
const back=chBack(im.links);S.links=S.links.filter(l=>!lids.has(l.id));prunePairMet();S.biz=S.biz.filter(b=>!bids.has(b.id));S.offers=S.offers.filter(o=>!bCities(o).some(c=>set.has(c)));
|
||||
S.transit=S.transit.filter(t=>!set.has(t.city));S.pni=S.pni.filter(x=>!set.has(x.city));S.caches=S.caches.filter(x=>!set.has(x.city));S.nni=(S.nni||[]).filter(x=>!set.has(x.city));
|
||||
for(const c of cities){for(const x of ixIdsIn(c)){delete S.ixp[x];delete S.rs[x];if(S.ixn)delete S.ixn[x];if(S.ixSite)delete S.ixSite[x];for(const k in S.peers)if(k.endsWith('@'+x))delete S.peers[k];}delete S.myIx[c];S.scrubs=S.scrubs.filter(x=>x.city!==c);if(S.ops)delete S.ops.skip[c];delete S.pops[c];}
|
||||
const rem=remoteCities();for(const x in S.ixp){const c=ixCity(x);if(!S.pops[c]&&!rem.includes(c)){delete S.ixp[x];delete S.rs[x];for(const k in S.peers)if(k.endsWith('@'+x))delete S.peers[k];}}
|
||||
if(set.has(S.home))S.home=Object.keys(S.pops)[0];
|
||||
purgeInc();S.cash-=im.fee;S.stats.decom=(S.stats.decom||0)+cities.length;
|
||||
toast(trn('decommission.n_pop_decommissioned_fee_in_early',cities.length,{fee:fmt$(im.fee),m:im.biz.length}),'bad');}
|
||||
toast(trn('decommission.n_pop_decommissioned_fee_in_early',cities.length,{fee:fmt$(im.fee),m:im.biz.length}),'bad');if(back)toast(trn('links.n_optic_back_on_the_spares_shelf',back),'good');}
|
||||
|
|
|
|||
|
|
@ -128,10 +128,11 @@ function pzMenu(){pzWkEnsure();const p=pzLoad(),tot=pzStarsTotal(p),max=PZ.lengt
|
|||
<p class="tagline">${tr('puzzles.no_clock_no_bills_real_traffic')}</p>`;
|
||||
// Once, after the puzzles got traffic: the old stars are kept on the wall, the new set starts at zero.
|
||||
if(p.old&&!p.noted){h+=`<div class="pznote">🖼️ ${tr('puzzles.puzzles_got_traffic_note',{n:p.old})}</div>`;p.noted=1;pzStore(p);}
|
||||
h+=`<div class="pzprog"><div class="kv"><span>${tr('puzzles.your_stars')}</span><b>⭐ ${tot} / ${max}</b></div><div class="bar me"><i style="width:${(tot/max*100).toFixed(1)}%"></i></div>${nxP?`<div class="meta">${tr('puzzles.next_pack_unlocks_at_n',{n:nxP.need,pack:esc(nxP.n)})}</div>`:''}${p.old?`<div class="meta">🖼️ ${tr('puzzles.framed_n_stars_from_the_old',{n:p.old})}</div>`:''}</div>`;
|
||||
if(pzOn())h+=`<div class="btns" style="margin:8px 0">${(UI.pzTop||0)>0&&(UI.pzTop||0)<3?btn(tr('puzzles.finish_here'),'pzFinish',{},'sm'):''}${btn(UI.pzFrom==='game'?tr('puzzles.back_to_my_network'):tr('puzzles.back_to_the_title'),'pzLeave',{},'')}${btn(tr('puzzles.keep_building'),'closeModal',{},'ghost')}</div>`;
|
||||
h+=arMenuRows();
|
||||
h+=pzWkRow();
|
||||
// The packs' own total, right above them: it is what unlocks the next pack (#231). Runs and weeklies count their own.
|
||||
h+=`<div class="pzprog"><div class="kv"><span>${tr('puzzles.stars_from_the_packs')}</span><b>⭐ ${tot} / ${max}</b></div><div class="bar me"><i style="width:${(tot/max*100).toFixed(1)}%"></i></div>${nxP?`<div class="meta">${tr('puzzles.next_pack_unlocks_at_n',{n:nxP.need,pack:esc(nxP.n)})}</div>`:''}${p.old?`<div class="meta">🖼️ ${tr('puzzles.framed_n_stars_from_the_old',{n:p.old})}</div>`:''}</div>`;
|
||||
for(const pk of PZ_PACKS){const open=tot>=pk.need,got=PZ.filter(x=>x.pack===pk.id).reduce((a,x)=>a+((p.s[x.id]||{}).st|0),0),n=PZ.filter(x=>x.pack===pk.id).length;
|
||||
h+=`<h3 class="pzpack">${open?'':'🔒 '}${esc(pk.n)} <span class="meta">⭐ ${got}/${n*3}</span></h3><p class="meta" style="margin:0 0 2px">${open?esc(pk.d):tr('puzzles.unlocks_at_n_stars',{n:pk.need})}</p>`;
|
||||
for(const d of PZ.filter(x=>x.pack===pk.id)){const r=p.s[d.id],tg=pzDemTag(d);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ function arResults(done){const A=S.ar,run=arRun(),sp=arSpend(),br=done?run.brief
|
|||
<div class="btns cta" style="margin-top:12px">${nx&&done?btn(tr('architect.next_run')+' →','pzArStart',{id:nx.id},'pink big'):btn(tr('puzzles.more_puzzles'),'puzzleMenu',{},'pink big')}${btn(tr('architect.try_again'),'pzRetry',{},'')}${done?btn(tr('common.share_2cd9'),'pzShare',{},'ghost'):btn(tr('architect.keep_going'),'closeModal',{},'ghost')}</div></div>`);
|
||||
for(let i=0;i<st;i++)setTimeout(()=>{sfx('star');haptic(15);},i*450+150);if(st>=3)setTimeout(()=>sfx('fanfare'),3*450+250);}
|
||||
// ---------- the list ----------
|
||||
function arMenuRows(){const p=arLoad();let h=`<h3 class="pzpack">🏗️ ${tr('architect.architect_runs')} <span class="pznew">${tr('architect.new')}</span></h3><p class="meta" style="margin:0 0 2px">${tr('architect.runs_lead')}</p>`;arWkEnsure();h+=arWkRow();
|
||||
function arMenuRows(){const p=arLoad(),got=AR_RUNS.reduce((a,r)=>a+((p.runs[r.id]||{}).st|0),0);let h=`<h3 class="pzpack">🏗️ ${tr('architect.architect_runs')} <span class="meta">⭐ ${got}/${AR_RUNS.length*3}</span> <span class="pznew">${tr('architect.new')}</span></h3><p class="meta" style="margin:0 0 2px">${tr('architect.runs_lead')}</p>`;arWkEnsure();h+=arWkRow();
|
||||
for(const r of AR_RUNS){const x=p.runs[r.id];
|
||||
h+=`<div class="scn"><div class="grow"><div class="nm">${esc(r.n)} <span class="pzst">${pzStarStr(x?x.st:0)}</span></div><div class="meta">${esc(r.j)}</div><div class="meta">${tr('architect.n_briefs',{n:r.briefs.length})} · 🏠 ${esc(CITY[r.hq].name)}${' · '+tr('puzzles.budget_x',{x:fmt$(r.budget)})}${x&&x.sp!=null?' · '+tr('puzzles.best_x',{x:fmt$(x.sp)}):x&&x.br?' · '+tr('architect.best_n_briefs',{n:x.br}):''}</div></div>${btn(tr('common.play'),'pzArStart',{id:r.id},x&&x.st>=3?'ghost':'pink')}</div>`;}
|
||||
return h;}
|
||||
|
|
|
|||
|
|
@ -2446,6 +2446,7 @@
|
|||
"links.fabric_port_in_city_is_full":"<b>Fabric port in {city} is full.</b>",
|
||||
"links.fixed_what_resolved_early":"<b>Fixed.</b> {what} resolved early.",
|
||||
"links.ix_now_runs_a_fab_fabric":"<b>{ix} now runs a {fab} fabric.</b><br>Room for {max} members. Expect a few more to join.",
|
||||
"links.n_optic_back_on_the_spares_shelf":{"one":"{n} optic went back on the spares shelf","other":"{n} optics went back on the spares shelf"},
|
||||
"links.name_is_called_off_the_cable":"<b>{name} is called off.</b><br>The cable factory takes back the glass nobody needs: {price} back.",
|
||||
"links.no_cable_available_for_that_route":"<b>No cable available for that route right now.</b>",
|
||||
"links.no_wave_capacity_on_this_route":"<b>No {wave} capacity on this route right now.</b><br>{why} Try a smaller wave, another route, or ask again in {n} days.",
|
||||
|
|
@ -3146,6 +3147,7 @@
|
|||
"puzzles.small_networks_real_traffic":"Small networks, real traffic",
|
||||
"puzzles.spent_x":"Spent {x}",
|
||||
"puzzles.spent_x_of_y":"Spent {x} / {y}",
|
||||
"puzzles.stars_from_the_packs":"Stars from the packs",
|
||||
"puzzles.stepping_stone_optional":"Stepping stone (optional)",
|
||||
"puzzles.suez_you_later":"Suez You Later",
|
||||
"puzzles.survive_any_single_cut_with_the":"Survive any single cut, with the traffic still flowing. Connected is not enough.",
|
||||
|
|
@ -3171,7 +3173,6 @@
|
|||
"puzzles.with_the_pop_price":"with the POP: {price}",
|
||||
"puzzles.your_pop":"Your POP",
|
||||
"puzzles.your_routers_pick_the_path":"Your routers pick the path. Tell them which: metrics, lowest latency, best effort.",
|
||||
"puzzles.your_stars":"Your stars",
|
||||
"puzzles.your_stars_so_far":"Your stars so far",
|
||||
"puzzles_weekly.detour":"Detour",
|
||||
"puzzles_weekly.island_hopping":"Island hopping",
|
||||
|
|
|
|||
|
|
@ -163,3 +163,20 @@ test('architect runs: the map tells two tubes in one trench from two separate pa
|
|||
assert.deepEqual(JSON.parse(ev("JSON.stringify(AR_PILLS.map(p=>p[2]).sort())")), ['2× one trench', '✓ 2 paths']);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('#231 the puzzle list counts each section\'s own stars: runs above, packs next to the packs', () => {
|
||||
const { ev, errors } = load();
|
||||
// 2 stars on a pack puzzle, 2 on Euro Run, 3 on another run
|
||||
ev("localStorage.setItem(PZ_KEY,JSON.stringify({set:PZ_SET,noted:1,s:{[PZ[0].id]:{st:2}}}));localStorage.setItem(AR_KEY,JSON.stringify({runs:{[AR_RUNS[0].id]:{st:2},[AR_RUNS[1].id]:{st:3}}}))");
|
||||
ev('ACT.puzzleMenu()');
|
||||
const heads = JSON.parse(ev("JSON.stringify([...document.querySelectorAll('#modal h3.pzpack')].map(h=>h.textContent))"));
|
||||
assert.match(heads[0], new RegExp(`Architect runs ⭐ 5/${3 * ev('AR_RUNS.length')}`), heads[0]);
|
||||
// the packs' total sits right above the first pack, after the runs and the weekly puzzle, and says what it counts
|
||||
const order = ev(`(()=>{const m=document.querySelector('#modal'),box=m.querySelector('.pzprog'),run=m.querySelector('[data-act=pzArStart]'),pack=[...m.querySelectorAll('h3.pzpack')].find(h=>!h.textContent.includes('🏗️'));
|
||||
return [!!(run.compareDocumentPosition(box)&Node.DOCUMENT_POSITION_FOLLOWING),!!(box.compareDocumentPosition(pack)&Node.DOCUMENT_POSITION_FOLLOWING),box.textContent].join('|')})()`);
|
||||
const [afterRuns, beforePacks, box] = order.split('|');
|
||||
assert.equal(afterRuns, 'true', 'below the architect runs');
|
||||
assert.equal(beforePacks, 'true', 'above the first pack');
|
||||
assert.match(box, new RegExp(`Stars from the packs⭐ 2 / ${3 * ev('PZ.length')}`), box);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -79,3 +79,25 @@ test('draft counts and quotes stay together when reopening a panel or using shor
|
|||
assert.equal(field().value,'','empty in-progress entry survives a tick');
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
test('#229 giving up a fiber puts its optics on the spares shelf, and so does decommissioning its POP',()=>{
|
||||
const {ev,dom,errors}=load();try{
|
||||
setup(ev);
|
||||
// a leased IRU (not your own build) with mixed optics
|
||||
ev("Object.assign(S.links[0],{own:false,ch:['zr4','zr4','tp16']});S.spares={zr4:1};compute()");
|
||||
ev("ACT.rmLink({id:'fiber'})");assert.equal(ev('S.links.length'),1,'the first click only asks');
|
||||
ev("ACT.rmLink({id:'fiber'})");assert.equal(ev('S.links.length'),0,'cancelled');
|
||||
assert.equal(ev('S.spares.zr4'),3);assert.equal(ev('S.spares.tp16'),1);
|
||||
assert.match(ev("S.log.map(e=>e.t).join(' | ')"),/3 optics went back on the spares shelf/);
|
||||
// the next channel of that type uses a spare for free
|
||||
ev("S.links.push({id:'f2',a:'fra',b:'ams',kind:'df',own:true,sys:'roadm',km:400,ch:[],ready:0,day:0,cut:0,mo:1});compute()");
|
||||
const cash=ev('S.cash');ev("ACT.setChCount({id:'f2',o:'zr4',n:3})");assert.equal(ev('S.cash'),cash,'spares are used first');assert.equal(ev('S.spares.zr4'),0);
|
||||
// decommissioning a POP returns the optics of every link it takes with it
|
||||
ev("S.pops.lon={...S.pops.fra};S.links.push({id:'f3',a:'lon',b:'ams',kind:'df',own:true,sys:'roadm',km:400,ch:['tp16','tp16'],ready:0,day:0,cut:0,mo:1});compute()");
|
||||
ev("decommission(['lon'])");
|
||||
assert.equal(ev("S.links.some(l=>l.id==='f3')"),false);assert.equal(ev('S.spares.tp16'),3);
|
||||
// a link without optics says nothing about spares
|
||||
ev("S.log=[];S.links.push({id:'f4',a:'fra',b:'ams',kind:'df',own:true,sys:'roadm',km:400,ch:[],ready:0,day:0,cut:0,mo:1});compute();ACT.rmLink({id:'f4'});ACT.rmLink({id:'f4'})");
|
||||
assert.doesNotMatch(ev("S.log.map(e=>e.t).join(' | ')"),/spares shelf/);
|
||||
assert.deepEqual(errors,[]);
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -578,3 +578,20 @@ test('#226 the shift report\'s Open button in the NOC opens the Ops sheet, and s
|
|||
assert.ok(doc.querySelector('#modalCard .ops-rep'), 'and it is the Ops sheet with the report');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('#228 the intern names the exchanges it peered at, even one that shares its city\'s id', t => {
|
||||
const { ev, errors } = game(t, "ACT.buyIx({city:'fra',tier:0,signed:true})");
|
||||
hire(ev); on(ev, 'ix');
|
||||
ev('S.day=14'); shift(ev);
|
||||
const line = ev('opsLine(S.ops.log[0])');
|
||||
// Frankfurt's first exchange has the city's id: the line names DE-KICKS, not the city
|
||||
assert.match(line, /peered with \d+ networks? at DE-KICKS/, line);
|
||||
assert.doesNotMatch(line, /at Frankfurt/);
|
||||
// two exchanges in two cities read as two exchanges, in the daily line and in the week's report
|
||||
const e = "{i:'kevin',r:[['peer',2,['fra~3','lon']]],up:0,mo:0}";
|
||||
assert.match(ev(`opsLine(${e})`), /at Apfelwein-IX, LYNX/);
|
||||
assert.match(ev("opsWeekLine({w:2,i:'kevin',n:{peer:2},wh:{peer:['fra~3','lon']},up:0,mo:0,rev:0,ff:0})"), /at Apfelwein-IX, LYNX/);
|
||||
// other orders still name cities
|
||||
assert.match(ev("opsLine({i:'kevin',r:[['routers',1,['lon +1']]],up:0,mo:0})"), /London \+1/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue