Traffic badges: a Tbps ladder and an odometer up to a zettabyte
Serving 1 Tbps (rare) and 10 Tbps (epic) now earn badges below the old 100 Tbps and 1 Pbps ones. S.vol counts the petabytes a game has carried (a day of 1 Gbps is 10.8 TB), with badges at 1 PB, 100 PB, 1 EB and 1 ZB, and a Carried tile on the dashboard. Old saves start the count from the 180 days of history they keep. The route fuzz takes badges only this checkout has off its page, since an unlock's log line shifts every id after it.
This commit is contained in:
parent
4e6f780c81
commit
fcb7264570
16 changed files with 178 additions and 4 deletions
|
|
@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
- New badges for traffic: serve 1 Tbps and 10 Tbps on the way to the 100 Tbps and petabit ones, and carry a petabyte, 100 petabytes, an exabyte and a zettabyte in one game. The dashboard shows how much traffic your network has carried so far.
|
||||||
## [3.1.0] — 2026-11-07
|
## [3.1.0] — 2026-11-07
|
||||||
|
|
||||||
- Whoever runs sales can now answer renewal haggles for you, each in their own way: switch it on at the sales desk. The engineer keeps nerdy customers at the market price and gives everyone else their discount, the shark refuses discounts and some customers walk, and the CEO settles it on the golf course, for better or worse.
|
- Whoever runs sales can now answer renewal haggles for you, each in their own way: switch it on at the sales desk. The engineer keeps nerdy customers at the market price and gives everyone else their discount, the shark refuses discounts and some customers walk, and the CEO settles it on the golf course, for better or worse.
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,13 @@ const weight = (b) => (BUILD.test(b.act) ? 8 : UIACT.test(b.act) ? 0.3 : 1);
|
||||||
opts: moves (count, default 50 to 200 by seed), maxDays per day-move, onMove(i, move) */
|
opts: moves (count, default 50 to 200 by seed), maxDays per day-move, onMove(i, move) */
|
||||||
function playGame(pages, seed, opts = {}) {
|
function playGame(pages, seed, opts = {}) {
|
||||||
const { base, head } = pages;
|
const { base, head } = pages;
|
||||||
|
// A badge only this checkout has would unlock in its game alone, and an unlock writes a log line, which shifts every
|
||||||
|
// id made after it: the comparison is about routing, so the new badges are taken off this checkout's page.
|
||||||
|
if (!pages.badges && base !== head) {
|
||||||
|
const ids = base.ev('JSON.stringify(BADGES.map((b)=>b.id))');
|
||||||
|
head.ev(`{const keep=new Set(${ids});for(let i=BADGES.length-1;i>=0;i--)if(!keep.has(BADGES[i].id))BADGES.splice(i,1);}`);
|
||||||
|
pages.badges = true;
|
||||||
|
}
|
||||||
const r = rng(seed * 2654435761);
|
const r = rng(seed * 2654435761);
|
||||||
const both = (fn, ...a) => [base.call(fn, ...a), head.call(fn, ...a)];
|
const both = (fn, ...a) => [base.call(fn, ...a), head.call(fn, ...a)];
|
||||||
const L = base.call('lists');
|
const L = base.call('lists');
|
||||||
|
|
|
||||||
|
|
@ -228,12 +228,16 @@
|
||||||
"badges.run_a_slow_booting_packetoinker":"Betreibe ein langsam bootendes PacketOinker-Chassis.",
|
"badges.run_a_slow_booting_packetoinker":"Betreibe ein langsam bootendes PacketOinker-Chassis.",
|
||||||
"badges.run_two_routers_in_one_pop":"Betreibe zwei Router in einem POP.",
|
"badges.run_two_routers_in_one_pop":"Betreibe zwei Router in einem POP.",
|
||||||
"badges.serve_100_tbps":"Liefere 100 Tbps aus.",
|
"badges.serve_100_tbps":"Liefere 100 Tbps aus.",
|
||||||
|
"badges.serve_10_tbps":"Liefere 10 Tbps aus.",
|
||||||
"badges.serve_1_pbps_a_thousand_terabits":"Liefere 1 Pbps aus: tausend Terabit glücklicher Traffic.",
|
"badges.serve_1_pbps_a_thousand_terabits":"Liefere 1 Pbps aus: tausend Terabit glücklicher Traffic.",
|
||||||
|
"badges.serve_1_tbps":"Liefere 1 Tbps aus.",
|
||||||
"badges.serve_99_5_of_demand_every":"Bediene ein ganzes Jahr lang jeden einzelnen Tag 99,5 % der Nachfrage.",
|
"badges.serve_99_5_of_demand_every":"Bediene ein ganzes Jahr lang jeden einzelnen Tag 99,5 % der Nachfrage.",
|
||||||
"badges.set_up_a_pni_while_the":"Richte einen PNI ein, solange der Konferenz-Glanz noch anhält.",
|
"badges.set_up_a_pni_while_the":"Richte einen PNI ein, solange der Konferenz-Glanz noch anhält.",
|
||||||
"badges.survive_100_incidents_without":"Überstehe 100 Störungen ohne Auswirkungen auf Kunden.",
|
"badges.survive_100_incidents_without":"Überstehe 100 Störungen ohne Auswirkungen auf Kunden.",
|
||||||
"badges.take_a_de_kicks_retention_offer":"Nimm ein Halteangebot von DE-KICKS an.",
|
"badges.take_a_de_kicks_retention_offer":"Nimm ein Halteangebot von DE-KICKS an.",
|
||||||
"badges.take_out_a_loan":"Nimm einen Kredit auf.",
|
"badges.take_out_a_loan":"Nimm einen Kredit auf.",
|
||||||
|
"badges.ten_terabits":"Zehn Terabit",
|
||||||
|
"badges.terabit_club":"Terabit-Club",
|
||||||
"badges.the_long_way_round":"Der lange Weg außenrum",
|
"badges.the_long_way_round":"Der lange Weg außenrum",
|
||||||
"badges.this_game_earns_fiery_badges":"Dieses Spiel läuft auf BGP um 3 Uhr nachts: Jedes Abzeichen hier wird im Feuer geschmiedet und wertet eins auf, das du schon hast.",
|
"badges.this_game_earns_fiery_badges":"Dieses Spiel läuft auf BGP um 3 Uhr nachts: Jedes Abzeichen hier wird im Feuer geschmiedet und wertet eins auf, das du schon hast.",
|
||||||
"badges.this_game_earns_frosted_badges":"Dieses Spiel läuft im Change Freeze: Abzeichen von hier gibt es gefriergetrocknet.",
|
"badges.this_game_earns_frosted_badges":"Dieses Spiel läuft im Change Freeze: Abzeichen von hier gibt es gefriergetrocknet.",
|
||||||
|
|
@ -243,6 +247,14 @@
|
||||||
"badges.variant_forged_at_3_a_m":"Um 3 Uhr geschmiedet",
|
"badges.variant_forged_at_3_a_m":"Um 3 Uhr geschmiedet",
|
||||||
"badges.variant_freeze_dried":"Gefriergetrocknet",
|
"badges.variant_freeze_dried":"Gefriergetrocknet",
|
||||||
"badges.variant_on_call":"Rufbereitschaft",
|
"badges.variant_on_call":"Rufbereitschaft",
|
||||||
|
"badges.vol_100pb":"Hundert Petabyte",
|
||||||
|
"badges.vol_100pb_d":"Transportiere in einem Spiel 100 PB Traffic.",
|
||||||
|
"badges.vol_eb":"Exabyte-Express",
|
||||||
|
"badges.vol_eb_d":"Transportiere in einem Spiel ein Exabyte Traffic: eine Million Terabyte.",
|
||||||
|
"badges.vol_pb":"Dein erstes Petabyte",
|
||||||
|
"badges.vol_pb_d":"Transportiere in einem Spiel ein Petabyte Traffic.",
|
||||||
|
"badges.vol_zb":"Das Zettabyte-Zeitalter",
|
||||||
|
"badges.vol_zb_d":"Transportiere in einem Spiel ein Zettabyte, ungefähr so viel wie das ganze Internet um 2016 in einem Jahr.",
|
||||||
"badges.weather_a_ddos_with_your_defences":"Überstehe einen DDoS mit einsatzbereiter Abwehr.",
|
"badges.weather_a_ddos_with_your_defences":"Überstehe einen DDoS mit einsatzbereiter Abwehr.",
|
||||||
"badges.weather_a_multi_terabit_ddos":"Überstehe einen DDoS im Multi-Terabit-Bereich.",
|
"badges.weather_a_multi_terabit_ddos":"Überstehe einen DDoS im Multi-Terabit-Bereich.",
|
||||||
"badges.win_without_ever_taking_a_loan":"Gewinne, ohne je einen Kredit aufzunehmen.",
|
"badges.win_without_ever_taking_a_loan":"Gewinne, ohne je einen Kredit aufzunehmen.",
|
||||||
|
|
@ -1793,6 +1805,8 @@
|
||||||
"dashboard.all_n":"Alle ({n})",
|
"dashboard.all_n":"Alle ({n})",
|
||||||
"dashboard.amp_huts_and_spares":"Verstärkerhütten und Ersatzteile",
|
"dashboard.amp_huts_and_spares":"Verstärkerhütten und Ersatzteile",
|
||||||
"dashboard.caches_pnis_and_ix":"Caches, PNIs und IX",
|
"dashboard.caches_pnis_and_ix":"Caches, PNIs und IX",
|
||||||
|
"dashboard.carried":"Transportiert",
|
||||||
|
"dashboard.carried_sub":"insgesamt, dieses Spiel",
|
||||||
"dashboard.chart_total":"Gesamt",
|
"dashboard.chart_total":"Gesamt",
|
||||||
"dashboard.customers_are_upset":"Kunden sind verärgert",
|
"dashboard.customers_are_upset":"Kunden sind verärgert",
|
||||||
"dashboard.delivered_30_days":"Geliefert, 30 Tage",
|
"dashboard.delivered_30_days":"Geliefert, 30 Tage",
|
||||||
|
|
|
||||||
|
|
@ -226,12 +226,16 @@
|
||||||
"badges.run_a_slow_booting_packetoinker":"Opera un chasis PacketOinker de arranque lento.",
|
"badges.run_a_slow_booting_packetoinker":"Opera un chasis PacketOinker de arranque lento.",
|
||||||
"badges.run_two_routers_in_one_pop":"Opera dos routers en un mismo POP.",
|
"badges.run_two_routers_in_one_pop":"Opera dos routers en un mismo POP.",
|
||||||
"badges.serve_100_tbps":"Sirve 100 Tbps.",
|
"badges.serve_100_tbps":"Sirve 100 Tbps.",
|
||||||
|
"badges.serve_10_tbps":"Sirve 10 Tbps.",
|
||||||
"badges.serve_1_pbps_a_thousand_terabits":"Sirve 1 Pbps: mil terabits de tráfico feliz.",
|
"badges.serve_1_pbps_a_thousand_terabits":"Sirve 1 Pbps: mil terabits de tráfico feliz.",
|
||||||
|
"badges.serve_1_tbps":"Sirve 1 Tbps.",
|
||||||
"badges.serve_99_5_of_demand_every":"Sirve el 99,5 % de la demanda cada día durante un año entero.",
|
"badges.serve_99_5_of_demand_every":"Sirve el 99,5 % de la demanda cada día durante un año entero.",
|
||||||
"badges.set_up_a_pni_while_the":"Monta un PNI mientras dure el brillo de la conferencia.",
|
"badges.set_up_a_pni_while_the":"Monta un PNI mientras dure el brillo de la conferencia.",
|
||||||
"badges.survive_100_incidents_without":"Sobrevive a 100 incidentes sin afectar a los clientes.",
|
"badges.survive_100_incidents_without":"Sobrevive a 100 incidentes sin afectar a los clientes.",
|
||||||
"badges.take_a_de_kicks_retention_offer":"Acepta una oferta de retención de DE-KICKS.",
|
"badges.take_a_de_kicks_retention_offer":"Acepta una oferta de retención de DE-KICKS.",
|
||||||
"badges.take_out_a_loan":"Pide un préstamo.",
|
"badges.take_out_a_loan":"Pide un préstamo.",
|
||||||
|
"badges.ten_terabits":"Diez terabits",
|
||||||
|
"badges.terabit_club":"Club del Terabit",
|
||||||
"badges.the_long_way_round":"El camino largo",
|
"badges.the_long_way_round":"El camino largo",
|
||||||
"badges.this_game_earns_fiery_badges":"Esta partida va de BGP a las 3 de la mañana: cada insignia que ganes aquí sale forjada en fuego y mejora la que ya tengas.",
|
"badges.this_game_earns_fiery_badges":"Esta partida va de BGP a las 3 de la mañana: cada insignia que ganes aquí sale forjada en fuego y mejora la que ya tengas.",
|
||||||
"badges.this_game_earns_frosted_badges":"Esta partida está en Change Freeze: las insignias de aquí salen liofilizadas.",
|
"badges.this_game_earns_frosted_badges":"Esta partida está en Change Freeze: las insignias de aquí salen liofilizadas.",
|
||||||
|
|
@ -241,6 +245,14 @@
|
||||||
"badges.variant_forged_at_3_a_m":"Forjada a las 3 a. m.",
|
"badges.variant_forged_at_3_a_m":"Forjada a las 3 a. m.",
|
||||||
"badges.variant_freeze_dried":"Liofilizada",
|
"badges.variant_freeze_dried":"Liofilizada",
|
||||||
"badges.variant_on_call":"De guardia",
|
"badges.variant_on_call":"De guardia",
|
||||||
|
"badges.vol_100pb":"Cien petabytes",
|
||||||
|
"badges.vol_100pb_d":"Transporta 100 PB de tráfico en una partida.",
|
||||||
|
"badges.vol_eb":"Exabyte Exprés",
|
||||||
|
"badges.vol_eb_d":"Transporta un exabyte de tráfico en una partida: un millón de terabytes.",
|
||||||
|
"badges.vol_pb":"Tu primer petabyte",
|
||||||
|
"badges.vol_pb_d":"Transporta un petabyte de tráfico en una partida.",
|
||||||
|
"badges.vol_zb":"La era del zettabyte",
|
||||||
|
"badges.vol_zb_d":"Transporta un zettabyte en una partida, más o menos lo que movió todo internet en un año hacia 2016.",
|
||||||
"badges.weather_a_ddos_with_your_defences":"Aguanta un DDoS con tus defensas listas.",
|
"badges.weather_a_ddos_with_your_defences":"Aguanta un DDoS con tus defensas listas.",
|
||||||
"badges.weather_a_multi_terabit_ddos":"Aguanta un DDoS de varios terabits.",
|
"badges.weather_a_multi_terabit_ddos":"Aguanta un DDoS de varios terabits.",
|
||||||
"badges.win_without_ever_taking_a_loan":"Gana sin pedir nunca un préstamo.",
|
"badges.win_without_ever_taking_a_loan":"Gana sin pedir nunca un préstamo.",
|
||||||
|
|
@ -1791,6 +1803,8 @@
|
||||||
"dashboard.all_n":"Todo ({n})",
|
"dashboard.all_n":"Todo ({n})",
|
||||||
"dashboard.amp_huts_and_spares":"Casetas de amplificación y repuestos",
|
"dashboard.amp_huts_and_spares":"Casetas de amplificación y repuestos",
|
||||||
"dashboard.caches_pnis_and_ix":"cachés, PNIs e IX",
|
"dashboard.caches_pnis_and_ix":"cachés, PNIs e IX",
|
||||||
|
"dashboard.carried":"Transportado",
|
||||||
|
"dashboard.carried_sub":"en total, esta partida",
|
||||||
"dashboard.chart_total":"Total",
|
"dashboard.chart_total":"Total",
|
||||||
"dashboard.customers_are_upset":"los clientes están molestos",
|
"dashboard.customers_are_upset":"los clientes están molestos",
|
||||||
"dashboard.delivered_30_days":"Entregado, 30 días",
|
"dashboard.delivered_30_days":"Entregado, 30 días",
|
||||||
|
|
|
||||||
|
|
@ -226,12 +226,16 @@
|
||||||
"badges.run_a_slow_booting_packetoinker":"Fais tourner un châssis PacketOinker qui met des plombes à booter.",
|
"badges.run_a_slow_booting_packetoinker":"Fais tourner un châssis PacketOinker qui met des plombes à booter.",
|
||||||
"badges.run_two_routers_in_one_pop":"Fais tourner deux routeurs dans un POP.",
|
"badges.run_two_routers_in_one_pop":"Fais tourner deux routeurs dans un POP.",
|
||||||
"badges.serve_100_tbps":"Sers 100 Tbps.",
|
"badges.serve_100_tbps":"Sers 100 Tbps.",
|
||||||
|
"badges.serve_10_tbps":"Servez 10 Tbps.",
|
||||||
"badges.serve_1_pbps_a_thousand_terabits":"Sers 1 Pbps : mille térabits de trafic heureux.",
|
"badges.serve_1_pbps_a_thousand_terabits":"Sers 1 Pbps : mille térabits de trafic heureux.",
|
||||||
|
"badges.serve_1_tbps":"Servez 1 Tbps.",
|
||||||
"badges.serve_99_5_of_demand_every":"Sers 99,5 % de la demande chaque jour, pendant une année entière.",
|
"badges.serve_99_5_of_demand_every":"Sers 99,5 % de la demande chaque jour, pendant une année entière.",
|
||||||
"badges.set_up_a_pni_while_the":"Monte un PNI tant que dure l’euphorie de la conférence.",
|
"badges.set_up_a_pni_while_the":"Monte un PNI tant que dure l’euphorie de la conférence.",
|
||||||
"badges.survive_100_incidents_without":"Survis à 100 incidents sans impact client.",
|
"badges.survive_100_incidents_without":"Survis à 100 incidents sans impact client.",
|
||||||
"badges.take_a_de_kicks_retention_offer":"Accepte une offre de fidélisation DE-KICKS.",
|
"badges.take_a_de_kicks_retention_offer":"Accepte une offre de fidélisation DE-KICKS.",
|
||||||
"badges.take_out_a_loan":"Contracte un prêt.",
|
"badges.take_out_a_loan":"Contracte un prêt.",
|
||||||
|
"badges.ten_terabits":"Dix térabits",
|
||||||
|
"badges.terabit_club":"Club du térabit",
|
||||||
"badges.the_long_way_round":"Le grand détour",
|
"badges.the_long_way_round":"Le grand détour",
|
||||||
"badges.this_game_earns_fiery_badges":"Cette partie tourne en BGP à 3 h du matin : chaque badge gagné ici est forgé dans le feu et améliore celui que tu as déjà.",
|
"badges.this_game_earns_fiery_badges":"Cette partie tourne en BGP à 3 h du matin : chaque badge gagné ici est forgé dans le feu et améliore celui que tu as déjà.",
|
||||||
"badges.this_game_earns_frosted_badges":"Cette partie est en Change Freeze : les badges gagnés ici sont lyophilisés.",
|
"badges.this_game_earns_frosted_badges":"Cette partie est en Change Freeze : les badges gagnés ici sont lyophilisés.",
|
||||||
|
|
@ -241,6 +245,14 @@
|
||||||
"badges.variant_forged_at_3_a_m":"Forgé à 3 h du matin",
|
"badges.variant_forged_at_3_a_m":"Forgé à 3 h du matin",
|
||||||
"badges.variant_freeze_dried":"Lyophilisé",
|
"badges.variant_freeze_dried":"Lyophilisé",
|
||||||
"badges.variant_on_call":"D’astreinte",
|
"badges.variant_on_call":"D’astreinte",
|
||||||
|
"badges.vol_100pb":"Cent pétaoctets",
|
||||||
|
"badges.vol_100pb_d":"Transportez 100 Po de trafic en une partie.",
|
||||||
|
"badges.vol_eb":"Exaoctet Express",
|
||||||
|
"badges.vol_eb_d":"Transportez un exaoctet de trafic en une partie : un million de téraoctets.",
|
||||||
|
"badges.vol_pb":"Votre premier pétaoctet",
|
||||||
|
"badges.vol_pb_d":"Transportez un pétaoctet de trafic en une partie.",
|
||||||
|
"badges.vol_zb":"L'ère du zettaoctet",
|
||||||
|
"badges.vol_zb_d":"Transportez un zettaoctet en une partie, à peu près ce que tout Internet a transporté en un an vers 2016.",
|
||||||
"badges.weather_a_ddos_with_your_defences":"Encaisse un DDoS avec tes défenses prêtes.",
|
"badges.weather_a_ddos_with_your_defences":"Encaisse un DDoS avec tes défenses prêtes.",
|
||||||
"badges.weather_a_multi_terabit_ddos":"Encaisse un DDoS de plusieurs térabits.",
|
"badges.weather_a_multi_terabit_ddos":"Encaisse un DDoS de plusieurs térabits.",
|
||||||
"badges.win_without_ever_taking_a_loan":"Gagne sans jamais contracter de prêt.",
|
"badges.win_without_ever_taking_a_loan":"Gagne sans jamais contracter de prêt.",
|
||||||
|
|
@ -1791,6 +1803,8 @@
|
||||||
"dashboard.all_n":"Toutes ({n})",
|
"dashboard.all_n":"Toutes ({n})",
|
||||||
"dashboard.amp_huts_and_spares":"Abris d’amplis et rechanges",
|
"dashboard.amp_huts_and_spares":"Abris d’amplis et rechanges",
|
||||||
"dashboard.caches_pnis_and_ix":"caches, PNI et IX",
|
"dashboard.caches_pnis_and_ix":"caches, PNI et IX",
|
||||||
|
"dashboard.carried":"Transporté",
|
||||||
|
"dashboard.carried_sub":"au total, cette partie",
|
||||||
"dashboard.chart_total":"Total",
|
"dashboard.chart_total":"Total",
|
||||||
"dashboard.customers_are_upset":"les clients râlent",
|
"dashboard.customers_are_upset":"les clients râlent",
|
||||||
"dashboard.delivered_30_days":"Livré, 30 jours",
|
"dashboard.delivered_30_days":"Livré, 30 jours",
|
||||||
|
|
|
||||||
|
|
@ -226,12 +226,16 @@
|
||||||
"badges.run_a_slow_booting_packetoinker":"Usa uno chassis PacketOinker dal boot lentissimo.",
|
"badges.run_a_slow_booting_packetoinker":"Usa uno chassis PacketOinker dal boot lentissimo.",
|
||||||
"badges.run_two_routers_in_one_pop":"Fai girare due router in un POP.",
|
"badges.run_two_routers_in_one_pop":"Fai girare due router in un POP.",
|
||||||
"badges.serve_100_tbps":"Servi 100 Tbps.",
|
"badges.serve_100_tbps":"Servi 100 Tbps.",
|
||||||
|
"badges.serve_10_tbps":"Servi 10 Tbps.",
|
||||||
"badges.serve_1_pbps_a_thousand_terabits":"Servi 1 Pbps: mille terabit di traffico felice.",
|
"badges.serve_1_pbps_a_thousand_terabits":"Servi 1 Pbps: mille terabit di traffico felice.",
|
||||||
|
"badges.serve_1_tbps":"Servi 1 Tbps.",
|
||||||
"badges.serve_99_5_of_demand_every":"Servi il 99,5% della domanda ogni singolo giorno per un anno intero.",
|
"badges.serve_99_5_of_demand_every":"Servi il 99,5% della domanda ogni singolo giorno per un anno intero.",
|
||||||
"badges.set_up_a_pni_while_the":"Attiva un PNI finché dura l’euforia della conferenza.",
|
"badges.set_up_a_pni_while_the":"Attiva un PNI finché dura l’euforia della conferenza.",
|
||||||
"badges.survive_100_incidents_without":"Sopravvivi a 100 incidenti senza impatto sui clienti.",
|
"badges.survive_100_incidents_without":"Sopravvivi a 100 incidenti senza impatto sui clienti.",
|
||||||
"badges.take_a_de_kicks_retention_offer":"Accetta un’offerta di fidelizzazione DE-KICKS.",
|
"badges.take_a_de_kicks_retention_offer":"Accetta un’offerta di fidelizzazione DE-KICKS.",
|
||||||
"badges.take_out_a_loan":"Chiedi un prestito.",
|
"badges.take_out_a_loan":"Chiedi un prestito.",
|
||||||
|
"badges.ten_terabits":"Dieci terabit",
|
||||||
|
"badges.terabit_club":"Club del terabit",
|
||||||
"badges.the_long_way_round":"Il giro lungo",
|
"badges.the_long_way_round":"Il giro lungo",
|
||||||
"badges.this_game_earns_fiery_badges":"Questa partita gira con BGP alle 3 di notte: ogni badge che guadagni qui è forgiato nel fuoco e migliora quello che hai già.",
|
"badges.this_game_earns_fiery_badges":"Questa partita gira con BGP alle 3 di notte: ogni badge che guadagni qui è forgiato nel fuoco e migliora quello che hai già.",
|
||||||
"badges.this_game_earns_frosted_badges":"Questa partita è in Change Freeze: i badge che guadagni qui arrivano liofilizzati.",
|
"badges.this_game_earns_frosted_badges":"Questa partita è in Change Freeze: i badge che guadagni qui arrivano liofilizzati.",
|
||||||
|
|
@ -241,6 +245,14 @@
|
||||||
"badges.variant_forged_at_3_a_m":"Forgiato alle 3 di notte",
|
"badges.variant_forged_at_3_a_m":"Forgiato alle 3 di notte",
|
||||||
"badges.variant_freeze_dried":"Liofilizzato",
|
"badges.variant_freeze_dried":"Liofilizzato",
|
||||||
"badges.variant_on_call":"Reperibile",
|
"badges.variant_on_call":"Reperibile",
|
||||||
|
"badges.vol_100pb":"Cento petabyte",
|
||||||
|
"badges.vol_100pb_d":"Trasporta 100 PB di traffico in una partita.",
|
||||||
|
"badges.vol_eb":"Exabyte Express",
|
||||||
|
"badges.vol_eb_d":"Trasporta un exabyte di traffico in una partita: un milione di terabyte.",
|
||||||
|
"badges.vol_pb":"Il tuo primo petabyte",
|
||||||
|
"badges.vol_pb_d":"Trasporta un petabyte di traffico in una partita.",
|
||||||
|
"badges.vol_zb":"L'era dello zettabyte",
|
||||||
|
"badges.vol_zb_d":"Trasporta uno zettabyte in una partita, più o meno quanto ha mosso l'intera internet in un anno intorno al 2016.",
|
||||||
"badges.weather_a_ddos_with_your_defences":"Reggi un DDoS con le difese pronte.",
|
"badges.weather_a_ddos_with_your_defences":"Reggi un DDoS con le difese pronte.",
|
||||||
"badges.weather_a_multi_terabit_ddos":"Reggi un DDoS da più terabit.",
|
"badges.weather_a_multi_terabit_ddos":"Reggi un DDoS da più terabit.",
|
||||||
"badges.win_without_ever_taking_a_loan":"Vinci senza mai chiedere un prestito.",
|
"badges.win_without_ever_taking_a_loan":"Vinci senza mai chiedere un prestito.",
|
||||||
|
|
@ -1791,6 +1803,8 @@
|
||||||
"dashboard.all_n":"Tutte ({n})",
|
"dashboard.all_n":"Tutte ({n})",
|
||||||
"dashboard.amp_huts_and_spares":"Shelter amplificatori e ricambi",
|
"dashboard.amp_huts_and_spares":"Shelter amplificatori e ricambi",
|
||||||
"dashboard.caches_pnis_and_ix":"cache, PNI e IX",
|
"dashboard.caches_pnis_and_ix":"cache, PNI e IX",
|
||||||
|
"dashboard.carried":"Trasportato",
|
||||||
|
"dashboard.carried_sub":"in totale, questa partita",
|
||||||
"dashboard.chart_total":"Totale",
|
"dashboard.chart_total":"Totale",
|
||||||
"dashboard.customers_are_upset":"clienti furiosi",
|
"dashboard.customers_are_upset":"clienti furiosi",
|
||||||
"dashboard.delivered_30_days":"Consegnato, 30 giorni",
|
"dashboard.delivered_30_days":"Consegnato, 30 giorni",
|
||||||
|
|
|
||||||
|
|
@ -226,12 +226,16 @@
|
||||||
"badges.run_a_slow_booting_packetoinker":"Rode um chassis PacketOinker de boot lento.",
|
"badges.run_a_slow_booting_packetoinker":"Rode um chassis PacketOinker de boot lento.",
|
||||||
"badges.run_two_routers_in_one_pop":"Rode dois routers em um POP.",
|
"badges.run_two_routers_in_one_pop":"Rode dois routers em um POP.",
|
||||||
"badges.serve_100_tbps":"Atenda 100 Tbps.",
|
"badges.serve_100_tbps":"Atenda 100 Tbps.",
|
||||||
|
"badges.serve_10_tbps":"Sirva 10 Tbps.",
|
||||||
"badges.serve_1_pbps_a_thousand_terabits":"Atenda 1 Pbps: mil terabits de tráfego feliz.",
|
"badges.serve_1_pbps_a_thousand_terabits":"Atenda 1 Pbps: mil terabits de tráfego feliz.",
|
||||||
|
"badges.serve_1_tbps":"Sirva 1 Tbps.",
|
||||||
"badges.serve_99_5_of_demand_every":"Atenda 99,5% da demanda todos os dias por um ano inteiro.",
|
"badges.serve_99_5_of_demand_every":"Atenda 99,5% da demanda todos os dias por um ano inteiro.",
|
||||||
"badges.set_up_a_pni_while_the":"Monte um PNI enquanto dura o clima da conferência.",
|
"badges.set_up_a_pni_while_the":"Monte um PNI enquanto dura o clima da conferência.",
|
||||||
"badges.survive_100_incidents_without":"Sobreviva a 100 incidentes sem impacto nos clientes.",
|
"badges.survive_100_incidents_without":"Sobreviva a 100 incidentes sem impacto nos clientes.",
|
||||||
"badges.take_a_de_kicks_retention_offer":"Aceite uma oferta de retenção da DE-KICKS.",
|
"badges.take_a_de_kicks_retention_offer":"Aceite uma oferta de retenção da DE-KICKS.",
|
||||||
"badges.take_out_a_loan":"Pegue um empréstimo.",
|
"badges.take_out_a_loan":"Pegue um empréstimo.",
|
||||||
|
"badges.ten_terabits":"Dez terabits",
|
||||||
|
"badges.terabit_club":"Clube do Terabit",
|
||||||
"badges.the_long_way_round":"A volta longa",
|
"badges.the_long_way_round":"A volta longa",
|
||||||
"badges.this_game_earns_fiery_badges":"Este jogo roda BGP às 3 da manhã: cada badge que você ganha aqui é forjado no fogo e melhora o que você já tem.",
|
"badges.this_game_earns_fiery_badges":"Este jogo roda BGP às 3 da manhã: cada badge que você ganha aqui é forjado no fogo e melhora o que você já tem.",
|
||||||
"badges.this_game_earns_frosted_badges":"Este jogo está em Change Freeze: os badges daqui vêm liofilizados.",
|
"badges.this_game_earns_frosted_badges":"Este jogo está em Change Freeze: os badges daqui vêm liofilizados.",
|
||||||
|
|
@ -241,6 +245,14 @@
|
||||||
"badges.variant_forged_at_3_a_m":"Forjado às 3 da manhã",
|
"badges.variant_forged_at_3_a_m":"Forjado às 3 da manhã",
|
||||||
"badges.variant_freeze_dried":"Liofilizado",
|
"badges.variant_freeze_dried":"Liofilizado",
|
||||||
"badges.variant_on_call":"De plantão",
|
"badges.variant_on_call":"De plantão",
|
||||||
|
"badges.vol_100pb":"Cem petabytes",
|
||||||
|
"badges.vol_100pb_d":"Transporte 100 PB de tráfego em uma partida.",
|
||||||
|
"badges.vol_eb":"Exabyte Expresso",
|
||||||
|
"badges.vol_eb_d":"Transporte um exabyte de tráfego em uma partida: um milhão de terabytes.",
|
||||||
|
"badges.vol_pb":"Seu primeiro petabyte",
|
||||||
|
"badges.vol_pb_d":"Transporte um petabyte de tráfego em uma partida.",
|
||||||
|
"badges.vol_zb":"A era do zettabyte",
|
||||||
|
"badges.vol_zb_d":"Transporte um zettabyte em uma partida, mais ou menos o que a internet inteira moveu em um ano por volta de 2016.",
|
||||||
"badges.weather_a_ddos_with_your_defences":"Aguente um DDoS com as defesas prontas.",
|
"badges.weather_a_ddos_with_your_defences":"Aguente um DDoS com as defesas prontas.",
|
||||||
"badges.weather_a_multi_terabit_ddos":"Aguente um DDoS de vários terabits.",
|
"badges.weather_a_multi_terabit_ddos":"Aguente um DDoS de vários terabits.",
|
||||||
"badges.win_without_ever_taking_a_loan":"Vença sem nunca pegar um empréstimo.",
|
"badges.win_without_ever_taking_a_loan":"Vença sem nunca pegar um empréstimo.",
|
||||||
|
|
@ -1791,6 +1803,8 @@
|
||||||
"dashboard.all_n":"Todos ({n})",
|
"dashboard.all_n":"Todos ({n})",
|
||||||
"dashboard.amp_huts_and_spares":"Abrigos de amplificador e reservas",
|
"dashboard.amp_huts_and_spares":"Abrigos de amplificador e reservas",
|
||||||
"dashboard.caches_pnis_and_ix":"caches, PNIs e IX",
|
"dashboard.caches_pnis_and_ix":"caches, PNIs e IX",
|
||||||
|
"dashboard.carried":"Transportado",
|
||||||
|
"dashboard.carried_sub":"no total, nesta partida",
|
||||||
"dashboard.chart_total":"Total",
|
"dashboard.chart_total":"Total",
|
||||||
"dashboard.customers_are_upset":"clientes furiosos",
|
"dashboard.customers_are_upset":"clientes furiosos",
|
||||||
"dashboard.delivered_30_days":"Entregue, 30 dias",
|
"dashboard.delivered_30_days":"Entregue, 30 dias",
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ const API_STATE_DOC={
|
||||||
lost:{type:'boolean',doc:'The bank repossessed the routers.'},
|
lost:{type:'boolean',doc:'The bank repossessed the routers.'},
|
||||||
neg:{type:'integer',doc:'Days in the red in a row.'},
|
neg:{type:'integer',doc:'Days in the red in a row.'},
|
||||||
hist:{type:'array',doc:'Daily history for the graphs: demand, served, exit split, revenue, cost, cash.'},
|
hist:{type:'array',doc:'Daily history for the graphs: demand, served, exit split, revenue, cost, cash.'},
|
||||||
|
vol:{type:'number',doc:'Traffic carried in this game, in petabytes (each day adds a day of what was served); badges at 1 PB, 100 PB, 1 EB and 1 ZB.'},
|
||||||
scn:{type:'map',doc:'The running scenario: id, rules, day limit, done/failed, and the day of the next scripted attack (nextDdos).'},
|
scn:{type:'map',doc:'The running scenario: id, rules, day limit, done/failed, and the day of the next scripted attack (nextDdos).'},
|
||||||
dk:{type:'map',doc:'De-Kicks state: per-exchange multipliers, add-ons, retention, the live quote (q) and the remembered one (lastQ).'},
|
dk:{type:'map',doc:'De-Kicks state: per-exchange multipliers, add-ons, retention, the live quote (q) and the remembered one (lastQ).'},
|
||||||
grace:{type:'map',doc:'Courtesy transit after a merger wave, until a day.'},
|
grace:{type:'map',doc:'Courtesy transit after a merger wave, until a day.'},
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
function newGame(name,home){
|
function newGame(name,home){
|
||||||
S={v:1,name,asn:200000+Math.floor(_rand()*15000),home,day:0,cash:START_CASH,
|
S={v:1,name,asn:200000+Math.floor(_rand()*15000),home,day:0,cash:START_CASH,
|
||||||
ltv:2,t1v:4,auV:1,calV:1,pieV:1,pie:null,ops:opsNew(),slAuto:slAutoNew(),achP:{},seen:NETS.map(n=>n.id),spares:{},pops:{[home]:{day:0,bb:null,boost:0,down:0,routers:1,gen:false}},links:[],nni:[],transit:[],ixp:{},rs:{},peers:{},pni:[],caches:[],biz:[],offers:[],myIx:{},pairMet:{},
|
ltv:2,t1v:4,auV:1,calV:1,pieV:1,pie:null,ops:opsNew(),slAuto:slAutoNew(),achP:{},seen:NETS.map(n=>n.id),spares:{},pops:{[home]:{day:0,bb:null,boost:0,down:0,routers:1,gen:false}},links:[],nni:[],transit:[],ixp:{},rs:{},peers:{},pni:[],caches:[],biz:[],offers:[],myIx:{},pairMet:{},
|
||||||
done:{},inc:[],fleet:{},ev:{ddosMore:[]},ddosStarts:[],priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},cnLic:{state:'none'},scrubs:[],scrubMode:'always',ddosAuto:{rtbh:false,scrub:true},capDeal:null,core:{lv:0,run:0},popStd:null,won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,ppol:'open',pdesk:null,pdeskRep:null,hw:{},rules:makeRules('oncall'),charter:'global',chartSet:false,demo:{},seatOff:null,solWon:0,monkey:{next:null,on:0}};
|
done:{},inc:[],fleet:{},ev:{ddosMore:[]},ddosStarts:[],priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},vol:0,cnLic:{state:'none'},scrubs:[],scrubMode:'always',ddosAuto:{rtbh:false,scrub:true},capDeal:null,core:{lv:0,run:0},popStd:null,won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,ppol:'open',pdesk:null,pdeskRep:null,hw:{},rules:makeRules('oncall'),charter:'global',chartSet:false,demo:{},seatOff:null,solWon:0,monkey:{next:null,on:0}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ function sanitize(s){
|
||||||
{const r=s.rules&&typeof s.rules==='object'&&!Array.isArray(s.rules)?s.rules:{};
|
{const r=s.rules&&typeof s.rules==='object'&&!Array.isArray(s.rules)?s.rules:{};
|
||||||
const m={mods:r.mods};s.rules=s.scn&&typeof s.scn==='object'?makeRules('oncall',m):s.mode==='sandbox'?makeRules('sandbox',{...m,chaos:r.chaos}):makeRules(NORMAL_PRESETS.includes(r.preset)?r.preset:'oncall',m);}
|
const m={mods:r.mods};s.rules=s.scn&&typeof s.scn==='object'?makeRules('oncall',m):s.mode==='sandbox'?makeRules('sandbox',{...m,chaos:r.chaos}):makeRules(NORMAL_PRESETS.includes(r.preset)?r.preset:'oncall',m);}
|
||||||
specSanitize(s);
|
specSanitize(s);
|
||||||
pieSanitize(s);pieIncFix(s);
|
pieSanitize(s);pieIncFix(s);volFix(s);
|
||||||
if(s.te){if(typeof s.te!=='object')s.te=null;else{s.te.on=!!s.te.on;s.te.script=typeof s.te.script==='string'?s.te.script.slice(0,4000):'';}}
|
if(s.te){if(typeof s.te!=='object')s.te=null;else{s.te.on=!!s.te.on;s.te.script=typeof s.te.script==='string'?s.te.script.slice(0,4000):'';}}
|
||||||
return s;}
|
return s;}
|
||||||
function migrate(s){sanitize(s);
|
function migrate(s){sanitize(s);
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ function* dayPost(d){
|
||||||
yield* ddosNewsRun();ddosTrack();
|
yield* ddosNewsRun();ddosTrack();
|
||||||
for(const t of S.transit){(t.hist=t.hist||[]).push(R.useT[t.id]||0);if(t.hist.length>30)t.hist.shift();}
|
for(const t of S.transit){(t.hist=t.hist||[]).push(R.useT[t.id]||0);if(t.hist.length>30)t.hist.shift();}
|
||||||
S.cash+=(R.revMo-R.costMo)/monLen(d);
|
S.cash+=(R.revMo-R.costMo)/monLen(d);
|
||||||
S.stats.peak=Math.max(S.stats.peak,R.served);
|
S.stats.peak=Math.max(S.stats.peak,R.served);volDay();
|
||||||
S.hist=S.hist||[];S.hist.push({d,dem:+R.demand.toFixed(2),srv:+R.served.toFixed(2),c:+(R.egT.c||0).toFixed(2),p:+(R.egT.p||0).toFixed(2),ix:+(R.egT.ix||0).toFixed(2),t:+(R.egT.t||0).toFixed(2),l2:+(R.egT.l2||0).toFixed(2),rev:Math.round(R.revMo),cost:Math.round(R.costMo),cash:Math.round(S.cash),inc:S.inc.length});if(S.hist.length>180)S.hist.shift();
|
S.hist=S.hist||[];S.hist.push({d,dem:+R.demand.toFixed(2),srv:+R.served.toFixed(2),c:+(R.egT.c||0).toFixed(2),p:+(R.egT.p||0).toFixed(2),ix:+(R.egT.ix||0).toFixed(2),t:+(R.egT.t||0).toFixed(2),l2:+(R.egT.l2||0).toFixed(2),rev:Math.round(R.revMo),cost:Math.round(R.costMo),cash:Math.round(S.cash),inc:S.inc.length});if(S.hist.length>180)S.hist.shift();
|
||||||
{const top=custLevel();if(top>(S.lvl||1)){for(let lv=(S.lvl||1)+1;lv<=top;lv++){track('level_'+lv);toast(tr('day_tick.customer_level_lv_name_new_customers',{lv,name:LEVELS[lv-1].n,unlock:LEVELS[lv-1].unlock})+`<br><i>${esc(LEVELS[lv-1].q)}</i>`,'goal');}S.lvl=top;sfx('coin');}}
|
{const top=custLevel();if(top>(S.lvl||1)){for(let lv=(S.lvl||1)+1;lv<=top;lv++){track('level_'+lv);toast(tr('day_tick.customer_level_lv_name_new_customers',{lv,name:LEVELS[lv-1].n,unlock:LEVELS[lv-1].unlock})+`<br><i>${esc(LEVELS[lv-1].q)}</i>`,'goal');}S.lvl=top;sfx('coin');}}
|
||||||
for(const l of S.links){if(l.kind!=='df')continue;
|
for(const l of S.links){if(l.kind!=='df')continue;
|
||||||
|
|
|
||||||
12
src/game/88-days/15-traffic-volume.js
Normal file
12
src/game/88-days/15-traffic-volume.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* ---------- Traffic carried: the network's odometer ----------
|
||||||
|
S.vol counts the petabytes the network has carried in this game: every day adds a day of what it served. R.served
|
||||||
|
is in Gbps, so a day of 1 Gbps is 86,400 gigabits, 10.8 terabytes, 0.0108 PB. Badges ride on it (20-badges.js),
|
||||||
|
from the first petabyte to a zettabyte, the whole internet's traffic in a year around 2016. */
|
||||||
|
const PB_DAY=86400/8/1e6;
|
||||||
|
function volDay(){S.vol=(S.vol||0)+(R.served>0?R.served*PB_DAY:0);}
|
||||||
|
// A volume of traffic, from the petabytes it is stored in: TB, PB, EB, ZB.
|
||||||
|
const fmtVol=pb=>pb>=1e6?(pb/1e6).toFixed(pb>=1e7?1:2)+' ZB':pb>=1000?(pb/1000).toFixed(pb>=1e4?1:2)+' EB':pb>=1?pb.toFixed(pb>=10?0:1)+' PB':(pb*1000).toFixed(pb>=0.01?0:1)+' TB';
|
||||||
|
// Saves: a number of petabytes. A save from before the odometer starts from the days its history still holds (the
|
||||||
|
// last 180), so an old network gets most of the credit it earned.
|
||||||
|
function volFix(s){if(typeof s.vol==='number'&&Number.isFinite(s.vol)&&s.vol>=0)return;
|
||||||
|
s.vol=(Array.isArray(s.hist)?s.hist:[]).reduce((a,h)=>a+(h&&typeof h.srv==='number'&&h.srv>0&&Number.isFinite(h.srv)?h.srv:0),0)*PB_DAY;}
|
||||||
|
|
@ -54,8 +54,15 @@ const BADGES=[
|
||||||
{id:'lv13',i:'🌐',t:tr('badges.is_this_the_internet'),d:tr('badges.reach_customer_level_13'),r:'l',ok:()=>(S.lvl||1)>=13},
|
{id:'lv13',i:'🌐',t:tr('badges.is_this_the_internet'),d:tr('badges.reach_customer_level_13'),r:'l',ok:()=>(S.lvl||1)>=13},
|
||||||
{id:'gigawatt',i:'⚛️',t:tr('common.gigawatt_landlord'),d:tr('badges.hold_an_ai_wan_a_training'),r:'l',ok:()=>['aiwan','mtrain','ingest','pairs'].every(t=>S.biz.some(b=>b.type===t))},
|
{id:'gigawatt',i:'⚛️',t:tr('common.gigawatt_landlord'),d:tr('badges.hold_an_ai_wan_a_training'),r:'l',ok:()=>['aiwan','mtrain','ingest','pairs'].every(t=>S.biz.some(b=>b.type===t))},
|
||||||
{id:'blitz',i:'🚀',t:tr('common.blitz'),d:tr('badges.reach_tier_1_within_two_years'),r:'l',ok:()=>!!S.won&&S.day<=730},
|
{id:'blitz',i:'🚀',t:tr('common.blitz'),d:tr('badges.reach_tier_1_within_two_years'),r:'l',ok:()=>!!S.won&&S.day<=730},
|
||||||
|
{id:'tera',i:'📶',t:tr('badges.terabit_club'),d:tr('badges.serve_1_tbps'),r:'r',ok:()=>R.served>=1000},
|
||||||
|
{id:'tera10',i:'🚄',t:tr('badges.ten_terabits'),d:tr('badges.serve_10_tbps'),r:'e',ok:()=>R.served>=10000},
|
||||||
{id:'peta',i:'🌌',t:tr('common.hundred_terabits'),d:tr('badges.serve_100_tbps'),r:'l',ok:()=>R.served>=100000},
|
{id:'peta',i:'🌌',t:tr('common.hundred_terabits'),d:tr('badges.serve_100_tbps'),r:'l',ok:()=>R.served>=100000},
|
||||||
{id:'petabit',i:'🪐',t:tr('badges.a_petabit_a_second'),d:tr('badges.serve_1_pbps_a_thousand_terabits'),r:'l',ok:()=>R.served>=1e6},
|
{id:'petabit',i:'🪐',t:tr('badges.a_petabit_a_second'),d:tr('badges.serve_1_pbps_a_thousand_terabits'),r:'l',ok:()=>R.served>=1e6},
|
||||||
|
// Traffic carried in total (15-traffic-volume.js): the odometer, in petabytes.
|
||||||
|
{id:'vol_pb',i:'💾',t:tr('badges.vol_pb'),d:tr('badges.vol_pb_d'),r:'c',ok:()=>(S.vol||0)>=1},
|
||||||
|
{id:'vol_100pb',i:'🗄️',t:tr('badges.vol_100pb'),d:tr('badges.vol_100pb_d'),r:'r',ok:()=>(S.vol||0)>=100},
|
||||||
|
{id:'vol_eb',i:'🚂',t:tr('badges.vol_eb'),d:tr('badges.vol_eb_d'),r:'e',ok:()=>(S.vol||0)>=1000},
|
||||||
|
{id:'vol_zb',i:'🌠',t:tr('badges.vol_zb'),d:tr('badges.vol_zb_d'),r:'l',ok:()=>(S.vol||0)>=1e6},
|
||||||
{id:'llama',i:'🦙',t:tr('common.llama_drama'),d:tr('badges.lose_fiber_to_a_llama_herd'),r:'l',secret:true,ok:()=>!!(st().f||{}).llama},
|
{id:'llama',i:'🦙',t:tr('common.llama_drama'),d:tr('badges.lose_fiber_to_a_llama_herd'),r:'l',secret:true,ok:()=>!!(st().f||{}).llama},
|
||||||
{id:'hallway',i:'🎤',t:tr('common.hallway_track'),d:tr('badges.attend_a_conference'),r:'r',ok:()=>(st().confs||0)>=1},
|
{id:'hallway',i:'🎤',t:tr('common.hallway_track'),d:tr('badges.attend_a_conference'),r:'r',ok:()=>(st().confs||0)>=1},
|
||||||
{id:'beer',i:'🍺',t:tr('badges.peering_over_beer'),d:tr('badges.set_up_a_pni_while_the'),r:'e',ok:()=>!!st().beerPni},
|
{id:'beer',i:'🍺',t:tr('badges.peering_over_beer'),d:tr('badges.set_up_a_pni_while_the'),r:'e',ok:()=>!!st().beerPni},
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ function renderDash(){checkLayer();
|
||||||
const net=R.revMo-R.costMo,tot=Object.values(R.egT).reduce((a,b)=>a+b,0)||1;
|
const net=R.revMo-R.costMo,tot=Object.values(R.egT).reduce((a,b)=>a+b,0)||1;
|
||||||
const tile=(l,v,sub)=>`<div class="tile"><div class="lbl">${l}</div><div class="val">${v}</div>${sub?`<div class="sub">${sub}</div>`:''}</div>`;
|
const tile=(l,v,sub)=>`<div class="tile"><div class="lbl">${l}</div><div class="val">${v}</div>${sub?`<div class="sub">${sub}</div>`:''}</div>`;
|
||||||
let h=`<div style="display:flex;align-items:center;gap:10px"><div><div class="eyebrow">AS${S.asn} · ${esc(S.name)} · ${tierLabel()}</div><h2 style="font-size:28px">${tr('common.noc_dashboard')}</h2></div><button class="x" data-act="dashClose" aria-label="${tr('common.close')}">×</button></div>`+dashTabs();const DT=UI.dtab||'overview';if(DT==='overview')h+=`
|
let h=`<div style="display:flex;align-items:center;gap:10px"><div><div class="eyebrow">AS${S.asn} · ${esc(S.name)} · ${tierLabel()}</div><h2 style="font-size:28px">${tr('common.noc_dashboard')}</h2></div><button class="x" data-act="dashClose" aria-label="${tr('common.close')}">×</button></div>`+dashTabs();const DT=UI.dtab||'overview';if(DT==='overview')h+=`
|
||||||
<div class="dgrid">${tile(tr('common.traffic_now'),fmtG(R.served),tr('dashboard.of_g_wanted',{g:fmtG(R.demand)}))}${tile(tr('common.peak'),fmtG(S.stats.peak))}${tile(tr('dashboard.delivered_30_days'),(up*100).toFixed(1)+'%',up>=0.999?tr('dashboard.five_nines_ish'):up>=0.99?tr('dashboard.two_nines_and_change'):tr('dashboard.customers_are_upset'))}${tile(tr('common.peering_ratio'),pct(R.peerShare||0),tr('dashboard.caches_pnis_and_ix'))}${tile(tr('dashboard.monthly_p_l'),`<span style="color:${net>=0?'var(--eye)':'var(--bad)'}">${net>=0?'+':''}${fmt$(net)}</span>`,tr('dashboard.in_in_out_out',{in:fmt$(R.revMo),out:fmt$(R.costMo)}))}${tile(tr('common.incidents'),S.stats.incidents,tr('dashboard.n_shrugged_off',{n:S.stats.survived}))}</div>
|
<div class="dgrid">${tile(tr('common.traffic_now'),fmtG(R.served),tr('dashboard.of_g_wanted',{g:fmtG(R.demand)}))}${tile(tr('common.peak'),fmtG(S.stats.peak))}${tile(tr('dashboard.carried'),fmtVol(S.vol||0),tr('dashboard.carried_sub'))}${tile(tr('dashboard.delivered_30_days'),(up*100).toFixed(1)+'%',up>=0.999?tr('dashboard.five_nines_ish'):up>=0.99?tr('dashboard.two_nines_and_change'):tr('dashboard.customers_are_upset'))}${tile(tr('common.peering_ratio'),pct(R.peerShare||0),tr('dashboard.caches_pnis_and_ix'))}${tile(tr('dashboard.monthly_p_l'),`<span style="color:${net>=0?'var(--eye)':'var(--bad)'}">${net>=0?'+':''}${fmt$(net)}</span>`,tr('dashboard.in_in_out_out',{in:fmt$(R.revMo),out:fmt$(R.costMo)}))}${tile(tr('common.incidents'),S.stats.incidents,tr('dashboard.n_shrugged_off',{n:S.stats.survived}))}</div>
|
||||||
<div class="dcols"><div class="panel2"><h3>${tr('dashboard.traffic_by_way_out')}</h3>${svgChart(rows,['c','p','ix','t','l2'],[{k:'dem',col:'#1E2640',dash:true}],v=>fmtCap(Math.round(v)),'traffic')}${chartLegend('traffic',k=>k==='dem'?'':' '+pct((R.egT[k]||0)/tot))}</div>
|
<div class="dcols"><div class="panel2"><h3>${tr('dashboard.traffic_by_way_out')}</h3>${svgChart(rows,['c','p','ix','t','l2'],[{k:'dem',col:'#1E2640',dash:true}],v=>fmtCap(Math.round(v)),'traffic')}${chartLegend('traffic',k=>k==='dem'?'':' '+pct((R.egT[k]||0)/tot))}</div>
|
||||||
<div class="panel2"><h3>${tr('dashboard.money_per_month')}</h3>${svgChart(rows,[],[{k:'rev',col:'#16A866'},{k:'cost',col:'#FF4D5E'}],v=>fmt$(v),'money')}${chartLegend('money')}
|
<div class="panel2"><h3>${tr('dashboard.money_per_month')}</h3>${svgChart(rows,[],[{k:'rev',col:'#16A866'},{k:'cost',col:'#FF4D5E'}],v=>fmt$(v),'money')}${chartLegend('money')}
|
||||||
<h3 style="margin-top:8px">${tr('dashboard.where_the_money_goes')}</h3>${Object.entries(R.cost).filter(([k,v])=>v>0).sort((a,b)=>b[1]-a[1]).map(([k,v])=>`<div class="kv"><span>${{pops:tr('dashboard.pops_and_routers'),links:tr('dashboard.waves_and_fiber'),transit:tr('common.transit'),ix:tr('common.ix_ports'),pni:tr('common.pnis'),caches:tr('common.cache_power'),nni:tr('common.fabric_ports'),optical:tr('dashboard.amp_huts_and_spares'),loans:tr('common.loan_repayments'),revshare:tr('dashboard.investor_revenue_share'),extras:tr('dashboard.licenses_and_scrubbing'),wholesale:tr('dashboard.nearly_broadband_network_wholesale'),levy:tr('dashboard.regional_broadband_levy'),pie:tr('pie.costs_row')}[k]||k}</span><b>${tr('common.price_mo',{price:fmt$(v)})}</b></div>`).join('')}</div></div>`;
|
<h3 style="margin-top:8px">${tr('dashboard.where_the_money_goes')}</h3>${Object.entries(R.cost).filter(([k,v])=>v>0).sort((a,b)=>b[1]-a[1]).map(([k,v])=>`<div class="kv"><span>${{pops:tr('dashboard.pops_and_routers'),links:tr('dashboard.waves_and_fiber'),transit:tr('common.transit'),ix:tr('common.ix_ports'),pni:tr('common.pnis'),caches:tr('common.cache_power'),nni:tr('common.fabric_ports'),optical:tr('dashboard.amp_huts_and_spares'),loans:tr('common.loan_repayments'),revshare:tr('dashboard.investor_revenue_share'),extras:tr('dashboard.licenses_and_scrubbing'),wholesale:tr('dashboard.nearly_broadband_network_wholesale'),levy:tr('dashboard.regional_broadband_levy'),pie:tr('pie.costs_row')}[k]||k}</span><b>${tr('common.price_mo',{price:fmt$(v)})}</b></div>`).join('')}</div></div>`;
|
||||||
|
|
|
||||||
|
|
@ -227,12 +227,16 @@
|
||||||
"badges.run_a_slow_booting_packetoinker":"Run a slow-booting PacketOinker chassis.",
|
"badges.run_a_slow_booting_packetoinker":"Run a slow-booting PacketOinker chassis.",
|
||||||
"badges.run_two_routers_in_one_pop":"Run two routers in one POP.",
|
"badges.run_two_routers_in_one_pop":"Run two routers in one POP.",
|
||||||
"badges.serve_100_tbps":"Serve 100 Tbps.",
|
"badges.serve_100_tbps":"Serve 100 Tbps.",
|
||||||
|
"badges.serve_10_tbps":"Serve 10 Tbps.",
|
||||||
"badges.serve_1_pbps_a_thousand_terabits":"Serve 1 Pbps: a thousand terabits of happy traffic.",
|
"badges.serve_1_pbps_a_thousand_terabits":"Serve 1 Pbps: a thousand terabits of happy traffic.",
|
||||||
|
"badges.serve_1_tbps":"Serve 1 Tbps.",
|
||||||
"badges.serve_99_5_of_demand_every":"Serve 99.5% of demand every single day for a whole year.",
|
"badges.serve_99_5_of_demand_every":"Serve 99.5% of demand every single day for a whole year.",
|
||||||
"badges.set_up_a_pni_while_the":"Set up a PNI while the conference glow lasts.",
|
"badges.set_up_a_pni_while_the":"Set up a PNI while the conference glow lasts.",
|
||||||
"badges.survive_100_incidents_without":"Survive 100 incidents without customer impact.",
|
"badges.survive_100_incidents_without":"Survive 100 incidents without customer impact.",
|
||||||
"badges.take_a_de_kicks_retention_offer":"Take a DE-KICKS retention offer.",
|
"badges.take_a_de_kicks_retention_offer":"Take a DE-KICKS retention offer.",
|
||||||
"badges.take_out_a_loan":"Take out a loan.",
|
"badges.take_out_a_loan":"Take out a loan.",
|
||||||
|
"badges.ten_terabits":"Ten Terabits",
|
||||||
|
"badges.terabit_club":"Terabit Club",
|
||||||
"badges.the_long_way_round":"The Long Way Round",
|
"badges.the_long_way_round":"The Long Way Round",
|
||||||
"badges.this_game_earns_fiery_badges":"This game runs BGP at 3 a.m.: every badge you earn here is forged in fire, and upgrades one you already have.",
|
"badges.this_game_earns_fiery_badges":"This game runs BGP at 3 a.m.: every badge you earn here is forged in fire, and upgrades one you already have.",
|
||||||
"badges.this_game_earns_frosted_badges":"This game runs a Change Freeze: badges you earn here come freeze-dried.",
|
"badges.this_game_earns_frosted_badges":"This game runs a Change Freeze: badges you earn here come freeze-dried.",
|
||||||
|
|
@ -242,6 +246,14 @@
|
||||||
"badges.variant_forged_at_3_a_m":"Forged at 3 a.m.",
|
"badges.variant_forged_at_3_a_m":"Forged at 3 a.m.",
|
||||||
"badges.variant_freeze_dried":"Freeze-dried",
|
"badges.variant_freeze_dried":"Freeze-dried",
|
||||||
"badges.variant_on_call":"On-call",
|
"badges.variant_on_call":"On-call",
|
||||||
|
"badges.vol_100pb":"A Hundred Petabytes",
|
||||||
|
"badges.vol_100pb_d":"Carry 100 PB of traffic in one game.",
|
||||||
|
"badges.vol_eb":"Exabyte Express",
|
||||||
|
"badges.vol_eb_d":"Carry an exabyte of traffic in one game: a million terabytes.",
|
||||||
|
"badges.vol_pb":"Your First Petabyte",
|
||||||
|
"badges.vol_pb_d":"Carry a petabyte of traffic in one game.",
|
||||||
|
"badges.vol_zb":"The Zettabyte Era",
|
||||||
|
"badges.vol_zb_d":"Carry a zettabyte in one game, about what the whole internet moved in a year around 2016.",
|
||||||
"badges.weather_a_ddos_with_your_defences":"Weather a DDoS with your defences ready.",
|
"badges.weather_a_ddos_with_your_defences":"Weather a DDoS with your defences ready.",
|
||||||
"badges.weather_a_multi_terabit_ddos":"Weather a multi-terabit DDoS.",
|
"badges.weather_a_multi_terabit_ddos":"Weather a multi-terabit DDoS.",
|
||||||
"badges.win_without_ever_taking_a_loan":"Win without ever taking a loan.",
|
"badges.win_without_ever_taking_a_loan":"Win without ever taking a loan.",
|
||||||
|
|
@ -1792,6 +1804,8 @@
|
||||||
"dashboard.all_n":"All ({n})",
|
"dashboard.all_n":"All ({n})",
|
||||||
"dashboard.amp_huts_and_spares":"Amp huts and spares",
|
"dashboard.amp_huts_and_spares":"Amp huts and spares",
|
||||||
"dashboard.caches_pnis_and_ix":"caches, PNIs and IX",
|
"dashboard.caches_pnis_and_ix":"caches, PNIs and IX",
|
||||||
|
"dashboard.carried":"Carried",
|
||||||
|
"dashboard.carried_sub":"in total, this game",
|
||||||
"dashboard.chart_total":"Total",
|
"dashboard.chart_total":"Total",
|
||||||
"dashboard.customers_are_upset":"customers are upset",
|
"dashboard.customers_are_upset":"customers are upset",
|
||||||
"dashboard.delivered_30_days":"Delivered, 30 days",
|
"dashboard.delivered_30_days":"Delivered, 30 days",
|
||||||
|
|
|
||||||
62
tests/traffic-badges.test.js
Normal file
62
tests/traffic-badges.test.js
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
// Traffic badges: the rate ladder (1 Tbps, 10 Tbps, then the old 100 Tbps and 1 Pbps) and the odometer, S.vol, the
|
||||||
|
// petabytes carried in a game, with badges at 1 PB, 100 PB, 1 EB and 1 ZB.
|
||||||
|
const test = require('node:test');
|
||||||
|
const assert = require('node:assert/strict');
|
||||||
|
const { load } = require('./harness');
|
||||||
|
|
||||||
|
const start = "ACT.start({});S.cash=1e9;S.nextFail=1e9;S.nextEvent=1e9;ACT.launchBB({city:'fra'});ACT.buyTransit({city:'fra',net:'cog',tier:1});compute()";
|
||||||
|
|
||||||
|
test('every day adds a day of what was served: 1 Gbps for a day is 10.8 TB', () => {
|
||||||
|
const { ev, errors } = load();
|
||||||
|
ev(start);
|
||||||
|
assert.equal(ev('S.vol'), 0, 'a new game starts at zero');
|
||||||
|
// What a day adds, from the day's own served traffic, whatever it is.
|
||||||
|
const r = JSON.parse(ev('(()=>{const out=[];for(let i=0;i<20;i++){const v0=S.vol;dayTick();out.push({add:S.vol-v0,srv:R.served});}return JSON.stringify(out);})()'));
|
||||||
|
for (const x of r) assert.ok(Math.abs(x.add - x.srv * 0.0108) < 1e-9, `${x.add} PB for ${x.srv} Gbps`);
|
||||||
|
assert.ok(r.some((x) => x.srv > 0), 'some traffic flowed');
|
||||||
|
assert.equal(ev('fmtVol(0.0108)'), '11 TB');
|
||||||
|
assert.equal(ev('fmtVol(1)'), '1.0 PB');
|
||||||
|
assert.equal(ev('fmtVol(1500)'), '1.50 EB');
|
||||||
|
assert.equal(ev('fmtVol(2e6)'), '2.00 ZB');
|
||||||
|
assert.deepEqual(errors, []);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('the ladders: each badge at its line, not before', () => {
|
||||||
|
const { ev, errors } = load();
|
||||||
|
ev(start);
|
||||||
|
const got = () => JSON.parse(ev("JSON.stringify(['tera','tera10','peta','petabit','vol_pb','vol_100pb','vol_eb','vol_zb'].filter(k=>S.ach&&S.ach[k]!==undefined))"));
|
||||||
|
const at = (served, vol) => { ev(`R.served=${served};S.vol=${vol};checkBadges()`); return got(); };
|
||||||
|
assert.deepEqual(at(999, 0.99), []);
|
||||||
|
assert.deepEqual(at(1000, 1), ['tera', 'vol_pb']);
|
||||||
|
assert.deepEqual(at(9999, 99.9), ['tera', 'vol_pb']);
|
||||||
|
assert.deepEqual(at(10000, 100), ['tera', 'tera10', 'vol_pb', 'vol_100pb']);
|
||||||
|
assert.deepEqual(at(10000, 1000), ['tera', 'tera10', 'vol_pb', 'vol_100pb', 'vol_eb']);
|
||||||
|
assert.deepEqual(at(1e6, 1e6), ['tera', 'tera10', 'peta', 'petabit', 'vol_pb', 'vol_100pb', 'vol_eb', 'vol_zb']);
|
||||||
|
assert.deepEqual(errors, []);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('the dashboard shows what was carried', () => {
|
||||||
|
const { ev, errors } = load();
|
||||||
|
ev(start);
|
||||||
|
ev('S.vol=1234.5');
|
||||||
|
ev('renderDash()');
|
||||||
|
const h = ev("document.getElementById('dash').innerHTML");
|
||||||
|
assert.match(h, /Carried/);
|
||||||
|
assert.match(h, /1\.23 EB/);
|
||||||
|
assert.deepEqual(errors, []);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('saves: kept, repaired, and an old save starts from the history it still holds', () => {
|
||||||
|
const { ev, errors } = load();
|
||||||
|
ev(start);
|
||||||
|
ev('S.vol=42;S.hist=[{d:1,srv:1000},{d:2,srv:2000}]');
|
||||||
|
const s = JSON.parse(ev('JSON.stringify(packSave(S))'));
|
||||||
|
const fix = (x) => JSON.parse(ev(`JSON.stringify(sanitize(JSON.parse(${JSON.stringify(JSON.stringify(x))})).vol)`));
|
||||||
|
assert.equal(fix(s), 42);
|
||||||
|
for (const bad of [-5, 'lots', null, Infinity]) assert.ok(Math.abs(fix({ ...s, vol: bad }) - 3000 * 0.0108) < 1e-9, `${bad} is rebuilt from the history`);
|
||||||
|
delete s.vol;
|
||||||
|
assert.ok(Math.abs(fix(s) - 3000 * 0.0108) < 1e-9, 'a save from before the odometer: 3,000 Gbps-days of history');
|
||||||
|
s.hist = [{ d: 1, srv: 'x' }, { d: 2, srv: -1 }, null];
|
||||||
|
assert.equal(fix(s), 0, 'junk history counts for nothing');
|
||||||
|
assert.deepEqual(errors, []);
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue