Best Effort: PNIs are up at once, no attack warnings without attacks

A pnis rule (wait or instant): in Best Effort pniLead() is 0, new PNIs are
on the moment they are ordered and augments and LAG members are applied at
once (pniUpDone(), split out of pniDay()). Gaming customers' attack warning
shows only where DDoS can happen.
This commit is contained in:
Frederic Jung 2026-11-03 08:19:10 +00:00
parent 09f205e458
commit 4a66bbf998
No known key found for this signature in database
16 changed files with 85 additions and 26 deletions

View file

@ -43,8 +43,8 @@ These are what the game promises, held up by `tests/gameplay-rules.test.js` (one
| Id | Rule | Why |
| --- | --- | --- |
| M1 | On-call is the classic game: it equals `RULE_DEF`, and a save without rules loads as On-call. The seeded suites (`tests/game.test.js`, `tests/rules.test.js`) are its behaviour. | Old saves never change under them. |
| M2 | Presets are ordered: Best Effort never harsher than Change Freeze, Change Freeze never harsher than On-call, BGP at 3 a.m. never gentler (chaos, lead times, market; and a seeded year of incidents). Only Best Effort mends sea cuts without ships, skips conferences, rescues instead of game over and has patient customers. | The names promise it. |
| M3 | Every subsystem that can annoy the player reads a rule: outages and events (`chaos`), DDoS, sold-out routes, de-peering and hardware prices (`market`), lead times (`lead`), the clock, cable ships (`sea`), conferences (`confs`), going broke (`broke`), customer patience (`moods`), and the day's toasts (quiet notifications). A quiet ruleset gives a quiet year. | Rules are presets of flags, not separate code. |
| M2 | Presets are ordered: Best Effort never harsher than Change Freeze, Change Freeze never harsher than On-call, BGP at 3 a.m. never gentler (chaos, lead times, market; and a seeded year of incidents). Only Best Effort mends sea cuts without ships, skips conferences, rescues instead of game over, has patient customers and instant PNIs. | The names promise it. |
| M3 | Every subsystem that can annoy the player reads a rule: outages and events (`chaos`), DDoS, sold-out routes, de-peering and hardware prices (`market`), lead times (`lead`), the clock, cable ships (`sea`), conferences (`confs`), going broke (`broke`), customer patience (`moods`), PNI delivery (`pnis`), and the day's toasts (quiet notifications). A quiet ruleset gives a quiet year. | Rules are presets of flags, not separate code. |
| M4 | Scenarios and the weekly challenge always run On-call plus their own `S.scn.rules`. | Fair scores. |
| M5 | Sandbox has no locked feature: open gates, every level, own cables, endless money. | It is a sandbox. |

View file

@ -8,7 +8,8 @@ All notable changes to this project are documented here. The project follows
- Networks you reach through an exchange's route server now stay "via RS" (#265). With an Open peering policy, the peering desk used to turn some of them into separate sessions of their own.
- The intern's "Light more fiber" order has a new Optics setting: light new fiber with the biggest optic it can afford, to save channels for later (#262). Once a fiber is lit, the intern still adds more of the same optic and never swaps what is in there.
- New Best Effort mode, the gentlest way to play: rare outages, no DDoS, no chaos monkey, no conferences and no cable ships, with sea cuts that mend on their own. Customers are more patient, a rescue loan from the Ministry of Tubes replaces game over, builds take days and prices never spike. A new Quiet notifications setting, on by default in Best Effort and available in every mode, only pops up trouble and milestones; everything else goes into the NOC log.
- Gaming customers no longer warn that they attract attacks in modes without DDoS attacks, such as Change Freeze.
- New Best Effort mode, the gentlest way to play: rare outages, no DDoS, no chaos monkey, no conferences and no cable ships, with sea cuts that mend on their own. PNIs are up the moment you order them, customers are more patient, a rescue loan from the Ministry of Tubes replaces game over, builds take days and prices never spike. A new Quiet notifications setting, on by default in Best Effort and available in every mode, only pops up trouble and milestones; everything else goes into the NOC log.
- The Build POP button now shows the whole price of a new POP, including the routers of your standard POP (#261). Before, it showed only the site, although the standard routers were paid for on top; a note under the button now lists them, and the intern's one-tap template prices them in as well. POPs that come with a new wave, dark fiber, your own subsea cable or a consortium seat now get the standard routers too, and those offers show the price with them.
## [2.5.0] — 2026-11-02

View file

@ -3083,11 +3083,13 @@
"pnis.cancel_the_order":"Bestellung stornieren",
"pnis.delivery_2_to_6_weeks":"Lieferung: 2 bis 6 Wochen",
"pnis.delivery_about_a_month_sometimes_6":"Lieferung: etwa ein Monat, manchmal 6 bis 12 Monate",
"pnis.it_is_up_already":"Läuft schon",
"pnis.no_capacity_in_us_east_you":"Keine Kapazität in US East. Du kannst dich auf die Warteliste setzen lassen, aber auch die Warteliste hat keine Kapazität mehr.",
"pnis.pni_with_net_is_up_in":"<b>PNI mit {net} in {city} ist aktiv.</b><br>Ein Cross-Connect im {dc}. Privat und schnell.",
"pnis.ready_in_about_n_days":"Fertig in etwa {n} Tagen",
"pnis.their_peering_team_says_us_east":"Ihr Peering-Team sagt, US East sei „kapazitätsbeschränkt“, was in Cloud-Sprache „nein“ heißt.",
"pnis.their_team_quotes_m_months":"Ihr Team nennt {m} Monate",
"pnis.up_the_moment_you_order":"Steht, sobald du bestellst",
"pnis.us_east_is_sold_out_until":"US East ist bis auf Weiteres ausverkauft. „Bis auf Weiteres“ ist auch ausverkauft.",
"pop_std.city_gets_the_standard_cost":"{city} bekommt den Standard: {n} × {model} für {cost}.",
"pop_std.clear":"Entfernen",
@ -3102,6 +3104,7 @@
"pops_transit_ix.after_consulting_with_management_the":"<b>„Nach Rücksprache mit dem Management …“</b><br>Der Preis ist gestiegen. Das Management wurde konsultiert.",
"pops_transit_ix.after_that_the_normal_price_returns":"Danach gilt wieder der normale Preis, plus eine kleine Treue-Verwaltungsgebühr.",
"pops_transit_ix.augment_ordered_with_net_eta":"<b>Erweiterung bei {net} bestellt.</b><br>{eta}.",
"pops_transit_ix.augment_with_net_is_up":"<b>Erweiterung mit {net} läuft:</b> {port}.",
"pops_transit_ix.de_kicks_group_customer_success":"DE-KICKS Group · Customer Success",
"pops_transit_ix.de_kicks_sales_is_still_aligning":"<b>Der DE-KICKS-Vertrieb „stimmt sich noch ab“.</b><br>Sie melden sich in {n} Tagen bei dir.",
"pops_transit_ix.de_kicks_will_circle_back_expect":"<b>DE-KICKS kommt „darauf zurück“.</b><br>Rechne innerhalb der nächsten Stunde mit einer Mail mit dem Betreff „Kurze Frage 🙂“.",
@ -3555,7 +3558,7 @@
"rules.on_call":"Rufbereitschaft",
"rules.one_small_network_one_tricky_goal":"Ein kleines Netz, ein kniffliges Ziel.",
"rules.puzzle":"Rätsel",
"rules.rare_outages_no_ddos_no_conferences":"Seltene Ausfälle, kein DDoS, kein Chaos-Affe, keine Konferenzen. Seekabel heilen ohne Kabelschiffe, Bauten dauern Tage, Preise bleiben stabil. Geduldige Kunden, leise Benachrichtigungen und ein Rettungskredit statt Game Over.",
"rules.rare_outages_no_ddos_pnis_at_once":"Seltene Ausfälle, kein DDoS, kein Chaos-Affe, keine Konferenzen. PNIs laufen, sobald du sie bestellst, Seekabel heilen ohne Kabelschiffe, Bauten dauern Tage, Preise bleiben stabil. Geduldige Kunden, leise Benachrichtigungen und ein Rettungskredit statt Game Over.",
"rules.real_lead_times_real_outages_a_real":"Echte Lieferzeiten, echte Ausfälle, ein echter Markt. Das klassische Spiel.",
"rules.rules_are_locked_for_this_network":"{rules}: Die Regeln sind für dieses Netz festgelegt.",
"rules.the_real_thing_your_pager_has":"Das echte Spiel. Dein Pager hat Meinungen.",
@ -3694,6 +3697,7 @@
"sites_peering_caches.net_declined_why":"<b>{net} hat abgelehnt.</b><br>{why}",
"sites_peering_caches.net_does_not_do_port_pnis":"<b>{net} macht keine {port}-PNIs.</b><br>Nichts unter 100G. Komm mit mehr Traffic wieder, oder mit einer größeren Optik.",
"sites_peering_caches.net_says_not_yet_send_them":"<b>{net} sagt: noch nicht.</b><br>Schick ihnen erst {min}+ Gbps.",
"sites_peering_caches.pni_with_net_is_up_already":"<b>PNI mit {net} läuft.</b><br>Der Cross-Connect in {dc} war noch am selben Nachmittag gepatcht.",
"sites_peering_caches.pni_with_net_ordered_eta_a":"<b>PNI mit {net} bestellt.</b><br>{eta}. Ein Cross-Connect im {dc}, sobald jemand die LOA findet.",
"sites_peering_caches.second_lag_member_added_one_member":"<b>Zweites LAG-Mitglied hinzugefügt.</b><br>Jetzt ein Mitglied in jedem Gebäude, also legt ein dunkles Gebäude nur den halben Port lahm.",
"sites_peering_caches.second_site_live_in_city_b":"<b>Zweiter Standort in {city} live.</b><br>{b} ist über deinen eigenen Metro-Ring mit {a} verbunden. Verschieb ein paar Uplinks in den Tabs Transit und Peering dorthin.",

View file

@ -3081,11 +3081,13 @@
"pnis.cancel_the_order":"Cancelar el pedido",
"pnis.delivery_2_to_6_weeks":"Entrega: de 2 a 6 semanas",
"pnis.delivery_about_a_month_sometimes_6":"Entrega: cerca de un mes, a veces de 6 a 12 meses",
"pnis.it_is_up_already":"Ya está activo",
"pnis.no_capacity_in_us_east_you":"Sin capacidad en US East. Puedes apuntarte a la lista de espera; la lista de espera también está sin capacidad.",
"pnis.pni_with_net_is_up_in":"<b>El PNI con {net} está activo en {city}.</b><br>Una interconexión cruzada en {dc}. Privada y rápida.",
"pnis.ready_in_about_n_days":"Listo en unos {n} días",
"pnis.their_peering_team_says_us_east":"Su equipo de peering dice que US East tiene «capacidad limitada», que en lenguaje de nube significa «no».",
"pnis.their_team_quotes_m_months":"Su equipo da {m} meses",
"pnis.up_the_moment_you_order":"Activo en cuanto lo pides",
"pnis.us_east_is_sold_out_until":"US East está agotado hasta nuevo aviso. El nuevo aviso también está agotado.",
"pop_std.city_gets_the_standard_cost":"{city} recibe el estándar: {n} × {model} por {cost}.",
"pop_std.clear":"Quitar",
@ -3100,6 +3102,7 @@
"pops_transit_ix.after_consulting_with_management_the":"<b>«Tras consultar con la dirección…»</b><br>El precio subió. Se consultó a la dirección.",
"pops_transit_ix.after_that_the_normal_price_returns":"Después, vuelve el precio normal, más una pequeña tarifa de administración de fidelidad.",
"pops_transit_ix.augment_ordered_with_net_eta":"<b>Ampliación pedida con {net}.</b><br>{eta}.",
"pops_transit_ix.augment_with_net_is_up":"<b>La ampliación con {net} está activa:</b> {port}.",
"pops_transit_ix.de_kicks_group_customer_success":"Grupo DE-KICKS · Éxito del cliente",
"pops_transit_ix.de_kicks_sales_is_still_aligning":"<b>Ventas de DE-KICKS sigue «alineándose».</b><br>Te responderán en {n} días.",
"pops_transit_ix.de_kicks_will_circle_back_expect":"<b>DE-KICKS «volverá sobre ello».</b><br>Espera un correo titulado «Una pregunta rápida 🙂» en la próxima hora.",
@ -3553,7 +3556,7 @@
"rules.on_call":"De guardia",
"rules.one_small_network_one_tricky_goal":"Una red pequeña, un objetivo con truco.",
"rules.puzzle":"Puzle",
"rules.rare_outages_no_ddos_no_conferences":"Pocas averías, sin DDoS, sin mono del caos, sin conferencias. Los cortes submarinos se reparan sin barcos cableros, las obras tardan días, los precios no se mueven. Clientes pacientes, notificaciones discretas y un préstamo de rescate en vez de fin de partida.",
"rules.rare_outages_no_ddos_pnis_at_once":"Pocas averías, sin DDoS, sin mono del caos, sin conferencias. Los PNI se activan en cuanto los pides, los cortes submarinos se reparan sin barcos cableros, las obras tardan días, los precios no se mueven. Clientes pacientes, notificaciones discretas y un préstamo de rescate en vez de fin de partida.",
"rules.real_lead_times_real_outages_a_real":"Plazos reales, caídas reales, un mercado real. El juego clásico.",
"rules.rules_are_locked_for_this_network":"{rules}: las reglas están fijadas para esta red.",
"rules.the_real_thing_your_pager_has":"El juego de verdad. Tu busca tiene opiniones.",
@ -3692,6 +3695,7 @@
"sites_peering_caches.net_declined_why":"<b>{net} rechazó.</b><br>{why}",
"sites_peering_caches.net_does_not_do_port_pnis":"<b>{net} no hace PNIs de {port}.</b><br>Nada menor de 100G. Vuelve con más tráfico, o una óptica mayor.",
"sites_peering_caches.net_says_not_yet_send_them":"<b>{net} dice que todavía no.</b><br>Mándale primero {min}+ Gbps.",
"sites_peering_caches.pni_with_net_is_up_already":"<b>El PNI con {net} está activo.</b><br>La interconexión en {dc} se hizo esa misma tarde.",
"sites_peering_caches.pni_with_net_ordered_eta_a":"<b>PNI con {net} pedido.</b><br>{eta}. Una interconexión cruzada en {dc}, cuando alguien encuentre la LOA.",
"sites_peering_caches.second_lag_member_added_one_member":"<b>Segundo miembro LAG añadido.</b><br>Ahora hay un miembro en cada edificio, así que un edificio a oscuras solo tumba la mitad del puerto.",
"sites_peering_caches.second_site_live_in_city_b":"<b>Segunda sede activa en {city}.</b><br>{b} está unida a {a} por tu propio anillo metropolitano. Mueve algunos uplinks allí desde las pestañas Tránsito y Peering.",

View file

@ -3081,11 +3081,13 @@
"pnis.cancel_the_order":"Annuler la commande",
"pnis.delivery_2_to_6_weeks":"Livraison : 2 à 6 semaines",
"pnis.delivery_about_a_month_sometimes_6":"Livraison : environ un mois, parfois 6 à 12 mois",
"pnis.it_is_up_already":"C'est déjà actif",
"pnis.no_capacity_in_us_east_you":"Pas de capacité en US East. Vous pouvez vous inscrire sur la liste d’attente ; la liste d’attente est aussi à court de capacité.",
"pnis.pni_with_net_is_up_in":"<b>La PNI avec {net} est en service à {city}.</b><br>Un cross-connect chez {dc}. Privé et rapide.",
"pnis.ready_in_about_n_days":"Prête dans environ {n} jours",
"pnis.their_peering_team_says_us_east":"Leur équipe de peering dit qu’US East est « capacity constrained », ce qui veut dire « non » en langage cloud.",
"pnis.their_team_quotes_m_months":"Leur équipe annonce {m} mois",
"pnis.up_the_moment_you_order":"Actif dès la commande",
"pnis.us_east_is_sold_out_until":"US East est complet jusqu’à nouvel ordre. Le nouvel ordre est complet aussi.",
"pop_std.city_gets_the_standard_cost":"{city} reçoit le standard : {n} × {model} pour {cost}.",
"pop_std.clear":"Effacer",
@ -3100,6 +3102,7 @@
"pops_transit_ix.after_consulting_with_management_the":"<b>« Après consultation de la direction… »</b><br>Le prix a augmenté. La direction a été consultée.",
"pops_transit_ix.after_that_the_normal_price_returns":"Ensuite, le prix normal revient, plus de petits frais de gestion de fidélité.",
"pops_transit_ix.augment_ordered_with_net_eta":"<b>Extension commandée chez {net}.</b><br>{eta}.",
"pops_transit_ix.augment_with_net_is_up":"<b>L'extension avec {net} est active :</b> {port}.",
"pops_transit_ix.de_kicks_group_customer_success":"DE-KICKS Group · Customer Success",
"pops_transit_ix.de_kicks_sales_is_still_aligning":"<b>Les commerciaux DE-KICKS sont encore en train de « s’aligner ».</b><br>Ils reviendront vers toi dans {n} jours.",
"pops_transit_ix.de_kicks_will_circle_back_expect":"<b>DE-KICKS va « revenir vers toi ».</b><br>Attends-toi à un mail intitulé « Petite question 🙂 » dans l’heure.",
@ -3553,7 +3556,7 @@
"rules.on_call":"D’astreinte",
"rules.one_small_network_one_tricky_goal":"Un petit réseau, un objectif retors.",
"rules.puzzle":"Casse-tête",
"rules.rare_outages_no_ddos_no_conferences":"Pannes rares, pas de DDoS, pas de singe du chaos, pas de conférences. Les coupures sous-marines se réparent sans navire câblier, les chantiers prennent des jours, les prix ne bougent pas. Clients patients, notifications discrètes et un prêt de sauvetage au lieu de la fin de partie.",
"rules.rare_outages_no_ddos_pnis_at_once":"Pannes rares, pas de DDoS, pas de singe du chaos, pas de conférences. Les PNI sont actifs dès la commande, les coupures sous-marines se réparent sans navire câblier, les chantiers prennent des jours, les prix ne bougent pas. Clients patients, notifications discrètes et un prêt de sauvetage au lieu de la fin de partie.",
"rules.real_lead_times_real_outages_a_real":"De vrais délais, de vraies pannes, un vrai marché. Le jeu classique.",
"rules.rules_are_locked_for_this_network":"{rules} : les règles sont verrouillées pour ce réseau.",
"rules.the_real_thing_your_pager_has":"Le vrai jeu. Ton bipeur a des opinions.",
@ -3692,6 +3695,7 @@
"sites_peering_caches.net_declined_why":"<b>{net} a refusé.</b><br>{why}",
"sites_peering_caches.net_does_not_do_port_pnis":"<b>{net} ne fait pas de PNI en {port}.</b><br>Rien en dessous de 100G. Revenez avec plus de trafic, ou une optique plus grosse.",
"sites_peering_caches.net_says_not_yet_send_them":"<b>{net} dit : pas encore.</b><br>Envoie-leur d’abord {min}+ Gbps.",
"sites_peering_caches.pni_with_net_is_up_already":"<b>Le PNI avec {net} est actif.</b><br>Le cross-connect à {dc} a été brassé l'après-midi même.",
"sites_peering_caches.pni_with_net_ordered_eta_a":"<b>PNI avec {net} commandée.</b><br>{eta}. Un cross-connect chez {dc}, dès que quelqu’un aura retrouvé la LOA.",
"sites_peering_caches.second_lag_member_added_one_member":"<b>Second membre de LAG ajouté.</b><br>Un membre dans chaque bâtiment désormais : un bâtiment éteint ne coupe plus que la moitié du port.",
"sites_peering_caches.second_site_live_in_city_b":"<b>Second site actif à {city}.</b><br>{b} est relié à {a} par ton propre anneau métropolitain. Déplaces-y quelques uplinks depuis les onglets Transit et Peering.",

View file

@ -3081,11 +3081,13 @@
"pnis.cancel_the_order":"Annulla l’ordine",
"pnis.delivery_2_to_6_weeks":"Consegna: da 2 a 6 settimane",
"pnis.delivery_about_a_month_sometimes_6":"Consegna: circa un mese, a volte da 6 a 12 mesi",
"pnis.it_is_up_already":"È già attivo",
"pnis.no_capacity_in_us_east_you":"Niente capacità in US East. Puoi iscriverti alla lista d’attesa; anche la lista d’attesa è senza capacità.",
"pnis.pni_with_net_is_up_in":"<b>La PNI con {net} è attiva a {city}.</b><br>Un cross-connect in {dc}. Privato e veloce.",
"pnis.ready_in_about_n_days":"Pronta in circa {n} giorni",
"pnis.their_peering_team_says_us_east":"Il loro team di peering dice che US East è “capacity constrained”, che in linguaggio cloud vuol dire “no”.",
"pnis.their_team_quotes_m_months":"Il loro team parla di {m} mesi",
"pnis.up_the_moment_you_order":"Attivo appena lo ordini",
"pnis.us_east_is_sold_out_until":"US East è esaurito fino a nuovo avviso. Anche il nuovo avviso è esaurito.",
"pop_std.city_gets_the_standard_cost":"{city} riceve lo standard: {n} × {model} per {cost}.",
"pop_std.clear":"Rimuovi",
@ -3100,6 +3102,7 @@
"pops_transit_ix.after_consulting_with_management_the":"<b>“Dopo un confronto con il management…”</b><br>Il prezzo è salito. Il management è stato consultato.",
"pops_transit_ix.after_that_the_normal_price_returns":"Dopodiché torna il prezzo normale, più una piccola commissione di gestione fedeltà.",
"pops_transit_ix.augment_ordered_with_net_eta":"<b>Ampliamento ordinato con {net}.</b><br>{eta}.",
"pops_transit_ix.augment_with_net_is_up":"<b>L'ampliamento con {net} è attivo:</b> {port}.",
"pops_transit_ix.de_kicks_group_customer_success":"DE-KICKS Group · Customer Success",
"pops_transit_ix.de_kicks_sales_is_still_aligning":"<b>Il commerciale DE-KICKS si sta ancora “allineando”.</b><br>Ti ricontatteranno tra {n} giorni.",
"pops_transit_ix.de_kicks_will_circle_back_expect":"<b>DE-KICKS ti “ricontatterà”.</b><br>Entro un’ora aspettati una mail intitolata “Domandina veloce 🙂”.",
@ -3553,7 +3556,7 @@
"rules.on_call":"Reperibile",
"rules.one_small_network_one_tricky_goal":"Una piccola rete, un obiettivo insidioso.",
"rules.puzzle":"Rompicapo",
"rules.rare_outages_no_ddos_no_conferences":"Guasti rari, niente DDoS, niente scimmia del caos, niente conferenze. I tagli sottomarini si riparano senza navi posacavi, i cantieri durano giorni, i prezzi restano fermi. Clienti pazienti, notifiche discrete e un prestito di salvataggio invece del game over.",
"rules.rare_outages_no_ddos_pnis_at_once":"Guasti rari, niente DDoS, niente scimmia del caos, niente conferenze. I PNI sono attivi appena li ordini, i tagli sottomarini si riparano senza navi posacavi, i cantieri durano giorni, i prezzi restano fermi. Clienti pazienti, notifiche discrete e un prestito di salvataggio invece del game over.",
"rules.real_lead_times_real_outages_a_real":"Tempi di consegna veri, guasti veri, un mercato vero. Il gioco classico.",
"rules.rules_are_locked_for_this_network":"{rules}: le regole sono bloccate per questa rete.",
"rules.the_real_thing_your_pager_has":"Il gioco vero. Il tuo cercapersone ha delle opinioni.",
@ -3692,6 +3695,7 @@
"sites_peering_caches.net_declined_why":"<b>{net} ha rifiutato.</b><br>{why}",
"sites_peering_caches.net_does_not_do_port_pnis":"<b>{net} non fa PNI da {port}.</b><br>Niente sotto i 100G. Torna con più traffico, o con un’ottica più grande.",
"sites_peering_caches.net_says_not_yet_send_them":"<b>{net} dice: non ancora.</b><br>Prima mandagli {min}+ Gbps.",
"sites_peering_caches.pni_with_net_is_up_already":"<b>Il PNI con {net} è attivo.</b><br>Il cross-connect a {dc} è stato patchato il pomeriggio stesso.",
"sites_peering_caches.pni_with_net_ordered_eta_a":"<b>PNI con {net} ordinata.</b><br>{eta}. Un cross-connect in {dc}, appena qualcuno trova la LOA.",
"sites_peering_caches.second_lag_member_added_one_member":"<b>Secondo membro LAG aggiunto.</b><br>Ora c’è un membro per edificio, così un edificio al buio si porta via solo metà porta.",
"sites_peering_caches.second_site_live_in_city_b":"<b>Secondo sito attivo a {city}.</b><br>{b} è collegato a {a} dal tuo anello metro. Sposta lì qualche uplink dalle schede Transit e Peering.",

View file

@ -3081,11 +3081,13 @@
"pnis.cancel_the_order":"Cancelar o pedido",
"pnis.delivery_2_to_6_weeks":"Entrega: de 2 a 6 semanas",
"pnis.delivery_about_a_month_sometimes_6":"Entrega: cerca de um mês, às vezes de 6 a 12 meses",
"pnis.it_is_up_already":"Já está ativo",
"pnis.no_capacity_in_us_east_you":"Sem capacidade em US East. Você pode entrar na lista de espera; a lista de espera também está sem capacidade.",
"pnis.pni_with_net_is_up_in":"<b>A PNI com {net} está no ar em {city}.</b><br>Um cross-connect em {dc}. Privado e rápido.",
"pnis.ready_in_about_n_days":"Pronta em cerca de {n} dias",
"pnis.their_peering_team_says_us_east":"O time de peering deles diz que US East está “capacity constrained”, que na língua da nuvem quer dizer “não”.",
"pnis.their_team_quotes_m_months":"A equipe deles fala em {m} meses",
"pnis.up_the_moment_you_order":"Ativo assim que você pede",
"pnis.us_east_is_sold_out_until":"US East está esgotado até segunda ordem. A segunda ordem também esgotou.",
"pop_std.city_gets_the_standard_cost":"{city} recebe o padrão: {n} × {model} por {cost}.",
"pop_std.clear":"Limpar",
@ -3100,6 +3102,7 @@
"pops_transit_ix.after_consulting_with_management_the":"<b>“Depois de consultar a diretoria…”</b><br>O preço subiu. A diretoria foi consultada.",
"pops_transit_ix.after_that_the_normal_price_returns":"Depois disso, volta o preço normal, mais uma pequena taxa de administração de fidelidade.",
"pops_transit_ix.augment_ordered_with_net_eta":"<b>Ampliação encomendada com {net}.</b><br>{eta}.",
"pops_transit_ix.augment_with_net_is_up":"<b>A ampliação com {net} está ativa:</b> {port}.",
"pops_transit_ix.de_kicks_group_customer_success":"DE-KICKS Group · Customer Success",
"pops_transit_ix.de_kicks_sales_is_still_aligning":"<b>O comercial da DE-KICKS ainda está “se alinhando”.</b><br>Eles retornam em {n} dias.",
"pops_transit_ix.de_kicks_will_circle_back_expect":"<b>A DE-KICKS vai “dar um retorno”.</b><br>Espere um e-mail com o assunto “Pergunta rápida 🙂” dentro de uma hora.",
@ -3553,7 +3556,7 @@
"rules.on_call":"De plantão",
"rules.one_small_network_one_tricky_goal":"Uma rede pequena, um objetivo traiçoeiro.",
"rules.puzzle":"Quebra-cabeça",
"rules.rare_outages_no_ddos_no_conferences":"Falhas raras, sem DDoS, sem macaco do caos, sem conferências. Cortes submarinos se reparam sem navios cabreiros, obras levam dias, preços não mudam. Clientes pacientes, notificações discretas e um empréstimo de resgate em vez de fim de jogo.",
"rules.rare_outages_no_ddos_pnis_at_once":"Falhas raras, sem DDoS, sem macaco do caos, sem conferências. PNIs ficam ativos assim que você pede, cortes submarinos se reparam sem navios cabreiros, obras levam dias, preços não mudam. Clientes pacientes, notificações discretas e um empréstimo de resgate em vez de fim de jogo.",
"rules.real_lead_times_real_outages_a_real":"Prazos reais, falhas reais, um mercado real. O jogo clássico.",
"rules.rules_are_locked_for_this_network":"{rules}: as regras estão travadas para esta rede.",
"rules.the_real_thing_your_pager_has":"O jogo de verdade. O seu pager tem opiniões.",
@ -3692,6 +3695,7 @@
"sites_peering_caches.net_declined_why":"<b>{net} recusou.</b><br>{why}",
"sites_peering_caches.net_does_not_do_port_pnis":"<b>{net} não faz PNI de {port}.</b><br>Nada abaixo de 100G. Volte com mais tráfego, ou uma óptica maior.",
"sites_peering_caches.net_says_not_yet_send_them":"<b>{net} diz: ainda não.</b><br>Mande {min}+ Gbps pra eles primeiro.",
"sites_peering_caches.pni_with_net_is_up_already":"<b>O PNI com {net} está ativo.</b><br>O cross-connect em {dc} foi feito na mesma tarde.",
"sites_peering_caches.pni_with_net_ordered_eta_a":"<b>PNI com {net} encomendada.</b><br>{eta}. Um cross-connect em {dc}, assim que alguém achar a LOA.",
"sites_peering_caches.second_lag_member_added_one_member":"<b>Segundo membro do LAG adicionado.</b><br>Agora tem um membro em cada prédio, então um prédio apagado só derruba metade da porta.",
"sites_peering_caches.second_site_live_in_city_b":"<b>Segundo site ativo em {city}.</b><br>{b} está ligado a {a} pelo seu próprio anel metro. Mova alguns uplinks pra lá nas abas Transit e Peering.",

View file

@ -5,12 +5,13 @@
Scenarios and the weekly challenge run on On-call plus their own S.scn.rules (scnRule()). */
// sea: cable ships sail out to subsea cuts, or (timer) a cut mends on its own clock. confs: conference season.
// broke: deep in the red ends the game, or (rescue) a state loan keeps it going. moods: patient customers sour half as fast.
const RULE_DEF={clock:true,chaos:'normal',lead:'real',market:true,money:'normal',gates:'ladder',sea:'ships',confs:true,broke:'lose',moods:'normal',mods:[]};
const RULE_LATE=['sea','confs','broke','moods'];
const RULE_OK={clock:[true,false],chaos:['none','calm','normal','spicy'],lead:['real','quick'],market:[true,false],money:['normal','infinite'],gates:['ladder','open'],sea:['ships','timer'],confs:[true,false],broke:['lose','rescue'],moods:['normal','patient']};
// pnis: PNIs and their augments wait for the other network's team, or (instant) are up the moment they are ordered.
const RULE_DEF={clock:true,chaos:'normal',lead:'real',market:true,money:'normal',gates:'ladder',sea:'ships',confs:true,broke:'lose',moods:'normal',pnis:'wait',mods:[]};
const RULE_LATE=['sea','confs','broke','moods','pnis'];
const RULE_OK={clock:[true,false],chaos:['none','calm','normal','spicy'],lead:['real','quick'],market:[true,false],money:['normal','infinite'],gates:['ladder','open'],sea:['ships','timer'],confs:[true,false],broke:['lose','rescue'],moods:['normal','patient'],pnis:['wait','instant']};
// i: icon, n: name, d: the one-line joke, x: what is different, in small print.
const PRESETS={
soft:{i:'☕',n:tr('rules.best_effort'),d:tr('rules.no_sla_no_pager_no_promises'),x:tr('rules.rare_outages_no_ddos_no_conferences'),clock:true,chaos:'calm',lead:'quick',market:false,money:'normal',gates:'ladder',sea:'timer',confs:false,broke:'rescue',moods:'patient'},
soft:{i:'☕',n:tr('rules.best_effort'),d:tr('rules.no_sla_no_pager_no_promises'),x:tr('rules.rare_outages_no_ddos_pnis_at_once'),clock:true,chaos:'calm',lead:'quick',market:false,money:'normal',gates:'ladder',sea:'timer',confs:false,broke:'rescue',moods:'patient',pnis:'instant'},
freeze:{i:'🧊',n:tr('rules.change_freeze'),d:tr('rules.nobody_touches_prod_even_the_backhoes'),x:tr('rules.a_third_of_the_outages_no_ddos_pnis'),clock:true,chaos:'calm',lead:'quick',market:false,money:'normal',gates:'ladder'},
oncall:{i:'📟',n:tr('rules.on_call'),d:tr('rules.the_real_thing_your_pager_has'),x:tr('rules.real_lead_times_real_outages_a_real'),clock:true,chaos:'normal',lead:'real',market:true,money:'normal',gates:'ladder'},
bgp:{i:'🔥',n:tr('rules.bgp_at_3_a_m'),d:tr('rules.everything_is_on_fire_and_it'),x:tr('rules.more_and_longer_outages_more_ddos'),clock:true,chaos:'spicy',lead:'real',market:true,money:'normal',gates:'ladder'},

View file

@ -5,14 +5,16 @@ const pniBig=id=>{const n=NET[id];return n.type==='t1'||(n.type==='cdn'&&n.pol!=
const pniMin=id=>{const n=NET[id];return n.type==='t1'&&!pniG1(id)||(n.type==='cdn'&&n.pol!=='open')?1:0;};
const pniG1=id=>id==='dtk';
// A beer with their peering coordinator at a conference halves the wait. It is how it really works.
const PNI_SLOW=0.15,pniLead=id=>{const n=pniBig(id)?(Math.random()<PNI_SLOW?180+Math.floor(Math.random()*186):30):14+Math.floor(Math.random()*29);return leadDays(S.conf&&S.conf.until>S.day?Math.round(n/2):n);};
const PNI_SLOW=0.15,pniNow=()=>rule('pnis')==='instant',pniLead=id=>{if(pniNow())return 0;const n=pniBig(id)?(Math.random()<PNI_SLOW?180+Math.floor(Math.random()*186):30):14+Math.floor(Math.random()*29);return leadDays(S.conf&&S.conf.until>S.day?Math.round(n/2):n);};
const pniG=p=>p.g1?1:PORT[p.tier].g,pniPN=p=>p.g1?'1G':PORT[p.tier].n,pniOn=p=>!(p.ready>S.day);
const pniEta=id=>pniBig(id)?tr('pnis.delivery_about_a_month_sometimes_6'):tr('pnis.delivery_2_to_6_weeks');
const PNI_G1_COST=1200,pniWhen=n=>n>=60?tr('pnis.their_team_quotes_m_months',{m:Math.round(n/30)}):tr('pnis.ready_in_about_n_days',{n});
const pniEta=id=>pniNow()?tr('pnis.up_the_moment_you_order'):pniBig(id)?tr('pnis.delivery_about_a_month_sometimes_6'):tr('pnis.delivery_2_to_6_weeks');
const PNI_G1_COST=1200,pniWhen=n=>n<=0?tr('pnis.it_is_up_already'):n>=60?tr('pnis.their_team_quotes_m_months',{m:Math.round(n/30)}):tr('pnis.ready_in_about_n_days',{n});
function pniWait(p,c){return `<div class="kv"><span>${(p.n||1)>1?p.n+'×':''}${pniPN(p)} PNI</span><b>${tr('common.on_order')}</b></div><div class="meta">${tr('pnis.about_n_days_to_go_nothing',{n:Math.max(0,p.ready-S.day)})}</div><div class="btns">${btn(tr('common.chase_it'),'pniChase',{id:p.id},'ghost sm')}${btn(UI.confirm===p.id?tr('common.really_remove'):tr('pnis.cancel_the_order'),'cancelPni',{id:p.id},'ghost sm')}</div>`;}
function pniDay(d){for(const p of S.pni){const nm=esc(NET[p.net].name),city=esc(CITY[p.city].name);
if(p.ready===d)toast(tr('pnis.pni_with_net_is_up_in',{net:nm,city,dc:esc(siteName(p.city,'a'))}),'good');
if(p.up&&p.up.ready<=d){p.tier=p.up.tier;p.n=p.up.n;if(p.up.site==='ab'&&p.n>=2&&S.pops[p.city]&&S.pops[p.city].site2)p.site='ab';if(p.up.g1)p.g1=true;else delete p.g1;delete p.up;toast(tr('pnis.augment_with_net_delivered_in_city',{net:nm,city,port:((p.n||1)>1?p.n+'×':'')+pniPN(p)}),'good');}}}
if(p.up&&p.up.ready<=d){pniUpDone(p);toast(tr('pnis.augment_with_net_delivered_in_city',{net:nm,city,port:((p.n||1)>1?p.n+'×':'')+pniPN(p)}),'good');}}}
// An augment arrives: the new port size, LAG and 1G flag replace the old ones.
function pniUpDone(p){p.tier=p.up.tier;p.n=p.up.n;if(p.up.site==='ab'&&p.n>=2&&S.pops[p.city]&&S.pops[p.city].site2)p.site='ab';if(p.up.g1)p.g1=true;else delete p.g1;delete p.up;}
// Microsnoft has no capacity on the US east coast. Not for a PNI, not at an exchange, not for anyone.
const US_EAST=['ash','nyc','bos','atn','mia'];
const MSF_NOPE=[N_('pnis.no_capacity_in_us_east_you'),N_('pnis.us_east_is_sold_out_until'),N_('pnis.their_peering_team_says_us_east'),N_('pnis.a_new_region_is_coming_online')];

View file

@ -11,7 +11,7 @@ function pniQuote(city,net,tier,reserved=0){tier=+tier;const g1=tier===-1;if(g1)
return {city,net,tier,g1,ex,cost,slots,why};}
function pniPlace(q){const {city,net,tier,g1,ex}=q,lead=pniLead(net);
if(S.conf&&S.conf.until>S.day)S.stats.beerPni=1;
if(ex)ex.up={tier,n:ex.n||1,ready:S.day+lead,g1:false};else S.pni.push({id:uid(),city,net,tier,g1:g1||undefined,ready:S.day+lead});
if(ex){ex.up={tier,n:ex.n||1,ready:S.day+lead,g1:false};if(!lead)pniUpDone(ex);}else S.pni.push({id:uid(),city,net,tier,g1:g1||undefined,ready:S.day+lead});
return lead;}
function pniBatch(net,tier){tier=+tier;const all=net===null;if(!S||(!all&&!isNet(net))||!Number.isInteger(tier)||(tier===-1?all||!pniG1(net):!PORT[tier]||!portShown(tier)))return null;
const shared=[],orders=[],blocked=[],reserved={};let kept=0,cost=0,mo=0,raised=0;

View file

@ -4,7 +4,8 @@ function bizSfOf(r,c){const d=r.bizDem&&r.bizDem[c];return teRules()&&teRules().
function bCities(o){return o.sites?o.sites.slice():[o.city,o.city2].filter(Boolean);}
function bHas(o){return !!BIZ_T[o.type].cap||bCities(o).every(c=>S.pops[c]);}
function eventLive(b){return BIZ_T[b.type].event&&S.day>=b.start&&S.day<b.start+b.dur;}
function bRisk(b){return BIZ_T[b.type]?.gaming?`<div class="meta">⚠️ ${tr('customers_and_events.gaming_attracts_attacks')}</div>`:'';}
// No warning where nobody attacks (Best Effort, Change Freeze, puzzles, the sandbox's calm).
function bRisk(b){return BIZ_T[b.type]?.gaming&&!ddosOff()?`<div class="meta">⚠️ ${tr('customers_and_events.gaming_attracts_attacks')}</div>`:'';}
function bTerms(o){const T=BIZ_T[o.type];if(T.cap)return capTerms(o);
if(T.event){const live=S.day>=o.start;return tr('customers_and_events.bw_extra_for_d_days_when',{bw:fmtG(o.bw),d:o.dur,when:live?tr('customers_and_events.day_n_of_d',{n:S.day-o.start+1,d:o.dur}):tr('customers_and_events.starting_in_n_d',{n:o.start-S.day}),fee:fmt$(o.fee)});}
if(T.sdwan)return tr('customers_and_events.n_sites_list_bw_per_site',{n:o.sites.length,list:o.sites.map(c=>CITY[c].name).join(', '),bw:fmtG(o.bw),price:fmt$(o.bw*o.rate)});

View file

@ -6,7 +6,7 @@ Object.assign(ACT,{
lagT:({id,d})=>{d=+d;if(d!==1&&d!==-1)return;const t=S.transit.find(x=>x.id===id);if(!t)return;const n=(t.n||1)+(+d);if(n<1||n>LAG_MAX)return;if(+d>0){if(!portOk(t.city,t.tier)||!portGate(t.city,PORT_SLOT(t.tier)))return;if(!spend(PORT[t.tier].setup))return;}t.n=n;if(n<2&&t.site==='ab')t.site='a';toast(+d>0?tr('pops_transit_ix.lag_member_added_net_in_city',{net:esc(NET[t.net].name),city:CITY[t.city].name,lag:lagName(t.tier,n)}):tr('pops_transit_ix.lag_member_removed'),'good');after();},
lagP:({id,d})=>{d=+d;if(d!==1&&d!==-1)return;const p=S.pni.find(x=>x.id===id);if(!p)return;const n=(p.n||1)+(+d);if(n<1||n>LAG_MAX)return;if(d>0&&(!pniOn(p)||p.up||msfNope(p.net,p.city)))return;if(+d>0&&(!portGate(p.city,PORT_SLOT(p.tier))||!spend(1500+PORT[p.tier].setup/2)))return;
// A LAG member is an augment: the big networks take months for that too.
if(d>0){const lead=pniLead(p.net);p.up={tier:p.tier,n,ready:S.day+lead,g1:!!p.g1};toast(tr('pops_transit_ix.augment_ordered_with_net_eta',{net:esc(NET[p.net].name),eta:pniWhen(lead)}),'good');after();return;}p.n=n;if(n<2&&p.site==='ab')p.site='a';sfx('build');after();},
if(d>0){const lead=pniLead(p.net);p.up={tier:p.tier,n,ready:S.day+lead,g1:!!p.g1};if(!lead)pniUpDone(p);toast(lead?tr('pops_transit_ix.augment_ordered_with_net_eta',{net:esc(NET[p.net].name),eta:pniWhen(lead)}):tr('pops_transit_ix.augment_with_net_is_up',{net:esc(NET[p.net].name),port:p.n+'×'+pniPN(p)}),'good');after();return;}p.n=n;if(n<2&&p.site==='ab')p.site='a';sfx('build');after();},
lagIx:({city,d})=>{d=+d;if(d!==1&&d!==-1)return;if(!isIx(city)||S.ixp[city]===undefined||S.myIx[city]||!S.pops[ixCity(city)])return;S.ixn=S.ixn||{};const n=(S.ixn[city]||1)+(+d);if(n<1||n>LAG_MAX)return;if(+d>0&&(!portGate(ixCity(city),PORT_SLOT(S.ixp[city]))||!spend(ixPortMo(city,S.ixp[city]))))return;S.ixn[city]=n;if(n<2&&S.ixSite&&S.ixSite[city]==='ab')S.ixSite[city]='a';sfx('build');after();},
cancelTransit:({id,ok})=>{if(!ok&&UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.transit=S.transit.filter(t=>t.id!==id);UI.confirm=null;after();},
buyIx:({city,tier,signed})=>{tier=+tier;if(!PORT[tier]||!ixName(city)||(!S.pops[ixCity(city)]&&(!remoteCities().includes(ixCity(city))||tier>1))||(S.ixp[city]!==undefined&&tier<=S.ixp[city]))return;if(S.pops[ixCity(city)]&&!portOk(ixCity(city),tier)){toast(tr('actions.your_router_can_t_take_a',{port:PORT[tier].n}),'bad');sfx('err');return;}{const h0=S.ixp[city]!==undefined;if(!S.myIx[city]&&!portGate(ixCity(city),h0?(PORT_SLOT(tier)-PORT_SLOT(S.ixp[city]))*((S.ixn||{})[city]||1):PORT_SLOT(tier)))return;}

View file

@ -17,7 +17,7 @@ Object.assign(ACT,{
peerAll:({city})=>{if(!isIx(city)||S.ixp[city]===undefined)return;const set=ixSessions(city);let n=0;for(const id of ixMembers(city))if(!set.has(id)&&peerOk(id,'ix',city).ok){S.peers[id+'@'+city]=true;n++;}if(!n)return;toast(trn('sites_peering_caches.n_new_session_at_ix_small',n,{ix:esc(ixName(city))}),'good',[],{a:'city',v:ixCity(city)});sfx('build');after();},
tailTog:()=>{UI.tailOpen=!UI.tailOpen;renderLeft();},
pni:({city,net,tier})=>{const q=pniQuote(city,net,tier);if(!q)return;if(q.why){toast(q.why,'bad');sfx('err');after();return;}if(!spend(q.cost))return;const lead=pniPlace(q);
toast(tr('sites_peering_caches.pni_with_net_ordered_eta_a',{net:esc(NET[net].name),eta:pniWhen(lead),dc:esc(siteName(city,'a'))}),'good');after();},
toast(lead?tr('sites_peering_caches.pni_with_net_ordered_eta_a',{net:esc(NET[net].name),eta:pniWhen(lead),dc:esc(siteName(city,'a'))}):tr('sites_peering_caches.pni_with_net_is_up_already',{net:esc(NET[net].name),dc:esc(siteName(city,'a'))}),'good');after();},
pniAllOpen:({net})=>{pniAllModal(net);},
pniAllSize:({v})=>{if(!UI.pniAll)return;pniAllModal(UI.pniAll.net,+v);$('modalCard').querySelector('[data-chg="pniAllSize"]')?.focus();},
pniAll:({net,tier})=>{const b=pniBatch(net,tier);if(!b||!b.orders.length)return;if(!spend(b.cost))return;

View file

@ -3082,11 +3082,13 @@
"pnis.cancel_the_order":"Cancel the order",
"pnis.delivery_2_to_6_weeks":"Delivery: 2 to 6 weeks",
"pnis.delivery_about_a_month_sometimes_6":"Delivery: about a month, sometimes 6 to 12 months",
"pnis.it_is_up_already":"It is up already",
"pnis.no_capacity_in_us_east_you":"No capacity in US East. You can join the waitlist; the waitlist is also out of capacity.",
"pnis.pni_with_net_is_up_in":"<b>PNI with {net} is up in {city}.</b><br>A cross-connect in {dc}. Private and fast.",
"pnis.ready_in_about_n_days":"Ready in about {n} days",
"pnis.their_peering_team_says_us_east":"Their peering team says US East is “capacity constrained”, which is cloud for “no”.",
"pnis.their_team_quotes_m_months":"Their team quotes {m} months",
"pnis.up_the_moment_you_order":"Up the moment you order it",
"pnis.us_east_is_sold_out_until":"US East is sold out until further notice. Further notice is also sold out.",
"pop_std.city_gets_the_standard_cost":"{city} gets the standard: {n} × {model} for {cost}.",
"pop_std.clear":"Clear",
@ -3101,6 +3103,7 @@
"pops_transit_ix.after_consulting_with_management_the":"<b>\"After consulting with management…\"</b><br>The price went up. Management was consulted.",
"pops_transit_ix.after_that_the_normal_price_returns":"After that, the normal price returns, plus a small loyalty administration fee.",
"pops_transit_ix.augment_ordered_with_net_eta":"<b>Augment ordered with {net}.</b><br>{eta}.",
"pops_transit_ix.augment_with_net_is_up":"<b>Augment with {net} is up:</b> {port}.",
"pops_transit_ix.de_kicks_group_customer_success":"DE-KICKS Group · Customer Success",
"pops_transit_ix.de_kicks_sales_is_still_aligning":"<b>DE-KICKS sales is still \"aligning\".</b><br>They will get back to you in {n} days.",
"pops_transit_ix.de_kicks_will_circle_back_expect":"<b>DE-KICKS will \"circle back\".</b><br>Expect an email titled \"Quick question 🙂\" within the hour.",
@ -3554,7 +3557,7 @@
"rules.on_call":"On-call",
"rules.one_small_network_one_tricky_goal":"One small network, one tricky goal.",
"rules.puzzle":"Puzzle",
"rules.rare_outages_no_ddos_no_conferences":"Rare outages, no DDoS, no chaos monkey, no conferences. Sea cuts mend without cable ships, builds take days, prices stay put. Patient customers, quiet notifications, and a rescue loan instead of game over.",
"rules.rare_outages_no_ddos_pnis_at_once":"Rare outages, no DDoS, no chaos monkey, no conferences. PNIs are up the moment you order them, sea cuts mend without cable ships, builds take days, prices stay put. Patient customers, quiet notifications, and a rescue loan instead of game over.",
"rules.real_lead_times_real_outages_a_real":"Real lead times, real outages, a real market. The classic game.",
"rules.rules_are_locked_for_this_network":"{rules}: rules are locked for this network.",
"rules.the_real_thing_your_pager_has":"The real thing. Your pager has opinions.",
@ -3693,6 +3696,7 @@
"sites_peering_caches.net_declined_why":"<b>{net} declined.</b><br>{why}",
"sites_peering_caches.net_does_not_do_port_pnis":"<b>{net} does not do {port} PNIs.</b><br>Nothing smaller than 100G. Come back with more traffic, or a bigger optic.",
"sites_peering_caches.net_says_not_yet_send_them":"<b>{net} says not yet.</b><br>Send them {min}+ Gbps first.",
"sites_peering_caches.pni_with_net_is_up_already":"<b>PNI with {net} is up.</b><br>The cross-connect in {dc} was patched the same afternoon.",
"sites_peering_caches.pni_with_net_ordered_eta_a":"<b>PNI with {net} ordered.</b><br>{eta}. A cross-connect in {dc}, once somebody finds the LOA.",
"sites_peering_caches.second_lag_member_added_one_member":"<b>Second LAG member added.</b><br>One member in each building now, so a dark building only takes out half the port.",
"sites_peering_caches.second_site_live_in_city_b":"<b>Second site live in {city}.</b><br>{b} is joined to {a} by your own metro ring. Move some uplinks there from the Transit and Peering tabs.",

View file

@ -12,7 +12,7 @@ test('Best Effort is a Normal preset with its own rules, kept through save and l
const { ev, errors } = load();
start(ev, 'soft');
assert.equal(ev('rulePreset()'), 'soft');
assert.deepEqual(J(ev, "['chaos','lead','market','sea','confs','broke','moods'].map(rule)"), ['calm', 'quick', false, 'timer', false, 'rescue', 'patient']);
assert.deepEqual(J(ev, "['chaos','lead','market','sea','confs','broke','moods','pnis'].map(rule)"), ['calm', 'quick', false, 'timer', false, 'rescue', 'patient', 'instant']);
assert.equal(ev('ddosOff()'), true, 'no DDoS');
assert.equal(ev('mkElig()'), false, 'no chaos monkey');
ev("S.rules.confs=true;S.rules.sea='ships';const t=JSON.stringify(packSave(S));S=migrate(JSON.parse(t))");
@ -20,7 +20,7 @@ test('Best Effort is a Normal preset with its own rules, kept through save and l
// Every other preset keeps the classic game's ships, conferences, game over and moods.
for (const p of ['freeze', 'oncall', 'bgp']) {
start(ev, p);
assert.deepEqual(J(ev, "['sea','confs','broke','moods'].map(rule)"), ['ships', true, 'lose', 'normal'], p);
assert.deepEqual(J(ev, "['sea','confs','broke','moods','pnis'].map(rule)"), ['ships', true, 'lose', 'normal', 'wait'], p);
}
assert.deepEqual(errors, []);
});
@ -128,3 +128,33 @@ test('the title screen offers Best Effort first, and it earns Freeze-dried badge
assert.equal(ev('badgeVar()'), 'freeze');
assert.deepEqual(errors, []);
});
test('Best Effort: PNIs and their augments are up the moment they are ordered', () => {
const { ev, errors } = load();
ev("beginGame('Soft Serve','fra',{mode:'normal',preset:'soft'});if(UI.pendGame)ACT.pitchSkip();closeModal();S.cash=1e9;S.lvl=6;for(const g of GOALS)S.done[g.id]=0;S.nextFail=S.nextEvent=1e9;ACT.launchBB({city:'fra'});for(const c in S.pops)S.pops[c].rgen=3;compute()");
assert.equal(ev("pniEta('nfx')"), 'Up the moment you order it');
ev("document.getElementById('toasts').innerHTML='';R.demTo.nfx=1e4;ACT.pni({city:'fra',net:'nfx',tier:1})");
assert.equal(ev('pniOn(S.pni[0])'), true, 'a PNI with a big network, up at once');
assert.match(ev("document.getElementById('toasts').textContent"), /PNI with NetChill is up/);
ev('compute()');
assert.ok(ev('R.usePni[S.pni[0].id]') > 0, 'and carrying traffic');
ev("R.demTo.nfx=1e4;ACT.pni({city:'fra',net:'nfx',tier:2})");
assert.deepEqual(J(ev, '[S.pni[0].tier,S.pni[0].up===undefined]'), [2, true], 'an upgrade, at once');
ev('ACT.lagP({id:S.pni[0].id,d:1})');
assert.deepEqual(J(ev, '[S.pni[0].n,S.pni[0].up===undefined]'), [2, true], 'a LAG member, at once');
// Change Freeze still waits, if only days.
start(ev, 'freeze');
ev("S.cash=1e9;S.lvl=6;ACT.launchBB({city:'mrs'});for(const c in S.pops)S.pops[c].rgen=3;compute();R.demTo.nfx=1e4;ACT.pni({city:'mrs',net:'nfx',tier:1})");
assert.ok(ev('S.pni[0].ready') > ev('S.day'));
assert.deepEqual(errors, []);
});
test('no "attracts attacks" warning where nobody attacks', () => {
const { ev, errors } = load();
const risk = () => ev("bRisk({type:Object.keys(BIZ_T).find(k=>BIZ_T[k].gaming)})");
start(ev, 'soft');
assert.equal(risk(), '');
start(ev, 'oncall');
assert.match(risk(), /Gaming attracts attacks/);
assert.deepEqual(errors, []);
});

View file

@ -218,8 +218,8 @@ test('M2: presets are ordered: Best Effort never harsher than Change Freeze, Cha
assert.ok(lead[P.soft.lead] <= lead[P.freeze.lead] && lead[P.freeze.lead] <= lead[P.oncall.lead] && lead[P.oncall.lead] <= lead[P.bgp.lead], 'M2: lead times');
assert.ok((!P.soft.market || P.freeze.market) && (!P.freeze.market || P.oncall.market), 'M2: market');
// The softenings only Best Effort has: every other Normal preset keeps the classic game's.
for (const k of ['sea', 'confs', 'broke', 'moods']) for (const p of ['freeze', 'oncall', 'bgp']) assert.equal(v(p, k), D[k], `M2: ${p} keeps ${k}`);
assert.deepEqual(['sea', 'confs', 'broke', 'moods'].map((k) => v('soft', k)), ['timer', false, 'rescue', 'patient'], 'M2: Best Effort softens them all');
for (const k of ['sea', 'confs', 'broke', 'moods', 'pnis']) for (const p of ['freeze', 'oncall', 'bgp']) assert.equal(v(p, k), D[k], `M2: ${p} keeps ${k}`);
assert.deepEqual(['sea', 'confs', 'broke', 'moods', 'pnis'].map((k) => v('soft', k)), ['timer', false, 'rescue', 'patient', 'instant'], 'M2: Best Effort softens them all');
assert.ok(P.bgp.market && P.bgp.money === 'normal' && P.bgp.gates === 'ladder', 'M2: BGP keeps every hardship');
// seeded: the same network for a year under each preset
const n = {};
@ -237,7 +237,7 @@ test('M3: every subsystem that can annoy the player reads a rule', () => {
const reads = [['dayPost', 'chaosMul()'], ['fireEvent', "rule('market')"], ['ddosTick', 'ddosOff()'],
['soldOut', "rule('market')"], ['hwMul', "rule('market')"], ['leadDays', "rule('lead')"], ['pniLead', 'leadDays'],
['dfBuildDays', 'leadDays'], ['dayPre', "rule('clock')"], ['snub', "rule('market')"], ['fireFailure', 'shipsOn()'],
['upcomingConfs', 'confsOn()'], ['dayPost', "rule('broke')"], ['dayPost', "rule('moods')"], ['toast', 'quietOn()']];
['upcomingConfs', 'confsOn()'], ['pniLead', 'pniNow()'], ['dayPost', "rule('broke')"], ['dayPost', "rule('moods')"], ['toast', 'quietOn()']];
fail('M3', reads.filter(([f, r]) => !ev(`typeof ${f}==='function'&&${f}.toString().includes(${JSON.stringify(r)})`)).map(([f, r]) => `${f}() does not read ${r}`), 'gate it on the ruleset (src/game/40-progress/30-rules.js)');
// and in play: no chaos and no market means a quiet year
const g = load();