Merge remote-tracking branch 'origin/main' into keyboard-shortcuts
This commit is contained in:
commit
c5c5aac970
14 changed files with 92 additions and 2 deletions
|
|
@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
- You can pay to hurry the survey, permits and factory of your own subsea cable, 30 days at a time (#258). Money only goes so far: the cable still has to be made, about two months plus a day for every 80 km, before the lay ships sail.
|
||||
- Three new cities in northern Australia: Port Hedland, Townsville and Alice Springs (#255). Port Hedland lands a new cable up the coast to Darwin and a branch of Darwin's cable out to Singapore; Alice Springs has no sea at all. In the wet season, November to April, fiber cuts in the tropical north, Darwin included, take twice as long to reach.
|
||||
- Traceroute no longer shows an "embedded cache in your rack" hop on paths that leave over transit, an exchange or a PNI. Only traffic that really ends at one of your cache boxes shows it now.
|
||||
- New keyboard shortcuts: the arrow keys and W A S D move the map, [ and ] step through your POPs, $ through the open offers, - and = zoom out and in, n opens the NOC dashboard, and ? lists every shortcut. A letter right after n opens one of the dashboard's tabs, such as n c for Connections, and Help links to the list too.
|
||||
|
|
|
|||
|
|
@ -432,6 +432,9 @@ const API_CMD={
|
|||
metricSet:{args:[['id','entityId'],['v','string']],dom:['metIn'],watch:['pairMet'],
|
||||
bind:a=>{$('metIn').value=String(a.v);},
|
||||
doc:'Write the custom metric\'s number for the link\'s city pair, in the mode metricMode set. Select the link first (view.selLink), so the panel is showing the input.'},
|
||||
seaRush:{args:[['id','entityId'],['all','boolean',false]],watch:['links.#id'],
|
||||
quote:a=>{const l=S.links.find(x=>x.id===a.id);if(!l)return {};const k=prepSteps(l),n=a.all?k:Math.min(1,k);return {setup:n*prepCost(l),days:Math.min(n*PREP_STEP,Math.max(0,l.ready-prepFloor(l)))};},
|
||||
doc:'Hurry the survey, permits and factory of your own subsea cable before laying starts: 30 days sooner per step (all: as fast as money goes), never sooner than the factory can make the cable.'},
|
||||
layShip:{args:[['id','entityId']],watch:['links.#id'],
|
||||
quote:a=>{const l=S.links.find(x=>x.id===a.id),q=l&&layQuote(l);return q?{setup:q.cost}:{};},
|
||||
doc:'Book a second lay ship on your own cable before laying starts: it lays from the other end and halves that part of the build.'},
|
||||
|
|
|
|||
|
|
@ -423,13 +423,16 @@
|
|||
"businesses.your_network_diagram_is_a_photo":"Dein Netzplan ist ein Foto von einem Whiteboard.",
|
||||
"businesses.your_noc_has_a_chat_channel":"Dein NOC hat einen Chat-Kanal namens #its-always-the-fiber, und es ist immer die Glasfaser.",
|
||||
"businesses.your_routing_table_needs_its_own":"Deine Routing-Tabelle braucht eine eigene Routing-Tabelle.",
|
||||
"cable_ships.as_fast_as_money_goes":"So schnell, wie Geld es kann <small>{price} · −{n} Tage</small>",
|
||||
"cable_ships.at_anchor_off_home":"liegt vor {home} vor Anker, binnen eines Tages auslaufbereit.",
|
||||
"cable_ships.book_a_second_lay_ship":"Zweites Verlegeschiff buchen <small>{price} · −{n} Tage</small>",
|
||||
"cable_ships.charter_ship":"{ship} chartern",
|
||||
"cable_ships.every_club_ship_is_out":"Jedes Schiff des {club} ist im Einsatz. Der Schnitt wartet auf das erste, das zurückkommt, oder auf eine private Charter.",
|
||||
"cable_ships.hurry_the_permits_and_the":"Genehmigungen und Fabrik antreiben <small>{price} · −{n} Tage</small>",
|
||||
"cable_ships.km_of_km":"{km} von {of} km",
|
||||
"cable_ships.lay_ship_tap":"<b>{ship}</b><br>Verlegt dein Kabel von {a} nach {b}: {km} von {of} km liegen am Meeresgrund.",
|
||||
"cable_ships.laying_starts_in_n_days":{"one":"Verlegung beginnt in {n} Tag","other":"Verlegung beginnt in {n} Tagen"},
|
||||
"cable_ships.money_only_goes_so_far":"Anwälte und Überstunden helfen nur bis zu einem Punkt: Das Kabel muss trotzdem gebaut werden. Bei diesem frühestens {n} Tage nach der Bestellung, dann laufen die Schiffe aus.",
|
||||
"cable_ships.private_at_anchor":"liegt vor {home} vor Anker, zu chartern für alle, die zahlen.",
|
||||
"cable_ships.private_operator":"Privater Betreiber",
|
||||
"cable_ships.sailing_home_to_home":{"one":"auf dem Heimweg nach {home}, in {n} Tag wieder frei.","other":"auf dem Heimweg nach {home}, in {n} Tagen wieder frei."},
|
||||
|
|
@ -441,6 +444,7 @@
|
|||
"cable_ships.ship_waits_for_a_permit":"{ship} ist vor Ort und wartet {n} T. auf eine Reparaturgenehmigung. Kabel in etwa {m} T. wieder da.",
|
||||
"cable_ships.ships_lay_the_cable":"{ships} auf See, beim Verlegen",
|
||||
"cable_ships.survey_permits_and_the_cable_factory":"Vermessung, Genehmigungen und die Kabelfabrik",
|
||||
"cable_ships.the_factory_runs_a_night_shift":{"one":"Die Genehmigungsanwälte haben einen Stempel gefunden und die Fabrik fährt eine Nachtschicht: Das Verlegen beginnt {n} Tag früher.","other":"Die Genehmigungsanwälte haben einen Stempel gefunden und die Fabrik fährt eine Nachtschicht: Das Verlegen beginnt {n} Tage früher."},
|
||||
"cables.a_bet_on_a_tiny_island":"Eine Wette auf eine winzige Insel mitten im Pazifik.",
|
||||
"cables.a_buffet_of_landings_down_norway":"Ein Buffet aus Anlandungen entlang der norwegischen Küste, von den Ölfeldern bis Oslo.",
|
||||
"cables.a_friendly_cable_with_french_manners":"Ein freundliches Kabel mit französischen Manieren.",
|
||||
|
|
|
|||
|
|
@ -421,13 +421,16 @@
|
|||
"businesses.your_network_diagram_is_a_photo":"Tu diagrama de red es una foto de una pizarra.",
|
||||
"businesses.your_noc_has_a_chat_channel":"Tu NOC tiene un canal de chat llamado #siempre-es-la-fibra, y siempre es la fibra.",
|
||||
"businesses.your_routing_table_needs_its_own":"Tu tabla de rutas necesita su propia tabla de rutas.",
|
||||
"cable_ships.as_fast_as_money_goes":"Tan rápido como el dinero permita <small>{price} · −{n} días</small>",
|
||||
"cable_ships.at_anchor_off_home":"fondeado frente a {home}, listo para zarpar en un día.",
|
||||
"cable_ships.book_a_second_lay_ship":"Reservar un segundo buque tendedor <small>{price} · −{n} días</small>",
|
||||
"cable_ships.charter_ship":"Fletar {ship}",
|
||||
"cable_ships.every_club_ship_is_out":"Todos los buques del {club} están en un trabajo. El corte espera al primero que vuelva, o a un flete privado.",
|
||||
"cable_ships.hurry_the_permits_and_the":"Acelerar permisos y fábrica <small>{price} · −{n} días</small>",
|
||||
"cable_ships.km_of_km":"{km} de {of} km",
|
||||
"cable_ships.lay_ship_tap":"<b>{ship}</b><br>Tiende tu cable de {a} a {b}: {km} de {of} km en el fondo del mar.",
|
||||
"cable_ships.laying_starts_in_n_days":{"one":"El tendido empieza en {n} día","other":"El tendido empieza en {n} días"},
|
||||
"cable_ships.money_only_goes_so_far":"Los abogados y las horas extra tienen un límite: el cable hay que fabricarlo igual. Para este son al menos {n} días desde el pedido, y luego zarpan los barcos.",
|
||||
"cable_ships.private_at_anchor":"fondeado frente a {home}, en flete para quien pague.",
|
||||
"cable_ships.private_operator":"Operador privado",
|
||||
"cable_ships.sailing_home_to_home":{"one":"volviendo a {home}, libre de nuevo en {n} día.","other":"volviendo a {home}, libre de nuevo en {n} días."},
|
||||
|
|
@ -439,6 +442,7 @@
|
|||
"cable_ships.ship_waits_for_a_permit":"{ship} está en el sitio y espera {n} d un permiso de reparación. El cable vuelve en unos {m} d.",
|
||||
"cable_ships.ships_lay_the_cable":"{ships} en el mar, tendiendo",
|
||||
"cable_ships.survey_permits_and_the_cable_factory":"Estudio, permisos y la fábrica de cable",
|
||||
"cable_ships.the_factory_runs_a_night_shift":{"one":"Los abogados de permisos encontraron un sello y la fábrica hace turno de noche: el tendido empieza {n} día antes.","other":"Los abogados de permisos encontraron un sello y la fábrica hace turno de noche: el tendido empieza {n} días antes."},
|
||||
"cables.a_bet_on_a_tiny_island":"Una apuesta por una isla diminuta en medio del Pacífico.",
|
||||
"cables.a_buffet_of_landings_down_norway":"Un bufé de aterrizajes por la costa noruega, de los campos petrolíferos a Oslo.",
|
||||
"cables.a_friendly_cable_with_french_manners":"Un cable simpático con modales franceses.",
|
||||
|
|
|
|||
|
|
@ -421,13 +421,16 @@
|
|||
"businesses.your_network_diagram_is_a_photo":"Ton schéma réseau est une photo de tableau blanc.",
|
||||
"businesses.your_noc_has_a_chat_channel":"Ton NOC a un canal de chat nommé #c-est-toujours-la-fibre, et c’est toujours la fibre.",
|
||||
"businesses.your_routing_table_needs_its_own":"Ta table de routage a besoin de sa propre table de routage.",
|
||||
"cable_ships.as_fast_as_money_goes":"Aussi vite que l'argent le permet <small>{price} · −{n} jours</small>",
|
||||
"cable_ships.at_anchor_off_home":"au mouillage devant {home}, prêt à appareiller en un jour.",
|
||||
"cable_ships.book_a_second_lay_ship":"Réserver un second navire câblier <small>{price} · −{n} jours</small>",
|
||||
"cable_ships.charter_ship":"Affréter {ship}",
|
||||
"cable_ships.every_club_ship_is_out":"Tous les navires du {club} sont en mission. La coupure attend le premier qui rentre, ou un affrètement privé.",
|
||||
"cable_ships.hurry_the_permits_and_the":"Presser les permis et l'usine <small>{price} · −{n} jours</small>",
|
||||
"cable_ships.km_of_km":"{km} sur {of} km",
|
||||
"cable_ships.lay_ship_tap":"<b>{ship}</b><br>Pose ton câble de {a} à {b} : {km} sur {of} km sur le fond.",
|
||||
"cable_ships.laying_starts_in_n_days":{"one":"La pose commence dans {n} jour","other":"La pose commence dans {n} jours"},
|
||||
"cable_ships.money_only_goes_so_far":"Les avocats et les heures sup' ont leurs limites : le câble doit quand même être fabriqué. Pour celui-ci, au plus tôt {n} jours après la commande, puis les navires appareillent.",
|
||||
"cable_ships.private_at_anchor":"au mouillage devant {home}, à affréter pour qui paie.",
|
||||
"cable_ships.private_operator":"Opérateur privé",
|
||||
"cable_ships.sailing_home_to_home":{"one":"rentre à {home}, libre dans {n} jour.","other":"rentre à {home}, libre dans {n} jours."},
|
||||
|
|
@ -439,6 +442,7 @@
|
|||
"cable_ships.ship_waits_for_a_permit":"{ship} est sur place et attend {n} j un permis de réparation. Câble rétabli dans environ {m} j.",
|
||||
"cable_ships.ships_lay_the_cable":"{ships} en mer, en pose",
|
||||
"cable_ships.survey_permits_and_the_cable_factory":"Relevés, permis et usine de câble",
|
||||
"cable_ships.the_factory_runs_a_night_shift":{"one":"Les avocats des permis ont trouvé un tampon et l'usine tourne de nuit : la pose commence {n} jour plus tôt.","other":"Les avocats des permis ont trouvé un tampon et l'usine tourne de nuit : la pose commence {n} jours plus tôt."},
|
||||
"cables.a_bet_on_a_tiny_island":"Un pari sur une minuscule île au milieu du Pacifique.",
|
||||
"cables.a_buffet_of_landings_down_norway":"Un buffet d’atterrissements le long de la côte norvégienne, des champs pétroliers jusqu’à Oslo.",
|
||||
"cables.a_friendly_cable_with_french_manners":"Un câble sympathique aux manières bien françaises.",
|
||||
|
|
|
|||
|
|
@ -421,13 +421,16 @@
|
|||
"businesses.your_network_diagram_is_a_photo":"Il tuo schema di rete è la foto di una lavagna.",
|
||||
"businesses.your_noc_has_a_chat_channel":"Il tuo NOC ha un canale chat chiamato #è-sempre-la-fibra, ed è sempre la fibra.",
|
||||
"businesses.your_routing_table_needs_its_own":"La tua tabella di routing ha bisogno di una tabella di routing tutta sua.",
|
||||
"cable_ships.as_fast_as_money_goes":"Più veloce che i soldi permettono <small>{price} · −{n} giorni</small>",
|
||||
"cable_ships.at_anchor_off_home":"alla fonda davanti a {home}, pronta a salpare entro un giorno.",
|
||||
"cable_ships.book_a_second_lay_ship":"Prenota una seconda nave posacavi <small>{price} · −{n} giorni</small>",
|
||||
"cable_ships.charter_ship":"Noleggia {ship}",
|
||||
"cable_ships.every_club_ship_is_out":"Tutte le navi del {club} sono in missione. Il taglio aspetta la prima che rientra, o un noleggio privato.",
|
||||
"cable_ships.hurry_the_permits_and_the":"Accelera permessi e fabbrica <small>{price} · −{n} giorni</small>",
|
||||
"cable_ships.km_of_km":"{km} di {of} km",
|
||||
"cable_ships.lay_ship_tap":"<b>{ship}</b><br>Posa il tuo cavo da {a} a {b}: {km} di {of} km sul fondale.",
|
||||
"cable_ships.laying_starts_in_n_days":{"one":"La posa inizia tra {n} giorno","other":"La posa inizia tra {n} giorni"},
|
||||
"cable_ships.money_only_goes_so_far":"Avvocati e straordinari arrivano fino a un certo punto: il cavo va comunque fabbricato. Per questo servono almeno {n} giorni dall'ordine, poi salpano le navi.",
|
||||
"cable_ships.private_at_anchor":"alla fonda davanti a {home}, a noleggio per chi paga.",
|
||||
"cable_ships.private_operator":"Operatore privato",
|
||||
"cable_ships.sailing_home_to_home":{"one":"rientra a {home}, di nuovo libera tra {n} giorno.","other":"rientra a {home}, di nuovo libera tra {n} giorni."},
|
||||
|
|
@ -439,6 +442,7 @@
|
|||
"cable_ships.ship_waits_for_a_permit":"{ship} è sul posto e aspetta {n} g un permesso di riparazione. Cavo di nuovo su tra circa {m} g.",
|
||||
"cable_ships.ships_lay_the_cable":"{ships} in mare, in posa",
|
||||
"cable_ships.survey_permits_and_the_cable_factory":"Rilievi, permessi e fabbrica del cavo",
|
||||
"cable_ships.the_factory_runs_a_night_shift":{"one":"Gli avvocati dei permessi hanno trovato un timbro e la fabbrica fa il turno di notte: la posa inizia {n} giorno prima.","other":"Gli avvocati dei permessi hanno trovato un timbro e la fabbrica fa il turno di notte: la posa inizia {n} giorni prima."},
|
||||
"cables.a_bet_on_a_tiny_island":"Una scommessa su un’isoletta in mezzo al Pacifico.",
|
||||
"cables.a_buffet_of_landings_down_norway":"Un buffet di approdi lungo la costa norvegese, dai giacimenti di petrolio fino a Oslo.",
|
||||
"cables.a_friendly_cable_with_french_manners":"Un cavo amichevole con le buone maniere francesi.",
|
||||
|
|
|
|||
|
|
@ -421,13 +421,16 @@
|
|||
"businesses.your_network_diagram_is_a_photo":"Seu diagrama de rede é uma foto de um quadro branco.",
|
||||
"businesses.your_noc_has_a_chat_channel":"Seu NOC tem um canal de chat chamado #é-sempre-a-fibra, e é sempre a fibra.",
|
||||
"businesses.your_routing_table_needs_its_own":"Sua tabela de roteamento precisa de uma tabela de roteamento própria.",
|
||||
"cable_ships.as_fast_as_money_goes":"O mais rápido que o dinheiro permite <small>{price} · −{n} dias</small>",
|
||||
"cable_ships.at_anchor_off_home":"fundeado diante de {home}, pronto para zarpar em um dia.",
|
||||
"cable_ships.book_a_second_lay_ship":"Reservar um segundo navio lançador <small>{price} · −{n} dias</small>",
|
||||
"cable_ships.charter_ship":"Fretar {ship}",
|
||||
"cable_ships.every_club_ship_is_out":"Todos os navios do {club} estão em serviço. O corte espera o primeiro que voltar, ou um frete privado.",
|
||||
"cable_ships.hurry_the_permits_and_the":"Apressar licenças e fábrica <small>{price} · −{n} dias</small>",
|
||||
"cable_ships.km_of_km":"{km} de {of} km",
|
||||
"cable_ships.lay_ship_tap":"<b>{ship}</b><br>Lançando seu cabo de {a} a {b}: {km} de {of} km no fundo do mar.",
|
||||
"cable_ships.laying_starts_in_n_days":{"one":"O lançamento começa em {n} dia","other":"O lançamento começa em {n} dias"},
|
||||
"cable_ships.money_only_goes_so_far":"Advogados e horas extras têm limite: o cabo ainda precisa ser fabricado. Para este, pelo menos {n} dias desde o pedido, e depois os navios zarpam.",
|
||||
"cable_ships.private_at_anchor":"fundeado diante de {home}, para frete a quem pagar.",
|
||||
"cable_ships.private_operator":"Operador privado",
|
||||
"cable_ships.sailing_home_to_home":{"one":"voltando para {home}, livre de novo em {n} dia.","other":"voltando para {home}, livre de novo em {n} dias."},
|
||||
|
|
@ -439,6 +442,7 @@
|
|||
"cable_ships.ship_waits_for_a_permit":"{ship} está no local e espera {n} d por uma licença de reparo. Cabo de volta em cerca de {m} d.",
|
||||
"cable_ships.ships_lay_the_cable":"{ships} no mar, lançando",
|
||||
"cable_ships.survey_permits_and_the_cable_factory":"Levantamento, licenças e a fábrica de cabo",
|
||||
"cable_ships.the_factory_runs_a_night_shift":{"one":"Os advogados de licenças acharam um carimbo e a fábrica faz turno da noite: o lançamento começa {n} dia antes.","other":"Os advogados de licenças acharam um carimbo e a fábrica faz turno da noite: o lançamento começa {n} dias antes."},
|
||||
"cables.a_bet_on_a_tiny_island":"Uma aposta numa ilhota no meio do Pacífico.",
|
||||
"cables.a_buffet_of_landings_down_norway":"Um rodízio de pontos de chegada pela costa norueguesa, dos campos de petróleo até Oslo.",
|
||||
"cables.a_friendly_cable_with_french_manners":"Um cabo simpático com bons modos franceses.",
|
||||
|
|
|
|||
|
|
@ -78,4 +78,9 @@ const layOwn=l=>l.kind==='df'&&l.own&&l.sub;
|
|||
const layName=(l,k=0)=>{let h=0;for(const ch of String(l.id))h=(h*31+ch.charCodeAt(0))>>>0;return LAY_SHIPS[(h+k)%LAY_SHIPS.length];};
|
||||
function layQuote(l){if(!layOwn(l)||l.ship2||S.day>=layStart(l)||l.ready<=S.day+1)return null;const save=Math.floor(layDays(l)/2);if(save<1)return null;return {save,cost:SHIP_MOB+save*LAY_DAY};}
|
||||
// How much of the cable is on the seabed, 0 to 1.
|
||||
/* Money hurries the survey, the permits and the factory (#258), 30 days a step, but only so far: the cable still has to
|
||||
be made, about two months plus a day for every 80 km of it, before the ships can sail and lay it. */
|
||||
const PREP_STEP=30,prepMin=l=>leadDays(Math.round(60+(l.km||0)*0.012)),prepCost=l=>Math.round((500000+(l.km||0)*60)*hwMul('build')),
|
||||
prepFloor=l=>Math.max(S.day+1,(l.day||0)+prepMin(l))+layLen(l),
|
||||
prepSteps=l=>layOwn(l)&&l.ready>S.day&&S.day<layStart(l)?Math.max(0,Math.ceil((l.ready-prepFloor(l))/PREP_STEP)):0;
|
||||
const layDone=(l,T)=>clamp((T-layStart(l))/layLen(l),0,1);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ Object.assign(ACT,{
|
|||
upSys:({id})=>{const l=S.links.find(x=>x.id===id),to=l&&sysNext(l);if(!to||!techOk('sys',to,DF_SYS[to].lvl))return;if(!spend(sysUpCost(l)))return;l.sys=to;if(l.ready<=S.day){l.eqDown=S.day+1;toast(tr('fiber_and_hardware.line_system_swap_all_channels_are'),'bad');}after();},
|
||||
spares:({id})=>{const l=S.links.find(x=>x.id===id);if(!l)return;l.spares=!l.spares;sfx('click');after();},
|
||||
// Your own subsea cable: book a second lay ship before laying starts; it lays from the other end (50-cable-ships.js).
|
||||
seaRush:({id,all})=>{const l=S.links.find(x=>x.id===id);if(!l)return;const k=prepSteps(l);if(!k)return;const n=all?k:1;if(!spend(n*prepCost(l)))return;const ready=Math.max(prepFloor(l),l.ready-PREP_STEP*n),saved=l.ready-ready;setCableReady(l,ready);toast(trn('cable_ships.the_factory_runs_a_night_shift',saved,{n:saved}),'good');sfx('build');after();},
|
||||
layShip:({id})=>{const l=S.links.find(x=>x.id===id);const q=l&&layQuote(l);if(!q||!spend(q.cost))return;l.ship2=1;setCableReady(l,l.ready-q.save);
|
||||
toast(trn('cable_ships.second_lay_ship_booked',q.save,{ship:esc(layName(l,1)),n:q.save}),'good');sfx('coin');after();},
|
||||
crews:({id,all})=>{const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||!l.own||l.sub||l.ready<=S.day+1)return;const n=all?crewSteps(l):1,c=n*crewCost(l);if(!spend(c))return;const ready=Math.max(S.day+1,l.ready-30*n),saved=l.ready-ready;setCableReady(l,ready);toast(trn('fiber_and_hardware.more_crews_on_site_construction_is',saved,{n:saved}),'good');after();},
|
||||
|
|
|
|||
|
|
@ -105,6 +105,9 @@ const shipNote=i=>{const t=i&&shipStatus(i);return t?`<p class="note">🚢 ${esc
|
|||
function layPanel(l){const d=S.day,st=layStart(l),q=layQuote(l),km=Math.round(layDone(l,d)*l.km),two=l.ship2?tr('cable_ships.ship_and_ship',{a:layName(l),b:layName(l,1)}):layName(l);
|
||||
let h=d<st?`<div class="kv"><span>${tr('cable_ships.survey_permits_and_the_cable_factory')}</span><b>${trn('cable_ships.laying_starts_in_n_days',st-d)}</b></div>`
|
||||
:`<div class="kv"><span>${tr('cable_ships.ships_lay_the_cable',{ships:esc(two)})}</span><b>${tr('cable_ships.km_of_km',{km:km.toLocaleString(),of:Math.round(l.km).toLocaleString()})}</b></div>`;
|
||||
const k=prepSteps(l),pc=prepCost(l),fast=Math.min(k*PREP_STEP,l.ready-prepFloor(l));
|
||||
if(k)h+=`<div class="btns">${btn(tr('cable_ships.hurry_the_permits_and_the',{n:Math.min(PREP_STEP,fast),price:fmt$(pc)}),'seaRush',{id:l.id},'sm',S.cash<pc)}${k>1?btn(tr('cable_ships.as_fast_as_money_goes',{n:fast,price:fmt$(k*pc)}),'seaRush',{id:l.id,all:1},'sm',S.cash<k*pc):''}</div>`;
|
||||
if(d<st)h+=`<p class="note">${tr('cable_ships.money_only_goes_so_far',{n:prepMin(l)})}</p>`;
|
||||
if(q)h+=`<div class="btns">${btn(tr('cable_ships.book_a_second_lay_ship',{price:fmt$(q.cost),n:q.save}),'layShip',{id:l.id},'sm',S.cash<q.cost)}</div><p class="note">${tr('link_panels.only_a_few_dozen_cable_ships')}</p>`;
|
||||
else if(!l.ship2&&d<st)h+=`<p class="note">${tr('link_panels.only_a_few_dozen_cable_ships')}</p>`;
|
||||
return h;}
|
||||
|
|
|
|||
|
|
@ -422,13 +422,16 @@
|
|||
"businesses.your_network_diagram_is_a_photo":"Your network diagram is a photo of a whiteboard.",
|
||||
"businesses.your_noc_has_a_chat_channel":"Your NOC has a chat channel called #its-always-the-fiber, and it is always the fiber.",
|
||||
"businesses.your_routing_table_needs_its_own":"Your routing table needs its own routing table.",
|
||||
"cable_ships.as_fast_as_money_goes":"As fast as money goes <small>{price} · −{n} days</small>",
|
||||
"cable_ships.at_anchor_off_home":"at anchor off {home}, ready to sail within a day.",
|
||||
"cable_ships.book_a_second_lay_ship":"Book a second lay ship <small>{price} · −{n} days</small>",
|
||||
"cable_ships.charter_ship":"Charter {ship}",
|
||||
"cable_ships.every_club_ship_is_out":"Every {club} ship is out on a job. The cut waits for the first one back, or a private charter.",
|
||||
"cable_ships.hurry_the_permits_and_the":"Hurry the permits and the factory <small>{price} · −{n} days</small>",
|
||||
"cable_ships.km_of_km":"{km} of {of} km",
|
||||
"cable_ships.lay_ship_tap":"<b>{ship}</b><br>Laying your cable from {a} to {b}: {km} of {of} km on the seabed.",
|
||||
"cable_ships.laying_starts_in_n_days":{"one":"Laying starts in {n} day","other":"Laying starts in {n} days"},
|
||||
"cable_ships.money_only_goes_so_far":"Lawyers and overtime only go so far: the cable still has to be made. For this one that is {n} days from the order at the soonest, then the ships sail.",
|
||||
"cable_ships.private_at_anchor":"at anchor off {home}, for charter to anyone who pays.",
|
||||
"cable_ships.private_operator":"Private operator",
|
||||
"cable_ships.sailing_home_to_home":{"one":"sailing home to {home}, free again in {n} day.","other":"sailing home to {home}, free again in {n} days."},
|
||||
|
|
@ -440,6 +443,7 @@
|
|||
"cable_ships.ship_waits_for_a_permit":"{ship} is on site, waiting {n}d for a repair permit. Cable back in about {m}d.",
|
||||
"cable_ships.ships_lay_the_cable":"{ships} at sea, laying",
|
||||
"cable_ships.survey_permits_and_the_cable_factory":"Survey, permits and the cable factory",
|
||||
"cable_ships.the_factory_runs_a_night_shift":{"one":"The permit lawyers found a stamp and the factory runs a night shift: laying starts {n} day sooner.","other":"The permit lawyers found a stamp and the factory runs a night shift: laying starts {n} days sooner."},
|
||||
"cables.a_bet_on_a_tiny_island":"A bet on a tiny island in the middle of the Pacific.",
|
||||
"cables.a_buffet_of_landings_down_norway":"A buffet of landings down the Norwegian coast, from the oil fields to Oslo.",
|
||||
"cables.a_friendly_cable_with_french_manners":"A friendly cable with French manners.",
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ test('a dry run prices every command that has a price, and changes nothing', ()
|
|||
crews: { id: df }, addCh: { id: df, o: 'zr4' }, addPair: { id: df }, upSys: { id: df }, regen: { id: df, d: 1 }, buySpare: { o: 'zr4' }, sellSpare: { o: 'zr4' },
|
||||
setChCount: { id: df, o: 'zr4', n: 2 }, repayLoan: { id: 'none' }, buildScrub: { city: 'ams', tier: 1 }, scrubUp: { city: 'fra', tier: 1 },
|
||||
fixInc: { id: 'none' }, confGo: { key: T('catalog', { name: 'conferences' })[0].key }, confSponsor: { key: T('catalog', { name: 'conferences' })[0].key },
|
||||
opsHire: { id: ev('Object.keys(INTERNS)[0]') }, opsNewPop: { city: 'nyc' }, pniAll: { net: 'cog', tier: 1 }, seatBuy: { n: 2 }, layShip: { id: df },
|
||||
opsHire: { id: ev('Object.keys(INTERNS)[0]') }, opsNewPop: { city: 'nyc' }, pniAll: { net: 'cog', tier: 1 }, seatBuy: { n: 2 }, layShip: { id: df }, seaRush: { id: df },
|
||||
utilityKit: { city: 'fra' }, utilityCaches: { city: 'fra' }, teDeploy: { script: 'spill at 85%' }, upLinkX: {},
|
||||
};
|
||||
const missing = quoted.filter((n) => !sample[n] && T('schema', { section: 'commands' })[n].args.some((a) => a.required));
|
||||
|
|
|
|||
|
|
@ -78,7 +78,9 @@ test('pages: the shipped page and dictionaries, with labels shrunk to ids, still
|
|||
for (const [lang, word] of [['en', 'Customers'], ['it', 'Clienti'], ['fr', null]]) {
|
||||
const { ev, errors } = load(lang === 'en' ? { file } : { file, lang, dir });
|
||||
ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});for(let i=0;i<40;i++)dayTick();ACT.leftTab({t:'noc'});renderAll()");
|
||||
const text = ev("['hud','leftBody','panelBody','modalCard','toasts'].map(i=>document.getElementById(i)?.textContent||'').join(' ')");
|
||||
// Text node by text node: a raw label sits inside one, while two elements' text run together ("facendo." then
|
||||
// "proprio ora") only looks like one.
|
||||
const text = ev("['hud','leftBody','panelBody','modalCard','toasts'].map(i=>{const e=document.getElementById(i);if(!e)return '';const w=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),out=[];while(w.nextNode())out.push(w.currentNode.nodeValue);return out.join(' ');}).join(' ')");
|
||||
if (word) assert.ok(text.includes(word), `${lang}: ${word}`);
|
||||
assert.doesNotMatch(text, /\b[a-z_]+\.[a-z0-9_]{6,}\b/, `${lang}: no raw labels`);
|
||||
assert.equal(ev("tr(FLOOD_WHO[0])"), ev("tr('failures.a_botnet_of_40_000_smart')"), `${lang}: labels kept for saves still translate`);
|
||||
|
|
|
|||
51
tests/sea-rush.test.js
Normal file
51
tests/sea-rush.test.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// #258: money hurries the survey, permits and factory of your own subsea cable, 30 days a step, but never below what the
|
||||
// factory needs to make the cable (two months plus a day per 80 km); the lay ships still sail after that.
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
const start = "ACT.start({});S.cash=1e9;S.lvl=13;S.day=200;S.nextFail=S.nextEvent=1e8;for(const g of GOALS)S.done[g.id]=0;";
|
||||
const own = (km, ready) => `S.links=[{id:'own',a:'lag',b:'bde',kind:'df',own:true,sub:true,sys:'roadm',km:${km},ch:[],day:200,ready:${ready},cut:0,mo:1}];`;
|
||||
|
||||
test('#258 paying hurries the permits and the factory, 30 days a step, down to what the factory needs', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
ev(start + own(6000, 800));
|
||||
// 6000 km: 60 + 72 days to make it, then 40 days at sea.
|
||||
assert.equal(ev('prepMin(S.links[0])'), 132);
|
||||
assert.equal(ev('prepFloor(S.links[0])'), 200 + 132 + 40);
|
||||
assert.equal(ev('prepSteps(S.links[0])'), 15);
|
||||
ev("UI.sel={type:'link',id:'own'};renderPanel()");
|
||||
const panel = () => dom.window.document.querySelector('#panelBody').textContent;
|
||||
assert.match(panel(), /Hurry the permits and the factory/);
|
||||
assert.match(panel(), /As fast as money goes/);
|
||||
assert.match(panel(), /132 days from the order at the soonest/);
|
||||
const step = ev('prepCost(S.links[0])'), cash = ev('S.cash');
|
||||
ev("ACT.seaRush({id:'own'})");
|
||||
assert.equal(ev('S.links[0].ready'), 770, 'one step: 30 days sooner');
|
||||
assert.equal(cash - ev('S.cash'), step);
|
||||
ev("ACT.seaRush({id:'own',all:1})");
|
||||
assert.equal(ev('S.links[0].ready'), 372, 'all the way: the factory floor, then the ships');
|
||||
assert.equal(cash - ev('S.cash'), 15 * step);
|
||||
assert.equal(ev('layStart(S.links[0])'), 332);
|
||||
assert.equal(ev('prepSteps(S.links[0])'), 0, 'no faster than that');
|
||||
ev("ACT.seaRush({id:'own'})");
|
||||
assert.equal(cash - ev('S.cash'), 15 * step, 'and nothing more is charged');
|
||||
// The second lay ship still halves the time at sea on top.
|
||||
ev("ACT.layShip({id:'own'})");
|
||||
assert.equal(ev('S.links[0].ready'), 352);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('#258 a short cable is quick; once the ships sail, money buys no more paperwork', () => {
|
||||
const { ev, errors } = load();
|
||||
ev(start + own(800, 600));
|
||||
assert.equal(ev('prepMin(S.links[0])'), 70, 'a short hop: a couple of months');
|
||||
ev("ACT.seaRush({id:'own',all:1})");
|
||||
assert.equal(ev('S.links[0].ready'), 200 + 70 + 6);
|
||||
ev(start + own(6000, 800) + 'S.day=770');
|
||||
assert.equal(ev('prepSteps(S.links[0])'), 0, 'laying has started');
|
||||
const cash = ev('S.cash');
|
||||
ev("ACT.seaRush({id:'own'})");
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue