Merge v2 (the eight community PRs) under the ruleset, puzzles and Tier 1 by cone
Integration base for performance work: origin/v2-orders' merge of v2 and the ruleset, onto v2-doors. Pinned attack flows (#153) route at their port's plain rank (no customer cone), and that rank is always tried even when RouteScript moved every other exit off it.
This commit is contained in:
commit
d0fbbed96a
61 changed files with 3064 additions and 200 deletions
18
CHANGELOG.md
18
CHANGELOG.md
|
|
@ -15,6 +15,24 @@ All notable changes to this project are documented here. The project follows
|
|||
- China Telecomet now sells its CN-Too premium crossing in Moscow too, at the same price as in Hong Kong (#195). Haul your European traffic to Moscow and it reaches China with about 3% loss; nothing else of theirs is on offer there.
|
||||
- Series of Tubes now speaks German. The game follows your browser's language the first time, and you can switch to German under Settings or on the title screen. Networking terms like Peering and Transit stay in English, the way network engineers say them.
|
||||
- Glowball Sakura Lager joins the map: a Tier 2 carrier in the big hubs of the US, Europe and Asia-Pacific that sells transit, takes PNIs and peers openly wherever it is. It is not a Tier 1, so it buys its own transit from three of them, while 13 smaller networks in its regions buy theirs from it, and one PNI with it reaches about 3% of all traffic. Far from home, in Asia and New Zealand, it charges more than the locals, and it sells no transit in Australia.
|
||||
- Check a selected link’s redundancy against current demand: see disconnected endpoints, additional service loss and full fallback links without changing the live network.
|
||||
- Links can now use a custom routing metric, set either as a multiplier or as an exact cost. Pick Custom under Routing metric to fine-tune where your traffic goes; it explains how a link's cost is worked out and what each preset comes to on that link.
|
||||
- Prices now follow how connected each city really is, based on PeeringDB and Hurricane Electric data. Transit costs up to 1.8× more in cities where few networks are present, a POP costs 1.25× to 1.5× where there is little or no carrier-neutral data center, and countries with thousands of networks, like Brazil and the US, bring more ISP customers. Big hubs such as Frankfurt, Amsterdam, New York and São Paulo keep their prices.
|
||||
- Attacks are more varied: sizes, lengths and ingress ports change from one attack to the next, and several can hit at once. Hosting game servers or cloud gaming makes attacks more frequent, as it does in real life.
|
||||
- The link traffic breakdown now shows the correct source city for scrubbing traffic. Cities using the same center no longer overwrite each other's labels.
|
||||
- Live attacks now show one scrubbing detour from the attacked city to its nearest active scrubbing center, using the links' one-way latency.
|
||||
- Game server and cloud gaming customers now carry a “Gaming attracts attacks” note on their offers and customer lists, so you can see the DDoS risk before signing them.
|
||||
- Live attacks now show how much traffic Flowspec actually drops at the ingress routers. Routers without TCAM no longer claim to filter attacks, mixed router capabilities are called out, and Flowspec drops are counted separately from other edge filters.
|
||||
- Hosting game servers or cloud gaming brings RackNet and TeamSpooked attacks. Both bypass Flowspec and require dedicated mitigation.
|
||||
- Flood Season keeps sending ever larger attacks when you keep playing after winning or running out of time. Finishing the challenge no longer switches the floods off.
|
||||
- Each live attack in the NOC now shows incoming bandwidth, upstream scrubbing, edge filtering, scrubbing-center use and any traffic still leaking through.
|
||||
- DDoS bandwidth now adds up: upstream scrubbing, edge filters and scrubbing centers work in sequence. The NOC uses the same figures as traffic routing, including floods that cannot reach a remote center.
|
||||
- Attacks can now use Memcached amplification or an ACK flood. Flowspec catches the former; the latter need mitigation.
|
||||
- Set the number of each optic model directly on land and subsea fiber links. Apply a whole change at once, with its total price shown before buying; removed optics return to the spares shelf.
|
||||
- Order PNIs with one network or every network at all shared POPs from the NOC Traffic tab: choose a port size, review the total cost, and add missing connections or upgrade smaller ones in one go. Each network keeps its own smallest PNI size and delivery time.
|
||||
- Toggle auto-accept in Deals to check ready sales every five real seconds, including their requirements and available service capacity, with a countdown beside eligible Accept buttons.
|
||||
- Toggle auto-pay repairs in the NOC to pay for affordable rush repairs automatically while the game runs.
|
||||
- Utilities join route servers and request eligible peers across every joined IX, install missing PoP redundancy hardware and balance caches between sites, and request a cache from each eligible provider at each site.
|
||||
|
||||
## [1.36.0] — 2026-10-28
|
||||
|
||||
|
|
|
|||
109
site/i18n/de.js
109
site/i18n/de.js
|
|
@ -14,6 +14,11 @@
|
|||
"action_helpers.too_far_even_at_its_slowest":"Zu weit, selbst in der langsamsten Einstellung: Ein optischer Abschnitt ist hier {span} km lang, die Reichweite beträgt {max} km. Füge einen Regenerator-Standort hinzu (Line System).",
|
||||
"action_helpers.unlocks_at_customer_level_n":"Wird ab Kundenlevel {n} freigeschaltet.",
|
||||
"actions.your_router_can_t_take_a":"<b>Dein Router kann keinen {port}-Port aufnehmen.</b><br>Rüste ihn im Tab Infra auf.",
|
||||
"automation.auto_accept_sales":"Deals automatisch annehmen: {state}",
|
||||
"automation.auto_pay_repairs":"Reparaturen automatisch zahlen: {state}",
|
||||
"automation.next_auto_check":"Zeit bis zur nächsten automatischen Prüfung der Anforderungen.",
|
||||
"automation.repairs_when_affordable":"Zahlt während des Spiels automatisch Express-Reparaturen, wenn du sie dir leisten kannst.",
|
||||
"automation.sales_every_five_seconds":"Alle 5 Sekunden während des Spiels: Nur Angebote, deren Anforderungen und Kapazität bereit sind, werden angenommen.",
|
||||
"badges.a_petabit_a_second":"Ein Petabit pro Sekunde",
|
||||
"badges.a_secret_badge":"Ein geheimes Abzeichen",
|
||||
"badges.attend_a_conference":"Besuche eine Konferenz.",
|
||||
|
|
@ -699,6 +704,7 @@
|
|||
"city_panel.every_port_is_taken_add_a":"Alle Ports sind belegt. Füg einen Router hinzu oder wechsle auf ein Modell mit mehr Ports, bevor du etwas Neues ansteckst.",
|
||||
"city_panel.everything_is_in_one_building_move":"Alles steht in einem Gebäude. Verschieb ein paar Uplinks in den Tabs Transit und Peering an den anderen Standort.",
|
||||
"city_panel.fabrics_list":"Fabrics: {list}",
|
||||
"city_panel.few_data_centers_pops_x":"Wenige Rechenzentren: POPs {x}×",
|
||||
"city_panel.fiber_from_city":"Glasfaser von {city}",
|
||||
"city_panel.fiber_is_down":"Glasfaser ist down",
|
||||
"city_panel.g_of_circuits":"{g} an Verbindungen",
|
||||
|
|
@ -785,6 +791,7 @@
|
|||
"common.95th_percentile":"95. Perzentil",
|
||||
"common.about_average":"etwa durchschnittlich",
|
||||
"common.accept":"Annehmen",
|
||||
"common.ack_flood":"ACK-Flood",
|
||||
"common.ad_campaign":"Werbekampagne!",
|
||||
"common.africa":"Afrika",
|
||||
"common.all_cities":"Alle Städte",
|
||||
|
|
@ -851,6 +858,7 @@
|
|||
"common.challenger":"Herausforderer",
|
||||
"common.change_freeze":"Change Freeze",
|
||||
"common.chase_it":"Hinterher",
|
||||
"common.check_redundancy":"Redundanz prüfen",
|
||||
"common.china":"China",
|
||||
"common.city":"Stadt",
|
||||
"common.city_906b":"Stadt",
|
||||
|
|
@ -875,10 +883,12 @@
|
|||
"common.controller_off":"Controller aus",
|
||||
"common.cooling_failure":"Kühlungsausfall",
|
||||
"common.copy":"Kopieren",
|
||||
"common.cost":"Kosten",
|
||||
"common.costs":"Kosten",
|
||||
"common.courtesy_route":"Gefälligkeits-Route",
|
||||
"common.crashes_more":"stürzt öfter ab",
|
||||
"common.credit_rating":"Bonität",
|
||||
"common.custom":"Eigene",
|
||||
"common.customer":"Kunde",
|
||||
"common.customer_care":"Kundenpflege",
|
||||
"common.customer_levels":"Kundenlevel",
|
||||
|
|
@ -905,6 +915,7 @@
|
|||
"common.demand":"Nachfrage",
|
||||
"common.deploy":"Deployen",
|
||||
"common.deployed":"deployt",
|
||||
"common.distributed_ingress":"Verteilter Eingang",
|
||||
"common.diverse":"redundant",
|
||||
"common.diverse_route":"redundante Route",
|
||||
"common.dns_reflection":"DNS-Reflection",
|
||||
|
|
@ -1062,6 +1073,7 @@
|
|||
"common.may":"Mai",
|
||||
"common.member":"− Mitglied",
|
||||
"common.member_fef5":"Mitglied",
|
||||
"common.memcached_amplification":"Memcached-Amplification",
|
||||
"common.merchant_silicon":"Merchant Silicon",
|
||||
"common.mercury":"Merkur",
|
||||
"common.metaverse_platform":"Metaverse-Plattform",
|
||||
|
|
@ -1074,6 +1086,7 @@
|
|||
"common.more_scenarios":"Weitere Szenarien",
|
||||
"common.ms_ms_one_way":"{ms} ms pro Richtung",
|
||||
"common.mtu_mismatch":"MTU-Mismatch",
|
||||
"common.multiplier":"Faktor",
|
||||
"common.mystery_link":"Mysteriöser Link",
|
||||
"common.n_box":{"one":"{n} Box","other":"{n} Boxen"},
|
||||
"common.n_days_left":"noch {n} Tage",
|
||||
|
|
@ -1163,6 +1176,7 @@
|
|||
"common.price_lock":"Preisbindung",
|
||||
"common.price_mo":"{price}/Monat",
|
||||
"common.provisioning_n_d_grace":"in Bereitstellung, {n} T. Schonfrist",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rang",
|
||||
"common.rare":"Selten",
|
||||
"common.reach":"Reichweite",
|
||||
|
|
@ -1172,6 +1186,7 @@
|
|||
"common.really_leave":"Wirklich verlassen?",
|
||||
"common.really_remove":"Wirklich entfernen?",
|
||||
"common.redundancy":"Redundanz",
|
||||
"common.redundancy_check":"Redundanzcheck",
|
||||
"common.regen_site":"− Regen-Standort",
|
||||
"common.regen_sites":"Regen-Standorte",
|
||||
"common.regional_player":"Regionaler Player",
|
||||
|
|
@ -1229,6 +1244,8 @@
|
|||
"common.sep":"Sep",
|
||||
"common.serious_backbone":"Ernstzunehmender Backbone",
|
||||
"common.serve_as_much_traffic_as_you":"Liefere in einem Jahr so viel Traffic aus, wie du kannst.",
|
||||
"common.service_affected":"Betroffener Dienst",
|
||||
"common.set":"Setzen",
|
||||
"common.settings":"Einstellungen",
|
||||
"common.share":"Teilen",
|
||||
"common.share_2cd9":"Teilen…",
|
||||
|
|
@ -1274,6 +1291,7 @@
|
|||
"common.subsea_cables":"Seekabel",
|
||||
"common.supply_chain":"Lieferkette",
|
||||
"common.syn_flood":"SYN-Flood",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestrisch",
|
||||
"common.terrestrial_19e4":"Terrestrisch",
|
||||
"common.terrestrial_fiber":"Terrestrische Glasfaser",
|
||||
|
|
@ -1405,6 +1423,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Du brauchst zuerst einen POP in jeder Stadt aus dem Vertrag.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} extra für {d} Tage, {when} · zahlt {fee}, wenn es vorbei ist",
|
||||
"customers_and_events.day_n_of_d":"Tag {n} von {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Gaming zieht Angriffe an",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} Faserpaare in deinem Graben {a}–{b}. Das Graben war der teure Teil, also wollen sie alles",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} Standorte: {list} · {bw} pro Standort · {price}/Monat",
|
||||
"customers_and_events.name_at_site":"{name} in {site}",
|
||||
|
|
@ -1621,6 +1640,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Ein Trawler vor Ostende hat sein Netz direkt durch dein Kabel {a}–{b} gezogen. Die Nordsee ist etwa dreißig Meter tief und voller Boote.",
|
||||
"failures.a_visiting_engineer_from_london":"Ein Gast-Ingenieur aus London hat Marmite ins NOC in {city} mitgebracht. Die diplomatischen Beziehungen sind zusammengebrochen, und dein Router auch, während alle stritten.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Ein Windpark-Serviceschiff hat auf deinem Kabel {a}–{b} Anker geworfen. Es war da, um eine Turbine zu reparieren.",
|
||||
"failures.across_n_transit_and_peering_ports":", über {n} Transit- und Peering-Ports",
|
||||
"failures.all_n_links_in_that_trench":"Alle {n} Links in diesem Graben sind mit ausgefallen.",
|
||||
"failures.an_automation_script_in_city_ran":"Ein Automatisierungsskript in {city} hat „sed“ auf die ganze Config losgelassen statt auf eine Zeile. Jedes Interface heißt jetzt „TODO“.",
|
||||
"failures.an_earthquake_shook_your_a_b":"Ein Erdbeben hat deine Glasfaser {a}–{b} irgendwo oberhalb von 4.000 Metern losgerüttelt.",
|
||||
|
|
@ -1985,13 +2005,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Eine Schaltsekunde hat einen deiner Router überzeugt, es sei 1970. Die Uptime zeigt jetzt minus 56 Jahre. Der Traffic ist okay.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Eine Route, die du in Jahr 1 zurückgezogen hast, ist irgendwo im Internet immer noch sichtbar. Niemand weiß, wo. Alles gut. Wahrscheinlich.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Ein zweistündiges Meeting über Router-Hostnamen endete mit einer Abstimmung für „router-final-v2-NEU“.",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Nach Upstream-Scrubbing: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Ein Prüfer wollte einen Netzplan. Du hast die Spielkarte geschickt. Er hat sie abgenickt.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Angriff vollständig abgewehrt",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Ziel blackholen (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Geblackholt: Der Müll ist weg, und {city} auch. Der Angriff hat bekommen, was er wollte.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Eingedämmt auf deinem geopferten {net}-PNI",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec kann keinen {vec} abfangen (Anwendungsebene)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Flowspec auf deinem {model} verwirft {vec} am Edge",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Flowspec auf deinem {model} stutzt {vec}, aber sein TCAM ist klein",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Edge-Filter verwerfen: {g}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec fängt {vec} nicht ab",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec verwirft: {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec verwirft: {g}; manche Eingangs-Router haben kein TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} kommen trotzdem durch",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"Es war DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"IX-Blackhole <small>~die Hälfte respektiert es</small>",
|
||||
|
|
@ -2002,29 +2026,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Tragender Tippfehler",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"Das Management hat einen Change Freeze verhängt. Jemand hat einen Change gemacht, um den Change Freeze anzukündigen.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"{name}-Transit-LAG in {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} scrubbt ihn beim Upstream (Clean-Pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Kein Flowspec-Filter: Die Eingangs-Router haben kein TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Kein Scrubbing-Center",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"Nach der Abwehr am Edge ist kein Scrubbing nötig",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"On-Demand-Scrubbing leitet um, aktiv in {n} T.",
|
||||
"incidents_and_ddos.open_to_work":"Open to Work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"PNI-LAG mit {name} in {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Erreicht dein Netz: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"RTBH ist kostenlos und sofort, verwirft aber alles zum Opfer, Angriff und Kunde gleichermaßen. Ein IX-Blackhole hält den Kunden online, aber nur etwa die Hälfte der Mitglieder respektiert es. Der HackBack 3000™ von Skynot AI beendet es manchmal, und manchmal plättet er einen Unschuldigen und bringt dir eine Strafe ein.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Scrubbing-Center nicht erreichbar oder voll",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing in {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Scrubbing-Traffic über dein Backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · noch {n} T.",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Jemand hat den DNS-Eintrag für das interne Wiki gelöscht. Das Runbook zum Reparieren von DNS lag im Wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Jemand hat ein VLAN „prodcution“ genannt. Es ist jetzt tragend und kann nie umbenannt werden.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"Das TLS-Zertifikat deines NOC-Dashboards ist abgelaufen. Niemand kann Graphen sehen, also gibt es technisch gesehen keine Probleme.",
|
||||
"incidents_and_ddos.this_attack_g":"Dieser Angriff: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket der Woche",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"{tier}-Scrubbing in {city} reinigt ihn, über deinen Backbone geschleppt (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"{tier}-Scrubbing in {city} reinigt ihn",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"Der Hersteller-Support hat dich gebeten, „es mal aus- und wieder einzuschalten“. Für den Router, den du schon neu gestartet hast. Ticket geschlossen.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Du hast im Inventar einen 10G-Link gefunden, den niemand bestellt hat, für den niemand zahlt und der 3 Gbps von irgendwas transportiert.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Dein Backbone kann nur {g} davon nach {city} schleppen: Der Rest wird nicht gescrubbt",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Deine IP-Adress-Tabelle hat 1.048.576 Zeilen erreicht. Excel hat dazu eine Meinung.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Dein IPv6-Traffic ist um 400 % gewachsen. Von einem Paket auf fünf.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Dein {model} hier hat kein Flowspec-TCAM",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Dein Monitoring ist ausgefallen. Du hast es gemerkt, weil nichts alarmiert hat. Sehr friedliche Woche.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Dein Peering-Koordinator hat sein Profil auf „Open to Work“ gestellt. Drei Tier 1s wollen plötzlich plaudern. Passiert ist nichts, aber es hat sich gut angefühlt.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Deine Scrubbing-Center sind voll: {g} rutschen durch",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"Die Support-Hotline deines Upstreams spielt immer dieselben 11 Sekunden Warteschleifenmusik. Dein Bereitschaftsingenieur kann sie jetzt in vier Tonarten summen.",
|
||||
"install.before_you_start":"Bevor du anfängst",
|
||||
"install.best_played_as_an_app":"Am besten als App spielen",
|
||||
|
|
@ -2106,9 +2130,12 @@
|
|||
"link_modal.you_already_have_n_link_here":{"one":"Du hast hier schon {n} Link ({list}). Parallele Links bringen Kapazität. Wie soll dieser geroutet werden?","other":"Du hast hier schon {n} Links ({list}). Parallele Links bringen Kapazität. Wie soll dieser geroutet werden?"},
|
||||
"link_panels.a_bigger_fabric_carries_more_traffic":"Eine größere Fabric trägt mehr Traffic und hat Platz für mehr Mitglieder. Dein Router hier muss trotzdem mithalten.",
|
||||
"link_panels.a_link_on_standby_carries_traffic":"Ein Link im Standby trägt nur Traffic, wenn die anderen Links zwischen diesen Städten voll oder down sind.",
|
||||
"link_panels.a_link_s_cost_is_its":"Die Kosten eines Links sind seine Länge in km plus 60, mal ein Faktor. Traffic nimmt den Pfad mit den niedrigsten Gesamtkosten.",
|
||||
"link_panels.a_regen_site_turns_the_light":"Ein Regen-Standort verwandelt das Licht auf halber Strecke zurück in Bits und schickt es frisch weiter, also müssen Optiken nur bis zum nächsten Standort reichen. Jeder braucht eine Regen-Karte für jeden beleuchteten Kanal. {price}/Monat pro Standort für die Hütte.",
|
||||
"link_panels.abandon_the_fiber":"Glasfaser aufgeben",
|
||||
"link_panels.add_parallel_link":"Parallelen Link hinzufügen",
|
||||
"link_panels.additional_traffic_lost":"Zusätzlich verlorener Traffic",
|
||||
"link_panels.an_alternate_path_exists_but_current":"Es gibt einen anderen Weg, aber mit dem jetzigen Routing und der Kapazität kommt weniger Traffic an.",
|
||||
"link_panels.apply_for_a_license_price_mo":"Lizenz beantragen <small>{price} + {mo}/Monat · ~45 Tage</small>",
|
||||
"link_panels.back_in_n_days":"Zurück in {n} Tagen.",
|
||||
"link_panels.behind_the_great_firewall":"Hinter der Großen Firewall",
|
||||
|
|
@ -2119,6 +2146,9 @@
|
|||
"link_panels.click_to_tear_down":"Klicken zum Abbauen",
|
||||
"link_panels.collecting_data_check_back_in_a":"Daten werden gesammelt. Schau in ein paar Tagen wieder rein.",
|
||||
"link_panels.congested_upgrade_it_or_add_a":"Überlastet. Rüste ihn auf oder füg einen parallelen Pfad hinzu.",
|
||||
"link_panels.connected_but_tight":"Verbunden, aber knapp.",
|
||||
"link_panels.cost_on_this_link_w_allowed":"Kosten auf diesem Link: {w}. Erlaubt: {lo} bis {hi}.",
|
||||
"link_panels.cost_the_exact_number_whatever_the":"Kosten: genau diese Zahl, egal wie lang der Link ist.",
|
||||
"link_panels.dark_fiber_kind_km_km":"Dark Fiber · {kind} · {km} km",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of":"Personalisierte DE-KICKS-Preise: {p} % von dem, was ein normaler IX verlangen würde (Aktion, noch {n} Tage).",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of_3d4f":"Personalisierte DE-KICKS-Preise: {p} % von dem, was ein normaler IX verlangen würde.",
|
||||
|
|
@ -2127,6 +2157,7 @@
|
|||
"link_panels.finish_in_1_day_price":"In 1 Tag fertigstellen <small>{price}</small>",
|
||||
"link_panels.foreign_networks_need_a_local_joint":"Ausländische Netze brauchen ein lokales Joint Venture und eine Betriebslizenz, um hier Infrastruktur zu bauen.",
|
||||
"link_panels.found_your_own_ix_cost_mo":"Eigenen IX gründen <small>{cost} + {mo}/Monat</small>",
|
||||
"link_panels.full_links_during_the_test":"Volle Links während des Tests",
|
||||
"link_panels.g_to_km_km":"{g} bis {km} km",
|
||||
"link_panels.giving_it_up_now_returns_price":"Wenn du jetzt aufgibst, bekommst du {price} zurück.",
|
||||
"link_panels.going_to_customers_in":"Geht zu Kunden in",
|
||||
|
|
@ -2141,6 +2172,7 @@
|
|||
"link_panels.lost_on_the_way":"Unterwegs verloren",
|
||||
"link_panels.mainland_china_plays_by_its_own":"Festlandchina spielt nach eigenen Regeln. {list} und andere ausländische Dienste sind hier gesperrt, also erreichen Nutzer meist chinesische Netze. Traffic über die Grenze verliert etwa {pct} durch Filter und Überlastung, außer er läuft über eine Premium-Route: CN-Too-Transit oder eine grenzüberschreitende Premium-Verbindung (beides nur in Hongkong zu haben) oder ein PNI mit einem chinesischen Netz. Der Umsatz pro Nutzer ist hier niedriger.",
|
||||
"link_panels.members_paying_you":"Mitglieder, die dich bezahlen",
|
||||
"link_panels.multiplier_scales_the_distance_cost":"Faktor: skaliert die Kosten der Strecke, ein längerer Link kostet also weiter mehr.",
|
||||
"link_panels.n_amp_huts":"{n} Verstärkerhütten",
|
||||
"link_panels.n_amplifiers":"{n} Verstärker",
|
||||
"link_panels.n_exchanges_compete_in_city_members":"{n} Exchanges konkurrieren in {city}. Die Mitglieder überschneiden sich, aber nicht komplett, und die Herausforderer unterbieten den Platzhirsch. Kleine Netze sitzen oft nur an einem davon.",
|
||||
|
|
@ -2159,6 +2191,7 @@
|
|||
"link_panels.needs_a_pop_in_cities_too":"Braucht auch einen POP in {cities}.",
|
||||
"link_panels.needs_what":"braucht {what}",
|
||||
"link_panels.needs_your_own_scrubbing_center":"Braucht ein eigenes Scrubbing-Center (Tab Infra).",
|
||||
"link_panels.no_alternate_backbone_path_connects":"Fällt dieser Link aus, verbindet kein anderer Backbone-Weg diese Endpunkte.",
|
||||
"link_panels.no_regen_sites_in_the_middle":"Keine Regen-Standorte mitten im Ozean: Lange Kabel betreiben ihre Optiken im Langstreckenmodus.",
|
||||
"link_panels.no_traffic_right_now":"Gerade kein Traffic.",
|
||||
"link_panels.not_in_your_cities_yet_nearest":"Noch in keiner deiner Städte. Am nächsten: {city}",
|
||||
|
|
@ -2168,6 +2201,7 @@
|
|||
"link_panels.on_standby_but_carrying_the_traffic":"Im Standby, trägt aber den Traffic: Kein aktiver Link zwischen diesen Städten ist up.",
|
||||
"link_panels.on_standby_idle_while_the_other":"Im Standby: untätig, solange die anderen Links zwischen diesen Städten Platz haben.",
|
||||
"link_panels.on_standby_taking_the_overflow":"Im Standby: nimmt den Überlauf, weil die anderen Links zwischen diesen Städten voll sind.",
|
||||
"link_panels.one_backhoe_is_not_enough":"Ein Bagger reicht nicht.",
|
||||
"link_panels.open_peer_but_not_on_any":"Offener Peer, aber an keinem IX, an dem du einen POP hast. Am nächsten: {city}",
|
||||
"link_panels.open_peer_but_not_on_any_bfbb":"Offener Peer, aber an keinem IX, an dem du einen POP hast",
|
||||
"link_panels.open_peer_join_the_route_server":"Offener Peer: Tritt dem Route Server am {ix} bei",
|
||||
|
|
@ -2184,6 +2218,7 @@
|
|||
"link_panels.port_port_price_on_request":"{port}-Port <small>Preis auf Anfrage ☎</small>",
|
||||
"link_panels.ports_at_p_of_the_usual":"Ports zu {p} % des üblichen Preises.",
|
||||
"link_panels.ports_up_to_port_are_free":"Ports bis {port} sind kostenlos.",
|
||||
"link_panels.presets_on_this_link_list":"Voreinstellungen auf diesem Link: {list}.",
|
||||
"link_panels.price_n_days":"{price} · {n} Tage",
|
||||
"link_panels.put_this_link_on_standby":"Diesen Link in Standby versetzen",
|
||||
"link_panels.ready_for_a_pni_in_city":"Bereit für einen PNI in {city}",
|
||||
|
|
@ -2202,6 +2237,7 @@
|
|||
"link_panels.sell_one_price":"Einen verkaufen <small>{price}</small>",
|
||||
"link_panels.selling_spare_capacity":"Freie Kapazität verkaufen",
|
||||
"link_panels.shares_a_trench_with_n_other":{"one":"Teilt sich einen Graben mit {n} anderen Link. Ein Schnitt legt alle lahm.","other":"Teilt sich einen Graben mit {n} anderen Links. Ein Schnitt legt alle lahm."},
|
||||
"link_panels.snapshot_only_one_selected_link":"Nur eine Momentaufnahme: Genau der gewählte Link fällt aus. Andere Links auf demselben Kabel, Graben oder Fabric bleiben oben. Bestehende Ausfälle und Routing-Regeln gelten weiter. Zeit, Geld und Spielstand ändern sich nicht.",
|
||||
"link_panels.spare_optics_and_amplifier_cards_on":"Reserve-Optiken und Verstärkerkarten im Regal machen aus mehrtägigen Hardwareausfällen einen eintägigen Tausch.",
|
||||
"link_panels.spare_price":"Ersatz + {price}",
|
||||
"link_panels.spares_bought_now_are_already_paid":"Jetzt gekaufte Ersatzteile sind schon bezahlt, wenn der nächste Engpass kommt.",
|
||||
|
|
@ -2211,6 +2247,7 @@
|
|||
"link_panels.take_it_off_standby":"Aus dem Standby holen",
|
||||
"link_panels.there_s_no_ix_in_city":"In {city} gibt es noch keinen IX. Gründe einen: Netze treten mit der Zeit bei, zahlen dir Ports und peeren kostenlos mit dir.",
|
||||
"link_panels.they_need_the_full_internet_your":"Sie brauchen das volle Internet. Deine Erreichbarkeit ist {pct}.",
|
||||
"link_panels.this_backhoe_wins":"Dieser Bagger gewinnt.",
|
||||
"link_panels.this_fiber_is_dark_add_optics":"Diese Glasfaser ist dunkel. Füg unten Optiken hinzu, um Traffic zu transportieren.",
|
||||
"link_panels.this_is_the_only_link_between":"Das ist der einzige Link zwischen diesen Städten. Füg einen parallelen hinzu oder einen Pfad über eine andere Stadt.",
|
||||
"link_panels.tier_1_only_a_pni_and":"Tier 1: nur ein PNI, und nur, wenn du groß genug für den Tier-1-Club bist",
|
||||
|
|
@ -2220,13 +2257,15 @@
|
|||
"link_panels.upgrade_to_sys_price":"Upgrade auf {sys} <small>{price}</small>",
|
||||
"link_panels.via_a_capacity_broker":"über einen Kapazitätsmakler",
|
||||
"link_panels.virtual_circuit_name_km_km":"Virtuelle Verbindung · {name} · {km} km",
|
||||
"link_panels.what_happens_if_this_link_fails":"Was passiert, wenn dieser Link jetzt ausfällt?",
|
||||
"link_panels.what_s_on_this_link":"Was auf diesem Link läuft",
|
||||
"link_panels.will_peer_at_ix_request_a":"Würde am {ix} peeren: Session anfragen",
|
||||
"link_panels.with_current_demand_and_routing_this":"Mit der jetzigen Nachfrage und dem Routing kann dieser Link ausfallen, ohne dass zusätzlicher Traffic verloren geht.",
|
||||
"link_panels.you_can_pre_install_optics_now":"Du kannst schon jetzt Optiken vorinstallieren, damit er an dem Tag leuchtet, an dem er fertig ist.",
|
||||
"link_panels.your_joint_venture_holds_an":"Dein Joint Venture hat eine Betriebslizenz.",
|
||||
"link_panels.your_own_build":"dein eigener Bau",
|
||||
"link_panels.your_own_fabric_name":"Deine eigene Fabric · {name}",
|
||||
"link_panels.your_routers_pick_the_lowest_cost":"Deine Router wählen den Pfad mit den niedrigsten Kosten. Erhöhe die Metrik, um Traffic auf andere Pfade zu drücken. „Nur Backup“ hält ihn untätig, außer nichts anderes funktioniert. Gilt für jeden Link zwischen diesen beiden Städten.",
|
||||
"link_panels.your_routers_pick_the_lowest_cost_0160":"Deine Router wählen den Pfad mit den niedrigsten Kosten. Erhöhe die Metrik, um Traffic auf andere Pfade zu drücken. „Nur Backup“ hält ihn untätig, außer nichts anderes funktioniert. Mit „Eigene“ setzt du deinen eigenen Faktor oder deine eigenen Kosten. Gilt für jeden Link zwischen diesen beiden Städten.",
|
||||
"link_panels.your_traffic_crossing_the_border":"Dein Traffic über die Grenze",
|
||||
"link_panels.your_wave_was_sold_before_the":"Deine Wave wurde verkauft, bevor der Kabelbesitzer es neu ausgelegt hat, also läuft sie weiter.",
|
||||
"links.a_fab_fabric_unlocks_at_customer":"<b>Eine {fab}-Fabric wird ab Kundenlevel {lv} freigeschaltet.</b>",
|
||||
|
|
@ -2494,6 +2533,10 @@
|
|||
"notifications.n_min_ago":{"one":"vor {n} Min.","other":"vor {n} Min."},
|
||||
"notifications.nothing_in_the_last_10_minutes":"Nichts in den letzten 10 Minuten.",
|
||||
"notifications.show_all_n":"Alle {n} anzeigen",
|
||||
"optic_counts.apply_price":"Übernehmen · {price}",
|
||||
"optic_counts.count_for_model":"Anzahl der {model}-Kanäle",
|
||||
"optic_counts.only_n_channels_free":"Auf dieser Glasfaser sind nur {n} Kanäle frei.",
|
||||
"optic_counts.target_count":"Zielanzahl",
|
||||
"own_cable.a_and_b":"{a} und {b}",
|
||||
"own_cable.a_fishing_fleet_is_trawling_exactly":"Eine Fischereiflotte schleppt ihre Netze genau dort, wo du verlegen musst.",
|
||||
"own_cable.a_leased_wave_wave_on_this":"Eine gemietete {wave}-Wave auf dieser Route kostet {price}/Monat.",
|
||||
|
|
@ -2606,6 +2649,27 @@
|
|||
"peering_policy.tried_a_remote_peer_once_it":"Haben es einmal mit einem Remote-Peer versucht. Der hat während eines Produktlaunchs geflappt. Nie wieder.",
|
||||
"pitcairn.uk_grant_mo":"Zuschuss aus UK {mo}/Monat",
|
||||
"pitcairn.uk_grant_mo_once_islanders":"Zuschuss aus UK {mo}/Monat, sobald die Inselbewohner online sind",
|
||||
"pni_all.additional_per_month":"Zusätzliche Kosten pro Monat",
|
||||
"pni_all.all_at_port":"Mit allen Netzen peeren · {port}",
|
||||
"pni_all.delivery_and_traffic_charges":"Die Lieferzeiten hängen vom Netz ab. Wo verlangt, kommen trafficabhängige Peering-Gebühren dazu.",
|
||||
"pni_all.n_at_their_minimum_size":{"one":"{n} Bestellung geht auf den kleinsten PNI, den dieses Netz annimmt.","other":"{n} Bestellungen gehen auf den kleinsten PNI, den diese Netze annehmen."},
|
||||
"pni_all.n_blocked_connections":{"one":"{n} gesperrte Verbindung","other":"{n} gesperrte Verbindungen"},
|
||||
"pni_all.n_blocked_pops":{"one":"{n} gesperrter POP","other":"{n} gesperrte POPs"},
|
||||
"pni_all.n_existing_or_pending_unchanged":{"one":"{n} bestehender PNI oder offene Bestellung bleibt unverändert.","other":"{n} bestehende PNIs oder offene Bestellungen bleiben unverändert."},
|
||||
"pni_all.n_networks":{"one":"{n} Netz","other":"{n} Netze"},
|
||||
"pni_all.n_of_total_connections":"{n} / {total} Verbindungen",
|
||||
"pni_all.n_of_total_pops":"{n} / {total} gemeinsame POPs",
|
||||
"pni_all.n_orders_with_net":{"one":"{n} PNI-Bestellung bei {net} aufgegeben. Unverändert: {kept}; gesperrt: {blocked}.","other":"{n} PNI-Bestellungen bei {net} aufgegeben. Unverändert: {kept}; gesperrt: {blocked}."},
|
||||
"pni_all.new_and_upgrades":"Neu: {fresh} · Upgrades: {up}",
|
||||
"pni_all.no_shared_locations":"Keine gemeinsamen POPs verfügbar.",
|
||||
"pni_all.no_shared_pops":"Du hast keinen POP mit diesem Netz gemeinsam.",
|
||||
"pni_all.order_missing_and_upgrade_smaller":"Bestellt fehlende PNIs und rüstet kleinere an deinen gemeinsamen POPs auf. Größere PNIs und offene Bestellungen bleiben unverändert. Nicht verfügbare POPs werden übersprungen.",
|
||||
"pni_all.peer_all_networks":"Mit allen Netzen an allen POPs peeren",
|
||||
"pni_all.peer_at_port":"An allen POPs peeren · {port}",
|
||||
"pni_all.peer_on_all_pops":"An allen POPs peeren",
|
||||
"pni_all.pni_size":"PNI-Größe",
|
||||
"pni_all.setup_total":"Einrichtung gesamt",
|
||||
"pni_all.traffic_charges_apply":"Dazu kommen Traffic-Gebühren von {price} pro Gbps.",
|
||||
"pnis.a_new_region_is_coming_online":"Eine neue Region geht bald online. Sie geht seit 2019 bald online.",
|
||||
"pnis.about_n_days_to_go_nothing":"Noch etwa {n} Tage. Nichts zu tun außer warten oder nachhaken.",
|
||||
"pnis.augment_with_net_delivered_in_city":"<b>Erweiterung mit {net} in {city} geliefert.</b><br>Jetzt {port}.",
|
||||
|
|
@ -3231,4 +3295,29 @@
|
|||
"tutorial.your_customers_want_the_whole":"Deine Kunden wollen das ganze Internet. Öffne den Tab Transit und kauf einen Port bei einem Carrier.",
|
||||
"tutorial.your_router_is_live_press_launch":"Dein Router ist live. Drück auf „Breitband starten“, um den Leuten in deiner Stadt Internet zu verkaufen.",
|
||||
"ui.n_d_left":"noch {n} T.",
|
||||
"utilities.apply_kit":"Redundanz-Kit anwenden",
|
||||
"utilities.cache_moves":"Zu verschiebende Cache-Boxen: {n} (je Anbieter ausgeglichen)",
|
||||
"utilities.cache_note":"Fordert an jedem bestehenden Standort einen Cache pro berechtigtem Anbieter an. Vorhandene Boxen bleiben; die Anbieter verlangen weiterhin genug Traffic.",
|
||||
"utilities.cache_ports":"Braucht {need} freie Router-Ports; {free} verfügbar. Angefordert wird erst, wenn alles zusammen passt.",
|
||||
"utilities.cache_quote":"{n} neue Cache-Boxen · Hardware gratis · Zusätzliche Kosten pro Monat: {mo}",
|
||||
"utilities.caches_requested":"{n} Cache-Boxen in {city} installiert.",
|
||||
"utilities.ix_peering":"IX-Peering im ganzen Netz",
|
||||
"utilities.join_route_servers":"Allen Route Servern beitreten ({n})",
|
||||
"utilities.kit_applied":"Redundanz in {city} aktualisiert.",
|
||||
"utilities.kit_balanced":"Hardware installiert und Caches ausgeglichen.",
|
||||
"utilities.kit_cost":"Einmalig: {cost} · Zusätzliche Kosten pro Monat: {mo}",
|
||||
"utilities.peer_counts":"{ready} möglich · {existing} bestehend · {blocked} nicht verfügbar",
|
||||
"utilities.peering_note":"Fordert an jedem IX, an dem du bist, alle möglichen Peers an. Bestehende Sessions, auch über Route Server, werden übersprungen. Absagen und Traffic-Schwellen gelten weiter. Es werden keine Ports oder bezahlten PNIs gekauft.",
|
||||
"utilities.peers_requested":"{n} neue IX-Peering-Sessions aufgebaut.",
|
||||
"utilities.quote_changed":"Das Angebot hat sich geändert. Prüf den neuen Preis und versuch es noch mal.",
|
||||
"utilities.redundancy_kit":"Redundanz-Kit für den POP",
|
||||
"utilities.redundancy_note":"Vorhandene Caches werden je Anbieter ausgeglichen. IX-, PNI- und Transit-Verbindungen verteilst du selbst auf die Standorte; prüf auch getrennte Links und freie Router-Kapazität.",
|
||||
"utilities.request_all":"Alle möglichen Peers anfragen ({n})",
|
||||
"utilities.request_caches":"Fehlende Caches anfordern ({n})",
|
||||
"utilities.route_server_note":"Peers über Route Server brauchen eine offene Peering-Policy. Bestehende Sessions bleiben aktiv; es werden keine Ports gekauft.",
|
||||
"utilities.route_servers_joined":"{n} Route Servern beigetreten.",
|
||||
"utilities.second_site":"Zweiter Standort",
|
||||
"utilities.title":"Werkzeuge",
|
||||
"utilities.two_routers":"Mindestens zwei Router",
|
||||
"utilities.view_pop":"POP ansehen",
|
||||
};
|
||||
|
|
|
|||
109
site/i18n/es.js
109
site/i18n/es.js
|
|
@ -12,6 +12,11 @@
|
|||
"action_helpers.too_far_even_at_its_slowest":"Demasiado lejos incluso en su ajuste más lento: aquí un tramo óptico mide {span} km y el alcance es de {max} km. Añade un sitio regenerador (Sistema de línea).",
|
||||
"action_helpers.unlocks_at_customer_level_n":"Se desbloquea en el nivel de cliente {n}.",
|
||||
"actions.your_router_can_t_take_a":"<b>Tu router no admite un puerto de {port}.</b><br>Mejóralo en la pestaña Infra.",
|
||||
"automation.auto_accept_sales":"Ventas automáticas: {state}",
|
||||
"automation.auto_pay_repairs":"Reparaciones pagadas auto: {state}",
|
||||
"automation.next_auto_check":"Tiempo hasta la próxima comprobación automática de requisitos.",
|
||||
"automation.repairs_when_affordable":"Mientras juegas, paga automáticamente las reparaciones urgentes disponibles si hay fondos suficientes.",
|
||||
"automation.sales_every_five_seconds":"Cada 5 segundos mientras juegas, acepta solo ofertas cuyos requisitos se cumplan y tengan capacidad de servicio disponible.",
|
||||
"badges.a_petabit_a_second":"Un petabit por segundo",
|
||||
"badges.a_secret_badge":"Una insignia secreta",
|
||||
"badges.attend_a_conference":"Asiste a una conferencia.",
|
||||
|
|
@ -697,6 +702,7 @@
|
|||
"city_panel.every_port_is_taken_add_a":"Todos los puertos están ocupados. Añade un router o cambia a un modelo con más puertos antes de conectar nada nuevo.",
|
||||
"city_panel.everything_is_in_one_building_move":"Todo está en un solo edificio. Mueve algunos uplinks a la otra sede desde las pestañas Tránsito y Peering.",
|
||||
"city_panel.fabrics_list":"Fabrics: {list}",
|
||||
"city_panel.few_data_centers_pops_x":"Pocos centros de datos: POPs {x}×",
|
||||
"city_panel.fiber_from_city":"Fibra desde {city}",
|
||||
"city_panel.fiber_is_down":"la fibra está caída",
|
||||
"city_panel.g_of_circuits":"{g} de circuitos",
|
||||
|
|
@ -783,6 +789,7 @@
|
|||
"common.95th_percentile":"Percentil 95",
|
||||
"common.about_average":"más o menos la media",
|
||||
"common.accept":"Aceptar",
|
||||
"common.ack_flood":"Inundación ACK",
|
||||
"common.ad_campaign":"¡Campaña publicitaria!",
|
||||
"common.africa":"África",
|
||||
"common.all_cities":"Todas las ciudades",
|
||||
|
|
@ -849,6 +856,7 @@
|
|||
"common.challenger":"aspirante",
|
||||
"common.change_freeze":"Congelación de cambios",
|
||||
"common.chase_it":"Perseguirlo",
|
||||
"common.check_redundancy":"Comprobar redundancia",
|
||||
"common.china":"China",
|
||||
"common.city":"ciudad",
|
||||
"common.city_906b":"Ciudad",
|
||||
|
|
@ -873,10 +881,12 @@
|
|||
"common.controller_off":"controlador apagado",
|
||||
"common.cooling_failure":"Fallo de refrigeración",
|
||||
"common.copy":"Copiar",
|
||||
"common.cost":"Coste",
|
||||
"common.costs":"Costes",
|
||||
"common.courtesy_route":"Ruta de cortesía",
|
||||
"common.crashes_more":"se cae más",
|
||||
"common.credit_rating":"Calificación crediticia",
|
||||
"common.custom":"Propia",
|
||||
"common.customer":"Cliente",
|
||||
"common.customer_care":"Atención al cliente",
|
||||
"common.customer_levels":"Niveles de cliente",
|
||||
|
|
@ -903,6 +913,7 @@
|
|||
"common.demand":"Demanda",
|
||||
"common.deploy":"Desplegar",
|
||||
"common.deployed":"desplegado",
|
||||
"common.distributed_ingress":"Entrada distribuida",
|
||||
"common.diverse":"diversa",
|
||||
"common.diverse_route":"ruta diversa",
|
||||
"common.dns_reflection":"Reflexión DNS",
|
||||
|
|
@ -1060,6 +1071,7 @@
|
|||
"common.may":"May",
|
||||
"common.member":"− miembro",
|
||||
"common.member_fef5":"Miembro",
|
||||
"common.memcached_amplification":"Amplificación Memcached",
|
||||
"common.merchant_silicon":"silicio comercial",
|
||||
"common.mercury":"Mercurio",
|
||||
"common.metaverse_platform":"Plataforma de metaverso",
|
||||
|
|
@ -1072,6 +1084,7 @@
|
|||
"common.more_scenarios":"Más escenarios",
|
||||
"common.ms_ms_one_way":"{ms} ms en un sentido",
|
||||
"common.mtu_mismatch":"Desajuste de MTU",
|
||||
"common.multiplier":"Multiplicador",
|
||||
"common.mystery_link":"Enlace misterioso",
|
||||
"common.n_box":{"one":"{n} caja","other":"{n} cajas"},
|
||||
"common.n_days_left":"Quedan {n} días",
|
||||
|
|
@ -1161,6 +1174,7 @@
|
|||
"common.price_lock":"Precio fijo",
|
||||
"common.price_mo":"{price}/mes",
|
||||
"common.provisioning_n_d_grace":"aprovisionando, {n} d de gracia",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rango",
|
||||
"common.rare":"Raro",
|
||||
"common.reach":"Alcance",
|
||||
|
|
@ -1170,6 +1184,7 @@
|
|||
"common.really_leave":"¿Salir de verdad?",
|
||||
"common.really_remove":"¿Quitar de verdad?",
|
||||
"common.redundancy":"Redundancia",
|
||||
"common.redundancy_check":"Prueba de redundancia",
|
||||
"common.regen_site":"− Sitio regenerador",
|
||||
"common.regen_sites":"Sitios regeneradores",
|
||||
"common.regional_player":"Jugador regional",
|
||||
|
|
@ -1227,6 +1242,8 @@
|
|||
"common.sep":"Sep",
|
||||
"common.serious_backbone":"Backbone serio",
|
||||
"common.serve_as_much_traffic_as_you":"Sirve todo el tráfico que puedas en un año.",
|
||||
"common.service_affected":"Servicio afectado",
|
||||
"common.set":"Aplicar",
|
||||
"common.settings":"Ajustes",
|
||||
"common.share":"Compartir",
|
||||
"common.share_2cd9":"Compartir…",
|
||||
|
|
@ -1272,6 +1289,7 @@
|
|||
"common.subsea_cables":"Cables submarinos",
|
||||
"common.supply_chain":"Cadena de suministro",
|
||||
"common.syn_flood":"Inundación SYN",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestre",
|
||||
"common.terrestrial_19e4":"Terrestre",
|
||||
"common.terrestrial_fiber":"Fibra terrestre",
|
||||
|
|
@ -1403,6 +1421,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Primero necesitas un POP en cada ciudad del contrato.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} extra durante {d} días, {when} · paga {fee} al terminar",
|
||||
"customers_and_events.day_n_of_d":"día {n} de {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"El gaming atrae ataques",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} pares de fibra en tu zanja {a}–{b}. La zanja era lo caro, así que quieren todo",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sedes: {list} · {bw} por sede · {price}/mes",
|
||||
"customers_and_events.name_at_site":"{name} en {site}",
|
||||
|
|
@ -1619,6 +1638,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Un arrastrero frente a Ostende arrastró sus aparejos directo por tu cable {a}–{b}. El Mar del Norte tiene unos treinta metros de profundidad y está lleno de barcos.",
|
||||
"failures.a_visiting_engineer_from_london":"Un ingeniero visitante de Londres llevó Marmite al NOC de {city}. Se rompieron las relaciones diplomáticas, y tu router también mientras todos discutían.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Un barco de servicio de un parque eólico echó el ancla sobre tu cable {a}–{b}. Estaba allí para arreglar una turbina.",
|
||||
"failures.across_n_transit_and_peering_ports":", por {n} puertos de tránsito y peering",
|
||||
"failures.all_n_links_in_that_trench":"Los {n} enlaces de esa zanja cayeron con ella.",
|
||||
"failures.an_automation_script_in_city_ran":"Un script de automatización en {city} ejecutó «sed» sobre toda la configuración en lugar de una línea. Ahora todas las interfaces se llaman «TODO».",
|
||||
"failures.an_earthquake_shook_your_a_b":"Un terremoto soltó tu fibra {a}–{b} en algún punto por encima de los 4000 metros.",
|
||||
|
|
@ -1983,13 +2003,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Un segundo intercalar convenció a uno de tus routers de que es 1970. El uptime marca ahora menos 56 años. El tráfico va bien.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Una ruta que retiraste en el Año 1 sigue visible en algún lugar de internet. Nadie sabe dónde. Está bien. Probablemente.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Una reunión de dos horas sobre nombres de host de routers terminó con un voto por «router-final-v2-NUEVO».",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Tras la depuración upstream: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Un auditor pidió un diagrama de red. Enviaste el mapa del juego. Lo aprobaron.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Ataque mitigado por completo",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Hacer blackhole al objetivo (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Blackhole hecho: la basura se fue, y {city} también. El ataque consiguió lo que quería.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contenido en tu PNI de sacrificio con {net}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec no puede atrapar un {vec} (capa de aplicación)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Flowspec en tu {model} está descartando {vec} en el borde",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Flowspec en tu {model} recorta {vec}, pero su TCAM es pequeña",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Filtros en el borde descartan: {g}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec no puede atrapar {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec descarta: {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec descarta: {g}; algunos routers de entrada no tienen TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} se cuelan igualmente",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"Era el DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"Blackhole en IX <small>~la mitad lo respeta</small>",
|
||||
|
|
@ -2000,29 +2024,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Errata de la que depende todo",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"La dirección declaró una congelación de cambios. Alguien hizo un cambio para anunciar la congelación de cambios.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"LAG de tránsito de {name} en {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} lo está depurando aguas arriba (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Sin filtrado Flowspec: los routers de entrada no tienen TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Sin centro de depuración",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"No hace falta depurar tras la mitigación en el borde",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"Depuración bajo demanda desviando, activa en {n} d",
|
||||
"incidents_and_ddos.open_to_work":"Abierto a ofertas",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"LAG de PNI con {name} en {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Llegando a tu red: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"El RTBH es gratis e instantáneo, pero descarta todo hacia la víctima, ataque y cliente por igual. Un blackhole en IX mantiene al cliente en pie, pero solo la mitad de los miembros lo respeta. HackBack 3000™ de Skynot AI a veces lo termina, y a veces arrasa a un inocente y te gana una multa.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Centros de depuración no disponibles o llenos",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Depuración en {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Tráfico de depuración por tu backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · quedan {n} d",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Alguien borró el registro DNS de la wiki interna. El runbook para arreglar el DNS estaba en la wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Alguien llamó a una VLAN «prodcution». Ahora todo depende de él y nunca se podrá renombrar.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"El certificado TLS de tu panel del NOC caducó. Nadie ve ninguna gráfica, así que técnicamente no hay problemas.",
|
||||
"incidents_and_ddos.this_attack_g":"Este ataque: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket de la semana",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"La depuración {tier} en {city} lo está limpiando, transportado por tu backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"La depuración {tier} en {city} lo está limpiando",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"El soporte del fabricante te pidió «probar a apagarlo y encenderlo». Para el router que ya reiniciaste. Ticket cerrado.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Encontraste en el inventario un enlace de 10G que nadie pidió, nadie paga y que lleva 3 Gbps de algo.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Tu backbone solo puede llevar {g} de eso a {city}: el resto no se depura",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Tu hoja de cálculo de direcciones IP llegó a 1 048 576 filas. Excel tiene opiniones.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Tu tráfico IPv6 creció un 400 %. De un paquete a cinco.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Tu {model} aquí no tiene TCAM de Flowspec",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Tu sistema de monitorización se cayó. Te enteraste porque nada alertó. Semana muy tranquila.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Tu coordinador de peering cambió su perfil a «abierto a ofertas». Tres Tier 1 de pronto quieren charlar. No pasó nada, pero sentó bien.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Tus centros de depuración están llenos: {g} se cuelan",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"La línea de soporte de tu upstream reproduce los mismos 11 segundos de música de espera. Tu ingeniero de guardia ya puede tararearla en cuatro tonos.",
|
||||
"install.before_you_start":"Antes de empezar",
|
||||
"install.best_played_as_an_app":"Mejor jugado como app",
|
||||
|
|
@ -2104,9 +2128,12 @@
|
|||
"link_modal.you_already_have_n_link_here":{"one":"Ya tienes {n} enlace aquí ({list}). Los enlaces paralelos suman capacidad. ¿Cómo debe enrutarse este?","other":"Ya tienes {n} enlaces aquí ({list}). Los enlaces paralelos suman capacidad. ¿Cómo debe enrutarse este?"},
|
||||
"link_panels.a_bigger_fabric_carries_more_traffic":"Una fabric mayor transporta más tráfico y tiene sitio para más miembros. Tu router de aquí aún tiene que aguantar el ritmo.",
|
||||
"link_panels.a_link_on_standby_carries_traffic":"Un enlace en espera solo lleva tráfico cuando los demás enlaces entre estas ciudades están llenos o caídos.",
|
||||
"link_panels.a_link_s_cost_is_its":"El coste de un enlace es su longitud en km más 60, por un multiplicador. El tráfico toma la ruta con el menor coste total.",
|
||||
"link_panels.a_regen_site_turns_the_light":"Un sitio regenerador convierte la luz de nuevo en bits a mitad de camino y la envía renovada, así que las ópticas solo tienen que llegar al siguiente sitio. Cada uno necesita una tarjeta regeneradora por cada canal iluminado. {price}/mes por sitio por la caseta.",
|
||||
"link_panels.abandon_the_fiber":"Abandonar la fibra",
|
||||
"link_panels.add_parallel_link":"Añadir enlace paralelo",
|
||||
"link_panels.additional_traffic_lost":"Tráfico perdido adicional",
|
||||
"link_panels.an_alternate_path_exists_but_current":"Hay un camino alternativo, pero con el routing y la capacidad actuales llega menos tráfico.",
|
||||
"link_panels.apply_for_a_license_price_mo":"Solicitar una licencia <small>{price} + {mo}/mes · ~45 días</small>",
|
||||
"link_panels.back_in_n_days":"De vuelta en {n} días.",
|
||||
"link_panels.behind_the_great_firewall":"Tras el Gran Cortafuegos",
|
||||
|
|
@ -2117,6 +2144,9 @@
|
|||
"link_panels.click_to_tear_down":"Haz clic para desmontar",
|
||||
"link_panels.collecting_data_check_back_in_a":"Recopilando datos. Vuelve en unos días.",
|
||||
"link_panels.congested_upgrade_it_or_add_a":"Congestionado. Mejóralo o añade una ruta paralela.",
|
||||
"link_panels.connected_but_tight":"Conectado, pero justo.",
|
||||
"link_panels.cost_on_this_link_w_allowed":"Coste en este enlace: {w}. Permitido: de {lo} a {hi}.",
|
||||
"link_panels.cost_the_exact_number_whatever_the":"Coste: el número exacto, sea cual sea la distancia.",
|
||||
"link_panels.dark_fiber_kind_km_km":"Fibra oscura · {kind} · {km} km",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of":"Precio personalizado de DE-KICKS: {p} % de lo que cobraría un IX normal (promo, quedan {n} días).",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of_3d4f":"Precio personalizado de DE-KICKS: {p} % de lo que cobraría un IX normal.",
|
||||
|
|
@ -2125,6 +2155,7 @@
|
|||
"link_panels.finish_in_1_day_price":"Terminar en 1 día <small>{price}</small>",
|
||||
"link_panels.foreign_networks_need_a_local_joint":"Las redes extranjeras necesitan una empresa conjunta local y una licencia de operación para construir infraestructura aquí.",
|
||||
"link_panels.found_your_own_ix_cost_mo":"Funda tu propio IX <small>{cost} + {mo}/mes</small>",
|
||||
"link_panels.full_links_during_the_test":"Enlaces llenos durante la prueba",
|
||||
"link_panels.g_to_km_km":"{g} hasta {km} km",
|
||||
"link_panels.giving_it_up_now_returns_price":"Renunciar ahora devuelve {price}.",
|
||||
"link_panels.going_to_customers_in":"Va a clientes en",
|
||||
|
|
@ -2139,6 +2170,7 @@
|
|||
"link_panels.lost_on_the_way":"Perdido por el camino",
|
||||
"link_panels.mainland_china_plays_by_its_own":"China continental juega con sus propias reglas. {list} y otros servicios extranjeros están bloqueados aquí, así que los usuarios llegan sobre todo a redes chinas. El tráfico que cruza la frontera pierde cerca del {pct} por filtrado y congestión, salvo que vaya por una ruta premium: tránsito CN-Too o un circuito transfronterizo premium (ambos solo se venden en Hong Kong), o un PNI con una red china. Los ingresos por usuario son menores aquí.",
|
||||
"link_panels.members_paying_you":"Miembros que te pagan",
|
||||
"link_panels.multiplier_scales_the_distance_cost":"Multiplicador: escala el coste de la distancia, así que un enlace más largo sigue costando más.",
|
||||
"link_panels.n_amp_huts":"{n} casetas de amplificación",
|
||||
"link_panels.n_amplifiers":"{n} amplificadores",
|
||||
"link_panels.n_exchanges_compete_in_city_members":"{n} intercambios compiten en {city}. Los miembros se solapan, pero no del todo, y los aspirantes bajan precios al establecido. Las redes pequeñas suelen estar solo en uno.",
|
||||
|
|
@ -2157,6 +2189,7 @@
|
|||
"link_panels.needs_a_pop_in_cities_too":"Necesita también un POP en {cities}.",
|
||||
"link_panels.needs_what":"necesita {what}",
|
||||
"link_panels.needs_your_own_scrubbing_center":"Necesita tu propio centro de depuración (pestaña Infra).",
|
||||
"link_panels.no_alternate_backbone_path_connects":"Si este enlace cae, ningún camino alternativo del backbone une estos extremos.",
|
||||
"link_panels.no_regen_sites_in_the_middle":"No hay sitios regeneradores en medio del océano: los cables largos usan sus ópticas en modo de larga distancia.",
|
||||
"link_panels.no_traffic_right_now":"Ahora no hay tráfico.",
|
||||
"link_panels.not_in_your_cities_yet_nearest":"Aún no está en tus ciudades. Más cercana: {city}",
|
||||
|
|
@ -2166,6 +2199,7 @@
|
|||
"link_panels.on_standby_but_carrying_the_traffic":"En espera, pero lleva el tráfico: ningún enlace activo entre estas ciudades funciona.",
|
||||
"link_panels.on_standby_idle_while_the_other":"En espera: inactivo mientras los demás enlaces entre estas ciudades tengan sitio.",
|
||||
"link_panels.on_standby_taking_the_overflow":"En espera: lleva el desbordamiento, porque los demás enlaces entre estas ciudades están llenos.",
|
||||
"link_panels.one_backhoe_is_not_enough":"Una retroexcavadora no basta.",
|
||||
"link_panels.open_peer_but_not_on_any":"Open peer, pero no en ningún IX donde tengas POP. Más cercano: {city}",
|
||||
"link_panels.open_peer_but_not_on_any_bfbb":"Open peer, pero no en ningún IX donde tengas POP",
|
||||
"link_panels.open_peer_join_the_route_server":"Open peer: únete al route server de {ix}",
|
||||
|
|
@ -2182,6 +2216,7 @@
|
|||
"link_panels.port_port_price_on_request":"Puerto {port} <small>Precio a consultar ☎</small>",
|
||||
"link_panels.ports_at_p_of_the_usual":"Puertos al {p} % del precio habitual.",
|
||||
"link_panels.ports_up_to_port_are_free":"Los puertos hasta {port} son gratis.",
|
||||
"link_panels.presets_on_this_link_list":"Valores predefinidos en este enlace: {list}.",
|
||||
"link_panels.price_n_days":"{price} · {n} días",
|
||||
"link_panels.put_this_link_on_standby":"Poner este enlace en espera",
|
||||
"link_panels.ready_for_a_pni_in_city":"Listo para un PNI en {city}",
|
||||
|
|
@ -2200,6 +2235,7 @@
|
|||
"link_panels.sell_one_price":"Vender uno <small>{price}</small>",
|
||||
"link_panels.selling_spare_capacity":"Vendiendo capacidad sobrante",
|
||||
"link_panels.shares_a_trench_with_n_other":{"one":"Comparte zanja con {n} enlace más. Un corte los tumba a todos.","other":"Comparte zanja con {n} enlaces más. Un corte los tumba a todos."},
|
||||
"link_panels.snapshot_only_one_selected_link":"Solo una instantánea: cae únicamente el enlace elegido. Los demás enlaces del mismo cable, zanja o fabric siguen arriba. Las averías y reglas de routing actuales se siguen aplicando. No cambian ni el tiempo, ni el dinero, ni la partida.",
|
||||
"link_panels.spare_optics_and_amplifier_cards_on":"Ópticas y tarjetas de amplificador de repuesto en el estante convierten averías de hardware de varios días en cambios de un día.",
|
||||
"link_panels.spare_price":"repuesto + {price}",
|
||||
"link_panels.spares_bought_now_are_already_paid":"Los repuestos comprados ahora ya están pagados cuando llegue la próxima escasez.",
|
||||
|
|
@ -2209,6 +2245,7 @@
|
|||
"link_panels.take_it_off_standby":"Sacarlo de la espera",
|
||||
"link_panels.there_s_no_ix_in_city":"Aún no hay IX en {city}. Funda uno: las redes se unen con el tiempo, te pagan por los puertos y hacen peering contigo gratis.",
|
||||
"link_panels.they_need_the_full_internet_your":"Necesitan todo internet. Tu alcance es del {pct}.",
|
||||
"link_panels.this_backhoe_wins":"Esta retroexcavadora gana.",
|
||||
"link_panels.this_fiber_is_dark_add_optics":"Esta fibra está a oscuras. Añade ópticas abajo para transportar tráfico.",
|
||||
"link_panels.this_is_the_only_link_between":"Este es el único enlace entre estas ciudades. Añade uno paralelo, o una ruta por otra ciudad.",
|
||||
"link_panels.tier_1_only_a_pni_and":"Tier 1: solo un PNI, y solo cuando seas lo bastante grande para el club de los Tier 1",
|
||||
|
|
@ -2218,13 +2255,15 @@
|
|||
"link_panels.upgrade_to_sys_price":"Mejorar a {sys} <small>{price}</small>",
|
||||
"link_panels.via_a_capacity_broker":"vía un corredor de capacidad",
|
||||
"link_panels.virtual_circuit_name_km_km":"Circuito virtual · {name} · {km} km",
|
||||
"link_panels.what_happens_if_this_link_fails":"¿Qué pasa si este enlace cae ahora mismo?",
|
||||
"link_panels.what_s_on_this_link":"Qué hay en este enlace",
|
||||
"link_panels.will_peer_at_ix_request_a":"Hará peering en {ix}: solicita una sesión",
|
||||
"link_panels.with_current_demand_and_routing_this":"Con la demanda y el routing actuales, este enlace puede caer sin perder más tráfico.",
|
||||
"link_panels.you_can_pre_install_optics_now":"Puedes preinstalar ópticas ahora para que se ilumine el día que esté listo.",
|
||||
"link_panels.your_joint_venture_holds_an":"Tu empresa conjunta tiene una licencia de operación.",
|
||||
"link_panels.your_own_build":"construcción propia",
|
||||
"link_panels.your_own_fabric_name":"Tu propia fabric · {name}",
|
||||
"link_panels.your_routers_pick_the_lowest_cost":"Tus routers eligen la ruta de menor coste. Sube la métrica para empujar el tráfico a otras rutas. «Solo respaldo» lo deja inactivo salvo que nada más funcione. Se aplica a todos los enlaces entre estas dos ciudades.",
|
||||
"link_panels.your_routers_pick_the_lowest_cost_0160":"Tus routers eligen la ruta de menor coste. Sube la métrica para empujar el tráfico a otras rutas. «Solo respaldo» lo deja inactivo salvo que nada más funcione. Elige Propia para fijar tu propio multiplicador o coste. Se aplica a todos los enlaces entre estas dos ciudades.",
|
||||
"link_panels.your_traffic_crossing_the_border":"Tu tráfico que cruza la frontera",
|
||||
"link_panels.your_wave_was_sold_before_the":"Tu onda se vendió antes de que el dueño del cable la rediseñara, así que sigue funcionando.",
|
||||
"links.a_fab_fabric_unlocks_at_customer":"<b>Una fabric {fab} se desbloquea en el nivel de cliente {lv}.</b>",
|
||||
|
|
@ -2492,6 +2531,10 @@
|
|||
"notifications.n_min_ago":{"one":"hace {n} min","other":"hace {n} min"},
|
||||
"notifications.nothing_in_the_last_10_minutes":"Nada en los últimos 10 minutos.",
|
||||
"notifications.show_all_n":"Mostrar las {n}",
|
||||
"optic_counts.apply_price":"Aplicar · {price}",
|
||||
"optic_counts.count_for_model":"Número de canales {model}",
|
||||
"optic_counts.only_n_channels_free":"Solo quedan {n} canales libres en esta fibra.",
|
||||
"optic_counts.target_count":"Cantidad deseada",
|
||||
"own_cable.a_and_b":"{a} y {b}",
|
||||
"own_cable.a_fishing_fleet_is_trawling_exactly":"Una flota pesquera está faenando justo donde necesitas tender.",
|
||||
"own_cable.a_leased_wave_wave_on_this":"Una onda {wave} alquilada en esta ruta cuesta {price}/mes.",
|
||||
|
|
@ -2604,6 +2647,27 @@
|
|||
"peering_policy.tried_a_remote_peer_once_it":"Probaron un peer remoto una vez. Osciló durante un lanzamiento de producto. Nunca más.",
|
||||
"pitcairn.uk_grant_mo":"Subvención británica {mo}/mes",
|
||||
"pitcairn.uk_grant_mo_once_islanders":"Subvención británica {mo}/mes cuando los isleños estén en línea",
|
||||
"pni_all.additional_per_month":"Coste mensual adicional",
|
||||
"pni_all.all_at_port":"Peering con todas las redes · {port}",
|
||||
"pni_all.delivery_and_traffic_charges":"Los plazos de entrega varían según la red. También se aplican cargos de peering basados en el tráfico cuando corresponda.",
|
||||
"pni_all.n_at_their_minimum_size":{"one":"{n} pedido sube al PNI más pequeño que acepta esa red.","other":"{n} pedidos suben al PNI más pequeño que aceptan esas redes."},
|
||||
"pni_all.n_blocked_connections":{"one":"{n} conexión no disponible","other":"{n} conexiones no disponibles"},
|
||||
"pni_all.n_blocked_pops":{"one":"{n} POP no disponible","other":"{n} POP no disponibles"},
|
||||
"pni_all.n_existing_or_pending_unchanged":{"one":"{n} PNI existente o pedido pendiente se mantiene sin cambios.","other":"{n} PNI existentes o pedidos pendientes se mantienen sin cambios."},
|
||||
"pni_all.n_networks":{"one":"{n} red","other":"{n} redes"},
|
||||
"pni_all.n_of_total_connections":"{n} / {total} conexiones",
|
||||
"pni_all.n_of_total_pops":"{n} / {total} POP en común",
|
||||
"pni_all.n_orders_with_net":{"one":"{n} pedido de PNI realizado con {net}. Sin cambios: {kept}; no disponibles: {blocked}.","other":"{n} pedidos de PNI realizados con {net}. Sin cambios: {kept}; no disponibles: {blocked}."},
|
||||
"pni_all.new_and_upgrades":"Nuevos: {fresh} · Ampliaciones: {up}",
|
||||
"pni_all.no_shared_locations":"No hay POP en común disponibles.",
|
||||
"pni_all.no_shared_pops":"No tienes POP en común con esta red.",
|
||||
"pni_all.order_missing_and_upgrade_smaller":"Pide los PNI que faltan y amplía los más pequeños en los POP en común. Los PNI mayores y los pedidos pendientes se mantienen sin cambios. Se omiten los POP no disponibles.",
|
||||
"pni_all.peer_all_networks":"Peering con todas las redes en todos los POP",
|
||||
"pni_all.peer_at_port":"Peering en todos los POP · {port}",
|
||||
"pni_all.peer_on_all_pops":"Peering en todos los POP",
|
||||
"pni_all.pni_size":"Capacidad del PNI",
|
||||
"pni_all.setup_total":"Coste total de instalación",
|
||||
"pni_all.traffic_charges_apply":"También se aplican cargos de tráfico de {price} por Gbps.",
|
||||
"pnis.a_new_region_is_coming_online":"Pronto se pondrá en marcha una región nueva. Lleva poniéndose en marcha pronto desde 2019.",
|
||||
"pnis.about_n_days_to_go_nothing":"Faltan unos {n} días. No queda más que esperar, o perseguirlo.",
|
||||
"pnis.augment_with_net_delivered_in_city":"<b>Ampliación con {net} entregada en {city}.</b><br>Ahora {port}.",
|
||||
|
|
@ -3229,4 +3293,29 @@
|
|||
"tutorial.your_customers_want_the_whole":"Tus clientes quieren todo internet. Abre la pestaña Tránsito y compra un puerto a un operador.",
|
||||
"tutorial.your_router_is_live_press_launch":"Tu router está activo. Pulsa «Lanzar banda ancha» para vender internet a la gente de tu ciudad.",
|
||||
"ui.n_d_left":"quedan {n} d",
|
||||
"utilities.apply_kit":"Aplicar kit de redundancia",
|
||||
"utilities.cache_moves":"Cachés que mover: {n} (equilibradas por proveedor)",
|
||||
"utilities.cache_note":"Solicita una caché por proveedor elegible en cada ubicación existente. Se conservan las cachés actuales; los proveedores siguen exigiendo tráfico suficiente.",
|
||||
"utilities.cache_ports":"Se necesitan {need} puertos libres de router; disponibles: {free}. No se solicita nada hasta que haya espacio para todas.",
|
||||
"utilities.cache_quote":"{n} cachés nuevas · Hardware gratuito · Coste mensual adicional: {mo}",
|
||||
"utilities.caches_requested":"Se han instalado {n} cachés en {city}.",
|
||||
"utilities.ix_peering":"Peering IX en toda la red",
|
||||
"utilities.join_route_servers":"Unirse a todos los route servers ({n})",
|
||||
"utilities.kit_applied":"Redundancia actualizada en {city}.",
|
||||
"utilities.kit_balanced":"Hardware instalado y cachés equilibradas.",
|
||||
"utilities.kit_cost":"Pago único: {cost} · Coste mensual adicional: {mo}",
|
||||
"utilities.peer_counts":"{ready} elegibles · {existing} existentes · {blocked} no disponibles",
|
||||
"utilities.peering_note":"Solicita peers elegibles en cada IX al que te hayas unido. Se omiten las sesiones existentes, incluidos los peers del route server. Los rechazos y umbrales de tráfico siguen vigentes. No se compran puertos ni PNI de pago.",
|
||||
"utilities.peers_requested":"Se han establecido {n} nuevas sesiones de peering IX.",
|
||||
"utilities.quote_changed":"El presupuesto ha cambiado. Revisa el nuevo precio e inténtalo de nuevo.",
|
||||
"utilities.redundancy_kit":"Kit de redundancia del POP",
|
||||
"utilities.redundancy_note":"Las cachés existentes se equilibran por proveedor. Reparte por separado las conexiones IX, PNI y transit entre ubicaciones y comprueba enlaces diversos y capacidad de reserva de los routers.",
|
||||
"utilities.request_all":"Solicitar todos los peers elegibles ({n})",
|
||||
"utilities.request_caches":"Solicitar las cachés que faltan ({n})",
|
||||
"utilities.route_server_note":"Los peers de los route servers requieren una política de peering abierta. Las sesiones existentes siguen activas; no se compran puertos.",
|
||||
"utilities.route_servers_joined":"Te has unido a {n} route servers.",
|
||||
"utilities.second_site":"Segunda ubicación",
|
||||
"utilities.title":"Utilidades",
|
||||
"utilities.two_routers":"Al menos dos routers",
|
||||
"utilities.view_pop":"Ver POP",
|
||||
};
|
||||
|
|
|
|||
109
site/i18n/fr.js
109
site/i18n/fr.js
|
|
@ -12,6 +12,11 @@
|
|||
"action_helpers.too_far_even_at_its_slowest":"Trop loin, même au débit le plus lent : ici une portée optique fait {span} km et l’optique va jusqu’à {max} km. Ajoute un site de régénération (Système de ligne).",
|
||||
"action_helpers.unlocks_at_customer_level_n":"Se débloque au niveau client {n}.",
|
||||
"actions.your_router_can_t_take_a":"<b>Ton routeur ne supporte pas de port {port}.</b><br>Mets-le à niveau dans l’onglet Infra.",
|
||||
"automation.auto_accept_sales":"Ventes automatiques : {state}",
|
||||
"automation.auto_pay_repairs":"Réparations payées auto : {state}",
|
||||
"automation.next_auto_check":"Temps avant la prochaine vérification automatique des conditions.",
|
||||
"automation.repairs_when_affordable":"Pendant le jeu, paie automatiquement les réparations urgentes disponibles si les fonds suffisent.",
|
||||
"automation.sales_every_five_seconds":"Toutes les 5 secondes pendant le jeu, accepte uniquement les offres dont les conditions sont remplies et la capacité de service disponible.",
|
||||
"badges.a_petabit_a_second":"Un pétabit par seconde",
|
||||
"badges.a_secret_badge":"Un badge secret",
|
||||
"badges.attend_a_conference":"Participe à une conférence.",
|
||||
|
|
@ -697,6 +702,7 @@
|
|||
"city_panel.every_port_is_taken_add_a":"Tous les ports sont pris. Ajoute un routeur ou passe à un modèle avec plus de ports avant de brancher quoi que ce soit.",
|
||||
"city_panel.everything_is_in_one_building_move":"Tout est dans un seul bâtiment. Déplace des uplinks vers l’autre site depuis les onglets Transit et Peering.",
|
||||
"city_panel.fabrics_list":"Fabrics : {list}",
|
||||
"city_panel.few_data_centers_pops_x":"Peu de data centers : POP {x}×",
|
||||
"city_panel.fiber_from_city":"Fibre depuis {city}",
|
||||
"city_panel.fiber_is_down":"fibre en panne",
|
||||
"city_panel.g_of_circuits":"{g} de circuits",
|
||||
|
|
@ -783,6 +789,7 @@
|
|||
"common.95th_percentile":"95e percentile",
|
||||
"common.about_average":"dans la moyenne",
|
||||
"common.accept":"Accepter",
|
||||
"common.ack_flood":"Flood ACK",
|
||||
"common.ad_campaign":"Campagne de pub !",
|
||||
"common.africa":"Afrique",
|
||||
"common.all_cities":"Toutes les villes",
|
||||
|
|
@ -849,6 +856,7 @@
|
|||
"common.challenger":"challenger",
|
||||
"common.change_freeze":"Gel des changements",
|
||||
"common.chase_it":"Relancer",
|
||||
"common.check_redundancy":"Vérifier la redondance",
|
||||
"common.china":"Chine",
|
||||
"common.city":"ville",
|
||||
"common.city_906b":"Ville",
|
||||
|
|
@ -873,10 +881,12 @@
|
|||
"common.controller_off":"contrôleur désactivé",
|
||||
"common.cooling_failure":"Panne de refroidissement",
|
||||
"common.copy":"Copier",
|
||||
"common.cost":"Coût",
|
||||
"common.costs":"Coûts",
|
||||
"common.courtesy_route":"Route de courtoisie",
|
||||
"common.crashes_more":"plante plus souvent",
|
||||
"common.credit_rating":"Note de crédit",
|
||||
"common.custom":"Perso",
|
||||
"common.customer":"Client",
|
||||
"common.customer_care":"Service client",
|
||||
"common.customer_levels":"Niveaux clients",
|
||||
|
|
@ -903,6 +913,7 @@
|
|||
"common.demand":"Demande",
|
||||
"common.deploy":"Déployer",
|
||||
"common.deployed":"déployé",
|
||||
"common.distributed_ingress":"Arrivée distribuée",
|
||||
"common.diverse":"diversifié",
|
||||
"common.diverse_route":"chemin diversifié",
|
||||
"common.dns_reflection":"réflexion DNS",
|
||||
|
|
@ -1060,6 +1071,7 @@
|
|||
"common.may":"mai",
|
||||
"common.member":"− membre",
|
||||
"common.member_fef5":"Membre",
|
||||
"common.memcached_amplification":"Amplification Memcached",
|
||||
"common.merchant_silicon":"merchant silicon",
|
||||
"common.mercury":"Mercure",
|
||||
"common.metaverse_platform":"Plateforme de métavers",
|
||||
|
|
@ -1072,6 +1084,7 @@
|
|||
"common.more_scenarios":"Plus de scénarios",
|
||||
"common.ms_ms_one_way":"{ms} ms aller simple",
|
||||
"common.mtu_mismatch":"MTU incohérente",
|
||||
"common.multiplier":"Multiplicateur",
|
||||
"common.mystery_link":"Lien mystère",
|
||||
"common.n_box":{"one":"{n} boîtier","other":"{n} boîtiers"},
|
||||
"common.n_days_left":"encore {n} jours",
|
||||
|
|
@ -1161,6 +1174,7 @@
|
|||
"common.price_lock":"Blocage des prix",
|
||||
"common.price_mo":"{price}/mois",
|
||||
"common.provisioning_n_d_grace":"mise en service, {n} j de grâce",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rang",
|
||||
"common.rare":"Rare",
|
||||
"common.reach":"Couverture",
|
||||
|
|
@ -1170,6 +1184,7 @@
|
|||
"common.really_leave":"Vraiment partir ?",
|
||||
"common.really_remove":"Vraiment supprimer ?",
|
||||
"common.redundancy":"Redondance",
|
||||
"common.redundancy_check":"Test de redondance",
|
||||
"common.regen_site":"− Site de régénération",
|
||||
"common.regen_sites":"Sites de régénération",
|
||||
"common.regional_player":"Acteur régional",
|
||||
|
|
@ -1227,6 +1242,8 @@
|
|||
"common.sep":"sept",
|
||||
"common.serious_backbone":"Backbone sérieux",
|
||||
"common.serve_as_much_traffic_as_you":"Sers autant de trafic que possible en un an.",
|
||||
"common.service_affected":"Service touché",
|
||||
"common.set":"Appliquer",
|
||||
"common.settings":"Réglages",
|
||||
"common.share":"Partager",
|
||||
"common.share_2cd9":"Partager…",
|
||||
|
|
@ -1272,6 +1289,7 @@
|
|||
"common.subsea_cables":"Câbles sous-marins",
|
||||
"common.supply_chain":"Chaîne d’approvisionnement",
|
||||
"common.syn_flood":"SYN flood",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestre",
|
||||
"common.terrestrial_19e4":"Terrestre",
|
||||
"common.terrestrial_fiber":"Fibre terrestre",
|
||||
|
|
@ -1403,6 +1421,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Il te faut d’abord un POP dans chaque ville du contrat.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} en plus pendant {d} jours, {when} · paie {fee} à la fin",
|
||||
"customers_and_events.day_n_of_d":"jour {n} sur {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Le gaming attire les attaques",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} paires de fibre dans ta tranchée {a}–{b}. Le génie civil, c’était le plus cher, alors ils veulent tout",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sites : {list} · {bw} par site · {price}/mois",
|
||||
"customers_and_events.name_at_site":"{name} à {site}",
|
||||
|
|
@ -1619,6 +1638,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Un chalutier au large d’Ostende a traîné son chalut en plein sur ton câble {a}–{b}. La mer du Nord fait une trentaine de mètres de fond et grouille de bateaux.",
|
||||
"failures.a_visiting_engineer_from_london":"Un ingénieur de passage venu de Londres a apporté de la Marmite au NOC de {city}. Les relations diplomatiques ont rompu, et ton routeur aussi, pendant que tout le monde se disputait.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Un navire de maintenance d’un parc éolien a jeté l’ancre sur ton câble {a}–{b}. Il était là pour réparer une éolienne.",
|
||||
"failures.across_n_transit_and_peering_ports":", via {n} ports de transit et de peering",
|
||||
"failures.all_n_links_in_that_trench":"Les {n} liens de cette tranchée sont tombés avec elle.",
|
||||
"failures.an_automation_script_in_city_ran":"Un script d’automatisation à {city} a lancé « sed » sur toute la config au lieu d’une ligne. Toutes les interfaces s’appellent maintenant « TODO ».",
|
||||
"failures.an_earthquake_shook_your_a_b":"Un séisme a déboîté ta fibre {a}–{b} quelque part au-dessus de 4 000 mètres.",
|
||||
|
|
@ -1983,13 +2003,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Une seconde intercalaire a convaincu un de tes routeurs qu’on est en 1970. L’uptime affiche moins 56 ans. Le trafic va bien.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Une route que tu as retirée en année 1 est encore visible quelque part sur Internet. Personne ne sait où. Tout va bien. Probablement.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Une réunion de deux heures sur les hostnames des routeurs s’est conclue par un vote pour « router-final-v2-NEW ».",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Après le scrubbing en amont : {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Un auditeur a demandé un schéma réseau. Tu lui as envoyé la carte du jeu. Il l’a validée.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Attaque entièrement neutralisée",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Blackholer la cible (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Blackholé : les déchets ont disparu, et {city} aussi. L’attaque a obtenu ce qu’elle voulait.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contenu sur ton PNI sacrificiel {net}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec ne peut pas arrêter un {vec} (couche applicative)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Flowspec sur ton {model} élimine le trafic {vec} en bordure",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Flowspec sur ton {model} rogne le trafic {vec}, mais sa TCAM est petite",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Filtres en bordure : {g} supprimés",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec ne peut pas arrêter {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec supprime {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec supprime {g} ; certains routeurs d’entrée n’ont pas de TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} passent encore",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"C’était le DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"Blackhole IX <small>~la moitié le respecte</small>",
|
||||
|
|
@ -2000,29 +2024,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Coquille porteuse",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"La direction a décrété un gel des changements. Quelqu’un a fait un changement pour annoncer le gel des changements.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"LAG de transit {name} à {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} le nettoie en amont (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Aucun filtrage Flowspec : les routeurs d’entrée n’ont pas de TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Pas de centre de scrubbing",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"Aucun scrubbing nécessaire après la protection en bordure",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"Scrubbing à la demande en cours de redirection, actif dans {n} j",
|
||||
"incidents_and_ddos.open_to_work":"Open to work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"LAG PNI avec {name} à {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Ce qui atteint ton réseau : {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"Le RTBH est gratuit et instantané, mais il jette tout ce qui va vers la victime, attaque comme client. Un blackhole IX garde le client en ligne, mais seule la moitié environ des membres le respecte. HackBack 3000™ de Skynot AI y met parfois fin, et parfois écrase un innocent et te vaut une amende.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Centres de scrubbing indisponibles ou saturés",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing à {city} : {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Trafic de scrubbing acheminé par ton backbone : {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · {n} j restants",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Quelqu’un a supprimé l’enregistrement DNS du wiki interne. La procédure pour réparer le DNS était sur le wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Quelqu’un a nommé un VLAN « prodcution ». Désormais, tout repose dessus et il ne pourra jamais être renommé.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"Le certificat TLS de ton tableau de bord NOC a expiré. Plus personne ne voit les graphes, donc techniquement il n’y a aucun problème.",
|
||||
"incidents_and_ddos.this_attack_g":"Cette attaque : {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Le ticket de la semaine",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"Le scrubbing {tier} à {city} le nettoie, acheminé par ton backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"Le scrubbing {tier} à {city} le nettoie",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"Le support du constructeur t’a demandé « d’essayer d’éteindre et de rallumer ». Pour le routeur que tu avais déjà redémarré. Ticket fermé.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Tu as trouvé dans l’inventaire un lien 10G que personne n’a commandé, que personne ne paie, et qui transporte 3 Gbps de quelque chose.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Ton backbone ne peut en acheminer que {g} jusqu’à {city} : le reste n’est pas nettoyé",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Ton tableur d’adresses IP a atteint 1 048 576 lignes. Excel a un avis sur la question.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Ton trafic IPv6 a augmenté de 400 %. D’un paquet à cinq.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Ton {model} ici n’a pas de TCAM Flowspec",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Ta supervision est tombée. Tu l’as découvert parce que rien n’a alerté. Semaine très paisible.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Ton peering coordinator a mis « open to work » sur son profil. Trois Tier 1 veulent soudain discuter. Il ne s’est rien passé, mais ça fait plaisir.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Tes centres de scrubbing sont pleins : {g} passent quand même",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"Le support de ton upstream passe en boucle les mêmes 11 secondes de musique d’attente. Ton ingé d’astreinte sait maintenant la fredonner dans quatre tonalités.",
|
||||
"install.before_you_start":"Avant de commencer",
|
||||
"install.best_played_as_an_app":"Mieux en appli",
|
||||
|
|
@ -2104,9 +2128,12 @@
|
|||
"link_modal.you_already_have_n_link_here":{"one":"Tu as déjà {n} lien ici ({list}). Les liens parallèles ajoutent de la capacité. Par où faire passer celui-ci ?","other":"Tu as déjà {n} liens ici ({list}). Les liens parallèles ajoutent de la capacité. Par où faire passer celui-ci ?"},
|
||||
"link_panels.a_bigger_fabric_carries_more_traffic":"Un fabric plus gros transporte plus de trafic et accueille plus de membres. Ton routeur ici doit quand même suivre.",
|
||||
"link_panels.a_link_on_standby_carries_traffic":"Un lien en attente ne porte du trafic que lorsque les autres liens entre ces villes sont pleins ou coupés.",
|
||||
"link_panels.a_link_s_cost_is_its":"Le coût d’un lien, c’est sa longueur en km plus 60, fois un multiplicateur. Le trafic prend le chemin au coût total le plus bas.",
|
||||
"link_panels.a_regen_site_turns_the_light":"Un site de régénération reconvertit la lumière en bits à mi-chemin et la renvoie toute fraîche, donc les optiques n’ont qu’à atteindre le site suivant. Chacun demande une carte de régénération par canal allumé. {price}/mois par site pour l’abri.",
|
||||
"link_panels.abandon_the_fiber":"Abandonner la fibre",
|
||||
"link_panels.add_parallel_link":"Ajouter un lien parallèle",
|
||||
"link_panels.additional_traffic_lost":"Trafic perdu en plus",
|
||||
"link_panels.an_alternate_path_exists_but_current":"Un autre chemin existe, mais avec le routage et la capacité actuels, moins de trafic arrive.",
|
||||
"link_panels.apply_for_a_license_price_mo":"Demander une licence <small>{price} + {mo}/mois · ~45 jours</small>",
|
||||
"link_panels.back_in_n_days":"Retour dans {n} jours.",
|
||||
"link_panels.behind_the_great_firewall":"Derrière le Grand Pare-feu",
|
||||
|
|
@ -2117,6 +2144,9 @@
|
|||
"link_panels.click_to_tear_down":"Clique pour couper la session",
|
||||
"link_panels.collecting_data_check_back_in_a":"Collecte des données en cours. Repasse dans quelques jours.",
|
||||
"link_panels.congested_upgrade_it_or_add_a":"Saturé. Augmente sa capacité ou ajoute un chemin parallèle.",
|
||||
"link_panels.connected_but_tight":"Connecté, mais de justesse.",
|
||||
"link_panels.cost_on_this_link_w_allowed":"Coût sur ce lien : {w}. Autorisé : de {lo} à {hi}.",
|
||||
"link_panels.cost_the_exact_number_whatever_the":"Coût : le nombre exact, quelle que soit la distance.",
|
||||
"link_panels.dark_fiber_kind_km_km":"Fibre noire · {kind} · {km} km",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of":"Tarif personnalisé DE-KICKS : {p} % de ce que facturerait un IX normal (promo, encore {n} jours).",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of_3d4f":"Tarif personnalisé DE-KICKS : {p} % de ce que facturerait un IX normal.",
|
||||
|
|
@ -2125,6 +2155,7 @@
|
|||
"link_panels.finish_in_1_day_price":"Terminer en 1 jour <small>{price}</small>",
|
||||
"link_panels.foreign_networks_need_a_local_joint":"Les réseaux étrangers ont besoin d’une coentreprise locale et d’une licence d’opérateur pour construire ici.",
|
||||
"link_panels.found_your_own_ix_cost_mo":"Fonder ton propre IX <small>{cost} + {mo}/mois</small>",
|
||||
"link_panels.full_links_during_the_test":"Liens saturés pendant le test",
|
||||
"link_panels.g_to_km_km":"{g} jusqu’à {km} km",
|
||||
"link_panels.giving_it_up_now_returns_price":"Y renoncer maintenant te rembourse {price}.",
|
||||
"link_panels.going_to_customers_in":"Vers les clients de",
|
||||
|
|
@ -2139,6 +2170,7 @@
|
|||
"link_panels.lost_on_the_way":"Perdu en route",
|
||||
"link_panels.mainland_china_plays_by_its_own":"La Chine continentale joue selon ses propres règles. {list} et d’autres services étrangers y sont bloqués, donc les utilisateurs atteignent surtout des réseaux chinois. Le trafic qui passe la frontière perd environ {pct} en filtrage et congestion, sauf s’il emprunte une route premium : du transit CN-Too ou un circuit transfrontalier premium (tous deux vendus uniquement à Hong Kong), ou un PNI avec un réseau chinois. Le revenu par utilisateur est plus faible ici.",
|
||||
"link_panels.members_paying_you":"Membres payants",
|
||||
"link_panels.multiplier_scales_the_distance_cost":"Multiplicateur : il multiplie le coût de la distance, donc un lien plus long coûte toujours plus.",
|
||||
"link_panels.n_amp_huts":"{n} abris d’amplis",
|
||||
"link_panels.n_amplifiers":"{n} amplificateurs",
|
||||
"link_panels.n_exchanges_compete_in_city_members":"{n} IX se font concurrence à {city}. Les membres se recoupent, mais pas totalement, et les challengers cassent les prix de l’historique. Les petits réseaux ne sont souvent que sur l’un d’eux.",
|
||||
|
|
@ -2157,6 +2189,7 @@
|
|||
"link_panels.needs_a_pop_in_cities_too":"Il faut aussi un POP à {cities}.",
|
||||
"link_panels.needs_what":"requiert {what}",
|
||||
"link_panels.needs_your_own_scrubbing_center":"Il faut ton propre centre de scrubbing (onglet Infra).",
|
||||
"link_panels.no_alternate_backbone_path_connects":"Si ce lien tombe, aucun autre chemin du backbone ne relie ces extrémités.",
|
||||
"link_panels.no_regen_sites_in_the_middle":"Pas de site de régénération au milieu de l’océan : sur les câbles longs, les optiques tournent en mode long-haul.",
|
||||
"link_panels.no_traffic_right_now":"Aucun trafic pour l’instant.",
|
||||
"link_panels.not_in_your_cities_yet_nearest":"Pas encore dans tes villes. La plus proche : {city}",
|
||||
|
|
@ -2166,6 +2199,7 @@
|
|||
"link_panels.on_standby_but_carrying_the_traffic":"En attente, mais il porte le trafic : aucun lien actif entre ces villes ne fonctionne.",
|
||||
"link_panels.on_standby_idle_while_the_other":"En attente : au repos tant que les autres liens entre ces villes ont de la place.",
|
||||
"link_panels.on_standby_taking_the_overflow":"En attente : il prend le débordement, car les autres liens entre ces villes sont pleins.",
|
||||
"link_panels.one_backhoe_is_not_enough":"Une pelleteuse ne suffit pas.",
|
||||
"link_panels.open_peer_but_not_on_any":"Peer ouvert, mais sur aucun IX où tu as un POP. Le plus proche : {city}",
|
||||
"link_panels.open_peer_but_not_on_any_bfbb":"Peer ouvert, mais sur aucun IX où tu as un POP",
|
||||
"link_panels.open_peer_join_the_route_server":"Peer ouvert : rejoins le route server de {ix}",
|
||||
|
|
@ -2182,6 +2216,7 @@
|
|||
"link_panels.port_port_price_on_request":"Port {port} <small>Prix sur demande ☎</small>",
|
||||
"link_panels.ports_at_p_of_the_usual":"Ports à {p} % du prix habituel.",
|
||||
"link_panels.ports_up_to_port_are_free":"Les ports jusqu’à {port} sont gratuits.",
|
||||
"link_panels.presets_on_this_link_list":"Préréglages sur ce lien : {list}.",
|
||||
"link_panels.price_n_days":"{price} · {n} jours",
|
||||
"link_panels.put_this_link_on_standby":"Mettre ce lien en attente",
|
||||
"link_panels.ready_for_a_pni_in_city":"Prêt pour un PNI à {city}",
|
||||
|
|
@ -2200,6 +2235,7 @@
|
|||
"link_panels.sell_one_price":"En vendre une <small>{price}</small>",
|
||||
"link_panels.selling_spare_capacity":"Vendre la capacité libre",
|
||||
"link_panels.shares_a_trench_with_n_other":{"one":"Partage une tranchée avec {n} autre lien. Une coupure et ils tombent tous.","other":"Partage une tranchée avec {n} autres liens. Une coupure et ils tombent tous."},
|
||||
"link_panels.snapshot_only_one_selected_link":"Simple instantané : seul le lien choisi tombe. Les autres liens du même câble, de la même tranchée ou du même fabric restent en place. Les pannes et règles de routage en cours s’appliquent toujours. Ni le temps, ni l’argent, ni la partie ne changent.",
|
||||
"link_panels.spare_optics_and_amplifier_cards_on":"Des optiques et des cartes d’ampli de rechange sur l’étagère transforment des pannes matérielles de plusieurs jours en remplacements d’une journée.",
|
||||
"link_panels.spare_price":"rechange + {price}",
|
||||
"link_panels.spares_bought_now_are_already_paid":"Les pièces achetées maintenant sont déjà payées quand la prochaine pénurie arrive.",
|
||||
|
|
@ -2209,6 +2245,7 @@
|
|||
"link_panels.take_it_off_standby":"Le sortir de l’attente",
|
||||
"link_panels.there_s_no_ix_in_city":"Pas encore d’IX à {city}. Fondes-en un : les réseaux te rejoignent peu à peu, te paient leurs ports et font du peering gratuit avec toi.",
|
||||
"link_panels.they_need_the_full_internet_your":"Ils veulent tout Internet. Ta couverture est de {pct}.",
|
||||
"link_panels.this_backhoe_wins":"Cette pelleteuse gagne.",
|
||||
"link_panels.this_fiber_is_dark_add_optics":"Cette fibre est éteinte. Ajoute des optiques ci-dessous pour transporter du trafic.",
|
||||
"link_panels.this_is_the_only_link_between":"C’est le seul lien entre ces villes. Ajoutes-en un parallèle, ou un chemin via une autre ville.",
|
||||
"link_panels.tier_1_only_a_pni_and":"Tier 1 : PNI uniquement, et seulement quand tu seras assez gros pour le club des Tier 1",
|
||||
|
|
@ -2218,13 +2255,15 @@
|
|||
"link_panels.upgrade_to_sys_price":"Passer à {sys} <small>{price}</small>",
|
||||
"link_panels.via_a_capacity_broker":"via un courtier en capacité",
|
||||
"link_panels.virtual_circuit_name_km_km":"Circuit virtuel · {name} · {km} km",
|
||||
"link_panels.what_happens_if_this_link_fails":"Que se passe-t-il si ce lien tombe maintenant ?",
|
||||
"link_panels.what_s_on_this_link":"Ce qui passe sur ce lien",
|
||||
"link_panels.will_peer_at_ix_request_a":"Accepte le peering à {ix} : demande une session",
|
||||
"link_panels.with_current_demand_and_routing_this":"Avec la demande et le routage actuels, ce lien peut tomber sans perte de trafic supplémentaire.",
|
||||
"link_panels.you_can_pre_install_optics_now":"Tu peux déjà installer les optiques pour qu’elle s’allume le jour où elle est prête.",
|
||||
"link_panels.your_joint_venture_holds_an":"Ta coentreprise détient une licence d’opérateur.",
|
||||
"link_panels.your_own_build":"construite par toi",
|
||||
"link_panels.your_own_fabric_name":"Ton propre fabric · {name}",
|
||||
"link_panels.your_routers_pick_the_lowest_cost":"Tes routeurs choisissent le chemin le moins coûteux. Augmente la métrique pour pousser le trafic vers d’autres chemins. « Secours seul » le laisse au repos tant que le reste fonctionne. S’applique à tous les liens entre ces deux villes.",
|
||||
"link_panels.your_routers_pick_the_lowest_cost_0160":"Tes routeurs choisissent le chemin le moins coûteux. Augmente la métrique pour pousser le trafic vers d’autres chemins. « Secours seul » le laisse au repos tant que le reste fonctionne. Choisis Perso pour fixer ton propre multiplicateur ou coût. S’applique à tous les liens entre ces deux villes.",
|
||||
"link_panels.your_traffic_crossing_the_border":"Ton trafic qui passe la frontière",
|
||||
"link_panels.your_wave_was_sold_before_the":"Ta longueur d’onde a été vendue avant que le propriétaire du câble ne le réingénie, donc elle continue de tourner.",
|
||||
"links.a_fab_fabric_unlocks_at_customer":"<b>Un fabric {fab} se débloque au niveau client {lv}.</b>",
|
||||
|
|
@ -2492,6 +2531,10 @@
|
|||
"notifications.n_min_ago":{"one":"il y a {n} min","other":"il y a {n} min"},
|
||||
"notifications.nothing_in_the_last_10_minutes":"Rien ces 10 dernières minutes.",
|
||||
"notifications.show_all_n":"Tout afficher ({n})",
|
||||
"optic_counts.apply_price":"Appliquer · {price}",
|
||||
"optic_counts.count_for_model":"Nombre de canaux {model}",
|
||||
"optic_counts.only_n_channels_free":"Il ne reste que {n} canaux libres sur cette fibre.",
|
||||
"optic_counts.target_count":"Quantité souhaitée",
|
||||
"own_cable.a_and_b":"{a} et {b}",
|
||||
"own_cable.a_fishing_fleet_is_trawling_exactly":"Une flotte de chalutiers drague pile là où tu dois poser.",
|
||||
"own_cable.a_leased_wave_wave_on_this":"Une longueur d’onde {wave} louée sur ce parcours coûte {price}/mois.",
|
||||
|
|
@ -2604,6 +2647,27 @@
|
|||
"peering_policy.tried_a_remote_peer_once_it":"Ils ont essayé un peer distant, une fois. Il a flappé pendant un lancement de produit. Plus jamais.",
|
||||
"pitcairn.uk_grant_mo":"Subvention britannique {mo}/mois",
|
||||
"pitcairn.uk_grant_mo_once_islanders":"Subvention britannique {mo}/mois une fois les insulaires en ligne",
|
||||
"pni_all.additional_per_month":"Coût mensuel supplémentaire",
|
||||
"pni_all.all_at_port":"Peering avec tous les réseaux · {port}",
|
||||
"pni_all.delivery_and_traffic_charges":"Les délais de livraison varient selon le réseau. Des frais de peering liés au trafic s'appliquent aussi lorsque le réseau l'exige.",
|
||||
"pni_all.n_at_their_minimum_size":{"one":"{n} commande passe au plus petit PNI que ce réseau accepte.","other":"{n} commandes passent au plus petit PNI que ces réseaux acceptent."},
|
||||
"pni_all.n_blocked_connections":{"one":"{n} connexion indisponible","other":"{n} connexions indisponibles"},
|
||||
"pni_all.n_blocked_pops":{"one":"{n} POP indisponible","other":"{n} POP indisponibles"},
|
||||
"pni_all.n_existing_or_pending_unchanged":{"one":"{n} PNI existant ou commande en attente reste inchangé.","other":"{n} PNI existants ou commandes en attente restent inchangés."},
|
||||
"pni_all.n_networks":{"one":"{n} réseau","other":"{n} réseaux"},
|
||||
"pni_all.n_of_total_connections":"{n} / {total} connexions",
|
||||
"pni_all.n_of_total_pops":"{n} / {total} POP en commun",
|
||||
"pni_all.n_orders_with_net":{"one":"{n} commande de PNI passée avec {net}. Inchangés : {kept} ; indisponibles : {blocked}.","other":"{n} commandes de PNI passées avec {net}. Inchangés : {kept} ; indisponibles : {blocked}."},
|
||||
"pni_all.new_and_upgrades":"Nouveaux : {fresh} · Augmentations : {up}",
|
||||
"pni_all.no_shared_locations":"Aucun POP en commun disponible.",
|
||||
"pni_all.no_shared_pops":"Tu n'as aucun POP en commun avec ce réseau.",
|
||||
"pni_all.order_missing_and_upgrade_smaller":"Commande les PNI manquants et augmente la capacité des plus petits dans les POP en commun. Les PNI plus grands et les commandes en attente restent inchangés. Les POP indisponibles sont ignorés.",
|
||||
"pni_all.peer_all_networks":"Peering avec tous les réseaux sur tous les POP",
|
||||
"pni_all.peer_at_port":"Peering sur tous les POP · {port}",
|
||||
"pni_all.peer_on_all_pops":"Peering sur tous les POP",
|
||||
"pni_all.pni_size":"Capacité du PNI",
|
||||
"pni_all.setup_total":"Coût total d'installation",
|
||||
"pni_all.traffic_charges_apply":"Des frais de trafic de {price} par Gbps s'appliquent également.",
|
||||
"pnis.a_new_region_is_coming_online":"Une nouvelle région arrive bientôt. Elle arrive bientôt depuis 2019.",
|
||||
"pnis.about_n_days_to_go_nothing":"Encore environ {n} jours. Rien à faire qu’attendre, ou relancer.",
|
||||
"pnis.augment_with_net_delivered_in_city":"<b>Extension avec {net} livrée à {city}.</b><br>Désormais {port}.",
|
||||
|
|
@ -3229,4 +3293,29 @@
|
|||
"tutorial.your_customers_want_the_whole":"Tes clients veulent tout Internet. Ouvre l’onglet Transit et achète un port chez un opérateur.",
|
||||
"tutorial.your_router_is_live_press_launch":"Ton routeur est en ligne. Appuie sur « Lancer le haut débit » pour vendre Internet aux habitants de ta ville.",
|
||||
"ui.n_d_left":"encore {n} j",
|
||||
"utilities.apply_kit":"Appliquer le kit de redondance",
|
||||
"utilities.cache_moves":"Caches à déplacer : {n} (équilibrés par fournisseur)",
|
||||
"utilities.cache_note":"Demande un cache par fournisseur éligible sur chaque site existant. Les caches existants sont conservés ; les fournisseurs exigent toujours un trafic suffisant.",
|
||||
"utilities.cache_ports":"Il faut {need} ports de routeur libres ; {free} disponibles. Aucune demande tant que tous les caches ne peuvent pas être installés.",
|
||||
"utilities.cache_quote":"{n} nouveaux caches · Matériel gratuit · Coût mensuel supplémentaire : {mo}",
|
||||
"utilities.caches_requested":"{n} caches installés à {city}.",
|
||||
"utilities.ix_peering":"Peering IX sur tout le réseau",
|
||||
"utilities.join_route_servers":"Rejoindre tous les route servers ({n})",
|
||||
"utilities.kit_applied":"Redondance mise à jour à {city}.",
|
||||
"utilities.kit_balanced":"Matériel installé et caches équilibrés.",
|
||||
"utilities.kit_cost":"Coût initial : {cost} · Coût mensuel supplémentaire : {mo}",
|
||||
"utilities.peer_counts":"{ready} éligibles · {existing} existants · {blocked} indisponibles",
|
||||
"utilities.peering_note":"Demande les peers éligibles sur chaque IX rejoint. Les sessions existantes, y compris via le route server, sont ignorées. Les refus et seuils de trafic restent applicables. Aucun port ni PNI payant ne sera acheté.",
|
||||
"utilities.peers_requested":"{n} nouvelles sessions de peering IX établies.",
|
||||
"utilities.quote_changed":"Le devis a changé. Vérifie le nouveau prix et réessaie.",
|
||||
"utilities.redundancy_kit":"Kit de redondance du POP",
|
||||
"utilities.redundancy_note":"Les caches existants sont équilibrés par fournisseur. Répartis séparément les connexions IX, PNI et transit entre les sites et vérifie la diversité des liaisons et la capacité de réserve des routeurs.",
|
||||
"utilities.request_all":"Demander tous les peers éligibles ({n})",
|
||||
"utilities.request_caches":"Demander les caches manquants ({n})",
|
||||
"utilities.route_server_note":"Les peers des route servers nécessitent une politique de peering ouverte. Les sessions existantes restent activées ; aucun port ne sera acheté.",
|
||||
"utilities.route_servers_joined":"{n} route servers rejoints.",
|
||||
"utilities.second_site":"Deuxième site",
|
||||
"utilities.title":"Utilitaires",
|
||||
"utilities.two_routers":"Au moins deux routeurs",
|
||||
"utilities.view_pop":"Voir le POP",
|
||||
};
|
||||
|
|
|
|||
109
site/i18n/it.js
109
site/i18n/it.js
|
|
@ -12,6 +12,11 @@
|
|||
"action_helpers.too_far_even_at_its_slowest":"Troppo lontano anche alla velocità più bassa: qui una tratta ottica è di {span} km e l’ottica arriva a {max} km. Aggiungi un sito di rigenerazione (Sistema di linea).",
|
||||
"action_helpers.unlocks_at_customer_level_n":"Si sblocca al livello cliente {n}.",
|
||||
"actions.your_router_can_t_take_a":"<b>Il tuo router non regge una porta {port}.</b><br>Aggiornalo nella scheda Infra.",
|
||||
"automation.auto_accept_sales":"Vendite automatiche: {state}",
|
||||
"automation.auto_pay_repairs":"Riparazioni a pagamento auto: {state}",
|
||||
"automation.next_auto_check":"Tempo fino alla prossima verifica automatica dei requisiti.",
|
||||
"automation.repairs_when_affordable":"Durante il gioco, paga automaticamente le riparazioni urgenti disponibili se hai abbastanza fondi.",
|
||||
"automation.sales_every_five_seconds":"Ogni 5 secondi durante il gioco, accetta solo le offerte con requisiti soddisfatti e capacità di servizio disponibile.",
|
||||
"badges.a_petabit_a_second":"Un petabit al secondo",
|
||||
"badges.a_secret_badge":"Un badge segreto",
|
||||
"badges.attend_a_conference":"Partecipa a una conferenza.",
|
||||
|
|
@ -697,6 +702,7 @@
|
|||
"city_panel.every_port_is_taken_add_a":"Tutte le porte sono occupate. Aggiungi un router o passa a un modello con più porte prima di collegare altro.",
|
||||
"city_panel.everything_is_in_one_building_move":"È tutto in un solo edificio. Sposta alcuni uplink sull’altro sito dalle schede Transit e Peering.",
|
||||
"city_panel.fabrics_list":"Fabric: {list}",
|
||||
"city_panel.few_data_centers_pops_x":"Pochi data center: POP {x}×",
|
||||
"city_panel.fiber_from_city":"Fibra da {city}",
|
||||
"city_panel.fiber_is_down":"la fibra è down",
|
||||
"city_panel.g_of_circuits":"{g} di circuiti",
|
||||
|
|
@ -783,6 +789,7 @@
|
|||
"common.95th_percentile":"95° percentile",
|
||||
"common.about_average":"nella media",
|
||||
"common.accept":"Accetta",
|
||||
"common.ack_flood":"Flood ACK",
|
||||
"common.ad_campaign":"Pubblicità!",
|
||||
"common.africa":"Africa",
|
||||
"common.all_cities":"Tutte le città",
|
||||
|
|
@ -849,6 +856,7 @@
|
|||
"common.challenger":"sfidante",
|
||||
"common.change_freeze":"Change freeze",
|
||||
"common.chase_it":"Sollecita",
|
||||
"common.check_redundancy":"Verifica ridondanza",
|
||||
"common.china":"Cina",
|
||||
"common.city":"città",
|
||||
"common.city_906b":"Città",
|
||||
|
|
@ -873,10 +881,12 @@
|
|||
"common.controller_off":"controller spento",
|
||||
"common.cooling_failure":"Guasto al raffreddamento",
|
||||
"common.copy":"Copia",
|
||||
"common.cost":"Costo",
|
||||
"common.costs":"Costi",
|
||||
"common.courtesy_route":"Percorso di cortesia",
|
||||
"common.crashes_more":"crasha più spesso",
|
||||
"common.credit_rating":"Rating creditizio",
|
||||
"common.custom":"Personalizzata",
|
||||
"common.customer":"Cliente",
|
||||
"common.customer_care":"Cura del cliente",
|
||||
"common.customer_levels":"Livelli clienti",
|
||||
|
|
@ -903,6 +913,7 @@
|
|||
"common.demand":"Domanda",
|
||||
"common.deploy":"Deploy",
|
||||
"common.deployed":"in produzione",
|
||||
"common.distributed_ingress":"Ingresso distribuito",
|
||||
"common.diverse":"diversificato",
|
||||
"common.diverse_route":"percorso diverso",
|
||||
"common.dns_reflection":"riflessione DNS",
|
||||
|
|
@ -1060,6 +1071,7 @@
|
|||
"common.may":"mag",
|
||||
"common.member":"− membro",
|
||||
"common.member_fef5":"Membro",
|
||||
"common.memcached_amplification":"Amplificazione Memcached",
|
||||
"common.merchant_silicon":"merchant silicon",
|
||||
"common.mercury":"Mercurio",
|
||||
"common.metaverse_platform":"Piattaforma metaverso",
|
||||
|
|
@ -1072,6 +1084,7 @@
|
|||
"common.more_scenarios":"Altri scenari",
|
||||
"common.ms_ms_one_way":"{ms} ms sola andata",
|
||||
"common.mtu_mismatch":"Mismatch di MTU",
|
||||
"common.multiplier":"Moltiplicatore",
|
||||
"common.mystery_link":"Link misterioso",
|
||||
"common.n_box":{"one":"{n} box","other":"{n} box"},
|
||||
"common.n_days_left":"mancano {n} giorni",
|
||||
|
|
@ -1161,6 +1174,7 @@
|
|||
"common.price_lock":"Blocco dei prezzi",
|
||||
"common.price_mo":"{price}/mese",
|
||||
"common.provisioning_n_d_grace":"in attivazione, {n}g di tolleranza",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rango",
|
||||
"common.rare":"Raro",
|
||||
"common.reach":"Copertura",
|
||||
|
|
@ -1170,6 +1184,7 @@
|
|||
"common.really_leave":"Uscire davvero?",
|
||||
"common.really_remove":"Rimuovere davvero?",
|
||||
"common.redundancy":"Ridondanza",
|
||||
"common.redundancy_check":"Verifica della ridondanza",
|
||||
"common.regen_site":"− Sito di rigenerazione",
|
||||
"common.regen_sites":"Siti di rigenerazione",
|
||||
"common.regional_player":"Operatore regionale",
|
||||
|
|
@ -1227,6 +1242,8 @@
|
|||
"common.sep":"set",
|
||||
"common.serious_backbone":"Backbone serio",
|
||||
"common.serve_as_much_traffic_as_you":"Servi più traffico che puoi in un anno.",
|
||||
"common.service_affected":"Servizio interessato",
|
||||
"common.set":"Imposta",
|
||||
"common.settings":"Impostazioni",
|
||||
"common.share":"Condividi",
|
||||
"common.share_2cd9":"Condividi…",
|
||||
|
|
@ -1272,6 +1289,7 @@
|
|||
"common.subsea_cables":"Cavi sottomarini",
|
||||
"common.supply_chain":"Catena di fornitura",
|
||||
"common.syn_flood":"flood SYN",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestre",
|
||||
"common.terrestrial_19e4":"Terrestre",
|
||||
"common.terrestrial_fiber":"Fibra terrestre",
|
||||
|
|
@ -1403,6 +1421,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Prima ti serve un POP in ogni città del contratto.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} in più per {d} giorni, {when} · paga {fee} alla fine",
|
||||
"customers_and_events.day_n_of_d":"giorno {n} di {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Il gaming attira attacchi",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} coppie di fibra nel tuo scavo {a}–{b}. Lo scavo era la parte costosa, quindi le vogliono tutte",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sedi: {list} · {bw} per sede · {price}/mese",
|
||||
"customers_and_events.name_at_site":"{name} presso {site}",
|
||||
|
|
@ -1619,6 +1638,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Un peschereccio al largo di Ostenda ha trascinato le reti dritte sul tuo cavo {a}–{b}. Il Mare del Nord è profondo una trentina di metri e pieno di barche.",
|
||||
"failures.a_visiting_engineer_from_london":"Un ingegnere in visita da Londra ha portato la Marmite nel NOC di {city}. Le relazioni diplomatiche sono saltate, e mentre tutti litigavano è saltato anche il tuo router.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Una nave di servizio di un parco eolico ha gettato l'ancora sul tuo cavo {a}–{b}. Era lì per riparare una turbina.",
|
||||
"failures.across_n_transit_and_peering_ports":", su {n} porte di transit e peering",
|
||||
"failures.all_n_links_in_that_trench":"Tutti i {n} link in quello scavo sono caduti insieme.",
|
||||
"failures.an_automation_script_in_city_ran":"Uno script di automazione a {city} ha lanciato “sed” su tutta la config invece che su una riga. Ora ogni interfaccia si chiama “TODO”.",
|
||||
"failures.an_earthquake_shook_your_a_b":"Un terremoto ha scollegato la tua fibra {a}–{b} da qualche parte sopra i 4.000 metri.",
|
||||
|
|
@ -1983,13 +2003,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Un secondo intercalare ha convinto uno dei tuoi router che siamo nel 1970. L’uptime ora segna meno 56 anni. Il traffico va benissimo.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Una route che hai ritirato nell’Anno 1 è ancora visibile da qualche parte su internet. Nessuno sa dove. Va tutto bene. Probabilmente.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Una riunione di due ore sugli hostname dei router si è chiusa con un voto per “router-final-v2-NEW”.",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Dopo lo scrubbing a monte: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Un auditor ha chiesto uno schema della rete. Gli hai mandato la mappa del gioco. L’ha approvata.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Attacco completamente mitigato",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Metti il bersaglio in buco nero (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"In buco nero: la spazzatura è sparita, e anche {city}. L’attacco ha ottenuto ciò che voleva.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contenuto sulla tua PNI sacrificale {net}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec non può fermare un {vec} (livello applicativo)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Il Flowspec sul tuo {model} sta scartando {vec} all’edge",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Il Flowspec sul tuo {model} lima {vec}, ma la sua TCAM è piccola",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Filtri al bordo: {g} scartati",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec non può fermare {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec scarta {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec scarta {g}; alcuni router di ingresso non hanno TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} superano le difese",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"Era il DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"Blackhole IX <small>~metà lo rispetta</small>",
|
||||
|
|
@ -2000,29 +2024,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Refuso portante",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"Il management ha dichiarato un change freeze. Qualcuno ha fatto una change per annunciare il change freeze.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"LAG di transit {name} a {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} lo sta ripulendo a monte (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Nessun filtraggio Flowspec: i router di ingresso non hanno TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Nessun centro di scrubbing",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"Nessuno scrubbing necessario dopo la mitigazione al bordo",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"Scrubbing on-demand in deviazione, attivo tra {n}g",
|
||||
"incidents_and_ddos.open_to_work":"Open to work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"LAG PNI con {name} a {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Arriva alla tua rete: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"L’RTBH è gratis e immediato, ma scarta tutto ciò che va alla vittima: attacco e cliente insieme. Un blackhole IX tiene su il cliente ma solo circa metà dei membri lo rispetta. HackBack 3000™ di Skynot AI a volte lo ferma, e a volte travolge un innocente e ti becca una multa.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Centri di scrubbing non disponibili o al completo",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing a {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Traffico di scrubbing trasportato sul tuo backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · {n}g rimasti",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Qualcuno ha cancellato il record DNS del wiki interno. Il runbook per sistemare il DNS stava sul wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Qualcuno ha chiamato una VLAN “prodcution”. Ora è portante e non potrà mai più essere rinominata.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"Il certificato TLS della dashboard del NOC è scaduto. Nessuno vede più i grafici, quindi tecnicamente non ci sono problemi.",
|
||||
"incidents_and_ddos.this_attack_g":"Questo attacco: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket della settimana",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"Lo scrubbing {tier} a {city} lo sta pulendo, portato lì sul tuo backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"Lo scrubbing {tier} a {city} lo sta pulendo",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"Il supporto del vendor ti ha chiesto di “provare a spegnere e riaccendere”. Il router che avevi già riavviato. Ticket chiuso.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Hai trovato in inventario un link da 10G che nessuno ha ordinato, nessuno paga, e che porta 3 Gbps di qualcosa.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Il tuo backbone riesce a portarne solo {g} a {city}: il resto non viene pulito",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Il foglio di calcolo degli indirizzi IP ha raggiunto 1.048.576 righe. Excel ha qualcosa da ridire.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Il tuo traffico IPv6 è cresciuto del 400%. Da un pacchetto a cinque.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Il tuo {model} qui non ha TCAM per il Flowspec",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Il tuo sistema di monitoraggio è andato giù. Te ne sei accorto perché non è scattato nessun allarme. Settimana tranquillissima.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Il tuo peering coordinator ha aggiornato il profilo con “open to work”. Tre Tier 1 all’improvviso vogliono fare due chiacchiere. Non è successo niente, ma è stato bello.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"I tuoi centri di scrubbing sono pieni: {g} passano lo stesso",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"Il supporto del tuo upstream ha sempre gli stessi 11 secondi di musica d’attesa. Il tuo reperibile ora sa canticchiarla in quattro tonalità.",
|
||||
"install.before_you_start":"Prima di iniziare",
|
||||
"install.best_played_as_an_app":"Meglio come app",
|
||||
|
|
@ -2104,9 +2128,12 @@
|
|||
"link_modal.you_already_have_n_link_here":{"one":"Hai già {n} link qui ({list}). I link paralleli aggiungono capacità. Che percorso deve fare questo?","other":"Hai già {n} link qui ({list}). I link paralleli aggiungono capacità. Che percorso deve fare questo?"},
|
||||
"link_panels.a_bigger_fabric_carries_more_traffic":"Un fabric più grande porta più traffico e ha posto per più membri. Il tuo router qui deve comunque starci dietro.",
|
||||
"link_panels.a_link_on_standby_carries_traffic":"Un link in standby porta traffico solo quando gli altri link tra queste città sono pieni o giù.",
|
||||
"link_panels.a_link_s_cost_is_its":"Il costo di un link è la sua lunghezza in km più 60, per un moltiplicatore. Il traffico prende il percorso col costo totale più basso.",
|
||||
"link_panels.a_regen_site_turns_the_light":"Un sito di rigenerazione riconverte la luce in bit a metà strada e la rimanda fresca, così le ottiche devono arrivare solo al sito successivo. Ognuno richiede una scheda di rigenerazione per ogni canale acceso. {price}/mese a sito per la casupola.",
|
||||
"link_panels.abandon_the_fiber":"Abbandona la fibra",
|
||||
"link_panels.add_parallel_link":"Aggiungi link parallelo",
|
||||
"link_panels.additional_traffic_lost":"Ulteriore traffico perso",
|
||||
"link_panels.an_alternate_path_exists_but_current":"Esiste un percorso alternativo, ma con routing e capacità attuali viene consegnato meno traffico.",
|
||||
"link_panels.apply_for_a_license_price_mo":"Richiedi una licenza <small>{price} + {mo}/mese · ~45 giorni</small>",
|
||||
"link_panels.back_in_n_days":"Torna tra {n} giorni.",
|
||||
"link_panels.behind_the_great_firewall":"Dietro il Great Firewall",
|
||||
|
|
@ -2117,6 +2144,9 @@
|
|||
"link_panels.click_to_tear_down":"Clicca per chiudere la sessione",
|
||||
"link_panels.collecting_data_check_back_in_a":"Raccolta dati in corso. Ripassa tra qualche giorno.",
|
||||
"link_panels.congested_upgrade_it_or_add_a":"Congestionato. Potenzialo o aggiungi un percorso parallelo.",
|
||||
"link_panels.connected_but_tight":"Connesso, ma al limite.",
|
||||
"link_panels.cost_on_this_link_w_allowed":"Costo su questo link: {w}. Ammessi: da {lo} a {hi}.",
|
||||
"link_panels.cost_the_exact_number_whatever_the":"Costo: il numero esatto, a prescindere dalla distanza.",
|
||||
"link_panels.dark_fiber_kind_km_km":"Dark fiber · {kind} · {km} km",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of":"Prezzi personalizzati DE-KICKS: {p}% di quanto chiederebbe un IX normale (promo, ancora {n} giorni).",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of_3d4f":"Prezzi personalizzati DE-KICKS: {p}% di quanto chiederebbe un IX normale.",
|
||||
|
|
@ -2125,6 +2155,7 @@
|
|||
"link_panels.finish_in_1_day_price":"Termina in 1 giorno <small>{price}</small>",
|
||||
"link_panels.foreign_networks_need_a_local_joint":"Per costruire infrastrutture qui, le reti straniere hanno bisogno di una joint venture locale e di una licenza operativa.",
|
||||
"link_panels.found_your_own_ix_cost_mo":"Fonda il tuo IX <small>{cost} + {mo}/mese</small>",
|
||||
"link_panels.full_links_during_the_test":"Collegamenti saturi durante il test",
|
||||
"link_panels.g_to_km_km":"{g} fino a {km} km",
|
||||
"link_panels.giving_it_up_now_returns_price":"Rinunciarci adesso ti restituisce {price}.",
|
||||
"link_panels.going_to_customers_in":"Diretto ai clienti a",
|
||||
|
|
@ -2139,6 +2170,7 @@
|
|||
"link_panels.lost_on_the_way":"Perso per strada",
|
||||
"link_panels.mainland_china_plays_by_its_own":"La Cina continentale gioca con regole tutte sue. {list} e altri servizi stranieri qui sono bloccati, quindi gli utenti raggiungono soprattutto reti cinesi. Il traffico che attraversa il confine perde circa il {pct} tra filtri e congestione, a meno che non viaggi su una rotta premium: transit CN-Too o un circuito transfrontaliero premium (entrambi venduti solo a Hong Kong), oppure un PNI con una rete cinese. Qui i ricavi per utente sono più bassi.",
|
||||
"link_panels.members_paying_you":"Membri paganti",
|
||||
"link_panels.multiplier_scales_the_distance_cost":"Moltiplicatore: scala il costo della distanza, così un link più lungo costa comunque di più.",
|
||||
"link_panels.n_amp_huts":"{n} shelter amplificatori",
|
||||
"link_panels.n_amplifiers":"{n} amplificatori",
|
||||
"link_panels.n_exchanges_compete_in_city_members":"A {city} si fanno concorrenza {n} exchange. I membri si sovrappongono, ma non del tutto, e gli sfidanti fanno prezzi più bassi dell’incumbent. Le reti piccole spesso stanno su uno solo.",
|
||||
|
|
@ -2157,6 +2189,7 @@
|
|||
"link_panels.needs_a_pop_in_cities_too":"Serve un POP anche a {cities}.",
|
||||
"link_panels.needs_what":"serve {what}",
|
||||
"link_panels.needs_your_own_scrubbing_center":"Serve il tuo centro di scrubbing (scheda Infra).",
|
||||
"link_panels.no_alternate_backbone_path_connects":"Se questo collegamento si interrompe, nessun percorso alternativo della dorsale collega questi estremi.",
|
||||
"link_panels.no_regen_sites_in_the_middle":"Niente siti di rigenerazione in mezzo all’oceano: sui cavi lunghi le ottiche lavorano in modalità long-haul.",
|
||||
"link_panels.no_traffic_right_now":"Nessun traffico al momento.",
|
||||
"link_panels.not_in_your_cities_yet_nearest":"Non ancora nelle tue città. La più vicina: {city}",
|
||||
|
|
@ -2166,6 +2199,7 @@
|
|||
"link_panels.on_standby_but_carrying_the_traffic":"In standby, ma porta il traffico: nessun link attivo tra queste città funziona.",
|
||||
"link_panels.on_standby_idle_while_the_other":"In standby: a riposo finché gli altri link tra queste città hanno spazio.",
|
||||
"link_panels.on_standby_taking_the_overflow":"In standby: prende il traffico in eccesso, perché gli altri link tra queste città sono pieni.",
|
||||
"link_panels.one_backhoe_is_not_enough":"Una ruspa non basta.",
|
||||
"link_panels.open_peer_but_not_on_any":"Peer aperto, ma non su nessun IX dove hai un POP. Il più vicino: {city}",
|
||||
"link_panels.open_peer_but_not_on_any_bfbb":"Peer aperto, ma non su nessun IX dove hai un POP",
|
||||
"link_panels.open_peer_join_the_route_server":"Peer aperto: entra nel route server di {ix}",
|
||||
|
|
@ -2182,6 +2216,7 @@
|
|||
"link_panels.port_port_price_on_request":"Porta {port} <small>Prezzo su richiesta ☎</small>",
|
||||
"link_panels.ports_at_p_of_the_usual":"Porte al {p}% del prezzo normale.",
|
||||
"link_panels.ports_up_to_port_are_free":"Le porte fino a {port} sono gratis.",
|
||||
"link_panels.presets_on_this_link_list":"Preset su questo link: {list}.",
|
||||
"link_panels.price_n_days":"{price} · {n} giorni",
|
||||
"link_panels.put_this_link_on_standby":"Metti questo link in standby",
|
||||
"link_panels.ready_for_a_pni_in_city":"Pronto per un PNI a {city}",
|
||||
|
|
@ -2200,6 +2235,7 @@
|
|||
"link_panels.sell_one_price":"Vendine uno <small>{price}</small>",
|
||||
"link_panels.selling_spare_capacity":"Vendere la capacità libera",
|
||||
"link_panels.shares_a_trench_with_n_other":{"one":"Condivide lo scavo con {n} altro link. Un taglio li butta giù tutti.","other":"Condivide lo scavo con altri {n} link. Un taglio li butta giù tutti."},
|
||||
"link_panels.snapshot_only_one_selected_link":"Solo un’istantanea: si interrompe il collegamento selezionato. Gli altri collegamenti sullo stesso cavo, scavo o fabric restano attivi. I guasti e le regole di routing esistenti si applicano comunque. Tempo, denaro e stato della partita non cambiano.",
|
||||
"link_panels.spare_optics_and_amplifier_cards_on":"Ottiche e schede amplificatore di scorta sullo scaffale trasformano guasti hardware da più giorni in sostituzioni da un giorno.",
|
||||
"link_panels.spare_price":"ricambio + {price}",
|
||||
"link_panels.spares_bought_now_are_already_paid":"Le scorte comprate adesso sono già pagate quando arriva la prossima carenza.",
|
||||
|
|
@ -2209,6 +2245,7 @@
|
|||
"link_panels.take_it_off_standby":"Toglilo dallo standby",
|
||||
"link_panels.there_s_no_ix_in_city":"A {city} non c’è ancora un IX. Fondane uno: le reti si uniscono col tempo, ti pagano le porte e fanno peering con te gratis.",
|
||||
"link_panels.they_need_the_full_internet_your":"Vogliono internet per intero. La tua copertura è del {pct}.",
|
||||
"link_panels.this_backhoe_wins":"Questa ruspa vince.",
|
||||
"link_panels.this_fiber_is_dark_add_optics":"Questa fibra è spenta. Aggiungi le ottiche qui sotto per trasportare traffico.",
|
||||
"link_panels.this_is_the_only_link_between":"È l’unico link tra queste città. Aggiungine uno parallelo, o un percorso che passi da un’altra città.",
|
||||
"link_panels.tier_1_only_a_pni_and":"Tier 1: solo un PNI, e solo quando sarai abbastanza grande per il club dei Tier 1",
|
||||
|
|
@ -2218,13 +2255,15 @@
|
|||
"link_panels.upgrade_to_sys_price":"Passa a {sys} <small>{price}</small>",
|
||||
"link_panels.via_a_capacity_broker":"tramite un broker di capacità",
|
||||
"link_panels.virtual_circuit_name_km_km":"Circuito virtuale · {name} · {km} km",
|
||||
"link_panels.what_happens_if_this_link_fails":"Cosa succede se questo collegamento si interrompe adesso?",
|
||||
"link_panels.what_s_on_this_link":"Cosa passa su questo link",
|
||||
"link_panels.will_peer_at_ix_request_a":"Farà peering a {ix}: richiedi una sessione",
|
||||
"link_panels.with_current_demand_and_routing_this":"Con domanda e routing attuali, questo collegamento può interrompersi senza ulteriori perdite di traffico.",
|
||||
"link_panels.you_can_pre_install_optics_now":"Puoi già installare le ottiche, così si accende il giorno in cui è pronta.",
|
||||
"link_panels.your_joint_venture_holds_an":"La tua joint venture ha una licenza operativa.",
|
||||
"link_panels.your_own_build":"costruita da te",
|
||||
"link_panels.your_own_fabric_name":"Il tuo fabric · {name}",
|
||||
"link_panels.your_routers_pick_the_lowest_cost":"I tuoi router scelgono il percorso a costo minore. Alza la metrica per spingere il traffico su altri percorsi. “Solo backup” lo lascia a riposo finché il resto funziona. Vale per tutti i link tra queste due città.",
|
||||
"link_panels.your_routers_pick_the_lowest_cost_0160":"I tuoi router scelgono il percorso a costo minore. Alza la metrica per spingere il traffico su altri percorsi. “Solo backup” lo lascia a riposo finché il resto funziona. Scegli Personalizzata per impostare il tuo moltiplicatore o costo. Vale per tutti i link tra queste due città.",
|
||||
"link_panels.your_traffic_crossing_the_border":"Il tuo traffico che passa il confine",
|
||||
"link_panels.your_wave_was_sold_before_the":"La tua wave è stata venduta prima che il proprietario del cavo lo riprogettasse, quindi continua a funzionare.",
|
||||
"links.a_fab_fabric_unlocks_at_customer":"<b>Un fabric {fab} si sblocca al livello clienti {lv}.</b>",
|
||||
|
|
@ -2492,6 +2531,10 @@
|
|||
"notifications.n_min_ago":{"one":"{n} min fa","other":"{n} min fa"},
|
||||
"notifications.nothing_in_the_last_10_minutes":"Niente negli ultimi 10 minuti.",
|
||||
"notifications.show_all_n":"Mostra tutte e {n}",
|
||||
"optic_counts.apply_price":"Applica · {price}",
|
||||
"optic_counts.count_for_model":"Numero di canali {model}",
|
||||
"optic_counts.only_n_channels_free":"Su questa fibra sono liberi solo {n} canali.",
|
||||
"optic_counts.target_count":"Quantità desiderata",
|
||||
"own_cable.a_and_b":"{a} e {b}",
|
||||
"own_cable.a_fishing_fleet_is_trawling_exactly":"Una flotta di pescherecci sta strascicando proprio dove devi posare.",
|
||||
"own_cable.a_leased_wave_wave_on_this":"Una wave da {wave} in affitto su questa tratta costa {price}/mese.",
|
||||
|
|
@ -2604,6 +2647,27 @@
|
|||
"peering_policy.tried_a_remote_peer_once_it":"Hanno provato un peer remoto, una volta. Ha flappato durante il lancio di un prodotto. Mai più.",
|
||||
"pitcairn.uk_grant_mo":"Contributo UK {mo}/mese",
|
||||
"pitcairn.uk_grant_mo_once_islanders":"Contributo UK {mo}/mese quando gli isolani saranno online",
|
||||
"pni_all.additional_per_month":"Costo mensile aggiuntivo",
|
||||
"pni_all.all_at_port":"Peering con tutte le reti · {port}",
|
||||
"pni_all.delivery_and_traffic_charges":"I tempi di consegna variano secondo la rete. Si applicano anche costi di peering basati sul traffico, dove previsti.",
|
||||
"pni_all.n_at_their_minimum_size":{"one":"{n} ordine sale al PNI più piccolo che quella rete accetta.","other":"{n} ordini salgono al PNI più piccolo che quelle reti accettano."},
|
||||
"pni_all.n_blocked_connections":{"one":"{n} connessione non disponibile","other":"{n} connessioni non disponibili"},
|
||||
"pni_all.n_blocked_pops":{"one":"{n} POP non disponibile","other":"{n} POP non disponibili"},
|
||||
"pni_all.n_existing_or_pending_unchanged":{"one":"{n} PNI esistente o ordine in attesa resta invariato.","other":"{n} PNI esistenti o ordini in attesa restano invariati."},
|
||||
"pni_all.n_networks":{"one":"{n} rete","other":"{n} reti"},
|
||||
"pni_all.n_of_total_connections":"{n} / {total} connessioni",
|
||||
"pni_all.n_of_total_pops":"{n} / {total} POP in comune",
|
||||
"pni_all.n_orders_with_net":{"one":"{n} ordine PNI effettuato con {net}. Invariati: {kept}; non disponibili: {blocked}.","other":"{n} ordini PNI effettuati con {net}. Invariati: {kept}; non disponibili: {blocked}."},
|
||||
"pni_all.new_and_upgrades":"Nuovi: {fresh} · Upgrade: {up}",
|
||||
"pni_all.no_shared_locations":"Nessun POP in comune disponibile.",
|
||||
"pni_all.no_shared_pops":"Non hai POP in comune con questa rete.",
|
||||
"pni_all.order_missing_and_upgrade_smaller":"Ordina i PNI mancanti e potenzia quelli più piccoli nei POP in comune. I PNI più grandi e gli ordini in attesa restano invariati. I POP non disponibili vengono saltati.",
|
||||
"pni_all.peer_all_networks":"Peering con tutte le reti su tutti i POP",
|
||||
"pni_all.peer_at_port":"Peering su tutti i POP · {port}",
|
||||
"pni_all.peer_on_all_pops":"Peering su tutti i POP",
|
||||
"pni_all.pni_size":"Capacità PNI",
|
||||
"pni_all.setup_total":"Costo totale di attivazione",
|
||||
"pni_all.traffic_charges_apply":"Si applicano anche costi di traffico di {price} per Gbps.",
|
||||
"pnis.a_new_region_is_coming_online":"Una nuova region arriverà presto. Arriva presto dal 2019.",
|
||||
"pnis.about_n_days_to_go_nothing":"Mancano circa {n} giorni. Non resta che aspettare, o sollecitare.",
|
||||
"pnis.augment_with_net_delivered_in_city":"<b>Ampliamento con {net} consegnato a {city}.</b><br>Ora {port}.",
|
||||
|
|
@ -3229,4 +3293,29 @@
|
|||
"tutorial.your_customers_want_the_whole":"I tuoi clienti vogliono tutta internet. Apri la scheda Transit e compra una porta da un carrier.",
|
||||
"tutorial.your_router_is_live_press_launch":"Il tuo router è acceso. Premi “Lancia la banda larga” per vendere internet alla gente della tua città.",
|
||||
"ui.n_d_left":"ancora {n}g",
|
||||
"utilities.apply_kit":"Applica il kit di ridondanza",
|
||||
"utilities.cache_moves":"Cache da spostare: {n} (bilanciate per fornitore)",
|
||||
"utilities.cache_note":"Richiedi una cache per ogni fornitore idoneo in ciascuna sede esistente. Le cache esistenti restano; i fornitori richiedono comunque traffico sufficiente.",
|
||||
"utilities.cache_ports":"Servono {need} porte router libere; disponibili: {free}. Nessuna richiesta finché non ci sarà spazio per tutte le cache.",
|
||||
"utilities.cache_quote":"{n} nuove cache · Hardware gratuito · Costo mensile aggiuntivo: {mo}",
|
||||
"utilities.caches_requested":"Installate {n} cache a {city}.",
|
||||
"utilities.ix_peering":"Peering IX su tutta la rete",
|
||||
"utilities.join_route_servers":"Unisciti a tutti i route server ({n})",
|
||||
"utilities.kit_applied":"Ridondanza aggiornata a {city}.",
|
||||
"utilities.kit_balanced":"Hardware installato e cache bilanciate.",
|
||||
"utilities.kit_cost":"Una tantum: {cost} · Costo mensile aggiuntivo: {mo}",
|
||||
"utilities.peer_counts":"{ready} idonei · {existing} esistenti · {blocked} non disponibili",
|
||||
"utilities.peering_note":"Richiedi i peer idonei in ogni IX a cui partecipi. Le sessioni esistenti, inclusi i peer del route server, vengono saltate. Rifiuti e soglie di traffico restano validi. Non vengono acquistate porte o PNI a pagamento.",
|
||||
"utilities.peers_requested":"Stabilite {n} nuove sessioni di peering IX.",
|
||||
"utilities.quote_changed":"Il preventivo è cambiato. Controlla il nuovo prezzo e riprova.",
|
||||
"utilities.redundancy_kit":"Kit di ridondanza del POP",
|
||||
"utilities.redundancy_note":"Le cache esistenti vengono bilanciate per fornitore. Distribuisci separatamente le connessioni IX, PNI e transit tra le sedi e verifica percorsi diversi e capacità di riserva dei router.",
|
||||
"utilities.request_all":"Richiedi tutti i peer idonei ({n})",
|
||||
"utilities.request_caches":"Richiedi le cache mancanti ({n})",
|
||||
"utilities.route_server_note":"I peer dei route server richiedono una politica di peering aperta. Le sessioni esistenti restano attive; non vengono acquistate porte.",
|
||||
"utilities.route_servers_joined":"Collegati {n} route server.",
|
||||
"utilities.second_site":"Seconda sede",
|
||||
"utilities.title":"Utilità",
|
||||
"utilities.two_routers":"Almeno due router",
|
||||
"utilities.view_pop":"Mostra POP",
|
||||
};
|
||||
|
|
|
|||
109
site/i18n/pt.js
109
site/i18n/pt.js
|
|
@ -12,6 +12,11 @@
|
|||
"action_helpers.too_far_even_at_its_slowest":"Longe demais até na configuração mais lenta: um span óptico aqui tem {span} km e ela alcança {max} km. Adicione um site de regeneração (Line system).",
|
||||
"action_helpers.unlocks_at_customer_level_n":"Desbloqueia no nível de cliente {n}.",
|
||||
"actions.your_router_can_t_take_a":"<b>Seu router não aguenta uma porta {port}.</b><br>Faça upgrade na aba Infra.",
|
||||
"automation.auto_accept_sales":"Vendas automáticas: {state}",
|
||||
"automation.auto_pay_repairs":"Reparações pagas auto: {state}",
|
||||
"automation.next_auto_check":"Tempo até à próxima verificação automática dos requisitos.",
|
||||
"automation.repairs_when_affordable":"Durante o jogo, paga automaticamente as reparações urgentes disponíveis quando há fundos suficientes.",
|
||||
"automation.sales_every_five_seconds":"A cada 5 segundos durante o jogo, aceita apenas ofertas com os requisitos cumpridos e capacidade de serviço disponível.",
|
||||
"badges.a_petabit_a_second":"Um petabit por segundo",
|
||||
"badges.a_secret_badge":"Um badge secreto",
|
||||
"badges.attend_a_conference":"Participe de uma conferência.",
|
||||
|
|
@ -697,6 +702,7 @@
|
|||
"city_panel.every_port_is_taken_add_a":"Todas as portas estão ocupadas. Adicione um router ou troque por um modelo com mais portas antes de plugar algo novo.",
|
||||
"city_panel.everything_is_in_one_building_move":"Está tudo num prédio só. Mova alguns uplinks para o outro site nas abas Transit e Peering.",
|
||||
"city_panel.fabrics_list":"Fabrics: {list}",
|
||||
"city_panel.few_data_centers_pops_x":"Poucos data centers: POPs {x}×",
|
||||
"city_panel.fiber_from_city":"Fibra de {city}",
|
||||
"city_panel.fiber_is_down":"a fibra caiu",
|
||||
"city_panel.g_of_circuits":"{g} de circuitos",
|
||||
|
|
@ -783,6 +789,7 @@
|
|||
"common.95th_percentile":"Percentil 95",
|
||||
"common.about_average":"na média",
|
||||
"common.accept":"Aceitar",
|
||||
"common.ack_flood":"Flood ACK",
|
||||
"common.ad_campaign":"Campanha!",
|
||||
"common.africa":"África",
|
||||
"common.all_cities":"Todas as cidades",
|
||||
|
|
@ -849,6 +856,7 @@
|
|||
"common.challenger":"desafiante",
|
||||
"common.change_freeze":"Change freeze",
|
||||
"common.chase_it":"Cobrar",
|
||||
"common.check_redundancy":"Verificar redundância",
|
||||
"common.china":"China",
|
||||
"common.city":"cidade",
|
||||
"common.city_906b":"Cidade",
|
||||
|
|
@ -873,10 +881,12 @@
|
|||
"common.controller_off":"controller desligado",
|
||||
"common.cooling_failure":"Falha na refrigeração",
|
||||
"common.copy":"Copiar",
|
||||
"common.cost":"Custo",
|
||||
"common.costs":"Custos",
|
||||
"common.courtesy_route":"Rota de cortesia",
|
||||
"common.crashes_more":"trava mais",
|
||||
"common.credit_rating":"Rating de crédito",
|
||||
"common.custom":"Personalizada",
|
||||
"common.customer":"Cliente",
|
||||
"common.customer_care":"Cuidado com o cliente",
|
||||
"common.customer_levels":"Níveis de clientes",
|
||||
|
|
@ -903,6 +913,7 @@
|
|||
"common.demand":"Demanda",
|
||||
"common.deploy":"Deploy",
|
||||
"common.deployed":"em produção",
|
||||
"common.distributed_ingress":"Entrada distribuída",
|
||||
"common.diverse":"diverso",
|
||||
"common.diverse_route":"rota diversa",
|
||||
"common.dns_reflection":"reflexão DNS",
|
||||
|
|
@ -1060,6 +1071,7 @@
|
|||
"common.may":"mai",
|
||||
"common.member":"− membro",
|
||||
"common.member_fef5":"Membro",
|
||||
"common.memcached_amplification":"Amplificação Memcached",
|
||||
"common.merchant_silicon":"merchant silicon",
|
||||
"common.mercury":"Mercúrio",
|
||||
"common.metaverse_platform":"Plataforma de metaverso",
|
||||
|
|
@ -1072,6 +1084,7 @@
|
|||
"common.more_scenarios":"Mais cenários",
|
||||
"common.ms_ms_one_way":"{ms} ms só ida",
|
||||
"common.mtu_mismatch":"Mismatch de MTU",
|
||||
"common.multiplier":"Multiplicador",
|
||||
"common.mystery_link":"Link misterioso",
|
||||
"common.n_box":{"one":"{n} caixa","other":"{n} caixas"},
|
||||
"common.n_days_left":"faltam {n} dias",
|
||||
|
|
@ -1161,6 +1174,7 @@
|
|||
"common.price_lock":"Congelamento de preços",
|
||||
"common.price_mo":"{price}/mês",
|
||||
"common.provisioning_n_d_grace":"em ativação, {n}d de carência",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Ranking",
|
||||
"common.rare":"Raro",
|
||||
"common.reach":"Alcance",
|
||||
|
|
@ -1170,6 +1184,7 @@
|
|||
"common.really_leave":"Sair mesmo?",
|
||||
"common.really_remove":"Remover mesmo?",
|
||||
"common.redundancy":"Redundância",
|
||||
"common.redundancy_check":"Teste de redundância",
|
||||
"common.regen_site":"− Site de regeneração",
|
||||
"common.regen_sites":"Sites de regeneração",
|
||||
"common.regional_player":"Player regional",
|
||||
|
|
@ -1227,6 +1242,8 @@
|
|||
"common.sep":"set",
|
||||
"common.serious_backbone":"Backbone de respeito",
|
||||
"common.serve_as_much_traffic_as_you":"Sirva o máximo de tráfego que conseguir em um ano.",
|
||||
"common.service_affected":"Serviço afetado",
|
||||
"common.set":"Aplicar",
|
||||
"common.settings":"Configurações",
|
||||
"common.share":"Compartilhar",
|
||||
"common.share_2cd9":"Compartilhar…",
|
||||
|
|
@ -1272,6 +1289,7 @@
|
|||
"common.subsea_cables":"Cabos submarinos",
|
||||
"common.supply_chain":"Cadeia de suprimentos",
|
||||
"common.syn_flood":"flood SYN",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestre",
|
||||
"common.terrestrial_19e4":"Terrestre",
|
||||
"common.terrestrial_fiber":"Fibra terrestre",
|
||||
|
|
@ -1403,6 +1421,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>Primeiro você precisa de um POP em cada cidade do contrato.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} a mais por {d} dias, {when} · paga {fee} no final",
|
||||
"customers_and_events.day_n_of_d":"dia {n} de {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Gaming atrai ataques",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} pares de fibra na sua vala {a}–{b}. Cavar foi a parte cara, então eles querem todos",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sites: {list} · {bw} por site · {price}/mês",
|
||||
"customers_and_events.name_at_site":"{name} em {site}",
|
||||
|
|
@ -1619,6 +1638,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"Um barco de arrasto ao largo de Ostende arrastou as redes bem em cima do seu cabo {a}–{b}. O Mar do Norte tem uns trinta metros de profundidade e é cheio de barcos.",
|
||||
"failures.a_visiting_engineer_from_london":"Um engenheiro de Londres em visita levou Marmite para o NOC de {city}. As relações diplomáticas caíram, e seu roteador também, enquanto todo mundo discutia.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"Um navio de serviço de um parque eólico jogou âncora no seu cabo {a}–{b}. Ele estava lá para consertar uma turbina.",
|
||||
"failures.across_n_transit_and_peering_ports":", por {n} portas de transit e peering",
|
||||
"failures.all_n_links_in_that_trench":"Todos os {n} links daquela vala caíram junto.",
|
||||
"failures.an_automation_script_in_city_ran":"Um script de automação em {city} rodou “sed” na config inteira em vez de uma linha. Toda interface agora se chama “TODO”.",
|
||||
"failures.an_earthquake_shook_your_a_b":"Um terremoto soltou sua fibra {a}–{b} em algum ponto acima de 4.000 metros.",
|
||||
|
|
@ -1983,13 +2003,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"Um segundo bissexto convenceu um dos seus routers de que estamos em 1970. O uptime agora marca menos 56 anos. O tráfego está ótimo.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"Uma rota que você retirou no Ano 1 ainda aparece em algum lugar da internet. Ninguém sabe onde. Tudo bem. Provavelmente.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"Uma reunião de duas horas sobre hostnames de routers terminou com votação em “router-final-v2-NOVO”.",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"Após o scrubbing upstream: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"Um auditor pediu um diagrama da rede. Você mandou o mapa do jogo. Ele aprovou.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Ataque totalmente mitigado",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Blackhole no alvo (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Em blackhole: o lixo sumiu, e {city} também. O ataque conseguiu o que queria.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contido no seu PNI sacrificial com {net}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec não pega um {vec} (camada de aplicação)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"O Flowspec no seu {model} está descartando {vec} na borda",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"O Flowspec no seu {model} reduz {vec}, mas a TCAM é pequena",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Filtros de borda descartando: {g}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec não consegue filtrar {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec descarta {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec descarta {g}; alguns roteadores de entrada não têm TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} estão passando",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"Foi o DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"Blackhole IX <small>~metade respeita</small>",
|
||||
|
|
@ -2000,29 +2024,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Erro de digitação estrutural",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"A gerência decretou um change freeze. Alguém fez uma change para anunciar o change freeze.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"LAG de transit {name} em {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} está limpando upstream (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"Sem filtragem Flowspec: os roteadores de entrada não têm TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"Sem centro de scrubbing",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"Scrubbing desnecessário após a mitigação na borda",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"Scrubbing on-demand desviando, ativo em {n}d",
|
||||
"incidents_and_ddos.open_to_work":"Open to work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"LAG de PNI com {name} em {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Chegando na sua rede: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"RTBH é grátis e instantâneo, mas descarta tudo que vai para a vítima, ataque e cliente juntos. Um blackhole no IX mantém o cliente no ar, mas só cerca de metade dos membros respeita. O HackBack 3000™ da Skynot AI às vezes resolve, e às vezes derruba um inocente e te rende uma multa.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Centros de scrubbing indisponíveis ou lotados",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing em {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Tráfego de scrubbing levado pelo seu backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · faltam {n}d",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Alguém apagou o registro DNS da wiki interna. O runbook para consertar DNS estava na wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Alguém chamou uma VLAN de “prodcution”. Agora ela é estrutural e nunca mais pode ser renomeada.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"O certificado TLS do dashboard do NOC expirou. Ninguém consegue ver gráfico nenhum, então tecnicamente não há problemas.",
|
||||
"incidents_and_ddos.this_attack_g":"Este ataque: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket da semana",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"O scrubbing {tier} em {city} está limpando, levado pelo seu backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"O scrubbing {tier} em {city} está limpando",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"O suporte do fabricante pediu para você “desligar e ligar de novo”. O router que você já tinha reiniciado. Ticket fechado.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"Você achou no inventário um link de 10G que ninguém pediu, ninguém paga e que carrega 3 Gbps de alguma coisa.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Seu backbone só consegue levar {g} até {city}: o resto não é limpo",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Sua planilha de endereços IP chegou a 1.048.576 linhas. O Excel tem opiniões.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Seu tráfego IPv6 cresceu 400%. De um pacote para cinco.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Seu {model} aqui não tem TCAM para Flowspec",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Seu sistema de monitoramento caiu. Você descobriu porque nenhum alarme tocou. Semana bem tranquila.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Seu peering coordinator atualizou o perfil para “open to work”. Três Tier 1 de repente querem bater um papo. Nada aconteceu, mas foi bom.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Seus centros de scrubbing estão cheios: {g} passam direto",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"O suporte do seu upstream toca os mesmos 11 segundos de música de espera. Seu plantonista já cantarola em quatro tons.",
|
||||
"install.before_you_start":"Antes de começar",
|
||||
"install.best_played_as_an_app":"Melhor jogar como app",
|
||||
|
|
@ -2104,9 +2128,12 @@
|
|||
"link_modal.you_already_have_n_link_here":{"one":"Você já tem {n} link aqui ({list}). Links paralelos somam capacidade. Como este deve ser roteado?","other":"Você já tem {n} links aqui ({list}). Links paralelos somam capacidade. Como este deve ser roteado?"},
|
||||
"link_panels.a_bigger_fabric_carries_more_traffic":"Um fabric maior carrega mais tráfego e tem espaço para mais membros. Seu router aqui ainda precisa dar conta.",
|
||||
"link_panels.a_link_on_standby_carries_traffic":"Um link de reserva só leva tráfego quando os outros links entre estas cidades estão cheios ou fora do ar.",
|
||||
"link_panels.a_link_s_cost_is_its":"O custo de um link é seu comprimento em km mais 60, vezes um multiplicador. O tráfego segue o caminho de menor custo total.",
|
||||
"link_panels.a_regen_site_turns_the_light":"Um site de regeneração transforma a luz de volta em bits no meio do caminho e a reenvia novinha, então as ópticas só precisam alcançar o próximo site. Cada um precisa de uma placa de regeneração para cada canal aceso. {price}/mês por site pelo abrigo.",
|
||||
"link_panels.abandon_the_fiber":"Abandonar a fibra",
|
||||
"link_panels.add_parallel_link":"Adicionar link paralelo",
|
||||
"link_panels.additional_traffic_lost":"Tráfego perdido a mais",
|
||||
"link_panels.an_alternate_path_exists_but_current":"Existe um caminho alternativo, mas com o roteamento e a capacidade atuais chega menos tráfego.",
|
||||
"link_panels.apply_for_a_license_price_mo":"Pedir licença <small>{price} + {mo}/mês · ~45 dias</small>",
|
||||
"link_panels.back_in_n_days":"Volta em {n} dias.",
|
||||
"link_panels.behind_the_great_firewall":"Atrás do Great Firewall",
|
||||
|
|
@ -2117,6 +2144,9 @@
|
|||
"link_panels.click_to_tear_down":"Clique para encerrar",
|
||||
"link_panels.collecting_data_check_back_in_a":"Coletando dados. Volte em alguns dias.",
|
||||
"link_panels.congested_upgrade_it_or_add_a":"Congestionado. Faça upgrade ou adicione um caminho paralelo.",
|
||||
"link_panels.connected_but_tight":"Conectado, mas no limite.",
|
||||
"link_panels.cost_on_this_link_w_allowed":"Custo neste link: {w}. Permitido: de {lo} a {hi}.",
|
||||
"link_panels.cost_the_exact_number_whatever_the":"Custo: o número exato, seja qual for a distância.",
|
||||
"link_panels.dark_fiber_kind_km_km":"Dark fiber · {kind} · {km} km",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of":"Preço personalizado DE-KICKS: {p}% do que um IX normal cobraria (promo, faltam {n} dias).",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of_3d4f":"Preço personalizado DE-KICKS: {p}% do que um IX normal cobraria.",
|
||||
|
|
@ -2125,6 +2155,7 @@
|
|||
"link_panels.finish_in_1_day_price":"Concluir em 1 dia <small>{price}</small>",
|
||||
"link_panels.foreign_networks_need_a_local_joint":"Redes estrangeiras precisam de uma joint venture local e de uma licença de operação para construir infraestrutura aqui.",
|
||||
"link_panels.found_your_own_ix_cost_mo":"Fundar seu próprio IX <small>{cost} + {mo}/mês</small>",
|
||||
"link_panels.full_links_during_the_test":"Links lotados durante o teste",
|
||||
"link_panels.g_to_km_km":"{g} até {km} km",
|
||||
"link_panels.giving_it_up_now_returns_price":"Desistir agora devolve {price}.",
|
||||
"link_panels.going_to_customers_in":"Indo para clientes em",
|
||||
|
|
@ -2139,6 +2170,7 @@
|
|||
"link_panels.lost_on_the_way":"Perdido no caminho",
|
||||
"link_panels.mainland_china_plays_by_its_own":"A China continental joga com regras próprias. {list} e outros serviços estrangeiros são bloqueados aqui, então os usuários acessam principalmente redes chinesas. O tráfego que cruza a fronteira perde cerca de {pct} com filtragem e congestionamento, a menos que vá por uma rota premium: transit CN-Too ou um circuito transfronteiriço premium (ambos vendidos só em Hong Kong), ou um PNI com uma rede chinesa. A receita por usuário aqui é menor.",
|
||||
"link_panels.members_paying_you":"Membros pagantes",
|
||||
"link_panels.multiplier_scales_the_distance_cost":"Multiplicador: multiplica o custo da distância, então um link mais longo continua custando mais.",
|
||||
"link_panels.n_amp_huts":"{n} abrigos de amplificador",
|
||||
"link_panels.n_amplifiers":"{n} amplificadores",
|
||||
"link_panels.n_exchanges_compete_in_city_members":"{n} exchanges competem em {city}. Os membros se sobrepõem, mas não totalmente, e os desafiantes cobram menos que o incumbente. Redes pequenas costumam ficar em só um deles.",
|
||||
|
|
@ -2157,6 +2189,7 @@
|
|||
"link_panels.needs_a_pop_in_cities_too":"Requer um POP em {cities} também.",
|
||||
"link_panels.needs_what":"requer {what}",
|
||||
"link_panels.needs_your_own_scrubbing_center":"Requer seu próprio centro de scrubbing (aba Infra).",
|
||||
"link_panels.no_alternate_backbone_path_connects":"Se este link cair, nenhum caminho alternativo do backbone liga estas pontas.",
|
||||
"link_panels.no_regen_sites_in_the_middle":"Sem sites de regeneração no meio do oceano: cabos longos rodam os ópticos em modo long-haul.",
|
||||
"link_panels.no_traffic_right_now":"Sem tráfego no momento.",
|
||||
"link_panels.not_in_your_cities_yet_nearest":"Ainda não está nas suas cidades. A mais próxima: {city}",
|
||||
|
|
@ -2166,6 +2199,7 @@
|
|||
"link_panels.on_standby_but_carrying_the_traffic":"De reserva, mas levando o tráfego: nenhum link ativo entre estas cidades está no ar.",
|
||||
"link_panels.on_standby_idle_while_the_other":"De reserva: ocioso enquanto os outros links entre estas cidades tiverem espaço.",
|
||||
"link_panels.on_standby_taking_the_overflow":"De reserva: levando o excedente, porque os outros links entre estas cidades estão cheios.",
|
||||
"link_panels.one_backhoe_is_not_enough":"Uma retroescavadeira não basta.",
|
||||
"link_panels.open_peer_but_not_on_any":"Peer aberto, mas em nenhum IX onde você tem POP. O mais próximo: {city}",
|
||||
"link_panels.open_peer_but_not_on_any_bfbb":"Peer aberto, mas em nenhum IX onde você tem POP",
|
||||
"link_panels.open_peer_join_the_route_server":"Peer aberto: entre no route server do {ix}",
|
||||
|
|
@ -2182,6 +2216,7 @@
|
|||
"link_panels.port_port_price_on_request":"Porta {port} <small>Preço sob consulta ☎</small>",
|
||||
"link_panels.ports_at_p_of_the_usual":"Portas a {p}% do preço normal.",
|
||||
"link_panels.ports_up_to_port_are_free":"Portas até {port} são grátis.",
|
||||
"link_panels.presets_on_this_link_list":"Predefinições neste link: {list}.",
|
||||
"link_panels.price_n_days":"{price} · {n} dias",
|
||||
"link_panels.put_this_link_on_standby":"Deixar este link de reserva",
|
||||
"link_panels.ready_for_a_pni_in_city":"Pronto para um PNI em {city}",
|
||||
|
|
@ -2200,6 +2235,7 @@
|
|||
"link_panels.sell_one_price":"Vender um <small>{price}</small>",
|
||||
"link_panels.selling_spare_capacity":"Vender capacidade ociosa",
|
||||
"link_panels.shares_a_trench_with_n_other":{"one":"Divide a vala com {n} outro link. Um corte derruba todos.","other":"Divide a vala com outros {n} links. Um corte derruba todos."},
|
||||
"link_panels.snapshot_only_one_selected_link":"Só um retrato: cai apenas o link escolhido. Os outros links no mesmo cabo, vala ou fabric continuam no ar. Falhas e regras de roteamento atuais continuam valendo. Tempo, dinheiro e partida não mudam.",
|
||||
"link_panels.spare_optics_and_amplifier_cards_on":"Ópticas e placas de amplificador de reserva na prateleira transformam falhas de hardware de vários dias em trocas de um dia.",
|
||||
"link_panels.spare_price":"reserva + {price}",
|
||||
"link_panels.spares_bought_now_are_already_paid":"Sobressalentes comprados agora já estão pagos quando vier a próxima falta.",
|
||||
|
|
@ -2209,6 +2245,7 @@
|
|||
"link_panels.take_it_off_standby":"Tirar da reserva",
|
||||
"link_panels.there_s_no_ix_in_city":"Ainda não há IX em {city}. Funde um: as redes entram com o tempo, pagam pelas portas e fazem peering com você de graça.",
|
||||
"link_panels.they_need_the_full_internet_your":"Eles querem a internet inteira. Seu alcance é de {pct}.",
|
||||
"link_panels.this_backhoe_wins":"Esta retroescavadeira vence.",
|
||||
"link_panels.this_fiber_is_dark_add_optics":"Esta fibra está apagada. Adicione ópticas abaixo para levar tráfego.",
|
||||
"link_panels.this_is_the_only_link_between":"É o único link entre essas cidades. Adicione um paralelo, ou um caminho passando por outra cidade.",
|
||||
"link_panels.tier_1_only_a_pni_and":"Tier 1: só PNI, e só quando você for grande o bastante para o clube dos Tier 1",
|
||||
|
|
@ -2218,13 +2255,15 @@
|
|||
"link_panels.upgrade_to_sys_price":"Atualizar para {sys} <small>{price}</small>",
|
||||
"link_panels.via_a_capacity_broker":"por um corretor de capacidade",
|
||||
"link_panels.virtual_circuit_name_km_km":"Circuito virtual · {name} · {km} km",
|
||||
"link_panels.what_happens_if_this_link_fails":"O que acontece se este link cair agora?",
|
||||
"link_panels.what_s_on_this_link":"O que passa neste link",
|
||||
"link_panels.will_peer_at_ix_request_a":"Faz peering no {ix}: peça uma sessão",
|
||||
"link_panels.with_current_demand_and_routing_this":"Com a demanda e o roteamento atuais, este link pode cair sem perder mais tráfego.",
|
||||
"link_panels.you_can_pre_install_optics_now":"Você já pode pré-instalar as ópticas, para ela acender no dia em que ficar pronta.",
|
||||
"link_panels.your_joint_venture_holds_an":"Sua joint venture tem uma licença de operação.",
|
||||
"link_panels.your_own_build":"construção própria",
|
||||
"link_panels.your_own_fabric_name":"Seu próprio fabric · {name}",
|
||||
"link_panels.your_routers_pick_the_lowest_cost":"Seus routers escolhem o caminho de menor custo. Aumente a métrica para empurrar o tráfego para outros caminhos. “Só backup” deixa o link ocioso a menos que nada mais funcione. Vale para todos os links entre essas duas cidades.",
|
||||
"link_panels.your_routers_pick_the_lowest_cost_0160":"Seus routers escolhem o caminho de menor custo. Aumente a métrica para empurrar o tráfego para outros caminhos. “Só backup” deixa o link ocioso a menos que nada mais funcione. Escolha Personalizada para definir seu próprio multiplicador ou custo. Vale para todos os links entre essas duas cidades.",
|
||||
"link_panels.your_traffic_crossing_the_border":"Seu tráfego cruzando a fronteira",
|
||||
"link_panels.your_wave_was_sold_before_the":"Sua wave foi vendida antes de o dono do cabo reprojetá-lo, então continua funcionando.",
|
||||
"links.a_fab_fabric_unlocks_at_customer":"<b>Um fabric {fab} desbloqueia no nível de cliente {lv}.</b>",
|
||||
|
|
@ -2492,6 +2531,10 @@
|
|||
"notifications.n_min_ago":{"one":"há {n} min","other":"há {n} min"},
|
||||
"notifications.nothing_in_the_last_10_minutes":"Nada nos últimos 10 minutos.",
|
||||
"notifications.show_all_n":"Mostrar todas as {n}",
|
||||
"optic_counts.apply_price":"Aplicar · {price}",
|
||||
"optic_counts.count_for_model":"Número de canais {model}",
|
||||
"optic_counts.only_n_channels_free":"Só há {n} canais livres nesta fibra.",
|
||||
"optic_counts.target_count":"Quantidade desejada",
|
||||
"own_cable.a_and_b":"{a} e {b}",
|
||||
"own_cable.a_fishing_fleet_is_trawling_exactly":"Uma frota pesqueira está arrastando redes bem onde você precisa lançar.",
|
||||
"own_cable.a_leased_wave_wave_on_this":"Uma wave de {wave} alugada nesta rota custa {price}/mês.",
|
||||
|
|
@ -2604,6 +2647,27 @@
|
|||
"peering_policy.tried_a_remote_peer_once_it":"Tentaram um peer remoto uma vez. Ele flapou durante um lançamento de produto. Nunca mais.",
|
||||
"pitcairn.uk_grant_mo":"Subsídio do Reino Unido {mo}/mês",
|
||||
"pitcairn.uk_grant_mo_once_islanders":"Subsídio do Reino Unido {mo}/mês quando os ilhéus estiverem online",
|
||||
"pni_all.additional_per_month":"Custo mensal adicional",
|
||||
"pni_all.all_at_port":"Peering com todas as redes · {port}",
|
||||
"pni_all.delivery_and_traffic_charges":"Os prazos de entrega variam conforme a rede. Também se aplicam custos de peering baseados no tráfego, quando exigidos.",
|
||||
"pni_all.n_at_their_minimum_size":{"one":"{n} pedido sobe para o menor PNI que essa rede aceita.","other":"{n} pedidos sobem para o menor PNI que essas redes aceitam."},
|
||||
"pni_all.n_blocked_connections":{"one":"{n} ligação indisponível","other":"{n} ligações indisponíveis"},
|
||||
"pni_all.n_blocked_pops":{"one":"{n} POP indisponível","other":"{n} POPs indisponíveis"},
|
||||
"pni_all.n_existing_or_pending_unchanged":{"one":"{n} PNI existente ou pedido pendente permanece inalterado.","other":"{n} PNIs existentes ou pedidos pendentes permanecem inalterados."},
|
||||
"pni_all.n_networks":{"one":"{n} rede","other":"{n} redes"},
|
||||
"pni_all.n_of_total_connections":"{n} / {total} ligações",
|
||||
"pni_all.n_of_total_pops":"{n} / {total} POPs em comum",
|
||||
"pni_all.n_orders_with_net":{"one":"{n} pedido de PNI feito com {net}. Inalterados: {kept}; indisponíveis: {blocked}.","other":"{n} pedidos de PNI feitos com {net}. Inalterados: {kept}; indisponíveis: {blocked}."},
|
||||
"pni_all.new_and_upgrades":"Novos: {fresh} · Upgrades: {up}",
|
||||
"pni_all.no_shared_locations":"Não há POPs em comum disponíveis.",
|
||||
"pni_all.no_shared_pops":"Não tens POPs em comum com esta rede.",
|
||||
"pni_all.order_missing_and_upgrade_smaller":"Pede os PNIs em falta e aumenta os mais pequenos nos POPs em comum. Os PNIs maiores e os pedidos pendentes ficam inalterados. Os POPs indisponíveis são ignorados.",
|
||||
"pni_all.peer_all_networks":"Peering com todas as redes em todos os POPs",
|
||||
"pni_all.peer_at_port":"Peering em todos os POPs · {port}",
|
||||
"pni_all.peer_on_all_pops":"Peering em todos os POPs",
|
||||
"pni_all.pni_size":"Capacidade do PNI",
|
||||
"pni_all.setup_total":"Custo total de instalação",
|
||||
"pni_all.traffic_charges_apply":"Também se aplicam custos de tráfego de {price} por Gbps.",
|
||||
"pnis.a_new_region_is_coming_online":"Uma nova região vai entrar no ar em breve. Ela está entrando no ar em breve desde 2019.",
|
||||
"pnis.about_n_days_to_go_nothing":"Faltam cerca de {n} dias. Não há nada a fazer além de esperar, ou cobrar.",
|
||||
"pnis.augment_with_net_delivered_in_city":"<b>Ampliação com {net} entregue em {city}.</b><br>Agora {port}.",
|
||||
|
|
@ -3229,4 +3293,29 @@
|
|||
"tutorial.your_customers_want_the_whole":"Seus clientes querem a internet inteira. Abra a aba Transit e compre uma porta de uma operadora.",
|
||||
"tutorial.your_router_is_live_press_launch":"Seu router está no ar. Aperte “Lançar banda larga” para vender internet ao pessoal da sua cidade.",
|
||||
"ui.n_d_left":"faltam {n}d",
|
||||
"utilities.apply_kit":"Aplicar kit de redundância",
|
||||
"utilities.cache_moves":"Caches a mover: {n} (equilibradas por fornecedor)",
|
||||
"utilities.cache_note":"Solicita uma cache por fornecedor elegível em cada local existente. As caches existentes são mantidas; os fornecedores continuam a exigir tráfego suficiente.",
|
||||
"utilities.cache_ports":"São necessárias {need} portas livres no router; disponíveis: {free}. Nada é solicitado até haver espaço para todas.",
|
||||
"utilities.cache_quote":"{n} novas caches · Hardware gratuito · Custo mensal adicional: {mo}",
|
||||
"utilities.caches_requested":"Instaladas {n} caches em {city}.",
|
||||
"utilities.ix_peering":"Peering IX em toda a rede",
|
||||
"utilities.join_route_servers":"Aderir a todos os route servers ({n})",
|
||||
"utilities.kit_applied":"Redundância atualizada em {city}.",
|
||||
"utilities.kit_balanced":"Hardware instalado e caches equilibradas.",
|
||||
"utilities.kit_cost":"Custo único: {cost} · Custo mensal adicional: {mo}",
|
||||
"utilities.peer_counts":"{ready} elegíveis · {existing} existentes · {blocked} indisponíveis",
|
||||
"utilities.peering_note":"Solicita peers elegíveis em todos os IX a que aderiste. As sessões existentes, incluindo peers do route server, são ignoradas. Recusas e limites de tráfego continuam a aplicar-se. Não são compradas portas nem PNI pagos.",
|
||||
"utilities.peers_requested":"Estabelecidas {n} novas sessões de peering IX.",
|
||||
"utilities.quote_changed":"O orçamento mudou. Verifica o novo preço e tenta novamente.",
|
||||
"utilities.redundancy_kit":"Kit de redundância do POP",
|
||||
"utilities.redundancy_note":"As caches existentes são equilibradas por fornecedor. Distribui separadamente as ligações IX, PNI e transit pelos locais e verifica ligações diversas e capacidade de reserva dos routers.",
|
||||
"utilities.request_all":"Solicitar todos os peers elegíveis ({n})",
|
||||
"utilities.request_caches":"Solicitar caches em falta ({n})",
|
||||
"utilities.route_server_note":"Os peers dos route servers exigem uma política de peering aberta. As sessões existentes continuam ativas; não são compradas portas.",
|
||||
"utilities.route_servers_joined":"Adesão a {n} route servers concluída.",
|
||||
"utilities.second_site":"Segundo local",
|
||||
"utilities.title":"Utilitários",
|
||||
"utilities.two_routers":"Pelo menos dois routers",
|
||||
"utilities.view_pop":"Ver POP",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const SITE2_N=[tr('economy.the_other_building'),tr('economy.campus_b_the_one_wit
|
|||
const siteNo=(name,n)=>name.replace('#',1+((S&&S.asn)|0)%(n||1));
|
||||
const siteName=(c,s)=>s==='b'?CITY[c].dc2?siteNo(CITY[c].dc2,CITY[c].dc2N):SITE2_N[hstr(c)%SITE2_N.length]:siteNo(CITY[c].dc,CITY[c].dcN);
|
||||
const BE_TAPE=30000;
|
||||
const popCost=c=>POP_COST+(c&&CITY[c]&&CITY[c].tape?BE_TAPE:0)+(c&&CITY[c]&&CITY[c].ru?RU_BOX:0)+(c&&CITY[c]&&CITY[c].uae?UAE_LIC:0)+(c&&CITY[c]&&CITY[c].saudi?KSA_LIC:0);
|
||||
const popCost=c=>Math.round(POP_COST*colo(c))+(c&&CITY[c]&&CITY[c].tape?BE_TAPE:0)+(c&&CITY[c]&&CITY[c].ru?RU_BOX:0)+(c&&CITY[c]&&CITY[c].uae?UAE_LIC:0)+(c&&CITY[c]&&CITY[c].saudi?KSA_LIC:0);
|
||||
const CN_LIC=150000, CN_JV_MO=6000;
|
||||
// Scrubbing centers come in tiers by clean bandwidth. Always-on diverts instantly; on-demand is cheaper
|
||||
// but takes a couple of days to engage. A clean-pipe add-on on a transit scrubs upstream, per port.
|
||||
|
|
@ -38,9 +38,13 @@ const FS_RES=[1,0.4,0.15];
|
|||
const DDOS_VEC={
|
||||
dns:{n:tr('common.dns_reflection'),fs:true},
|
||||
ntp:{n:tr('common.ntp_amplification'),fs:true},
|
||||
memcached:{n:tr('common.memcached_amplification'),fs:true},
|
||||
ack:{n:tr('common.ack_flood'),fs:false},
|
||||
cldap:{n:tr('common.cldap_flood'),fs:true},
|
||||
syn:{n:tr('common.syn_flood'),fs:true},
|
||||
http:{n:tr('common.http_flood'),fs:false},
|
||||
racknet:{n:tr('common.racknet'),fs:false,gaming:true},
|
||||
teamspooked:{n:tr('common.teamspooked'),fs:false,gaming:true},
|
||||
};
|
||||
const MYIX_COST=80000, MYIX_MO=3000, MYIX_FEE=1500, START_CASH=200000;
|
||||
// Your own exchange's switching fabric. Bigger fabrics carry more and attract more members.
|
||||
|
|
|
|||
|
|
@ -35,7 +35,14 @@ const NNI=[{n:'10G',g:10,mo:500},{n:'100G',g:100,mo:1200}];
|
|||
const VXC=[{n:'10G',g:10,m:1},{n:'50G',g:50,m:2.4},{n:'100G',g:100,m:3.6}];
|
||||
const vxcMo=(km,sub,t)=>Math.round((150+km*0.12)*VXC[t].m*(sub?2:1));
|
||||
const MET={prefer:{l:tr('common.prefer'),f:0.5},normal:{l:tr('common.normal'),f:1},avoid:{l:tr('common.avoid'),f:4},backup:{l:tr('common.backup_only'),f:60}};
|
||||
// Custom metrics: a multiplier on the distance cost (f) or an absolute IGP cost (w), capped like an OSPF metric.
|
||||
const MET_LIM={f:[0.1,100],w:[1,65535]};
|
||||
const clampM=(k,v)=>{const [lo,hi]=MET_LIM[k];v=Math.min(hi,Math.max(lo,v));return k==='w'?Math.round(v):Math.round(v*100)/100;};
|
||||
const PREF={high:tr('common.prefer'),normal:tr('common.normal'),low:tr('common.backup_only')};
|
||||
const edgeKey=l=>l.a<l.b?l.a+'|'+l.b:l.b+'|'+l.a;
|
||||
// The routing metric of a city pair (edgeKey), set for every link between the two cities.
|
||||
function pairMet(k){return (S.pairMet&&S.pairMet[k])||'normal';}
|
||||
// A custom metric is stored as {k:'f'|'w',v}: a multiplier, or an exact cost whatever the distance.
|
||||
function pairMet(k){const m=S.pairMet&&S.pairMet[k];return m?(typeof m==='object'?'custom':m):'normal';}
|
||||
function pairCm(k){const m=S.pairMet&&S.pairMet[k];return m&&typeof m==='object'?m:null;}
|
||||
// The cost of one link of km on the pair k, as Dijkstra sees it.
|
||||
function pairW(k,km){const m=S.pairMet&&S.pairMet[k];return m&&typeof m==='object'?(m.k==='w'?m.v:(km+60)*m.v):(km+60)*MET[m||'normal'].f;}
|
||||
|
|
|
|||
196
src/game/20-world/55-city-pdb.js
Normal file
196
src/game/20-world/55-city-pdb.js
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
/* Real-world calibration, pulled 2026-10-25 (Pacific islands 2026-10-26). Per city: [carrier-neutral facilities, network presences across them,
|
||||
ASNs registered in its country]. Facilities and presences are PeeringDB facilities within 50 km or in the same city
|
||||
(peeringdb.com/api/fac, net_count summed); ASNs per country are from bgp.he.net/report/world.
|
||||
A city missing here keeps the plain regional price. One entry per line, sorted by id. */
|
||||
const CITY_PDB={
|
||||
abj:[5,11,32],
|
||||
acc:[7,78,124],
|
||||
add:[2,3,10],
|
||||
aju:[4,3,9693],
|
||||
akl:[27,398,755],
|
||||
alg:[0,0,16],
|
||||
ams:[69,2731,1827],
|
||||
apw:[0,0,11],
|
||||
ash:[86,1010,33300],
|
||||
asu:[3,8,124],
|
||||
ath:[6,108,307],
|
||||
atn:[42,589,33300],
|
||||
auh:[4,1,231],
|
||||
bcn:[13,159,1341],
|
||||
bde:[0,0,4027],
|
||||
beg:[7,49,227],
|
||||
bel:[3,7,9693],
|
||||
ber:[22,351,3705],
|
||||
bet:[16,174,152],
|
||||
bhz:[13,40,9693],
|
||||
bkk:[32,397,675],
|
||||
blr:[14,104,6412],
|
||||
bne:[21,277,3196],
|
||||
bog:[16,195,598],
|
||||
bom:[59,1050,6412],
|
||||
bos:[31,209,33300],
|
||||
bru:[33,328,443],
|
||||
bsb:[14,108,9693],
|
||||
bud:[6,146,369],
|
||||
bue:[28,372,1357],
|
||||
buh:[23,289,1424],
|
||||
bvb:[3,6,9693],
|
||||
cac:[4,6,9693],
|
||||
cai:[5,28,97],
|
||||
cal:[15,127,2595],
|
||||
cas:[2,2,39],
|
||||
cau:[2,2,9693],
|
||||
cbo:[1,0,33],
|
||||
ccs:[6,32,296],
|
||||
cgb:[4,5,9693],
|
||||
cgr:[4,4,9693],
|
||||
chi:[64,809,33300],
|
||||
cor:[2,29,1357],
|
||||
cph:[30,290,529],
|
||||
cpq:[19,65,9693],
|
||||
cpt:[6,267,879],
|
||||
cpv:[4,12,9693],
|
||||
cwb:[11,79,9693],
|
||||
cxj:[2,3,9693],
|
||||
dac:[30,107,2105],
|
||||
dal:[59,969,33300],
|
||||
dar:[9,67,124],
|
||||
del:[31,479,6412],
|
||||
den:[28,310,33300],
|
||||
dkr:[2,4,23],
|
||||
dla:[3,14,34],
|
||||
doh:[6,29,31],
|
||||
drw:[3,15,3196],
|
||||
dub:[21,277,350],
|
||||
dur:[4,137,879],
|
||||
dxb:[8,135,231],
|
||||
edi:[4,46,4027],
|
||||
fec:[5,4,9693],
|
||||
fih:[7,19,57],
|
||||
fln:[5,23,9693],
|
||||
for:[16,362,9693],
|
||||
fra:[56,2450,3705],
|
||||
fuj:[1,49,231],
|
||||
gbe:[1,2,39],
|
||||
gdl:[4,22,814],
|
||||
gua:[5,16,103],
|
||||
gum:[6,28,11],
|
||||
gyn:[5,28,9693],
|
||||
ham:[26,228,3705],
|
||||
hel:[23,232,427],
|
||||
hir:[1,0,11],
|
||||
hkg:[57,1107,1514],
|
||||
hnl:[7,33,33300],
|
||||
hou:[21,173,33300],
|
||||
hre:[1,0,37],
|
||||
hyd:[17,152,6412],
|
||||
icn:[37,201,1197],
|
||||
igu:[5,26,124],
|
||||
ist:[28,334,1290],
|
||||
jed:[5,25,220],
|
||||
jib:[3,19,5],
|
||||
jkt:[98,3015,4108],
|
||||
jnb:[14,561,879],
|
||||
jpa:[4,18,9693],
|
||||
kcy:[22,313,33300],
|
||||
kgl:[5,14,34],
|
||||
khi:[7,15,488],
|
||||
kla:[2,18,71],
|
||||
kul:[20,210,434],
|
||||
kyv:[33,506,2342],
|
||||
lad:[8,27,79],
|
||||
lag:[13,279,304],
|
||||
lax:[44,939,33300],
|
||||
ldb:[3,7,9693],
|
||||
lim:[12,156,267],
|
||||
lis:[9,129,187],
|
||||
ljd:[1,2,9693],
|
||||
lon:[100,2588,4027],
|
||||
lpb:[1,2,71],
|
||||
lun:[4,3,24],
|
||||
maa:[20,374,6412],
|
||||
mad:[31,578,1341],
|
||||
maj:[0,0,12],
|
||||
man:[29,353,4027],
|
||||
mao:[7,15,9693],
|
||||
mba:[4,176,274],
|
||||
mcp:[2,0,9693],
|
||||
mcz:[1,5,9693],
|
||||
mde:[2,18,598],
|
||||
mel:[20,395,3196],
|
||||
mex:[18,122,814],
|
||||
mgf:[4,9,9693],
|
||||
mia:[27,553,33300],
|
||||
mil:[29,728,1534],
|
||||
mnl:[17,352,750],
|
||||
mos:[49,632,6683],
|
||||
mpm:[7,20,36],
|
||||
mrs:[8,273,2249],
|
||||
mtl:[35,283,2595],
|
||||
mty:[5,27,814],
|
||||
muc:[22,230,3705],
|
||||
mvd:[1,2,53],
|
||||
nat:[1,3,9693],
|
||||
nbo:[9,283,274],
|
||||
nou:[2,2,19],
|
||||
nyc:[96,1322,33300],
|
||||
oos:[5,22,443],
|
||||
osa:[19,229,1330],
|
||||
osl:[20,209,448],
|
||||
ott:[6,21,2595],
|
||||
pan:[8,26,158],
|
||||
par:[77,1528,2249],
|
||||
pek:[10,15,6717],
|
||||
per:[12,248,3196],
|
||||
phx:[26,279,33300],
|
||||
pmo:[3,46,1534],
|
||||
pmw:[3,8,9693],
|
||||
poa:[22,120,9693],
|
||||
pom:[2,0,46],
|
||||
ppg:[0,0,2],
|
||||
ppt:[0,0,6],
|
||||
prg:[24,336,775],
|
||||
pvh:[3,4,9693],
|
||||
qro:[11,144,814],
|
||||
rao:[6,3,9693],
|
||||
rbr:[0,0,9693],
|
||||
rec:[6,31,9693],
|
||||
rek:[15,51,93],
|
||||
ria:[2,2,9693],
|
||||
rio:[33,577,9693],
|
||||
rom:[12,213,1534],
|
||||
ror:[0,0,4],
|
||||
ruh:[8,29,220],
|
||||
sao:[70,1875,9693],
|
||||
scl:[36,274,450],
|
||||
sea:[37,539,33300],
|
||||
sgn:[6,36,1068],
|
||||
sha:[11,27,6717],
|
||||
sin:[58,1271,782],
|
||||
sjc:[57,1048,33300],
|
||||
sjo:[8,6,128],
|
||||
sjp:[2,4,9693],
|
||||
slc:[22,202,33300],
|
||||
slz:[1,6,9693],
|
||||
sof:[15,451,889],
|
||||
ssa:[13,44,9693],
|
||||
stg:[18,63,3705],
|
||||
sto:[31,539,1011],
|
||||
suv:[0,0,23],
|
||||
svg:[2,14,448],
|
||||
syd:[40,979,3196],
|
||||
tbu:[0,0,5],
|
||||
the:[2,1,9693],
|
||||
tll:[7,80,256],
|
||||
tok:[58,917,1330],
|
||||
tor:[46,509,2595],
|
||||
tpe:[15,274,500],
|
||||
tun:[2,0,30],
|
||||
uio:[9,16,287],
|
||||
van:[13,214,2595],
|
||||
vie:[30,377,860],
|
||||
vix:[6,30,9693],
|
||||
waw:[25,855,2743],
|
||||
wdh:[1,2,22],
|
||||
zrh:[38,535,1209],
|
||||
};
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/* ================= BUSINESSES ================= */
|
||||
const BIZ_T={
|
||||
dia:{l:tr('common.enterprise_dia'),opts:[1,2,5,10],rate:600},
|
||||
game:{l:tr('common.game_servers'),opts:[5,10,20,40],rate:120},
|
||||
game:{l:tr('common.game_servers'),gaming:true,opts:[5,10,20,40],rate:120},
|
||||
host:{l:tr('common.hosting'),opts:[10,20,40,80],rate:60},
|
||||
isp:{l:tr('businesses.downstream_isp_buys_transit'),opts:[100,200,400,800],rate:15,lv:2},
|
||||
l2vpn:{l:tr('common.l2vpn_circuit'),opts:[1,10,40,100],rate:0,l2:true,km:1,lv:1},
|
||||
|
|
@ -26,7 +26,7 @@ const BIZ_T={
|
|||
pairs:{l:tr('businesses.hundreds_of_fiber_pairs'),opts:[1],rate:0,fiber:true,mega:true,lv:4,names:['A Hyperscaler Who Shall Not Be Named','Planet-Scale AI WAN Team','The Fiber-Hungry Giant','Project Very Long Glass']},
|
||||
esport:{l:tr('businesses.esports_world_final'),opts:[400,800,1600,3200],rate:0,event:true,lv:5,names:['League of Lag Finals','Counter-Ping Major','Fortnightly World Cup','Dota Two Many Viewers','Rocket Leak Championship','Street Frighter Evo']},
|
||||
sov:{l:tr('businesses.sovereign_cloud_region'),opts:[400,800,1600],rate:0,l2:true,div:true,km:0.6,lv:6,names:['Gaia-Ex Sovereign Cloud','Bundeswolke (Very Secure)','Le Cloud Souverain','Datenschutz Deluxe','Your Data Stays Here, Probably','A Cloud With a Flag on It','Data Residency Is a State of Mind']},
|
||||
cgame:{l:tr('businesses.cloud_gaming_platform'),opts:[800,1600,3200],rate:45,lv:8,names:['Stadia-ium (Back Again)','GeForce Later','Ping Station Now','Luna-tick Gaming','Shadow of a Doubt Cloud PC','Input Lag Arcade','Bufferbloat Bros. Streaming']},
|
||||
cgame:{l:tr('businesses.cloud_gaming_platform'),gaming:true,opts:[800,1600,3200],rate:45,lv:8,names:['Stadia-ium (Back Again)','GeForce Later','Ping Station Now','Luna-tick Gaming','Shadow of a Doubt Cloud PC','Input Lag Arcade','Bufferbloat Bros. Streaming']},
|
||||
metav:{l:tr('common.metaverse_platform'),opts:[1600,3200,6400],rate:35,lv:9,names:['Meh-taverse','Second Second Life','Horizon Worlds Apart','The Oasis (Ready Player Done)','Legs Finally Shipped Inc.','Decentra-landlocked']},
|
||||
agi:{l:tr('businesses.agi_lab_allegedly'),opts:[12800,25600],rate:0,l2:true,div:true,mega:true,km:0.4,lv:11,names:['Almost General Intelligence Inc.','Superintelligence Pending','The Lab That Said Two More Years','Paperclip Maximizer Labs','Deep Thought Two','Benevolent Overlord Research']},
|
||||
mars:{l:tr('businesses.mars_mission_ground_station'),opts:[100,200,400],rate:0,l2:true,lat:true,km:4,lv:13,names:['Red Planet Relay','Ares Ground Segment','Olympus Mons Uplink','Mars or Bust Mission Control','Interplanetary Ping Society','Light-Minute Logistics','RFC 1149 Avian Carriers (Mars Division)']},
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
const slug=t=>String(t).toLowerCase().normalize('NFKD').replace(/[̀-ͯ]/g,'').replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'x';
|
||||
function trPaths(src){const live=S.links.filter(l=>!linkDown(l)),rem=remoteCities(),ok=c=>popUp(c)||rem.includes(c),adj={};
|
||||
// Every link between two cities costs what the pair costs, as in compute(); the trace shows an active link over one on standby.
|
||||
const pw={};for(const l of live){const k=edgeKey(l);pw[k]=Math.min(pw[k]??Infinity,(l.km+60)*MET[pairMet(k)].f);}
|
||||
const pw={};for(const l of live){const k=edgeKey(l);pw[k]=Math.min(pw[k]??Infinity,pairW(k,l.km));}
|
||||
for(const l of live){if(!ok(l.a)||!ok(l.b))continue;const w=pw[edgeKey(l)]+(l.standby?1e-6:0);(adj[l.a]=adj[l.a]||[]).push([l.b,l,w]);(adj[l.b]=adj[l.b]||[]).push([l.a,l,w]);}
|
||||
const dist={[src]:0},prev={},done=new Set();for(;;){let u=null,ud=Infinity;for(const k in dist)if(!done.has(k)&&dist[k]<ud){u=k;ud=dist[k];}if(u===null)break;done.add(u);for(const [v,l,w] of adj[u]||[]){const nd=ud+w;if(nd<(dist[v]??Infinity)){dist[v]=nd;prev[v]=l;}}}
|
||||
const path=dst=>{if(dist[dst]===undefined)return null;const out=[];let v=dst;while(v!==src){const l=prev[v];out.unshift({l,from:l.a===v?l.b:l.a,to:v});v=l.a===v?l.b:l.a;}return out;};return {dist,path};}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
function newGame(name,home){
|
||||
S={v:1,name,asn:200000+Math.floor(_rand()*15000),home,day:0,cash:START_CASH,
|
||||
ltv:2,t1v:3,auV:1,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:[],ev:{},priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},cnLic:{state:'none'},scrubs:[],scrubMode:'always',capDeal:null,won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,inbox:{items:[],down:{},tiny:{},rep:0,bot:false,log:[],seq:0},hw:{},rules:makeRules('oncall')};
|
||||
ltv:2,t1v:3,auV:1,achP:{},autoSales:false,autoRepair:false,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:[],ev:{ddosMore:[]},ddosStarts:[],priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},cnLic:{state:'none'},scrubs:[],scrubMode:'always',capDeal:null,won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,inbox:{items:[],down:{},tiny:{},rep:0,bot:false,log:[],seq:0},hw:{},rules:makeRules('oncall')};
|
||||
}
|
||||
|
||||
|
|
|
|||
36
src/game/60-features/90-automation.js
Normal file
36
src/game/60-features/90-automation.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* Optional operators use the same sales and repair actions as the player. */
|
||||
const AUTO_SALES_MS=5000;
|
||||
function autoSalesSeconds(now=performance.now()){if(!S||!S.autoSales)return null;
|
||||
const left=UI.autoGame===S&&autoActive()?AUTO_SALES_MS-(now-UI.autoSalesAt):AUTO_SALES_MS;
|
||||
return Math.max(1,Math.min(AUTO_SALES_MS/1000,Math.ceil(left/1000)));}
|
||||
function autoCountdownReady(o){if(!S||!S.autoSales||!o||!(o.exp>S.day)||!bCities(o).every(popUp)||!reqOk(o))return false;
|
||||
const inc=S.inc.map(i=>i.id).join('|');let c=UI.autoReady;
|
||||
// Share capacity trials between views and keep them until the next check, action or incident.
|
||||
if(!c||c.s!==S||c.at!==UI.autoSalesAt||c.inc!==inc||c.event!==S.nextEvent)c=UI.autoReady={s:S,at:UI.autoSalesAt,inc,event:S.nextEvent,offers:new Map()};
|
||||
if(!c.offers.has(o))c.offers.set(o,!!autoOffer(o));return c.offers.get(o);}
|
||||
function autoAcceptLabel(o){return tr('common.accept')+(S.autoSales?` <small data-auto-sales="${esc(o.id)}" title="${esc(tr('automation.next_auto_check'))}">${autoCountdownReady(o)?`(${autoSalesSeconds()})`:''}</small>`:'');}
|
||||
function renderAutoCountdown(now=performance.now()){const n=autoSalesSeconds(now);if(UI.autoCount===n&&UI.autoCountResult===R)return;UI.autoCount=n;UI.autoCountResult=R;
|
||||
const offers=new Map((S?S.offers:[]).map(o=>[o.id,o]));
|
||||
for(const el of document.querySelectorAll('[data-auto-sales]'))el.textContent=n!==null&&autoCountdownReady(offers.get(el.dataset.autoSales))?`(${n})`:'';}
|
||||
function offerCustomer(o){return {id:o.id,city:o.city,city2:o.city2||null,reqs:o.reqs||[],latMax:o.latMax||null,route:BIZ_T[o.type].scenic?'scenic':BIZ_T[o.type].lat?'fast':'normal',name:o.name,type:o.type,bw:o.bw,rate:o.rate,mood:100,since:S.day,sites:o.sites||null,start:o.start,dur:o.dur,fee:o.fee,link:o.link,slots:o.slots||0,what:o.what,prov:o.prov,due:BIZ_T[o.type].cap?S.day+o.win:undefined};}
|
||||
function autoOffer(o){if(!o||!own(BIZ_T,o.type)||!(o.exp>S.day)||!(o.bw>0)||o.rate<0||!bCities(o).length||!bCities(o).every(popUp)||!reqOk(o))return null;
|
||||
const T=BIZ_T[o.type],b=offerCustomer(o);if(T.event&&(!(o.start>S.day)||!(o.dur>0)))return null;
|
||||
if(o.type==='capfib'&&S.biz.some(x=>x.type==='capfib'&&capPend(x)&&!x.link&&((x.city===o.city&&x.city2===o.city2)||(x.city===o.city2&&x.city2===o.city))))return null;
|
||||
if(T.fiber){const l=o.type==='capfib'?capFibLink(b):S.links.find(x=>x.id===o.link);if(!l)return null;b.link=l.id;
|
||||
if(!fiberOk(b)||(o.type==='wwave'&&(!(o.slots>0)||freeCh(l)<o.slots))||(o.type==='dfpair'&&!pairFree(l))||
|
||||
(o.type==='pairs'&&(!l.own||S.biz.some(x=>x.link===l.id&&['pairs','capfib','dfpair'].includes(x.type)))))return null;}
|
||||
const state=S,result=R,hot=UI.hotMap,future=S.biz.some(x=>BIZ_T[x.type].event&&x.start>S.day);
|
||||
// Trial the added demand before signing; failed trials leave the live game untouched.
|
||||
try{S={...S,biz:S.biz};
|
||||
// shortcut: future events reserve capacity together; use per-date trials if separate bookings must share capacity.
|
||||
if(future){S.biz=S.biz.map(x=>BIZ_T[x.type].event&&x.start>S.day?{...x,start:S.day}:x);compute();}
|
||||
const healthy=S.biz.filter(x=>!bizWhy(x).length);if(T.event)b.start=S.day;if(T.cap)b.live=true;S.biz=S.biz.concat(b);compute();
|
||||
return !bizWhy(b).length&&healthy.every(x=>!bizWhy(x).length)?b:null;
|
||||
}finally{S=state;R=result;UI.hotMap=hot;b.start=o.start;if(T.cap)delete b.live;}}
|
||||
function autoActive(){return !!(S&&UI.started&&!S.lost&&UI.speed&&$('modal').hidden&&document.visibilityState==='visible');}
|
||||
function automationTick(now){if(UI.autoGame!==S){UI.autoGame=S;UI.autoSalesAt=now;}
|
||||
if(!autoActive()){UI.autoSalesAt=now;return;}
|
||||
if(S.autoRepair&&S.inc.length){purgeInc();for(const i of S.inc.slice()){if(!autoActive())break;
|
||||
if(i.type!=='ddos'&&i.until>S.day&&i.cost>0&&i.cost<=S.cash&&!(i.slow&&i.rushed))ACT.fixInc({id:i.id});}}
|
||||
if(!S.autoSales||!autoActive()){UI.autoSalesAt=now;return;}if(now-UI.autoSalesAt<AUTO_SALES_MS)return;
|
||||
UI.autoSalesAt=now;for(const o of S.offers.slice()){if(!autoActive())break;ACT.accept({id:o.id,auto:true});}}
|
||||
24
src/game/70-rules/35-pni-orders.js
Normal file
24
src/game/70-rules/35-pni-orders.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* Single and bulk orders share the same checks, prices and provisioning. */
|
||||
function pniQuote(city,net,tier,reserved=0){tier=+tier;const g1=tier===-1;if(g1)tier=0;
|
||||
if(!S||!S.pops[city]||!isNet(net)||!NET[net].pops.includes(city)||!Number.isInteger(tier)||!PORT[tier]||(g1&&!pniG1(net)))return null;
|
||||
const ex=S.pni.find(p=>p.city===city&&p.net===net);
|
||||
if(ex&&(g1||!pniOn(ex)||ex.up||(!(ex.g1&&tier===0)&&tier<=ex.tier)))return null;
|
||||
const cost=g1?PNI_G1_COST:(1500+PORT[tier].setup/2)*(ex&&ex.n||1),slots=ex?(PORT_SLOT(tier)-PORT_SLOT(ex.tier))*(ex.n||1):PORT_SLOT(tier);
|
||||
let why='';if(!portOk(city,tier))why=tr('actions.your_router_can_t_take_a',{port:PORT[tier].n});
|
||||
else{const r=peerOk(net,'pni',city);if(!r.ok)why=tr('sites_peering_caches.net_declined_the_pni_why',{net:esc(NET[net].name),why:esc(r.why)});
|
||||
else if(!g1&&tier<pniMin(net))why=tr('sites_peering_caches.net_does_not_do_port_pnis',{net:esc(NET[net].name),port:PORT[tier].n});
|
||||
else if(slots>0&&portsUsed(city)+reserved+slots>portsMax(city)+1e-9)why=tr('ports.no_free_router_ports_in_city',{city:esc(CITY[city].name),u:fmtPorts(portsUsed(city)+reserved),m:portsMax(city)});}
|
||||
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});
|
||||
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;
|
||||
// Pending augments and earlier orders in this batch already own their future ports.
|
||||
for(const p of S.pni)if(p.up)reserved[p.city]=(reserved[p.city]||0)+Math.max(0,PORT_SLOT(p.up.tier)*(p.up.n||1)-PORT_SLOT(p.tier)*(p.n||1));
|
||||
for(const n of all?NETS:[NET[net]])for(const city of n.pops){if(!S.pops[city])continue;shared.push(city);
|
||||
// Each network at its own minimum: asking everyone for 10G orders 100G from those that start at 100G.
|
||||
const q=pniQuote(city,n.id,all&&tier>=0?Math.max(tier,pniMin(n.id)):tier,reserved[city]||0);if(!q){kept++;continue;}if(q.why){blocked.push(q);continue;}orders.push(q);if(q.tier>tier&&!q.g1)raised++;cost+=q.cost;reserved[city]=(reserved[city]||0)+q.slots;
|
||||
mo+=pniMo({net:n.id,tier:q.tier,g1:q.g1,n:q.ex&&q.ex.n},0)-(q.ex?pniMo(q.ex,0):0);}
|
||||
return {shared,orders,blocked,kept,cost,mo,raised};}
|
||||
29
src/game/70-rules/95-utilities.js
Normal file
29
src/game/70-rules/95-utilities.js
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/* Utilities: plan from live state, then apply a whole batch with one recompute. */
|
||||
function utilityRouteServers(){return S?Object.keys(S.ixp).filter(ix=>isIx(ix)&&!S.myIx[ix]&&!S.rs[ix]):[];}
|
||||
function utilityCacheMoves(city){if(!S||!S.pops[city])return [];const groups=new Map(),moves=[];
|
||||
for(const c of S.caches)if(c.city===city){let g=groups.get(c.net);if(!g){g={a:[],b:[]};groups.set(c.net,g);}g[c.site==='b'?'b':'a'].push(c);}
|
||||
const move=(g,from,n)=>{const to=from==='a'?'b':'a';for(const c of g[from].splice(0,n)){g[to].push(c);moves.push({id:c.id,site:to});}};
|
||||
for(const g of groups.values()){const from=g.a.length>g.b.length?'a':'b',to=from==='a'?'b':'a';
|
||||
move(g,from,Math.floor((g[from].length-g[to].length)/2));}
|
||||
// Spread odd-provider extras too, so the overall site counts also differ by at most one.
|
||||
let diff=0;for(const g of groups.values())diff+=g.a.length-g.b.length;
|
||||
const from=diff>0?'a':'b',to=from==='a'?'b':'a';let left=Math.floor(Math.abs(diff)/2);
|
||||
for(const g of groups.values())if(left&&g[from].length>g[to].length){move(g,from,1);left--;}
|
||||
return moves;}
|
||||
function utilityCaches(city){const p=S&&S.pops[city];if(!p)return null;const sites=p.site2?['a','b']:['a'],add=[],have=new Set();
|
||||
for(const c of S.caches)if(c.city===city)have.add(c.net+'@'+(c.site==='b'?'b':'a'));
|
||||
for(const n of NETS)if(n.cache&&(R.demTo[n.id]||0)>=n.cache.min)for(const site of sites)if(!have.has(n.id+'@'+site))add.push({net:n.id,site});
|
||||
return {add,key:add.map(c=>c.net+'@'+c.site).join(','),mo:add.length*CACHE_MO,free:Math.max(0,portsMax(city)-portsUsed(city))};}
|
||||
function utilityKit(city){const p=S&&S.pops[city];if(!p)return null;
|
||||
const gen=!p.gen,site=!p.site2,router=(p.routers||1)<2,g=p.rgen||0;
|
||||
return {gen,site,router,moves:utilityCacheMoves(city),cost:(gen?GEN_COST:0)+(site?SITE2_COST:0)+(router?routerCost(g,1):0),
|
||||
mo:(gen?GEN_MO:0)+(site?SITE2_MO:0)+(router?routerMo(g):0)};}
|
||||
function utilityPeers(){if(!S)return [];return Object.keys(S.ixp).filter(isIx).map(ix=>{
|
||||
const sessions=ixSessions(ix),requests=[],blocked=[];let existing=0;
|
||||
for(const id of ixMembers(ix)){
|
||||
// Existing but temporarily down sessions must not be repeatedly requested.
|
||||
if(sessions.has(id)||S.peers[id+'@'+ix]){existing++;continue;}
|
||||
const chk=peerOk(id,'ix',ix);if(chk.ok)requests.push(id);else blocked.push({id,why:chk.why});
|
||||
}
|
||||
return {ix,requests,blocked,existing};
|
||||
});}
|
||||
|
|
@ -57,7 +57,7 @@ function teOptimize(){const L=[tr('routescript.suggested_by_the_optimizer_from_l
|
|||
return L.join('\n');}
|
||||
// Ready-made RouteScripts, filled in from the live network. Players load them from the help; the AI button picks them too.
|
||||
const teUps=()=>[...new Set(S.transit.map(t=>t.net))].map(n=>({n,p:Math.min(...S.transit.filter(t=>t.net===n).map(t=>NET[n].price*netMult(NET[n],t.city)))})).sort((a,b)=>a.p-b.p);
|
||||
const teNm=n=>NET[n].name.toLowerCase(),teAtk=()=>!!(S.ev.ddos&&S.ev.ddos.until>S.day);
|
||||
const teNm=n=>NET[n].name.toLowerCase(),teAtk=()=>ddosAll().length>0;
|
||||
const teSad=()=>S.biz.some(b=>!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber&&!BIZ_T[b.type].event&&sfOf(R,b.city)<0.95);
|
||||
const TE_RECIPES=[
|
||||
{id:'shield',n:N_('common.shields_up'),d:N_('routescript.for_a_ddos_drop_the_junk'),fit:()=>teAtk()?9:0.3,
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ function compute(){
|
|||
const remote=remoteCities(),adj=new Array(NC); pops.concat(remote).forEach(p=>adj[CIDX[p]]=[]);
|
||||
const edges={},TRX=teRules(),live=[];let NE=0;R2.bizDem={};R2.bizSrv={};
|
||||
for(const l of S.links){const ai=CIDX[l.a],bi=CIDX[l.b];if(linkDown(l)||!adj[ai]||!adj[bi])continue;live.push(l);const key=l.a<l.b?l.a+'|'+l.b:l.b+'|'+l.a;let e=edges[key];
|
||||
// The metric belongs to the city pair; links on standby add capacity that fills only after the others (#122).
|
||||
if(!e){const f=MET[pairMet(key)].f;e=edges[key]={id:key,a:l.a,b:l.b,ai,bi,i:NE++,km:l.km,cap:0,scap:0,w:Infinity,lat:Infinity,slat:Infinity,links:[],res:0,ld:0,tr:null,pl:0,f:f*(TRX&&TRX.avoid.has(key)?60:1)};adj[ai].push([bi,e]);adj[bi].push([ai,e]);}
|
||||
const c=capOf(l),lt=linkLat(l);e.cap+=c;e.links.push(l);e.w=Math.min(e.w,(l.km+60)*e.f);if(l.standby){e.scap+=c;e.slat=Math.min(e.slat,lt);}else e.lat=Math.min(e.lat,lt);}
|
||||
// The metric belongs to the city pair (a preset or a custom one); links on standby add capacity that fills only after the others (#122).
|
||||
if(!e){e=edges[key]={id:key,a:l.a,b:l.b,ai,bi,i:NE++,km:l.km,cap:0,scap:0,w:Infinity,lat:Infinity,slat:Infinity,links:[],res:0,ld:0,tr:null,pl:0,f:TRX&&TRX.avoid.has(key)?60:1};adj[ai].push([bi,e]);adj[bi].push([ai,e]);}
|
||||
const c=capOf(l),lt=linkLat(l);e.cap+=c;e.links.push(l);e.w=Math.min(e.w,pairW(key,l.km)*e.f);if(l.standby){e.scap+=c;e.slat=Math.min(e.slat,lt);}else e.lat=Math.min(e.lat,lt);}
|
||||
for(const k in edges){const e=edges[k];if(e.lat===Infinity)e.lat=e.slat;}
|
||||
// Shortest paths from every POP: SPD[pop] the distance to each city index (Infinity: no path), SPP[pop] the edge it arrives by.
|
||||
// ALONE[i]: no other city lies within 1e-6 of POP i (so only its own exits can be at distance 0 from it).
|
||||
|
|
@ -37,7 +37,7 @@ function compute(){
|
|||
// ok() cannot change during one compute, so ask each exit once per network, not once per flow and rank.
|
||||
// okBy[net] lists the exits that reach it in E's order, like E.filter(e=>e.ok(net)).
|
||||
const okBy={};for(const id of NET_IDS)okBy[id]=[];
|
||||
const ekN={};for(const e of E){e.ek=e.k+':'+e.id;ekN[e.ek]=(ekN[e.ek]||0)+1;}
|
||||
R2.ingressPorts={};const ekN={};for(const e of E){e.ek=e.k+':'+e.id;if(e.k!=='c'){const p=R2.ingressPorts[e.ek]||(R2.ingressPorts[e.ek]={k:e.k,id:e.id,city:e.city,lab:e.lab,cap:0,traffic:0});p.cap+=e.cap;}ekN[e.ek]=(ekN[e.ek]||0)+1;}
|
||||
// dup: shares its key with another exit (a hand-edited save), so R.egDesc shows whichever pushed last.
|
||||
for(const e of E){e.desc={lab:e.lab,city:e.city,k:e.k};e.dup=ekN[e.ek]>1;e.told=false;e.hp=e.pref==='high'?0:1;e.ci=CIDX[e.city];e.cn=cnCity(e.city);e.vis=0;for(const n of e.nets||NET_IDS){const L=okBy[n];if(L&&L[L.length-1]!==e&&e.ok(n))L.push(e);}}
|
||||
for(const n of NETS){R2.reachable[n.id]=okBy[n.id].some(e=>e.rank>0);if(R2.reachable[n.id])R2.reach+=NSH[n.id];if(okBy[n.id].some(e=>e.rank>0&&e.k!=='t')){R2.nt[n.id]=1;R2.reachNT+=NSH[n.id];
|
||||
|
|
@ -46,11 +46,11 @@ function compute(){
|
|||
const cacheNets=new Set(S.caches.filter(c=>popUp(c.city)).map(c=>c.net));
|
||||
const viral=(ev.viral>day?1.25:1)*(ev.php&&ev.php>day?0.7:1);
|
||||
// Every flow has the same shape and carries what routing asks about it again and again (nj: its network's index).
|
||||
const NN=NETS.length,flows=[],flow=(c,ci,cn,j,rem,cache,junk,bz=false)=>{const n=NETS[j];flows.push({c,n:n.id,rem,cache,junk,bz,ci,cn,ncn:!!n.cn,nj:j,nr:junk?NN:j});};
|
||||
const NN=NETS.length,flows=[],flow=(c,ci,cn,j,rem,cache,junk,bz=false)=>{const n=NETS[j],f={c,n:n.id,rem,cache,junk,bz,ci,cn,ncn:!!n.cn,nj:j,nr:junk?NN:j};flows.push(f);return f;};
|
||||
// Customer demand per city, added up in S.biz order (what filtering S.biz for each city would give).
|
||||
const bizBw={};for(const b of S.biz){const T=BIZ_T[b.type];if(!T.l2&&!T.fiber&&(!T.event||eventLive(b))){const v=bizBw[b.city];bizBw[b.city]=(v===undefined?0:v)+b.bw;}}
|
||||
// Traffic shares by network index, and their sums, for each share table (and with Russia's throttle).
|
||||
const shArr=new Map(),shSum=new Map(),DEMTO=new Float64Array(NN),loc=scnRule('local'),HAUL=[];R2.haul=[];
|
||||
const shArr=new Map(),shSum=new Map(),DEMTO=new Float64Array(NN),loc=scnRule('local'),scrubRoom={},atkBy={},junkGroups=[],bhCities=new Set(ddosAll().filter(a=>a.bh).map(a=>a.city));R2.haul=[];R2.ddos=[];for(const a of ddosAll())for(const part of ddosSlices(a))(atkBy[part.city]||(atkBy[part.city]=[])).push(part);
|
||||
for(const c of Object.keys(S.pops)){
|
||||
const p=S.pops[c],ci=CIDX[c],cn=cnCity(c),SH=cn?NSH_CN:ruCity(c)?NSH_RU:CITY[c].kr&&S.krExit?NSH_KRX:NSH;const eye=(p.bb?p.bb.d:0)*viral*(cn&&ev.golden>day?1.4:1);const biz=bizBw[c]??0;const d0=eye+biz;
|
||||
// Goggle video is throttled in Russia (#70): people there get half of it, so they ask for half. It is not
|
||||
|
|
@ -59,26 +59,18 @@ function compute(){
|
|||
const tt=sm[+ru]||(sm[+ru]=[NETS.reduce((t,n,j)=>t+sa[j]*thr(n.id),0),NETS.reduce((t,n,j)=>t+sa[j],0)]),lf=loc?NETS.reduce((t,n,j)=>t+(R2.reachable[n.id]?sa[j]*thr(n.id):0),0)/(tt[0]||1):1,d=d0*tt[0]/(tt[1]||1)*lf;
|
||||
R2.cityEye[c]=eye;R2.cityDem[c]=d;R2.citySrv[c]=0;R2.demand+=d;
|
||||
for(let j=0;j<NN;j++)DEMTO[j]=(DEMTO[j]||0)+d0*sa[j]*thr(NETS[j].id);
|
||||
if(!popUp(c))continue;
|
||||
// A shaped attack: `rtbh` is the player pulling the plug on the victim IP (junk gone, customer dark too);
|
||||
// `edge` is the crude RouteScript `blackhole ddos` filter (junk gone, 10% of real traffic with it). Flowspec
|
||||
// (a standing licence) and a scrubbing center each knock the flood down before it reaches the sim.
|
||||
const atk=ev.ddos&&ev.ddos.city===c&&ev.ddos.until>day?ev.ddos:null;
|
||||
const rtbh=!!(atk&&atk.bh), edge=!!(atk&&TRX&&TRX.blackhole&&!rtbh);
|
||||
const attacks=atkBy[c]||[],rtbh=bhCities.has(c),edge=!!(attacks.length&&TRX&&TRX.blackhole&&!rtbh);
|
||||
let dd=0;
|
||||
if(atk&&!rtbh){let mult=1;const en=atk.entry||{};
|
||||
if(DDOS_VEC[atk.vec]&&DDOS_VEC[atk.vec].fs){const cap=fsAt(atk.city);if(cap)mult=Math.min(mult,FS_RES[cap]);}
|
||||
if(en.k==='t'){const t=S.transit.find(x=>x.id===en.id);if(t&&t.clean)mult=Math.min(mult,0.1);}
|
||||
if(atk.ixbh&&hasIxAt(atk.city))mult=Math.min(mult,0.5);
|
||||
if(edge)mult=0;
|
||||
// Scrubbing is used when it beats the edge tools; floods for a center in another city are hauled after the circuits below.
|
||||
const sp=edge?null:scrubPlan(atk);
|
||||
if(sp&&scrubIdeal(sp)<atk.gbps*mult){dd=scrubIdeal(sp);for(const x of sp.parts)if(x.city!==c)HAUL.push({c,to:x.city,tier:x.tier,a:x.a,v:d*0.1});}
|
||||
else dd=atk.gbps*mult;
|
||||
if(en.k==='p'){const p=S.pni.find(x=>x.id===en.id);if(p&&p.sacrif)dd=Math.min(dd,liveCap(pniG(p),p.city,p.site,p.n)*0.9);}}
|
||||
for(const atk of attacks){const m=ddosMitigation(atk,{},bhCities.has((atk.parent||atk).city),false);R2.ddos.push(m);dd+=m.leak;
|
||||
const group={m,flows:[]};junkGroups.push(group);
|
||||
if(atk.entries?.length){for(const q of m.ingress){const f=flow(c,ci,cn,0,q.g,false,true);f.pin=q.entry.k+':'+q.entry.id;group.flows.push({f,share:m.leak>0?q.g/m.leak:0});}}
|
||||
else for(let j=0;j<NN;j++)group.flows.push({f:flow(c,ci,cn,j,m.leak*NSH[NETS[j].id],false,true),share:NSH[NETS[j].id]});}
|
||||
if(!popUp(c)){for(const m of R2.ddos.filter(m=>m.attack.city===c))m.offline=true;continue;}
|
||||
const bh=rtbh||edge;
|
||||
if(dd>0)for(let j=0;j<NN;j++)flow(c,ci,cn,j,dd*NSH[NETS[j].id],false,true);
|
||||
if(edge)R2.teBlack+=atk.gbps*0.15+d*0.1;if(rtbh)R2.teBlack+=atk.gbps+d;
|
||||
if(edge)R2.teBlack+=attacks.reduce((n,a)=>n+a.gbps,0)+d*0.1;if(rtbh)R2.teBlack+=attacks.reduce((n,a)=>n+a.gbps,0)+d;
|
||||
R2.cityBlocked=R2.cityBlocked||{};
|
||||
const mtuH=ev.pmtud&&ev.pmtud.until>day?ev.pmtud:null,kr=CITY[c].kr;
|
||||
for(let j=0;j<NN;j++){const n=NETS[j],a=(loc&&!R2.reachable[n.id]?0:d0)*sa[j]*thr(n.id)*(rtbh?0:edge?0.9:1)*(mtuH&&mtuH.net===n.id?mtuH.f:1)*(kr&&ev.krroute>day&&n.id==='fbk'?0.8:1);if(a<=0)continue;
|
||||
|
|
@ -141,21 +133,32 @@ function compute(){
|
|||
if((b.reqs||[]).includes('diverse')){const k=b.city+'>'+b.city2;R2.div[b.id]=divMemo[k]??(divMemo[k]=disjointI(b.city,b.city2));}}
|
||||
/* A flood for a scrubbing center elsewhere rides the backbone there, with the victim's own traffic (#117).
|
||||
What the links cannot carry is not scrubbed and lands on the city after all. */
|
||||
for(const H of HAUL){const A=H.c,B=H.to,Ai=CIDX[A],Bi=CIDX[B];let h=0,ms=null;
|
||||
if(popUp(A)&&popUp(B)&&SPD[A]&&SPD[A][Bi]<Infinity){const {path,ni}=walkI(SPP[A],Ai,Bi);let room=Infinity;for(const l of path)room=Math.min(room,l.res);for(const i of ni)if(HAS[i])room=Math.min(room,NRES[i]);
|
||||
const want=H.a+H.v,take=Math.max(0,Math.min(want,room));h=want>0?H.a*take/want:0;ms=path.reduce((x,e)=>x+e.lat,0)*2;
|
||||
const ek='scrub:'+B;R2.egDesc[ek]={lab:labOf(N_('compute.attack_hauled_to_scrubbing_in_city'),'city',CITY[B].name),city:A,k:'l2'};
|
||||
for(const i of ni)if(HAS[i])nodeTake(i,take);for(const l of path){l.res-=take;l.ld+=take;carry(l,ek,NN,Ai,take);}}
|
||||
R2.haul.push({city:A,to:B,tier:H.tier,a:H.a,h,ms});const left=(H.a-h)*0.85;if(left>1e-6)for(let j=0;j<NN;j++)flow(A,Ai,cnCity(A),j,left*NSH[NETS[j].id],false,true);}
|
||||
const scrubNear=new Map();
|
||||
for(const m of R2.ddos){const atk=m.attack,A=atk.city,Ai=CIDX[A];
|
||||
m.sp=!m.offline&&m.leak>0?scrubPlan(atk,m.leak,scrubRoom,(x,want)=>{const B=x.city,Bi=CIDX[B];if(A===B)return want;let h=0,ms=null;
|
||||
if(popUp(A)&&popUp(B)&&SPD[A]&&SPD[A][Bi]<Infinity){const {path,ni}=walkI(SPP[A],Ai,Bi);let room=Infinity;for(const l of path)room=Math.min(room,l.res);for(const i of ni)if(HAS[i])room=Math.min(room,NRES[i]);
|
||||
const v=R2.cityDem[A]*0.1*want/Math.max(m.leak,1)/atkBy[A].length,total=want+v,take=Math.max(0,Math.min(total,room));h=total>0?want*take/total:0;ms=path.reduce((n,e)=>n+e.lat,0)*2;
|
||||
// Sources sharing a center need separate labels in link breakdowns and map highlights.
|
||||
const ek='scrub:'+A+'>'+B;R2.egDesc[ek]={lab:labOf(N_('compute.attack_hauled_to_scrubbing_in_city'),'city',CITY[B].name),city:A,k:'l2'};
|
||||
for(const i of ni)if(HAS[i])nodeTake(i,take);for(const l of path){l.res-=take;l.ld+=take;carry(l,ek,NN,Ai,take);}}
|
||||
R2.haul.push({city:A,to:B,tier:x.tier||0,a:want,h,ms,attack:atk.id});return h;}):null;
|
||||
if(m.sp){m.leak=m.sp.leak;
|
||||
// The card describes the victim's nearest center, separately from distributed ingress hauling above.
|
||||
const c=(atk.parent||atk).city;let near=scrubNear.get(c);if(near===undefined){near=null;
|
||||
for(const x of S.scrubs)if(popUp(x.city)&&SPD[c]&&SPD[c][CIDX[x.city]]<Infinity){const ms=c===x.city?0:walkI(SPP[c],CIDX[c],CIDX[x.city]).path.reduce((n,e)=>n+e.lat,0);if(!near||ms<near.ms)near={city:x.city,ms};}
|
||||
scrubNear.set(c,near);}m.near=near;}}
|
||||
for(const group of junkGroups)for(const q of group.flows)q.f.rem=group.m.offline?0:group.m.leak*q.share;
|
||||
const TE=!!(S.te&&S.te.on),TR=teRules();R2.teMoved=0;const teCache=new Map(),SPILL=TR&&TR.spill?TR.spill:1;
|
||||
const altPath=(src,dst,base)=>{const key=src*NC+dst,c0=teCache.get(key);
|
||||
if(c0===false)return null;if(c0&&c0.path.every(l=>l.res>1e-3)&&c0.ni.every(i=>!HAS[i]||NRES[i]>1e-3))return c0;
|
||||
const {D,P}=dijkstra(adj,src,wW,(v,e)=>e.res<=1e-3||(HAS[v]&&NRES[v]<=1e-3),dst);
|
||||
if(D[dst]===Infinity||D[dst]>2*base+60){teCache.set(key,false);return null;}
|
||||
const Q=walkI(P,src,dst);teCache.set(key,Q);return Q;};
|
||||
const ingressE={};for(const e of E)(ingressE[e.ek]||(ingressE[e.ek]=[])).push(e);
|
||||
/* A network in a peer's customer cone, reached through that peer (#85): after every network you peer with directly
|
||||
(its AS path is one hop longer) and before transit. */
|
||||
const base=(e,n)=>e.pref==='low'?4:e.rank>0&&e.rank<3&&coneOf(e,n)?CONE_RANK:e.rank;
|
||||
// An attack pinned to the port it enters by (rank0) has no AS path to compare, so cones do not apply to it.
|
||||
const rank0=e=>e.pref==='low'?4:e.rank,base=(e,n)=>e.pref==='low'?4:e.rank>0&&e.rank<3&&coneOf(e,n)?CONE_RANK:e.rank;
|
||||
// LOCAL_PREF on an upstream moves it ahead of or behind the other transits, never ahead of peering (#96).
|
||||
const eff=(e,n)=>{let r=base(e,n);if(TR){if(e.k==='t'&&TR.up[e.net])r=TR.up[e.net]==='prefer'?2.9:3.5;if(e.prep)r=4.4;if(e.k!=='c'&&TR.drain.has(e.city))r=4.6;const o=TR.net[n];if(o){if(o.prefer===e.k)r=0.5;else if(o.avoid===e.k)r=4.5;}}return r;};
|
||||
const RANKS=TR?[0,0.5,1,2,CONE_RANK,2.9,3,3.5,4,4.4,4.5,4.6]:[0,1,2,CONE_RANK,3,4];
|
||||
|
|
@ -165,6 +168,8 @@ function compute(){
|
|||
// Each list also knows whether it holds a preferred exit (hi) and its exits by city (at), in list order.
|
||||
const byRank={},RSET=new Set();for(const id of NET_IDS){const m=byRank[id]={};for(const e of okBy[id]){const r=TR?eff(e,id):base(e,id);RSET.add(r);(m[r]||(m[r]=[])).push(e);}
|
||||
for(const r in m){const L=m[r];L.hi=L.some(e=>e.hp===0);L.at=new Map();for(const e of L){const h=L.at.get(e.ci);if(h)h.push(e);else L.at.set(e.ci,[e]);}}}
|
||||
// Attack flows pinned to their entry port route at its plain rank, which RouteScript may have left with no list.
|
||||
for(const f of flows)if(f.pin)for(const e of ingressE[f.pin]||[])RSET.add(rank0(e));
|
||||
// The flow being routed, and from its POP: distances, arriving edges and the paths walked so far, by city index.
|
||||
let f=null,Dv=null,Pv=null,PP=null,vis=0;const walked=[],G=[],REST=[],NEG=[];
|
||||
// An exit the flow can still try: not visited yet, not full when the flow started, and reachable from the POP.
|
||||
|
|
@ -180,7 +185,7 @@ function compute(){
|
|||
const ek=e.ek,nr=f.nr,ci=f.ci;if(!e.told||e.dup){R2.egDesc[ek]=e.desc;e.told=true;}
|
||||
for(const l of path){l.res-=amt;l.ld+=amt;carry(l,ek,nr,ci,amt);}
|
||||
e.used+=amt;f.rem-=amt;
|
||||
if(!f.junk){let ok=amt;const cf=f.cn,ce=e.cn,cn=f.ncn;
|
||||
if(!f.junk){if(e.k!=='c')R2.ingressPorts[ek].traffic+=amt;let ok=amt;const cf=f.cn,ce=e.cn,cn=f.ncn;
|
||||
if(cf!==ce||(cf&&!cn)||(!cf&&cn&&e.k==='t')){const prem=(e.k==='t'&&e.prem)||(e.k==='p'&&e.pnc)||path.some(x=>x.links&&x.links.some(y=>y.premium));const loss=prem?0.03:(ev.gfw>day?0.35:0.2);R2.gfwLost+=amt*loss;R2.gfwCross+=amt;ok=amt*(1-loss);}
|
||||
SRV[f.ci]+=ok;R2.served+=ok;if(f.bz)R2.bizSrv[f.c]+=ok;if(e.rank<=2)R2.peered+=ok;if(e.k==='t'){const m=R2.tNet[e.id]||(R2.tNet[e.id]={});m[f.n]=(m[f.n]||0)+ok;
|
||||
// Backhaul to transit: users notice the round trip to the exit. Up to 20 ms (about 1,500 km) is free, then
|
||||
|
|
@ -212,8 +217,9 @@ function compute(){
|
|||
// Index loops in here: plain for…of allocates an iterator per loop until V8 has optimised compute().
|
||||
for(let fi=0,FN=flows.length;fi<FN;fi++){f=flows[fi];
|
||||
if(f.rem<=1e-6||(rank===0&&!f.cache)||(pass&&!pass(f)))continue;
|
||||
const lst=byRank[f.n][rank];if(!lst)continue;
|
||||
Dv=SDi[f.ci];Pv=SPi[f.ci];PP=walked[f.ci]||(walked[f.ci]=[]);vis++;
|
||||
if(f.pin){for(const e of ingressE[f.pin]||[])if(rank0(e)===rank&&e.used<e.cap&&Dv[e.ci]<Infinity)send(e,f.rem);continue;}
|
||||
const lst=byRank[f.n][rank];if(!lst)continue;
|
||||
/* Groups are tried nearest first, preferred exits before the rest, in the order a stable sort of the usable
|
||||
exits gives. Exits only fill up once tried, so the usable ones stay the same until then. Nearly every flow
|
||||
fits in its first group: find that one with a scan (nothing is visited yet), and sort only what is left
|
||||
|
|
@ -259,7 +265,7 @@ function compute(){
|
|||
for(const e of E){if(e.k==='t')R2.useT[e.id]=(R2.useT[e.id]||0)+e.used;else if(e.k==='ix')R2.useIx[e.id]=e.used;else if(e.k==='p')R2.usePni[e.id]=e.used;else R2.useCache[e.id]=e.used;}
|
||||
// money
|
||||
const C=R2.cost,V=R2.rev,pm=S.priceMul;
|
||||
C.pops=Object.values(S.pops).reduce((a,p)=>a+POP_MO+((p.routers||1)-1)*ROUTER_MO+cageMo(p.routers)+(p.routers||1)*RG[p.rgen||0].mo+(p.gen?GEN_MO:0),0);
|
||||
C.pops=Object.entries(S.pops).reduce((a,[c,p])=>a+popMo(c)+((p.routers||1)-1)*ROUTER_MO+cageMo(p.routers)+(p.routers||1)*RG[p.rgen||0].mo+(p.gen?GEN_MO:0),0);
|
||||
C.optical=S.links.filter(l=>l.kind==='df').reduce((a,l)=>a+(l.ready>S.day?0:ampCount(l.km)*AMP_MO*(l.own&&isRdm(l.sys)&&!l.sub?Math.max(1,l.pairs|0):1)+(l.regen|0)*REGEN_MO)+(l.spares?Math.round(150+(l.ch||[]).length*80):0),0);
|
||||
C.links=S.links.reduce((a,l)=>a+(l.mo||0),0);
|
||||
C.nni=(S.nni||[]).reduce((a,x)=>a+NNI[x.tier].mo,0);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ function sanitize(s){
|
|||
['pops','ixp','rs','peers','myIx','done','ev','stats','ixn','ixPref','ixSite','confReg','ach','pairMet'].forEach(obj);
|
||||
s.v=1;s.name=String(s.name==null?'Packet Pals':s.name).slice(0,24);s.day=int(s.day,0,1e7,0);s.cash=num(s.cash,0);s.asn=int(s.asn,1,4294967294,200000);
|
||||
s.priceMul=num(s.priceMul,1);s.nextFail=num(s.nextFail,s.day+45);s.nextEvent=num(s.nextEvent,s.day+40);s.lvl=int(s.lvl,1,LEVELS.length,1);s.neg=int(s.neg,0,1e7,0);s.loanStrikes=int(s.loanStrikes,0,1e3,0);
|
||||
s.autoSales=s.autoSales===true;s.autoRepair=s.autoRepair===true;
|
||||
for(const k of Object.keys(s.stats)){const v=s.stats[k];if(k==='by'||k==='f'){if(!v||typeof v!=='object')s.stats[k]={};else for(const j of Object.keys(v))v[j]=num(v[j],0);}else if(typeof v!=='boolean')s.stats[k]=num(v,0);}
|
||||
for(const k of ['survived','incidents','peak'])s.stats[k]=num(s.stats[k],0);
|
||||
for(const c of Object.keys(s.pops)){const p=s.pops[c];if(!isCity(c)||!p||typeof p!=='object'){delete s.pops[c];continue;}p.routers=int(p.routers,1,RMAX,1);if(p.rupDay!==undefined)p.rupDay=num(p.rupDay,-1);if(p.rgen!==undefined)p.rgen=int(p.rgen,0,RG.length-1,0);p.down=num(p.down,0);if(p.bb&&typeof p.bb==='object')p.bb.d=num(p.bb.d,0);else p.bb=null;}
|
||||
|
|
@ -22,7 +23,9 @@ function sanitize(s){
|
|||
links, with all of them carrying traffic, so the pair keeps that metric and nothing goes on standby. */
|
||||
{const pm=s.pairMet,lo={};for(const l of s.links){if(l.metric!==undefined){const k=edgeKey(l),m=own(MET,l.metric)?l.metric:'normal';if(!lo[k]||MET[m].f<MET[lo[k]].f)lo[k]=m;}if(l.standby!==true)delete l.standby;}
|
||||
for(const l of s.links){const k=edgeKey(l);if(lo[k]&&l.metric===undefined)lo[k]='normal';delete l.metric;}
|
||||
for(const k in lo)pm[k]=lo[k];const ks=new Set(s.links.map(edgeKey));for(const k of Object.keys(pm))if(!ks.has(k)||!own(MET,pm[k])||pm[k]==='normal')delete pm[k];}
|
||||
for(const k in lo)pm[k]=lo[k];const ks=new Set(s.links.map(edgeKey));for(const k of Object.keys(pm)){const v=pm[k];
|
||||
if(v&&typeof v==='object'&&ks.has(k)){const mk=v.k==='w'?'w':'f';pm[k]={k:mk,v:clampM(mk,num(v.v,mk==='w'?60:1))};continue;}
|
||||
if(!ks.has(k)||typeof v!=='string'||!own(MET,v)||v==='normal')delete pm[k];}}
|
||||
const degO=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;
|
||||
s.transit=s.transit.filter(t=>t&&isCity(t.city)&&isNet(t.net)).map(t=>(t.lacp=degO(t.lacp),t.site=['a','b','ab'].includes(t.site)?t.site:'a',t.id=sid(t.id),t.tier=tier(t.tier),t.n=lag(t.n),t.down=num(t.down,0),t.clean=!!t.clean,t.premium=premOnlyAt(NET[t.net],t.city)||!!t.premium&&premCity(NET[t.net],t.city),t));
|
||||
s.pni=s.pni.filter(x=>x&&isCity(x.city)&&isNet(x.net)).map(x=>(x.lacp=degO(x.lacp),x.site=['a','b','ab'].includes(x.site)?x.site:'a',x.id=sid(x.id),x.tier=tier(x.tier),x.n=lag(x.n),x.sacrif=!!x.sacrif,x));
|
||||
|
|
@ -60,10 +63,15 @@ function sanitize(s){
|
|||
if(!Array.isArray(s.scrubs))s.scrubs=s.scrubAt&&isCity(s.scrubAt)?[{city:s.scrubAt,tier:s.scrubTier}]:[];delete s.scrubAt;delete s.scrubTier;
|
||||
{const seen=new Set();s.scrubs=s.scrubs.filter(x=>x&&typeof x==='object'&&isCity(x.city)&&s.pops[x.city]&&!seen.has(x.city)&&seen.add(x.city)).map(x=>({city:x.city,tier:int(x.tier,0,SCRUB_TIERS.length-1,0)}));}
|
||||
s.scrubMode=s.scrubMode==='ondemand'?'ondemand':'always';
|
||||
if(s.ev&&s.ev.ddos){const a=s.ev.ddos;
|
||||
if(!a||typeof a!=='object'||!isCity(a.city)||!own(DDOS_VEC,a.vec))delete s.ev.ddos;
|
||||
else{a.gbps=num(a.gbps,2);a.until=num(a.until,s.day);a.bh=!!a.bh;a.ixbh=!!a.ixbh;a.start=num(a.start,s.day);
|
||||
if(!a.entry||typeof a.entry!=='object')a.entry={k:'edge',lab:''};else{a.entry.lab=String(a.entry.lab||'').slice(0,60);a.entry.id=a.entry.id==null?undefined:String(a.entry.id).slice(0,40);}}}
|
||||
// Keep the legacy primary attack so old saves and imports remain compatible; additional floods overlap it.
|
||||
const repairAttack=a=>{if(!a||typeof a!=='object'||!isCity(a.city)||!s.pops[a.city]||!own(DDOS_VEC,a.vec))return null;
|
||||
a.id=sid(a.id);a.gbps=Math.max(0,num(a.gbps,2));a.until=num(a.until,s.day);a.bh=!!a.bh;a.ixbh=!!a.ixbh;a.start=Math.max(0,Math.min(s.day,num(a.start,s.day)));a.until=Math.min(a.until,a.start+7);
|
||||
if(Array.isArray(a.entries)){a.entries=a.entries.filter(en=>en&&['t','ix','p'].includes(en.k)&&isCity(en.city)&&typeof en.id==='string'&&Number.isFinite(+en.share)&&+en.share>0).slice(0,3000).map(en=>({k:en.k,id:en.id.slice(0,40),city:en.city,lab:String(en.lab||'').slice(0,60),share:+en.share}));const sum=a.entries.reduce((n,en)=>n+en.share,0);if(Number.isFinite(sum)&&sum>0)for(const en of a.entries)en.share/=sum;else delete a.entries;}else delete a.entries;
|
||||
a.sla=Array.isArray(a.sla)?a.sla.filter(x=>typeof x==='string').slice(0,s.biz.length):[];
|
||||
if(!a.entry||typeof a.entry!=='object')a.entry={k:'edge',lab:''};else{a.entry.lab=String(a.entry.lab||'').slice(0,60);a.entry.id=a.entry.id==null?undefined:String(a.entry.id).slice(0,40);}return a;};
|
||||
const attacks=[s.ev.ddos,...(Array.isArray(s.ev.ddosMore)?s.ev.ddosMore:[])].map(repairAttack).filter(Boolean).slice(0,14);
|
||||
if(attacks.length)s.ev.ddos=attacks[0];else delete s.ev.ddos;s.ev.ddosMore=attacks.slice(1);
|
||||
s.ddosStarts=(Array.isArray(s.ddosStarts)?s.ddosStarts:attacks.map(a=>a.start)).filter(d=>typeof d==='number'||typeof d==='string').map(Number).filter(d=>Number.isFinite(d)&&d>s.day-7&&d<=s.day).sort((a,b)=>a-b).slice(-14);
|
||||
s.auV=s.auV===1?1:0;if(s.auNews!==true)delete s.auNews;
|
||||
// Badges: S.ach[id] is the day it was earned (any save); S.achP[id] the variant (2.0). A missing variant is the standard one.
|
||||
for(const k of Object.keys(s.ach))s.ach[k]=num(s.ach[k],0);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ 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>`:'';}
|
||||
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)});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
function cnOk(){return S.cnLic&&S.cnLic.state==='ok';}
|
||||
function regionMult(c){const C=CITY[c];if(!C||C.cn)return 1;if(C.kr)return KR_TRANSIT;if(C.au)return AU_TRANSIT;if(C.tape)return 1.5;return C.reg==='AS'?2.5:C.reg==='AF'?2:C.reg==='OC'?1.8:C.reg==='SA'?1.6:1;}
|
||||
// Few networks in the building means few transit sellers to haggle with: up to 1.8× where almost nobody is present.
|
||||
// Hand-set markets (Korea, Australia, Belgian red tape) keep their own price.
|
||||
const txComp=c=>{const q=CITY_PDB[c];return q?clamp((1000/Math.max(q[1],10))**0.15,1,1.8):1;};
|
||||
// No neutral data center means building your own room: POPs cost more to build and to run.
|
||||
const colo=c=>{const q=CITY_PDB[c];return !q?1:q[0]===0?1.5:q[0]<=2?1.25:1;};
|
||||
const popMo=c=>Math.round(POP_MO*colo(c));
|
||||
function regionMult(c){const C=CITY[c];if(!C||C.cn)return 1;if(C.kr)return KR_TRANSIT;if(C.au)return AU_TRANSIT;if(C.tape)return 1.5;const base=C.reg==='AS'?2.5:C.reg==='AF'?2:C.reg==='OC'?1.8:C.reg==='SA'?1.6:1;return Math.round(base*txComp(c)*10)/10;}
|
||||
// A network's own markup on top of that, where it is far from home (Glowball Sakura Lager in Asia and New Zealand).
|
||||
const netMult=(n,c)=>regionMult(c)*((n&&n.far&&CITY[c]&&n.far[CITY[c].reg])||1);
|
||||
const uaePair=(a,b)=>!!CITY[a].uae&&!!CITY[b].uae;
|
||||
|
|
|
|||
|
|
@ -25,58 +25,82 @@ function lagsN(){const o=[];for(const t of S.transit)if((t.n||1)>=2&&!(t.down>S.
|
|||
for(const p of S.pni)if((p.n||1)>=2)o.push({k:'p',id:p.id,o:p,n:p.n,lab:tr('incidents_and_ddos.pni_lag_with_name_in_city',{name:NET[p.net].name,city:CITY[p.city].name})});
|
||||
for(const x in S.ixp){const n=(S.ixn||{})[x]||1;if(n>=2&&!S.myIx[x])o.push({k:'ix',id:x,n,lab:ixNamesCity(x)?tr('incidents_and_ddos.ix_lag',{ix:ixName(x)}):tr('incidents_and_ddos.ix_lag_in_city',{ix:ixName(x),city:CITY[ixCity(x)].name})});}return o;}
|
||||
// Where the junk comes in: one of the city's live uplinks, or just "the edge" if it has none yet.
|
||||
// The primary slot remains compatible with older saves; every system uses the full live set.
|
||||
function ddosAll(s=S,live=true){return [s.ev.ddos,...(s.ev.ddosMore||[])].filter(a=>a&&(!live||a.until>s.day));}
|
||||
const ddosFind=id=>ddosAll().find(a=>id===undefined||a.id===id);
|
||||
function ddosDrop(a){const left=ddosAll(S,false).filter(x=>x!==a);S.ev.ddos=left[0]||null;S.ev.ddosMore=left.slice(1);}
|
||||
function ddosExpire(){for(const a of ddosAll(S,false))if(a.until<=S.day||!S.pops[a.city]){ddosDone(a);ddosDrop(a);}}
|
||||
function ddosEntries(){const ports=Object.values(R.ingressPorts||{}).filter(p=>p.cap>0),busy=ports.some(p=>p.traffic>1e-6),weight=p=>busy?p.traffic:p.cap,total=ports.reduce((n,p)=>n+weight(p),0);
|
||||
return total>0?ports.filter(p=>weight(p)>0).map(p=>({k:p.k,id:p.id,city:p.city,lab:p.lab,share:weight(p)/total})):[];}
|
||||
function ddosSlices(a){if(!a.entries?.length)return [a];const groups={};
|
||||
for(const en of a.entries){const c=S.pops[en.city]?en.city:a.city;(groups[c]||(groups[c]=[])).push(en);}
|
||||
return Object.entries(groups).map(([city,entries])=>({...a,parent:a,city,entries,gbps:a.gbps*entries.reduce((n,en)=>n+en.share,0)}));}
|
||||
const ddosCities=a=>[...new Set([a.city,...(a.entries||[]).map(en=>en.city)])].filter(c=>S.pops[c]);
|
||||
const ddosHasIx=a=>ddosCities(a).some(hasIxAt);
|
||||
const ddosSf=a=>Math.min(1,...ddosCities(a).map(c=>sfOf(R,c)));
|
||||
function ddosReport(a){const ms=(R.ddos||[]).filter(m=>m.attack===a||m.attack.parent===a);if(!ms.length)return ddosMitigation(a);
|
||||
const parts={};for(const m of ms)for(const x of m.sp?.parts||[]){const q=parts[x.city]||(parts[x.city]={city:x.city,tier:x.tier,a:0,cleaned:0});q.a+=x.a;q.cleaned+=x.cleaned;}
|
||||
return {attack:a,blackhole:ms.some(m=>m.blackhole),upstream:ms.some(m=>m.upstream),reaching:ms.reduce((n,m)=>n+m.reaching,0),flowspec:ms.reduce((n,m)=>n+m.flowspec,0),fsMissing:ms.some(m=>m.fsMissing),filtered:ms.reduce((n,m)=>n+m.filtered,0),sp:Object.keys(parts).length?{parts:Object.values(parts)}:null,near:ms.find(m=>m.near)?.near||null,leak:ms.reduce((n,m)=>n+m.leak,0)};}
|
||||
function ddosEntry(c){const o=[];
|
||||
for(const t of S.transit)if(t.city===c&&!(t.down>S.day))o.push({k:'t',id:t.id,lab:tr('common.net_transit',{net:NET[t.net].name})});
|
||||
for(const x of ixIdsIn(c))if(S.ixp[x]!==undefined)o.push({k:'ix',id:x,lab:tr('common.ix_peering',{ix:ixName(x)})});
|
||||
for(const p of S.pni)if(p.city===c)o.push({k:'p',id:p.id,lab:tr('common.pni_with_net',{net:NET[p.net].name})});
|
||||
return o.length?pick(o):{k:'edge',lab:''};}
|
||||
// Flowspec capability of the router in a city: 0 none, 1 basic, 2 full. The flood is filtered where the
|
||||
// victim POP's own router has the TCAM for it.
|
||||
// Flowspec capability at each ingress POP: 0 none, 1 basic, 2 full.
|
||||
const fsAt=c=>{const p=S.pops[c];return p?(RG[p.rgen||0].fs||0):0;};
|
||||
// Scrubbing residual for an attack: clean up to the center's capacity (to 15%), overflow leaks. On-demand
|
||||
// Scrubbing removes attack traffic up to the center's capacity; overflow leaks. On-demand
|
||||
// does nothing for the first couple of days while traffic is being diverted.
|
||||
function scrubEngaged(atk){return hasScrub()&&(S.scrubMode==='always'||(S.day-(atk.start||S.day))>=SCRUB_DELAY);}
|
||||
function scrubEngaged(atk){return hasScrub()&&(S.scrubMode==='always'||(S.day-(atk.start??S.day))>=SCRUB_DELAY);}
|
||||
// Several centers (#117): the flood goes to the nearest working one, and what it cannot take spills to the next.
|
||||
// A center in another city only helps if the backbone can carry the flood there; routing works that out.
|
||||
const scrubFar=c=>{const a=S.ev&&S.ev.ddos;return a&&a.until>S.day&&a.city===c&&(R.haul||[]).find(q=>q.city===c&&q.ms!==null&&q.ms>=SCRUB_FAR_MS)||null;};
|
||||
function scrubPlan(atk){if(!scrubEngaged(atk))return null;const c=atk.city;let g=atk.gbps||0;const parts=[];
|
||||
for(const x of S.scrubs.filter(x=>popUp(x.city)&&(x.city===c||pathExists(c,x.city))).sort((a,b)=>(a.city===c?0:kmBetween(c,a.city))-(b.city===c?0:kmBetween(c,b.city)))){if(g<=0)break;const a=Math.min(g,SCRUB_TIERS[x.tier||0].g);parts.push({city:x.city,tier:x.tier||0,a});g-=a;}
|
||||
const scrubFar=c=>ddosAll().some(a=>ddosCities(a).includes(c))&&(R.haul||[]).find(q=>q.city===c&&q.ms!==null&&q.ms>=SCRUB_FAR_MS)||null;
|
||||
function scrubPlan(atk,g=atk.gbps||0,room={},take=null){if(!scrubEngaged(atk))return null;const c=atk.city;const parts=[];
|
||||
for(const x of S.scrubs.filter(x=>popUp(x.city)&&(x.city===c||pathExists(c,x.city))).sort((a,b)=>(a.city===c?0:kmBetween(c,a.city))-(b.city===c?0:kmBetween(c,b.city)))){if(g<=0)break;const cap=SCRUB_TIERS[x.tier||0].g,a=Math.min(g,room[x.city]??cap);if(a<=0)continue;const cleaned=take?take(x,a):a;room[x.city]=(room[x.city]??cap)-cleaned;parts.push({city:x.city,tier:x.tier||0,a,cleaned});g-=cleaned;}
|
||||
return parts.length?{parts,leak:g}:null;}
|
||||
// What still lands on the city if every haul gets through: 15% of what is scrubbed, plus whatever no center can take.
|
||||
const scrubIdeal=p=>p?p.parts.reduce((s,x)=>s+x.a*0.15,0)+p.leak:Infinity;
|
||||
// One accounting pipeline for routing and the NOC: upstream -> edge -> scrubbing -> leakage.
|
||||
function ddosMitigation(a,room={},blackhole=a.bh,plan=true){const entries=a.entries?.length?a.entries:[{...(a.entry||{}),share:1}],total=entries.reduce((n,en)=>n+en.share,0),ingress=[];
|
||||
let upstream=false,reaching=0,g=0,flowspec=0,fsMissing=false;
|
||||
for(const en of entries){const t=en.k==='t'?S.transit.find(x=>x.id===en.id):null,p=en.k==='p'?S.pni.find(x=>x.id===en.id):null,clean=!!(t&&t.clean);
|
||||
upstream=upstream||clean;let part=blackhole?0:a.gbps*en.share/total*(clean?0.1:1);reaching+=part;
|
||||
if(DDOS_VEC[a.vec]?.fs){const cap=fsAt(S.pops[en.city]?en.city:a.city),before=part;part*=FS_RES[cap];flowspec+=before-part;if(cap===0&&before>0)fsMissing=true;}
|
||||
if(a.ixbh&&hasIxAt(a.city))part*=0.5;
|
||||
if(p&&p.sacrif)part=Math.min(part,liveCap(pniG(p),p.city,p.site,p.n)*0.9);
|
||||
if(teRules()?.blackhole&&!blackhole)part=0;
|
||||
g+=part;ingress.push({entry:en,g:part});}
|
||||
const filtered=reaching-g,sp=plan&&g>0?scrubPlan(a,g,room):null;
|
||||
return {attack:a,blackhole,upstream,reaching,flowspec,fsMissing,filtered,ingress,sp,leak:sp?sp.leak:g};}
|
||||
// The NOC's live attack view: what is hitting you, what each tool would do about it right now, and the buttons.
|
||||
function ddosPanel(){
|
||||
const a=S&&S.ev&&S.ev.ddos;if(!a||a.until<=S.day||!S.pops[a.city])return '';
|
||||
const V=DDOS_VEC[a.vec]||{n:'?',fs:false},cap=fsAt(a.city),model=RG[(S.pops[a.city].rgen||0)].n,en=a.entry||{};
|
||||
const cleanT=en.k==='t'?S.transit.find(x=>x.id===en.id):null, sacP=en.k==='p'?S.pni.find(x=>x.id===en.id):null;
|
||||
let mult=1;
|
||||
if(V.fs&&cap)mult=Math.min(mult,FS_RES[cap]);
|
||||
if(cleanT&&cleanT.clean)mult=Math.min(mult,0.1);
|
||||
if(a.ixbh&&hasIxAt(a.city))mult=Math.min(mult,0.5);
|
||||
const sp=scrubPlan(a),useS=!!sp&&scrubIdeal(sp)<a.gbps*mult,hl=x=>(R.haul||[]).find(q=>q.city===a.city&&q.to===x.city);
|
||||
let land=a.bh?0:useS?sp.parts.reduce((t,x)=>{const q=x.city===a.city?null:hl(x);return t+x.a*0.15+(q?(q.a-q.h)*0.85:0);},sp.leak):a.gbps*mult;
|
||||
if(sacP&&sacP.sacrif)land=Math.min(land,liveCap(PORT[sacP.tier].g,sacP.city,sacP.site,sacP.n)*0.9);
|
||||
land=Math.round(land);
|
||||
const fsLine=!V.fs?'— '+tr('incidents_and_ddos.flowspec_cannot_catch_an_vec',{vec:esc(V.n)})
|
||||
:cap>=2?'✓ '+tr('incidents_and_ddos.flowspec_on_your_model_is_dropping',{model:esc(model),vec:esc(V.n)})
|
||||
:cap===1?'~ '+tr('incidents_and_ddos.flowspec_on_your_model_trims_vec',{model:esc(model),vec:esc(V.n)})
|
||||
:'— '+tr('incidents_and_ddos.your_model_here_has_no_flowspec',{model:esc(model)});
|
||||
const scrOne=x=>{const T=SCRUB_TIERS[x.tier],q=x.city===a.city?null:hl(x);
|
||||
return q&&q.h<q.a-0.5?'~ '+tr('incidents_and_ddos.your_backbone_can_only_haul_g',{g:fmtG(q.h),city:esc(CITY[x.city].name)})
|
||||
:q&&q.ms!==null?'✓ '+tr('incidents_and_ddos.tier_scrubbing_in_city_is_cleaning',{tier:T.n,city:esc(CITY[x.city].name),ms:Math.round(q.ms)})
|
||||
:'✓ '+tr('incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6',{tier:T.n,city:esc(CITY[x.city].name)});};
|
||||
function ddosPanel(){return S?ddosAll().filter(a=>S.pops[a.city]).map(ddosOne).join(''):'';}
|
||||
function ddosOne(a){
|
||||
const V=DDOS_VEC[a.vec]||{n:'?',fs:false},en=a.entry||{};
|
||||
const sacP=en.k==='p'?S.pni.find(x=>x.id===en.id):null;
|
||||
const m=ddosReport(a),sp=m.sp,hl=x=>{const qs=(R.haul||[]).filter(q=>q.to===x.city&&q.attack===a.id);return qs.length?{a:qs.reduce((n,q)=>n+q.a,0),h:qs.reduce((n,q)=>n+q.h,0)}:null;};
|
||||
const landLine=m.blackhole?'~ '+tr('incidents_and_ddos.blackholed_the_junk_is_gone_and',{city:esc(CITY[a.city].name)})
|
||||
:m.upstream?'✓ '+tr('incidents_and_ddos.after_upstream_scrubbing_g',{g:fmtG(m.reaching)}):'';
|
||||
const fsLine=!V.fs?'— '+tr('incidents_and_ddos.flowspec_cannot_catch_vec',{vec:esc(V.n)})
|
||||
:m.flowspec<=1e-6?'— '+tr('incidents_and_ddos.no_flowspec_filtering_ingress')
|
||||
:m.fsMissing?'~ '+tr('incidents_and_ddos.flowspec_dropping_g_some_ingress',{g:fmtG(m.flowspec)})
|
||||
:'✓ '+tr('incidents_and_ddos.flowspec_dropping_g',{g:fmtG(m.flowspec)});
|
||||
const used=c=>(R.ddos||[m]).reduce((n,q)=>n+(q.sp?.parts||[]).filter(x=>x.city===c).reduce((t,x)=>t+x.cleaned,0),0);
|
||||
const scrOne=x=>{const T=SCRUB_TIERS[x.tier],q=hl(x),total=used(x.city);
|
||||
return (x.cleaned>1e-6?'✓ ':'~ ')+tr('incidents_and_ddos.scrubbing_in_city_used_capacity',{city:esc(CITY[x.city].name),used:fmtG(total),capacity:T.n})
|
||||
+(total>x.cleaned+1e-6?' · '+tr('incidents_and_ddos.this_attack_g',{g:fmtG(x.cleaned)}):'')
|
||||
+(q&&q.h<q.a-0.5?'<br>~ '+tr('incidents_and_ddos.your_backbone_can_only_haul_g',{g:fmtG(q.h),city:esc(CITY[x.city].name)}):'');};
|
||||
const scrLine=!hasScrub()?'— '+tr('incidents_and_ddos.no_scrubbing_center')
|
||||
:!scrubEngaged(a)?'… '+tr('incidents_and_ddos.on_demand_scrubbing_diverting_live',{n:Math.max(1,SCRUB_DELAY-(S.day-(a.start||S.day)))})
|
||||
:!sp?'— '+tr('incidents_and_ddos.no_scrubbing_center')
|
||||
:sp.parts.map(scrOne).join('<br>')+(sp.leak>0.5?'<br>~ '+tr('incidents_and_ddos.your_scrubbing_centers_are_full_g',{g:fmtG(sp.leak)}):'');
|
||||
const entryLine=cleanT&&cleanT.clean?'✓ '+tr('incidents_and_ddos.net_is_scrubbing_it_upstream_clean',{net:esc(NET[cleanT.net].name)})
|
||||
:sacP&&sacP.sacrif?'✓ '+tr('incidents_and_ddos.contained_on_your_sacrificial_net',{net:esc(NET[sacP.net].name)}):'';
|
||||
:!scrubEngaged(a)?'… '+tr('incidents_and_ddos.on_demand_scrubbing_diverting_live',{n:Math.max(1,SCRUB_DELAY-(S.day-(a.start??S.day)))})
|
||||
:!sp?'— '+(m.leak<=1e-6?tr('incidents_and_ddos.no_scrubbing_needed_after_edge'):tr('incidents_and_ddos.scrubbing_centers_unavailable_or_at'))
|
||||
:sp.parts.map(scrOne).join('<br>');
|
||||
const haulLine=m.near&&m.near.ms>0&&sp?.parts.some(x=>x.cleaned>1e-6)?'✓ '+tr('incidents_and_ddos.scrubbing_traffic_hauled_over_your',{city:esc(CITY[a.city].name),to:esc(CITY[m.near.city].name),ms:m.near.ms.toFixed(1)}):'';
|
||||
const entryLine=sacP&&sacP.sacrif?'✓ '+tr('incidents_and_ddos.contained_on_your_sacrificial_net',{net:esc(NET[sacP.net].name)}):'';
|
||||
let h=`<div class="inc" style="background:#FFE2E6;border:1px solid #FF8A9A">
|
||||
<div class="nm">🚨 ${tr('incidents_and_ddos.live_attack_city',{city:esc(CITY[a.city].name)})}</div>
|
||||
<div class="meta">${tr('incidents_and_ddos.size_vec_entry_n_d_left',{size:fmtG(a.gbps),vec:esc(V.n),entry:a.entry&&a.entry.lab?' · '+esc(a.entry.lab):'',n:a.until-S.day})}</div>
|
||||
<div class="meta"><b>${a.bh?tr('incidents_and_ddos.blackholed_the_junk_is_gone_and',{city:esc(CITY[a.city].name)}):tr('incidents_and_ddos.reaching_your_network_g',{g:fmtG(land)})}</b></div>
|
||||
${landLine?`<div class="meta"><b>${landLine}</b></div>`:''}
|
||||
${m.blackhole?'':`<div class="meta">${fsLine}</div>${entryLine?`<div class="meta">${entryLine}</div>`:''}
|
||||
${m.filtered-m.flowspec>1e-6?`<div class="meta">✓ ${tr('incidents_and_ddos.edge_filters_dropping_g',{g:fmtG(m.filtered-m.flowspec)})}</div>`:''}
|
||||
<div class="meta">${scrLine}</div>
|
||||
<div class="meta">${fsLine}</div>${entryLine?`\n <div class="meta">${entryLine}</div>`:''}
|
||||
<div class="btns">${a.bh?btn(tr('common.stop_blackholing'),'unrtbh',{},'ghost sm'):btn(tr('incidents_and_ddos.blackhole_the_target_rtbh'),'rtbh',{},'red sm')}${hasIxAt(a.city)&&!a.bh?btn(a.ixbh?tr('incidents_and_ddos.ix_blackhole_on'):tr('incidents_and_ddos.ix_blackhole_half_honour_it'),'ixbh',{},a.ixbh?'green sm':'sm'):''}${btn(tr('incidents_and_ddos.hackback_3000tm_20k'),'hackback',{},'sm',S.cash<20000)}</div>
|
||||
${haulLine?`<div class="meta">${haulLine}</div>`:''}
|
||||
<div class="meta">${m.leak>1e-6?'~ '+tr('incidents_and_ddos.g_is_leaking_through',{g:fmtG(m.leak)}):'✓ '+tr('incidents_and_ddos.attack_fully_mitigated')}</div>`}
|
||||
<div class="btns">${m.blackhole?btn(tr('common.stop_blackholing'),'unrtbh',{id:a.id},'ghost sm'):btn(tr('incidents_and_ddos.blackhole_the_target_rtbh'),'rtbh',{id:a.id},'red sm')}${ddosHasIx(a)&&!m.blackhole?btn(a.ixbh?tr('incidents_and_ddos.ix_blackhole_on'):tr('incidents_and_ddos.ix_blackhole_half_honour_it'),'ixbh',{id:a.id},a.ixbh?'green sm':'sm'):''}${btn(tr('incidents_and_ddos.hackback_3000tm_20k'),'hackback',{id:a.id},'sm',S.cash<20000)}</div>
|
||||
<p class="meta">${tr('incidents_and_ddos.rtbh_is_free_and_instant_but')}</p></div>`;
|
||||
return h;}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ function fireFailure(){
|
|||
if(S.transit.some(t=>!(t.down>S.day)))opts.push(['transit',3]);
|
||||
if(Object.keys(S.ixp).length)opts.push(['ixloop',2]);
|
||||
if(S.transit.length&&S.day>60)opts.push(['leak',2]);
|
||||
// Flood Season brings its own; Change Freeze has none, BGP at 3 a.m. twice as many.
|
||||
if(S.day>40&&!scnRule('ddos')&&rule('chaos')!=='calm')opts.push(['ddos',rule('chaos')==='spicy'?4:2]);
|
||||
// Flood Season brings its own; Change Freeze (calm) has none. Spicy chaos or gaming customers put DDoS on its own,
|
||||
// busier schedule (ddosTick) instead of this one, so it is never counted twice.
|
||||
if(S.day>40&&!scnRule('ddos')&&!ddosOff()&&!ddosSpicy())opts.push(['ddos',2]);
|
||||
if(fabsUsed.length)opts.push(['fabric',1.5]);
|
||||
const lit=S.links.filter(l=>l.kind==='df'&&dfCap(l)>0&&!linkDown(l));if(lit.length)opts.push(['amp',1.5+lit.length*0.3],['optic',1.5+lit.length*0.3]);
|
||||
opts.push(['funny',4]);
|
||||
|
|
@ -112,27 +113,56 @@ function fireFailure(){
|
|||
else{const paused=pref('pauseIncident')&&autoPause();toast(`<b>${incTitle(type)}</b><br>${esc(last.msg)}${paused?`<br><b>${tr('common.game_paused')}</b>`:''}`,'bad',(last.cost?[{l:`${last.fix||tr('common.rush_repair')} ${fmt$(last.cost)}`,act:'fixInc',args:{id:last.id}}]:[]).concat(paused?[resumeAct()]:[]),incOpen(last));}
|
||||
sfx('alert');
|
||||
}
|
||||
// A DDoS attack: mostly short, modest spikes; now and then a "botnet of toasters" monster into the terabits.
|
||||
// In Flood Season (scenario rule ddos) they come more often, a third are monsters, and they grow over the year.
|
||||
function ddosAttack(){const type='ddos',fl=scnRule('ddos'),grow=fl?1+S.day/180:1;if(S.ev.ddos&&S.ev.ddos.until>S.day)ddosDone(S.ev.ddos);
|
||||
const c=pick(Object.keys(S.pops)),vec=pick(Object.keys(DDOS_VEC)),V=DDOS_VEC[vec];
|
||||
const monster=Math.random()<(fl?0.33:0.15),base=Math.max(R.cityDem[c]||0,4);
|
||||
const gbps=Math.round((monster?800+Math.random()*2600:2+Math.random()*Math.max(18,base*0.9))*grow);
|
||||
const dur=2+Math.floor(Math.random()*4),entry=ddosEntry(c);
|
||||
S.ev.ddos={city:c,vec,gbps,until:S.day+dur,entry,bh:false,start:S.day};
|
||||
const gamingCount=()=>S.biz.reduce((n,b)=>n+(BIZ_T[b.type]?.gaming?1:0),0);
|
||||
const ddosVectors=()=>Object.keys(DDOS_VEC).filter(k=>!DDOS_VEC[k].gaming||gamingCount()>0);
|
||||
// Expected starts per week in normal play; the rolling 14-start limit is a separate ceiling.
|
||||
// Spread gaming exposure over dozens of customers, including the first, rather than switching baselines.
|
||||
const ddosRate=()=>0.5+6.5*(1-Math.exp(-gamingCount()/50*(1+Math.max(1,S.lvl||1)/LEVELS.length)));
|
||||
const ddosPressure=()=>1-Math.exp(-(.01+Math.max(0,(S.lvl||1)-1)/12+gamingCount()/10+(scnRule('ddos')?.2+S.day/365:0)));
|
||||
// Normalize the vector mix so smaller gaming-only floods do not lower the advertised overall mean.
|
||||
function ddosSizeMean(){const stage=Math.max(1,S.lvl||1)/LEVELS.length,games=gamingCount(),fl=scnRule('ddos');
|
||||
const base=Math.max(10,(R.demand||0)*4/3*stage,fl?1400:0);
|
||||
if(fl)return base*(1+0.2*games/(games+10))*(1+S.day/365);
|
||||
// Relative to no gaming: 3x at one customer, 8x at 50, approaching the existing 12x balance.
|
||||
const mean=base*(games?1.2-0.9*Math.pow(4/9,(games-1)/49):0.1),vectors=ddosVectors(),weight=vectors.reduce((n,k)=>n+(DDOS_VEC[k].gaming?1/3:1),0)/vectors.length;
|
||||
return mean/weight;}
|
||||
// Normal rolls: 98% uniform 0.2–2, 2% uniform 8–12. Their mean is 1.278, so spikes do not inflate the balance.
|
||||
const ddosSizeMax=()=>ddosSizeMean()*(scnRule('ddos')?1.5:12/1.278);
|
||||
function ddosSize(vec){const fl=scnRule('ddos'),r=Math.random(),roll=fl?1/3+r*2/3:(r<.98?.2+1.8*r/.98:8+4*(r-.98)/.02)/12;
|
||||
const raw=ddosSizeMax()*(DDOS_VEC[vec].gaming?1/3:1)*roll;
|
||||
return fl?Math.max(2,Math.floor(raw)):Math.max(0.001,Math.floor(raw*1000)/1000);}
|
||||
// Calm (Change Freeze) and no chaos at all mean no attacks, gamers or not.
|
||||
const ddosOff=()=>{const c=rule('chaos');return c==='calm'||c==='none';};
|
||||
// More frequent attacks are opt-in: the spicy chaos setting, or hosting gamers (who attract them in real life).
|
||||
const ddosSpicy=()=>!ddosOff()&&(rule('chaos')==='spicy'||gamingCount()>0);
|
||||
function ddosTick(){if(ddosOff()&&!scnRule('ddos'))return;if(scnRule('ddos')){let next=+S.scn.nextDdos||3,n=0;
|
||||
// Unless spicy, floods take turns as they always did: the next one waits until the last is over.
|
||||
if(!ddosSpicy()&&ddosAll().length)return;
|
||||
while(S.day>=next&&n++<2){ddosAttack(false);next+=floodGap();}S.scn.nextDdos=next<S.day?S.day+floodGap():next;}
|
||||
else if(ddosSpicy()&&(S.day>40||gamingCount()))for(let i=0;i<2;i++)if(Math.random()<ddosRate()/14)ddosAttack(false);}
|
||||
// Size, duration and starts are randomized independently; overlapping floods never replace each other.
|
||||
function ddosAttack(recompute=true){const type='ddos',fl=scnRule('ddos');ddosExpire();
|
||||
S.ddosStarts=(S.ddosStarts||[]).filter(d=>d>S.day-7&&d<=S.day);if(S.ddosStarts.length>=14||!Object.keys(S.pops).length)return;S.ddosStarts.push(S.day);
|
||||
const c=pick(Object.keys(S.pops)),vec=pick(ddosVectors()),V=DDOS_VEC[vec];
|
||||
const gbps=ddosSize(vec);
|
||||
const dur=1+Math.floor(Math.random()*(1+6*ddosPressure())),entry=ddosEntry(c);
|
||||
const entries=ddosEntries(),a={id:uid(),city:c,vec,gbps,until:S.day+dur,entry:entries.length>1?{k:'distributed',lab:tr('common.distributed_ingress')}:entries[0]||entry,entries,bh:false,start:S.day};
|
||||
if(!S.ev.ddos)S.ev.ddos=a;else(S.ev.ddosMore||(S.ev.ddosMore=[])).push(a);
|
||||
const soaked=(V.fs&&fsAt(c))||hasScrub();
|
||||
const how=entry&&entry.lab?tr('failures.in_via_e',{e:entry.lab}):'';
|
||||
const how=entries.length>1?tr('failures.across_n_transit_and_peering_ports',{n:entries.length}):entry&&entry.lab?tr('failures.in_via_e',{e:entry.lab}):'';
|
||||
const msg=tr('failures.a_size_vec_attack_is_hitting',{size:fmtG(gbps),vec:V.n,city:CITY[c].name,how})+' '+(soaked?tr('failures.your_mitigation_is_eating_most_of'):tr('failures.junk_traffic_is_eating_your_capacity'));
|
||||
if(fl)S.ev.ddos.who=pick(FLOOD_WHO);
|
||||
addInc({type,ref:c,until:S.day+dur,msg:fl?msg+' '+tr('failures.attacker_who',{who:tr(S.ev.ddos.who)}):msg,cost:0});
|
||||
if(fl)a.who=pick(FLOOD_WHO);
|
||||
addInc({type,ref:c,atk:a.id,until:S.day+dur,msg:fl?msg+' '+tr('failures.attacker_who',{who:tr(a.who)}):msg,cost:0});
|
||||
if(soaked){S.stats.survived++;S.stats.ddosHeld=(S.stats.ddosHeld||0)+1;if(gbps>=1000)S.stats.ddosMonster=(S.stats.ddosMonster||0)+1;}
|
||||
compute();
|
||||
toast(`<b>${incTitle('ddos')}: ${esc(CITY[c].name)}</b><br>${esc(msg)}${fl?`<br><i>${esc(tr('failures.attacker_who',{who:tr(S.ev.ddos.who)}))}</i>`:''}`,soaked?'goal':'bad',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}],{a:'city',v:c});
|
||||
if(recompute){compute();a.worst=ddosSf(a);}
|
||||
toast(`<b>${incTitle('ddos')}: ${esc(CITY[c].name)}</b><br>${esc(msg)}${fl?`<br><i>${esc(tr('failures.attacker_who',{who:tr(a.who)}))}</i>`:''}`,soaked?'goal':'bad',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}],{a:'city',v:c});
|
||||
sfx('alert');}
|
||||
// When an attack is over: was it held? Held means the city under attack got at least 97% of its traffic every day.
|
||||
function ddosDone(a){if(!a||a.done)return;a.done=1;if(a.worst===undefined&&S.pops[a.city])a.worst=sfOf(R,a.city);const ok=(a.worst===undefined?1:a.worst)>=0.97;
|
||||
function ddosDone(a){if(!a||a.done)return;a.done=1;if(a.worst===undefined&&S.pops[a.city])a.worst=ddosSf(a);const ok=(a.worst===undefined?1:a.worst)>=0.97;
|
||||
if(ok){S.stats.ddosOk=(S.stats.ddosOk||0)+1;if(a.gbps>=1000)S.stats.ddosOkBig=(S.stats.ddosOkBig||0)+1;}else S.stats.ddosLost=(S.stats.ddosLost||0)+1;
|
||||
if(scnRule('ddos')){const who=tr(a.who||FLOOD_WHO[0]);toast(ok?tr('failures.flood_held_g_who_gave_up',{g:fmtG(a.gbps),who:who.charAt(0).toUpperCase()+who.slice(1)}):tr('failures.that_one_got_through_g_city',{g:fmtG(a.gbps),city:CITY[a.city]?CITY[a.city].name:tr('common.your_network'),p:pct(a.worst||0),who}),ok?'goal':'bad');}}
|
||||
// Flood Season: 3 to 7 days apart as before, shrinking with age, level and gamers only when attacks are spicy.
|
||||
const floodGap=()=>!ddosSpicy()?3+Math.floor(Math.random()*5):Math.max(0.05,(3+Math.random()*5)/(Math.sqrt(1+S.day/180)*(1+gamingCount()/10+Math.max(0,(S.lvl||1)-1)/12)));
|
||||
const FLOOD_WHO=[N_('failures.a_botnet_of_40_000_smart'),N_('failures.every_unpatched_baby_monitor_in'),N_('failures.a_gaming_clan_that_lost_one'),N_('failures.a_fridge_that_achieved_sentience_and'),N_('failures.a_crypto_bro_shorting_your_stock'),N_('failures.a_teenager_with_a_stolen_credit'),N_('failures.a_rival_isp_s_stress_test'),N_('failures.ten_thousand_smart_light_bulbs'),N_('failures.a_printer_just_one_printer_nobody'),N_('failures.a_botnet_run_from_a_cloud'),N_('failures.somebody_who_did_not_like_your'),N_('failures.the_internet_connected_kettles_of_a')];
|
||||
function incTitle(t){return {ring:tr('failures.metro_ring_cut'),site:tr('common.site_outage'),cut:tr('common.fiber_cut'),crash:tr('common.router_crash'),power:tr('common.power_outage'),transit:tr('common.upstream_outage'),ixloop:tr('common.ix_meltdown'),leak:tr('common.route_leak'),ddos:tr('common.ddos_attack'),fabric:tr('common.fabric_outage'),depeer:tr('common.peering_spat'),fatwave:tr('failures.fat_fingered_wave'),label:tr('failures.patch_panel_mishap'),mtu:tr('common.mtu_mismatch'),krroute:tr('failures.rerouted_via_hong_kong'),ctrlplane:tr('failures.control_plane_meltdown'),lacp:tr('common.lacp_trouble'),loss:tr('common.packet_loss'),pmtud:tr('failures.pmtud_black_hole'),oops:tr('common.oops'),cleaner:tr('common.vacuum_incident'),maxpfx:tr('failures.max_prefix_meltdown'),prepend:tr('common.prepend_ageddon'),rpki:tr('common.rpki_invalid'),amp:tr('common.amplifier_failure'),roadmff:tr('failures.fat_fingered_roadm'),optic:tr('common.dead_optic'),maint:tr('common.maintenance_window_3a92'),ac:tr('common.cooling_failure'),hijack:tr('common.bgp_hijack'),shutdown:tr('common.government_shutdown'),redsea:tr('failures.geopolitical_cable_cut')}[t]||tr('common.incident');}
|
||||
const LINKCUT_TR=['cut','redsea'],LINKCUT_ID=['fatwave','label'],POPDOWN=['crash','power','oops','cleaner','maint','shutdown'],IXDOWN=['ixloop','maxpfx'],TDOWN=['transit','prepend'],LINKEQ=['mtu','amp','roadmff','optic'];
|
||||
|
|
@ -147,7 +177,7 @@ function clearInc(i){
|
|||
else if(TDOWN.includes(T)){const t=S.transit.find(x=>x.id===i.ref);if(t)t.down=remainUntil(x=>TDOWN.includes(x.type)&&x.ref===i.ref);}
|
||||
else if(T==='rpki'||T==='hijack'){if(!S.inc.some(x=>x.type==='rpki'||x.type==='hijack'))S.ev.rpki=null;}
|
||||
else if(T==='leak'){S.ev.leak=null;}
|
||||
else if(T==='ddos'){const a=S.ev.ddos;if(a&&a.city===i.ref&&(a.start===undefined||a.start===i.start)){ddosDone(a);S.ev.ddos=null;}}
|
||||
else if(T==='ddos'){const a=ddosAll(S,false).find(a=>i.atk?a.id===i.atk:a.city===i.ref&&(a.start===undefined||a.start===i.start));if(a){ddosDone(a);ddosDrop(a);}}
|
||||
else if(T==='fabric'){if(S.ev.fab)S.ev.fab[i.ref]=remainUntil(x=>x.type==='fabric'&&x.ref===i.ref);}
|
||||
else if(T==='mtu'){const l=S.links.find(x=>x.id===i.ref);if(l)l.deg=remainUntil(x=>x.type==='mtu'&&x.ref===i.ref);}
|
||||
else if(T==='loss'){const l=S.links.find(x=>x.id===i.ref);if(l&&!S.inc.some(x=>x.type==='loss'&&x.ref===i.ref))l.loss=null;}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ function dayTick(){
|
|||
if(R&&R.teMoved)S.stats.teMax=Math.max(S.stats.teMax||0,R.teMoved);
|
||||
{const t1=!!S.won&&isTier1();if(S.t1Now&&!t1)toast(tr('day_tick.you_are_no_longer_tier_1',{why:t1Why()}),'bad');S.t1Now=t1;}
|
||||
if(S.grace&&S.grace.until===d){toast(tr('day_tick.the_courtesy_route_has_ended_new'),'bad',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}]);}
|
||||
{const a=S.ev.ddos;if(a&&a.until>d&&R&&S.pops[a.city])a.worst=Math.min(a.worst===undefined?1:a.worst,sfOf(R,a.city));}
|
||||
if(scnRule('ddos')&&!(S.scn.done||S.scn.failed)&&d>=(+S.scn.nextDdos||3)&&!(S.ev.ddos&&S.ev.ddos.until>d)){ddosAttack();S.scn.nextDdos=d+3+Math.floor(Math.random()*5);}
|
||||
for(const a of ddosAll(S,false))if(a.until>=d&&R&&S.pops[a.city])a.worst=Math.min(a.worst===undefined?1:a.worst,ddosSf(a));
|
||||
ddosExpire();
|
||||
ddosTick();
|
||||
if(R&&R.demand>0)S.stats.clean=R.served/R.demand>=0.995?(S.stats.clean||0)+1:0;
|
||||
if(S.scn&&S.scn.id==='redsea')S.stats.asiaRun=asiaG()>=RS_G?(S.stats.asiaRun||0)+1:0;
|
||||
if(S.ev.php===d)toast(tr('day_tick.the_internet_is_back_half_of'),'good');
|
||||
|
|
@ -24,6 +25,7 @@ function dayTick(){
|
|||
if(sf>=0.9){const g=(CITY[c].be&&!(p.boost>d)?0.35:1)*0.025*(scnRule('boom')?1.5:1)*(p.boost>d?2:1)*sf*(0.7+0.6*(R.peerShare||0))*(CITY[c].reg==='AS'&&!CITY[c].cn?1.6:1);p.bb.d+=g*p.bb.d*(1-p.bb.d/P);}
|
||||
else p.bb.d=Math.max(Math.min(3,P),p.bb.d*(1-(0.9-sf)*0.04));}
|
||||
compute();
|
||||
for(const a of ddosAll())a.worst=Math.min(a.worst??1,ddosSf(a));
|
||||
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)/30;
|
||||
S.stats.peak=Math.max(S.stats.peak,R.served);
|
||||
|
|
@ -33,9 +35,9 @@ function dayTick(){
|
|||
if(l.ready===d){toast(`<b>${l.own?tr('day_tick.your_fiber_is_finished_a_b',{a:CITY[l.a].name,b:CITY[l.b].name}):tr('day_tick.dark_fiber_handed_over_a_b',{a:CITY[l.a].name,b:CITY[l.b].name})}</b><br>${(l.ch||[]).length?tr('day_tick.channels_are_lighting_up_now'):tr('day_tick.it_is_dark_add_optics_to')}`,'goal',[{l:tr('common.open'),act:'selLink',args:{id:l.id}}]);sfx('coin');}
|
||||
if(l.own&&l.ready>d&&Math.random()<0.012){const extra=10+Math.floor(Math.random()*40);setCableReady(l,l.ready+leadDays(extra));toast(tr('day_tick.construction_delay_n_days_why_a',{n:leadDays(extra),why:pick(l.sub?SEA_DELAYS.map(x=>tr(x)):[tr('day_tick.archaeologists_found_a_roman'),tr('day_tick.a_protected_hamster_species_lives'),tr('day_tick.the_railway_changed_its_mind_about'),tr('day_tick.the_drilling_crew_hit_a_granite'),tr('day_tick.a_town_council_wants_a_public'),tr('day_tick.somebody_else_s_gas_main_was'),tr('day_tick.the_permit_office_lost_your_permit')]),a:CITY[l.a].name,b:CITY[l.b].name}),'bad');}}
|
||||
// DDoS protection SLA: if a protected customer's own city is hit and still goes down, you pay out (once per attack).
|
||||
if(S.ev.ddos&&S.ev.ddos.until>d){const a=S.ev.ddos;
|
||||
for(const b of S.biz)if(b.type==='scrub'&&b.city===a.city&&b.slaFor!==a.start&&sfOf(R,b.city)<0.85){
|
||||
b.slaFor=a.start;S.cash-=SLA_PEN;b.mood=Math.max(0,b.mood-18);S.stats.sla=(S.stats.sla||0)+1;
|
||||
for(const a of ddosAll()){
|
||||
for(const b of S.biz)if(b.type==='scrub'&&ddosCities(a).includes(b.city)&&!(a.sla||[]).includes(b.id)&&(a.id||b.slaFor!==a.start)&&sfOf(R,b.city)<0.85){
|
||||
(a.sla||(a.sla=[])).push(b.id);b.slaFor=a.start;S.cash-=SLA_PEN;b.mood=Math.max(0,b.mood-18);S.stats.sla=(S.stats.sla||0)+1;
|
||||
toast(tr('day_tick.sla_breach_name_the_attack_on',{name:esc(b.name),city:CITY[a.city].name,pen:fmt$(SLA_PEN)}),'bad');sfx('err');}}
|
||||
// businesses mood
|
||||
const ids=linkIds();for(const b of S.biz.slice()){if(eventTick(b,d)||capPendTick(b,d))continue;b.pm=b.mood;const sf=bizSf(b,ids),reachOk=BIZ_T[b.type].l2||BIZ_T[b.type].fiber||R.reach>0.99||scnRule('local'),scrubOk=b.type!=='scrub'||(hasScrub()&&!scrubFar(b.city)),divOk=reqOk(b);
|
||||
|
|
@ -83,6 +85,8 @@ function spawnOffer(){
|
|||
if(lv>=3&&MEGA.some(m=>mine.includes(m.c)))types.push('ingest');if(lv>=4&&MEGA.some(m=>mine.includes(m.c)))types.push('aiwan','aiwan','mtrain');if(lv>=4&&S.links.some(l=>l.kind==='df'&&l.own&&l.ready<=S.day))types.push('pairs');
|
||||
if(lv>=5)types.push('esport');if(lv>=6&&mine.length>=2)types.push('sov','sov');if(lv>=8)types.push('cgame','cgame');if(lv>=9)types.push('metav','metav');if(lv>=11&&MEGA.some(m=>mine.includes(m.c)))types.push('agi');if(lv>=13&&mine.length>=2)types.push('mars');
|
||||
const br=mine.filter(c=>CITY[c].br);if(br.length)types.push('provedor','provedor','provedor');
|
||||
// Countries with thousands of ASNs (Brazil's provedores, US regionals) are full of small ISPs shopping for transit.
|
||||
const dense=mine.filter(c=>(CITY_PDB[c]||[])[2]>=2000);if(lv>=2&&dense.length)types.push('isp');
|
||||
const fabC=mine.filter(c=>FABS.some(f=>f.cities.includes(c)));if(lv>=2&&fabC.length){types.push('fabip','fabip');if(mine.length>=2)types.push('fabl2');}
|
||||
const t=pick(types),T=BIZ_T[t];
|
||||
if(T.event||T.sdwan||T.fiber||T.mega){spawnSpecial(t);return;}
|
||||
|
|
@ -97,6 +101,7 @@ function spawnOffer(){
|
|||
let name=list.length?pick(list):(T.names?pick(T.names):'Startup #'+Math.floor(Math.random()*999));
|
||||
useName(name);
|
||||
if(t==='provedor')city=pick(br);
|
||||
if(t==='isp'&&dense.length&&Math.random()<0.5)city=pick(dense);
|
||||
if(t==='hft'){const fin=['nyc','chi','lon','fra','tok','sin','hkg','ams','ash'],mf=mine.filter(c=>fin.includes(c));city=mf.length?pick(mf):pick(mine);city2=pick(fin.filter(c=>c!==city));}
|
||||
let rate=T.l2?Math.round((150+kmBetween(city,city2)*0.08)*T.km):T.rate;
|
||||
if(CITY[city].au&&!T.l2&&!T.fiber&&!T.event){rate=Math.round(rate*AU_ARPU);bw=Math.min(bw,pick(T.opts.slice(0,2)));}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* ================= ACTIONS ================= */
|
||||
function spend(c){if(S.cash<c){toast(tr('interface.not_enough_cash_wait_for_revenue'),'bad');sfx('err');return false;}S.cash-=c;sfx('build');return true;}
|
||||
const ACT={
|
||||
linkCheck:({id})=>{const l=S.links.find(x=>x.id===id);if(!l||linkDown(l))return;linkCheckModal(l);},
|
||||
speed:({v})=>{v=+v;if(pzOn())return;if(![0,0.5,1,2,4,8].includes(v)||(S&&!rule('clock')&&v))return;if(v)UI.lastSpeed=v;UI.speed=v;renderHUD();},
|
||||
help:()=>showHelp(),
|
||||
dash:()=>{if(!S||pzOn())return;const d=$('dash');d.hidden=!d.hidden;if(!d.hidden)renderDash();},
|
||||
|
|
@ -32,7 +33,7 @@ const ACT={
|
|||
netFilter:({f})=>{UI.nf=f==='out'?'out':'all';UI.netFocus=null;$('dash').hidden=true;UI.left='nets';UI.leftOpen=true;UI.sel=null;renderPanel();renderLeft();const b=$('leftBody');if(b)b.scrollTop=0;},
|
||||
meetGo:({city})=>{if(!isCity(city))return;$('dash').hidden=true;ACT.focusCity({city});if(S.pops[city]){UI.tab='peer';renderPanel();}},
|
||||
toggleLeft:()=>{UI.leftOpen=!UI.leftOpen;renderLeft();},
|
||||
phoneTab:({t})=>{if(!['goals','deals','noc','nets'].includes(t))return;haptic(8);if(UI.leftOpen&&UI.left===t&&!UI.sel){UI.leftOpen=false;}else{UI.left=t;UI.leftOpen=true;UI.sel=null;renderPanel();}$('left').classList.remove('full');renderLeft();},
|
||||
phoneTab:({t})=>{if(!['goals','deals','noc','nets'].includes(t))return;if($('modal').classList.contains('link-check'))closeModal();haptic(8);if(UI.leftOpen&&UI.left===t&&!UI.sel){UI.leftOpen=false;}else{UI.left=t;UI.leftOpen=true;UI.sel=null;renderPanel();}$('left').classList.remove('full');renderLeft();},
|
||||
phonePlay:()=>{if(pzOn())return;if(S&&!rule('clock'))return;haptic(10);if(UI.speed){UI.lastSpeed=UI.speed;UI.speed=0;}else UI.speed=UI.lastSpeed||1;renderHUD();},
|
||||
phoneSpeed:()=>{if(pzOn())return;if(S&&!rule('clock'))return;haptic(8);const cur=UI.speed||UI.lastSpeed||1,i=SPEEDS.indexOf(cur),n=SPEEDS[(i+1)%SPEEDS.length];UI.speed=n;UI.lastSpeed=n;renderHUD();},
|
||||
install:()=>{if(installEvt){installEvt.prompt();installEvt.userChoice.finally(()=>{installEvt=null;});return;}
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ Object.assign(ACT,{
|
|||
unpeer:({city,net})=>{delete S.peers[net+'@'+city];after();},
|
||||
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})=>{tier=+tier;const g1=tier===-1;if(g1){if(!pniG1(net))return;tier=0;}if(!S.pops[city]||!NET[net]||!NET[net].pops.includes(city)||!PORT[tier])return;if(!portOk(city,tier)){toast(tr('actions.your_router_can_t_take_a',{port:PORT[tier].n}),'bad');sfx('err');return;}const r=peerOk(net,'pni',city);if(!r.ok){toast(tr('sites_peering_caches.net_declined_the_pni_why',{net:esc(NET[net].name),why:esc(r.why)}),'bad');sfx('err');after();return;}
|
||||
if(!g1&&tier<pniMin(net)){toast(tr('sites_peering_caches.net_does_not_do_port_pnis',{net:esc(NET[net].name),port:PORT[tier].n}),'bad');sfx('err');return;}
|
||||
const ex=S.pni.find(p=>p.city===city&&p.net===net);if(ex&&(g1||!pniOn(ex)||ex.up))return;if(ex&&!(ex.g1&&tier===0)&&tier<=ex.tier)return;
|
||||
const cost=g1?PNI_G1_COST:(1500+PORT[tier].setup/2)*(ex&&ex.n||1);if(!portGate(city,ex?(PORT_SLOT(tier)-PORT_SLOT(ex.tier))*(ex.n||1):PORT_SLOT(tier)))return;if(!spend(cost))return;if(S.conf&&S.conf.until>S.day)S.stats.beerPni=1;
|
||||
// Nothing is instant: a cross-connect takes weeks, and the big networks quote months for a new PNI or an augment.
|
||||
const lead=pniLead(net);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});
|
||||
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();},
|
||||
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;
|
||||
for(const q of b.orders)pniPlace(q);UI.pniAll=null;closeModal();
|
||||
toast(trn('pni_all.n_orders_with_net',b.orders.length,{net:esc(net===null?tr('common.all_networks'):NET[net].name),kept:b.kept,blocked:b.blocked.length}),'good');after();},
|
||||
pniChase:({id})=>{const p=S.pni.find(x=>x.id===id);if(!p||(pniOn(p)&&!p.up))return;const r=Math.random();
|
||||
if(r<0.15){if(p.up)p.up.ready=Math.max(S.day+1,p.up.ready-30);else p.ready=Math.max(S.day+1,p.ready-30);toast(tr('sites_peering_caches.your_account_manager_found_the_order'),'good');}
|
||||
else toast(pick([tr('sites_peering_caches.it_is_with_the_provisioning_team'),tr('sites_peering_caches.we_are_waiting_on_the_colo'),tr('sites_peering_caches.your_ticket_was_merged_into_another'),tr('sites_peering_caches.could_you_resend_the_loa_you'),tr('sites_peering_caches.your_account_manager_is_on_paternity')]));after();},
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ Object.assign(ACT,{
|
|||
const T=BIZ_T[t],nm=()=>{const list=T.names.filter(n=>!S.usedNames.includes(n)),n=list.length?pick(list):pick(T.names);useName(n);return n;};
|
||||
// A capacity broker finds a buyer at once and keeps 10% of the monthly price.
|
||||
const o=fiberOffer(t,l,nm,0.9);o.broker=true;S.offers.push(o);toast(tr('customers.listed_with_a_capacity_broker_name',{name:esc(o.name),what:esc(o.what)}),'good');sfx('click');after();},
|
||||
accept:({id})=>{const o=S.offers.find(x=>x.id===id);if(!o)return;if(!bHas(o)){toast(tr('customers.you_need_a_pop_in_every'),'bad');return;}
|
||||
autoToggle:({k})=>{if(k!=='autoSales'&&k!=='autoRepair')return;S[k]=!S[k];if(k==='autoSales'){UI.autoGame=S;UI.autoSalesAt=performance.now();}sfx('click');after();},
|
||||
accept:({id,auto=false})=>{const o=S.offers.find(x=>x.id===id);if(!o)return;const customer=auto?(S.autoSales&&autoOffer(o)):offerCustomer(o);if(!customer)return;if(!bHas(o)){toast(tr('customers.you_need_a_pop_in_every'),'bad');return;}
|
||||
if(o.type==='wwave'){const l=S.links.find(x=>x.id===o.link);if(!l||chMax(l)-(l.ch||[]).length-soldSlots(l)<o.slots){toast(tr('customers.not_enough_free_channels_on_that'),'bad');return;}}
|
||||
if(BIZ_T[o.type].event&&S.day>=o.start){toast(tr('customers.too_late_the_event_has_already'),'bad');return;}
|
||||
// A carrier renting more alien waves on a fiber it already rents grows its contract, like a real order for extra waves,
|
||||
|
|
@ -12,7 +13,7 @@ Object.assign(ACT,{
|
|||
const more=o.type==='wwave'&&S.biz.find(b=>b.type==='wwave'&&b.link===o.link&&b.name===o.name);
|
||||
if(more){const l=S.links.find(x=>x.id===o.link);S.offers=S.offers.filter(x=>x!==o);more.slots=(more.slots||0)+(o.slots||0);more.rate+=o.rate;if(l)more.what=wwWhat(l,more.slots);
|
||||
floater(CITY[o.city].x,CITY[o.city].y-30,tr('common.signed'),'#16A866');sfx('coin');after();return;}
|
||||
S.offers=S.offers.filter(x=>x!==o);S.biz.push({id:o.id,city:o.city,city2:o.city2||null,reqs:o.reqs||[],latMax:o.latMax||null,route:BIZ_T[o.type].scenic?'scenic':BIZ_T[o.type].lat?'fast':'normal',name:o.name,type:o.type,bw:o.bw,rate:o.rate,mood:100,since:S.day,sites:o.sites||null,start:o.start,dur:o.dur,fee:o.fee,link:o.link,slots:o.slots||0,what:o.what,prov:o.prov,due:BIZ_T[o.type].cap?S.day+o.win:undefined});
|
||||
S.offers=S.offers.filter(x=>x!==o);S.biz.push(customer);
|
||||
floater(CITY[o.city].x,CITY[o.city].y-30,tr('common.signed'),'#16A866');sfx('coin');after();},
|
||||
decline:({id})=>{S.offers=S.offers.filter(x=>x.id!==id);after();},
|
||||
dropBiz:({id})=>{const b0=S.biz.find(x=>x.id===id);if(!b0)return;if(BIZ_T[b0.type].event&&S.day>=b0.start){toast(tr('customers.the_event_is_already_running_the'),'bad');sfx('err');return;}if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.biz=S.biz.filter(b=>b.id!==id);UI.confirm=null;after();},
|
||||
|
|
|
|||
|
|
@ -28,7 +28,14 @@ Object.assign(ACT,{
|
|||
upVxc:({id,t})=>{t=+t;const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='vxc'||!VXC[t]||t<=l.vt)return;const extra=VXC[t].g-VXC[l.vt].g;for(const c of [l.a,l.b]){const pt=nniPort(c,l.prov);if(pt&&nniUsed(c,l.prov)+extra>NNI[pt.tier].g){toast(tr('links.fabric_port_in_city_is_full',{city:CITY[c].name}),'bad');sfx('err');return;}}const mo=vxcMo(l.km,l.sub,t);if(!spend(mo))return;l.vt=t;l.mo=mo;after();},
|
||||
cancelVxc:({id})=>{if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.links=S.links.filter(l=>l.id!==id);prunePairMet();const rem=remoteCities();for(const c in S.ixp){if(!S.pops[ixCity(c)]&&!rem.includes(ixCity(c))){delete S.ixp[c];delete S.rs[c];for(const k in S.peers)if(k.endsWith('@'+c))delete S.peers[k];}}UI.sel=null;UI.confirm=null;after();},
|
||||
setPref:({kind,id,v})=>{if(!own(PREF,v))return;if(kind!=='t'&&kind!=='p'&&!(isIx(id)&&S.ixp[id]!==undefined))return;if(kind==='t'){const t=S.transit.find(x=>x.id===id);if(t)t.pref=v;}else if(kind==='p'){const x=S.pni.find(y=>y.id===id);if(x)x.pref=v;}else{S.ixPref=S.ixPref||{};S.ixPref[id]=v;}sfx('click');after();},
|
||||
setMetric:({id,v})=>{if(!own(MET,v))return;const l=S.links.find(x=>x.id===id);if(!l)return;const m=S.pairMet||(S.pairMet={}),k=edgeKey(l);if(v==='normal')delete m[k];else m[k]=v;sfx('click');after();},
|
||||
setMetric:({id,v})=>{if(v!=='custom'&&!own(MET,v))return;const l=S.links.find(x=>x.id===id);if(!l)return;const m=S.pairMet||(S.pairMet={}),k=edgeKey(l);
|
||||
// Switching to custom starts from the current preset's factor, so nothing moves until the player edits it.
|
||||
if(v==='custom'){if(!pairCm(k))m[k]={k:'f',v:MET[pairMet(k)].f};}else if(v==='normal')delete m[k];else m[k]=v;sfx('click');after();},
|
||||
metricMode:({id,k})=>{if(k!=='f'&&k!=='w')return;const l=S.links.find(x=>x.id===id);if(!l)return;const key=edgeKey(l),c=pairCm(key);if(!c||c.k===k)return;
|
||||
// The cost stays what it was on this link, written the other way.
|
||||
const w=pairW(key,l.km);S.pairMet[key]={k,v:clampM(k,k==='w'?w:w/(l.km+60))};sfx('click');after();},
|
||||
metricSet:({id})=>{const l=S.links.find(x=>x.id===id),t=$('metIn');if(!l||!t)return;const key=edgeKey(l),c=pairCm(key);if(!c)return;const v=parseFloat(String(t.value).replace(',','.'));if(!Number.isFinite(v)){sfx('err');return;}
|
||||
t.blur();S.pairMet[key]={k:c.k,v:clampM(c.k,v)};sfx('click');after();},
|
||||
setStandby:({id,on})=>{const l=S.links.find(x=>x.id===id);if(!l)return;if(on)l.standby=true;else delete l.standby;sfx('click');after();},
|
||||
goEgress:({city,k})=>{ACT.focusCity({city});UI.tab=k==='t'?'up':k==='l2'?'cust':k==='nni'?'links':'peer';renderPanel();},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ Object.assign(ACT,{
|
|||
rmScrub:({city})=>{if(!S.scrubs.some(x=>x.city===city))return;if(UI.confirm!=='scrub:'+city){UI.confirm='scrub:'+city;renderAll();return;}S.scrubs=S.scrubs.filter(x=>x.city!==city);if(!hasScrub())S.scrubMode='always';UI.confirm=null;after();},
|
||||
cleanPipe:({id})=>{const t=S.transit.find(x=>x.id===id);if(!t)return;t.clean=!t.clean;toast(t.clean?tr('security_and_china.clean_pipe_add_on_enabled_on',{net:NET[t.net].name,mo:fmt$(cleanMo(t))}):tr('security_and_china.clean_pipe_add_on_removed_from',{net:NET[t.net].name}),t.clean?'good':'');after();},
|
||||
sacrif:({id})=>{const p=S.pni.find(x=>x.id===id);if(!p)return;p.sacrif=!p.sacrif;toast(p.sacrif?tr('security_and_china.net_pni_is_now_a_sacrificial',{net:NET[p.net].name}):tr('security_and_china.net_pni_is_back_to_normal',{net:NET[p.net].name}),p.sacrif?'good':'');after();},
|
||||
ixbh:()=>{const a=S.ev.ddos;if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}if(!hasIxAt(a.city)){toast(tr('security_and_china.no_ix_in_city_to_announce',{city:CITY[a.city].name}),'bad');sfx('err');return;}a.ixbh=!a.ixbh;toast(a.ixbh?tr('security_and_china.ix_blackhole_announced_in_city_about',{city:CITY[a.city].name}):tr('security_and_china.ix_blackhole_withdrawn'),a.ixbh?'good':'');sfx('alert');after();},
|
||||
rtbh:()=>{const a=S.ev.ddos;if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}a.bh=true;S.stats.rtbh=(S.stats.rtbh||0)+1;toast(tr('security_and_china.rtbh_announced_you_blackholed_the',{city:CITY[a.city].name}),'bad');sfx('alert');after();},
|
||||
unrtbh:()=>{const a=S.ev.ddos;if(!a||!a.bh)return;a.bh=false;toast(tr('security_and_china.blackhole_withdrawn_city_is',{city:CITY[a.city].name}),'');after();},
|
||||
hackback:()=>{const a=S.ev.ddos;if(!a||a.until<=S.day){toast(tr('security_and_china.nothing_to_hack_back_right_now'),'');return;}if(!spend(20000))return;S.stats.hackback=(S.stats.hackback||0)+1;
|
||||
ixbh:({id}={})=>{const a=ddosFind(id);if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}if(!ddosHasIx(a)){toast(tr('security_and_china.no_ix_in_city_to_announce',{city:CITY[a.city].name}),'bad');sfx('err');return;}a.ixbh=!a.ixbh;toast(a.ixbh?tr('security_and_china.ix_blackhole_announced_in_city_about',{city:ddosCities(a).filter(hasIxAt).map(c=>CITY[c].name).join(', ')}):tr('security_and_china.ix_blackhole_withdrawn'),a.ixbh?'good':'');sfx('alert');after();},
|
||||
rtbh:({id}={})=>{const a=ddosFind(id);if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}a.bh=true;S.stats.rtbh=(S.stats.rtbh||0)+1;toast(tr('security_and_china.rtbh_announced_you_blackholed_the',{city:CITY[a.city].name}),'bad');sfx('alert');after();},
|
||||
unrtbh:({id}={})=>{const a=ddosFind(id);if(!a)return;for(const x of ddosAll())if(x.city===a.city)x.bh=false;toast(tr('security_and_china.blackhole_withdrawn_city_is',{city:CITY[a.city].name}),'');after();},
|
||||
hackback:({id}={})=>{const a=ddosFind(id);if(!a||a.until<=S.day){toast(tr('security_and_china.nothing_to_hack_back_right_now'),'');return;}if(!spend(20000))return;S.stats.hackback=(S.stats.hackback||0)+1;
|
||||
if(Math.random()<0.35){a.until=S.day;a.bh=false;S.stats.hackWin=(S.stats.hackWin||0)+1;toast(tr('security_and_china.hackback_3000tm_strikes_back_skynot',{city:CITY[a.city].name}),'goal');sfx('coin');}
|
||||
else{const fine=15000+Math.floor(Math.random()*35000);S.cash-=fine;S.stats.vigilante=(S.stats.vigilante||0)+1;
|
||||
toast(tr('security_and_china.hackback_3000tm_hit_the_wrong_target',{who:pick([tr('security_and_china.skynot_ai_flattened_a_grandma_s'),tr('security_and_china.you_counter_flooded_a_hospital_in'),tr('security_and_china.the_botnet_was_already_someone_else')]),fine:fmt$(fine)}),'bad');sfx('err');}
|
||||
|
|
|
|||
27
src/game/90-actions/88-optic-counts.js
Normal file
27
src/game/90-actions/88-optic-counts.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// Quote the whole change before spending: shelf optics still need regen cards.
|
||||
function opticCountCost(l,o,n){
|
||||
const add=Math.max(0,n-(l.ch||[]).filter(k=>k===o).length),sp=Math.min(add,spareN(o)),r=REGEN_CH*(l.regen|0),c=optCost(o);
|
||||
return sp*Math.round(c*r)+(add-sp)*Math.round(c*(1+r));
|
||||
}
|
||||
Object.assign(ACT,{
|
||||
setChCount:({id,o,n})=>{
|
||||
const l=S.links.find(x=>x.id===id);
|
||||
if(!l||l.kind!=='df'||!own(OPT,o)||!Number.isSafeInteger(n)||n<0||n>chMax(l))return;
|
||||
const old=(l.ch||[]).filter(k=>k===o).length,d=n-old;
|
||||
if(!d)return;
|
||||
if(d>0){
|
||||
const why=chWhy(l,o);
|
||||
if(why){toast(tr('fiber_and_hardware.can_t_add_optic_why',{optic:OPT[o].n,why:esc(why)}),'bad');sfx('err');return;}
|
||||
const free=chMax(l)-(l.ch||[]).length-soldSlots(l);
|
||||
if(d>free){toast(tr('optic_counts.only_n_channels_free',{n:free}),'bad');sfx('err');return;}
|
||||
if(!portGate(l.a,d)||!portGate(l.b,d)||!spend(opticCountCost(l,o,n)))return;
|
||||
const sp=Math.min(d,spareN(o));if(sp)S.spares[o]-=sp;
|
||||
(l.ch=l.ch||[]).push(...Array(d).fill(o));
|
||||
}else{
|
||||
let left=-d;l.ch=l.ch.filter(k=>k!==o||left--<=0);
|
||||
S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)-d;
|
||||
}
|
||||
if(UI.opticCounts)delete UI.opticCounts[JSON.stringify([id,o])];
|
||||
after();
|
||||
},
|
||||
});
|
||||
21
src/game/90-actions/88-utilities.js
Normal file
21
src/game/90-actions/88-utilities.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
Object.assign(ACT,{
|
||||
utilities:({city}={})=>{if(S)utilitiesModal(city);},
|
||||
utilityPick:()=>{if(S&&$('utilityCity'))utilitiesModal($('utilityCity').value);},
|
||||
utilityRouteServers:({city}={})=>{if(!S)return;const ids=utilityRouteServers();for(const ix of ids)S.rs[ix]=true;
|
||||
if(ids.length){sfx('build');after();}utilitiesModal(city,tr('utilities.route_servers_joined',{n:ids.length}));},
|
||||
utilityKit:({city,cost,modal})=>{const q=utilityKit(city);if(!q||(!q.cost&&!q.moves.length))return;
|
||||
// Prices can change while a modal is open. Refresh the quote before spending more.
|
||||
if(q.cost!==+cost){if(modal)utilitiesModal(city,tr('utilities.quote_changed'));else{renderPanel();toast(tr('utilities.quote_changed'));}return;}
|
||||
if(q.cost&&!spend(q.cost))return;const p=S.pops[city];
|
||||
if(q.gen)p.gen=true;if(q.site){p.site2=true;p.site2Day=S.day;}if(q.router)p.routers=2;
|
||||
const moves=new Map(q.moves.map(m=>[m.id,m.site]));for(const c of S.caches)if(moves.has(c.id))c.site=moves.get(c.id);
|
||||
after();const msg=tr('utilities.kit_applied',{city:CITY[city].name});if(modal)utilitiesModal(city,msg);else toast(esc(msg),'good');},
|
||||
utilityCaches:({city,quote,modal})=>{const q=utilityCaches(city);if(!q||!q.add.length)return;
|
||||
if(q.key!==quote){if(modal)utilitiesModal(city,tr('utilities.quote_changed'));else{renderPanel();toast(tr('utilities.quote_changed'));}return;}
|
||||
if(!portGate(city,q.add.length))return;
|
||||
for(const c of q.add)S.caches.push({id:uid(),city,net:c.net,site:c.site});
|
||||
sfx('build');after();const msg=tr('utilities.caches_requested',{n:q.add.length,city:CITY[city].name});if(modal)utilitiesModal(city,msg);else toast(esc(msg),'good');},
|
||||
utilityPeers:({city}={})=>{if(!S)return;const rows=utilityPeers();let n=0;
|
||||
for(const row of rows)for(const id of row.requests){S.peers[id+'@'+row.ix]=true;n++;}
|
||||
if(n){sfx('build');after();}utilitiesModal(city,tr('utilities.peers_requested',{n}));},
|
||||
});
|
||||
|
|
@ -30,6 +30,7 @@ Object.assign(ACT,{
|
|||
${btn(tr('puzzles.puzzles'),'puzzleMenu',{},'ghost')}
|
||||
${btn(tr('common.how_to_play'),'help',{},'ghost')}
|
||||
${RELEASE_NOTES.length?btn(tr('common.what_s_new_in_v',{v:esc(APP_VERSION)}),'whatsNewShow',{},'ghost'):''}
|
||||
${btn(tr('utilities.title'),'utilities',{},'')}
|
||||
${btn(tr('common.settings'),'settings',{},'ghost')}
|
||||
${btn(tr('common.start_a_new_network'),'resetAsk',{},'red')}
|
||||
</div>${chatHtml()}${issueHtml()}`);},
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function chWhy(l,o){const O=OPT[o];if(O.lvl>lvl())return tr('action_helpers.unlo
|
|||
if((l.ch||[]).length+soldSlots(l)>=chMax(l))return soldSlots(l)?tr('action_helpers.sys_is_full_max_channels_sold',{sys:DF_SYS[l.sys].n,max:chMax(l),sold:soldSlots(l)}):tr('action_helpers.sys_is_full_max_channels',{sys:DF_SYS[l.sys].n,max:chMax(l)});
|
||||
for(const c of [l.a,l.b]){const p=S.pops[c];if(p&&RG[p.rgen||0].cls<O.rg)return tr('action_helpers.needs_routers_with_pn_ports_or',{pn:RG[mainRG(O.rg)].pn,city:CITY[c].name});}return '';}
|
||||
function bbCost(c){return 15000+CITY[c].P*20;}
|
||||
function after(){if(S)purgeInc();compute();checkGoals();renderAll();if(S&&!$('dash').hidden)renderDash();save();}
|
||||
function after(){UI.autoReady=null;if(S)purgeInc();compute();checkGoals();renderAll();if(S&&!$('dash').hidden)renderDash();save();}
|
||||
const isTablet=()=>innerWidth>760&&innerWidth<=1200;
|
||||
function selectLink(id){UI.sel={type:'link',id};UI.confirm=null;if(isTablet()||isPhone())UI.leftOpen=false;$('panel').classList.remove('full');renderPanel();renderLeft();}
|
||||
function selectCity(c){UI.sel={type:'city',id:c};UI.confirm=null;if(isTablet()||isPhone())UI.leftOpen=false;const P=$('panel');if(P)P.classList.remove('full');if(!S.pops[c])UI.tab='cust';renderPanel();}
|
||||
|
|
|
|||
|
|
@ -40,16 +40,18 @@ function renderLeft(){checkLayer();
|
|||
h+=GOALS.map(g=>{const d=S.done[g.id]!==undefined,c=g===cur;return `<div class="goal ${d?'done':''} ${c?'cur':''}"><div class="ck">${d?'✓':''}</div><div><div class="gt">${esc(g.t)}</div>${c||!d?`<div class="gd">${esc(g.d)}</div>`:''}${!d&&g.r?`<div class="gr">${tr('hud_and_panels.reward_cash',{cash:fmt$(g.r)})}</div>`:''}</div></div>`;}).join('');
|
||||
h+=badgeGrid();
|
||||
}else if(UI.left==='deals'){
|
||||
h+=`<div class="btns"><button class="b sm ${S.autoSales?'green':'ghost'}" data-act="autoToggle" data-args='{"k":"autoSales"}' aria-pressed="${S.autoSales}">${tr('automation.auto_accept_sales',{state:S.autoSales?tr('common.on'):tr('common.off')})}</button></div><p class="meta">${tr('automation.sales_every_five_seconds')}</p>`;
|
||||
{const st=custStats();if(st.n)h+=`<div class="row" style="margin-bottom:8px"><div class="grow"><div class="nm">${tr('common.your_customers')} <span class="meta">${st.n} · ${tr('hud_and_panels.happiness_p',{p:Math.round(st.avg)})}</span></div><div class="bar ${moodCls(st.avg)}"><i style="width:${st.avg}%"></i></div>${st.unhappy?`<div class="why">${trn('hud_and_panels.n_unhappy_customer_price_mo_at',st.unhappy,{price:fmt$(st.risk)})}</div>`:''}</div>${btn(st.unhappy?tr('common.see_who'):tr('common.all_customers'),'custOpen',{sad:st.unhappy?1:0},st.unhappy?'pink sm':'ghost sm')}</div>`;}
|
||||
h+=confSection();
|
||||
{const lv=S.lvl||1,nx=LEVELS[lv];h+=`<div class="inc" style="background:#FFF6CF"><div class="nm">${tr('hud_and_panels.customer_level_lv_name',{lv,name:LEVELS[lv-1].n})}</div><div class="meta">${nx?tr('hud_and_panels.next_req_unlocks_what',{req:nx.req,what:lc1(nx.unlock)}):tr('common.every_customer_type_is_unlocked_go')}</div></div>`;}
|
||||
if(!S.offers.length)h+=`<p class="empty">${tr('hud_and_panels.no_open_offers_right_now_businesses')}</p>`;
|
||||
for(const o of S.offers.slice().sort((a,b)=>a.exp-b.exp)){const has=bHas(o);
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)} · ${CITY[o.city].name}${o.city2?' ⇄ '+CITY[o.city2].name:''} · <b>${bTerms(o)}</b> · ${tr('ui.n_d_left',{n:o.exp-S.day})}${(o.reqs||[]).length?` · ${trn('hud_and_panels.n_special_requirement',o.reqs.length)}`:''}</div>${reqList(o)}
|
||||
<div class="btns">${has?btn(tr('common.accept'),'accept',{id:o.id},'green sm'):btn(tr('common.go_there'),'focusCity',{city:bCities(o).find(c=>!S.pops[c])},'ghost sm')}${btn(tr('common.decline'),'decline',{id:o.id},'ghost sm')}</div>${has?'':`<div class="why">${tr('hud_and_panels.needs_a_pop_in_cities',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div></div>`;}
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)} · ${CITY[o.city].name}${o.city2?' ⇄ '+CITY[o.city2].name:''} · <b>${bTerms(o)}</b> · ${tr('ui.n_d_left',{n:o.exp-S.day})}${(o.reqs||[]).length?` · ${trn('hud_and_panels.n_special_requirement',o.reqs.length)}`:''}</div>${bRisk(o)}${reqList(o)}
|
||||
<div class="btns">${has?btn(autoAcceptLabel(o),'accept',{id:o.id},'green sm'):btn(tr('common.go_there'),'focusCity',{city:bCities(o).find(c=>!S.pops[c])},'ghost sm')}${btn(tr('common.decline'),'decline',{id:o.id},'ghost sm')}</div>${has?'':`<div class="why">${tr('hud_and_panels.needs_a_pop_in_cities',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div></div>`;}
|
||||
}else if(UI.left==='noc'){
|
||||
h+=`<div class="btns" style="margin-bottom:8px">${btn(tr('hud_and_panels.open_noc_dashboard'),'dash',{},'pink')}${btn(tr('common.connections'),'connOpen',{},'')}${btn(tr('common.traceroute'),'trace',{},'')}</div>`;
|
||||
h+=`<p class="lead">${tr('hud_and_panels.your_network_operations_center_every')}</p>`;
|
||||
h+=`<div class="btns"><button class="b sm ${S.autoRepair?'green':'ghost'}" data-act="autoToggle" data-args='{"k":"autoRepair"}' aria-pressed="${S.autoRepair}">${tr('automation.auto_pay_repairs',{state:S.autoRepair?tr('common.on'):tr('common.off')})}</button></div><p class="meta">${tr('automation.repairs_when_affordable')}</p>`;
|
||||
// Incidents come first, the ones you can fix with one click at the top (#63): no scrolling past hot ports to replace an optic.
|
||||
for(const i of S.inc.filter(i=>i.type!=='ddos').sort((a,b)=>(b.cost?1:0)-(a.cost?1:0)||(b.impact||0)-(a.impact||0))){h+=`<div class="inc"><div class="nm">${incTitle(i.type)}</div><div class="meta">${esc(i.msg)}</div><div class="meta">${trn('hud_and_panels.auto_fix_in_n_day',i.until-S.day)}${i.impact?` · ${tr('hud_and_panels.g_lost',{g:fmtG(i.impact)})}`:''}</div>${i.cost?`<div class="btns">${btn(`${esc(i.fix||tr('common.rush_repair'))} ${fmt$(i.cost)}`,'fixInc',{id:i.id},'red sm',S.cash<i.cost)}</div>`:''}</div>`;}
|
||||
h+=logSection();UI.logSeen=Date.now();
|
||||
|
|
@ -88,6 +90,8 @@ function renderPanel(){checkLayer();
|
|||
const P=$('panel');
|
||||
if(!S||!UI.sel){P.hidden=true;return;}
|
||||
P.hidden=false;
|
||||
// Don't wipe a half-typed custom metric on the daily re-render.
|
||||
const fe=document.activeElement;if(fe&&fe.id==='metIn'&&UI.sel.type!=='city'&&fe.dataset.id===UI.sel.id)return;
|
||||
const scrollEl=$('panelBody').querySelector('.scroll');const st=scrollEl?scrollEl.scrollTop:0;
|
||||
const html=pzOn()?pzPanel(UI.sel):UI.sel.type==='city'?cityPanel(UI.sel.id):linkPanel(UI.sel.id);if(!html){P.hidden=true;return;}if(html===UI._ph&&!P.hidden&&$('panelBody').firstChild)return;UI._ph=html;morph($('panelBody'),html);
|
||||
const ns=$('panelBody').querySelector('.scroll');if(ns)ns.scrollTop=st;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
function cityPanel(c){
|
||||
const C=CITY[c],p=S.pops[c],ix=ixName(c),down=p&&p.down>S.day;
|
||||
let h=`<div class="ph"><div style="min-width:0"><div class="eyebrow">${REG[C.reg]} · ${esc(siteName(c,'a'))}</div><h2>${C.name}</h2>
|
||||
<div class="facts"><span class="fact">${tr('city_panel.g_of_eyeballs',{g:fmtG(eyeP(c))})}</span>${grantFact(c)}${latSlow(c)?`<span class="fact bad">🐢 ${tr('city_panel.ms_ms_to_transit',{ms:Math.round(R.latFar[c].ms)})}</span>`:''}${regionMult(c)>1?`<span class="fact">${tr('city_panel.transit_x_pricier',{x:regionMult(c)})}</span>`:''}${C.reg==='AS'&&!C.cn?'<span class="fact ixf">'+tr('city_panel.underserved_users_grow_60_faster')+'</span>':''}${ix?`<span class="fact ixf">${tr('city_panel.ix_ix',{ix:esc(ix)})}</span>`:''}${p?`<span class="fact mine">${tr('common.your_pop')}</span><button class="fact trb" data-act="trace" data-args='{"city":"${c}"}'>🔍 ${tr('common.traceroute')}</button>`:''}${down?`<span class="fact down">DOWN</span>`:''}</div></div>
|
||||
<div class="facts"><span class="fact">${tr('city_panel.g_of_eyeballs',{g:fmtG(eyeP(c))})}</span>${grantFact(c)}${latSlow(c)?`<span class="fact bad">🐢 ${tr('city_panel.ms_ms_to_transit',{ms:Math.round(R.latFar[c].ms)})}</span>`:''}${regionMult(c)>1?`<span class="fact">${tr('city_panel.transit_x_pricier',{x:regionMult(c)})}</span>`:''}${colo(c)>1?`<span class="fact">${tr('city_panel.few_data_centers_pops_x',{x:colo(c)})}</span>`:''}${C.reg==='AS'&&!C.cn?'<span class="fact ixf">'+tr('city_panel.underserved_users_grow_60_faster')+'</span>':''}${ix?`<span class="fact ixf">${tr('city_panel.ix_ix',{ix:esc(ix)})}</span>`:''}${p?`<span class="fact mine">${tr('common.your_pop')}</span><button class="fact trb" data-act="trace" data-args='{"city":"${c}"}'>🔍 ${tr('common.traceroute')}</button>`:''}${down?`<span class="fact down">DOWN</span>`:''}</div></div>
|
||||
<button class="x" data-act="closePanel" aria-label="${tr('common.close')}">×</button></div>`;
|
||||
if(!p){
|
||||
h+=`<div class="scroll">${C.note?`<p class="note" style="margin-top:0">${esc(C.note)}</p>`:''}
|
||||
${C.cn?chinaSection(c):''}${C.cn&&!cnOk()?'':`<section><h3>${tr('city_panel.open_a_pop_here')}</h3><p class="lead">${tr('city_panel.a_pop_point_of_presence_is')}</p>
|
||||
${C.ru?`<p class="why">${tr('city_panel.includes_the_mandatory_government',{cost:fmt$(RU_BOX),mo:fmt$(RU_BOX_MO)})}</p>`:''}${btn(tr('city_panel.build_pop_cost_mo_mo',{cost:fmt$(popCost(c)),mo:fmt$(POP_MO)}),'buildPop',{city:c},'pink big',S.cash<popCost(c))}
|
||||
${C.ru?`<p class="why">${tr('city_panel.includes_the_mandatory_government',{cost:fmt$(RU_BOX),mo:fmt$(RU_BOX_MO)})}</p>`:''}${btn(tr('city_panel.build_pop_cost_mo_mo',{cost:fmt$(popCost(c)),mo:fmt$(popMo(c))}),'buildPop',{city:c},'pink big',S.cash<popCost(c))}
|
||||
<p class="note">${tr('city_panel.or_drag_from_one_of_your')}</p></section>`}`;
|
||||
h+=offersHere(c);
|
||||
const trs=NETS.filter(n=>sellsAt(n,c));
|
||||
|
|
@ -35,7 +35,7 @@ function cityPanel(c){
|
|||
h+=`</section><section><h3>${tr('common.business_customers')}</h3>`;
|
||||
const bz=S.biz.filter(b=>bCities(b).includes(c));
|
||||
if(!bz.length)h+=`<p class="empty">${tr('city_panel.no_businesses_yet_offers_pop_up')}</p>`;
|
||||
for(const b of bz)h+=`<div class="row"><div class="grow"><div class="nm">${esc(b.name)}</div><div class="meta">${esc(BIZ_T[b.type].l)}${b.city2?` ${CITY[b.city].name} ⇄ ${CITY[b.city2].name}`:''} · ${bTerms(b)}${BIZ_T[b.type].l2?` · ${b.sites?tr('city_panel.carrying_g_per_site',{g:fmtG(R.l2[b.id]||0)}):tr('city_panel.carrying_g',{g:fmtG(R.l2[b.id]||0)})}`:''}${BIZ_T[b.type].fiber&&!fiberOk(b)?' · <b style="color:var(--bad)">'+tr('city_panel.fiber_is_down')+'</b>':''}${BIZ_T[b.type].event&&eventLive(b)?` · <b>${tr('city_panel.serving_v',{v:pct(sfOf(R,b.city))})}</b>`:''}${b.type==='scrub'&&!hasScrub()?' · <b style="color:var(--bad)">'+tr('common.needs_a_scrubbing_center')+'</b>':''}${S.day-(b.since||0)<15?` · <b>${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}</b>`:''}</div>${reqList(b)}${BIZ_T[b.type].l2?routeCtl(b):''}<div class="bar ${b.mood<30?'bad':b.mood<65?'warn':''}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}</div></div>${btn(UI.confirm===b.id?tr('common.really_drop'):tr('common.drop'),'dropBiz',{id:b.id},'ghost sm')}</div>`;
|
||||
for(const b of bz)h+=`<div class="row"><div class="grow"><div class="nm">${esc(b.name)}</div><div class="meta">${esc(BIZ_T[b.type].l)}${b.city2?` ${CITY[b.city].name} ⇄ ${CITY[b.city2].name}`:''} · ${bTerms(b)}${BIZ_T[b.type].l2?` · ${b.sites?tr('city_panel.carrying_g_per_site',{g:fmtG(R.l2[b.id]||0)}):tr('city_panel.carrying_g',{g:fmtG(R.l2[b.id]||0)})}`:''}${BIZ_T[b.type].fiber&&!fiberOk(b)?' · <b style="color:var(--bad)">'+tr('city_panel.fiber_is_down')+'</b>':''}${BIZ_T[b.type].event&&eventLive(b)?` · <b>${tr('city_panel.serving_v',{v:pct(sfOf(R,b.city))})}</b>`:''}${b.type==='scrub'&&!hasScrub()?' · <b style="color:var(--bad)">'+tr('common.needs_a_scrubbing_center')+'</b>':''}${S.day-(b.since||0)<15?` · <b>${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}</b>`:''}</div>${bRisk(b)}${reqList(b)}${BIZ_T[b.type].l2?routeCtl(b):''}<div class="bar ${b.mood<30?'bad':b.mood<65?'warn':''}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}</div></div>${btn(UI.confirm===b.id?tr('common.really_drop'):tr('common.drop'),'dropBiz',{id:b.id},'ghost sm')}</div>`;
|
||||
h+=`</section>`+offersHere(c);
|
||||
}else if(UI.tab==='up'){
|
||||
h+=portNote(c)+latNote(c);
|
||||
|
|
@ -67,6 +67,7 @@ function cityPanel(c){
|
|||
${have.length?btn(tr('common.remove'),'rmCache',{id:(have.find(x=>x.site==='b')||have[0]).id},'ghost sm'):''}${btn(have.length?tr('common.box'):tr('common.request'),'cache',{city:c,net:n.id},'sm',!ok)}</div>${S.pops[c].site2&&have.length?(()=>{const nb=have.filter(x=>x.site==='b').length,na=have.length-nb;return `<div class="seg site"><span class="meta">${tr('city_panel.boxes_a_in_a_b_in',{a:na,b:nb})}</span>${na?btn(tr('city_panel.move_one_to_b'),'cacheSite',{city:c,net:n.id,s:'b'},'ghost sm'):''}${nb?btn(tr('city_panel.move_one_to_a'),'cacheSite',{city:c,net:n.id,s:'a'},'ghost sm'):''}</div>`;})():''}`;}
|
||||
h+=`</section>`;
|
||||
}else{
|
||||
h+=utilityKitHtml(c);
|
||||
const ls=S.links.filter(l=>l.a===c||l.b===c);
|
||||
const rt=p.routers||1,g=p.rgen||0,G=RG[g],nl=R.nodeLoad[c]||0,nc=R.nodeCap[c]||nodeCap(c),Ni=g===mainRG(G.cls)?mainRG(G.cls+1):-1,N=Ni>=0?RG[Ni]:null,pu=portsUsed(c),pm=portsMax(c);
|
||||
h+=`<section><h3>${tr('common.routers')}</h3><p class="lead">${tr('city_panel.the_model_sets_your_fastest')}</p>
|
||||
|
|
|
|||
25
src/game/93-ui/55-utilities.js
Normal file
25
src/game/93-ui/55-utilities.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
function utilityKitHtml(city,modal=false){const q=utilityKit(city);if(!q)return '';const p=S.pops[city];
|
||||
const row=(label,have)=>`<div class="kv"><span>${label}</span><b>${have?tr('common.installed'):tr('common.none_304f')}</b></div>`;
|
||||
return `<section><h3>${tr('utilities.redundancy_kit')}</h3>
|
||||
${row(tr('common.backup_generator'),p.gen)}${row(tr('utilities.second_site'),p.site2)}${row(tr('utilities.two_routers'),(p.routers||1)>=2)}
|
||||
<p class="meta">${tr('utilities.cache_moves',{n:q.moves.length})}</p>
|
||||
${q.cost||q.moves.length?`<p class="meta">${tr('utilities.kit_cost',{cost:fmt$(q.cost),mo:fmt$(q.mo)})}</p><div class="btns">${btn(tr('utilities.apply_kit'),'utilityKit',{city,cost:q.cost,modal},'pink',q.cost>0&&S.cash<q.cost)}</div>`:`<p class="meta">${tr('utilities.kit_balanced')}</p>`}
|
||||
<p class="note">${tr('utilities.redundancy_note')}</p></section>${utilityCachesHtml(city,modal)}`;}
|
||||
function utilityCachesHtml(city,modal=false){const q=utilityCaches(city);if(!q)return '';
|
||||
return `<section><h3>${tr('common.embedded_caches')}</h3><p class="lead">${tr('utilities.cache_note')}</p>
|
||||
<p class="meta">${tr('utilities.cache_quote',{n:q.add.length,mo:fmt$(q.mo)})}</p>
|
||||
${q.free<q.add.length?`<p class="why">${tr('utilities.cache_ports',{need:q.add.length,free:fmtPorts(q.free)})}</p>`:''}
|
||||
<div class="btns">${btn(tr('utilities.request_caches',{n:q.add.length}),'utilityCaches',{city,quote:q.key,modal},'pink',!q.add.length||q.free+1e-9<q.add.length)}</div></section>`;}
|
||||
function utilitiesModal(city,message){if(!S)return;const cities=Object.keys(S.pops).sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name));
|
||||
city=S.pops[city]?city:UI.sel&&UI.sel.type==='city'&&S.pops[UI.sel.id]?UI.sel.id:S.pops[S.home]?S.home:cities[0];
|
||||
const rows=utilityPeers(),n=rows.reduce((v,r)=>v+r.requests.length,0),rs=utilityRouteServers().length;
|
||||
openModal(`<div style="display:flex;align-items:center"><h2 style="font-size:26px">${tr('utilities.title')}</h2><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div>
|
||||
${message?`<p role="status" class="note">${esc(message)}</p>`:''}
|
||||
<section><h3>${tr('utilities.ix_peering')}</h3><p class="lead">${tr('utilities.peering_note')}</p>
|
||||
<div class="btns">${btn(tr('utilities.join_route_servers',{n:rs}),'utilityRouteServers',{city},'pink',!rs)}${btn(tr('utilities.request_all',{n}),'utilityPeers',{city},'',!n)}</div>
|
||||
<p class="meta">${tr('utilities.route_server_note')}</p>
|
||||
${ppol()!=='open'?`<p class="why">${tr('link_panels.off_while_your_peering_policy_is',{pol:tr(PPOL_N[ppol()])})}</p>${btn(tr('common.peering_policy'),'inbox',{},'ghost sm')}`:''}
|
||||
${rows.map(r=>`<details><summary>${esc(ixName(r.ix))} · ${tr('utilities.peer_counts',{ready:r.requests.length,existing:r.existing,blocked:r.blocked.length})}</summary>
|
||||
${r.blocked.map(b=>`<p class="meta"><b>${esc(NET[b.id].name)}</b>: ${esc(b.why)}</p>`).join('')}</details>`).join('')}</section>
|
||||
${cities.length?`<section><label for="utilityCity">${tr('common.your_pop')}</label><div class="btns"><select id="utilityCity" style="max-width:100%">${cities.map(c=>`<option value="${c}"${c===city?' selected':''}>${esc(CITY[c].name)}</option>`).join('')}</select>${btn(tr('utilities.view_pop'),'utilityPick',{},'sm')}</div></section>${utilityKitHtml(city,true)}`:''}`);
|
||||
}
|
||||
|
|
@ -34,9 +34,25 @@ function vxcPanel(l){
|
|||
return h;
|
||||
}
|
||||
function prefCtl(kind,id,cur){cur=cur||'normal';return `<div class="btns"><span class="meta" style="align-self:center">${tr('common.egress')}</span>${Object.keys(PREF).map(v=>btn(PREF[v],'setPref',{kind,id,v},cur===v?'pink sm':'ghost sm')).join('')}</div>`;}
|
||||
// Trial routing is isolated from the live save, counters and scenic-route memory.
|
||||
function linkTrial(id){const save=S,live=R,hot=UI.hotMap,cache=TE_CACHE;
|
||||
try{S=JSON.parse(JSON.stringify(save));const l=S.links.find(x=>x.id===id);if(!l||linkDown(l))return null;
|
||||
compute();const before=R;l.cut=S.day+1;compute();
|
||||
const allowed=new Set(Object.keys(S.pops).filter(popUp).concat(remoteCities())),adj={};
|
||||
for(const x of S.links)if(!linkDown(x)&&allowed.has(x.a)&&allowed.has(x.b)){(adj[x.a]=adj[x.a]||[]).push(x.b);(adj[x.b]=adj[x.b]||[]).push(x.a);}
|
||||
const seen=new Set([l.a]),q=[l.a];for(let i=0;i<q.length;i++)for(const c of adj[q[i]]||[])if(!seen.has(c)){seen.add(c);q.push(c);}
|
||||
const losses=[];for(const c in S.pops){const g=Math.max(0,(before.citySrv[c]||0)-(R.citySrv[c]||0));if(g>.01)losses.push({name:CITY[c].name,g});}
|
||||
for(const b of S.biz)if(BIZ_T[b.type].l2){const g=Math.max(0,(before.l2[b.id]||0)-(R.l2[b.id]||0));if(g>.01)losses.push({name:b.name,g});}
|
||||
const busy=S.links.filter(x=>x.id!==id&&!linkDown(x)&&capOf(x)>0&&(R.load[x.id]||0)/capOf(x)>=.995).map(x=>({name:CITY[x.a].name+' ⇄ '+CITY[x.b].name,g:R.load[x.id]||0,cap:capOf(x)}));
|
||||
return {split:!seen.has(l.b),loss:losses.reduce((a,x)=>a+x.g,0),losses,busy,day:S.day};
|
||||
}finally{S=save;R=live;UI.hotMap=hot;TE_CACHE=cache;}}
|
||||
function linkCheckModal(l){const t=linkTrial(l.id);if(!t)return;
|
||||
const title=t.split?tr('link_panels.this_backhoe_wins'):t.loss>.01?tr('link_panels.connected_but_tight'):tr('link_panels.one_backhoe_is_not_enough');
|
||||
openModal(`<div style="display:flex;align-items:center;justify-content:space-between;gap:10px"><h2>${tr('common.redundancy_check')}</h2><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div><p class="eyebrow">${esc(CITY[l.a].name)} ⇄ ${esc(CITY[l.b].name)} · ${dateStr(t.day)}</p><div class="inc" style="background:${t.split?'#FFE3E3':t.loss>.01?'#FFF6CF':'#EAF7EE'}"><div class="nm">${title}</div><p class="lead">${t.split?tr('link_panels.no_alternate_backbone_path_connects'):t.loss>.01?tr('link_panels.an_alternate_path_exists_but_current'):tr('link_panels.with_current_demand_and_routing_this')}</p><div class="kv"><span>${tr('link_panels.additional_traffic_lost')}</span><b>${fmtG(t.loss)}</b></div></div>${t.losses.length?`<h3>${tr('common.service_affected')}</h3>${t.losses.map(x=>`<div class="kv"><span>${esc(x.name)}</span><b>−${fmtG(x.g)}</b></div>`).join('')}`:''}${t.busy.length?`<h3>${tr('link_panels.full_links_during_the_test')}</h3>${t.busy.slice(0,6).map(x=>`<div class="kv"><span>${esc(x.name)}</span><b>${fmtG(x.g)} / ${fmtG(x.cap)}</b></div>`).join('')}`:''}<p class="note">${tr('link_panels.snapshot_only_one_selected_link')}</p><div class="btns">${btn(tr('common.close'),'closeModal',{},'ghost')}</div>`,'link-check');}
|
||||
function linkCheckControl(l){return `<section><h3>${tr('common.redundancy_check')}</h3><p class="note">${tr('link_panels.what_happens_if_this_link_fails')}</p>${btn(tr('common.check_redundancy'),'linkCheck',{id:l.id},'ghost sm',linkDown(l))}</section>`;}
|
||||
function trafficSection(l){
|
||||
const rec=R.ef[edgeKey(l)],n=pairLinks(l.a,l.b).length;
|
||||
let h=`<section><h3>${tr('link_panels.what_s_on_this_link')}</h3>`;
|
||||
let h=linkCheckControl(l)+`<section><h3>${tr('link_panels.what_s_on_this_link')}</h3>`;
|
||||
if(!rec){return h+`<p class="empty">${tr('link_panels.no_traffic_right_now')}</p></section>`;}
|
||||
const tot=Object.values(rec.net).reduce((a,b)=>a+b,0)||1;
|
||||
const nets=Object.entries(rec.net).sort((a,b)=>b[1]-a[1]);
|
||||
|
|
@ -51,8 +67,15 @@ function trafficSection(l){
|
|||
if(u>=0.8&&egs.length){const d=R.egDesc[egs[0][0]];h+=`<p class="why">${tr('link_panels.biggest_feeder_egress_in_city_set',{egress:esc(d.lab),city:CITY[d.city].name})}</p>`;}
|
||||
return h+`</section>`;
|
||||
}
|
||||
function metricSection(l){const cur=pairMet(edgeKey(l)),pl=pairLinks(l.a,l.b),sb=!!l.standby;
|
||||
let h=`<section><h3>${tr('common.routing_metric')}</h3><p class="lead">${tr('link_panels.your_routers_pick_the_lowest_cost')}</p><div class="btns">${Object.keys(MET).map(k=>btn(MET[k].l,'setMetric',{id:l.id,v:k},cur===k?'pink sm':'ghost sm')).join('')}</div>`;
|
||||
function metricSection(l){const key=edgeKey(l),cur=pairMet(key),pl=pairLinks(l.a,l.b),sb=!!l.standby,base=l.km+60,sel=k=>cur===k?'pink sm':'ghost sm';
|
||||
let h=`<section><h3>${tr('common.routing_metric')}</h3><p class="lead">${tr('link_panels.your_routers_pick_the_lowest_cost_0160')}</p><div class="btns">${Object.keys(MET).map(k=>btn(MET[k].l,'setMetric',{id:l.id,v:k},sel(k))).join('')}${btn(tr('common.custom'),'setMetric',{id:l.id,v:'custom'},sel('custom'))}</div>`;
|
||||
const cm=pairCm(key);
|
||||
if(cm){const k=cm.k,[lo,hi]=MET_LIM[k],md=m=>k===m?'pink sm':'ghost sm';
|
||||
const pre=Object.keys(MET).map(m=>`${MET[m].l} ×${MET[m].f} = ${Math.round(base*MET[m].f)}`).join(', ');
|
||||
h+=`<p class="meta">${tr('link_panels.a_link_s_cost_is_its')} ${tr('link_panels.presets_on_this_link_list',{list:pre})}</p>
|
||||
<div class="btns">${btn(tr('common.multiplier'),'metricMode',{id:l.id,k:'f'},md('f'))}${btn(tr('common.cost'),'metricMode',{id:l.id,k:'w'},md('w'))}</div>
|
||||
<div class="metric-in"><input class="t" id="metIn" type="number" inputmode="decimal" min="${lo}" max="${hi}" step="${k==='w'?1:0.1}" value="${cm.v}" data-id="${esc(l.id)}" aria-label="${esc(k==='w'?tr('common.cost'):tr('common.multiplier'))}">${btn(tr('common.set'),'metricSet',{id:l.id},'pink sm')}</div>
|
||||
<p class="meta">${k==='w'?tr('link_panels.cost_the_exact_number_whatever_the'):tr('link_panels.multiplier_scales_the_distance_cost')} ${tr('link_panels.cost_on_this_link_w_allowed',{w:Math.round(pairW(key,l.km)),lo:k==='w'?lo:'×'+lo,hi:k==='w'?hi:'×'+hi})}</p>`;}
|
||||
// Standby only means something next to another link; a link left on standby alone can still be taken off it.
|
||||
if(pl.length>1||sb){const busy=(R.load[l.id]||0)>1e-3,alone=!pl.some(x=>x!==l&&!x.standby&&!linkDown(x));
|
||||
const st=!sb?tr('link_panels.a_link_on_standby_carries_traffic'):!busy?tr('link_panels.on_standby_idle_while_the_other'):alone?tr('link_panels.on_standby_but_carrying_the_traffic'):tr('link_panels.on_standby_taking_the_overflow');
|
||||
|
|
@ -81,12 +104,12 @@ function dfPanel(l){
|
|||
if(!bld){const sold=S.biz.filter(b=>b.link===l.id&&(b.type==='wwave'||b.type==='dfpair'||b.type==='pairs')),off=S.offers.find(o=>o.link===l.id),fc=freeCh(l);
|
||||
h+=`<section><h3>${tr('link_panels.selling_spare_capacity')}</h3><p class="lead">${tr('link_panels.other_carriers_rent_what_you_do')}</p>
|
||||
<div class="kv"><span>${tr('common.free_channels')}</span><b>${fc} / ${chMax(l)}</b></div>${sold.map(b=>`<div class="row"><div class="grow"><div class="nm">${esc(b.name)}</div><div class="meta">${esc(b.what||BIZ_T[b.type].l)} · ${tr('common.price_mo',{price:fmt$(b.rate)})}</div></div></div>`).join('')}
|
||||
${off?`<div class="row"><div class="grow"><div class="nm">${esc(off.name)}</div><div class="meta">${esc(off.what)} · ${tr('common.price_mo',{price:fmt$(off.rate)})} · ${tr('ui.n_d_left',{n:off.exp-S.day})}${off.broker?' · '+tr('link_panels.via_a_capacity_broker'):''}</div></div>${btn(tr('common.accept'),'accept',{id:off.id},'pink sm')}</div>`:fc>=1||pairFree(l)?`<div class="btns">${btn(tr('link_panels.list_it_with_a_capacity_broker'),'advertise',{id:l.id},'sm')}</div>`:`<p class="note">${tr('link_panels.nothing_spare_to_sell_on_this')}</p>`}</section>`;}
|
||||
${off?`<div class="row"><div class="grow"><div class="nm">${esc(off.name)}</div><div class="meta">${esc(off.what)} · ${tr('common.price_mo',{price:fmt$(off.rate)})} · ${tr('ui.n_d_left',{n:off.exp-S.day})}${off.broker?' · '+tr('link_panels.via_a_capacity_broker'):''}</div></div>${btn(autoAcceptLabel(off),'accept',{id:off.id},'pink sm')}</div>`:fc>=1||pairFree(l)?`<div class="btns">${btn(tr('link_panels.list_it_with_a_capacity_broker'),'advertise',{id:l.id},'sm')}</div>`:`<p class="note">${tr('link_panels.nothing_spare_to_sell_on_this')}</p>`}</section>`;}
|
||||
h+=`<section><h3>${tr('common.optics')}</h3><p class="lead">${tr('link_panels.each_channel_is_a_pair_of')}</p>`;
|
||||
if(l.own&&l.sub)h+=subUpgradePanel(l);
|
||||
for(const k of Object.keys(OPT)){const O=OPT[k],n=(l.ch||[]).filter(x=>x===k).length,why=chWhy(l,k);
|
||||
const md=optMode(k,l),cc=chCost(l,k),sp=spareN(k);
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">${O.n} <span class="meta">${optModes(k,l).map(([g,r])=>tr('link_panels.g_to_km_km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')}</span></div><div class="meta">${esc(O.blurb)}${n?` · <b>${tr('link_panels.n_lit',{n})}</b>`:''}${sp?` · ${trn('link_panels.n_spare_on_the_shelf',sp)}`:''}</div>${md&&!md.full?`<div class="meta">⚠️ ${tr('link_panels.runs_at_g_per_channel_on',{g:fmtG(md.g)})} ${!l.sub&®enNeed(k,l)>(l.regen|0)?trn('link_panels.n_regen_site_would_bring_it',regenNeed(k,l),{g:fmtG(O.g)}):''}</div>`:''}${why?`<div class="why">${esc(why)}</div>`:''}</div>${n?btn('−','rmCh',{id:l.id,o:k},'ghost sm'):''}${btn(sp?`+ <small>${cc?tr('link_panels.spare_price',{price:fmt$(cc)}):tr('common.spare')}</small>`:`+ <small>${fmt$(cc)}</small>`,'addCh',{id:l.id,o:k},'sm',!!why||S.cash<cc)}</div>`;}
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">${O.n} <span class="meta">${optModes(k,l).map(([g,r])=>tr('link_panels.g_to_km_km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')}</span></div><div class="meta">${esc(O.blurb)}${n?` · <b>${tr('link_panels.n_lit',{n})}</b>`:''}${sp?` · ${trn('link_panels.n_spare_on_the_shelf',sp)}`:''}</div>${md&&!md.full?`<div class="meta">⚠️ ${tr('link_panels.runs_at_g_per_channel_on',{g:fmtG(md.g)})} ${!l.sub&®enNeed(k,l)>(l.regen|0)?trn('link_panels.n_regen_site_would_bring_it',regenNeed(k,l),{g:fmtG(O.g)}):''}</div>`:''}${why?`<div class="why">${esc(why)}</div>`:''}${opticCountControl(l,k,n)}</div>${n?btn('−','rmCh',{id:l.id,o:k},'ghost sm'):''}${btn(sp?`+ <small>${cc?tr('link_panels.spare_price',{price:fmt$(cc)}):tr('common.spare')}</small>`:`+ <small>${fmt$(cc)}</small>`,'addCh',{id:l.id,o:k},'sm',!!why||S.cash<cc)}</div>`;}
|
||||
{const st=Object.keys(OPT).filter(k=>spareN(k)>0);h+=`<p class="note">${tr('link_panels.unplugged_optics_go_on_the_spares')}</p>`;
|
||||
{const used=[...new Set(l.ch||[])].filter(k=>OPT[k]&&OPT[k].lvl<=lvl());if(used.length)h+=`<div class="btns">${used.map(k=>btn(tr('link_panels.stock_a_spare_optic_price',{optic:OPT[k].n,price:fmt$(optCost(k))}),'buySpare',{o:k},'ghost sm',S.cash<optCost(k)||spareN(k)>=64)).join('')}</div><p class="meta">${tr('link_panels.spares_bought_now_are_already_paid')}</p>`;}if(st.length)h+=`<h4 class="sub4">${tr('common.spares_shelf')}</h4>`+st.map(k=>`<div class="row"><div class="grow"><div class="nm">${spareN(k)} × ${OPT[k].n}</div></div>${btn(tr('link_panels.sell_one_price',{price:fmt$(spareValue(k))}),'sellSpare',{o:k},'ghost sm')}</div>`).join('');}
|
||||
const rg=l.regen|0,rgAdd=REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH);
|
||||
|
|
@ -98,7 +121,7 @@ function dfPanel(l){
|
|||
}
|
||||
function offersHere(c){
|
||||
const os=S.offers.filter(o=>bCities(o).includes(c));if(!os.length)return '';
|
||||
return `<section><h3>${tr('common.offers_here')}</h3>${os.map(o=>`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)}${o.city2?` ${CITY[o.city].name} ⇄ ${CITY[o.city2].name}`:''} · ${bTerms(o)} · ${tr('ui.n_d_left',{n:o.exp-S.day})}</div>${R.reach<0.99&&!BIZ_T[o.type].l2?`<div class="why">${tr('link_panels.they_need_the_full_internet_your',{pct:pct(R.reach)})}</div>`:''}${o.type==='scrub'&&!hasScrub()?`<div class="why">${tr('link_panels.needs_your_own_scrubbing_center')}</div>`:''}${reqList(o)}${bHas(o)?'':`<div class="why">${tr('link_panels.needs_a_pop_in_cities_too',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div>${bHas(o)?btn(tr('common.accept'),'accept',{id:o.id},'green sm'):''}${btn(tr('common.no'),'decline',{id:o.id},'ghost sm')}</div>`).join('')}</section>`;
|
||||
return `<section><h3>${tr('common.offers_here')}</h3>${os.map(o=>`<div class="row"><div class="grow"><div class="nm">${esc(o.name)}</div><div class="meta">${esc(BIZ_T[o.type].l)}${o.city2?` ${CITY[o.city].name} ⇄ ${CITY[o.city2].name}`:''} · ${bTerms(o)} · ${tr('ui.n_d_left',{n:o.exp-S.day})}</div>${R.reach<0.99&&!BIZ_T[o.type].l2?`<div class="why">${tr('link_panels.they_need_the_full_internet_your',{pct:pct(R.reach)})}</div>`:''}${o.type==='scrub'&&!hasScrub()?`<div class="why">${tr('link_panels.needs_your_own_scrubbing_center')}</div>`:''}${bRisk(o)}${reqList(o)}${bHas(o)?'':`<div class="why">${tr('link_panels.needs_a_pop_in_cities_too',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}</div>`}</div>${bHas(o)?btn(autoAcceptLabel(o),'accept',{id:o.id},'green sm'):''}${btn(tr('common.no'),'decline',{id:o.id},'ghost sm')}</div>`).join('')}</section>`;
|
||||
}
|
||||
function linkPanel(id){
|
||||
const l=S.links.find(x=>x.id===id);if(!l){UI.sel=null;return '';}
|
||||
|
|
|
|||
20
src/game/93-ui/75-optic-counts.js
Normal file
20
src/game/93-ui/75-optic-counts.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
function opticCountControl(l,o,n){
|
||||
const key=JSON.stringify([l.id,o]);let draft=UI.opticCounts&&UI.opticCounts[key];
|
||||
if(draft&&draft.base!==n){delete UI.opticCounts[key];draft=null;}
|
||||
const v=draft?draft.n:n,value=draft?draft.value:n;
|
||||
const price=Number.isSafeInteger(v)&&v>=0&&v<=chMax(l)?opticCountCost(l,o,v):0;
|
||||
return `<form class="optic-count" data-link="${esc(l.id)}" data-optic="${o}"><label>${tr('optic_counts.target_count')}<input class="t" type="number" name="count" min="0" max="${chMax(l)}" step="1" inputmode="numeric" required value="${esc(value)}" aria-label="${esc(tr('optic_counts.count_for_model',{model:OPT[o].n}))}"></label><button class="b sm" type="submit">${tr('optic_counts.apply_price',{price:fmt$(price)})}</button></form>`;
|
||||
}
|
||||
document.addEventListener('input',e=>{
|
||||
const f=e.target.closest('form.optic-count');if(!f||!S)return;
|
||||
const l=S.links.find(x=>x.id===f.dataset.link),o=f.dataset.optic,n=f.elements.count.valueAsNumber;
|
||||
if(!l||!own(OPT,o))return;
|
||||
UI.opticCounts=UI.opticCounts||{};UI.opticCounts[JSON.stringify([l.id,o])]={base:(l.ch||[]).filter(k=>k===o).length,n,value:e.target.value};
|
||||
e.target.setAttribute('value',e.target.value);
|
||||
f.querySelector('button').textContent=tr('optic_counts.apply_price',{price:fmt$(Number.isSafeInteger(n)&&n>=0&&n<=chMax(l)?opticCountCost(l,o,n):0)});
|
||||
});
|
||||
document.addEventListener('submit',e=>{
|
||||
const f=e.target.closest('form.optic-count');if(!f)return;e.preventDefault();
|
||||
if(!S||!f.reportValidity()||!$('modal').hidden)return;
|
||||
ACT.setChCount({id:f.dataset.link,o:f.dataset.optic,n:f.elements.count.valueAsNumber});
|
||||
});
|
||||
|
|
@ -12,8 +12,8 @@ const SCN_PROG={stg:()=>[{l:tr('common.reach'),v:R.reach,max:0.45,txt:`${pct(R.r
|
|||
darien:()=>[...['bog','lim','scl','sao'].map(c=>pChk(tr('progress.pop_in_city',{city:CITY[c].name}),!!S.pops[c])),pSrv(150)],
|
||||
gangnam:()=>[pReach(),pSrv(200)],
|
||||
fttb:()=>[...AU_BB.map(c=>pChk(tr('progress.broadband_in_city',{city:CITY[c].name}),!!(S.pops[c]&&S.pops[c].bb))),{l:tr('common.cables_overseas'),v:Math.min(2,auExits()),max:2,txt:`${auExits()} / 2`}],
|
||||
flood:()=>{const ok=S.stats.ddosOk||0,big=S.stats.ddosOkBig||0,a=S.ev.ddos&&S.ev.ddos.until>S.day?S.ev.ddos:null;
|
||||
return [{l:tr('common.floods_held'),v:ok,max:20,txt:`${ok} / 20`},{l:tr('progress.terabit_floods_held'),v:big,max:5,txt:`${big} / 5`},{l:tr('progress.floods_that_got_through'),v:0,max:0,txt:String(S.stats.ddosLost||0)}].concat(a?[{l:tr('progress.under_attack_now'),v:0,max:0,txt:`${fmtG(a.gbps)} · ${CITY[a.city].name} · ${pct(a.worst===undefined?1:a.worst)}`}]:[]);},baltic:()=>[{l:tr('progress.days_in_a_row_with_99'),v:S.stats.clean||0,max:90,txt:tr('progress.n_of_m',{n:S.stats.clean||0,m:90})}]};
|
||||
flood:()=>{const ok=S.stats.ddosOk||0,big=S.stats.ddosOkBig||0,attacks=ddosAll();
|
||||
return [{l:tr('common.floods_held'),v:ok,max:20,txt:`${ok} / 20`},{l:tr('progress.terabit_floods_held'),v:big,max:5,txt:`${big} / 5`},{l:tr('progress.floods_that_got_through'),v:0,max:0,txt:String(S.stats.ddosLost||0)}].concat(attacks.map(a=>({l:tr('progress.under_attack_now'),v:0,max:0,txt:`${fmtG(a.gbps)} · ${CITY[a.city].name} · ${pct(a.worst===undefined?1:a.worst)}`})));},baltic:()=>[{l:tr('progress.days_in_a_row_with_99'),v:S.stats.clean||0,max:90,txt:tr('progress.n_of_m',{n:S.stats.clean||0,m:90})}]};
|
||||
function scnProg(){const sc=S&&S.scn;if(!sc)return null;
|
||||
if(sc.id==='weekly')return {goal:tr('common.serve_as_much_traffic_as_you'),items:[{l:tr('progress.your_score_peak_traffic'),v:0,max:0,txt:fmtG(S.stats.peak||0)}],f:Math.min(1,S.day/sc.days)};
|
||||
const def=SCN.find(x=>x.id===sc.id),fn=SCN_PROG[sc.id];if(!def)return null;let items=[];try{items=fn?fn():[];}catch(e){items=[];}
|
||||
|
|
|
|||
|
|
@ -30,5 +30,5 @@ function custSection(){const F=UI.kf||{};let h=`<div class="panel2" id="custSec"
|
|||
const trend=b=>b.pm===undefined||Math.abs(b.mood-b.pm)<0.05?'':b.mood>b.pm?' <span style="color:var(--eye)">▲</span>':' <span style="color:var(--bad)">▼</span>';
|
||||
const sorts=[['mood',tr('common.happiness')],['mo',tr('common.per_month')],['name',tr('common.name')],['city',tr('common.where')]];
|
||||
h+=`<div class="seg" style="margin-bottom:4px">${sorts.map(([k,l])=>btn(l+(sk===k?(dir>0?' ▲':' ▼'):''),'custSort',{k},sk===k?'pink sm':'ghost sm')).join('')}</div>`;
|
||||
h+=rows.slice(0,listN('cust')).map(b=>{const why=bizWhy(b),grace=S.day-(b.since||0)<15;return `<div class="row"><div class="grow"><div class="nm">${esc(b.name)} <span class="meta">${esc(BIZ_T[b.type].l)}</span></div><div class="meta">${esc(where(b))} · ${BIZ_T[b.type].event?esc(bTerms(b)):tr('common.price_mo',{price:fmt$(bizMo(b))})}${grace?` · ${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}`:''}</div>${why.length?`<div class="why">${why.map(esc).join(' · ')}</div>`:''}<div class="bar ${moodCls(b.mood)}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}${trend(b)}</div></div>${btn(tr('common.open'),'custGo',{id:b.id},'ghost sm')}</div>`;}).join('');
|
||||
h+=rows.slice(0,listN('cust')).map(b=>{const why=bizWhy(b),grace=S.day-(b.since||0)<15;return `<div class="row"><div class="grow"><div class="nm">${esc(b.name)} <span class="meta">${esc(BIZ_T[b.type].l)}</span></div><div class="meta">${esc(where(b))} · ${BIZ_T[b.type].event?esc(bTerms(b)):tr('common.price_mo',{price:fmt$(bizMo(b))})}${grace?` · ${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}`:''}</div>${bRisk(b)}${why.length?`<div class="why">${why.map(esc).join(' · ')}</div>`:''}<div class="bar ${moodCls(b.mood)}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}${trend(b)}</div></div>${btn(tr('common.open'),'custGo',{id:b.id},'ghost sm')}</div>`;}).join('');
|
||||
return h+listMore('cust',rows.length,n=>trn('customers.n_more_customer',n))+`</div>`;}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,9 @@ function renderDash(){checkLayer();
|
|||
{const k=UI.dashSort||'traffic',dir=UI.dashDir||-1,val=x=>k==='name'?x.n.name.toLowerCase():k==='asn'?x.n.asn:k==='type'?x.n.type:k==='cost'?x.cost:k==='lost'?x.lost:x.t;nets.sort((a,b)=>{const A=val(a),B=val(b);return (A<B?-1:A>B?1:0)*dir||b.t-a.t;});}
|
||||
if(DT==='cust')h+=custSection();
|
||||
if(DT==='conn')h+=connSection();
|
||||
if(DT==='traffic')h+=`<div class="btns">${btn(tr('pni_all.peer_all_networks'),'pniAllOpen',{net:null},'pink sm')}</div>`;
|
||||
if(DT==='traffic')h+=`<div class="panel2" style="margin-top:12px"><h3>${tr('dashboard.traffic_by_network_asn')}</h3><p class="note" style="margin-top:0">${tr('dashboard.where_your_users_traffic_comes_from')}</p><div class="legend" style="margin:0 0 6px">${['c','p','ix','t'].map(k=>`<span><i style="background:${EGC[k][1]}"></i>${EGC[k][0]}</span>`).join('')}</div><div class="tscroll"><table class="tbl"><thead><tr>${[['name',tr('common.network_6974'),''],['asn','AS',''],['type',tr('common.type'),''],['traffic',tr('common.traffic'),'r'],['mix',tr('dashboard.how_it_arrives'),''],['cost',tr('common.transit_cost'),'r'],['lost',tr('common.lost'),'r']].map(([k,l,c])=>`<th class="${c}">${k==='mix'?l:`<button class="thb" data-act="dashSort" data-args="${esc(JSON.stringify({k}))}">${l}${UI.dashSort===k?(UI.dashDir>0?' ▲':' ▼'):''}</button>`}</th>`).join('')}</tr></thead><tbody>
|
||||
${nets.map(({n,e,t,want})=>{return `<tr><td><span style="display:inline-flex;align-items:center;gap:6px">${logo(n)}<b>${esc(n.name)}</b></span></td><td>${n.asn}</td><td><span class="tag ${n.type}">${TYPE_L[n.type]}</span></td><td class="r">${fmtG(t)}</td><td><div class="mix" title="${['c','p','ix','t'].filter(k=>e[k]>0.01).map(k=>EGC[k][0]+' '+fmtG(e[k])).join(' · ')||tr('common.nothing_yet')}">${['c','p','ix','t'].map(k=>`<i style="width:${t?e[k]/t*100:0}%;background:${EGC[k][1]}"></i>`).join('')}</div></td><td class="r">${e.t>0.01?tr('common.price_mo',{price:fmt$((R.cost.transit||0)*e.t/tT)}):'—'}</td><td class="r" style="color:${want-t>want*0.05?'var(--bad)':'inherit'}">${want>0.01?pct(Math.max(0,1-t/want)):'—'}</td></tr>`;}).join('')}</tbody></table></div></div>`;
|
||||
${nets.map(({n,e,t,want})=>{return `<tr><td><span style="display:inline-flex;align-items:center;gap:6px">${logo(n)}<b>${esc(n.name)}</b></span>${n.pops&&n.pops.some(c=>S.pops[c])?`<div class="btns">${btn(tr('pni_all.peer_on_all_pops'),'pniAllOpen',{net:n.id},'ghost sm')}</div>`:''}</td><td>${n.asn}</td><td><span class="tag ${n.type}">${TYPE_L[n.type]}</span></td><td class="r">${fmtG(t)}</td><td><div class="mix" title="${['c','p','ix','t'].filter(k=>e[k]>0.01).map(k=>EGC[k][0]+' '+fmtG(e[k])).join(' · ')||tr('common.nothing_yet')}">${['c','p','ix','t'].map(k=>`<i style="width:${t?e[k]/t*100:0}%;background:${EGC[k][1]}"></i>`).join('')}</div></td><td class="r">${e.t>0.01?tr('common.price_mo',{price:fmt$((R.cost.transit||0)*e.t/tT)}):'—'}</td><td class="r" style="color:${want-t>want*0.05?'var(--bad)':'inherit'}">${want>0.01?pct(Math.max(0,1-t/want)):'—'}</td></tr>`;}).join('')}</tbody></table></div></div>`;
|
||||
if(DT==='traffic'){const top=transitTop(S.transit.map(t=>t.id),8);if(top.length)h+=`<div class="panel2" style="margin-top:12px"><h3>${tr('dashboard.who_your_transit_carries')}</h3><p class="note" style="margin-top:0">${tr('dashboard.the_networks_you_pay_transit_to')}</p>${top.map(([id,v])=>`<div class="row">${logo(NET[id])}<div class="grow"><div class="nm">${esc(NET[id].name)} <span class="meta">AS${NET[id].asn} · ${fmtG(v)} · ${tr('dashboard.about_price_mo',{price:fmt$((R.cost.transit||0)*v/tT)})}</span></div><div class="meta">${esc(offTransitHint(id))}</div></div>${btn(tr('common.where_6276'),'netFocus',{id},'ghost sm')}</div>`).join('')}</div>`;}
|
||||
const ls=S.links.filter(l=>capOf(l)>0).map(l=>({l,u:(R.load[l.id]||0)/capOf(l)})).sort((a,b)=>b.u-a.u).slice(0,8);
|
||||
const rs=Object.keys(S.pops).map(c=>({c,u:(R.nodeLoad[c]||0)/(R.nodeCap[c]||1)})).sort((a,b)=>b.u-a.u).slice(0,6);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Keyboard focus moves into the modal, so Enter or Space can't keep pressing a hidden button behind it.
|
||||
function openModal(html){if($('modal').hidden)markLayer();$('modalCard').innerHTML=html;$('modal').hidden=false;const a=document.activeElement;if(a&&a!==document.body&&!a.closest('#modal')){a.blur();const m=$('modalCard');m.tabIndex=-1;m.focus({preventScroll:true});}}
|
||||
// The link check on phones sits above the tab bar and is not modal, so the tabs stay usable.
|
||||
function openModal(html,cls=''){$('modal').className=cls;$('modalCard').setAttribute('aria-modal',cls==='link-check'&&isPhone()?'false':'true');if($('modal').hidden)markLayer();$('modalCard').innerHTML=html;$('modal').hidden=false;const a=document.activeElement;if(a&&a!==document.body&&!a.closest('#modal')){a.blur();const m=$('modalCard');m.tabIndex=-1;m.focus({preventScroll:true});}}
|
||||
function closeModal(){if(!$('modal').hidden)markLayer();$('modal').hidden=true;UI.pending=null;}
|
||||
const NETWORK_NAMES=[
|
||||
'Packet Pals','Shinternet','Post, Telegraph & Tubes','Peering Pressure','Best Effort Telecom',
|
||||
|
|
|
|||
20
src/game/95-modals/35-pni-all.js
Normal file
20
src/game/95-modals/35-pni-all.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
function pniAllModal(net,tier=1){const b=pniBatch(net,tier);if(!b)return;UI.pniAll={net,tier};
|
||||
const all=net===null,n=NET[net],port=tier===-1?'1G':PORT[tier].n,up=b.orders.filter(q=>q.ex).length,byNet={};
|
||||
if(all)for(const q of b.orders)(byNet[q.net]||(byNet[q.net]=[])).push(q.city);
|
||||
const controls=`<div class="btns">${btn(all?tr('pni_all.all_at_port',{port}):tr('pni_all.peer_at_port',{port}),'pniAll',{net,tier},'pink',!b.orders.length||S.cash<b.cost)}${btn(tr('common.cancel'),'closeModal',{},'ghost')}</div>`;
|
||||
const blocked=b.blocked.map(q=>`<p class="why"><b>${all?esc(NET[q.net].name)+' · ':''}${esc(CITY[q.city].name)}:</b> ${q.why}</p>`).join('');
|
||||
openModal(`<div style="display:flex;align-items:center"><div><div class="eyebrow">${all?tr('common.all_networks'):`AS${n.asn} · ${esc(n.name)}`}</div><h2>${all?tr('pni_all.peer_all_networks'):tr('pni_all.peer_on_all_pops')}</h2></div><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div>
|
||||
<p class="lead">${tr('pni_all.order_missing_and_upgrade_smaller')}</p>
|
||||
<div class="trsel"><label>${tr('pni_all.pni_size')}<select data-chg="pniAllSize">${pniG1(net)?`<option value="-1"${tier===-1?' selected':''}>1G</option>`:''}${PORT.map((p,i)=>portShown(i)&&(all||i>=pniMin(net))?`<option value="${i}"${tier===i?' selected':''}>${p.n}</option>`:'').join('')}</select></label></div>
|
||||
<div class="kv"><span>${tr('pni_all.new_and_upgrades',{fresh:b.orders.length-up,up})}</span><b>${all?tr('pni_all.n_of_total_connections',{n:b.orders.length,total:b.shared.length}):tr('pni_all.n_of_total_pops',{n:b.orders.length,total:b.shared.length})}</b></div>
|
||||
<div class="kv"><span>${tr('pni_all.setup_total')}</span><b>${fmt$(b.cost)}</b></div>
|
||||
<div class="kv"><span>${tr('pni_all.additional_per_month')}</span><b>${tr('common.price_mo',{price:fmt$(b.mo)})}</b></div>
|
||||
${b.raised?`<p class="note">${trn('pni_all.n_at_their_minimum_size',b.raised)}</p>`:''}
|
||||
${all?`<p class="note">${tr('pni_all.delivery_and_traffic_charges')}</p>`:n.perG?`<p class="note">${tr('pni_all.traffic_charges_apply',{price:fmt$(n.perG)})}</p>`:''}
|
||||
${S.cash<b.cost?`<p class="why">${tr('interface.not_enough_cash_wait_for_revenue')}</p>`:''}
|
||||
${all?controls:''}
|
||||
${all&&b.orders.length?`<details><summary>${trn('pni_all.n_networks',Object.keys(byNet).length)}</summary>${Object.entries(byNet).map(([id,cities])=>`<div class="kv"><b>${esc(NET[id].name)}</b><span>${trn('save.n_pop',cities.length)}</span></div><p class="meta">${cities.map(c=>esc(CITY[c].name)).join(' · ')}</p>`).join('')}</details>`:b.orders.length?`<p class="meta">${b.orders.map(q=>esc(CITY[q.city].name)).join(' · ')}</p><p class="note">${pniEta(net)}</p>`:''}
|
||||
${b.kept?`<p class="note">${trn('pni_all.n_existing_or_pending_unchanged',b.kept)}</p>`:''}
|
||||
${b.blocked.length?(all?`<details><summary>${trn('pni_all.n_blocked_connections',b.blocked.length)}</summary>${blocked}</details>`:`<h3>${trn('pni_all.n_blocked_pops',b.blocked.length)}</h3>${blocked}`):''}
|
||||
${!b.shared.length?`<p class="why">${all?tr('pni_all.no_shared_locations'):tr('pni_all.no_shared_pops')}</p>`:''}
|
||||
${all?'':controls}`);}
|
||||
|
|
@ -38,5 +38,5 @@ cv.addEventListener('pointerup',endPtr);cv.addEventListener('pointercancel',canc
|
|||
const ZMIN=0.35,ZMAX=16;
|
||||
function zoomAt(mx,my,f){const wx=cam.x+(mx-CW/2)/cam.z,wy=cam.y+(my-CH/2)/cam.z;cam.z=clamp(cam.z*f,ZMIN,ZMAX);cam.x=wx-(mx-CW/2)/cam.z;cam.y=wy-(my-CH/2)/cam.z;wrapCam();}
|
||||
cv.addEventListener('wheel',e=>{e.preventDefault();zoomAt(e.clientX,e.clientY,Math.exp(-e.deltaY*0.0015));},{passive:false});
|
||||
addEventListener('keydown',e=>{if(e.target.closest&&e.target.closest('input,textarea,select,[contenteditable]'))return;if(e.ctrlKey||e.metaKey||e.altKey)return;if(e.code==='Space'&&e.target.closest&&e.target.closest('button,a'))return;if(e.code==='Space'&&(!S||rule('clock'))&&!pzOn()){e.preventDefault();UI.speed=UI.speed?0:1;renderHUD();}if(e.key==='0')ACT.speed({v:0.5});if(e.key==='1')ACT.speed({v:1});if(e.key==='2')ACT.speed({v:2});if(e.key==='3')ACT.speed({v:4});if(e.key==='4')ACT.speed({v:8});if(e.key==='Escape'&&!$('bankBox').hidden){$('bankBox').hidden=true;return;}if(e.key==='Escape'&&!$('dash').hidden){$('dash').hidden=true;return;}if(e.key==='Escape'){if(!$('modal').hidden){if(S&&UI.started&&!S.lost)closeModal();}else{UI.sel=null;renderPanel();}}});
|
||||
addEventListener('keydown',e=>{if(e.key==='Enter'&&e.target.id==='metIn'){ACT.metricSet({id:e.target.dataset.id});return;}if(e.target.closest&&e.target.closest('input,textarea,select,[contenteditable]'))return;if(e.ctrlKey||e.metaKey||e.altKey)return;if(e.code==='Space'&&e.target.closest&&e.target.closest('button,a'))return;if(e.code==='Space'&&(!S||rule('clock'))&&!pzOn()){e.preventDefault();UI.speed=UI.speed?0:1;renderHUD();}if(e.key==='0')ACT.speed({v:0.5});if(e.key==='1')ACT.speed({v:1});if(e.key==='2')ACT.speed({v:2});if(e.key==='3')ACT.speed({v:4});if(e.key==='4')ACT.speed({v:8});if(e.key==='Escape'&&!$('bankBox').hidden){$('bankBox').hidden=true;return;}if(e.key==='Escape'&&!$('dash').hidden){$('dash').hidden=true;return;}if(e.key==='Escape'){if(!$('modal').hidden){if(S&&UI.started&&!S.lost)closeModal();}else{UI.sel=null;renderPanel();}}});
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ function frame(now){
|
|||
if(UI.panelsDue){UI.panelsDue=false;if(!pressing){renderPanel();renderLeft();if(!$('dash').hidden)renderDash();renderBank();}renderHint();}
|
||||
if(S&&!S.lost&&$('modal').hidden&&UI.speed&&!pzOn()){acc+=dt*UI.speed;let n=0;while(acc>=DAY_MS&&n<4&&UI.speed){acc-=DAY_MS;try{dayTick();}catch(e){tickErr(e);}n++;}
|
||||
if(n){UI.ticking=true;renderHUD();UI.ticking=false;UI.panelsDue=true;}}
|
||||
try{automationTick(now);renderAutoCountdown();}catch(e){tickErr(e);}
|
||||
if((UI.speed||pzOn())&&!(S&&S.lost))animT+=dt; /* paused = frozen dots, waves and clouds */
|
||||
const t=animOn()?animT:0;
|
||||
if(!(UI.mapHid=mapHidden())&&!mapStill(t,now)){try{draw(t);}catch(e){tickErr(e);}UI.drawnAt=now;}
|
||||
|
|
|
|||
109
src/i18n/en.js
109
src/i18n/en.js
|
|
@ -13,6 +13,11 @@
|
|||
"action_helpers.too_far_even_at_its_slowest":"Too far even at its slowest setting: an optical span here is {span} km and it reaches {max} km. Add a regen site (Line system).",
|
||||
"action_helpers.unlocks_at_customer_level_n":"Unlocks at customer level {n}.",
|
||||
"actions.your_router_can_t_take_a":"<b>Your router can't take a {port} port.</b><br>Upgrade it in the Infra tab.",
|
||||
"automation.auto_accept_sales":"Auto-accept sales: {state}",
|
||||
"automation.auto_pay_repairs":"Auto-pay repairs: {state}",
|
||||
"automation.next_auto_check":"Time until the next automatic requirements check.",
|
||||
"automation.repairs_when_affordable":"While playing, automatically pay for available rush repairs when you can afford them.",
|
||||
"automation.sales_every_five_seconds":"Every 5 seconds while playing, accept only offers whose requirements and service capacity are ready.",
|
||||
"badges.a_petabit_a_second":"A Petabit a Second",
|
||||
"badges.a_secret_badge":"A secret badge",
|
||||
"badges.attend_a_conference":"Attend a conference.",
|
||||
|
|
@ -698,6 +703,7 @@
|
|||
"city_panel.every_port_is_taken_add_a":"Every port is taken. Add a router or swap to a model with more ports before you plug in anything new.",
|
||||
"city_panel.everything_is_in_one_building_move":"Everything is in one building. Move some uplinks to the other site from the Transit and Peering tabs.",
|
||||
"city_panel.fabrics_list":"Fabrics: {list}",
|
||||
"city_panel.few_data_centers_pops_x":"Few data centers: POPs {x}×",
|
||||
"city_panel.fiber_from_city":"Fiber from {city}",
|
||||
"city_panel.fiber_is_down":"fiber is down",
|
||||
"city_panel.g_of_circuits":"{g} of circuits",
|
||||
|
|
@ -784,6 +790,7 @@
|
|||
"common.95th_percentile":"95th percentile",
|
||||
"common.about_average":"about average",
|
||||
"common.accept":"Accept",
|
||||
"common.ack_flood":"ACK flood",
|
||||
"common.ad_campaign":"Ad campaign!",
|
||||
"common.africa":"Africa",
|
||||
"common.all_cities":"All cities",
|
||||
|
|
@ -850,6 +857,7 @@
|
|||
"common.challenger":"challenger",
|
||||
"common.change_freeze":"Change freeze",
|
||||
"common.chase_it":"Chase it",
|
||||
"common.check_redundancy":"Check redundancy",
|
||||
"common.china":"China",
|
||||
"common.city":"city",
|
||||
"common.city_906b":"City",
|
||||
|
|
@ -874,10 +882,12 @@
|
|||
"common.controller_off":"controller off",
|
||||
"common.cooling_failure":"Cooling failure",
|
||||
"common.copy":"Copy",
|
||||
"common.cost":"Cost",
|
||||
"common.costs":"Costs",
|
||||
"common.courtesy_route":"Courtesy route",
|
||||
"common.crashes_more":"crashes more",
|
||||
"common.credit_rating":"Credit rating",
|
||||
"common.custom":"Custom",
|
||||
"common.customer":"Customer",
|
||||
"common.customer_care":"Customer Care",
|
||||
"common.customer_levels":"Customer levels",
|
||||
|
|
@ -904,6 +914,7 @@
|
|||
"common.demand":"Demand",
|
||||
"common.deploy":"Deploy",
|
||||
"common.deployed":"deployed",
|
||||
"common.distributed_ingress":"Distributed ingress",
|
||||
"common.diverse":"diverse",
|
||||
"common.diverse_route":"diverse route",
|
||||
"common.dns_reflection":"DNS reflection",
|
||||
|
|
@ -1061,6 +1072,7 @@
|
|||
"common.may":"May",
|
||||
"common.member":"− member",
|
||||
"common.member_fef5":"Member",
|
||||
"common.memcached_amplification":"Memcached amplification",
|
||||
"common.merchant_silicon":"merchant silicon",
|
||||
"common.mercury":"Mercury",
|
||||
"common.metaverse_platform":"Metaverse platform",
|
||||
|
|
@ -1073,6 +1085,7 @@
|
|||
"common.more_scenarios":"More scenarios",
|
||||
"common.ms_ms_one_way":"{ms} ms one-way",
|
||||
"common.mtu_mismatch":"MTU mismatch",
|
||||
"common.multiplier":"Multiplier",
|
||||
"common.mystery_link":"Mystery link",
|
||||
"common.n_box":{"one":"{n} box","other":"{n} boxes"},
|
||||
"common.n_days_left":"{n} days left",
|
||||
|
|
@ -1162,6 +1175,7 @@
|
|||
"common.price_lock":"Price lock",
|
||||
"common.price_mo":"{price}/mo",
|
||||
"common.provisioning_n_d_grace":"provisioning, {n}d grace",
|
||||
"common.racknet":"RackNet",
|
||||
"common.rank":"Rank",
|
||||
"common.rare":"Rare",
|
||||
"common.reach":"Reach",
|
||||
|
|
@ -1171,6 +1185,7 @@
|
|||
"common.really_leave":"Really leave?",
|
||||
"common.really_remove":"Really remove?",
|
||||
"common.redundancy":"Redundancy",
|
||||
"common.redundancy_check":"Redundancy check",
|
||||
"common.regen_site":"− Regen site",
|
||||
"common.regen_sites":"Regen sites",
|
||||
"common.regional_player":"Regional player",
|
||||
|
|
@ -1228,6 +1243,8 @@
|
|||
"common.sep":"Sep",
|
||||
"common.serious_backbone":"Serious backbone",
|
||||
"common.serve_as_much_traffic_as_you":"Serve as much traffic as you can in one year.",
|
||||
"common.service_affected":"Service affected",
|
||||
"common.set":"Set",
|
||||
"common.settings":"Settings",
|
||||
"common.share":"Share",
|
||||
"common.share_2cd9":"Share…",
|
||||
|
|
@ -1273,6 +1290,7 @@
|
|||
"common.subsea_cables":"Subsea cables",
|
||||
"common.supply_chain":"Supply chain",
|
||||
"common.syn_flood":"SYN flood",
|
||||
"common.teamspooked":"TeamSpooked",
|
||||
"common.terrestrial":"terrestrial",
|
||||
"common.terrestrial_19e4":"Terrestrial",
|
||||
"common.terrestrial_fiber":"Terrestrial fiber",
|
||||
|
|
@ -1404,6 +1422,7 @@
|
|||
"customers.you_need_a_pop_in_every":"<b>You need a POP in every city on the contract first.</b>",
|
||||
"customers_and_events.bw_extra_for_d_days_when":"{bw} extra for {d} days, {when} · pays {fee} when it is over",
|
||||
"customers_and_events.day_n_of_d":"day {n} of {d}",
|
||||
"customers_and_events.gaming_attracts_attacks":"Gaming attracts attacks",
|
||||
"customers_and_events.n_fiber_pairs_in_your_a":"{n} fiber pairs in your {a}–{b} trench. Trenching was the expensive part, so they want all of it",
|
||||
"customers_and_events.n_sites_list_bw_per_site":"{n} sites: {list} · {bw} per site · {price}/mo",
|
||||
"customers_and_events.name_at_site":"{name} at {site}",
|
||||
|
|
@ -1620,6 +1639,7 @@
|
|||
"failures.a_trawler_off_ostend_dragged_its":"A trawler off Ostend dragged its gear straight through your {a}–{b} cable. The North Sea is about thirty metres deep and full of boats.",
|
||||
"failures.a_visiting_engineer_from_london":"A visiting engineer from London brought Marmite to the {city} NOC. Diplomatic relations broke down, and so did your router while everyone argued.",
|
||||
"failures.a_wind_farm_service_vessel_dropped":"A wind-farm service vessel dropped anchor on your {a}–{b} cable. It was there to fix a turbine.",
|
||||
"failures.across_n_transit_and_peering_ports":", across {n} transit and peering ports",
|
||||
"failures.all_n_links_in_that_trench":"All {n} links in that trench went down with it.",
|
||||
"failures.an_automation_script_in_city_ran":"An automation script in {city} ran “sed” on the whole config instead of one line. Every interface is now named “TODO”.",
|
||||
"failures.an_earthquake_shook_your_a_b":"An earthquake shook your {a}–{b} fiber loose somewhere above 4,000 metres.",
|
||||
|
|
@ -1984,13 +2004,17 @@
|
|||
"incidents_and_ddos.a_leap_second_convinced_one_of":"A leap second convinced one of your routers it is 1970. Uptime now reads minus 56 years. Traffic is fine.",
|
||||
"incidents_and_ddos.a_route_you_withdrew_in_year":"A route you withdrew in Year 1 is still visible somewhere in the internet. Nobody knows where. It is fine. Probably.",
|
||||
"incidents_and_ddos.a_two_hour_meeting_about_router":"A two-hour meeting about router hostnames ended with a vote for “router-final-v2-NEW”.",
|
||||
"incidents_and_ddos.after_upstream_scrubbing_g":"After upstream scrubbing: {g}",
|
||||
"incidents_and_ddos.an_auditor_asked_for_a_network":"An auditor asked for a network diagram. You sent the game map. They approved it.",
|
||||
"incidents_and_ddos.attack_fully_mitigated":"Attack fully mitigated",
|
||||
"incidents_and_ddos.blackhole_the_target_rtbh":"Blackhole the target (RTBH)",
|
||||
"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Blackholed: the junk is gone, and so is {city}. The attack got what it wanted.",
|
||||
"incidents_and_ddos.contained_on_your_sacrificial_net":"Contained on your sacrificial {net} PNI",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_an_vec":"Flowspec cannot catch an {vec} (application layer)",
|
||||
"incidents_and_ddos.flowspec_on_your_model_is_dropping":"Flowspec on your {model} is dropping {vec} at the edge",
|
||||
"incidents_and_ddos.flowspec_on_your_model_trims_vec":"Flowspec on your {model} trims {vec}, but its TCAM is small",
|
||||
"incidents_and_ddos.edge_filters_dropping_g":"Edge filters dropping: {g}",
|
||||
"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec cannot catch {vec}",
|
||||
"incidents_and_ddos.flowspec_dropping_g":"Flowspec dropping: {g}",
|
||||
"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec dropping: {g}; some ingress routers have no TCAM",
|
||||
"incidents_and_ddos.g_is_leaking_through":"{g} is leaking through",
|
||||
"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ <small>$20k</small>",
|
||||
"incidents_and_ddos.it_was_dns":"It was DNS",
|
||||
"incidents_and_ddos.ix_blackhole_half_honour_it":"IX blackhole <small>~half honour it</small>",
|
||||
|
|
@ -2001,29 +2025,29 @@
|
|||
"incidents_and_ddos.load_bearing_typo":"Load-bearing typo",
|
||||
"incidents_and_ddos.management_declared_a_change_freeze":"Management declared a change freeze. Someone made a change to announce the change freeze.",
|
||||
"incidents_and_ddos.name_transit_lag_in_city":"{name} transit LAG in {city}",
|
||||
"incidents_and_ddos.net_is_scrubbing_it_upstream_clean":"{net} is scrubbing it upstream (clean-pipe)",
|
||||
"incidents_and_ddos.no_flowspec_filtering_ingress":"No Flowspec filtering: ingress routers have no TCAM",
|
||||
"incidents_and_ddos.no_scrubbing_center":"No scrubbing center",
|
||||
"incidents_and_ddos.no_scrubbing_needed_after_edge":"No scrubbing needed after edge mitigation",
|
||||
"incidents_and_ddos.on_demand_scrubbing_diverting_live":"On-demand scrubbing diverting, live in {n}d",
|
||||
"incidents_and_ddos.open_to_work":"Open to work",
|
||||
"incidents_and_ddos.pni_lag_with_name_in_city":"PNI LAG with {name} in {city}",
|
||||
"incidents_and_ddos.reaching_your_network_g":"Reaching your network: {g}",
|
||||
"incidents_and_ddos.rtbh_is_free_and_instant_but":"RTBH is free and instant, but it drops everything to the victim, attack and customer alike. An IX blackhole keeps the customer up but only about half the members honour it. HackBack 3000™ by Skynot AI sometimes ends it, and sometimes flattens an innocent and earns you a fine.",
|
||||
"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Scrubbing centers unavailable or at capacity",
|
||||
"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing in {city}: {used} / {capacity}",
|
||||
"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Scrubbing traffic hauled over your backbone: {city} → {to} (+{ms} ms)",
|
||||
"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · {n}d left",
|
||||
"incidents_and_ddos.someone_deleted_the_dns_record_for":"Someone deleted the DNS record for the internal wiki. The runbook for fixing DNS was on the wiki.",
|
||||
"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Someone named a VLAN “prodcution”. It is now load-bearing and can never be renamed.",
|
||||
"incidents_and_ddos.the_tls_certificate_on_your_noc":"The TLS certificate on your NOC dashboard expired. Nobody can see any graphs, so technically there are no problems.",
|
||||
"incidents_and_ddos.this_attack_g":"This attack: {g}",
|
||||
"incidents_and_ddos.ticket_of_the_week":"Ticket of the week",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning":"{tier} scrubbing in {city} is cleaning it, hauled over your backbone (+{ms} ms)",
|
||||
"incidents_and_ddos.tier_scrubbing_in_city_is_cleaning_a8f6":"{tier} scrubbing in {city} is cleaning it",
|
||||
"incidents_and_ddos.vendor_support_asked_you_to_try":"Vendor support asked you to “try turning it off and on again”. For the router you already rebooted. Ticket closed.",
|
||||
"incidents_and_ddos.you_found_a_10g_link_in":"You found a 10G link in the inventory that nobody ordered, nobody pays for, and that carries 3 Gbps of something.",
|
||||
"incidents_and_ddos.your_backbone_can_only_haul_g":"Your backbone can only haul {g} of it to {city}: the rest is not scrubbed",
|
||||
"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Your IP address spreadsheet hit 1,048,576 rows. Excel has opinions.",
|
||||
"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Your IPv6 traffic grew 400%. From one packet to five.",
|
||||
"incidents_and_ddos.your_model_here_has_no_flowspec":"Your {model} here has no Flowspec TCAM",
|
||||
"incidents_and_ddos.your_monitoring_system_went_down_you":"Your monitoring system went down. You found out because nothing alerted. Very peaceful week.",
|
||||
"incidents_and_ddos.your_peering_coordinator_updated":"Your peering coordinator updated their profile to “open to work”. Three Tier 1s suddenly want to chat. Nothing happened, but it felt nice.",
|
||||
"incidents_and_ddos.your_scrubbing_centers_are_full_g":"Your scrubbing centers are full: {g} leaks past",
|
||||
"incidents_and_ddos.your_upstream_support_line_plays_the":"Your upstream support line plays the same 11 seconds of hold music. Your on-call engineer can now hum it in four keys.",
|
||||
"install.before_you_start":"Before you start",
|
||||
"install.best_played_as_an_app":"Best played as an app",
|
||||
|
|
@ -2105,9 +2129,12 @@
|
|||
"link_modal.you_already_have_n_link_here":{"one":"You already have {n} link here ({list}). Parallel links add capacity. How should this one be routed?","other":"You already have {n} links here ({list}). Parallel links add capacity. How should this one be routed?"},
|
||||
"link_panels.a_bigger_fabric_carries_more_traffic":"A bigger fabric carries more traffic and has room for more members. Your router here still has to keep up.",
|
||||
"link_panels.a_link_on_standby_carries_traffic":"A link on standby carries traffic only when the other links between these cities are full or down.",
|
||||
"link_panels.a_link_s_cost_is_its":"A link’s cost is its length in km plus 60, times a multiplier. Traffic takes the path with the lowest total cost.",
|
||||
"link_panels.a_regen_site_turns_the_light":"A regen site turns the light back into bits halfway and sends it on fresh, so optics only have to reach the next site. Each needs a regen card for every lit channel. {price}/mo per site for the hut.",
|
||||
"link_panels.abandon_the_fiber":"Abandon the fiber",
|
||||
"link_panels.add_parallel_link":"Add parallel link",
|
||||
"link_panels.additional_traffic_lost":"Additional traffic lost",
|
||||
"link_panels.an_alternate_path_exists_but_current":"An alternate path exists, but current routing and capacity deliver less traffic.",
|
||||
"link_panels.apply_for_a_license_price_mo":"Apply for a license <small>{price} + {mo}/mo · ~45 days</small>",
|
||||
"link_panels.back_in_n_days":"Back in {n} days.",
|
||||
"link_panels.behind_the_great_firewall":"Behind the Great Firewall",
|
||||
|
|
@ -2118,6 +2145,9 @@
|
|||
"link_panels.click_to_tear_down":"Click to tear down",
|
||||
"link_panels.collecting_data_check_back_in_a":"Collecting data. Check back in a few days.",
|
||||
"link_panels.congested_upgrade_it_or_add_a":"Congested. Upgrade it or add a parallel path.",
|
||||
"link_panels.connected_but_tight":"Connected, but tight.",
|
||||
"link_panels.cost_on_this_link_w_allowed":"Cost on this link: {w}. Allowed: {lo} to {hi}.",
|
||||
"link_panels.cost_the_exact_number_whatever_the":"Cost: the exact number, whatever the distance.",
|
||||
"link_panels.dark_fiber_kind_km_km":"Dark fiber · {kind} · {km} km",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of":"DE-KICKS personalised pricing: {p}% of what a normal IX would charge (promo, {n} days left).",
|
||||
"link_panels.de_kicks_personalised_pricing_p_of_3d4f":"DE-KICKS personalised pricing: {p}% of what a normal IX would charge.",
|
||||
|
|
@ -2126,6 +2156,7 @@
|
|||
"link_panels.finish_in_1_day_price":"Finish in 1 day <small>{price}</small>",
|
||||
"link_panels.foreign_networks_need_a_local_joint":"Foreign networks need a local joint venture and an operating license to build infrastructure here.",
|
||||
"link_panels.found_your_own_ix_cost_mo":"Found your own IX <small>{cost} + {mo}/mo</small>",
|
||||
"link_panels.full_links_during_the_test":"Full links during the test",
|
||||
"link_panels.g_to_km_km":"{g} to {km} km",
|
||||
"link_panels.giving_it_up_now_returns_price":"Giving it up now returns {price}.",
|
||||
"link_panels.going_to_customers_in":"Going to customers in",
|
||||
|
|
@ -2140,6 +2171,7 @@
|
|||
"link_panels.lost_on_the_way":"Lost on the way",
|
||||
"link_panels.mainland_china_plays_by_its_own":"Mainland China plays by its own rules. {list} and other foreign services are blocked here, so users mostly reach Chinese networks. Traffic crossing the border loses about {pct} to filtering and congestion, unless it rides a premium route: CN-Too transit or a premium cross-border circuit (both sold only in Hong Kong), or a PNI with a Chinese network. Revenue per user is lower here.",
|
||||
"link_panels.members_paying_you":"Members paying you",
|
||||
"link_panels.multiplier_scales_the_distance_cost":"Multiplier: scales the distance cost, so a longer link still costs more.",
|
||||
"link_panels.n_amp_huts":"{n} amp huts",
|
||||
"link_panels.n_amplifiers":"{n} amplifiers",
|
||||
"link_panels.n_exchanges_compete_in_city_members":"{n} exchanges compete in {city}. Members overlap, but not completely, and the challengers undercut the incumbent. Small networks often sit on just one of them.",
|
||||
|
|
@ -2158,6 +2190,7 @@
|
|||
"link_panels.needs_a_pop_in_cities_too":"Needs a POP in {cities} too.",
|
||||
"link_panels.needs_what":"needs {what}",
|
||||
"link_panels.needs_your_own_scrubbing_center":"Needs your own scrubbing center (Infra tab).",
|
||||
"link_panels.no_alternate_backbone_path_connects":"No alternate backbone path connects these endpoints if this link fails.",
|
||||
"link_panels.no_regen_sites_in_the_middle":"No regen sites in the middle of the ocean: long cables run their optics in long-haul mode.",
|
||||
"link_panels.no_traffic_right_now":"No traffic right now.",
|
||||
"link_panels.not_in_your_cities_yet_nearest":"Not in your cities yet. Nearest: {city}",
|
||||
|
|
@ -2167,6 +2200,7 @@
|
|||
"link_panels.on_standby_but_carrying_the_traffic":"On standby, but carrying the traffic: no active link between these cities is up.",
|
||||
"link_panels.on_standby_idle_while_the_other":"On standby: idle while the other links between these cities have room.",
|
||||
"link_panels.on_standby_taking_the_overflow":"On standby: taking the overflow, because the other links between these cities are full.",
|
||||
"link_panels.one_backhoe_is_not_enough":"One backhoe is not enough.",
|
||||
"link_panels.open_peer_but_not_on_any":"Open peer, but not on any IX where you have a POP. Nearest: {city}",
|
||||
"link_panels.open_peer_but_not_on_any_bfbb":"Open peer, but not on any IX where you have a POP",
|
||||
"link_panels.open_peer_join_the_route_server":"Open peer: join the route server at {ix}",
|
||||
|
|
@ -2183,6 +2217,7 @@
|
|||
"link_panels.port_port_price_on_request":"{port} port <small>Price on request ☎</small>",
|
||||
"link_panels.ports_at_p_of_the_usual":"Ports at {p}% of the usual price.",
|
||||
"link_panels.ports_up_to_port_are_free":"Ports up to {port} are free.",
|
||||
"link_panels.presets_on_this_link_list":"Presets on this link: {list}.",
|
||||
"link_panels.price_n_days":"{price} · {n} days",
|
||||
"link_panels.put_this_link_on_standby":"Put this link on standby",
|
||||
"link_panels.ready_for_a_pni_in_city":"Ready for a PNI in {city}",
|
||||
|
|
@ -2201,6 +2236,7 @@
|
|||
"link_panels.sell_one_price":"Sell one <small>{price}</small>",
|
||||
"link_panels.selling_spare_capacity":"Selling spare capacity",
|
||||
"link_panels.shares_a_trench_with_n_other":{"one":"Shares a trench with {n} other link. One cut takes them all down.","other":"Shares a trench with {n} other links. One cut takes them all down."},
|
||||
"link_panels.snapshot_only_one_selected_link":"Snapshot only: one selected link fails. Other links on the same cable, trench or fabric stay up. Existing outages and routing rules still apply. No time, money or game state is changed.",
|
||||
"link_panels.spare_optics_and_amplifier_cards_on":"Spare optics and amplifier cards on the shelf turn multi-day hardware failures into one-day swaps.",
|
||||
"link_panels.spare_price":"spare + {price}",
|
||||
"link_panels.spares_bought_now_are_already_paid":"Spares bought now are already paid for when the next shortage hits.",
|
||||
|
|
@ -2210,6 +2246,7 @@
|
|||
"link_panels.take_it_off_standby":"Take it off standby",
|
||||
"link_panels.there_s_no_ix_in_city":"There's no IX in {city} yet. Found one: networks join over time, pay you for ports, and peer with you for free.",
|
||||
"link_panels.they_need_the_full_internet_your":"They need the full internet. Your reach is {pct}.",
|
||||
"link_panels.this_backhoe_wins":"This backhoe wins.",
|
||||
"link_panels.this_fiber_is_dark_add_optics":"This fiber is dark. Add optics below to carry traffic.",
|
||||
"link_panels.this_is_the_only_link_between":"This is the only link between these cities. Add a parallel one, or a path through another city.",
|
||||
"link_panels.tier_1_only_a_pni_and":"Tier 1: only a PNI, and only once you are big enough for the Tier 1 club",
|
||||
|
|
@ -2219,13 +2256,15 @@
|
|||
"link_panels.upgrade_to_sys_price":"Upgrade to {sys} <small>{price}</small>",
|
||||
"link_panels.via_a_capacity_broker":"via a capacity broker",
|
||||
"link_panels.virtual_circuit_name_km_km":"Virtual circuit · {name} · {km} km",
|
||||
"link_panels.what_happens_if_this_link_fails":"What happens if this link fails right now?",
|
||||
"link_panels.what_s_on_this_link":"What's on this link",
|
||||
"link_panels.will_peer_at_ix_request_a":"Will peer at {ix}: request a session",
|
||||
"link_panels.with_current_demand_and_routing_this":"With current demand and routing, this link can fail without additional traffic loss.",
|
||||
"link_panels.you_can_pre_install_optics_now":"You can pre-install optics now so it lights up the day it's ready.",
|
||||
"link_panels.your_joint_venture_holds_an":"Your joint venture holds an operating license.",
|
||||
"link_panels.your_own_build":"your own build",
|
||||
"link_panels.your_own_fabric_name":"Your own fabric · {name}",
|
||||
"link_panels.your_routers_pick_the_lowest_cost":"Your routers pick the lowest-cost path. Raise the metric to push traffic onto other paths. “Backup only” keeps it idle unless nothing else works. Applies to every link between these two cities.",
|
||||
"link_panels.your_routers_pick_the_lowest_cost_0160":"Your routers pick the lowest-cost path. Raise the metric to push traffic onto other paths. “Backup only” keeps it idle unless nothing else works. Pick Custom to set your own multiplier or cost. Applies to every link between these two cities.",
|
||||
"link_panels.your_traffic_crossing_the_border":"Your traffic crossing the border",
|
||||
"link_panels.your_wave_was_sold_before_the":"Your wave was sold before the cable owner re-engineered it, so it keeps running.",
|
||||
"links.a_fab_fabric_unlocks_at_customer":"<b>A {fab} fabric unlocks at customer level {lv}.</b>",
|
||||
|
|
@ -2493,6 +2532,10 @@
|
|||
"notifications.n_min_ago":{"one":"{n} min ago","other":"{n} min ago"},
|
||||
"notifications.nothing_in_the_last_10_minutes":"Nothing in the last 10 minutes.",
|
||||
"notifications.show_all_n":"Show all {n}",
|
||||
"optic_counts.apply_price":"Apply · {price}",
|
||||
"optic_counts.count_for_model":"Number of {model} channels",
|
||||
"optic_counts.only_n_channels_free":"Only {n} channels are free on this fiber.",
|
||||
"optic_counts.target_count":"Target count",
|
||||
"own_cable.a_and_b":"{a} and {b}",
|
||||
"own_cable.a_fishing_fleet_is_trawling_exactly":"A fishing fleet is trawling exactly where you need to lay.",
|
||||
"own_cable.a_leased_wave_wave_on_this":"A leased {wave} wave on this route costs {price}/mo.",
|
||||
|
|
@ -2605,6 +2648,27 @@
|
|||
"peering_policy.tried_a_remote_peer_once_it":"Tried a remote peer once. It flapped during a product launch. Never again.",
|
||||
"pitcairn.uk_grant_mo":"UK grant {mo}/mo",
|
||||
"pitcairn.uk_grant_mo_once_islanders":"UK grant {mo}/mo once the islanders are online",
|
||||
"pni_all.additional_per_month":"Additional monthly cost",
|
||||
"pni_all.all_at_port":"Peer all networks · {port}",
|
||||
"pni_all.delivery_and_traffic_charges":"Delivery times vary by network. Traffic-based peering charges also apply where required.",
|
||||
"pni_all.n_at_their_minimum_size":{"one":"{n} order goes up to the smallest PNI that network accepts.","other":"{n} orders go up to the smallest PNI those networks accept."},
|
||||
"pni_all.n_blocked_connections":{"one":"{n} blocked connection","other":"{n} blocked connections"},
|
||||
"pni_all.n_blocked_pops":{"one":"{n} blocked POP","other":"{n} blocked POPs"},
|
||||
"pni_all.n_existing_or_pending_unchanged":{"one":"{n} existing PNI or pending order stays unchanged.","other":"{n} existing PNIs or pending orders stay unchanged."},
|
||||
"pni_all.n_networks":{"one":"{n} network","other":"{n} networks"},
|
||||
"pni_all.n_of_total_connections":"{n} / {total} connections",
|
||||
"pni_all.n_of_total_pops":"{n} / {total} shared POPs",
|
||||
"pni_all.n_orders_with_net":{"one":"{n} PNI order placed with {net}. Unchanged: {kept}; blocked: {blocked}.","other":"{n} PNI orders placed with {net}. Unchanged: {kept}; blocked: {blocked}."},
|
||||
"pni_all.new_and_upgrades":"New: {fresh} · Upgrades: {up}",
|
||||
"pni_all.no_shared_locations":"No shared POPs are available.",
|
||||
"pni_all.no_shared_pops":"You have no POPs in common with this network.",
|
||||
"pni_all.order_missing_and_upgrade_smaller":"Orders missing PNIs and upgrades smaller ones at your shared POPs. Larger PNIs and pending orders stay unchanged. Unavailable POPs are skipped.",
|
||||
"pni_all.peer_all_networks":"Peer all networks on all POPs",
|
||||
"pni_all.peer_at_port":"Peer on all POPs · {port}",
|
||||
"pni_all.peer_on_all_pops":"Peer on all POPs",
|
||||
"pni_all.pni_size":"PNI size",
|
||||
"pni_all.setup_total":"Total setup cost",
|
||||
"pni_all.traffic_charges_apply":"Traffic charges of {price} per Gbps also apply.",
|
||||
"pnis.a_new_region_is_coming_online":"A new region is coming online soon. It has been coming online soon since 2019.",
|
||||
"pnis.about_n_days_to_go_nothing":"About {n} days to go. Nothing to do but wait, or chase it.",
|
||||
"pnis.augment_with_net_delivered_in_city":"<b>Augment with {net} delivered in {city}.</b><br>Now {port}.",
|
||||
|
|
@ -3230,4 +3294,29 @@
|
|||
"tutorial.your_customers_want_the_whole":"Your customers want the whole internet. Open the Transit tab and buy a port from a carrier.",
|
||||
"tutorial.your_router_is_live_press_launch":"Your router is live. Press “Launch broadband” to sell internet to the people of your city.",
|
||||
"ui.n_d_left":"{n}d left",
|
||||
"utilities.apply_kit":"Apply redundancy kit",
|
||||
"utilities.cache_moves":"Cache boxes to move: {n} (balanced per provider)",
|
||||
"utilities.cache_note":"Request one cache per eligible provider at each existing site. Existing boxes are kept; providers still require sufficient traffic.",
|
||||
"utilities.cache_ports":"Requires {need} free router ports; {free} available. Nothing is requested until the whole batch fits.",
|
||||
"utilities.cache_quote":"{n} new cache boxes · Free hardware · Additional monthly cost: {mo}",
|
||||
"utilities.caches_requested":"Installed {n} cache boxes in {city}.",
|
||||
"utilities.ix_peering":"Network-wide IX peering",
|
||||
"utilities.join_route_servers":"Join all route servers ({n})",
|
||||
"utilities.kit_applied":"Redundancy updated in {city}.",
|
||||
"utilities.kit_balanced":"Hardware installed and caches balanced.",
|
||||
"utilities.kit_cost":"One-off: {cost} · Additional monthly cost: {mo}",
|
||||
"utilities.peer_counts":"{ready} eligible · {existing} existing · {blocked} unavailable",
|
||||
"utilities.peering_note":"Request eligible peers at every IX you have joined. Existing sessions, including route-server peers, are skipped. Refusals and traffic thresholds still apply. No ports or paid PNIs are purchased.",
|
||||
"utilities.peers_requested":"Established {n} new IX peering sessions.",
|
||||
"utilities.quote_changed":"The quote changed. Review the new price and try again.",
|
||||
"utilities.redundancy_kit":"PoP redundancy kit",
|
||||
"utilities.redundancy_note":"Existing caches are balanced per provider. Split IX, PNI and transit connections across sites separately, and check diverse links and spare router capacity.",
|
||||
"utilities.request_all":"Request all eligible peers ({n})",
|
||||
"utilities.request_caches":"Request missing caches ({n})",
|
||||
"utilities.route_server_note":"Route-server peers require an Open peering policy. Existing sessions stay enabled; no ports are bought.",
|
||||
"utilities.route_servers_joined":"Joined {n} route servers.",
|
||||
"utilities.second_site":"Second site",
|
||||
"utilities.title":"Utilities",
|
||||
"utilities.two_routers":"At least two routers",
|
||||
"utilities.view_pop":"View PoP",
|
||||
};
|
||||
|
|
|
|||
4
src/styles/35-optic-counts.css
Normal file
4
src/styles/35-optic-counts.css
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
.optic-count{display:flex;flex-wrap:wrap;align-items:end;gap:8px;margin-top:8px}
|
||||
.optic-count label{display:flex;flex-direction:column;gap:3px;font-size:12px;font-weight:800}
|
||||
.optic-count input.t{width:88px;font-size:16px;min-height:44px}
|
||||
.optic-count .b{min-height:44px}
|
||||
|
|
@ -108,6 +108,7 @@ label.f{display:block;font-weight:900;font-size:12px;letter-spacing:.06em;text-t
|
|||
input.t{width:100%;box-sizing:border-box;border:3px solid var(--ink);border-radius:12px;padding:8px 12px;font-family:var(--display);font-weight:800;font-size:18px;background:var(--soft)}
|
||||
.network-name{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
|
||||
.network-name input.t{flex:1 1 240px;width:auto;min-width:0}
|
||||
.metric-in{display:flex;gap:6px;align-items:center;margin-top:6px}.metric-in input.t{flex:1 1 120px;width:auto;min-width:0;font-size:16px;padding:4px 10px}
|
||||
.plug{display:flex;gap:12px;align-items:center;border:3px solid var(--ink);border-radius:14px;padding:10px 12px;margin:10px 0 4px;background:var(--soft);box-shadow:0 3px 0 var(--ink);color:var(--ink);text-decoration:none}
|
||||
.plug:hover{background:#FFF6D6}.plug .pi{font-size:30px;line-height:1}.plug b{font-family:var(--display);font-size:16px}.plug .meta{display:block;margin-top:2px}.plug .go{margin-left:auto;font-weight:900;white-space:nowrap}
|
||||
.starts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.starts .start:last-child:nth-child(odd){grid-column:1/-1}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ button,.chip,.b,a{touch-action:manipulation;-webkit-tap-highlight-color:transpar
|
|||
#coach{top:auto !important;bottom:calc(var(--tabbar) + 8px);width:calc(100% - 16px);padding:7px 10px;font-size:13px}
|
||||
body.sheet-open #coach{bottom:calc(var(--tabbar) + 8px + min(62vh,520px))}
|
||||
#modal{align-items:end;padding:0}
|
||||
#modal.link-check{bottom:var(--tabbar)}
|
||||
#modal .cta{position:sticky;bottom:calc(-16px - env(safe-area-inset-bottom,0px));z-index:1;background:var(--paper);margin:12px -16px 0 !important;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));border-top:2px solid var(--line)}
|
||||
.title-art h1{font-size:34px}.title-art svg{width:54px;height:54px}
|
||||
.tagline{font-size:13.5px;margin:8px 0 10px}
|
||||
|
|
|
|||
363
tests/automation.test.js
Normal file
363
tests/automation.test.js
Normal file
|
|
@ -0,0 +1,363 @@
|
|||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
function setup(ev) {
|
||||
ev("ACT.start({});S.cash=1e8;S.offers=[];S.biz=[];S.nextFail=S.nextEvent=1e6;for(const g of GOALS)S.done[g.id]=0;S.pops.fra.rgen=3;ACT.buyTransit({city:'fra',net:'lvl',tier:1});compute()");
|
||||
}
|
||||
function offer(ev, id, extra = {}) {
|
||||
ev(`S.offers.push(${JSON.stringify({ id, city: 'fra', name: id, type: 'dia', bw: 1, rate: 600, reqs: [], exp: 30, ...extra })})`);
|
||||
}
|
||||
|
||||
test('auto-accept waits five real seconds at every game speed and the toggle stops it', () => {
|
||||
for (const speed of [0.5, 1, 2, 4, 8]) {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'first');
|
||||
ev("ACT.autoToggle({k:'autoSales'});UI.autoSalesAt=1000");
|
||||
const start = ev('UI.autoSalesAt');
|
||||
ev(`UI.speed=${speed};automationTick(${start + 4999})`);
|
||||
assert.equal(ev('S.biz.length'), 0, speed);
|
||||
ev(`automationTick(${start + 5000})`);
|
||||
assert.equal(ev('S.biz[0].id'), 'first', speed);
|
||||
offer(ev, 'second');
|
||||
ev(`automationTick(${start + 9999})`);
|
||||
assert.equal(ev('S.biz.length'), 1, speed);
|
||||
ev(`automationTick(${start + 10000})`);
|
||||
assert.equal(ev('S.biz.length'), 2, speed);
|
||||
ev("ACT.autoToggle({k:'autoSales'})");
|
||||
offer(ev, 'off');
|
||||
ev(`automationTick(${start + 20000});ACT.accept({id:'off',auto:true})`);
|
||||
assert.equal(ev('S.biz.length'), 2, speed);
|
||||
assert.equal(ev('S.offers[0].id'), 'off', speed);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Accept buttons share a real-time countdown in Deals, city offers and fiber broker offers', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'ready');
|
||||
offer(ev, 'waiting', { reqs: ['gen'] });
|
||||
ev("window.testNow=1000;performance.now=()=>testNow;ACT.leftTab({t:'deals'});UI.sel={type:'city',id:'fra'};UI.tab='cust';UI.leftOpen=true;renderAll()");
|
||||
assert.equal(dom.window.document.querySelectorAll('[data-auto-sales]').length, 0);
|
||||
ev("ACT.autoToggle({k:'autoSales'});renderAutoCountdown()");
|
||||
const counts = () => [...dom.window.document.querySelectorAll('[data-auto-sales]')];
|
||||
const readyCounts = () => counts().filter(el => el.dataset.autoSales === 'ready');
|
||||
assert.ok(readyCounts().length >= 2, 'Deals and the city panel both show it');
|
||||
assert.ok(readyCounts().every(el => el.textContent === '(5)'));
|
||||
assert.ok(counts().filter(el => el.dataset.autoSales === 'waiting').every(el => el.textContent === ''), 'unmet requirements have no countdown');
|
||||
ev('testNow=2001;renderAutoCountdown()');
|
||||
assert.ok(readyCounts().every(el => el.textContent === '(4)'));
|
||||
ev('testNow=3000;UI.speed=8;renderAutoCountdown()');
|
||||
assert.ok(readyCounts().every(el => el.textContent === '(3)'));
|
||||
ev('UI.speed=0.5;renderAll();renderAutoCountdown()');
|
||||
assert.ok(readyCounts().every(el => el.textContent === '(3)'), 'game speed and re-rendering leave the real-time clock alone');
|
||||
assert.match(dom.window.document.querySelector('#leftBody [data-act="accept"]').textContent, /Accept \(3\)/);
|
||||
ev("ACT.buildPop({city:'ams'});S.links.push({id:'fiber',a:'fra',b:'ams',kind:'df',sys:'lite',ch:[],own:true,km:450,ready:0,cut:0,mo:1})");
|
||||
offer(ev, 'broker', { type: 'wwave', city2: 'ams', link: 'fiber', slots: 1, what: 'One wave' });
|
||||
ev("compute();UI.sel={type:'link',id:'fiber'};renderPanel()");
|
||||
const broker = dom.window.document.querySelector('#panelBody [data-act="accept"] [data-auto-sales]');
|
||||
assert.ok(broker);
|
||||
assert.equal(broker.textContent, '(3)');
|
||||
ev('testNow=6000;automationTick(testNow);renderAutoCountdown()');
|
||||
assert.equal(ev("S.biz.some(b=>b.id==='ready')"), true);
|
||||
assert.equal(ev("S.offers.some(o=>o.id==='waiting')"), true, 'the countdown does not bypass requirements');
|
||||
offer(ev, 'next-ready');
|
||||
ev('renderAll();renderAutoCountdown()');
|
||||
assert.ok(counts().filter(el => el.dataset.autoSales === 'next-ready').every(el => el.textContent === '(5)'), 'the next check starts a fresh countdown');
|
||||
ev("ACT.autoToggle({k:'autoSales'});renderAutoCountdown()");
|
||||
assert.equal(counts().length, 0);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('only ready offers get a countdown, including after requirements or capacity change', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'ready');
|
||||
offer(ev, 'needs-generator', { reqs: ['gen'] });
|
||||
offer(ev, 'too-big', { bw: 1000 });
|
||||
offer(ev, 'expired', { exp: 0 });
|
||||
ev("window.testNow=1000;performance.now=()=>testNow;ACT.leftTab({t:'deals'});ACT.autoToggle({k:'autoSales'});renderAutoCountdown()");
|
||||
const count = id => dom.window.document.querySelector(`#leftBody [data-auto-sales="${id}"]`).textContent;
|
||||
assert.equal(count('ready'), '(5)');
|
||||
assert.equal(count('needs-generator'), '');
|
||||
assert.equal(count('too-big'), '');
|
||||
assert.equal(count('expired'), '');
|
||||
ev('S.pops.fra.gen=true;after()');
|
||||
assert.equal(count('needs-generator'), '(5)', 'becoming eligible shows the timer');
|
||||
ev('S.pops.fra.gen=false;compute();renderAutoCountdown()');
|
||||
assert.equal(count('needs-generator'), '', 'a requirement becoming false hides it immediately');
|
||||
ev("S.offers.find(o=>o.id==='too-big').bw=2;after()");
|
||||
assert.equal(count('too-big'), '(5)', 'actions invalidate the capacity preview');
|
||||
ev('testNow=6000;automationTick(testNow);renderAutoCountdown()');
|
||||
assert.equal(ev("S.offers.some(o=>o.id==='needs-generator')"), true, 'acceptance checks requirements again');
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('readiness trials are shared between views and are not repeated for every redraw', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'ready');
|
||||
ev("window.testNow=1000;performance.now=()=>testNow;ACT.leftTab({t:'deals'});UI.sel={type:'city',id:'fra'};UI.tab='cust';window.originalAutoOffer=autoOffer;window.trials=0;window.autoOffer=o=>{trials++;return originalAutoOffer(o)};ACT.autoToggle({k:'autoSales'})");
|
||||
assert.equal(ev('trials'), 1);
|
||||
ev('renderAll();compute();renderAll();renderAutoCountdown()');
|
||||
assert.equal(ev('trials'), 1, 'ordinary routing refreshes reuse the preview');
|
||||
ev('after()');
|
||||
assert.equal(ev('trials'), 2, 'a real action refreshes readiness');
|
||||
ev('window.autoOffer=originalAutoOffer');
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('auto-accept leaves unready and expired offers alone without failure notifications', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'generator', { reqs: ['gen'] });
|
||||
offer(ev, 'missing-pop', { city: 'ams' });
|
||||
offer(ev, 'scrub', { type: 'scrub' });
|
||||
offer(ev, 'expired', { exp: 0 });
|
||||
offer(ev, 'ipv6', { reqs: ['ipv6'] });
|
||||
const log = ev('S.log.length');
|
||||
ev('S.autoSales=true;UI.autoGame=S;UI.autoSalesAt=0;automationTick(5000)');
|
||||
assert.equal(ev('S.biz.length'), 0);
|
||||
assert.equal(ev('S.offers.length'), 5);
|
||||
assert.equal(ev('S.log.length'), log, 'no repeated failed manual-action toasts');
|
||||
ev('S.pops.fra.gen=true;compute();automationTick(10000)');
|
||||
assert.equal(ev('S.biz.length'), 1);
|
||||
assert.equal(ev('S.biz[0].id'), 'generator');
|
||||
// Manual acceptance keeps its existing sign-now, provision-later behavior.
|
||||
ev("ACT.accept({id:'scrub'})");
|
||||
assert.equal(ev("S.biz.some(b=>b.id==='scrub')"), true);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('the trial includes new bandwidth and later offers cannot overbook earlier accepted sales', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'one', { bw: 60 });
|
||||
offer(ev, 'two', { bw: 60 });
|
||||
const state = ev('JSON.stringify(S)');
|
||||
ev('window.beforeState=S;window.beforeResult=R;window.beforeHot=UI.hotMap');
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), true);
|
||||
assert.equal(ev('JSON.stringify(S)'), state);
|
||||
assert.equal(ev('S===beforeState&&R===beforeResult&&UI.hotMap===beforeHot'), true);
|
||||
ev('S.autoSales=true;UI.autoGame=S;UI.autoSalesAt=0;automationTick(5000)');
|
||||
assert.equal(ev('S.biz.length'), 1);
|
||||
assert.equal(ev('S.offers[0].id'), 'two');
|
||||
assert.ok(ev('bizSf(S.biz[0])') >= 0.95);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('auto-accept checks actual circuits, latency and NNI capacity', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
ev("ACT.buildPop({city:'ams'});S.pops.ams.rgen=3;compute()");
|
||||
offer(ev, 'circuit', { type: 'hft', city2: 'ams', bw: 10, latMax: 50, reqs: ['lat'] });
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), false, 'POPs alone are not a circuit');
|
||||
ev("S.links.push({id:'path',a:'fra',b:'ams',kind:'wave',tier:1,km:450,sub:false,cut:0,mo:1});compute()");
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), true);
|
||||
ev('S.offers[0].latMax=0.1');
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), false, 'latency budget must pass');
|
||||
ev("S.offers=[];window.fabric=FABS.find(f=>f.cities.includes('fra')).id;ACT.buyNni({city:'fra',prov:fabric,tier:0})");
|
||||
const prov = ev('fabric');
|
||||
const bandwidth = ev('NNI[0].g * 0.75');
|
||||
offer(ev, 'fabric-one', { type: 'fabip', prov, bw: bandwidth, reqs: ['nni'] });
|
||||
offer(ev, 'fabric-two', { type: 'fabip', prov, bw: bandwidth, reqs: ['nni'] });
|
||||
// Transit has enough headroom, so the second rejection is the shared NNI port.
|
||||
ev("S.transit[0].tier=4;compute();S.autoSales=true;UI.autoGame=S;UI.autoSalesAt=0;automationTick(5000)");
|
||||
assert.equal(ev('S.biz.length'), 1);
|
||||
assert.equal(ev('S.offers[0].id'), 'fabric-two');
|
||||
assert.ok(ev("nniUsed('fra',fabric)<=NNI[0].g"));
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('new circuits do not take service away from healthy signed customers', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
ev("ACT.buildPop({city:'ams'});S.pops.ams.rgen=3;S.links.push({id:'path',a:'fra',b:'ams',kind:'wave',tier:1,km:450,sub:false,cut:0,mo:1});S.transit[0].city='ams';compute()");
|
||||
offer(ev, 'existing', { bw: 80 });
|
||||
ev("ACT.accept({id:'existing'})");
|
||||
offer(ev, 'new-circuit', { type: 'l2vpn', city2: 'ams', bw: 50 });
|
||||
assert.equal(ev('bizWhy(S.biz[0]).length'), 0);
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), false);
|
||||
assert.ok(ev('bizSf(S.biz[0])') >= 0.95, 'failed preview leaves the old routing result intact');
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('fiber sales check live equipment and free spectrum, and repeated carrier orders still merge', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
ev("ACT.buildPop({city:'ams'});S.pops.ams.rgen=3;S.links=[{id:'fiber',a:'fra',b:'ams',kind:'df',own:true,sys:'lite',ch:Array(14).fill('zr4'),km:450,sub:false,ready:0,cut:0,mo:1}];S.biz=[{id:'old',name:'Same Carrier',type:'wwave',city:'fra',city2:'ams',link:'fiber',bw:1,rate:1000,slots:1,reqs:[],mood:100,since:0}];compute()");
|
||||
offer(ev, 'full', { type: 'wwave', city2: 'ams', link: 'fiber', slots: 2 });
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), false);
|
||||
ev("S.offers[0].slots=1;S.offers[0].name='Same Carrier';S.links[0].eqDown=10;compute()");
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), false, 'a broken amplifier prevents a wave sale');
|
||||
ev('S.links[0].eqDown=0;compute();S.autoSales=true;UI.autoGame=S;UI.autoSalesAt=0;automationTick(5000)');
|
||||
assert.equal(ev('S.biz.length'), 1);
|
||||
assert.equal(ev('S.biz[0].slots'), 2);
|
||||
assert.equal(ev('S.biz[0].rate'), 1600);
|
||||
assert.equal(ev('freeCh(S.links[0])'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('capacity pair sales need completed infrastructure and reserve it for the accepted contract', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'pairs', { type: 'capfib', city2: 'ams', slots: 2, win: 90 });
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), false);
|
||||
ev("ACT.buildPop({city:'ams'});S.links=[{id:'own',a:'fra',b:'ams',kind:'df',own:true,sys:'roadm',ch:[],km:450,sub:false,ready:0,cut:0,mo:1}];compute()");
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), true);
|
||||
ev('S.autoSales=true;UI.autoGame=S;UI.autoSalesAt=0;automationTick(5000)');
|
||||
assert.equal(ev('S.biz[0].link'), 'own');
|
||||
assert.equal(ev('capPend(S.biz[0])'), true, 'normal delivery handover still happens on a game day');
|
||||
offer(ev, 'second-pairs', { type: 'capfib', city2: 'ams', slots: 2, win: 90 });
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), false, 'the same trench cannot be promised twice');
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('future event demand is tested before signing, with booked events reserving headroom', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'event', { type: 'event', bw: 80, rate: 0, start: 10, dur: 3, fee: 5000, exp: 9 });
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), true);
|
||||
ev('S.autoSales=true;UI.autoGame=S;UI.autoSalesAt=0;automationTick(5000)');
|
||||
assert.equal(ev('S.biz[0].start'), 10, 'the trial does not move the actual event date');
|
||||
assert.equal(ev('R.cityDem.fra'), 0);
|
||||
offer(ev, 'too-large', { bw: 30 });
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), false);
|
||||
ev('S.offers[0].bw=10');
|
||||
assert.equal(ev('!!autoOffer(S.offers[0])'), true);
|
||||
assert.equal(ev('S.biz[0].start'), 10);
|
||||
assert.equal(ev('R.cityDem.fra'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('failed capacity trials restore game, routing and map state even when compute throws', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'ready');
|
||||
ev("window.beforeState=S;window.beforeResult=R;window.beforeHot=UI.hotMap;window.originalCompute=compute;window.compute=()=>{throw new Error('trial failed')}");
|
||||
assert.throws(() => ev('autoOffer(S.offers[0])'), /trial failed/);
|
||||
assert.equal(ev('S===beforeState&&R===beforeResult&&UI.hotMap===beforeHot'), true);
|
||||
ev('window.compute=originalCompute');
|
||||
assert.equal(ev('S.biz.length'), 0);
|
||||
assert.equal(ev('S.offers.length'), 1);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('auto-pay rushes affordable repairs once, skips unaffordable and expired incidents, and obeys its toggle', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
ev(`S.cash=10000;S.links=[{id:'fiber',a:'fra',b:'ams',kind:'df',sys:'lite',ch:['zr4'],km:450,sub:false,ready:0,cut:0,eqDown:10,chFail:{i:0,until:10},mo:1}];
|
||||
S.pops.fra.down=8;S.inc=[
|
||||
{id:'amp',type:'amp',ref:'fiber',until:10,cost:30000,msg:'Broken amp'},
|
||||
{id:'optic',type:'optic',ref:'fiber',until:10,cost:5000,msg:'Broken optic'},
|
||||
{id:'slow',type:'crash',ref:'fra',until:8,cost:2000,slow:true,msg:'Slow boot'},
|
||||
{id:'orphan',type:'amp',ref:'gone',until:10,cost:299,msg:'Removed equipment'},
|
||||
{id:'expired',type:'amp',ref:'fiber',until:0,cost:1000,msg:'Expired'},
|
||||
{id:'ddos',type:'ddos',ref:'fra',until:10,cost:1000,msg:'Attack'}];
|
||||
S.autoRepair=true;UI.autoGame=S;UI.autoSalesAt=0;automationTick(1)`);
|
||||
assert.equal(ev('S.cash'), 3000);
|
||||
assert.equal(ev("S.inc.some(i=>i.id==='optic')"), false);
|
||||
assert.equal(ev('S.links[0].chFail'), null);
|
||||
assert.equal(ev("S.inc.find(i=>i.id==='slow').rushed"), true);
|
||||
assert.equal(ev("S.inc.find(i=>i.id==='slow').until"), 1);
|
||||
assert.equal(ev("S.inc.find(i=>i.id==='slow').cost"), 0);
|
||||
assert.equal(ev('S.pops.fra.down'), 1);
|
||||
ev('automationTick(2)');
|
||||
assert.equal(ev('S.cash'), 3000, 'no duplicate rush payment');
|
||||
ev('S.cash=40000;automationTick(3)');
|
||||
assert.equal(ev('S.cash'), 10000);
|
||||
assert.equal(ev('S.links[0].eqDown'), 0);
|
||||
assert.equal(ev("S.inc.some(i=>i.id==='amp')"), false);
|
||||
ev("ACT.autoToggle({k:'autoRepair'});S.inc.push({id:'new',type:'amp',ref:'fiber',until:10,cost:1000,msg:'New failure'});automationTick(4)");
|
||||
assert.equal(ev('S.cash'), 10000);
|
||||
assert.equal(ev("S.inc.some(i=>i.id==='new')"), true);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('automation pauses with the game, dialogs, hidden pages and game over', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
offer(ev, 'paused');
|
||||
ev('S.autoSales=true;UI.autoGame=S;UI.autoSalesAt=0;UI.speed=0;automationTick(5000)');
|
||||
assert.equal(ev('S.biz.length'), 0);
|
||||
ev('UI.speed=1;automationTick(9999)');
|
||||
assert.equal(ev('S.biz.length'), 0, 'resume starts a fresh five-second wait');
|
||||
ev("openModal('<p>Menu</p>');automationTick(10000);closeModal()");
|
||||
ev("Object.defineProperty(document,'visibilityState',{configurable:true,value:'hidden'});automationTick(15000)");
|
||||
ev("Object.defineProperty(document,'visibilityState',{configurable:true,value:'visible'});S.lost=true;automationTick(20000);S.lost=false;automationTick(24999)");
|
||||
assert.equal(ev('S.biz.length'), 0);
|
||||
ev('automationTick(25000)');
|
||||
assert.equal(ev('S.biz.length'), 1);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('the frame loop repairs new incidents without waiting for the sales timer', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
ev(`S.autoRepair=true;S.links=[{id:'fiber',a:'fra',b:'ams',kind:'df',sys:'lite',ch:['zr4'],km:450,sub:false,ready:0,cut:0,mo:1}];
|
||||
window.originalDay=dayTick;window.dayTick=()=>{S.links[0].eqDown=10;S.inc.push({id:'new',type:'amp',ref:'fiber',until:10,cost:1000,msg:'Broken amp'})};
|
||||
window.cashBefore=S.cash;last=0;acc=DAY_MS;frame(16);window.dayTick=originalDay`);
|
||||
assert.equal(ev('S.cash'), ev('cashBefore-1000'));
|
||||
assert.equal(ev('S.inc.length'), 0);
|
||||
assert.equal(ev('S.links[0].eqDown'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('toggles persist, old and malformed saves default off, and the timer resets for another game', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
setup(ev);
|
||||
assert.equal(ev('S.autoSales||S.autoRepair'), false);
|
||||
ev("ACT.autoToggle({k:'autoSales'});ACT.autoToggle({k:'autoRepair'});save();S=migrate(JSON.parse(localStorage.getItem('sot-save-v1')))");
|
||||
assert.equal(ev('S.autoSales&&S.autoRepair'), true);
|
||||
ev("delete S.autoSales;delete S.autoRepair;S=migrate(S)");
|
||||
assert.equal(ev('S.autoSales||S.autoRepair'), false);
|
||||
ev("S.autoSales='true';S.autoRepair=1;S=migrate(S);ACT.autoToggle({k:'cash'})");
|
||||
assert.equal(ev('S.autoSales||S.autoRepair'), false);
|
||||
ev('UI.autoGame=S;UI.autoSalesAt=0;S=migrate(JSON.parse(JSON.stringify(S)));S.autoSales=true;compute()');
|
||||
offer(ev, 'imported');
|
||||
ev('automationTick(100000)');
|
||||
assert.equal(ev('S.biz.length'), 0, 'an imported game does not inherit another game timer');
|
||||
ev('automationTick(105000)');
|
||||
assert.equal(ev('S.biz.length'), 1);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('both toggle buttons work by keyboard-compatible DOM events on phones in every language', () => {
|
||||
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
|
||||
const { ev, dom, errors } = load(lang === 'en' ? {} : { lang });
|
||||
setup(ev);
|
||||
dom.window.innerWidth = 360;
|
||||
for (const [tab, key] of [['deals', 'autoSales'], ['noc', 'autoRepair']]) {
|
||||
ev(`ACT.leftTab({t:'${tab}'});renderAll()`);
|
||||
const button = [...dom.window.document.querySelectorAll('#leftBody [data-act="autoToggle"]')].find(b => JSON.parse(b.dataset.args).k === key);
|
||||
assert.ok(button, lang);
|
||||
assert.equal(button.getAttribute('aria-pressed'), 'false', lang);
|
||||
button.focus();
|
||||
button.click();
|
||||
const updated = dom.window.document.querySelector('#leftBody [data-act="autoToggle"]');
|
||||
assert.equal(updated.getAttribute('aria-pressed'), 'true', lang);
|
||||
assert.equal(ev(`S.${key}`), true, lang);
|
||||
assert.doesNotMatch(dom.window.document.getElementById('leftBody').textContent, /automation\./, lang);
|
||||
}
|
||||
assert.deepEqual(errors, [], lang);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
|
@ -2,6 +2,16 @@ const test = require('node:test');
|
|||
const assert = require('node:assert/strict');
|
||||
const { load, seed } = require('./harness');
|
||||
|
||||
test('daily DDoS spawns share one routing calculation and score their first active day', () => {
|
||||
const { ev, errors } = load();
|
||||
// The busier DDoS schedule needs spicy chaos (BGP at 3 a.m.) or gaming customers.
|
||||
ev("ACT.start({});S.rules=makeRules('bgp');S.cash=1e9;S.day=50;S.nextFail=1e9;S.nextEvent=1e9;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=200;ACT.buyTransit({city:'fra',net:'cog',tier:1});compute();window.__compute=compute;window.__random=Math.random;window.__computes=0;compute=()=>{window.__computes++;window.__compute()};Math.random=()=>0;dayTick();compute=window.__compute;Math.random=window.__random");
|
||||
assert.equal(ev('ddosAll().length'), 2, 'both daily spawn opportunities were used');
|
||||
assert.equal(ev('window.__computes'), 1, 'daily spawns do not reroute the whole network individually');
|
||||
assert.ok(ev('ddosAll().every(a=>a.worst===ddosSf(a))'), 'first-day service is recorded after routing');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('page boots to the title screen without errors', () => {
|
||||
const { ev, errors } = load();
|
||||
assert.equal(ev("document.getElementById('modal').hidden"), false);
|
||||
|
|
@ -197,6 +207,52 @@ test('Flowspec is a router-model capability, and each tool answers a flood', ()
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a distributed SYN flood reports actual Flowspec drops and sends only the remainder to scrubbing', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.scrubs=[{city:'fra',tier:0}];S.scrubMode='always';S.ev.ddos={id:'syn',city:'fra',vec:'syn',gbps:30.2,start:0,until:7,entries:[{k:'edge',city:'fra',share:1}]};compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).flowspec'), 0);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).sp.parts[0].cleaned'), 30.2);
|
||||
assert.match(ev('ddosPanel()'), /— No Flowspec filtering: ingress routers have no TCAM/);
|
||||
assert.match(ev('ddosPanel()'), /✓ Scrubbing in Frankfurt: 30\.2 Gbps \/ 100G/);
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /✓ Flowspec|After upstream scrubbing|Reaching your network/);
|
||||
for (const [router, dropped, scrubbed] of [[1,18.12,12.08], [3,25.67,4.53]]) {
|
||||
ev(`S.pops.fra.rgen=${router};compute()`);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-dropped)<1e-9);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).sp.parts[0].cleaned')-scrubbed)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), new RegExp('✓ Flowspec dropping: '+dropped.toFixed(1).replace('.', '\\.')+' Gbps'));
|
||||
assert.match(ev('ddosPanel()'), new RegExp('Scrubbing in Frankfurt: '+scrubbed.toFixed(1).replace('.', '\\.')+' Gbps / 100G'));
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /no TCAM|Edge filters dropping/);
|
||||
}
|
||||
ev("S.ev.ddos.vec='ack';compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).flowspec'), 0);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).sp.parts[0].cleaned'), 30.2);
|
||||
assert.match(ev('ddosPanel()'), /— Flowspec cannot catch ACK flood/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('Flowspec accounts for each ingress router, upstream cleaning and other edge filters separately', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});S.pops.nyc.rgen=3;S.transit=[{id:'tf',city:'fra',net:'cog',tier:1},{id:'tn',city:'nyc',net:'cog',tier:1}];S.scrubs=[{city:'fra',tier:0},{city:'nyc',tier:0}];S.ev.ddos={id:'syn',city:'fra',vec:'syn',gbps:30.2,start:0,until:7,entries:[{k:'t',id:'tf',city:'fra',share:0.5},{k:'t',id:'tn',city:'nyc',share:0.5}]};compute()");
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-12.835)<1e-9);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).sp.parts.reduce((n,x)=>n+x.cleaned,0)')-17.365)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), /~ Flowspec dropping: 12\.8 Gbps; some ingress routers have no TCAM/);
|
||||
assert.match(ev('ddosPanel()'), /Scrubbing in Frankfurt: 15\.1 Gbps \/ 100G/);
|
||||
assert.match(ev('ddosPanel()'), /Scrubbing in New York: 2\.3 Gbps \/ 100G/);
|
||||
assert.equal(ev('ddosMitigation(S.ev.ddos).flowspec'), ev('ddosReport(S.ev.ddos).flowspec'), 'uncached reports also filter at the ingress instead of the target');
|
||||
ev('S.transit[1].clean=true;compute()');
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).reaching')-16.61)<1e-9);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-1.2835)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), /✓ After upstream scrubbing: 16\.6 Gbps/);
|
||||
assert.match(ev('ddosPanel()'), /~ Flowspec dropping: 1\.3 Gbps/);
|
||||
ev("S.pops.fra.rgen=3;S.ixp={fra:1,nyc:1};S.ev.ddos.ixbh=true;compute()");
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-14.1185)<1e-9);
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).filtered-ddosReport(S.ev.ddos).flowspec')-1.24575)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), /✓ Flowspec dropping: 14\.1 Gbps/);
|
||||
assert.match(ev('ddosPanel()'), /✓ Edge filters dropping: 1\.2 Gbps/);
|
||||
assert.ok(ev('Math.abs(ddosReport(S.ev.ddos).reaching-ddosReport(S.ev.ddos).filtered-ddosReport(S.ev.ddos).sp.parts.reduce((n,x)=>n+x.cleaned,0)-ddosReport(S.ev.ddos).leak)<1e-9'));
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('RTBH blackholes the victim, and HackBack 3000 is a gamble', () => {
|
||||
const { ev } = load();
|
||||
ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=120;ACT.buyTransit({city:'fra',net:'cog',tier:1});compute()");
|
||||
|
|
@ -478,3 +534,615 @@ test('the broadband panel shows what homes in that city really pay, not the base
|
|||
assert.ok(ev("cityPanel('del')").includes(rev + '/mo'), `revenue line matches what the month pays (${rev})`);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
// Custom routing metrics: a fra–ams–par triangle where the direct fra–par link is normally shortest.
|
||||
const triangle = (ev) => {
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})");
|
||||
ev("for(const c of ['ams','par'])ACT.buildPop({city:c});const L=(a,b)=>{UI.via=null;openLinkModal(a,b);ACT.buildLink({tier:1});closeModal();};L('fra','ams');L('ams','par');L('fra','par');compute()");
|
||||
ev("window.FP=S.links.find(l=>(l.a==='fra'&&l.b==='par')||(l.a==='par'&&l.b==='fra')).id;window.FK=edgeKey(S.links.find(l=>l.id===FP));window.pmOf=()=>S.pairMet[FK];window.hops=()=>JSON.stringify(trPaths('fra').path('par').map(h=>h.l.id))");
|
||||
};
|
||||
|
||||
test('a custom multiplier routes exactly like the matching preset', () => {
|
||||
const { ev, errors } = load();
|
||||
triangle(ev);
|
||||
assert.equal(ev("hops()"), JSON.stringify([ev("FP")]), 'direct link wins by default');
|
||||
ev("ACT.setMetric({id:FP,v:'avoid'})");
|
||||
const avoid = ev("JSON.stringify({h:hops(),load:R.load,served:R.served})");
|
||||
ev("ACT.setMetric({id:FP,v:'custom'})");
|
||||
assert.equal(ev("pairMet(FK)"), 'custom');
|
||||
const m = ev("pmOf()");
|
||||
assert.equal(m.k, 'f');
|
||||
assert.equal(m.v, 4, 'custom starts from the preset it replaces');
|
||||
assert.equal(ev("JSON.stringify({h:hops(),load:R.load,served:R.served})"), avoid);
|
||||
ev("ACT.setMetric({id:FP,v:'normal'})");
|
||||
assert.equal(ev("FK in S.pairMet"), false, 'presets drop the custom metric');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('an absolute custom cost steers the path, and switching modes keeps the cost', () => {
|
||||
const { ev, errors } = load();
|
||||
triangle(ev);
|
||||
ev("ACT.setMetric({id:FP,v:'custom'});ACT.metricMode({id:FP,k:'w'})");
|
||||
const l = ev("S.links.find(l=>l.id===FP)");
|
||||
assert.equal(ev("pmOf().k"), 'w');
|
||||
assert.equal(ev("pmOf().v"), Math.round(l.km + 60), 'switching to cost keeps the effective metric');
|
||||
ev("ACT.selLink({id:FP});renderAll();$('metIn').value='65535';ACT.metricSet({id:FP})");
|
||||
assert.equal(ev("pmOf().v"), 65535);
|
||||
assert.ok(!JSON.parse(ev("hops()")).includes(ev("FP")), 'a huge cost sends traffic round via Amsterdam');
|
||||
ev("renderAll();$('metIn').value='1';ACT.metricSet({id:FP})");
|
||||
assert.equal(ev("hops()"), JSON.stringify([ev("FP")]));
|
||||
ev("ACT.metricMode({id:FP,k:'f'})");
|
||||
assert.equal(ev("pmOf().v"), 0.1, 'converted back to a multiplier, clamped to the minimum');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('custom metric input is validated and clamped', () => {
|
||||
const { ev, errors } = load();
|
||||
triangle(ev);
|
||||
ev("ACT.setMetric({id:FP,v:'custom'});ACT.selLink({id:FP});renderAll()");
|
||||
ev("$('metIn').value='';ACT.metricSet({id:FP})");
|
||||
assert.equal(ev("pmOf().v"), 1, 'empty input changes nothing');
|
||||
ev("renderAll();$('metIn').value='9999';ACT.metricSet({id:FP})");
|
||||
assert.equal(ev("pmOf().v"), 100);
|
||||
ev("renderAll();$('metIn').value='0';ACT.metricSet({id:FP})");
|
||||
assert.equal(ev("pmOf().v"), 0.1);
|
||||
ev("ACT.metricMode({id:FP,k:'x'});ACT.setMetric({id:FP,v:'bogus'})");
|
||||
assert.equal(ev("pairMet(FK)"), 'custom');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('custom metrics survive a save, and broken ones are repaired', () => {
|
||||
const { ev, errors } = load();
|
||||
triangle(ev);
|
||||
ev("ACT.setMetric({id:FP,v:'custom'});ACT.metricMode({id:FP,k:'w'});pmOf().v=777;S=migrate(JSON.parse(JSON.stringify(S)));compute()");
|
||||
assert.deepEqual(JSON.parse(ev("JSON.stringify(pmOf())")), { k: 'w', v: 777 });
|
||||
ev("S.pairMet[FK]={k:'zz',v:'lots'};S=migrate(JSON.parse(JSON.stringify(S)));compute()");
|
||||
assert.deepEqual(JSON.parse(ev("JSON.stringify(pmOf())")), { k: 'f', v: 1 });
|
||||
ev("S.pairMet[FK]={k:'w',v:1e9};S=migrate(JSON.parse(JSON.stringify(S)))");
|
||||
assert.equal(ev("pmOf().v"), 65535);
|
||||
// An old save: a preset metric on the link itself, from before metrics moved to the city pair.
|
||||
ev("delete S.pairMet[FK];S.links.find(l=>l.id===FP).metric='avoid';S=migrate(JSON.parse(JSON.stringify(S)));compute()");
|
||||
assert.equal(ev("pmOf()"), 'avoid');
|
||||
assert.equal(ev("'metric' in S.links.find(l=>l.id===FP)"), false);
|
||||
assert.equal(JSON.parse(ev("hops()")).length, 2, 'the old save still routes, avoiding the direct link');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('preset buttons stay plain, and Custom explains the numbers, also on phones', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
triangle(ev);
|
||||
for (const w of [1280, 390]) {
|
||||
ev(`window.innerWidth=${w};ACT.setMetric({id:FP,v:'normal'});ACT.selLink({id:FP});renderAll()`);
|
||||
const doc = dom.window.document;
|
||||
const btns = [...doc.querySelectorAll('#panel [data-act="setMetric"]')];
|
||||
assert.equal(btns.length, 5);
|
||||
const km = ev("S.links.find(l=>l.id===FP).km");
|
||||
assert.deepEqual(btns.map(b => b.textContent), ['Prefer', 'Normal', 'Avoid', 'Backup only', 'Custom']);
|
||||
assert.equal(doc.getElementById('metIn'), null);
|
||||
assert.doesNotMatch(doc.getElementById('panel').textContent, /times a multiplier/);
|
||||
ev("ACT.setMetric({id:FP,v:'custom'})");
|
||||
assert.ok(doc.getElementById('metIn'), `custom editor at ${w}px`);
|
||||
assert.ok(doc.querySelector('#panel [data-act="metricMode"]'));
|
||||
const txt = doc.getElementById('panel').textContent;
|
||||
assert.match(txt, /times a multiplier/);
|
||||
assert.match(txt, new RegExp(`Normal ×1 = ${Math.round(km + 60)}, Avoid ×4 = ${Math.round((km + 60) * 4)}`));
|
||||
assert.match(txt, /Multiplier: scales the distance cost/);
|
||||
assert.match(txt, /Cost on this link/);
|
||||
ev("ACT.metricMode({id:FP,k:'w'})");
|
||||
assert.match(doc.getElementById('panel').textContent, /Cost: the exact number/);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a custom metric belongs to the city pair, like the presets, and a standby link keeps it', () => {
|
||||
const { ev, errors } = load();
|
||||
triangle(ev);
|
||||
ev("UI.via=null;openLinkModal('fra','par');ACT.buildLink({tier:1});closeModal();compute()");
|
||||
ev("ACT.setMetric({id:FP,v:'custom'});ACT.metricMode({id:FP,k:'w'});ACT.selLink({id:FP});renderAll();$('metIn').value='65535';ACT.metricSet({id:FP})");
|
||||
const other = ev("S.links.find(l=>l.id!==FP&&edgeKey(l)===FK).id");
|
||||
assert.equal(ev(`pairMet(edgeKey(S.links.find(l=>l.id==='${other}')))`), 'custom', 'the second link between the cities shares it');
|
||||
ev(`ACT.setStandby({id:'${other}',on:1})`);
|
||||
assert.ok(!JSON.parse(ev("hops()")).includes(ev("FP")), 'the pair is still avoided');
|
||||
assert.equal(ev("pmOf().v"), 65535);
|
||||
// Removing every link of the pair drops the metric with it.
|
||||
ev("S.links=S.links.filter(l=>edgeKey(l)!==FK);prunePairMet()");
|
||||
assert.equal(ev("FK in S.pairMet"), false);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
||||
test('Memcached amplification and ACK flood are available without gaming customers and respect Flowspec', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=200;ACT.buyTransit({city:'fra',net:'cog',tier:1});RG[0].fs=2");
|
||||
assert.equal(ev('S.biz.length'), 0);
|
||||
assert.equal(ev('DDOS_VEC.memcached.fs'), true);
|
||||
assert.equal(ev('DDOS_VEC.ack.fs'), false);
|
||||
ev("S.ev.ddos={city:'fra',vec:'ack',gbps:300,until:S.day+3,start:S.day};compute()");
|
||||
const ack = ev('R.served');
|
||||
assert.match(ev('ddosPanel()'), /ACK flood/);
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /application layer/);
|
||||
ev("S.ev.ddos.vec='memcached';compute()");
|
||||
assert.ok(ev('R.served') > ack, 'Flowspec filters Memcached but cannot filter ACK');
|
||||
for (const vec of ['memcached', 'ack']) {
|
||||
ev(`const old=Math.random;Math.random=()=>(${['dns','ntp','memcached','ack'].indexOf(vec)}+0.1)/ddosVectors().length;ddosAttack();Math.random=old`);
|
||||
assert.equal(ev('ddosAll().at(-1).vec'), vec, 'the generator can select each new vector');
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
||||
test('DDoS accounting conserves attack bandwidth through upstream, edge and local scrubbing', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;ACT.launchBB({city:'fra'});ACT.buyTransit({city:'fra',net:'cog',tier:1});S.pops.fra.bb.d=100;S.scrubs=[{city:'fra',tier:1}];S.transit[0].clean=true;S.ev.ddos={city:'fra',vec:'http',gbps:1842,until:5,start:0,entry:{k:'t',id:S.transit[0].id}};compute()");
|
||||
assert.ok(Math.abs(ev('R.ddos[0].reaching') - 184.2) < 1e-9);
|
||||
assert.equal(ev('R.ddos[0].sp.parts[0].cleaned'), ev('R.ddos[0].reaching'));
|
||||
assert.equal(ev('R.ddos[0].leak'), 0, 'the 1T center cleans the upstream remainder');
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /842 Gbps of attack traffic leaks/);
|
||||
ev('S.transit[0].clean=false;compute()');
|
||||
assert.equal(ev('R.ddos[0].reaching'), 1842);
|
||||
assert.equal(ev('R.ddos[0].leak'), 842);
|
||||
for (const setup of ["S.transit[0].clean=true", "RG[0].fs=2;S.ev.ddos.vec='dns'", "S.scrubs=[]"]) {
|
||||
ev(setup+';compute()');
|
||||
assert.ok(ev('Math.abs(R.ddos[0].reaching-R.ddos[0].filtered-(R.ddos[0].sp?.parts.reduce((n,x)=>n+x.cleaned,0)||0)-R.ddos[0].leak)<1e-9'));
|
||||
assert.ok(ev('R.ddos[0].leak<=R.ddos[0].reaching'));
|
||||
}
|
||||
// On-demand diversion must also work for an attack which began on day zero.
|
||||
ev("S.scrubs=[{city:'fra',tier:1}];S.scrubMode='ondemand';S.day=2;compute()");
|
||||
assert.equal(ev('R.ddos[0].leak'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
||||
test('the NOC integrates DDoS mitigation totals into each live attack card without duplicate summaries on phones', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev('ACT.start({})');
|
||||
Object.defineProperty(dom.window, 'innerWidth', { value: 360, configurable: true });
|
||||
ev("S.cash=1e9;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.transit[0].clean=true;S.scrubs=[{city:'fra',tier:1}];S.ev.ddos={city:'fra',vec:'http',gbps:3840,until:5,start:0,entry:{k:'t',id:S.transit[0].id}};compute();UI.left='noc';UI.leftOpen=true;renderLeft()");
|
||||
const card = () => dom.window.document.querySelector('[data-act="rtbh"], [data-act="unrtbh"]').closest('.inc');
|
||||
const text = () => card().textContent;
|
||||
assert.match(card().querySelector('.nm').textContent, /🚨 Live attack: Frankfurt/);
|
||||
assert.equal(dom.window.document.querySelector('.ddos-stats'), null, 'use the existing attack card');
|
||||
assert.doesNotMatch(text(), /DDoS mitigation status|Attack size:|3840 Gbps|This attack:/);
|
||||
assert.equal(text().match(/3\.84 Tbps/g).length, 1, 'the attack size appears once');
|
||||
assert.match(text(), /✓ After upstream scrubbing: 384 Gbps/);
|
||||
assert.equal(text().match(/After upstream scrubbing/g).length, 1, 'show the upstream remainder once');
|
||||
assert.doesNotMatch(text(), /Reaching your network|reaching your network|Upstream scrubbing active/);
|
||||
assert.match(text(), /✓ Scrubbing in Frankfurt: 384 Gbps \/ 1T/);
|
||||
assert.match(text(), /✓ Attack fully mitigated/);
|
||||
ev('S.transit[0].clean=false;compute();renderLeft()');
|
||||
assert.doesNotMatch(text(), /After upstream scrubbing|Reaching your network/);
|
||||
assert.equal(text().match(/3\.84 Tbps/g).length, 1, 'inactive upstream scrubbing does not repeat the attack size');
|
||||
assert.match(text(), /✓ Scrubbing in Frankfurt: 1\.00 Tbps \/ 1T/);
|
||||
assert.match(text(), /~ 2\.84 Tbps is leaking through/);
|
||||
assert.equal(text().match(/leaking through/g).length, 1, 'show the mitigation outcome once');
|
||||
assert.doesNotMatch(text(), /Upstream scrubbing|Attack fully mitigated|leaks past mitigation/);
|
||||
ev("S.transit[0].clean=true;S.pops.fra.rgen=3;S.ev.ddos.vec='dns';compute();renderLeft()");
|
||||
assert.match(text(), /✓ Flowspec dropping: 326 Gbps/);
|
||||
assert.doesNotMatch(text(), /Edge filters dropping/);
|
||||
assert.match(text(), /✓ Scrubbing in Frankfurt: 57\.6 Gbps \/ 1T/);
|
||||
assert.match(text(), /✓ Attack fully mitigated/);
|
||||
ev('ACT.rtbh();renderLeft()');
|
||||
assert.match(text(), /~ Blackholed: the junk is gone, and so is Frankfurt/);
|
||||
assert.equal(text().match(/Blackholed:/g).length, 1);
|
||||
assert.doesNotMatch(text(), /After upstream scrubbing|reaching your network|scrubbing in Frankfurt|Attack fully mitigated|leaking through/i);
|
||||
assert.ok(card().querySelector('[data-act="unrtbh"]'), 'the existing controls stay in the card');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('overlapping floods share scrubbing capacity, have separate controls, and finish independently', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.nextFail=1e9;S.nextEvent=1e9;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.scrubs=[{city:'fra',tier:1}];S.ev.ddos={id:'one',city:'fra',vec:'http',gbps:700,start:0,until:3};S.ev.ddosMore=[{id:'two',city:'fra',vec:'http',gbps:700,start:0,until:5}];compute();UI.left='noc';UI.leftOpen=true;renderLeft()");
|
||||
assert.equal(ev('R.ddos.length'), 2);
|
||||
assert.equal(ev('R.ddos.reduce((n,m)=>n+(m.sp?.parts.reduce((v,x)=>v+x.cleaned,0)||0),0)'), 1000);
|
||||
assert.equal(ev('R.ddos.reduce((n,m)=>n+m.leak,0)'), 400, 'one center cannot spend its capacity twice');
|
||||
const cards = [...dom.window.document.querySelectorAll('[data-act="rtbh"]')].map(b=>b.closest('.inc'));
|
||||
assert.equal(cards.length, 2);
|
||||
assert.match(cards[1].textContent, /✓ Scrubbing in Frankfurt: 1\.00 Tbps \/ 1T · This attack: 300 Gbps/);
|
||||
ev("ACT.rtbh({id:'two'})");
|
||||
assert.equal(ev("S.ev.ddos.bh||false"), false, 'the selected attack gets the control');
|
||||
assert.equal(ev('S.ev.ddosMore[0].bh'), true);
|
||||
assert.ok(ev('R.ddos.every(m=>m.leak===0)'), 'blackholing a target city drops every flood to it');
|
||||
ev("ACT.unrtbh({id:'one'});const old=Math.random;Math.random=()=>0.1;ACT.hackback({id:'two'});Math.random=old");
|
||||
assert.equal(ev('ddosAll().length'), 1, 'hack-back ends only the selected attack');
|
||||
ev('S.day=3;ddosExpire();compute()');
|
||||
assert.equal(ev('ddosAll().length'), 0);
|
||||
assert.equal(ev('(S.stats.ddosOk||0)+(S.stats.ddosLost||0)'), 2, 'both attacks scored once');
|
||||
ev('ddosExpire()');
|
||||
assert.equal(ev('(S.stats.ddosOk||0)+(S.stats.ddosLost||0)'), 2);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('overlapping DDoS saves round trip and legacy attacks migrate safely', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.ev.ddos={city:'fra',vec:'dns',gbps:'80',until:7,start:0};delete S.ev.ddosMore;delete S.ddosStarts;S=migrate(JSON.parse(JSON.stringify(S)))");
|
||||
assert.equal(ev('ddosAll().length'), 1);
|
||||
assert.equal(ev('S.ev.ddos.gbps'), 80);
|
||||
assert.equal(ev('S.ev.ddosMore.length'), 0);
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(S.ddosStarts)')), [0]);
|
||||
ev("S.ev.ddosMore=[{id:'overlap',city:'fra',vec:'ack',gbps:50,until:5,start:0,sla:['customer']},null,{city:'bad',vec:'dns'}, {city:'fra',vec:'unknown'}];S.ddosStarts=[0,'bad',Infinity,-9,99];S=migrate(JSON.parse(JSON.stringify(S)))");
|
||||
assert.equal(ev('ddosAll().length'), 2);
|
||||
assert.equal(ev('S.ev.ddosMore[0].id'), 'overlap');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(S.ddosStarts)')), [0]);
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(S)));compute()');
|
||||
assert.equal(ev('R.ddos.length'), 2);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('simultaneous attacks each bill their protected customer only once', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.nextFail=1e9;S.nextEvent=1e9;ACT.launchBB({city:'fra'});S.pops.fra.bb.d=200;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.biz=[{id:'protected',name:'Shield',city:'fra',type:'scrub',bw:5,rate:900,mood:100,since:0,reqs:[]}];S.ev.ddos={id:'one',city:'fra',vec:'http',gbps:6000,start:0,until:7};S.ev.ddosMore=[{id:'two',city:'fra',vec:'http',gbps:6000,start:0,until:7}];compute();dayTick()");
|
||||
assert.equal(ev('S.stats.sla'), 2, 'same-day attacks have separate SLA identities');
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(S)));dayTick()');
|
||||
assert.equal(ev('S.stats.sla'), 2, 'reloading does not pay the same credits twice');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('DDoS frequency rises with level and signed gaming customers, with a rolling weekly ceiling', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.day=50;S.lvl=1;S.biz=[]");
|
||||
const base = ev('ddosRate()');
|
||||
assert.equal(base, 0.5);
|
||||
ev('S.lvl=13');
|
||||
assert.equal(ev('ddosRate()'), base, 'level alone does not increase the non-gaming rate');
|
||||
ev("S.biz=[{type:'game',city:'fra'}];S.lvl=1");
|
||||
const early = ev('ddosRate()');
|
||||
ev('S.lvl=13');
|
||||
const level = ev('ddosRate()');
|
||||
ev("S.biz=Array.from({length:20},(_,i)=>({type:i%2?'cgame':'game',city:'fra'}))");
|
||||
const gaming = ev('ddosRate()');
|
||||
assert.ok(base < early && early < level && level < gaming && gaming <= 7);
|
||||
ev("S.offers=Array.from({length:50},()=>({type:'game'}));S.biz=[];S.lvl=1");
|
||||
assert.equal(ev('ddosRate()'), base, 'unsigned offers do not attract attacks');
|
||||
// Force every random spawn opportunity (with spicy chaos on), then verify each rolling seven-day window.
|
||||
ev("S.rules=makeRules('bgp');");
|
||||
ev('window.__starts=[];window.__oldRandom=Math.random;Math.random=()=>0');
|
||||
for (let day = 50; day < 66; day++) {
|
||||
ev(`S.day=${day};ddosTick();window.__starts.push(...ddosAll().filter(a=>a.start===S.day).map(a=>a.start))`);
|
||||
assert.ok(ev('S.ddosStarts.length') <= 14);
|
||||
}
|
||||
ev('Math.random=window.__oldRandom');
|
||||
const starts = JSON.parse(ev('JSON.stringify(window.__starts)'));
|
||||
for (let day = 50; day < 66; day++) assert.ok(starts.filter(d=>d>day-7&&d<=day).length <= 14);
|
||||
assert.ok(starts.length > 14, 'the allowance renews as starts leave the rolling window');
|
||||
ev('for(let i=0;i<30;i++)ddosAttack()');
|
||||
assert.equal(ev('S.ddosStarts.length'), 14, 'manual and incident starts cannot bypass the cap');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('DDoS sizes use a smaller non-gaming baseline and preserve unbounded Flood Season scaling', () => {
|
||||
const { ev, errors } = load();
|
||||
ev('ACT.start({});S.lvl=13;R.demand=150000;S.biz=[]');
|
||||
assert.equal(ev('ddosSizeMean()'), 20000);
|
||||
ev("S.scn={id:'flood',rules:{ddos:true}};S.day=365");
|
||||
assert.equal(ev('ddosSizeMean()'), 400000);
|
||||
ev('S.day=730');
|
||||
assert.equal(ev('ddosSizeMean()'), 600000, 'Flood Season keeps growing after completion');
|
||||
ev('S.scn=null;R.demand=300000');
|
||||
assert.equal(ev('ddosSizeMean()'), 40000, 'larger networks can draw still larger attacks');
|
||||
ev('S.lvl=1');
|
||||
const early = ev('ddosSizeMax()');
|
||||
ev('S.lvl=13');
|
||||
const late = ev('ddosSizeMax()');
|
||||
ev("S.biz=[{type:'game',city:'fra'}]");
|
||||
assert.ok(early < late && late < ev('ddosSizeMax()'));
|
||||
// Fixed quantiles show longer durations as both level and gaming exposure rise.
|
||||
ev('window.__oldRandom=Math.random;Math.random=()=>0.95;S.lvl=1;S.biz=[];ddosAttack();window.__earlyDur=ddosAll().at(-1).until-S.day;S.lvl=13;S.biz=Array.from({length:40},()=>({type:\'game\',city:\'fra\',bw:0,rate:0}));ddosAttack();Math.random=window.__oldRandom');
|
||||
assert.ok(ev('ddosAll().at(-1).until-S.day') > ev('window.__earlyDur'));
|
||||
assert.equal(ev('ddosAll().at(-1).until-S.day'), 7);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('distributed attacks follow normal transit and peering traffic across regions', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});for(const c of ['fra','nyc']){S.pops[c].rgen=3;S.pops[c].bb={d:c==='fra'?100:300}}S.transit=[{id:'tf',city:'fra',net:'cog',tier:2},{id:'tn',city:'nyc',net:'cog',tier:2}];S.pni=[{id:'pf',city:'fra',net:'ggl',tier:1}];S.ixp={nyc:1};S.rs={nyc:true};compute();window.__normal=JSON.stringify(R.ingressPorts);ddosAttack()");
|
||||
const normal = JSON.parse(ev('window.__normal'));
|
||||
const entries = JSON.parse(ev('JSON.stringify(ddosAll()[0].entries)'));
|
||||
const total = Object.values(normal).reduce((n,p)=>n+p.traffic,0);
|
||||
assert.ok(entries.some(p=>p.k==='t') && entries.some(p=>p.k==='p') && entries.some(p=>p.k==='ix'));
|
||||
assert.deepEqual([...new Set(entries.map(p=>p.city))].sort(), ['fra','nyc']);
|
||||
for (const en of entries) assert.ok(Math.abs(en.share-normal[en.k+':'+en.id].traffic/total)<1e-9);
|
||||
assert.ok(Math.abs(entries.reduce((n,en)=>n+en.share,0)-1)<1e-9);
|
||||
assert.match(ev('ddosPanel()'), /Live attack:/);
|
||||
assert.doesNotMatch(ev('ddosPanel()'), /ports: .*regions:/, 'keep regional detail out of the live attack card');
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(S)));compute()');
|
||||
assert.equal(ev('S.ev.ddos.entries.length'), entries.length, 'distributed shares survive a save round trip');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('distributed ingress applies upstream scrubbing only to its own port and uses regional centers', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});for(const c of ['fra','nyc']){S.pops[c].rgen=3;S.pops[c].bb={d:100}}S.transit=[{id:'tf',city:'fra',net:'cog',tier:2,clean:true},{id:'tn',city:'nyc',net:'cog',tier:2}];S.scrubs=[{city:'fra',tier:0}];S.ev.ddos={id:'spread',city:'fra',vec:'http',gbps:1000,start:0,until:7,entries:[{k:'t',id:'tf',city:'fra',share:0.25},{k:'t',id:'tn',city:'nyc',share:0.75}]};compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).reaching'), 775);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).leak'), 750);
|
||||
assert.equal(ev('R.useT.tn'), 400, 'the uncleaned flood fills its own ingress port');
|
||||
assert.ok(ev('R.useT.tf') < 200, 'it cannot spill into the cleaned port');
|
||||
assert.match(ev('ddosPanel()'), /✓ After upstream scrubbing: 775 Gbps/);
|
||||
assert.match(ev('ddosPanel()'), /~ 750 Gbps is leaking through/);
|
||||
ev("S.scrubs.push({city:'nyc',tier:1});compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).leak'), 0);
|
||||
assert.match(ev('ddosPanel()'), /✓ Scrubbing in Frankfurt: 25\.0 Gbps \/ 100G/);
|
||||
assert.match(ev('ddosPanel()'), /✓ Scrubbing in New York: 750 Gbps \/ 1T/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('scrubbing hauls retain their real source on each link when several cities use one center', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev(`ACT.start({});S.cash=1e9;S.lvl=6;for(const c of ['prg','ber'])ACT.buildPop({city:c});
|
||||
for(const c in S.pops)S.pops[c].rgen=3;
|
||||
S.links=[{id:'fp1',a:'fra',b:'prg',kind:'wave',tier:2,km:409,mo:100},
|
||||
{id:'fp2',a:'fra',b:'prg',kind:'wave',tier:2,km:409,mo:100},
|
||||
{id:'fb',a:'fra',b:'ber',kind:'wave',tier:2,km:420,mo:100},
|
||||
{id:'pb',a:'prg',b:'ber',kind:'wave',tier:2,km:280,mo:100}];
|
||||
S.transit=[{id:'tp',city:'prg',net:'cog',tier:2},{id:'tb',city:'ber',net:'cog',tier:2}];
|
||||
S.scrubs=[{city:'fra',tier:1}];
|
||||
S.ev.ddos={id:'spread',city:'ber',vec:'ack',gbps:100,start:0,until:7,
|
||||
entries:[{k:'t',id:'tp',city:'prg',share:.5},{k:'t',id:'tb',city:'ber',share:.5}]};compute()`);
|
||||
const sources = id => JSON.parse(ev(`JSON.stringify(Object.entries(R.ef[edgeKey(S.links.find(l=>l.id==='${id}'))].eg)
|
||||
.filter(([key])=>key.startsWith('scrub:')).map(([key,g])=>({city:R.egDesc[key].city,g})).sort((a,b)=>a.city.localeCompare(b.city)))`));
|
||||
assert.equal(ev('R.load.pb||0'), 0, 'Berlin does not feed the Prague link');
|
||||
assert.deepEqual(sources('fp1').map(x=>x.city), ['prg']);
|
||||
assert.deepEqual(sources('fb').map(x=>x.city), ['ber']);
|
||||
assert.ok(sources('fp1')[0].g>0 && sources('fb')[0].g>0);
|
||||
assert.ok(Math.abs(sources('fp1')[0].g-ev('R.load.fp1+R.load.fp2'))<1e-9, 'the grouped record covers both parallel links exactly');
|
||||
ev("selectLink('fp1');draw(0)");
|
||||
const row = [...dom.window.document.querySelectorAll('#panelBody .row')].find(x=>x.querySelector('.nm')?.textContent==='Attack hauled to scrubbing in Frankfurt');
|
||||
assert.ok(row);
|
||||
assert.match(row.querySelector('.meta').textContent, /^Prague · /);
|
||||
assert.equal(JSON.parse(row.querySelector('[data-act="goEgress"]').dataset.args).city, 'prg');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify([...UI.feed])')), ['prg'], 'the map highlights the same source as the inspected link');
|
||||
row.querySelector('[data-act="goEgress"]').click();
|
||||
assert.equal(ev('UI.sel.id'), 'prg', 'Open goes to the actual source city');
|
||||
// Reordering ingress and adding an overlapping flood must not change the attribution.
|
||||
ev("S.ev.ddos.entries.reverse();S.ev.ddosMore=[{...S.ev.ddos,id:'overlap',gbps:20,entries:S.ev.ddos.entries.slice().reverse()}];compute()");
|
||||
assert.deepEqual(sources('fp1').map(x=>x.city), ['prg']);
|
||||
assert.deepEqual(sources('fb').map(x=>x.city), ['ber']);
|
||||
// When Berlin's direct link fails, its haul really does join Prague's route.
|
||||
ev('S.links.find(l=>l.id==="fb").cut=S.day+1;compute()');
|
||||
assert.ok(ev('R.load.pb')>0);
|
||||
assert.deepEqual(sources('fp1').map(x=>x.city), ['ber','prg']);
|
||||
assert.deepEqual(sources('pb').map(x=>x.city), ['ber']);
|
||||
assert.ok(Math.abs(sources('fp1').reduce((n,x)=>n+x.g,0)-ev('R.load.fp1+R.load.fp2'))<1e-9, 'shared-path totals still equal the actual link load');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
function setupScrubLatency(ev) {
|
||||
ev(`ACT.start({});S.cash=1e9;S.lvl=6;for(const c of ['par','nyc','ams'])ACT.buildPop({city:c});
|
||||
for(const c in S.pops)S.pops[c].rgen=RG.findIndex(g=>g.fs===1);
|
||||
S.links=[{id:'pf',a:'par',b:'fra',kind:'wave',tier:3,km:620/1.3,mo:100},
|
||||
{id:'fn',a:'fra',b:'nyc',kind:'wave',tier:3,km:6000,mo:100},
|
||||
{id:'fa',a:'fra',b:'ams',kind:'wave',tier:3,km:200,mo:100}];
|
||||
S.transit=[{id:'tf',city:'fra',net:'cog',tier:2},{id:'tn',city:'nyc',net:'cog',tier:2}];
|
||||
S.scrubs=[{city:'fra',tier:0},{city:'par',tier:0}];
|
||||
S.ev.ddos={id:'par-flood',city:'par',vec:'dns',gbps:33.8,start:0,until:7,
|
||||
entries:[{k:'t',id:'tf',city:'fra',share:0.65},{k:'t',id:'tn',city:'nyc',share:0.35}]};compute()`);
|
||||
}
|
||||
|
||||
test('distributed ingress does not give a locally protected victim a remote scrubbing latency', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
setupScrubLatency(ev);
|
||||
assert.ok(ev("R.haul.some(q=>q.city==='nyc'&&q.to==='par'&&q.ms>60)"), 'the remote ingress still travels to its scrubbing center');
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).sp.parts.length'), 2, 'both centers clean the distributed flood');
|
||||
assert.ok(Math.abs(ev('ddosReport(S.ev.ddos).flowspec')-20.28)<1e-9);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).leak'), 0);
|
||||
Object.defineProperty(dom.window, 'innerWidth', { value: 360, configurable: true });
|
||||
ev("UI.left='noc';UI.leftOpen=true;renderLeft()");
|
||||
const text = dom.window.document.getElementById('left').textContent;
|
||||
assert.match(text, /Live attack: Paris/);
|
||||
assert.match(text, /Scrubbing in Frankfurt: 8\.8 Gbps/);
|
||||
assert.match(text, /Scrubbing in Paris: 4\.7 Gbps/);
|
||||
assert.doesNotMatch(text, /Scrubbing traffic hauled over your backbone|\+\d+(\.\d+)? ms/);
|
||||
// A local center is still nearest when it is full and other centers take overflow.
|
||||
ev("S.ev.ddos.vec='ack';S.ev.ddos.gbps=300;compute()");
|
||||
assert.doesNotMatch(ev('ddosOne(S.ev.ddos)'), /Scrubbing traffic hauled over your backbone/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('each attack shows only the nearest scrubbing detour using precise one-way link latency', () => {
|
||||
const { ev, errors } = load();
|
||||
setupScrubLatency(ev);
|
||||
ev("for(const c in S.pops)S.pops[c].rgen=3;S.scrubs=[{city:'fra',tier:0},{city:'ams',tier:0}];S.ev.ddos.vec='ack';S.ev.ddos.gbps=230;compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).sp.parts.length'), 2, 'capacity spills between centers');
|
||||
const card = ev('ddosOne(S.ev.ddos)');
|
||||
assert.equal((card.match(/Scrubbing traffic hauled over your backbone/g)||[]).length, 1);
|
||||
assert.match(card, /✓ Scrubbing traffic hauled over your backbone: Paris → Frankfurt \(\+3\.1 ms\)/);
|
||||
// An overlapping attack has its own victim and nearest center.
|
||||
ev("S.ev.ddosMore=[{id:'other',city:'ams',vec:'ack',gbps:10,start:0,until:7,entries:[{k:'t',id:'tn',city:'nyc',share:1}]}];compute()");
|
||||
assert.doesNotMatch(ev('ddosOne(S.ev.ddosMore[0])'), /Scrubbing traffic hauled over your backbone/);
|
||||
assert.match(ev('ddosOne(S.ev.ddos)'), /Paris → Frankfurt \(\+3\.1 ms\)/);
|
||||
// Ignore a failed nearby center and use the live path to Amsterdam.
|
||||
ev("S.pops.fra.down=10;S.links.push({id:'pa',a:'par',b:'ams',kind:'wave',tier:3,km:2000,mo:100});S.ev.ddos.entries=[{k:'edge',city:'par',share:1}];compute()");
|
||||
assert.match(ev('ddosOne(S.ev.ddos)'), /Paris → Amsterdam \(\+13\.0 ms\)/);
|
||||
ev('S.ev.ddos.bh=true;compute()');
|
||||
assert.doesNotMatch(ev('ddosOne(S.ev.ddos)'), /Scrubbing traffic hauled over your backbone/);
|
||||
ev('S.ev.ddos.bh=false;S.scrubMode="ondemand";compute()');
|
||||
assert.doesNotMatch(ev('ddosOne(S.ev.ddos)'), /Scrubbing traffic hauled over your backbone/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a constrained remote haul leaves scrubbing capacity for the next overlapping flood', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});for(const c of ['fra','nyc'])S.pops[c].rgen=3;S.links=[{id:'thin',a:'nyc',b:'fra',kind:'wave',tier:1,km:6000,mo:100}];S.scrubs=[{city:'fra',tier:1}];S.ev.ddos={id:'far',city:'nyc',vec:'http',gbps:600,start:0,until:7};S.ev.ddosMore=[{id:'near',city:'fra',vec:'http',gbps:900,start:0,until:7}];compute()");
|
||||
const clean = JSON.parse(ev('JSON.stringify(R.ddos.map(m=>({id:m.attack.id,clean:m.sp?.parts.reduce((n,x)=>n+x.cleaned,0)||0,leak:m.leak})))'));
|
||||
assert.equal(clean.find(m=>m.id==='near').clean, 900);
|
||||
assert.ok(clean.find(m=>m.id==='far').clean <= 100);
|
||||
assert.ok(clean.reduce((n,m)=>n+m.clean,0) <= 1000);
|
||||
for (const m of clean) assert.equal(m.clean+m.leak, m.id==='near'?900:600);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('distributed attack statistics survive an ingress outage and corrupted saved shares', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=6;ACT.buildPop({city:'nyc'});S.ev.ddos={id:'spread',city:'fra',vec:'http',gbps:1000,start:0,until:7,entries:[{k:'t',id:'a',city:'fra',share:0.25},{k:'t',id:'b',city:'nyc',share:0.75}]};S.pops.nyc.down=5;compute()");
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).reaching'), 1000);
|
||||
assert.equal(ev('ddosReport(S.ev.ddos).leak'), 1000);
|
||||
ev("S.ev.ddos.entries.push({k:'t',id:'bad',city:'unknown',share:5},{k:'t',id:'bad2',city:'fra',share:-1});S=migrate(JSON.parse(JSON.stringify(S)));compute()");
|
||||
assert.equal(ev('S.ev.ddos.entries.length'), 2);
|
||||
assert.equal(ev('S.ev.ddos.entries.reduce((n,en)=>n+en.share,0)'), 1);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('RackNet and TeamSpooked require signed gaming customers, bypass Flowspec, and stay within a third of the current size range', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.lvl=13;S.pops.fra.bb={d:150000};ACT.buyTransit({city:'fra',net:'cog',tier:2});compute()");
|
||||
assert.equal(ev("ddosVectors().includes('racknet')||ddosVectors().includes('teamspooked')"), false);
|
||||
ev("S.offers=[{type:'game'}]");
|
||||
assert.equal(ev("ddosVectors().includes('racknet')"), false, 'an unsigned offer does not introduce gaming attacks');
|
||||
ev("S.biz=[{type:'game',id:'gamer',name:'Gamer',city:'fra',bw:0,rate:0}];compute()");
|
||||
for (const vec of ['racknet','teamspooked']) {
|
||||
assert.equal(ev(`DDOS_VEC.${vec}.fs`), false);
|
||||
const sizeMax = ev('ddosSizeMax()/3');
|
||||
ev(`const old=Math.random;let n=0;Math.random=()=>n++===1?(ddosVectors().indexOf('${vec}')+0.5)/ddosVectors().length:0.999999;ddosAttack();Math.random=old`);
|
||||
assert.equal(ev('ddosAll().at(-1).vec'), vec);
|
||||
assert.ok(ev('ddosAll().at(-1).gbps') <= sizeMax);
|
||||
assert.ok(ev('ddosAll().at(-1).gbps') > sizeMax*(1-0.00002), 'the upper randomized quantile approaches the one-third limit, including rare spikes');
|
||||
}
|
||||
ev("S.biz[0].type='cgame'");
|
||||
assert.equal(ev("ddosVectors().includes('teamspooked')"), true, 'cloud gaming also attracts these vectors');
|
||||
ev('S.biz=[]');
|
||||
assert.equal(ev("ddosVectors().includes('teamspooked')"), false);
|
||||
assert.equal(ev('ddosAll().length'), 2, 'existing attacks finish naturally after the gaming customer leaves');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('normal DDoS starts average half an attack per week without gaming and never exceed a seven-per-week expected rate', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.rules=makeRules('bgp');S.day=50");
|
||||
const checks = JSON.parse(ev(`
|
||||
const oldAttack=ddosAttack,oldRandom=Math.random,out=[];
|
||||
try {
|
||||
for(const [level,games] of [[1,0],[13,0],[1,1],[13,1],[13,10],[13,1000]]){
|
||||
S.lvl=level;S.biz=Array.from({length:games},()=>({type:'game'}));
|
||||
let starts=0,draw=0;ddosAttack=()=>{starts++};Math.random=()=>((draw++)+0.5)/14000;
|
||||
for(let day=0;day<7000;day++)ddosTick();
|
||||
out.push({level,games,expected:ddosRate(),observed:starts/1000});
|
||||
}
|
||||
} finally {ddosAttack=oldAttack;Math.random=oldRandom;}
|
||||
JSON.stringify(out)
|
||||
`));
|
||||
for(const row of checks){
|
||||
assert.ok(Math.abs(row.observed-row.expected)<=0.0011, JSON.stringify(row));
|
||||
if(row.games===0)assert.equal(row.observed,0.5);
|
||||
else assert.ok(row.expected>0.5&&row.expected<=7);
|
||||
}
|
||||
assert.ok(checks[3].expected>checks[2].expected, 'level increases gaming frequency');
|
||||
assert.ok(checks[4].expected>checks[3].expected, 'more gaming customers increase frequency');
|
||||
assert.ok(checks[3].expected<0.8, 'one gaming customer does not suddenly add several attacks per week, even at the last level');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('normal attack sizes match the one- and fifty-gamer targets while frequency rises gradually', () => {
|
||||
const { ev, errors } = load();
|
||||
ev('ACT.start({})');
|
||||
const samples = JSON.parse(ev(`
|
||||
const oldRandom=Math.random,out=[];
|
||||
try {
|
||||
for(const [level,demand] of [[1,0],[3,1850],[LEVELS.length,LV_REQ.at(-1).pk]]){
|
||||
const counts=[];
|
||||
for(const games of [0,1,2,5,10,20,50,100,1000]){
|
||||
S.lvl=level;S.biz=Array.from({length:games},(_,i)=>({id:'g'+i,type:i%2?'cgame':'game',city:'fra',bw:0,rate:0}));
|
||||
const vectors=ddosVectors();let sum=0;
|
||||
for(let i=0;i<vectors.length;i++)for(const [roll,weight] of [[0.49,0.98],[0.99,0.02]]){
|
||||
S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];R.demand=demand;
|
||||
let draw=0;Math.random=()=>draw++===1?(i+0.5)/vectors.length:roll;
|
||||
ddosAttack(false);sum+=weight*S.ev.ddos.gbps;
|
||||
}
|
||||
counts.push({games,mean:sum/vectors.length,rate:ddosRate()});
|
||||
}
|
||||
out.push({level,demand,counts});
|
||||
}
|
||||
} finally {Math.random=oldRandom;}
|
||||
JSON.stringify(out)
|
||||
`));
|
||||
for(const row of samples){
|
||||
const [plain,first]=row.counts,fifty=row.counts.find(c=>c.games===50),hundred=row.counts.find(c=>c.games===100),many=row.counts.at(-1);
|
||||
assert.ok(Math.abs(first.mean-plain.mean*3)<0.003, 'the first gamer triples the overall mean, allowing only bandwidth rounding: '+JSON.stringify(row));
|
||||
assert.ok(Math.abs(fifty.mean-plain.mean*8)<0.01, 'fifty gamers bring eightfold sizes, allowing only bandwidth rounding');
|
||||
assert.ok(hundred.mean>first.mean*3, 'growth continues across dozens of gaming customers');
|
||||
assert.ok(hundred.mean>plain.mean*10 && hundred.mean<plain.mean*11, 'a hundred gamers bring roughly tenfold sizes');
|
||||
assert.ok(many.mean<=plain.mean*12+0.01, 'high-exposure sizes approach the existing upper balance');
|
||||
assert.equal(plain.rate,0.5);
|
||||
assert.ok(first.rate<0.8);
|
||||
assert.ok(hundred.rate>6 && many.rate<=7);
|
||||
for(let i=1;i<row.counts.length;i++){
|
||||
assert.ok(row.counts[i].mean>row.counts[i-1].mean, 'each sampled count increases actual spawned attack sizes');
|
||||
assert.ok(row.counts[i].rate>row.counts[i-1].rate, 'each sampled count increases frequency');
|
||||
}
|
||||
}
|
||||
assert.ok(Math.abs(samples[0].counts[0].mean-1)<0.001, 'the minimum-demand baseline still permits small attacks');
|
||||
assert.ok(Math.abs(samples[1].counts[0].mean-740/13)<0.001, 'the 1.85 Tbps non-gaming example keeps its average');
|
||||
assert.ok(Math.abs(samples[2].counts[0].mean-samples[2].demand*4/3/10)<0.001);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('normal attack sizes cover a broad ordinary range and a two-percent large tail without raising the mean', () => {
|
||||
const { ev, errors } = load();
|
||||
ev('ACT.start({});S.lvl=3;S.biz=[];R.demand=1850');
|
||||
const distribution = JSON.parse(ev(`
|
||||
const oldRandom=Math.random,ordinary=[],large=[];let sum=0;
|
||||
try {
|
||||
for(let i=0;i<10000;i++){
|
||||
Math.random=()=>(i+0.5)/10000;
|
||||
const g=ddosSize('syn');sum+=g;(g>100?large:ordinary).push(g);
|
||||
}
|
||||
} finally {Math.random=oldRandom;}
|
||||
JSON.stringify({ordinary:{n:ordinary.length,min:Math.min(...ordinary),max:Math.max(...ordinary)},
|
||||
large:{n:large.length,min:Math.min(...large),max:Math.max(...large),near500:large.some(g=>g>=490&&g<=510)},mean:sum/10000})
|
||||
`));
|
||||
assert.equal(distribution.ordinary.n, 9800);
|
||||
assert.equal(distribution.large.n, 200);
|
||||
assert.ok(distribution.ordinary.min>=8.9 && distribution.ordinary.min<10);
|
||||
assert.ok(distribution.ordinary.max>85 && distribution.ordinary.max<=89.1);
|
||||
assert.ok(distribution.ordinary.max/distribution.ordinary.min>9.9);
|
||||
assert.ok(distribution.large.min>=356 && distribution.large.max<=535);
|
||||
assert.ok(distribution.large.near500, 'the example network can occasionally face a roughly 500 Gbps flood');
|
||||
assert.ok(Math.abs(distribution.mean-740/13)<0.001, 'the rare tail preserves the previous 56.923 Gbps average');
|
||||
// Verify that real spawns use both bands, not just the standalone sampler.
|
||||
for (const [roll,minimum,maximum] of [[0.49,8.9,89.1],[0.99,356,535]]) {
|
||||
ev(`S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];R.demand=1850;const old=Math.random;let n=0;Math.random=()=>{const i=n++;return i===1?(ddosVectors().indexOf('syn')+0.5)/ddosVectors().length:i===2?${roll}:0.5};try{ddosAttack()}finally{Math.random=old}`);
|
||||
assert.equal(ev('S.ev.ddos.vec'), 'syn');
|
||||
assert.ok(ev('S.ev.ddos.gbps')>=minimum && ev('S.ev.ddos.gbps')<=maximum);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('Flood Season retains its existing size quantiles and escalation when normal attacks gain rare spikes', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.scn={id:'flood',rules:{ddos:true}};S.lvl=3;S.biz=[];R.demand=1850");
|
||||
for (const [day,expected] of [[0,[700,1400,2099]],[365,[1400,2800,4199]],[730,[2100,4200,6299]]]) {
|
||||
ev(`S.day=${day}`);
|
||||
const actual = JSON.parse(ev("const old=Math.random;let sizes;try{sizes=[0,0.5,0.999999].map(r=>{Math.random=()=>r;return ddosSize('syn')})}finally{Math.random=old}JSON.stringify(sizes)"));
|
||||
assert.deepEqual(actual, expected);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the busier DDoS schedule needs spicy chaos or gaming customers; otherwise attacks come as before', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e9;S.day=50;S.lvl=13;S.biz=[];S.nextFail=1e9;S.nextEvent=1e9");
|
||||
const ticks = () => ev("(()=>{const old=Math.random,oa=ddosAttack;let n=0;ddosAttack=()=>{n++};Math.random=()=>0;try{for(let i=0;i<30;i++)ddosTick();}finally{Math.random=old;ddosAttack=oa;}return n;})()");
|
||||
assert.equal(ticks(), 0, 'no spicy chaos, no gamers: no extra schedule');
|
||||
// DDoS stays one of the regular incidents instead: some roll of fireFailure() still starts one.
|
||||
assert.ok(ev("(()=>{const old=Math.random;try{for(let i=0;i<200;i++){const r=i/200;Math.random=()=>r;S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];fireFailure();if(ddosAll().length)return true;}return false;}finally{Math.random=old;}})()"), 'fireFailure can start an attack');
|
||||
ev("S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];S.inc=[]");
|
||||
ev("S.biz=[{type:'game',city:'fra',bw:5,rate:1,reqs:[]}]");
|
||||
assert.ok(ticks() > 0, 'gaming customers bring their own attacks');
|
||||
ev("S.biz=[];S.rules=makeRules('bgp')");
|
||||
assert.ok(ticks() > 0, 'spicy chaos brings more attacks');
|
||||
ev("S.rules=makeRules('freeze')");
|
||||
assert.equal(ticks(), 0, 'Change Freeze has no attacks on either schedule');
|
||||
ev("S.biz=[{type:'game',city:'fra',bw:5,rate:1,reqs:[]}]");
|
||||
assert.equal(ticks(), 0, 'not even with gamers');
|
||||
assert.ok(ev("(()=>{const old=Math.random;try{for(let i=0;i<200;i++){const r=i/200;Math.random=()=>r;S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];fireFailure();if(ddosAll().length)return false;}return true;}finally{Math.random=old;S.inc=[];}})()"), 'and fireFailure never rolls one');
|
||||
ev("S.rules=makeRules('bgp');S.biz=[]");
|
||||
assert.ok(ev("(()=>{const old=Math.random;try{for(let i=0;i<200;i++){const r=i/200;Math.random=()=>r;S.ev.ddos=null;S.ev.ddosMore=[];S.ddosStarts=[];fireFailure();if(ddosAll().length)return false;}return true;}finally{Math.random=old;S.inc=[];}})()"), 'spicy attacks come from their own schedule only, never twice');
|
||||
ev("S.rules=makeRules('oncall')");
|
||||
// Flood Season, not spicy: one flood at a time, 3 to 7 days apart, however old the scenario is.
|
||||
ev("ACT.startScn({id:'flood',sure:1});S.biz=[]");
|
||||
const gaps = JSON.parse(ev("(()=>{const o=[];for(const d of [0,1000])for(const r of [0,0.999]){S.day=d;const old=Math.random;Math.random=()=>r;o.push(floodGap());Math.random=old;}return JSON.stringify(o);})()"));
|
||||
assert.deepEqual(gaps, [3, 7, 3, 7]);
|
||||
ev("S.scn.nextDdos=S.day;ddosTick()");
|
||||
assert.equal(ev('ddosAll().length'), 1);
|
||||
ev("S.scn.nextDdos=S.day;ddosTick()");
|
||||
assert.equal(ev('ddosAll().length'), 1, 'the next flood waits for the last one to end');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ module.exports = `
|
|||
for(f of flows){
|
||||
if(f.rem<=1e-6||(rank===0&&!f.cache)||(pass&&!pass(f)))continue;
|
||||
Dv=SDi[f.ci];Pv=SPi[f.ci];PP=walked[f.ci]||(walked[f.ci]=[]);vis++;
|
||||
const candidates=E.filter(e=>e.used<e.cap&&e.ok(f.n)&&
|
||||
(TR?eff(e,f.n):base(e,f.n))===rank&&Dv[CIDX[e.city]]<Infinity)
|
||||
const candidates=E.filter(e=>e.used<e.cap&&(f.pin?e.ek===f.pin:e.ok(f.n))&&
|
||||
(f.pin?rank0(e):TR?eff(e,f.n):base(e,f.n))===rank&&Dv[CIDX[e.city]]<Infinity)
|
||||
.sort((a,b)=>(a.pref==='high'?0:1)-(b.pref==='high'?0:1)||Dv[CIDX[a.city]]-Dv[CIDX[b.city]]);
|
||||
for(let i=0;i<candidates.length&&f.rem>1e-6;){
|
||||
let j=i+1;while(j<candidates.length&&(candidates[j].pref==='high')===(candidates[i].pref==='high')&&
|
||||
|
|
|
|||
|
|
@ -1326,3 +1326,20 @@ test('#166 every Brazilian exchange is named after its city, São Paulo included
|
|||
assert.deepEqual(odd, []);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('link redundancy trials distinguish a bridge, a full fallback and a healthy alternate path without changing the game',()=>{
|
||||
const {ev,errors}=load();
|
||||
ev("ACT.start({});S.cash=1e8;ACT.buildPop({city:'bde'});ACT.buildPop({city:'ams'});S.biz=[{id:'circuit',name:'Test Circuit',type:'l2vpn',city:'fra',city2:'bde',bw:80,rate:1,reqs:[]}];S.links=[{id:'main',a:'fra',b:'bde',kind:'wave',tier:1,km:100,mo:100,cut:0,trench:'main'}];compute();window.state=JSON.stringify(S);window.live=R;window.hot=UI.hotMap;window.cache=TE_CACHE");
|
||||
let t=JSON.parse(ev("JSON.stringify(linkTrial('main'))"));assert.equal(t.split,true);assert.equal(t.loss,80);
|
||||
assert.equal(ev('JSON.stringify(S)'),ev('state'));assert.equal(ev('R===live&&UI.hotMap===hot&&TE_CACHE===cache'),true);
|
||||
ev("S.links.push({id:'a',a:'fra',b:'ams',kind:'wave',tier:0,km:100,mo:100,cut:0},{id:'b',a:'ams',b:'bde',kind:'wave',tier:0,km:100,mo:100,cut:0});compute()");
|
||||
t=JSON.parse(ev("JSON.stringify(linkTrial('main'))"));assert.equal(t.split,false);assert.equal(t.loss,70);assert.equal(t.busy.length,2);
|
||||
ev("S.links[1].tier=1;S.links[2].tier=1;compute()");t=JSON.parse(ev("JSON.stringify(linkTrial('main'))"));assert.equal(t.split,false);assert.equal(t.loss,0);
|
||||
ev("S.links[1].cut=S.day+5;compute()");assert.equal(ev("linkTrial('main').split"),true,'existing failures are respected');assert.equal(ev("linkTrial('a')"),null,'an already failed link is not tested');
|
||||
ev("S.links=S.links.slice(0,1);S.links.push({...S.links[0],id:'parallel'});compute()");assert.equal(ev("linkTrial('main').split"),false,'only the selected link fails even when a trench is shared');assert.equal(ev("linkTrial('main').loss"),0);
|
||||
ev("S.links[0]={...S.links[0],kind:'df',sys:'roadm',ch:['tp16'],pairs:1,regen:0,ready:0,own:true};compute()");assert.equal(ev("linkTrial('main').loss"),0,'dark fiber is tested as one link');
|
||||
ev("window.innerWidth=360;ACT.linkCheck({id:'main'})");assert.match(ev("$('modalCard').textContent"),/One backhoe is not enough/);assert.equal(ev("$('modal').className"),'link-check');ev("ACT.phoneTab({t:'noc'})");assert.equal(ev("$('modal').hidden"),true);
|
||||
ev("S.links[0]={...S.links[0],kind:'vxc',vt:1,prov:FABS[0].id};compute()");assert.equal(ev("linkTrial('main').loss"),0,'virtual circuits are tested individually');
|
||||
ev("window.saveRef=S;window.liveRef=R;window.originalCompute=compute;compute=()=>{throw Error('trial failed')}");assert.throws(()=>ev("linkTrial('main')"),/trial failed/);ev('compute=originalCompute');assert.equal(ev('S===saveRef&&R===liveRef'),true,'even a failed trial restores the live state');
|
||||
assert.deepEqual(errors,[]);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ test('Flood Season: attacks keep coming, grow, and only count when service held'
|
|||
assert.ok(ev('S.lvl') >= 3, 'starts with bigger gear unlocked');
|
||||
// a few weeks in: several attacks start on their own schedule
|
||||
let n = 0;
|
||||
for (let i = 0; i < 40; i++) { ev('dayTick()'); if (ev('!!(S.ev.ddos&&S.ev.ddos.start===S.day)')) n++; }
|
||||
for (let i = 0; i < 40; i++) { ev('dayTick()'); if (ev('ddosAll().some(a=>a.start===S.day)')) n++; }
|
||||
assert.ok(n >= 4, `attacks keep coming (${n} in 40 days)`);
|
||||
assert.ok(ev('(S.stats.ddosOk||0)+(S.stats.ddosLost||0)') >= 3, 'finished attacks are scored');
|
||||
// scoring: held only if service stayed at 97%+
|
||||
|
|
@ -468,3 +468,29 @@ test('RouteScript: help, ready-made scripts and the AI button', () => {
|
|||
ev("UI.dtab='overview';renderAll()");
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
||||
test('Flood Season keeps attacking and escalating after both success and timeout', () => {
|
||||
for (const outcome of ['done', 'failed']) {
|
||||
const { ev, errors, dom } = load();
|
||||
ev("ACT.startScn({id:'flood',sure:1});S.cash=1e9;S.nextFail=1e9;S.nextEvent=1e9");
|
||||
if (outcome === 'done') ev('S.stats.ddosOk=20;S.stats.ddosOkBig=5;S.day=100');
|
||||
else ev('S.day=365');
|
||||
ev('scnTick(S.day)');
|
||||
assert.ok(ev(`!!S.scn.${outcome}`));
|
||||
assert.ok([...dom.window.document.querySelectorAll('#modal [data-act="closeModal"]')].some(b=>b.textContent==='Keep playing'));
|
||||
ev('ACT.closeModal();S.scn.nextDdos=S.day+1;dayTick()');
|
||||
assert.equal(ev('S.ev.ddos.start'), ev('S.day'), 'Keep playing still spawns attacks');
|
||||
const before = ev('S.day');
|
||||
ev('S.scn.nextDdos=S.day+1;S.day+=8;dayTick()');
|
||||
assert.ok(ev('ddosAll().at(-1).start') > before, 'subsequent attacks keep coming');
|
||||
// Escalating frequency belongs to spicy chaos; calmer games keep the old 3 to 7 days.
|
||||
ev("S.rules.chaos='spicy'");
|
||||
const gaps = JSON.parse(ev('const old=Math.random;Math.random=()=>0.5;S.day=0;const early=floodGap();S.day=1000;const late=floodGap();Math.random=old;JSON.stringify([early,late])'));
|
||||
assert.ok(gaps[1] < gaps[0], 'frequency keeps increasing with scenario age');
|
||||
const sizes = JSON.parse(ev('const old=Math.random;Math.random=()=>0.9;S.day=0;ddosAttack();const early=ddosAll().at(-1).gbps;S.day=1000;ddosAttack();const late=ddosAll().at(-1).gbps;Math.random=old;JSON.stringify([early,late])'));
|
||||
assert.ok(sizes[1] > sizes[0], 'intensity keeps increasing with scenario age');
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
81
tests/optic-counts.test.js
Normal file
81
tests/optic-counts.test.js
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
const test=require('node:test');
|
||||
const assert=require('node:assert/strict');
|
||||
const {load}=require('./harness');
|
||||
function setup(ev,sub=false){ev(`ACT.start({});S.cash=1e9;S.lvl=13;S.day=100;for(const g of GOALS)S.done[g.id]=0;
|
||||
S.pops.fra.rgen=mainRG(4);S.pops.fra.routers=16;S.pops.ams={...S.pops.fra};
|
||||
S.links=[{id:'fiber',a:'fra',b:'ams',kind:'df',own:true,sub:${sub},sys:'roadm',km:400,ch:[],ready:0,day:0,cut:0,mo:1}];
|
||||
UI.sel={type:'link',id:'fiber'};renderPanel();`);}
|
||||
const count=ev=>ev('S.links[0].ch.length');
|
||||
for(const sub of [false,true])test(`typed counts buy and remove optics on ${sub?'subsea':'land'} fiber`,()=>{
|
||||
const {ev,dom,errors}=load();try{
|
||||
setup(ev,sub);const doc=dom.window.document;
|
||||
const f=doc.querySelector('form.optic-count[data-optic="zr4"]'),input=f.elements.count;
|
||||
input.focus();input.value='5';input.dispatchEvent(new dom.window.Event('input',{bubbles:true}));
|
||||
const cost=ev("5*chCost(S.links[0],'zr4')"),cash=ev('S.cash');
|
||||
assert.ok(f.querySelector('button').textContent.includes(ev(`fmt$(${cost})`)));
|
||||
ev('S.day++;renderPanel()');
|
||||
assert.equal(doc.activeElement,input,'tick preserves the focused field');assert.equal(input.value,'5');
|
||||
assert.ok(f.querySelector('button').textContent.includes(ev(`fmt$(${cost})`)));
|
||||
f.dispatchEvent(new dom.window.Event('submit',{bubbles:true,cancelable:true}));
|
||||
assert.equal(count(ev),5);assert.equal(cash-ev('S.cash'),cost);
|
||||
ev("ACT.setChCount({id:'fiber',o:'zr4',n:2})");assert.equal(count(ev),2);assert.equal(ev('S.spares.zr4'),3);
|
||||
const before=ev('S.cash');ev("ACT.setChCount({id:'fiber',o:'zr4',n:5})");assert.equal(count(ev),5);assert.equal(ev('S.cash'),before);assert.equal(ev('S.spares.zr4'),0);
|
||||
ev("ACT.setChCount({id:'fiber',o:'zr4',n:0})");assert.equal(count(ev),0);assert.equal(ev('S.spares.zr4'),5);
|
||||
assert.deepEqual(errors,[]);
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
test('batch price matches individual channel purchases with spares, regen cards and tariffs',()=>{
|
||||
const {ev,dom}=load();try{setup(ev);ev("S.links[0].regen=2;S.spares={zr4:2};S.ev.tariff=S.day+20");
|
||||
const expected=ev("2*Math.round(optCost('zr4')*REGEN_CH*2)+3*Math.round(optCost('zr4')*(1+REGEN_CH*2))");
|
||||
assert.equal(ev("opticCountCost(S.links[0],'zr4',5)"),expected);
|
||||
const cash=ev('S.cash');ev("ACT.setChCount({id:'fiber',o:'zr4',n:5})");assert.equal(cash-ev('S.cash'),expected);
|
||||
setup(ev);ev("S.links[0].regen=2;S.spares={zr4:2};S.ev.tariff=S.day+20");const cash2=ev('S.cash');
|
||||
ev("for(let i=0;i<5;i++)ACT.addCh({id:'fiber',o:'zr4'})");assert.equal(cash2-ev('S.cash'),expected);
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
test('unaffordable batches, port limits and invalid input never partially change state',()=>{
|
||||
const {ev,dom}=load();try{setup(ev);ev('S.cash=1');
|
||||
ev("ACT.setChCount({id:'fiber',o:'zr4',n:5})");assert.equal(count(ev),0);assert.equal(ev('S.cash'),1);
|
||||
ev('S.cash=1e9;S.pops.ams.routers=1');const max=ev("Math.floor(portsMax('ams')-portsUsed('ams'))");
|
||||
ev(`ACT.setChCount({id:'fiber',o:'zr4',n:${max+1}})`);assert.equal(count(ev),0);assert.equal(ev('S.cash'),1e9);
|
||||
ev('S.pops.ams.routers=16');
|
||||
for(const n of ['NaN','Infinity','-1','1.5','65',"'3'"]){ev(`ACT.setChCount({id:'fiber',o:'zr4',n:${n}})`);assert.equal(count(ev),0);}
|
||||
ev("ACT.setChCount({id:'missing',o:'zr4',n:2});ACT.setChCount({id:'fiber',o:'missing',n:2})");assert.equal(ev('S.cash'),1e9);
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
test('channel reservations and reach, line-system, level and router compatibility still apply',()=>{
|
||||
const {ev,dom}=load();try{setup(ev);
|
||||
ev("S.links[0].ch=Array(63).fill('zr8');ACT.setChCount({id:'fiber',o:'zr4',n:2})");assert.equal(count(ev),63);
|
||||
setup(ev);ev("S.biz.push({type:'wwave',link:'fiber',slots:63});ACT.setChCount({id:'fiber',o:'zr4',n:2})");assert.equal(count(ev),0);
|
||||
setup(ev);ev("S.links[0].km=20000;ACT.setChCount({id:'fiber',o:'zr4',n:2})");assert.equal(count(ev),0);
|
||||
setup(ev);ev("S.links[0].sys='lite';ACT.setChCount({id:'fiber',o:'tp16',n:2})");assert.equal(count(ev),0);
|
||||
setup(ev);ev("S.lvl=1;S.done={};ACT.setChCount({id:'fiber',o:'tp16',n:2})");assert.equal(count(ev),0);
|
||||
setup(ev);ev("S.pops.ams.rgen=0;ACT.setChCount({id:'fiber',o:'tp32',n:2})");assert.equal(count(ev),0);
|
||||
setup(ev);ev("S.links[0].ch=['zr4','zr8','zr4'];ACT.setChCount({id:'fiber',o:'zr4',n:0})");assert.equal(ev("JSON.stringify(S.links[0].ch)"),'["zr8"]');
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
test('plus and minus buttons work alongside typed counts',()=>{
|
||||
const {ev,dom,errors}=load();try{setup(ev);const doc=dom.window.document;
|
||||
const plus=()=>[...doc.querySelectorAll('[data-act="addCh"]')].find(b=>JSON.parse(b.dataset.args).o==='zr4');
|
||||
const minus=()=>[...doc.querySelectorAll('[data-act="rmCh"]')].find(b=>JSON.parse(b.dataset.args).o==='zr4');
|
||||
const input=()=>doc.querySelector('form.optic-count[data-optic="zr4"] input');
|
||||
plus().click();assert.equal(count(ev),1);assert.equal(input().value,'1');
|
||||
input().value='4';input().dispatchEvent(new dom.window.Event('input',{bubbles:true}));
|
||||
input().form.dispatchEvent(new dom.window.Event('submit',{bubbles:true,cancelable:true}));
|
||||
assert.equal(count(ev),4);minus().click();assert.equal(count(ev),3);assert.equal(input().value,'3');
|
||||
plus().click();assert.equal(count(ev),4);assert.equal(input().value,'4');assert.deepEqual(errors,[]);
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
|
||||
test('draft counts and quotes stay together when reopening a panel or using shortcuts',()=>{
|
||||
const {ev,dom}=load();try{setup(ev);const doc=dom.window.document;
|
||||
const field=()=>doc.querySelector('form.optic-count[data-optic="zr4"] input');
|
||||
field().value='5';field().dispatchEvent(new dom.window.Event('input',{bubbles:true}));
|
||||
ev("UI.sel=null;renderPanel();$('panelBody').innerHTML='';UI.sel={type:'link',id:'fiber'};renderPanel()");
|
||||
assert.equal(field().value,'5');
|
||||
ev("ACT.addCh({id:'fiber',o:'zr4'});ACT.rmCh({id:'fiber',o:'zr4'})");
|
||||
assert.equal(field().value,'0');assert.ok(field().form.querySelector('button').textContent.includes(ev('fmt$(0)')));
|
||||
field().value='';field().dispatchEvent(new dom.window.Event('input',{bubbles:true}));ev('S.day++;renderPanel()');
|
||||
assert.equal(field().value,'','empty in-progress entry survives a tick');
|
||||
}finally{dom.window.close();}
|
||||
});
|
||||
155
tests/pni-all.test.js
Normal file
155
tests/pni-all.test.js
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
function setup(ev, cities = []) {
|
||||
ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0");
|
||||
for (const city of cities) ev(`ACT.buildPop({city:'${city}'})`);
|
||||
ev('for(const p of Object.values(S.pops))p.rgen=RG.length-1;compute()');
|
||||
}
|
||||
|
||||
test('bulk PNIs add missing shared POPs and upgrade smaller ports once, preserving existing orders and LAGs', () => {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev, ['ams', 'lon', 'par', 'nyc', 'sjc', 'sao']);
|
||||
ev(`S.pni.push(
|
||||
{id:'small',net:'drz',city:'fra',tier:0,n:2,site:'ab',pref:'high'},
|
||||
{id:'big',net:'drz',city:'ams',tier:2},
|
||||
{id:'equal',net:'drz',city:'lon',tier:1},
|
||||
{id:'pending',net:'drz',city:'par',tier:0,ready:S.day+20},
|
||||
{id:'augment',net:'drz',city:'nyc',tier:0,up:{tier:1,n:1,ready:S.day+20}});compute()`);
|
||||
const before = ev('JSON.stringify(S)');
|
||||
assert.deepEqual(JSON.parse(ev("JSON.stringify((b=>({shared:b.shared.length,orders:b.orders.length,kept:b.kept,cost:b.cost,mo:b.mo}))(pniBatch('drz',1)))")),
|
||||
{ shared: 6, orders: 2, kept: 4, cost: 6750, mo: 650 });
|
||||
assert.equal(ev('JSON.stringify(S)'), before, 'preview does not change the save');
|
||||
const cash = ev('S.cash');
|
||||
const existing = JSON.parse(ev("JSON.stringify(S.pni.filter(p=>p.id!=='small'))"));
|
||||
ev("const originalAfter=after;window.after=()=>{window.afterCount=(window.afterCount||0)+1;originalAfter()};ACT.pniAll({net:'drz',tier:1})");
|
||||
assert.equal(ev('window.afterCount'), 1, 'one recompute/render/save for the whole batch');
|
||||
assert.equal(ev('S.cash'), cash - 6750);
|
||||
assert.equal(ev('S.pni.length'), 6);
|
||||
assert.equal(ev("S.pni.filter(p=>p.city==='sao'||p.city==='tok').length"), 0, 'only shared owned POPs');
|
||||
assert.deepEqual(JSON.parse(ev("JSON.stringify(S.pni.filter(p=>['big','equal','pending','augment'].includes(p.id)))")), existing);
|
||||
assert.equal(ev("S.pni.find(p=>p.id==='small').up.n"), 2);
|
||||
assert.equal(ev("S.pni.find(p=>p.id==='small').site"), 'ab');
|
||||
assert.equal(ev("S.pni.find(p=>p.id==='small').pref"), 'high');
|
||||
assert.ok(ev("S.pni.find(p=>p.city==='sjc').ready>S.day"), 'new PNIs still take time');
|
||||
ev("ACT.pniAll({net:'drz',tier:1})");
|
||||
assert.equal(ev('S.cash'), cash - 6750, 'repeat clicks neither charge nor duplicate');
|
||||
assert.equal(ev('window.afterCount'), 1);
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(packSave(S))));S.day=Math.max(...S.pni.map(p=>p.up?p.up.ready:p.ready||0));pniDay(S.day);compute()');
|
||||
assert.equal(ev("S.pni.find(p=>p.id==='small').tier"), 1, 'augment survives save migration and delivers');
|
||||
assert.equal(ev("S.pni.find(p=>p.city==='sjc').tier"), 1);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('bulk PNIs skip router speed, port capacity and policy restrictions with city-specific reasons', () => {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev, ['ams', 'lon', 'ash']);
|
||||
ev(`S.pops.fra.rgen=0;S.pops.ams.rgen=1;
|
||||
S.caches=Array.from({length:portsMax('ams')},()=>({id:uid(),city:'ams',net:'cfl'}));
|
||||
while(['ams','lon'].some(c=>snub('msf',c)?.all))S.asn++;
|
||||
compute();R.demTo.msf=1e4;ACT.pniAllOpen({net:'msf'});ACT.pniAllSize({v:'2'})`);
|
||||
assert.equal(ev("pniBatch('msf',2).orders.length"), 1);
|
||||
assert.equal(ev("pniBatch('msf',2).blocked.length"), 3);
|
||||
const text = dom.window.document.getElementById('modalCard').textContent;
|
||||
assert.match(text, /Frankfurt.*router can't take a 400G/s);
|
||||
assert.match(text, /Amsterdam.*No free router ports/s);
|
||||
assert.match(text, /Ashburn.*capacity|Ashburn.*sold out/s);
|
||||
const cash = ev('S.cash');
|
||||
ev("ACT.pniAll({net:'msf',tier:2})");
|
||||
assert.equal(ev('S.pni.length'), 1);
|
||||
assert.equal(ev('S.pni[0].city'), 'lon');
|
||||
assert.equal(ev('S.cash'), cash - 3500);
|
||||
assert.match(ev("S.log[0].t"), /blocked: 3/);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('insufficient funds refuse the entire eligible batch and execution rechecks a stale preview', () => {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev, ['ams']);
|
||||
ev("S.cash=pniBatch('drz',1).cost-1;ACT.pniAllOpen({net:'drz'})");
|
||||
assert.equal(dom.window.document.querySelector('#modalCard [data-act="pniAll"]').disabled, true);
|
||||
const cash = ev('S.cash');
|
||||
ev("ACT.pniAll({net:'drz',tier:1})");
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
assert.equal(ev('S.pni.length'), 0);
|
||||
ev("S.cash=1e8;ACT.pniAllOpen({net:'drz'});delete S.pops.ams;S.pops.fra.rgen=0;ACT.pniAll({net:'drz',tier:2})");
|
||||
assert.equal(ev('S.cash'), 1e8);
|
||||
assert.equal(ev('S.pni.length'), 0, 'deleted POPs and unsupported speeds are rechecked on click');
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('bulk PNI actions reject invalid networks, sizes, minimum ports, traffic thresholds and non-shared locations', () => {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev);
|
||||
ev('S.pops.fra.rgen=0');
|
||||
const cash = ev('S.cash');
|
||||
for (const net of ['missing', '__proto__', 'drz', 'nfx']) {
|
||||
for (const tier of [-2, -1, 0.5, 99, NaN, Infinity]) ev(`ACT.pniAll({net:'${net}',tier:${tier}})`);
|
||||
}
|
||||
ev("ACT.pniAll({net:'nfx',tier:0});R.demTo.nfx=0;ACT.pniAll({net:'nfx',tier:1})");
|
||||
assert.equal(ev('S.pni.length'), 0);
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
ev("delete S.pops.fra;ACT.pniAllOpen({net:'drz'});ACT.pniAll({net:'drz',tier:1})");
|
||||
assert.match(dom.window.document.getElementById('modalCard').textContent, /no POPs in common/);
|
||||
assert.equal(dom.window.document.querySelector('#modalCard [data-act="pniAll"]').disabled, true);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('Doitsche 1G bulk orders and 10G augments keep paid-peering fees and conference delivery rules', () => {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev, ['ams']);
|
||||
ev("S.conf={until:S.day+10,reg:'EU'};Math.random=()=>0.5");
|
||||
const cash = ev('S.cash');
|
||||
assert.equal(ev("pniBatch('dtk',-1).cost"), 2400);
|
||||
assert.equal(ev("pniBatch('dtk',-1).mo"), ev('2*(PORT[0].pni/2+NET.dtk.paidFee)'));
|
||||
ev("ACT.pniAll({net:'dtk',tier:-1})");
|
||||
assert.equal(ev('S.cash'), cash - 2400);
|
||||
assert.equal(ev('S.stats.beerPni'), 1);
|
||||
assert.equal(ev('S.pni.every(p=>p.g1&&pniG(p)===1&&p.ready===S.day+15)'), true);
|
||||
ev('S.day+=15;pniDay(S.day);compute()');
|
||||
assert.equal(ev("pniBatch('dtk',0).mo"), 200, 'upgrades add port costs, without charging the peering fee twice');
|
||||
ev("ACT.pniAll({net:'dtk',tier:0});S.day=Math.max(...S.pni.map(p=>p.up.ready));pniDay(S.day)");
|
||||
assert.equal(ev('S.pni.every(p=>!p.g1&&pniG(p)===10)'), true);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('Traffic row buttons and size selection work by DOM events on phones in every language', () => {
|
||||
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
|
||||
const { dom, ev, errors } = load(lang === 'en' ? {} : { lang });
|
||||
setup(ev);
|
||||
dom.window.innerWidth = 360;
|
||||
ev("ACT.launchBB({city:'fra'});ACT.dash();ACT.dashTab({k:'traffic'})");
|
||||
const doc = dom.window.document;
|
||||
const buttons = [...doc.querySelectorAll('#dashCard [data-act="pniAllOpen"]')];
|
||||
assert.ok(buttons.length > 0, lang);
|
||||
assert.equal(buttons.some(b => JSON.parse(b.dataset.args).net === '_tail'), false);
|
||||
const cash = ev('S.cash');
|
||||
buttons.find(b => JSON.parse(b.dataset.args).net === 'cfl').click();
|
||||
assert.equal(doc.getElementById('modal').hidden, false, lang);
|
||||
let select = doc.querySelector('#modalCard select');
|
||||
assert.equal(select.closest('label').textContent.includes(ev("tr('pni_all.pni_size')")), true, lang);
|
||||
select.focus();
|
||||
select.value = '0';
|
||||
select.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
|
||||
select = doc.querySelector('#modalCard select');
|
||||
assert.equal(select.value, '0', lang);
|
||||
assert.equal(doc.activeElement, select, 'size changes preserve keyboard focus');
|
||||
const submit = doc.querySelector('#modalCard [data-act="pniAll"]');
|
||||
assert.equal(JSON.parse(submit.dataset.args).tier, 0, lang);
|
||||
assert.equal(submit.disabled, false, lang);
|
||||
assert.equal(ev('S.cash'), cash, 'opening or changing the preview spends nothing');
|
||||
submit.click();
|
||||
assert.equal(doc.getElementById('modal').hidden, true, lang);
|
||||
assert.equal(ev("S.pni.some(p=>p.net==='cfl'&&p.city==='fra'&&p.tier===0)"), true, lang);
|
||||
assert.equal(ev('S.cash'), cash - 1750, lang);
|
||||
assert.doesNotMatch(doc.getElementById('modalCard').textContent, /pni_all\./, lang);
|
||||
assert.deepEqual(errors, [], lang);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
161
tests/pni-global.test.js
Normal file
161
tests/pni-global.test.js
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
function setup(ev) {
|
||||
ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;S.pops.fra.rgen=RG.length-1;compute()");
|
||||
}
|
||||
|
||||
test('global PNIs cover every eligible network and shared POP, including the long tail, in one transaction', () => {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev);
|
||||
ev(`ACT.buildPop({city:'ams'});S.pops.ams.rgen=RG.length-1;
|
||||
S.pni.push({id:'small',net:'cfl',city:'fra',tier:0,n:2,site:'ab',pref:'high'},
|
||||
{id:'big',net:'drz',city:'ams',tier:2},
|
||||
{id:'pending',net:'nfx',city:'fra',tier:1,ready:S.day+30});
|
||||
compute();for(const n of NETS)R.demTo[n.id]=1e4`);
|
||||
const before = ev('JSON.stringify(S)');
|
||||
const batch = JSON.parse(ev('JSON.stringify(pniBatch(null,1))'));
|
||||
assert.equal(ev('JSON.stringify(S)'), before, 'global preview changes no game state');
|
||||
assert.ok(batch.orders.some(q => q.net === 'cfl' && q.city === 'fra' && q.ex));
|
||||
assert.ok(batch.orders.some(q => q.net === 'cfl' && q.city === 'ams' && !q.ex));
|
||||
assert.ok(batch.orders.some(q => ev(`NET['${q.net}'].tail`)), 'small networks are included');
|
||||
assert.equal(batch.orders.some(q => q.net === 'drz' && q.city === 'ams'), false, 'no downgrade');
|
||||
assert.equal(batch.orders.some(q => q.net === 'nfx' && q.city === 'fra'), false, 'keep pending orders');
|
||||
const cash = ev('S.cash');
|
||||
ev("const originalAfter=after;window.after=()=>{window.afterCount=(window.afterCount||0)+1;originalAfter()};ACT.pniAll({net:null,tier:1})");
|
||||
assert.equal(ev('window.afterCount'), 1);
|
||||
assert.equal(ev('S.cash'), cash - batch.cost);
|
||||
assert.equal(ev('S.pni.length'), 3 + batch.orders.filter(q => !q.ex).length);
|
||||
assert.equal(ev('new Set(S.pni.map(p=>p.net+"@"+p.city)).size'), ev('S.pni.length'));
|
||||
assert.equal(ev("S.pni.every(p=>S.pops[p.city]&&NET[p.net].pops.includes(p.city))"), true);
|
||||
assert.equal(ev("S.pni.find(p=>p.id==='small').up.n"), 2, 'LAG members stay together');
|
||||
assert.equal(ev("S.pni.find(p=>p.id==='small').pref"), 'high');
|
||||
assert.equal(ev("S.pni.find(p=>p.id==='big').tier"), 2);
|
||||
assert.equal(ev('Object.keys(S.pops).every(c=>portsUsed(c)<=portsMax(c))'), true);
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(packSave(S))));compute()');
|
||||
assert.equal(ev('S.pni.length'), 3 + batch.orders.filter(q => !q.ex).length);
|
||||
assert.equal(ev("S.pni.find(p=>p.id==='small').up.tier"), 1);
|
||||
const count = ev('S.pni.length');
|
||||
ev('ACT.pniAll({net:null,tier:1})');
|
||||
assert.equal(ev('S.cash'), cash - batch.cost, 'repeat clicks spend nothing');
|
||||
assert.equal(ev('S.pni.length'), count);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('global PNIs share the available router ports, including four 10G breakouts per slot', () => {
|
||||
for (const [tier, count] of [[1, 1], [0, 4]]) {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev);
|
||||
ev("S.pops.fra.rgen=0;S.caches=Array.from({length:7},()=>({id:uid(),city:'fra',net:'cfl'}));compute()");
|
||||
assert.equal(ev(`pniBatch(null,${tier}).orders.length`), count);
|
||||
assert.ok(ev(`pniBatch(null,${tier}).blocked.some(q=>/No free router ports/.test(q.why))`));
|
||||
ev(`ACT.pniAll({net:null,tier:${tier}})`);
|
||||
assert.equal(ev('S.pni.length'), count);
|
||||
assert.equal(ev("portsUsed('fra')"), 8);
|
||||
const cash = ev('S.cash');
|
||||
ev(`ACT.pniAll({net:null,tier:${tier}})`);
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('global planning reserves ports for pending speed and LAG augments without mutating the save', () => {
|
||||
for (const [tier, n] of [[1, 1], [0, 4]]) {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev);
|
||||
ev(`S.pops.fra.rgen=0;S.caches=Array.from({length:7},()=>({id:uid(),city:'fra',net:'cfl'}));
|
||||
S.pni=[{id:'pending',city:'fra',net:'cfl',tier:0,n:1,up:{tier:${tier},n:${n},ready:S.day+30}}];compute()`);
|
||||
const state = ev('JSON.stringify(S)');
|
||||
assert.equal(ev('pniBatch(null,0).orders.length'), 0);
|
||||
assert.equal(ev('pniBatch(null,1).orders.length'), 0);
|
||||
assert.equal(ev('JSON.stringify(S)'), state);
|
||||
const cash = ev('S.cash');
|
||||
ev('ACT.pniAll({net:null,tier:1})');
|
||||
assert.equal(ev('S.pni.length'), 1);
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('global PNIs require the full budget and reject unsupported sizes and an empty POP list', () => {
|
||||
const { dom, ev, errors } = load();
|
||||
setup(ev);
|
||||
ev('S.cash=pniBatch(null,1).cost-1;ACT.pniAllOpen({net:null})');
|
||||
const cash = ev('S.cash');
|
||||
assert.equal(dom.window.document.querySelector('#modalCard [data-act="pniAll"]').disabled, true);
|
||||
ev('ACT.pniAll({net:null,tier:1})');
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
assert.equal(ev('S.pni.length'), 0, 'no partial purchase');
|
||||
for (const tier of [-2, -1, 0.5, 99, NaN, Infinity]) ev(`ACT.pniAll({net:null,tier:${tier}})`);
|
||||
ev('ACT.pniAll({tier:1});S.pops={};ACT.pniAllOpen({net:null})');
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
assert.equal(ev('S.pni.length'), 0);
|
||||
assert.match(dom.window.document.getElementById('modalCard').textContent, /No shared POPs/);
|
||||
assert.equal(dom.window.document.querySelector('#modalCard [data-act="pniAll"]').disabled, true);
|
||||
assert.deepEqual(errors, []);
|
||||
dom.window.close();
|
||||
});
|
||||
|
||||
test('the global Traffic button preserves scope, keyboard focus and translations on phones', () => {
|
||||
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
|
||||
const { dom, ev, errors } = load(lang === 'en' ? {} : { lang });
|
||||
setup(ev);
|
||||
dom.window.innerWidth = 360;
|
||||
ev("ACT.dash();ACT.dashTab({k:'traffic'})");
|
||||
const doc = dom.window.document;
|
||||
const button = [...doc.querySelectorAll('#dashCard [data-act="pniAllOpen"]')].find(b => JSON.parse(b.dataset.args).net === null);
|
||||
assert.ok(button, lang);
|
||||
button.click();
|
||||
assert.equal(doc.querySelector('#modalCard h2').textContent, ev("tr('pni_all.peer_all_networks')"), lang);
|
||||
const cash = ev('S.cash');
|
||||
const select = doc.querySelector('#modalCard select');
|
||||
assert.equal([...select.options].some(o => o.value === '-1'), false, '1G is not available for all networks');
|
||||
select.focus();
|
||||
select.value = '0';
|
||||
select.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
|
||||
assert.equal(doc.activeElement, doc.querySelector('#modalCard select'));
|
||||
const submit = doc.querySelector('#modalCard [data-act="pniAll"]');
|
||||
assert.deepEqual(JSON.parse(submit.dataset.args), { net: null, tier: 0 }, lang);
|
||||
assert.equal(submit.disabled, false, lang);
|
||||
assert.ok(doc.querySelectorAll('#modalCard details').length > 0, 'long lists are collapsed');
|
||||
assert.equal(ev('S.cash'), cash, 'preview does not buy anything');
|
||||
assert.doesNotMatch(doc.getElementById('modalCard').textContent, /pni_all\./, lang);
|
||||
const cost = ev('pniBatch(null,0).cost');
|
||||
submit.click();
|
||||
assert.equal(doc.getElementById('modal').hidden, true, lang);
|
||||
assert.equal(ev('S.cash'), cash - cost, lang);
|
||||
assert.ok(ev('new Set(S.pni.map(p=>p.net)).size') > 1, lang);
|
||||
assert.deepEqual(errors, [], lang);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('bulk PNIs follow each network\'s own minimum port and lead time (pniMin, pniLead)', () => {
|
||||
const { ev, errors } = load();
|
||||
setup(ev);
|
||||
ev("ACT.buildPop({city:'ams'});S.pops.ams.rgen=RG.length-1;compute();for(const n of NETS)R.demTo[n.id]=1e4");
|
||||
// Ask everyone for 10G: networks that start at 100G get 100G, the rest get 10G.
|
||||
const b = JSON.parse(ev('JSON.stringify(pniBatch(null,0))'));
|
||||
const big = b.orders.filter(q => ev(`pniMin('${q.net}')`) > 0), small = b.orders.filter(q => ev(`pniMin('${q.net}')`) === 0);
|
||||
assert.ok(big.length && small.length, 'the batch has networks of both kinds');
|
||||
assert.ok(big.every(q => q.tier === ev(`pniMin('${q.net}')`)), 'never below a network\'s minimum');
|
||||
assert.ok(small.every(q => q.tier === 0));
|
||||
assert.equal(b.raised, big.length);
|
||||
assert.equal(b.blocked.some(q => /does not do/.test(q.why)), false, 'nobody is blocked for the size alone');
|
||||
// A single network still refuses a port below its minimum.
|
||||
const t1 = ev("NETS.find(n=>pniMin(n.id)>0&&n.pops.includes('fra')).id");
|
||||
const one = JSON.parse(ev(`JSON.stringify(pniBatch('${t1}',0))`));
|
||||
assert.equal(one.orders.length, 0);
|
||||
assert.ok(one.blocked.length > 0);
|
||||
// Lead times come from pniLead per network, as for a single order: big networks about a month, others 2 to 6 weeks.
|
||||
ev("const r=Math.random;Math.random=()=>0.5;ACT.pniAll({net:null,tier:0});Math.random=r");
|
||||
const placed = JSON.parse(ev('JSON.stringify(S.pni.map(p=>({net:p.net,wait:p.ready-S.day,big:pniBig(p.net)})))'));
|
||||
assert.equal(placed.length, b.orders.length);
|
||||
assert.ok(placed.some(p => p.big) && placed.some(p => !p.big));
|
||||
for (const p of placed) if (p.big) assert.equal(p.wait, 30, p.net); else assert.equal(p.wait, 14 + Math.floor(0.5 * 29), p.net);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
@ -610,7 +610,8 @@ test('Australia: hard mode start in Sydney, dear transit and waves, cheap IX por
|
|||
assert.equal(ev('S.home'), 'syd');
|
||||
assert.equal(ev("regionMult('syd')"), 3, 'transit into Australia costs more than Asia');
|
||||
assert.ok(ev("regionMult('syd')>regionMult('sin')&®ionMult('syd')<regionMult('icn')"));
|
||||
assert.equal(ev("regionMult('akl')"), 1.8, 'Auckland keeps the Oceania price');
|
||||
assert.ok(ev("regionMult('akl')") < ev('AU_TRANSIT'), 'Auckland is not priced like Australia');
|
||||
assert.equal(ev("regionMult('akl')"), ev("Math.round(1.8*txComp('akl')*10)/10"), 'Auckland pays the Oceania price, adjusted for its market');
|
||||
assert.equal(ev("waveMarket('syd','lax',true).reg"), 2.6, 'any subsea wave touching Australia');
|
||||
assert.equal(ev("waveMarket('mel','syd',false).reg"), 1.8);
|
||||
assert.ok(ev("ixPortMo('syd',1)<PORT[1].ix"), 'IX ports are the cheap exception');
|
||||
|
|
@ -1070,3 +1071,25 @@ test('city density: no small city crowds a bigger one, Brazil is slimmer than Eu
|
|||
ev('cam.x=CITY.cpv.x;cam.y=CITY.cpv.y;cam.z=6;draw(0)');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('prices follow real connectivity: thin markets cost more, hubs stay put', () => {
|
||||
const { ev, errors } = load();
|
||||
start(ev);
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(Object.keys(CITY_PDB).filter(c=>!CITY[c]))')), [], 'every entry is a city on the map');
|
||||
assert.ok(ev('Object.keys(CITY_PDB).length') >= 190, 'real-world data for most cities');
|
||||
// A city without data keeps the plain regional price.
|
||||
assert.equal(ev("(()=>{const q=CITY_PDB.fra;delete CITY_PDB.fra;const r=[txComp('fra'),colo('fra'),popMo('fra')];CITY_PDB.fra=q;return r.join()})()"), `1,1,${ev('POP_MO')}`);
|
||||
assert.equal(ev("regionMult('syd')"), ev('AU_TRANSIT'), 'Australia keeps its hand-set transit price');
|
||||
for (const c of ['fra', 'ams', 'lon', 'nyc']) assert.equal(ev(`txComp('${c}')`), 1, `${c} is a hub`);
|
||||
assert.equal(ev("regionMult('sao')"), 1.6, 'São Paulo keeps the South American price');
|
||||
assert.ok(ev("regionMult('rbr')") > ev("regionMult('sao')") * 1.5, 'Rio Branco has few sellers');
|
||||
assert.ok(ev("txComp('rbr')") <= 1.8);
|
||||
assert.equal(ev("colo('rbr')"), 1.5, 'no neutral data center');
|
||||
assert.equal(ev("popCost('rbr')"), ev('POP_COST') * 1.5);
|
||||
assert.equal(ev("popMo('fra')"), ev('POP_MO'));
|
||||
ev("ACT.buildPop({city:'rbr'});compute()");
|
||||
assert.ok(ev('R.cost.pops') >= ev("popMo('rbr')"), 'running cost uses the city rent');
|
||||
ev("selectCity('rbr')");
|
||||
assert.ok(ev("CITY_PDB.sao[2]>=2000&&CITY_PDB.nyc[2]>=2000&&CITY_PDB.kgl[2]<2000"), 'Brazil and the US are dense in ASNs, Rwanda is not');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ test('indexed routing matches the simple allocation loop across network changes'
|
|||
"S.te.script='prefer transit Cogentle\\nprepend transit Cogentle 2\\nprotect customers'",
|
||||
"S.ev.rpki={nets:['ggl','nfx'],until:S.day+3};S.ev.depeer=S.day+3",
|
||||
"S.ev.ddos={city:'fra',until:S.day+3,gbps:300,vec:'syn',entry:{k:'edge'}}",
|
||||
"S.ev.ddos.entries=[{k:'t',id:'transit0',city:'fra',share:.4},{k:'t',id:'transit4',city:'nyc',share:.6}]",
|
||||
"S.links[0].eqDown=S.day+2;S.links[1].cut=S.day+2;S.links[2].loss={until:S.day+2,f:0.5}",
|
||||
"S.links[4].chFail={until:S.day+2,o:'tp16'};S.links[6].ch.push('zr4');S.links[8].regen=2",
|
||||
"S.day+=4;S.pni.splice(0,20);S.caches.splice(0,10);S.transit[0].pref='high'",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,30 @@ function network(ev) {
|
|||
ev("const L=(a,b,t,v)=>{UI.via=v||null;openLinkModal(a,b);ACT.buildLink({tier:t});};L('fra','ams',3);L('fra','par',3);L('ams','lon',2,'uly');closeModal()");
|
||||
}
|
||||
|
||||
test('gaming offers and signed customers show their DDoS risk in Deals, city panels and customer lists', () => {
|
||||
const { ev, errors, dom } = load();
|
||||
ev("ACT.start({});S.cash=1e9;ACT.buyTransit({city:'fra',net:'cog',tier:1});S.offers=['game','cgame','host'].map(type=>({id:type,city:'fra',name:type,bw:5,rate:100,reqs:[],exp:S.day+30,type}));UI.left='deals';UI.leftOpen=true;renderLeft()");
|
||||
const notes = (root, action) => {
|
||||
const buttons = [...root.querySelectorAll(`[data-act="${action}"]`)];
|
||||
assert.equal(buttons.length, 3);
|
||||
for (const button of buttons) {
|
||||
const id = JSON.parse(button.dataset.args).id;
|
||||
const count = (button.closest('.row').textContent.match(/Gaming attracts attacks/g)||[]).length;
|
||||
assert.equal(count, id==='game'||id==='cgame'?1:0, `risk note for ${id}`);
|
||||
}
|
||||
};
|
||||
assert.equal(ev('gamingCount()'), 0, 'offers disclose future risk before signing');
|
||||
notes(dom.window.document.getElementById('leftBody'), 'accept');
|
||||
ev("selectCity('fra');ACT.tab({t:'cust'})");
|
||||
notes(dom.window.document.getElementById('panelBody'), 'accept');
|
||||
ev("for(const id of ['game','cgame','host'])ACT.accept({id});UI.tab='cust';renderPanel()");
|
||||
assert.equal(ev('gamingCount()'), 2, 'the note uses the same customer classification as the attack calculation');
|
||||
notes(dom.window.document.getElementById('panelBody'), 'dropBiz');
|
||||
ev('ACT.custOpen({})');
|
||||
notes(dom.window.document.getElementById('custSec'), 'custGo');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('event networks pay in full when the crowd is served, nothing up front', () => {
|
||||
const { ev, errors } = load();
|
||||
seed(ev, 4);
|
||||
|
|
|
|||
120
tests/utilities-caches.test.js
Normal file
120
tests/utilities-caches.test.js
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
function setup(t) {
|
||||
const h = load();
|
||||
t.after(() => h.dom.window.close());
|
||||
h.ev("ACT.start({});S.cash=1e8;UI.speed=0;for(const g of GOALS)S.done[g.id]=0;compute()");
|
||||
return h;
|
||||
}
|
||||
|
||||
test('kit balances each provider with minimal moves while buying the missing hardware', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("for(const [net,n] of [['cfl',4],['ggl',3]])for(let i=0;i<n;i++)S.caches.push({id:net+i,city:'fra',net});S.pops.ams={day:0,routers:1};S.caches.push({id:'elsewhere',city:'ams',net:'cfl',site:'b'});compute()");
|
||||
const before = ev('S.cash'), ids = ev('S.caches.map(c=>c.id).join()');
|
||||
const quote = JSON.parse(ev("JSON.stringify(utilityKit('fra'))"));
|
||||
assert.equal(quote.moves.length, 3);
|
||||
ev("ACT.utilityKit({city:'fra',cost:utilityKit('fra').cost})");
|
||||
assert.equal(ev('S.cash'), before - quote.cost);
|
||||
assert.equal(ev("S.caches.filter(c=>c.city==='fra'&&c.net==='cfl'&&c.site==='b').length"), 2);
|
||||
assert.equal(ev("S.caches.filter(c=>c.city==='fra'&&c.net==='ggl'&&c.site==='b').length"), 1);
|
||||
assert.equal(ev("S.caches.find(c=>c.id==='elsewhere').site"), 'b');
|
||||
assert.equal(ev('S.caches.map(c=>c.id).join()'), ids);
|
||||
assert.equal(ev("utilityKit('fra').moves.length"), 0);
|
||||
const stable = ev('JSON.stringify(S.caches)');
|
||||
ev("ACT.utilityKit({city:'fra',cost:0})");
|
||||
assert.equal(ev('JSON.stringify(S.caches)'), stable);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('an already equipped PoP can balance caches for free, even with negative cash', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("Object.assign(S.pops.fra,{gen:true,site2:true,routers:3});for(const [net,site] of [['cfl','a'],['ggl','b']])for(let i=0;i<4;i++)S.caches.push({id:net+i,city:'fra',net,site});S.cash=-1;compute();selectCity('fra');ACT.tab({t:'links'})");
|
||||
assert.equal(ev("utilityKit('fra').moves.length"), 4, 'overall counts match but provider counts do not');
|
||||
assert.equal(ev("document.querySelector('#panelBody [data-act=utilityKit]').disabled"), false);
|
||||
ev("document.querySelector('#panelBody [data-act=utilityKit]').click()");
|
||||
assert.equal(ev('S.cash'), -1);
|
||||
assert.equal(ev('S.pops.fra.routers'), 3);
|
||||
for (const net of ['cfl', 'ggl'])
|
||||
assert.equal(ev(`S.caches.filter(c=>c.net==='${net}'&&c.site==='b').length`), 2);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a rejected kit purchase never moves caches or partially installs hardware', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("S.caches=[{id:'c1',city:'fra',net:'cfl'},{id:'c2',city:'fra',net:'cfl'}];S.cash=1;compute()");
|
||||
const before = ev('JSON.stringify({p:S.pops.fra,c:S.caches,cash:S.cash})');
|
||||
ev("ACT.utilityKit({city:'fra',cost:utilityKit('fra').cost});ACT.utilityKit({city:'fra',cost:-1})");
|
||||
assert.equal(ev('JSON.stringify({p:S.pops.fra,c:S.caches,cash:S.cash})'), before);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('odd provider totals are balanced across the whole PoP with the fewest moves', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("Object.assign(S.pops.fra,{gen:true,site2:true,routers:2});for(const [net,n] of [['nfx',3],['cfl',1],['ggl',1]])for(let i=0;i<n;i++)S.caches.push({id:net+i,city:'fra',net});compute()");
|
||||
assert.equal(ev("utilityCacheMoves('fra').length"), 2, 'five boxes all in A require two moves');
|
||||
ev("ACT.utilityKit({city:'fra',cost:0})");
|
||||
assert.equal(ev("S.caches.filter(c=>c.site==='b').length"), 2);
|
||||
assert.equal(ev("['nfx','cfl','ggl'].every(net=>Math.abs(S.caches.filter(c=>c.net===net&&c.site==='b').length-S.caches.filter(c=>c.net===net&&c.site!=='b').length)<=1)"), true);
|
||||
assert.equal(ev("utilityCacheMoves('fra').length"), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('cache batch fills missing provider/site pairs, keeps extra boxes and respects eligibility', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("Object.assign(S.pops.fra,{site2:true,routers:2});S.caches=[{id:'keep1',city:'fra',net:'cfl'},{id:'keep2',city:'fra',net:'cfl',site:'a'}];compute();R.demTo={cfl:NET.cfl.cache.min,ggl:NET.ggl.cache.min-1}");
|
||||
const cash = ev('S.cash'), mo = ev('R.cost.caches');
|
||||
assert.equal(ev("utilityCaches('fra').add.length"), 1);
|
||||
ev("ACT.utilityCaches({city:'fra',quote:utilityCaches('fra').key})");
|
||||
assert.equal(ev('S.cash'), cash, 'cache hardware is free');
|
||||
assert.equal(ev('R.cost.caches'), mo + ev('CACHE_MO'));
|
||||
assert.equal(ev("S.caches.filter(c=>c.net==='cfl'&&c.site==='b').length"), 1);
|
||||
assert.equal(ev("S.caches.filter(c=>c.net==='cfl').length"), 3, 'extra existing A box kept');
|
||||
assert.equal(ev("S.caches.some(c=>c.net==='ggl')"), false);
|
||||
const stable = ev('JSON.stringify(S.caches)');
|
||||
ev("R.demTo={cfl:NET.cfl.cache.min};ACT.utilityCaches({city:'fra',quote:utilityCaches('fra').key})");
|
||||
assert.equal(ev('JSON.stringify(S.caches)'), stable);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('one-site requests add only A, then a new second site gets exactly its missing boxes', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("R.demTo=Object.fromEntries(NETS.filter(n=>n.cache).map(n=>[n.id,n.cache.min]));ACT.utilityCaches({city:'fra',quote:utilityCaches('fra').key})");
|
||||
assert.equal(ev('S.caches.length'), 5);
|
||||
assert.equal(ev("S.caches.every(c=>c.site==='a')"), true);
|
||||
ev("ACT.utilityKit({city:'fra',cost:utilityKit('fra').cost});R.demTo=Object.fromEntries(NETS.filter(n=>n.cache).map(n=>[n.id,n.cache.min]));ACT.utilityCaches({city:'fra',quote:utilityCaches('fra').key})");
|
||||
assert.equal(ev('S.caches.length'), 10);
|
||||
assert.equal(ev("NETS.filter(n=>n.cache).every(n=>['a','b'].every(s=>S.caches.filter(c=>c.net===n.id&&c.site===s).length===1))"), true);
|
||||
ev("save();S=migrate(JSON.parse(localStorage.getItem('sot-save-v1')));compute()");
|
||||
assert.equal(ev('S.caches.length'), 10);
|
||||
assert.equal(ev("S.caches.filter(c=>c.site==='b').length"), 5);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('cache requests reject stale eligibility and insufficient port capacity atomically', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("S.pops.fra.site2=true;for(let i=0;i<7;i++)S.caches.push({id:'full'+i,city:'fra',net:'nfx'});compute();R.demTo={cfl:NET.cfl.cache.min};window.q=utilityCaches('fra');ACT.utilities()");
|
||||
assert.equal(ev('q.free'), 1);
|
||||
assert.equal(ev('q.add.length'), 2);
|
||||
assert.equal(ev("document.querySelector('[data-act=utilityCaches]').disabled"), true);
|
||||
const before = ev('JSON.stringify(S.caches)');
|
||||
ev("ACT.utilityCaches({city:'fra',quote:q.key})");
|
||||
assert.equal(ev('JSON.stringify(S.caches)'), before);
|
||||
ev("S.pops.fra.routers=2;R.demTo.ggl=NET.ggl.cache.min;ACT.utilityCaches({city:'fra',quote:q.key,modal:true})");
|
||||
assert.equal(ev('JSON.stringify(S.caches)'), before);
|
||||
assert.match(ev("document.getElementById('modalCard').textContent"), /quote changed/);
|
||||
ev("ACT.utilityCaches({city:'not-a-city',quote:''})");
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('balanced caches keep serving when either site fails', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("Object.assign(S.pops.fra,{site2:true,routers:2,rgen:RG.length-1,bb:{d:5000}});S.caches=[{id:'one',city:'fra',net:'ggl'},{id:'two',city:'fra',net:'ggl'}];compute();ACT.utilityKit({city:'fra',cost:utilityKit('fra').cost})");
|
||||
for (const site of ['a', 'b']) {
|
||||
ev(`S.inc=[{id:'site-failure',type:'site',ref:'fra',site:'${site}',until:S.day+2}];compute()`);
|
||||
assert.ok(ev('Object.values(R.useCache).reduce((a,b)=>a+b,0)') > 0);
|
||||
assert.equal(ev(`S.caches.filter(c=>(c.site||'a')==='${site}').every(c=>!R.useCache[c.id])`), true);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
137
tests/utilities.test.js
Normal file
137
tests/utilities.test.js
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
|
||||
function setup(t, opts) {
|
||||
const h = load(opts);
|
||||
t.after(() => h.dom.window.close());
|
||||
h.ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;UI.speed=0;compute()");
|
||||
return h;
|
||||
}
|
||||
|
||||
test('redundancy kit matches normal purchases, including cash, monthly costs and save reload', t => {
|
||||
const a = setup(t), b = setup(t);
|
||||
const quote = JSON.parse(a.ev("JSON.stringify(utilityKit('fra'))"));
|
||||
const cash = a.ev('S.cash'), monthly = a.ev('R.costMo');
|
||||
a.ev("ACT.utilityKit({city:'fra',cost:utilityKit('fra').cost})");
|
||||
b.ev("ACT.addGen({city:'fra'});ACT.addSite({city:'fra'});ACT.addRouter({city:'fra'})");
|
||||
for (const expr of ['S.pops.fra', 'R.cost'])
|
||||
assert.deepEqual(JSON.parse(a.ev(`JSON.stringify(${expr})`)), JSON.parse(b.ev(`JSON.stringify(${expr})`)));
|
||||
assert.equal(a.ev('S.cash'), cash - quote.cost);
|
||||
assert.equal(a.ev('S.cash'), b.ev('S.cash'));
|
||||
assert.equal(a.ev('R.costMo'), monthly + quote.mo);
|
||||
const before = a.ev('JSON.stringify(S)');
|
||||
a.ev("ACT.utilityKit({city:'fra',cost:0})");
|
||||
assert.equal(a.ev('JSON.stringify(S)'), before, 'repeat does not buy more hardware');
|
||||
a.ev("save();S=migrate(JSON.parse(localStorage.getItem('sot-save-v1')));compute()");
|
||||
assert.equal(a.ev('S.pops.fra.gen && S.pops.fra.site2 && S.pops.fra.routers===2'), true);
|
||||
assert.deepEqual(a.errors, []);
|
||||
assert.deepEqual(b.errors, []);
|
||||
});
|
||||
|
||||
test('kit is all-or-nothing, rejects stale quotes and handles missing PoPs', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("window.quote=utilityKit('fra').cost;S.cash=quote-1");
|
||||
const before = ev('JSON.stringify(S.pops.fra)');
|
||||
ev("ACT.utilityKit({city:'fra',cost:quote})");
|
||||
assert.equal(ev('JSON.stringify(S.pops.fra)'), before);
|
||||
assert.equal(ev('S.cash'), ev('quote-1'));
|
||||
ev("S.cash=1e8;ACT.utilityKit({city:'fra',cost:quote+1,modal:true})");
|
||||
assert.equal(ev('JSON.stringify(S.pops.fra)'), before);
|
||||
assert.match(ev("document.getElementById('modalCard').textContent"), /quote changed/);
|
||||
ev("ACT.utilityKit({city:'not-a-city',cost:0});ACT.utilityKit({city:'ams',cost:0})");
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('kit buys only missing components and preserves extra routers and service placement', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("S.pops.fra.routers=4;S.pops.fra.gen=true;S.pops.fra.rgen=3;S.transit.push({id:'test',city:'fra',net:'cog',tier:0,site:'a'});compute()");
|
||||
const cash = ev('S.cash');
|
||||
assert.equal(ev("utilityKit('fra').cost"), ev('SITE2_COST'));
|
||||
ev("ACT.utilityKit({city:'fra',cost:utilityKit('fra').cost})");
|
||||
assert.equal(ev('S.cash'), cash - ev('SITE2_COST'));
|
||||
assert.equal(ev('S.pops.fra.routers'), 4);
|
||||
assert.equal(ev('S.pops.fra.rgen'), 3);
|
||||
assert.equal(ev('S.transit[0].site'), 'a');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('bulk peering covers rival IXs, respects policy and is idempotent', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("ACT.buildPop({city:'ams'});ACT.buyIx({city:'fra',tier:0,signed:true});ACT.buyIx({city:'ams',tier:0});ACT.buyIx({city:'ams~3',tier:0});ACT.rs({city:'ams'});compute()");
|
||||
const expected = JSON.parse(ev("JSON.stringify(utilityPeers().flatMap(r=>r.requests.map(id=>id+'@'+r.ix)))"));
|
||||
assert.ok(expected.length > 0);
|
||||
assert.ok(expected.some(k => k.endsWith('@ams~3')));
|
||||
const blocked = JSON.parse(ev("JSON.stringify(utilityPeers().flatMap(r=>r.blocked.map(b=>b.id+'@'+r.ix)))"));
|
||||
assert.ok(blocked.length > 0);
|
||||
const cash = ev('S.cash'), ports = ev('JSON.stringify(S.ixp)'), pnis = ev('JSON.stringify(S.pni)');
|
||||
ev('ACT.utilityPeers()');
|
||||
for (const k of expected) assert.equal(ev(`S.peers[${JSON.stringify(k)}]`), true, k);
|
||||
for (const k of blocked) assert.equal(ev(`!!S.peers[${JSON.stringify(k)}]`), false, k);
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
assert.equal(ev('JSON.stringify(S.ixp)'), ports);
|
||||
assert.equal(ev('JSON.stringify(S.pni)'), pnis);
|
||||
const peers = ev('JSON.stringify(S.peers)');
|
||||
ev('ACT.utilityPeers()');
|
||||
assert.equal(ev('JSON.stringify(S.peers)'), peers);
|
||||
assert.equal(ev('utilityPeers().reduce((n,r)=>n+r.requests.length,0)'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('bulk peering skips disconnected IXs, route server coverage and existing down sessions', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
assert.equal(ev('utilityPeers().length'), 0);
|
||||
ev("ACT.utilityPeers();ACT.buyIx({city:'fra',tier:0,signed:true});ACT.rs({city:'fra'});S.peers['ggl@fra']=true;compute()");
|
||||
assert.equal(ev("utilityPeers()[0].requests.includes('drz')"), false);
|
||||
assert.equal(ev("utilityPeers()[0].requests.includes('ggl')"), false);
|
||||
ev("ACT.cancelIx({city:'fra',sure:1,ok:1});ACT.utilityPeers()");
|
||||
assert.equal(ev('utilityPeers().length'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('utilities are available from the menu and PoP Infra in every language', t => {
|
||||
for (const lang of ['en', 'it', 'pt', 'fr', 'es']) {
|
||||
const { ev, dom, errors } = setup(t, lang === 'en' ? {} : { lang });
|
||||
ev('ACT.menu()');
|
||||
assert.ok(dom.window.document.querySelector('[data-act="utilities"]'), lang);
|
||||
ev("selectCity('fra');ACT.tab({t:'links'})");
|
||||
assert.ok(dom.window.document.querySelector('#panelBody [data-act="utilityKit"]'), lang);
|
||||
ev('ACT.utilities()');
|
||||
assert.equal(dom.window.document.querySelector('#utilityCity').value, 'fra');
|
||||
assert.ok(!dom.window.document.querySelector('#modalCard').textContent.includes('utilities.'), lang);
|
||||
assert.deepEqual(errors, [], lang);
|
||||
}
|
||||
});
|
||||
|
||||
test('join all route servers preserves existing sessions and covers rival and remote IX ports', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev("ACT.buyIx({city:'fra',tier:0,signed:true});ACT.rs({city:'fra'});window.fabric=FABS.find(f=>f.cities.includes('fra')&&f.cities.includes('ams')).id;S.links.push({id:'remote',a:'fra',b:'ams',kind:'vxc',prov:fabric,vt:1,km:kmBetween('fra','ams'),sub:false,mo:0,cut:0,day:S.day});ACT.buyIx({city:'ams',tier:0});ACT.buyIx({city:'ams~3',tier:0});compute()");
|
||||
assert.equal(ev("isRemote('ams')"), true);
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(utilityRouteServers().sort())')), ['ams', 'ams~3']);
|
||||
const cash = ev('S.cash'), ports = ev('JSON.stringify(S.ixp)'), peers = ev('JSON.stringify(S.peers)');
|
||||
ev('ACT.utilityRouteServers()');
|
||||
assert.equal(ev("S.rs.fra && S.rs.ams && S.rs['ams~3']"), true);
|
||||
assert.equal(ev("ixSessions('ams').has('drz')"), true);
|
||||
assert.equal(ev('S.cash'), cash);
|
||||
assert.equal(ev('JSON.stringify(S.ixp)'), ports);
|
||||
assert.equal(ev('JSON.stringify(S.peers)'), peers);
|
||||
const rs = ev('JSON.stringify(S.rs)');
|
||||
ev('ACT.utilityRouteServers()');
|
||||
assert.equal(ev('JSON.stringify(S.rs)'), rs, 'repeat never toggles a session off');
|
||||
assert.equal(ev('utilityRouteServers().length'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('route-server batch leaves peering policy and player-owned exchanges alone', t => {
|
||||
const { ev, errors } = setup(t);
|
||||
ev('ACT.utilityRouteServers()');
|
||||
assert.equal(ev('Object.keys(S.rs).length'), 0, 'does not join an IX without a port');
|
||||
ev("ACT.buyIx({city:'fra',tier:0,signed:true});ACT.inboxPol({p:'closed'});ACT.utilityRouteServers()");
|
||||
assert.equal(ev('ppol()'), 'closed');
|
||||
assert.equal(ev('S.rs.fra'), true);
|
||||
assert.equal(ev("ixSessions('fra').has('drz')"), false, 'does not bypass closed policy');
|
||||
assert.match(ev("document.getElementById('modalCard').textContent"), /Off while your peering policy/);
|
||||
ev("S.myIx.fra={members:[],fab:0};S.rs.fra=false;ACT.utilityRouteServers()");
|
||||
assert.equal(ev('S.rs.fra'), false, 'owned exchange has no join-route-server control');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue