Island Wi-Fi for 18 groups of outer islands, by satellite and spur cable (#83)
Each zone (Vanua Levu & Taveuni off Suva, the Out Islands off Nassau, and 16 more) is a pool of island homes at your POP in its city: no node and no link on the map, its Gbps join the city's demand. Rent backhaul at the city's teleport (about 35% sign up over GEO, 75% over MEO, 90% over Starblink from a gateway there) or, from level 3, lay a spur cable and everyone may sign up. The first order brings the island kit. Islanders pay island prices, their homes are IPv6-only in the NAT64 pool, and investors on a revenue share take their cut. A spur can be cut for weeks (failure 'wspur', chaos only): a satellite kept beside it carries the islands. Zones are off in puzzles, the Architect, scenarios and below level 2. The satellite geometry works on points now (satSeesAt, satPairAt, satKmAt; the city functions wrap them, with the same answers). Starblink serves a zone only from a gateway in its own city (16 of 18; a gateway anywhere in reach would serve the same 16), with its storm and rival rule; Nunavut and Southeast Alaska stay on GEO. Rules W6 and F12.
This commit is contained in:
parent
7967a29083
commit
6f0c080875
44 changed files with 1087 additions and 65 deletions
|
|
@ -27,6 +27,7 @@ These are what the game promises, held up by `tests/gameplay-rules.test.js` (one
|
|||
| W3 | Every city can buy transit from someone, or is a documented exception (Pitcairn: land your own cable, reach it through a pie dish, or rent a satellite circuit from a teleport; Stuttgart: peering only). | A start or an expansion must never be a dead end by accident. |
|
||||
| W4 | Cable pairs join two distinct real cities, have a length, and cable ids are unique. | Broken landings break routing and the own-cable planner. |
|
||||
| W5 | A city alone on its landmass has a cable or a beach to land one. | Islands are reachable. |
|
||||
| W6 | Every island Wi-Fi zone (`WISP`, #83) hangs off a satellite city (`satRemote`) within 1,000 km of it, seen together with it by a GEO bird; its pool is 3 to 12 G of homes; its spur is at most 1,500 km, or there is none (`km:0`); ids are sorted. | A zone is the outer islands of the city they look to, reachable from the first teleport; smaller ones never pay, and pie terminals serve them. |
|
||||
|
||||
## Networks
|
||||
|
||||
|
|
@ -75,6 +76,7 @@ These are what the game promises, held up by `tests/gameplay-rules.test.js` (one
|
|||
| F8 | In the capacity market (Lambda Bazaar), a managed wave comes out of capacity you lit yourself (your own traffic gets that much less, and the customer suffers when your optics cannot carry it), rides one channel (an 800G or 1.6T wave needs an optic that big), and is priced against its fiber: a 400G wave 2.7 times a 100G one on land and 3.8 times on subsea, each bigger size cheaper per bit. Spectrum lists at 30% of the fiber's monthly cost, and heat moves any price by at most −30% to +35%. | Selling lit capacity must cost capacity, or every fiber sells twice; the ratios are 2025 market prices (TeleGeography), so bigger waves win on volume, not on price per bit. |
|
||||
| F9 | A strict latency contract (`BIZ_T.lowlat`, #137) comes only from customer level 7, is 1.6T or 3.2T and never grows past 3.2T, has a latency limit something you can build meets (`latMaxOf`, as trading links), pays more per Gbps than any other big circuit on the same route even with all their extras, and once its 15-day grace is over credits a day's fee and loses patience faster for every day over its limit. | Real low-latency routes sell at a premium for guaranteed milliseconds and pay service credits when they miss; the cap keeps one contract from carrying a level. |
|
||||
| F10 | Growth goes sideways, plus one paid way up: a PNI bundles eight members per router at its POP, up to 32 (`pniLagMax()`); transit, exchange and fabric LAGs stay at eight (`LAG_MAX`). Giant AI circuits land at campuses (`MEGA`) in at least 30 metros, no metro more than two, picked less often where giant circuits already crowd the city. | Raising caps only moves the wall; a fatter PNI costs a router (its price and its port slots), and the late game's demand spreads over many metros as real AI and cloud campuses do (#61, #323). |
|
||||
| F12 | Island Wi-Fi (#83), on a zone's own books at full take-up in era 1 (its homes at island prices less the towers' upkeep and the backhaul rent; the teleport, tracking antennas and a Starblink gateway are shared and left out), makes money on at least one way in; a spur earns more than any satellite option, MEO at least as much as GEO and LEO at least as much as MEO where both reach; spurs up to 250 km pay back within 5 years against the best GEO or MEO stage, up to 1,000 km within 10. | The ladder (GEO, then MEO or LEO, then your own cable) must be worth climbing, and its first rung must not lose money; the longest spurs are a choice, not a given. |
|
||||
|
||||
## DDoS
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
- Island Wi-Fi: bring the internet to 18 groups of outer islands, over satellite capacity first and your own spur cable later (#83). Each group looks to an island city, like Vanua Levu to Suva or the Out Islands to Nassau: open a POP there and its Customers tab lists them. Rent capacity at the city's teleport and about a third of the islanders sign up over GEO, three quarters over MEO and nine in ten over Starblink from a gateway there; from level 3 a spur cable from the city lets everyone sign up and needs no rent. Islanders pay island prices, their homes are IPv6-only from day one, and their traffic rides the city's routers and links. A spur can be cut and the repair ship takes weeks: a satellite circuit kept beside it carries the islands meanwhile. Investors on a revenue share take their cut of what the islands pay.
|
||||
- Rent low-orbit satellite capacity from Starblink from level 5: islands near your fiber get circuits at about 30 ms round trip (#83). Host a Starblink gateway at a teleport on your fiber, then rent 5 to 50 Gbps to small islands and remote towns within 1,200 km of it. Users hardly notice the lag, and selective networks peer over it as over a cable; next to a cable it waits on standby, and a GEO or MEO circuit to the same island waits on standby beside it. Every island behind a gateway leans on that POP's routers and fiber, which its teleport section now shows, and a rare solar storm puts the circuits in safe mode for a day or two. Once your own constellation carries traffic, Starblink sells you nothing new.
|
||||
- A POP you mark as a micro POP, medium POP or regional hub now keeps that kind's routers when you also have a build standard (#315). Its router model and count come from its kind: "Bring everything up now" and your intern no longer swap its routers or add more to meet the build standard, while the standard's other targets still apply there. The POP's router section says so.
|
||||
- Send to another device now gives a multiplayer network its session link, on copies of the game you host yourself (#263). The link carries on with the network in the session on the other device, and pasting it under From another device opens it there too; the save file stays a copy that plays on alone.
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ build stays the static page described above.
|
|||
| `src/game/60-features/34-ipv6-only.js`, `src/game/90-actions/55-ipv6-only.js` | IPv6-only broadband: a city's home routers swapped for 464XLAT, and the NAT64 pool next to CGNAT; the build standard's `v6` row rolls it out (`ip6Todo()`, `ip6Owed()`) |
|
||||
| `src/game/80-simulation/65-express.js`, `src/game/90-actions/87-express.js`, `src/game/93-ui/72-express.js`, `src/game/96-map/51-express-geometry.js` | Express lightpaths (#58): a link of kind `xp` from A to C over a chain of ROADM fibers, passing the cities between as light; its rules, actions, panels, the link window's Express tab, and how the map draws it |
|
||||
| `src/game/10-catalog/75-satellites.js`, `src/game/60-features/45-teleports.js`, `src/game/90-actions/87-teleports.js`, `src/game/93-ui/72-teleport-panels.js` | Satellites (#83): teleports at POPs (`p.tele`) and rented GEO and MEO circuits (links of kind `sat`): the birds and their reach, the rules and money, the actions and the panels |
|
||||
| `src/game/10-catalog/76-wisp-zones.js`, `src/game/60-features/46-wisp-zones.js`, `src/game/90-actions/87-wisp-zones.js`, `src/game/93-ui/73-wisp-panels.js` | Island Wi-Fi (#83): zones of outer islands (`WISP`), each a pool of homes at its city's POP (`p.wisp`) whose Gbps join the city's demand; their backhaul from the city's teleport (GEO, MEO, Starblink LEO) or a spur cable, the spur cut (incident `wspur`), the money, the actions and the panels |
|
||||
| `src/game/60-features/89-multiplayer.js`, `src/game/95-modals/48-multiplayer.js`, `src/game/90-actions/92-multiplayer.js`, `src/styles/41-multiplayer.css` | Multiplayer, only in a copy built with `MP_API` ([MULTIPLAYER.md](MULTIPLAYER.md)): `S.mp`, saves and cards sent to the session server, the `#mp=` link; the title screen's door, the session panel and the HUD chip; `srvOn()`, false until server-run play is switched on |
|
||||
| `src/game/98-server-play/`, `src/styles/43-server-play.css` | The page's side of server-run play (T4), only in a multiplayer build's page; a comment so far ([plans/server-run.md](plans/server-run.md)) |
|
||||
| `scripts/mp-server.js`, `scripts/lib/mp.js` | The multiplayer session server: the command line and the built site, and the API with its storage. `npm run dev -- --mp` mounts the API in the development server |
|
||||
|
|
|
|||
|
|
@ -151,7 +151,15 @@ Asked on 2026-11-09, not answered yet:
|
|||
- **Express fiber (#58):** a whole fiber pair does not splice through a city (every fiber end is a POP; expresses
|
||||
cover the need; open question 5). Of a fiber's own incidents only the dirty connector dims its expresses; MTU,
|
||||
microbursts and a marginal optic stay with its routers and optics.
|
||||
- **Satellites (#83):** no WISP zones and no rented LEO tier (open question 6); the rented GEO and MEO circuits never
|
||||
- **Island Wi-Fi (#83):** a zone's traffic enters at its own city's POP, so Starblink serves it only from a gateway in
|
||||
that city (16 of the 18 zones; a gateway anywhere in reach would serve the same 16): Nunavut and Southeast Alaska lie
|
||||
beyond the 56° shell and MEO's ring, so they stay on GEO (Southeast Alaska keeps its spur). One circuit, one move
|
||||
and one spur per zone; a standby satellite pays full rent; no standing order for island backhaul, no zones on the
|
||||
map or the multiplayer card, no rain fade. The spurs follow real domestic cables: Tahiti to the Tuamotus and
|
||||
Marquesas (Natitua), Tonga's domestic cable (cut by the Hunga Tonga eruption in 2022), Papua New Guinea's Kumul,
|
||||
the Solomons' and the Maldives' domestic networks, the Bahamas' and Cape Verde's inter-island cables, and Southeast
|
||||
Alaska's.
|
||||
- **Satellites (#83):** the rented GEO and MEO circuits never
|
||||
fail (no rain fade or sun outage; Pie in the Sky has its own); no island volcano or Caribbean and Pacific hurricane
|
||||
events; no "Island Hopper" scenario; no footprints on the map; no satellite tab in the drag-to-link window (ordering
|
||||
is from the city panel; the no-cable hint offers a teleport's order sheet only for the city it names); selective
|
||||
|
|
|
|||
|
|
@ -193,6 +193,11 @@ const SEND = [
|
|||
'utilityKitNew',
|
||||
'utilityPeers',
|
||||
'utilityRouteServers',
|
||||
'wispRm',
|
||||
'wispSat',
|
||||
'wispSatRm',
|
||||
'wispSatSize',
|
||||
'wispSpur',
|
||||
'xpBuild',
|
||||
'xpCh',
|
||||
];
|
||||
|
|
@ -367,6 +372,7 @@ const LOCAL = [
|
|||
'via',
|
||||
'vpSet',
|
||||
'whatsNewShow',
|
||||
'wispOpen',
|
||||
'wsShare',
|
||||
'xfer',
|
||||
'xferFile',
|
||||
|
|
@ -433,6 +439,8 @@ const CONFIRM = {
|
|||
salesFire: 'salesFire',
|
||||
teleLeoRm: 'leo:{city}',
|
||||
teleRm: 'tele:{city}',
|
||||
wispRm: 'wz:{z}',
|
||||
wispSatRm: 'wsat:{z}',
|
||||
};
|
||||
// The UI.confirm key a preset act's first click writes (null for 'arg' acts and acts that do not confirm).
|
||||
const SRV_ARM = Object.fromEntries(Object.entries(CONFIRM).filter(([, v]) => v !== 'arg'));
|
||||
|
|
|
|||
|
|
@ -5261,6 +5261,58 @@
|
|||
"utilities.title":"Werkzeuge",
|
||||
"utilities.two_routers":"Mindestens zwei Router",
|
||||
"utilities.view_pop":"POP ansehen",
|
||||
"wisp.backhaul":"Backhaul",
|
||||
"wisp.close":"Insel-WLAN schließen",
|
||||
"wisp.closed":"Das Insel-WLAN auf {zone} ist geschlossen.",
|
||||
"wisp.costs_row":"Insel-WLAN: Masten und Stichkabel",
|
||||
"wisp.cut_anchor":"Ein Schiffsanker hat das Stichkabel nach {zone} vor {city} durchgerissen.",
|
||||
"wisp.cut_dark":"Sonst erreicht nichts die Inseln: Sie sind offline, bis es geflickt ist.",
|
||||
"wisp.cut_sat":"Der Satellitenlink trägt die Inseln so lange.",
|
||||
"wisp.cut_slide":"Ein Unterwasser-Erdrutsch hat das Stichkabel nach {zone} zerrissen.",
|
||||
"wisp.cut_trawler":"Ein Fischtrawler hat sich im Stichkabel nach {zone} verfangen.",
|
||||
"wisp.cut_volcano":"Ein Unterwasservulkan ist direkt auf dem Stichkabel nach {zone} ausgebrochen.",
|
||||
"wisp.decom":"Das Insel-WLAN schließt mit: {list}.",
|
||||
"wisp.double_hop":"Doppelter Hop: {city} erreicht die Welt nur per Satellit, der Traffic der Inseln ginge also zweimal nach oben. Bring {city} zuerst ein Kabel.",
|
||||
"wisp.full":"Der Link ist voll: Haushalte warten.",
|
||||
"wisp.homes_online":"Haushalte online",
|
||||
"wisp.inc_title":"Stichkabel gekappt",
|
||||
"wisp.ipv6":"Seine Haushalte sind vom ersten Tag an IPv6-only (464XLAT): Ihr IPv4 teilt sich den NAT64-Pool, die Inseln brauchen also nie einen eigenen Block.",
|
||||
"wisp.kit":"Mit der ersten Bestellung kommt auch das Insel-Kit: Masten, Solarpanels und Heimfunkgeräte, {cost}.",
|
||||
"wisp.lay_spur":"Stichkabel verlegen {cost}",
|
||||
"wisp.lead":"Zu den Haushalten dieser Inseln führt kein Kabel, also kannst du ihr Internet sein: zuerst Satellitenkapazität von einem Teleport hier, später ein Stichkabel. Inselbewohner zahlen Inselpreise: {rate} pro Gbps im Monat.",
|
||||
"wisp.move_note":"Bestell auf einem anderen Satelliten, um die Inseln dorthin umzuziehen: Der alte Link trägt, bis der neue steht.",
|
||||
"wisp.moved":"{zone} läuft jetzt über {bird}.",
|
||||
"wisp.moving":{"one":"{cap} auf {bird} für {zone} bestellt: Die Inseln ziehen in {n} Tag um.","other":"{cap} auf {bird} für {zone} bestellt: Die Inseln ziehen in {n} Tagen um."},
|
||||
"wisp.n_zones":{"one":"{n} Inselzone","other":"{n} Inselzonen"},
|
||||
"wisp.no_pop":"Eröffne hier einen POP, um den Inseln ringsum WLAN zu bringen: {list}.",
|
||||
"wisp.no_teleport":"Satellitenkapazität für die Inseln kommt an einem Teleport in {city} herunter. Bau dort zuerst einen.",
|
||||
"wisp.online":"{zone} ist online: Die ersten Inselbewohner melden sich an.",
|
||||
"wisp.ordered":{"one":"{cap} auf {bird} für {zone} bestellt: Die Inselbewohner gehen in {n} Tag online.","other":"{cap} auf {bird} für {zone} bestellt: Die Inselbewohner gehen in {n} Tagen online."},
|
||||
"wisp.pool":"{g} an Haushalten",
|
||||
"wisp.rush":"Reparaturschiff chartern",
|
||||
"wisp.section":"Insel-WLAN",
|
||||
"wisp.served":"Versorgt auf den Inseln",
|
||||
"wisp.spur":"Stichkabel",
|
||||
"wisp.spur_cut":{"one":"Gekappt: Das Reparaturschiff ist {n} Tag entfernt.","other":"Gekappt: Das Reparaturschiff ist {n} Tage entfernt."},
|
||||
"wisp.spur_laying":"Kabelschiff verlegt das Stichkabel",
|
||||
"wisp.spur_lead":"{km} km Kabel ohne Repeater ab {city}. Das meiste haben Entwicklungsbanken bezahlt; das ist dein Anteil. Sobald es leuchtet, kann sich jeder auf den Inseln anmelden, und nichts ist gemietet.",
|
||||
"wisp.spur_level":"Stichkabel gibt es ab Level {lv}.",
|
||||
"wisp.spur_lit":"Stichkabel in Betrieb, {cap}",
|
||||
"wisp.spur_none":"Zu weit oder zu viel Meereis für ein Stichkabel: Diese Inseln bleiben bei Satelliten.",
|
||||
"wisp.spur_ordered":{"one":"Ein Kabelschiff läuft aus, um das Stichkabel nach {zone} zu verlegen: in Betrieb in {n} Tag.","other":"Ein Kabelschiff läuft aus, um das Stichkabel nach {zone} zu verlegen: in Betrieb in {n} Tagen."},
|
||||
"wisp.spur_ready":"Das Stichkabel nach {zone} ist in Betrieb: Jetzt kann sich jeder auf den Inseln anmelden.",
|
||||
"wisp.spur_trap":"Ein Kabel ist ein Single Point of Failure: Wird es gekappt, braucht das Reparaturschiff Wochen. Ein Satellitenlink im Standby trägt die Inseln so lange.",
|
||||
"wisp.st_cut":"Gekappt",
|
||||
"wisp.st_none":"Noch kein Link",
|
||||
"wisp.st_soon":"Kommt bald",
|
||||
"wisp.st_spur":"Kabel",
|
||||
"wisp.take":"Die Inselbewohner melden sich an, so weit der Link es zulässt: etwa {geo} über GEO, {meo} über MEO, {leo} über LEO, alle über ein Kabel.",
|
||||
"wisp.tele_reaches":"Insel-WLAN von diesem Teleport:",
|
||||
"wisp.upkeep":"Masten, Solar und Crews",
|
||||
"wisp.why_moving":"Ein Umzug auf einen anderen Satelliten läuft schon.",
|
||||
"wisp.why_no_pop":"Eröffne zuerst einen POP in {city}: Die Crews und die Lizenz der Inseln arbeiten von dort.",
|
||||
"wisp.why_same":"Die Inseln laufen schon über {bird}: Ändere lieber die Größe dieses Links.",
|
||||
"wisp.why_spur_have":"Das Stichkabel liegt schon.",
|
||||
"wkscn.copy_my_result":"Mein Ergebnis kopieren",
|
||||
"wkscn.desc_a_g_event_comes_to":"An Tag {day} kommt ein Event mit {g} nach {city}. Bau das Netz dafür, aus dem Nichts.",
|
||||
"wkscn.desc_a_ship_dragged_its_anchor":"Ein Schiff hat seinen Anker über {cab} geschleift. Finde einen anderen Weg von {a} nach {b}.",
|
||||
|
|
|
|||
|
|
@ -5259,6 +5259,58 @@
|
|||
"utilities.title":"Utilidades",
|
||||
"utilities.two_routers":"Al menos dos routers",
|
||||
"utilities.view_pop":"Ver POP",
|
||||
"wisp.backhaul":"Backhaul",
|
||||
"wisp.close":"Cerrar el Wi-Fi isleño",
|
||||
"wisp.closed":"El Wi-Fi isleño de {zone} está cerrado.",
|
||||
"wisp.costs_row":"Wi-Fi isleño: torres y ramales",
|
||||
"wisp.cut_anchor":"El ancla de un barco arrastró el ramal de {zone} frente a {city}.",
|
||||
"wisp.cut_dark":"Nada más llega a las islas: están sin conexión hasta que lo reparen.",
|
||||
"wisp.cut_sat":"Mientras tanto, el circuito por satélite lleva a las islas.",
|
||||
"wisp.cut_slide":"Un deslizamiento submarino partió el ramal de {zone}.",
|
||||
"wisp.cut_trawler":"Un arrastrero enganchó el ramal de {zone}.",
|
||||
"wisp.cut_volcano":"Un volcán submarino entró en erupción justo encima del ramal de {zone}.",
|
||||
"wisp.decom":"El Wi-Fi isleño cierra con él: {list}.",
|
||||
"wisp.double_hop":"Doble salto: {city} solo llega al mundo por satélite, así que el tráfico de las islas subiría dos veces. Primero lleva un cable a {city}.",
|
||||
"wisp.full":"El enlace está lleno: hay hogares esperando.",
|
||||
"wisp.homes_online":"Hogares conectados",
|
||||
"wisp.inc_title":"Ramal cortado",
|
||||
"wisp.ipv6":"Sus hogares son solo IPv6 (464XLAT) desde el primer día: su IPv4 comparte el pool NAT64, así que las islas nunca necesitan un bloque propio.",
|
||||
"wisp.kit":"El primer pedido trae también el kit isleño: torres, paneles solares y radios para los hogares, {cost}.",
|
||||
"wisp.lay_spur":"Tender el ramal {cost}",
|
||||
"wisp.lead":"Ningún cable llega a los hogares de estas islas, así que puedes ser su internet: primero capacidad por satélite desde un teleport aquí, más tarde un cable ramal. Los isleños pagan precios de isla: {rate} por Gbps al mes.",
|
||||
"wisp.move_note":"Pide en otro satélite para mudar allí las islas: el circuito viejo las lleva hasta que el nuevo esté listo.",
|
||||
"wisp.moved":"{zone} ahora va por {bird}.",
|
||||
"wisp.moving":{"one":"{cap} en {bird} pedido para {zone}: las islas se mudan en {n} día.","other":"{cap} en {bird} pedido para {zone}: las islas se mudan en {n} días."},
|
||||
"wisp.n_zones":{"one":"{n} zona isleña","other":"{n} zonas isleñas"},
|
||||
"wisp.no_pop":"Abre un POP aquí para llevar Wi-Fi a las islas de alrededor: {list}.",
|
||||
"wisp.no_teleport":"La capacidad por satélite para las islas baja en un teleport en {city}. Primero construye uno allí.",
|
||||
"wisp.online":"{zone} está en línea: los primeros isleños se están dando de alta.",
|
||||
"wisp.ordered":{"one":"{cap} en {bird} pedido para {zone}: los isleños se conectan en {n} día.","other":"{cap} en {bird} pedido para {zone}: los isleños se conectan en {n} días."},
|
||||
"wisp.pool":"{g} de hogares",
|
||||
"wisp.rush":"Fletar un barco de reparación",
|
||||
"wisp.section":"Wi-Fi isleño",
|
||||
"wisp.served":"Servido en las islas",
|
||||
"wisp.spur":"Cable ramal",
|
||||
"wisp.spur_cut":{"one":"Cortado: el barco de reparación está a {n} día.","other":"Cortado: el barco de reparación está a {n} días."},
|
||||
"wisp.spur_laying":"Un barco cablero tiende el ramal",
|
||||
"wisp.spur_lead":"{km} km de cable sin repetidores desde {city}. Los bancos de desarrollo pagaron la mayor parte; esta es tu parte. Cuando esté encendido, todos en las islas pueden darse de alta y no se alquila nada.",
|
||||
"wisp.spur_level":"Los ramales llegan en el nivel {lv}.",
|
||||
"wisp.spur_lit":"Ramal encendido, {cap}",
|
||||
"wisp.spur_none":"Demasiado lejos, o demasiado hielo marino, para un ramal: estas islas siguen con satélites.",
|
||||
"wisp.spur_ordered":{"one":"Un barco cablero zarpa a tender el ramal de {zone}: encendido en {n} día.","other":"Un barco cablero zarpa a tender el ramal de {zone}: encendido en {n} días."},
|
||||
"wisp.spur_ready":"El ramal de {zone} está encendido: ya pueden darse de alta todos en las islas.",
|
||||
"wisp.spur_trap":"Un solo cable es un único punto de fallo: cuando lo cortan, el barco de reparación tarda semanas. Un circuito por satélite en reserva lleva a las islas mientras tanto.",
|
||||
"wisp.st_cut":"Ramal cortado",
|
||||
"wisp.st_none":"Sin enlace aún",
|
||||
"wisp.st_soon":"En camino",
|
||||
"wisp.st_spur":"Ramal",
|
||||
"wisp.take":"Los isleños se dan de alta hasta donde el enlace les deja: cerca del {geo} por GEO, del {meo} por MEO, del {leo} por LEO, y todos por cable.",
|
||||
"wisp.tele_reaches":"Wi-Fi isleño desde este teleport:",
|
||||
"wisp.upkeep":"Torres, solar y cuadrillas",
|
||||
"wisp.why_moving":"Ya hay una mudanza a otro satélite en marcha.",
|
||||
"wisp.why_no_pop":"Primero abre un POP en {city}: las cuadrillas y la licencia de las islas trabajan desde allí.",
|
||||
"wisp.why_same":"Las islas ya van por {bird}: mejor cambia el tamaño de ese circuito.",
|
||||
"wisp.why_spur_have":"El ramal ya está tendido.",
|
||||
"wkscn.copy_my_result":"Copiar mi resultado",
|
||||
"wkscn.desc_a_g_event_comes_to":"El día {day} llega a {city} un evento de {g}. Construye la red que necesita, desde cero.",
|
||||
"wkscn.desc_a_ship_dragged_its_anchor":"Un barco arrastró el ancla sobre {cab}. Busca otro camino de {a} a {b}.",
|
||||
|
|
|
|||
|
|
@ -5259,6 +5259,58 @@
|
|||
"utilities.title":"Utilitaires",
|
||||
"utilities.two_routers":"Au moins deux routeurs",
|
||||
"utilities.view_pop":"Voir le POP",
|
||||
"wisp.backhaul":"Backhaul",
|
||||
"wisp.close":"Fermer le Wi-Fi des îles",
|
||||
"wisp.closed":"Le Wi-Fi des îles à {zone} est fermé.",
|
||||
"wisp.costs_row":"Wi-Fi des îles : pylônes et câbles d’antenne",
|
||||
"wisp.cut_anchor":"L’ancre d’un navire a raclé le câble de {zone} au large de {city}.",
|
||||
"wisp.cut_dark":"Rien d’autre n’atteint les îles : elles restent hors ligne jusqu’à la réparation.",
|
||||
"wisp.cut_sat":"Le circuit satellite porte les îles en attendant.",
|
||||
"wisp.cut_slide":"Un glissement de terrain sous-marin a rompu le câble de {zone}.",
|
||||
"wisp.cut_trawler":"Un chalutier a accroché le câble de {zone}.",
|
||||
"wisp.cut_volcano":"Un volcan sous-marin est entré en éruption juste sur le câble de {zone}.",
|
||||
"wisp.decom":"Le Wi-Fi des îles ferme avec : {list}.",
|
||||
"wisp.double_hop":"Double saut : {city} ne rejoint le monde que par satellite, le trafic des îles monterait donc deux fois. Amène d’abord un câble à {city}.",
|
||||
"wisp.full":"Le lien est plein : des foyers attendent.",
|
||||
"wisp.homes_online":"Foyers en ligne",
|
||||
"wisp.inc_title":"Câble coupé",
|
||||
"wisp.ipv6":"Ses foyers sont en IPv6 seul (464XLAT) dès le premier jour : leur IPv4 partage le pool NAT64, les îles n’ont donc jamais besoin d’un bloc à elles.",
|
||||
"wisp.kit":"La première commande apporte aussi le kit des îles : pylônes, panneaux solaires et radios pour les foyers, {cost}.",
|
||||
"wisp.lay_spur":"Poser le câble {cost}",
|
||||
"wisp.lead":"Aucun câble n’arrive aux foyers de ces îles, alors tu peux être leur internet : d’abord de la capacité satellite depuis un téléport ici, plus tard un câble d’antenne. Les insulaires paient des prix d’île : {rate} le Gbps par mois.",
|
||||
"wisp.move_note":"Commande sur un autre satellite pour y déménager les îles : l’ancien circuit les porte jusqu’à ce que le nouveau soit prêt.",
|
||||
"wisp.moved":"{zone} passe maintenant par {bird}.",
|
||||
"wisp.moving":{"one":"{cap} sur {bird} commandé pour {zone} : les îles déménagent dans {n} jour.","other":"{cap} sur {bird} commandé pour {zone} : les îles déménagent dans {n} jours."},
|
||||
"wisp.n_zones":{"one":"{n} zone d’îles","other":"{n} zones d’îles"},
|
||||
"wisp.no_pop":"Ouvre un POP ici pour apporter le Wi-Fi aux îles alentour : {list}.",
|
||||
"wisp.no_teleport":"La capacité satellite des îles descend à un téléport à {city}. Construis-en d’abord un là-bas.",
|
||||
"wisp.online":"{zone} est en ligne : les premiers insulaires s’abonnent.",
|
||||
"wisp.ordered":{"one":"{cap} sur {bird} commandé pour {zone} : les insulaires se connectent dans {n} jour.","other":"{cap} sur {bird} commandé pour {zone} : les insulaires se connectent dans {n} jours."},
|
||||
"wisp.pool":"{g} de foyers",
|
||||
"wisp.rush":"Affréter un navire de réparation",
|
||||
"wisp.section":"Wi-Fi des îles",
|
||||
"wisp.served":"Servi sur les îles",
|
||||
"wisp.spur":"Câble d’antenne",
|
||||
"wisp.spur_cut":{"one":"Coupé : le navire de réparation est à {n} jour.","other":"Coupé : le navire de réparation est à {n} jours."},
|
||||
"wisp.spur_laying":"Un câblier pose le câble",
|
||||
"wisp.spur_lead":"{km} km de câble sans répéteurs depuis {city}. Les banques de développement en ont payé l’essentiel ; voici ta part. Une fois allumé, tout le monde sur les îles peut s’abonner, et rien n’est loué.",
|
||||
"wisp.spur_level":"Les câbles d’antenne arrivent au niveau {lv}.",
|
||||
"wisp.spur_lit":"Câble allumé, {cap}",
|
||||
"wisp.spur_none":"Trop loin, ou trop de banquise, pour un câble : ces îles restent sur satellites.",
|
||||
"wisp.spur_ordered":{"one":"Un câblier part poser le câble de {zone} : allumé dans {n} jour.","other":"Un câblier part poser le câble de {zone} : allumé dans {n} jours."},
|
||||
"wisp.spur_ready":"Le câble de {zone} est allumé : tout le monde sur les îles peut s’abonner maintenant.",
|
||||
"wisp.spur_trap":"Un seul câble, c’est un point de défaillance unique : quand il est coupé, le navire de réparation met des semaines. Un circuit satellite gardé en réserve porte les îles en attendant.",
|
||||
"wisp.st_cut":"Câble coupé",
|
||||
"wisp.st_none":"Pas encore de lien",
|
||||
"wisp.st_soon":"Bientôt",
|
||||
"wisp.st_spur":"Câble",
|
||||
"wisp.take":"Les insulaires s’abonnent autant que le lien le permet : environ {geo} par GEO, {meo} par MEO, {leo} par LEO, et tous par câble.",
|
||||
"wisp.tele_reaches":"Wi-Fi des îles depuis ce téléport :",
|
||||
"wisp.upkeep":"Pylônes, solaire et équipes",
|
||||
"wisp.why_moving":"Un déménagement vers un autre satellite est en cours.",
|
||||
"wisp.why_no_pop":"Ouvre d’abord un POP à {city} : les équipes et la licence des îles travaillent depuis là.",
|
||||
"wisp.why_same":"Les îles passent déjà par {bird} : change plutôt la taille de ce circuit.",
|
||||
"wisp.why_spur_have":"Le câble est déjà posé.",
|
||||
"wkscn.copy_my_result":"Copier mon résultat",
|
||||
"wkscn.desc_a_g_event_comes_to":"Le jour {day}, un événement de {g} arrive à {city}. Construis le réseau qu'il lui faut, à partir de rien.",
|
||||
"wkscn.desc_a_ship_dragged_its_anchor":"Un navire a traîné son ancre sur {cab}. Trouve un autre chemin de {a} à {b}.",
|
||||
|
|
|
|||
|
|
@ -5259,6 +5259,58 @@
|
|||
"utilities.title":"Utilità",
|
||||
"utilities.two_routers":"Almeno due router",
|
||||
"utilities.view_pop":"Mostra POP",
|
||||
"wisp.backhaul":"Backhaul",
|
||||
"wisp.close":"Chiudi il Wi-Fi delle isole",
|
||||
"wisp.closed":"Il Wi-Fi delle isole su {zone} è chiuso.",
|
||||
"wisp.costs_row":"Wi-Fi delle isole: torri e cavi di diramazione",
|
||||
"wisp.cut_anchor":"L’ancora di una nave ha trascinato via il cavo di {zone} al largo di {city}.",
|
||||
"wisp.cut_dark":"Nient’altro raggiunge le isole: restano offline finché non lo riparano.",
|
||||
"wisp.cut_sat":"Nel frattempo il circuito satellitare porta le isole.",
|
||||
"wisp.cut_slide":"Una frana sottomarina ha spezzato il cavo di {zone}.",
|
||||
"wisp.cut_trawler":"Un peschereccio a strascico si è impigliato nel cavo di {zone}.",
|
||||
"wisp.cut_volcano":"Un vulcano sottomarino è eruttato proprio sopra il cavo di {zone}.",
|
||||
"wisp.decom":"Con lui chiude il Wi-Fi delle isole: {list}.",
|
||||
"wisp.double_hop":"Doppio salto: {city} raggiunge il mondo solo via satellite, quindi il traffico delle isole salirebbe due volte. Prima porta un cavo a {city}.",
|
||||
"wisp.full":"Il link è pieno: ci sono case in attesa.",
|
||||
"wisp.homes_online":"Case online",
|
||||
"wisp.inc_title":"Cavo tranciato",
|
||||
"wisp.ipv6":"Le sue case sono solo IPv6 (464XLAT) dal primo giorno: il loro IPv4 condivide il pool NAT64, quindi le isole non hanno mai bisogno di un blocco tutto loro.",
|
||||
"wisp.kit":"Il primo ordine porta anche il kit per le isole: torri, pannelli solari e radio per le case, {cost}.",
|
||||
"wisp.lay_spur":"Posa il cavo {cost}",
|
||||
"wisp.lead":"Nessun cavo arriva alle case di queste isole, quindi puoi essere tu il loro internet: prima capacità satellitare da un teleport qui, poi un cavo di diramazione. Gli isolani pagano prezzi da isola: {rate} al Gbps al mese.",
|
||||
"wisp.move_note":"Ordina su un altro satellite per spostarci le isole: il vecchio circuito le porta finché il nuovo non è pronto.",
|
||||
"wisp.moved":"{zone} ora passa da {bird}.",
|
||||
"wisp.moving":{"one":"{cap} su {bird} ordinato per {zone}: le isole si spostano tra {n} giorno.","other":"{cap} su {bird} ordinato per {zone}: le isole si spostano tra {n} giorni."},
|
||||
"wisp.n_zones":{"one":"{n} zona di isole","other":"{n} zone di isole"},
|
||||
"wisp.no_pop":"Apri un POP qui per portare il Wi-Fi alle isole intorno: {list}.",
|
||||
"wisp.no_teleport":"La capacità satellitare per le isole scende a un teleport a {city}. Prima costruiscine uno lì.",
|
||||
"wisp.online":"{zone} è online: i primi isolani si stanno abbonando.",
|
||||
"wisp.ordered":{"one":"{cap} su {bird} ordinato per {zone}: gli isolani vanno online tra {n} giorno.","other":"{cap} su {bird} ordinato per {zone}: gli isolani vanno online tra {n} giorni."},
|
||||
"wisp.pool":"{g} di case",
|
||||
"wisp.rush":"Noleggia una nave riparatrice",
|
||||
"wisp.section":"Wi-Fi delle isole",
|
||||
"wisp.served":"Servito sulle isole",
|
||||
"wisp.spur":"Cavo di diramazione",
|
||||
"wisp.spur_cut":{"one":"Tranciato: la nave riparatrice è a {n} giorno.","other":"Tranciato: la nave riparatrice è a {n} giorni."},
|
||||
"wisp.spur_laying":"Una nave posacavi sta posando il cavo",
|
||||
"wisp.spur_lead":"{km} km di cavo senza ripetitori da {city}. Le banche di sviluppo ne hanno pagato quasi tutto; questa è la tua parte. Una volta acceso, tutti sulle isole possono abbonarsi, e non si affitta niente.",
|
||||
"wisp.spur_level":"I cavi di diramazione arrivano al livello {lv}.",
|
||||
"wisp.spur_lit":"Cavo acceso, {cap}",
|
||||
"wisp.spur_none":"Troppo lontano, o troppo ghiaccio marino, per un cavo: queste isole restano sui satelliti.",
|
||||
"wisp.spur_ordered":{"one":"Una nave posacavi salpa per posare il cavo di {zone}: acceso tra {n} giorno.","other":"Una nave posacavi salpa per posare il cavo di {zone}: acceso tra {n} giorni."},
|
||||
"wisp.spur_ready":"Il cavo di {zone} è acceso: ora tutti sulle isole possono abbonarsi.",
|
||||
"wisp.spur_trap":"Un solo cavo è un unico punto di guasto: quando lo tranciano, la nave riparatrice ci mette settimane. Un circuito satellitare tenuto in standby porta le isole nel frattempo.",
|
||||
"wisp.st_cut":"Cavo tranciato",
|
||||
"wisp.st_none":"Ancora nessun link",
|
||||
"wisp.st_soon":"In arrivo",
|
||||
"wisp.st_spur":"Cavo",
|
||||
"wisp.take":"Gli isolani si abbonano fin dove il link lo permette: circa il {geo} via GEO, il {meo} via MEO, il {leo} via LEO, tutti via cavo.",
|
||||
"wisp.tele_reaches":"Wi-Fi delle isole da questo teleport:",
|
||||
"wisp.upkeep":"Torri, solare e squadre",
|
||||
"wisp.why_moving":"Uno spostamento su un altro satellite è già in corso.",
|
||||
"wisp.why_no_pop":"Prima apri un POP a {city}: le squadre e la licenza delle isole lavorano da lì.",
|
||||
"wisp.why_same":"Le isole passano già da {bird}: cambia piuttosto la taglia di quel circuito.",
|
||||
"wisp.why_spur_have":"Il cavo è già posato.",
|
||||
"wkscn.copy_my_result":"Copia il mio risultato",
|
||||
"wkscn.desc_a_g_event_comes_to":"Il giorno {day} arriva a {city} un evento da {g}. Costruisci la rete che serve, da zero.",
|
||||
"wkscn.desc_a_ship_dragged_its_anchor":"Una nave ha trascinato l'ancora su {cab}. Trova un'altra strada da {a} a {b}.",
|
||||
|
|
|
|||
|
|
@ -5259,6 +5259,58 @@
|
|||
"utilities.title":"Utilitários",
|
||||
"utilities.two_routers":"Pelo menos dois routers",
|
||||
"utilities.view_pop":"Ver POP",
|
||||
"wisp.backhaul":"Backhaul",
|
||||
"wisp.close":"Fechar o Wi-Fi das ilhas",
|
||||
"wisp.closed":"O Wi-Fi das ilhas em {zone} foi fechado.",
|
||||
"wisp.costs_row":"Wi-Fi das ilhas: torres e ramais",
|
||||
"wisp.cut_anchor":"A âncora de um navio arrastou o ramal de {zone} ao largo de {city}.",
|
||||
"wisp.cut_dark":"Nada mais chega às ilhas: elas ficam fora do ar até o conserto.",
|
||||
"wisp.cut_sat":"Enquanto isso, o circuito por satélite leva as ilhas.",
|
||||
"wisp.cut_slide":"Um deslizamento submarino partiu o ramal de {zone}.",
|
||||
"wisp.cut_trawler":"Uma traineira enganchou o ramal de {zone}.",
|
||||
"wisp.cut_volcano":"Um vulcão submarino entrou em erupção bem em cima do ramal de {zone}.",
|
||||
"wisp.decom":"O Wi-Fi das ilhas fecha junto: {list}.",
|
||||
"wisp.double_hop":"Salto duplo: {city} só chega ao mundo por satélite, então o tráfego das ilhas subiria duas vezes. Leve primeiro um cabo até {city}.",
|
||||
"wisp.full":"O link está cheio: há casas esperando.",
|
||||
"wisp.homes_online":"Casas conectadas",
|
||||
"wisp.inc_title":"Ramal cortado",
|
||||
"wisp.ipv6":"As casas são só IPv6 (464XLAT) desde o primeiro dia: o IPv4 delas divide o pool NAT64, então as ilhas nunca precisam de um bloco próprio.",
|
||||
"wisp.kit":"O primeiro pedido traz também o kit das ilhas: torres, painéis solares e rádios para as casas, {cost}.",
|
||||
"wisp.lay_spur":"Lançar o ramal {cost}",
|
||||
"wisp.lead":"Nenhum cabo chega às casas destas ilhas, então você pode ser a internet delas: primeiro capacidade por satélite de um teleporto aqui, depois um cabo ramal. Os ilhéus pagam preços de ilha: {rate} por Gbps ao mês.",
|
||||
"wisp.move_note":"Peça em outro satélite para mudar as ilhas para lá: o circuito antigo leva até o novo ficar pronto.",
|
||||
"wisp.moved":"{zone} agora vai por {bird}.",
|
||||
"wisp.moving":{"one":"{cap} no {bird} pedido para {zone}: as ilhas mudam em {n} dia.","other":"{cap} no {bird} pedido para {zone}: as ilhas mudam em {n} dias."},
|
||||
"wisp.n_zones":{"one":"{n} zona de ilhas","other":"{n} zonas de ilhas"},
|
||||
"wisp.no_pop":"Abra um POP aqui para levar Wi-Fi às ilhas em volta: {list}.",
|
||||
"wisp.no_teleport":"A capacidade por satélite para as ilhas desce num teleporto em {city}. Construa um lá primeiro.",
|
||||
"wisp.online":"{zone} está no ar: os primeiros ilhéus estão assinando.",
|
||||
"wisp.ordered":{"one":"{cap} no {bird} pedido para {zone}: os ilhéus ficam on-line em {n} dia.","other":"{cap} no {bird} pedido para {zone}: os ilhéus ficam on-line em {n} dias."},
|
||||
"wisp.pool":"{g} de casas",
|
||||
"wisp.rush":"Fretar um navio de reparo",
|
||||
"wisp.section":"Wi-Fi das ilhas",
|
||||
"wisp.served":"Servido nas ilhas",
|
||||
"wisp.spur":"Cabo ramal",
|
||||
"wisp.spur_cut":{"one":"Cortado: o navio de reparo está a {n} dia.","other":"Cortado: o navio de reparo está a {n} dias."},
|
||||
"wisp.spur_laying":"Navio cabeiro lançando o ramal",
|
||||
"wisp.spur_lead":"{km} km de cabo sem repetidores desde {city}. Os bancos de desenvolvimento pagaram a maior parte; esta é a sua parte. Quando estiver aceso, todos nas ilhas podem assinar, e nada é alugado.",
|
||||
"wisp.spur_level":"Os ramais chegam no nível {lv}.",
|
||||
"wisp.spur_lit":"Ramal aceso, {cap}",
|
||||
"wisp.spur_none":"Longe demais, ou gelo marinho demais, para um ramal: estas ilhas ficam nos satélites.",
|
||||
"wisp.spur_ordered":{"one":"Um navio cabeiro zarpa para lançar o ramal de {zone}: aceso em {n} dia.","other":"Um navio cabeiro zarpa para lançar o ramal de {zone}: aceso em {n} dias."},
|
||||
"wisp.spur_ready":"O ramal de {zone} está aceso: agora todos nas ilhas podem assinar.",
|
||||
"wisp.spur_trap":"Um só cabo é um ponto único de falha: quando é cortado, o navio de reparo leva semanas. Um circuito por satélite de reserva leva as ilhas enquanto isso.",
|
||||
"wisp.st_cut":"Ramal cortado",
|
||||
"wisp.st_none":"Ainda sem link",
|
||||
"wisp.st_soon":"A caminho",
|
||||
"wisp.st_spur":"Ramal",
|
||||
"wisp.take":"Os ilhéus assinam até onde o link deixa: cerca de {geo} por GEO, {meo} por MEO, {leo} por LEO, e todos por cabo.",
|
||||
"wisp.tele_reaches":"Wi-Fi das ilhas deste teleporto:",
|
||||
"wisp.upkeep":"Torres, solar e equipes",
|
||||
"wisp.why_moving":"Uma mudança para outro satélite já está em andamento.",
|
||||
"wisp.why_no_pop":"Abra primeiro um POP em {city}: as equipes e a licença das ilhas trabalham de lá.",
|
||||
"wisp.why_same":"As ilhas já vão pelo {bird}: mude o tamanho desse circuito.",
|
||||
"wisp.why_spur_have":"O ramal já está lançado.",
|
||||
"wkscn.copy_my_result":"Copiar meu resultado",
|
||||
"wkscn.desc_a_g_event_comes_to":"No dia {day} chega a {city} um evento de {g}. Construa a rede de que ele precisa, do zero.",
|
||||
"wkscn.desc_a_ship_dragged_its_anchor":"Um navio arrastou a âncora sobre o {cab}. Encontre outro caminho de {a} a {b}.",
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ const API_DOMAINS={
|
|||
routerModel:{table:'RG',kind:'index'},
|
||||
scrubTier:{table:'SCRUB_TIERS',kind:'index'},
|
||||
satBird:{table:'SATS',kind:'key'},
|
||||
wispZone:{table:'WISP',kind:'key'},
|
||||
satG:{kind:'enum',values:()=>[...new Set(Object.values(SAT_ORB).flatMap(o=>o.g))].sort((a,b)=>a-b)},
|
||||
// Small fixed vocabularies the game itself checks by list membership.
|
||||
// The link metric presets, plus "custom" for a hand-tuned number (ACT.setMetric).
|
||||
|
|
|
|||
|
|
@ -188,6 +188,20 @@ const API_CMD={
|
|||
quote:a=>{const l=S.links.find(x=>x.id===a.id&&x.kind==='sat'),g=+a.g,ok=!!l&&g!==l.g&&SAT_ORB[SATS[l.bird].orb].g.includes(g),mo=ok?satMo(l.bird,g):0;
|
||||
return {setup:ok&&g>l.g?mo:0,monthly:mo,blocked:!l?['not a satellite circuit']:ok?[g>l.g&&leoLink(l)?leoGrowWhy(l):''].filter(Boolean):[tr('satellites.no_such_circuit')]};},
|
||||
doc:'Resize a satellite circuit on the same bird. A bigger one pays its new month up front; a LEO circuit grows only while its gateway is on your fiber and your own constellation carries nothing.'},
|
||||
wispSat:{args:[['z','wispZone'],['bird','satBird'],['g','satG']],watch:['pops'],
|
||||
quote:a=>{const ok=own(WISP,a.z)&&own(SATS,a.bird),mo=ok?wispSatMo(a.bird,+a.g):0;return {setup:ok?mo+(wispZ(a.z)?0:wispKit(a.z)):0,monthly:mo,days:ok?leadDays(SAT_ORB[SATS[a.bird].orb].days):0,blocked:[wispSatWhy(a.z,a.bird,+a.g)].filter(Boolean)};},
|
||||
doc:'Island Wi-Fi: rent satellite capacity for an island zone (catalog WISP; its city is c) from your teleport in that city, on a bird that sees both: GEO 1-10 Gbps, MEO 2-20 with tracking antennas, LEO 5-50 from a Starblink gateway there. A contended share, 60% of a circuit\'s price. The first order of a zone also pays the island kit (towers, solar, home radios). How many homes sign up follows the link: about 35% of the pool over GEO, 75% over MEO, 90% over LEO, all over a spur. With a circuit running, one on another bird is a move: the old one carries until the new one is commissioned. The zone\'s homes join the city\'s demand.'},
|
||||
wispSatSize:{args:[['z','wispZone'],['g','satG']],watch:['pops'],
|
||||
quote:a=>{const Z=own(WISP,a.z)?wispZ(a.z):null,o=Z&&Z.sat,g=+a.g,ok=!!o&&g!==o.g&&SAT_ORB[wispOrb(o)].g.includes(g),mo=ok?wispSatMo(o.bird,g):0;
|
||||
return {setup:ok&&g>o.g?mo:0,monthly:mo,blocked:!o?['no circuit for that zone']:ok?[g>o.g&&wispOrb(o)==='leo'?leoGrowWhy({a:WISP[a.z].c}):''].filter(Boolean):[tr('satellites.no_such_circuit')]};},
|
||||
doc:'Resize an island zone\'s satellite circuit on the same bird. A bigger one pays its new month up front.'},
|
||||
wispSatRm:{args:[['z','wispZone']],confirm:'double',watch:['pops'],
|
||||
doc:'Cancel an island zone\'s satellite circuit (and a move being commissioned). With no spur lit, its homes go offline and leave.'},
|
||||
wispSpur:{args:[['z','wispZone']],watch:['pops'],
|
||||
quote:a=>{const ok=own(WISP,a.z);return {setup:ok?wispSpurCost(a.z)+(wispZ(a.z)?0:wispKit(a.z)):0,monthly:ok?wispSpurMo(a.z):0,days:ok?wispSpurDays(a.z):0,blocked:[wispSpurWhy(a.z)].filter(Boolean)};},
|
||||
doc:'Island Wi-Fi: lay a spur cable from the zone\'s city (level 3; not every zone can have one). Every home there may sign up once it is lit, and nothing is rented. A spur can be cut (weeks to mend, or a $250k repair ship): a satellite circuit kept beside it carries the islands meanwhile. A zone may start with a spur alone (with the island kit).'},
|
||||
wispRm:{args:[['z','wispZone']],confirm:'double',watch:['pops'],
|
||||
doc:'Close an island Wi-Fi zone: its circuits, spur and homes go.'},
|
||||
/* ---------- dark fiber and own cable ---------- */
|
||||
orderDf:{args:[['a','cityId'],['b','cityId'],['source','dfSource'],['system','systemId']],
|
||||
bindsUI:['pending','dfSrc','dfSys'],bind:a=>{UI.pending={a:a.a,b:a.b};UI.dfSrc=a.source;UI.dfSys=a.system;},
|
||||
|
|
@ -348,7 +362,7 @@ const API_CMD={
|
|||
ip4Nat64:{args:[['v','ip4Ratio64']],watch:['ip4'],
|
||||
doc:'Set how many IPv6-only homes share one IPv4 address in the NAT64 pool (64, 128 or 256). Their refunds are well under CGNAT\'s at the same ratio and shrink as the world moves to IPv6; fewer is refused when the customers signed would not fit.'},
|
||||
ip6Go:{args:[['city','cityId']],watch:['pops.#city'],
|
||||
quote:a=>({setup:ip6Cost(a.city),days:ip6Days(a.city),monthly:Math.round(ip6Mo(a.city,(R.rev&&R.rev.eyeballs)||0)),blocked:[ip6Why(a.city)].filter(Boolean)}),
|
||||
quote:a=>({setup:ip6Cost(a.city),days:ip6Days(a.city),monthly:Math.round(ip6Mo(a.city,ip4Eye())),blocked:[ip6Why(a.city)].filter(Boolean)}),
|
||||
doc:'Take a broadband city IPv6-only (464XLAT): swap its dual-stack home routers for ones with a CLAT over the quoted days, paid day by day as they go in (setup is the whole swap; starting needs only the first day\'s share on hand, and it waits while cash is short). Those homes then need no IPv4 of their own, only a share of the NAT64 pool; new homes there get the new router too, at the swap\'s price a router, paid the day they join (even short of cash: a new home needs it). monthly is what it does to the IPv4 bill (NAT64 gateways and refunds against the CGNAT it saves; negative saves). Frees what the city panel says for new customers.'},
|
||||
ip6Stop:{args:[['city','cityId']],watch:['pops.#city'],
|
||||
doc:'Stop a city\'s swap to IPv6-only. The homes already swapped stay IPv6-only (their routers are paid for, nothing comes back); new homes come dual stack again. ip6Go resumes it for the rest.'},
|
||||
|
|
@ -649,6 +663,7 @@ const API_BOUND={
|
|||
trace:{command:'traceRun',arg:'from'},
|
||||
decomToggle:{command:'decomGo',arg:'cities'},
|
||||
satOpen:{command:'buySat',note:'opens the satellite order sheet from a teleport (a) or for a city (b); buySat takes a, b, bird and g itself'},
|
||||
wispOpen:{command:'wispSat',note:'opens an island Wi-Fi zone in its city\'s Customers tab; wispSat, wispSpur and the rest take z themselves'},
|
||||
openVxc:{command:'buyVxc',note:'opens the circuit picker from a fabric port ({from, prov}); buyVxc takes a, b, prov and t itself'},
|
||||
connCancel:{command:'cancelTransit',note:'the connections list\'s cancel button: it arms, then dispatches cancelTransit, cancelPni, cancelIx, rmCache or rmNni'},
|
||||
cnPrem:{command:'buildLink',arg:'premiumCrossing'},
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const API_STATE_DOC={
|
|||
t1v:{type:'integer',doc:'Level at which Tier 1 transit was offered.'},
|
||||
auV:{type:'integer',doc:'Australia content level gate.'},
|
||||
seen:{type:'array',doc:'Network ids the deals panel has already shown. Vestigial: written by newGame, read nowhere.'},
|
||||
pops:{type:'map',doc:'Your POPs by city id: day opened, broadband (bb: d, its demand in Gbps; v6, the share of its homes that are IPv6-only behind NAT64, absent for dual stack; v6e, the day a swap to IPv6-only finishes, while it runs), ad boost, downtime, routers, generator, second site, teleport (tele: 1 GEO dishes, 2 with MEO tracking antennas), a Starblink LEO gateway on it (leo: 1).'},
|
||||
pops:{type:'map',doc:'Your POPs by city id: day opened, broadband (bb: d, its demand in Gbps; v6, the share of its homes that are IPv6-only behind NAT64, absent for dual stack; v6e, the day a swap to IPv6-only finishes, while it runs), ad boost, downtime, routers, generator, second site, teleport (tele: 1 GEO dishes, 2 with MEO tracking antennas), a Starblink LEO gateway on it (leo: 1)., island Wi-Fi zones (wisp: by zone id, {day, d: the homes\' Gbps signed up, sat: the circuit {bird, g, mo, day, ready}, nxt: a move to another bird being commissioned, sp: the spur cable {day, ready}}).'},
|
||||
links:{type:'array',doc:'Your links: waves, dark fiber (df), own cables, fabric circuits (vxc), express lightpaths (xp: via lists the dark fibers it rides from a, ch its optics) and rented satellite circuits (sat: bird, g Gbps, km of radio path, ready day), each with an entity id.'},
|
||||
transit:{type:'array',doc:'Transit ports: city, net, tier, LAG members, port history for 95th-percentile billing.'},
|
||||
ixp:{type:'map',doc:'IX ports by exchange city; tier per port (may exceed 1 with LAG members in ixn).'},
|
||||
|
|
@ -131,6 +131,9 @@ const API_RESULTS_DOC={
|
|||
cityDem:{type:'map',doc:'Eyeball + customer demand per city.'},
|
||||
citySrv:{type:'map',doc:'Traffic served per city.'},
|
||||
cityEye:{type:'map',doc:'Eyeballs online per city.'},
|
||||
cityWisp:{type:'map',doc:'Island Wi-Fi: the Gbps of island homes each city carries for its zones (already in cityDem; never in cityEye).'},
|
||||
wisp:{type:'map',doc:'Island Wi-Fi zones by zone id (catalog WISP): d, the homes\' Gbps wanted; car, what their backhaul carried; sf, how well they were served (0..1); k, how many may sign up over today\'s link (the take-up cap).'},
|
||||
wispL:{type:'array',doc:'Island Wi-Fi zones in this compute: z, its city c, zd wanted and car carried, in Gbps.'},
|
||||
latF:{type:'map',doc:'Fraction of each city\'s traffic that goes far (over a threshold latency).'},
|
||||
latFar:{type:'map',doc:'The far exit each slow city sends traffic through.'},
|
||||
satU:{type:'map',doc:'Of each city\'s served traffic, the Gbps that rode a rented satellite circuit (its users notice the orbit\'s latency on that share). Only there while you have a satellite circuit up.'},
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ function apiJson(v){
|
|||
carries the keys confGo/confSponsor need, which exist in no field of S; TE_RECIPES renders
|
||||
each recipe's script, because the source is a function and some read the live network. The
|
||||
recipes' relevance score is not exposed: judging which one fits is the agent's job. */
|
||||
const API_TABLES={ROCKETS,CRUSTS,PIE_RD,PIE_SPAT_DEF,SATS,SAT_ORB,SAT_PROV,SALES,CITIES,NETS,CABLES,XIX,PORT,LT,NNI,VXC,RG,OPT,DF_SYS,FAB,SCRUB_TIERS,BIZ_T,LEVELS,GOALS,BROKER_GOALS,SCN,BANKS,REQS,NSH,MET,PREF,RT,PPOL,CONFS,LAG_MAX,PNI_LAG_MAX,PNI_LAG_RT,RMAX,REGEN_MAX,START_CASH,CONF_COST,CONF_SP,CAP_COST,CAP_LV,CONF_DAYS,SUB_UPGRADES,SEA_DESIGNS,TE_COST,TE_MO,MYIX_COST,CN_LIC,SITE2_COST,MYIX_FAB,INTERNS,OPSK,CHARTERS,SEAT_N,CORE_LV,CORE_COST,CORE_REQ,CORE_LAB,INTERN_MO,PZ_TIERS,AR_TIERS,PZ_RG};
|
||||
const API_TABLES={ROCKETS,CRUSTS,PIE_RD,PIE_SPAT_DEF,SATS,SAT_ORB,SAT_PROV,WISP,SALES,CITIES,NETS,CABLES,XIX,PORT,LT,NNI,VXC,RG,OPT,DF_SYS,FAB,SCRUB_TIERS,BIZ_T,LEVELS,GOALS,BROKER_GOALS,SCN,BANKS,REQS,NSH,MET,PREF,RT,PPOL,CONFS,LAG_MAX,PNI_LAG_MAX,PNI_LAG_RT,RMAX,REGEN_MAX,START_CASH,CONF_COST,CONF_SP,CAP_COST,CAP_LV,CONF_DAYS,SUB_UPGRADES,SEA_DESIGNS,TE_COST,TE_MO,MYIX_COST,CN_LIC,SITE2_COST,MYIX_FAB,INTERNS,OPSK,CHARTERS,SEAT_N,CORE_LV,CORE_COST,CORE_REQ,CORE_LAB,INTERN_MO,PZ_TIERS,AR_TIERS,PZ_RG};
|
||||
const API_MADE={
|
||||
BADGES:()=>!S?[]:BADGES.map(b=>{const on=S.ach&&S.ach[b.id]!==undefined,ever=!!hof()[b.id];
|
||||
return b.secret&&!on&&!ever?{id:b.id,i:'❔',t:'???',d:tr('badges.a_secret_badge'),r:b.r,secret:true}:{...b,ever};}),
|
||||
|
|
|
|||
|
|
@ -14,10 +14,11 @@
|
|||
// ends must see the same satellite at once: at most km apart (LEO: a bent pipe, no lasers on a rented tier), and at least
|
||||
// el degrees above both horizons (what a ground terminal needs to clear the trees; far north, two ends 7,000 km apart lose
|
||||
// a MEO satellite below the horizon). loss is also how satEdges/satAfter tell the orbits apart, so no two may share one.
|
||||
// wisp: how many of an island zone's homes sign up when this orbit is their only link (46-wisp-zones.js).
|
||||
const SAT_ORB={
|
||||
geo:{n:'GEO',h:35786,proc:25,loss:0.5,days:10,lv:2,g:[1,2,5,10]},
|
||||
meo:{n:'MEO',h:8062,proc:7,loss:0.08,days:21,lv:3,g:[2,5,10,20],lat:50,km:7500,el:5},
|
||||
leo:{n:'LEO',h:550,proc:10,loss:0.03,days:14,lv:5,g:[5,10,20,50],lat:56,km:1200,el:25},
|
||||
geo:{n:'GEO',h:35786,proc:25,loss:0.5,days:10,lv:2,g:[1,2,5,10],wisp:0.35},
|
||||
meo:{n:'MEO',h:8062,proc:7,loss:0.08,days:21,lv:3,g:[2,5,10,20],lat:50,km:7500,el:5,wisp:0.75},
|
||||
leo:{n:'LEO',h:550,proc:10,loss:0.03,days:14,lv:5,g:[5,10,20,50],lat:56,km:1200,el:25,wisp:0.9},
|
||||
};
|
||||
// pg: dollars a month for the first Gbps; bigger circuits cost less per Gbps (satMo).
|
||||
const SAT_PROV={
|
||||
|
|
@ -51,23 +52,28 @@ function satArc(la1,lo1,la2,lo2){const r=Math.PI/180,c=Math.sin(la1*r)*Math.sin(
|
|||
function satSlant(arc,h){const Q=SAT_RE+h,a=arc*Math.PI/180;return Math.sqrt(SAT_RE*SAT_RE+Q*Q-2*SAT_RE*Q*Math.cos(a));}
|
||||
// How high above a dish's horizon that satellite stands, in degrees (negative: below it, behind the Earth).
|
||||
function satElev(arc,h){const a=arc*Math.PI/180;return Math.atan2(Math.cos(a)-SAT_RE/(SAT_RE+h),Math.sin(a))*180/Math.PI;}
|
||||
// The longitude the bird sits over for a circuit: a GEO's slot; a MEO ring's satellite halfway between the two ends.
|
||||
// LEO does not use it: its satellite flies over the midpoint of the two ends, not over the equator.
|
||||
function satLon(id,a,b){const B=SATS[id];if(B.orb==='geo')return B.lon;const r=Math.PI/180,A=CITY[a],C=CITY[b];
|
||||
return Math.atan2(Math.sin(A.lon*r)+Math.sin(C.lon*r),Math.cos(A.lon*r)+Math.cos(C.lon*r))/r;}
|
||||
// Whether bird id sees city c.
|
||||
function satSees(id,c){const B=SATS[id],C=CITY[c];if(!B||!C)return false;return B.orb==='geo'?satArc(0,B.lon,C.lat,C.lon)<=B.r:Math.abs(C.lat)<=SAT_ORB[B.orb].lat;}
|
||||
/* The geometry works on points ({lat, lon}: a city, or an island zone that is no city), and the city versions wrap it.
|
||||
The longitude the bird sits over for a circuit between P and Q: a GEO's slot; a MEO ring's satellite halfway between
|
||||
the two ends. LEO does not use it: its satellite flies over the midpoint of the two ends, not over the equator. */
|
||||
function satLonAt(id,P,Q){const B=SATS[id];if(B.orb==='geo')return B.lon;const r=Math.PI/180;
|
||||
return Math.atan2(Math.sin(P.lon*r)+Math.sin(Q.lon*r),Math.cos(P.lon*r)+Math.cos(Q.lon*r))/r;}
|
||||
function satLon(id,a,b){return satLonAt(id,CITY[a],CITY[b]);}
|
||||
// Whether bird id sees point P, and city c.
|
||||
function satSeesAt(id,P){const B=SATS[id];if(!B||!P)return false;return B.orb==='geo'?satArc(0,B.lon,P.lat,P.lon)<=B.r:Math.abs(P.lat)<=SAT_ORB[B.orb].lat;}
|
||||
function satSees(id,c){return satSeesAt(id,CITY[c]);}
|
||||
// Whether one satellite of bird id sees both ends at once: a GEO sees them from its slot; a MEO or LEO satellite has to
|
||||
// be within km of both and high enough above both horizons (LEO's flies over the midpoint).
|
||||
function satPairOk(id,a,b){if(a===b||!satSees(id,a)||!satSees(id,b))return false;const B=SATS[id];if(B.orb==='geo')return true;const O=SAT_ORB[B.orb];
|
||||
if(kmBetween(a,b)>O.km)return false;
|
||||
if(B.orb==='leo')return satElev(satArc(CITY[a].lat,CITY[a].lon,CITY[b].lat,CITY[b].lon)/2,O.h)>=O.el;
|
||||
const lon=satLon(id,a,b);return [a,b].every(c=>satElev(satArc(0,lon,CITY[c].lat,CITY[c].lon),O.h)>=O.el);}
|
||||
// be within km of both and high enough above both horizons (LEO's flies over the midpoint). km as kmBetween counts it.
|
||||
function satPairAt(id,P,Q){if(!satSeesAt(id,P)||!satSeesAt(id,Q))return false;const B=SATS[id];if(B.orb==='geo')return true;const O=SAT_ORB[B.orb];
|
||||
if(Math.max(20,Math.round(hav(P.lon,P.lat,Q.lon,Q.lat)))>O.km)return false;
|
||||
if(B.orb==='leo')return satElev(satArc(P.lat,P.lon,Q.lat,Q.lon)/2,O.h)>=O.el;
|
||||
const lon=satLonAt(id,P,Q);return [P,Q].every(X=>satElev(satArc(0,lon,X.lat,X.lon),O.h)>=O.el);}
|
||||
function satPairOk(id,a,b){return a!==b&&satPairAt(id,CITY[a],CITY[b]);}
|
||||
// The radio path: up from one dish and down to the other, the km the signal really travels. It is the link's km, so the
|
||||
// routers' metric (pairW) sees a satellite as the long way round it is, and a cable wins whenever there is one.
|
||||
function satKm(id,a,b){const h=SAT_ORB[SATS[id].orb].h,A=CITY[a],C=CITY[b];
|
||||
if(SATS[id].orb==='leo')return Math.round(2*satSlant(satArc(A.lat,A.lon,C.lat,C.lon)/2,h));
|
||||
const lon=satLon(id,a,b);return Math.round(satSlant(satArc(0,lon,A.lat,A.lon),h)+satSlant(satArc(0,lon,C.lat,C.lon),h));}
|
||||
function satKmAt(id,P,Q){const h=SAT_ORB[SATS[id].orb].h;
|
||||
if(SATS[id].orb==='leo')return Math.round(2*satSlant(satArc(P.lat,P.lon,Q.lat,Q.lon)/2,h));
|
||||
const lon=satLonAt(id,P,Q);return Math.round(satSlant(satArc(0,lon,P.lat,P.lon),h)+satSlant(satArc(0,lon,Q.lat,Q.lon),h));}
|
||||
function satKm(id,a,b){return satKmAt(id,CITY[a],CITY[b]);}
|
||||
/* LEO from a gateway to any point on the globe (a zone of islands, not a city): pure, they read only the catalog and
|
||||
CITY. c: the gateway's city id; lat, lon: the far end in degrees. leoArcLL: the arc between them in degrees; leoKmLL:
|
||||
the radio path in km (up to the satellite over the midpoint and down again); leoMsLL: one way in ms, the modems
|
||||
|
|
|
|||
38
src/game/10-catalog/76-wisp-zones.js
Normal file
38
src/game/10-catalog/76-wisp-zones.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* ---------- Island Wi-Fi zones (#83): the outer islands no cable reaches ----------
|
||||
Each zone is a pool of island homes looking to one island city (c, always one a satellite serves), at the point lat,
|
||||
lon: no city on the map and no link, only homes your POP in c brings online (60-features/46-wisp-zones.js).
|
||||
n: real place names, as in CITIES, joined by "&". P: Gbps of homes at full take-up in era 1 (about the islands' share
|
||||
of their country, half again for being the only internet there; scaled by eraMul() like eyeP). km: the spur cable from
|
||||
c, 0 where none can be laid (too far, or sea ice). v: volcanic, so an eruption can cut the spur. Zones under 3 G are
|
||||
left out: pie terminals and a satellite circuit to the island itself serve those.
|
||||
The zones beyond 56 degrees (Nunavut, Southeast Alaska) are past Starblink's shell and MEO's ring: GEO only there. */
|
||||
const WISP={
|
||||
anjouan:{n:'Anjouan & Mohéli',c:'hah',lat:-12.25,lon:44.1,P:6,km:200},
|
||||
capeverde:{n:'Sal, Boa Vista & São Vicente',c:'rai',lat:16.6,lon:-23.8,P:6,km:450},
|
||||
chuuk:{n:'Chuuk, Yap & Kosrae',c:'pni',lat:7.4,lon:151.85,P:5,km:800},
|
||||
leeward:{n:'Bora Bora & Raiatea',c:'ppt',lat:-16.8,lon:-151.45,P:4,km:250},
|
||||
malaita:{n:'Malaita & Gizo',c:'hir',lat:-8.5,lon:159.5,P:8,km:350},
|
||||
marianas:{n:'Saipan, Tinian & Rota',c:'gum',lat:15.2,lon:145.75,P:6,km:230,v:1},
|
||||
ngi:{n:'New Britain, New Ireland & Bougainville',c:'pom',lat:-5,lon:152.5,P:12,km:900,v:1},
|
||||
nunavut:{n:'Rankin Inlet, Cambridge Bay & Pond Inlet',c:'yfb',lat:66.5,lon:-88,P:5,km:0},
|
||||
outislands:{n:'Abaco, Eleuthera & Exuma',c:'nas',lat:25.1,lon:-76.4,P:8,km:400},
|
||||
rangiroa:{n:'Rangiroa & Nuku Hiva',c:'ppt',lat:-12,lon:-144,P:3,km:1400},
|
||||
santo:{n:'Espiritu Santo & Tanna',c:'vli',lat:-16.5,lon:167.8,P:8,km:400,v:1},
|
||||
savaii:{n:'Savai’i',c:'apw',lat:-13.6,lon:-172.4,P:3,km:80},
|
||||
seak:{n:'Sitka, Ketchikan & Petersburg',c:'jnu',lat:56.4,lon:-133.3,P:5,km:450},
|
||||
southatolls:{n:'Addu, Fuvahmulah & Huvadhoo',c:'mle',lat:0,lon:73.3,P:6,km:500},
|
||||
tobago:{n:'Tobago',c:'pos',lat:11.25,lon:-60.7,P:3,km:120},
|
||||
vanualevu:{n:'Vanua Levu & Taveuni',c:'suv',lat:-16.6,lon:179.2,P:10,km:220},
|
||||
vavau:{n:'Vava’u & Ha’apai',c:'tbu',lat:-19.2,lon:-174.2,P:3,km:300,v:1},
|
||||
vi:{n:'St Thomas, St Croix & Tortola',c:'sju',lat:18.2,lon:-64.8,P:6,km:160},
|
||||
};
|
||||
/* The money. ARPU: islanders pay island prices (times EYE_RATE). SHARE: a zone's satellite capacity is a contended share
|
||||
of a high-throughput beam, cheaper than a trunk circuit of the same size. KIT(+G per Gbps of pool): towers, solar
|
||||
panels and home radios, with the first order; MO(+G): their upkeep. SPUR: an unrepeatered festoon with small beach
|
||||
landings, mostly paid by development banks (this is your share), plus KM a km; MO + MO_KM a km to run; G: what it
|
||||
carries; D0 + DKM a km: days to lay it. LV: the level spurs come at. GROW: daily take-up growth; START: the pool share
|
||||
that signs up at once and never leaves. RUSH: chartering a repair ship for a cut spur; CUT_W: a lit spur's weight among
|
||||
the failures. */
|
||||
const WISP_ARPU=14,WISP_SHARE=0.6,WISP_KIT=30000,WISP_KIT_G=4000,WISP_MO=500,WISP_MO_G=50,
|
||||
WISP_SPUR=150000,WISP_SPUR_KM=600,WISP_SPUR_MO=400,WISP_SPUR_MO_KM=1.5,WISP_SPUR_G=100,WISP_SPUR_D0=90,WISP_SPUR_DKM=0.15,
|
||||
WISP_SPUR_LV=3,WISP_GROW=0.02,WISP_START=0.05,WISP_RUSH=250000,WISP_CUT_W=1.5;
|
||||
|
|
@ -6,4 +6,4 @@ const UI={sel:null,tab:'cust',left:'goals',speed:1,hover:null,drag:null,snap:nul
|
|||
the player's (an agent drives): no pause, no speed buttons, no auto-pause, and the speed is HOOKS.speed()'s. */
|
||||
const HOOKS={};
|
||||
let uidN=1; const uid=()=>'i'+(Date.now()%1e7).toString(36)+(uidN++);
|
||||
function emptyR(){return {nt:{},cone:{},reachNT:0,teBlack:0,tNet:{},egT:{},netEg:{},l2lat:{},nodeLoad:{},nodeCap:{},div:{},l2:{},gfwLost:0,gfwCross:0,ef:{},egDesc:{},p95:{},peered:0,peerShare:0,load:{},useT:{},useIx:{},usePni:{},useCache:{},cityDem:{},citySrv:{},cityEye:{},latF:{},latFar:{},demTo:{},served:0,demand:0,reach:0,sessions:0,revMo:0,costMo:0,cost:{},rev:{},reachable:{},ddos:[],haul:[],tgtF:{},bbF:{},fsUse:{},ddosHot:{}};}
|
||||
function emptyR(){return {nt:{},cone:{},reachNT:0,teBlack:0,tNet:{},egT:{},netEg:{},l2lat:{},nodeLoad:{},nodeCap:{},div:{},l2:{},gfwLost:0,gfwCross:0,ef:{},egDesc:{},p95:{},peered:0,peerShare:0,load:{},useT:{},useIx:{},usePni:{},useCache:{},cityDem:{},citySrv:{},cityEye:{},cityWisp:{},wisp:{},wispL:[],latF:{},latFar:{},demTo:{},served:0,demand:0,reach:0,sessions:0,revMo:0,costMo:0,cost:{},rev:{},reachable:{},ddos:[],haul:[],tgtF:{},bbF:{},fsUse:{},ddosHot:{}};}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ function ip4Need(b){const k=b&&IP4_BIZ[b.type];if(!k||!(b.bw>0))return 0;return
|
|||
function ip4Use(s=S){const I=s.ip4,r=I.nat,r6=I.n64||IP4_N640;let own=0,inn=0,out=0,B=0,H=0,H6=0;
|
||||
for(const b of I.b){const n=ip4Sz(b.len);if(b.k==='in')inn+=n;else if(b.out)out+=n;else own+=n;}
|
||||
for(const b of s.biz)B+=ip4Need(b);
|
||||
for(const c in s.pops){const p=s.pops[c];if(p.bb){const h=p.bb.d*IP4_BB;H+=h;if(p.bb.v6)H6+=h*p.bb.v6;}}
|
||||
// Island Wi-Fi homes (46-wisp-zones.js) are IPv6-only from day one: their IPv4 shares the NAT64 pool.
|
||||
for(const c in s.pops){const p=s.pops[c];if(p.bb){const h=p.bb.d*IP4_BB;H+=h;if(p.bb.v6)H6+=h*p.bb.v6;}if(p.wisp)for(const z in p.wisp){const h=p.wisp[z].d*IP4_BB;H+=h;H6+=h;}}
|
||||
H=Math.ceil(H);H6=Math.min(H,Math.ceil(H6));const Hd=H-H6,T=own+inn,A=Math.max(0,T-B),p6=Math.ceil(H6/r6),min=Math.ceil(Hd/r),need=p6+min,A2=A-p6;let cg=0,over=0;
|
||||
if(A2<Hd){if(A2>=min)cg=Math.min(Hd,Math.ceil((Hd-A2)*r/(r-1)));else{cg=Hd;over=need?1-A/need:0;}}
|
||||
return {T,own,inn,out,B,H,H6,Hd,p6,cg,over,need,free:T-B-need,r,r6};}
|
||||
|
|
@ -73,15 +74,17 @@ const ip4V4=(d=S.day)=>Math.max(IP4_V4_MIN,IP4_V4-IP4_V4_YR*Math.max(0,d)/365.24
|
|||
function ip4Bill(eye,s=S){const u=ip4Use(s),v4=ip4V4();let lin=0,lout=0;for(const b of s.ip4.b){if(b.k==='in')lin+=b.mo||0;else if(b.out)lout+=b.mo||0;}
|
||||
const cgS=u.H?u.cg/u.H:0,v6S=u.H?u.H6/u.H:0;
|
||||
return {u,lin,lout,v4,box:u.cg/IP4_BB*v4*IP4_CGN,box64:u.H6/IP4_BB*v4*IP4_CGN,refund:eye*(cgS*IP4_ANNOY[u.r]+v6S*IP4_ANNOY64[u.r6]*v4/IP4_V4+u.over*IP4_SQZ)};}
|
||||
// What homes pay a month (broadband and island Wi-Fi), which the refunds scale with: from computeMoney's V, or R.
|
||||
const ip4Eye=(V=R&&R.rev)=>V?(V.eyeballs||0)+(V.wisp||0):0;
|
||||
// computeMoney: only what is there, so a network with nothing to pay keeps its money rows as they were.
|
||||
function ip4Money(C,V){if(!ip4On())return;const b=ip4Bill(V.eyeballs||0),c=Math.round(b.lin+b.box+b.box64+b.refund);if(c>0)C.ip4=c;if(b.lout>0)V.ip4=b.lout;}
|
||||
function ip4Money(C,V){if(!ip4On())return;const b=ip4Bill(ip4Eye(V)),c=Math.round(b.lin+b.box+b.box64+b.refund);if(c>0)C.ip4=c;if(b.lout>0)V.ip4=b.lout;}
|
||||
/* A new network gets its /21 from the RIR. An older save gets what it already uses registered to it and a quarter more to
|
||||
grow into (about a month for a big, fast-growing network), rounded up to /24s in real CIDR blocks (a /21 at the
|
||||
least), so nothing changes on load; those blocks move like any other two years on.
|
||||
Their ids are fixed (rir0, rir1…), not uid(): a new game draws no id, so every id after it stays as it was. */
|
||||
function ip4Grant(s){const d=s.day||0,b=[],add=len=>b.push({id:'rir'+b.length,len,k:'rir',d});let need=0;
|
||||
for(const x of s.biz||[])need+=ip4Need(x);
|
||||
for(const c in s.pops||{}){const p=s.pops[c];if(p&&p.bb&&p.bb.d>0)need+=p.bb.d*IP4_BB;}
|
||||
for(const c in s.pops||{}){const p=s.pops[c];if(p&&p.bb&&p.bb.d>0)need+=p.bb.d*IP4_BB;if(p&&p.wisp&&typeof p.wisp==='object')for(const z in p.wisp)need+=Math.max(0,num(p.wisp[z]&&p.wisp[z].d,0))*IP4_BB;}
|
||||
need=Math.max(ip4Sz(IP4_START),Math.ceil(need*1.25/256)*256);
|
||||
while(need>=ip4Sz(IP4_MIN)&&b.length<200){add(IP4_MIN);need-=ip4Sz(IP4_MIN);}
|
||||
for(let len=IP4_MIN+1;len<=IP4_MAX;len++)if(need>=ip4Sz(len)){add(len);need-=ip4Sz(len);}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ function ip6Html(c){if(!ip4On())return '';const p=ip6Pop(c),b=p&&p.bb;if(!b)retu
|
|||
if(b.v6e){const wait=ip6Slice(b,S.day+1)>Math.max(0,S.cash);
|
||||
h+=`<div class="bar me"><i style="width:${Math.min(100,v*100)}%"></i></div><p class="note">${tr('ip6.swapping_home_routers_paid',{cost:fmt$(IP6_CPE),date:dateStr(b.v6e)})}</p>${wait?`<p class="why">${tr('ip6.waiting')}</p>`:''}<div class="btns">${btn(tr('ip6.stop'),'ip6Stop',{city:c},'ghost sm')}</div>`;}
|
||||
else if(v>=1)h+=`<p class="note">${tr('ip6.new_homes_get_a_clat',{cost:fmt$(IP6_CPE),r})}</p>`;
|
||||
else{const n=Math.ceil(ip6Homes(p)),cost=ip6Cost(c),f=Math.max(0,ip6Free(c)),mo=Math.round(ip6Mo(c,(R.rev&&R.rev.eyeballs)||0));
|
||||
else{const n=Math.ceil(ip6Homes(p)),cost=ip6Cost(c),f=Math.max(0,ip6Free(c)),mo=Math.round(ip6Mo(c,ip4Eye()));
|
||||
// Before the player commits: what the month costs after it too, and that it buys nothing yet while IPv4 still fits.
|
||||
const bill=mo>0?tr('ip6.your_ipv4_bill_goes_up',{price:fmt$(mo)})+(ip4Use().cg?'':' '+tr('ip6.no_home_is_behind_cgnat')):mo<0?tr('ip6.your_ipv4_bill_goes_down',{price:fmt$(-mo)}):'';
|
||||
h+=`<p class="note">${v>0?tr('ip6.part_note',{p:pct(v)}):tr('ip6.pitch',{r})} ${tr('ip6.what',{routers:trn('ip6.n_routers',n,{n:ip4N(n)}),days:ip6Days(c),addr:trn('ip4.n_addresses',f,{n:ip4N(f)})})} ${tr('ip6.homes_that_join_later',{cost:fmt$(IP6_CPE)})}${bill?' '+bill:''}</p>
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ function leoGrowWhy(l){const a=l.a;if(!leoGw(a))return tr('satellites.needs_leo_
|
|||
const leoLink=l=>l.kind==='sat'&&own(SATS,l.bird)&&SATS[l.bird].orb==='leo';
|
||||
const leoStorm=()=>S.ev.sky>S.day;
|
||||
const leoDown=l=>leoStorm()&&leoLink(l);
|
||||
// A storm can only find circuits in the sky: a commissioned LEO circuit (failureRun, and Pie's own storms).
|
||||
const leoLive=()=>S.links.some(l=>leoLink(l)&&!(l.ready>S.day));
|
||||
// A storm can only find circuits in the sky: a commissioned LEO circuit, an island zone's too (failureRun, and Pie's own storms).
|
||||
const leoLive=()=>S.links.some(l=>leoLink(l)&&!(l.ready>S.day))||wispLeoLive();
|
||||
// A solar storm: Starblink puts its satellites in safe mode for 1 or 2 days (days: how many, when the caller knows).
|
||||
function leoStormGo(days){S.ev.sky=S.day+(days||1+Math.floor(Math.random()*2));
|
||||
addInc({type:'leostorm',ref:'sbk',until:S.ev.sky,msg:tr('satellites.leo_storm_msg',{prov:SAT_PROV.sbk.n}),cost:0});}
|
||||
|
|
@ -91,8 +91,8 @@ function leoStormGo(days){S.ev.sky=S.day+(days||1+Math.floor(Math.random()*2));
|
|||
the rent, SAT_ORB.leo.loss for what users notice, and leoStorm() for the storm. */
|
||||
function leoReachLL(c,lat,lon){const O=SAT_ORB.leo;if(!leoGw(c)||lvl()<O.lv||!satWired(c)||leoRival())return false;
|
||||
if(Math.abs(CITY[c].lat)>O.lat||!(Math.abs(lat)<=O.lat))return false;return leoArcLL(c,lat,lon)*Math.PI/180*SAT_RE<=O.km;}
|
||||
// What the teleports and their circuits cost a month (R.cost.sat).
|
||||
function satMoAll(){let m=0;for(const c in S.pops){const t=teleOf(c);if(t)m+=TPORT_MO+(t>1?TRK_MO:0)+(S.pops[c].leo===1?LEO_GW_MO:0);}for(const l of S.links)if(l.kind==='sat')m+=l.mo||0;return m;}
|
||||
// What the teleports and their circuits cost a month (R.cost.sat), the island zones' circuits too.
|
||||
function satMoAll(){let m=0;for(const c in S.pops){const t=teleOf(c);if(t)m+=TPORT_MO+(t>1?TRK_MO:0)+(S.pops[c].leo===1?LEO_GW_MO:0);}for(const l of S.links)if(l.kind==='sat')m+=l.mo||0;return m+wispSatMoAll();}
|
||||
/* compute(): what users notice on the edges a satellite circuit is on. sv: the losses of the orbits there; sx: the edge's
|
||||
latency is the satellite's (no cable carries ahead of it), so it is no haul to transit on the ground. Returns how many
|
||||
edges there were, for compute() to know a satellite is in the picture at all. */
|
||||
|
|
|
|||
111
src/game/60-features/46-wisp-zones.js
Normal file
111
src/game/60-features/46-wisp-zones.js
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
/* ---------- Island Wi-Fi (#83): the outer islands, served from a POP in the city they look to ----------
|
||||
A zone (WISP, 10-catalog/76-wisp-zones.js) is a pool of island homes hanging off your POP in its city: no node and no
|
||||
link on the map. Its backhaul lands in that city: satellite capacity from the teleport there (GEO, then MEO with
|
||||
tracking antennas, then Starblink LEO from a gateway there) or a spur cable laid from it. What reaches the islands
|
||||
caps how many sign up (SAT_ORB[orb].wisp; all of them over a cable). Their Gbps join the city's demand (compute()), so
|
||||
they ride its routers, links and transit, and they are IPv6-only homes in your NAT64 pool from day one. A spur can be
|
||||
cut (failure 'wspur', a weeks-long repair): a satellite circuit kept beside it carries the islands meanwhile.
|
||||
State: S.pops[c].wisp[z]={day, d: Gbps of homes signed up, sat?, nxt?: a move being commissioned, sp?: the spur};
|
||||
a cut is only ever an incident. Actions: 90-actions/87-wisp-zones.js; panels: 93-ui/73-wisp-panels.js. */
|
||||
// Normal and sandbox games from the level teleports come at; never puzzles, the Architect or scenarios (weekly too).
|
||||
const wispOn=()=>!!S&&!pzOn()&&!S.ar&&!S.scn&&(S.mode==='normal'||S.mode==='sandbox')&&lvl()>=SAT_ORB.geo.lv;
|
||||
// The zones of city c, and zone z's state (null without it).
|
||||
const WISP_AT=(()=>{const m={};for(const z of Object.keys(WISP))(m[WISP[z].c]||(m[WISP[z].c]=[])).push(z);return m;})();
|
||||
const wispAt=c=>own(WISP_AT,c)?WISP_AT[c]:[];
|
||||
function wispZ(z){if(!own(WISP,z))return null;const c=WISP[z].c,W=own(S.pops,c)&&S.pops[c].wisp;return W&&own(W,z)?W[z]:null;}
|
||||
// Every zone you run: [z, its state].
|
||||
function wispAll(){const o=[];for(const c in S.pops){const W=S.pops[c].wisp;if(W)for(const z in W)o.push([z,W[z]]);}return o;}
|
||||
const wispPool=z=>WISP[z].P*eraMul();
|
||||
const wispRate=z=>EYE_RATE*arpuOf(WISP[z].c)*WISP_ARPU;
|
||||
const wispStart=z=>wispPool(z)*WISP_START;
|
||||
const wispOrb=o=>SATS[o.bird].orb;
|
||||
// Lit (cut or not); and a lit spur a cut holds down, until that day (0: none).
|
||||
const wispLit=Z=>!!Z.sp&&!(Z.sp.ready>S.day);
|
||||
function wispCut(z){let u=0;for(const i of S.inc)if(i.type==='wspur'&&i.z===z&&i.until>S.day)u=Math.max(u,i.until);return u;}
|
||||
// How many islanders may sign up over what reaches them (a cut lasts weeks; they wait for it), and how many that is.
|
||||
const wispTake=Z=>wispLit(Z)?1:Z.sat&&!(Z.sat.ready>S.day)?SAT_ORB[wispOrb(Z.sat)].wisp:0;
|
||||
const wispK=(z,Z)=>wispPool(z)*wispTake(Z);
|
||||
// What carries the islands today: the spur, unless it is cut; else the circuit, unless a solar storm holds LEO in safe mode.
|
||||
function wispLink(z,Z){if(wispLit(Z)&&!wispCut(z))return {g:WISP_SPUR_G,sp:true};const o=Z.sat;
|
||||
return o&&!(o.ready>S.day)&&!(leoStorm()&&wispOrb(o)==='leo')?o:null;}
|
||||
// Prices: a contended share of a beam, the island kit with the first order, its upkeep, the spur at today's prices.
|
||||
const wispSatMo=(bird,g)=>Math.round(satMo(bird,g)*WISP_SHARE/10)*10;
|
||||
const wispKit=z=>WISP_KIT+WISP_KIT_G*WISP[z].P;
|
||||
const wispUpMo=z=>WISP_MO+WISP_MO_G*WISP[z].P;
|
||||
const wispSpurCost=z=>Math.round((WISP_SPUR+WISP_SPUR_KM*WISP[z].km)*hwMul('build')/1000)*1000;
|
||||
const wispSpurMo=z=>Math.round(WISP_SPUR_MO+WISP_SPUR_MO_KM*WISP[z].km);
|
||||
const wispSpurDays=z=>leadDays(Math.round(WISP_SPUR_D0+WISP_SPUR_DKM*WISP[z].km));
|
||||
// The birds that see both the city and the zone, by orbit (GEO, MEO, LEO), then the cheapest (as satBirds).
|
||||
function wispBirds(z){const W=WISP[z],C=CITY[W.c];return Object.keys(SATS).filter(id=>satPairAt(id,C,W)).sort((x,y)=>SAT_ORD.indexOf(SATS[x].orb)-SAT_ORD.indexOf(SATS[y].orb)||SAT_PROV[SATS[x].p].pg-SAT_PROV[SATS[y].p].pg);}
|
||||
// One way over bird id from the city to the zone, in ms (LEO: Starblink's own bent pipe, leoMsLL).
|
||||
function wispMs(z,id){const W=WISP[z];return SATS[id].orb==='leo'?leoMsLL(W.c,W.lat,W.lon):satKmAt(id,CITY[W.c],W)/SAT_C+SAT_ORB[SATS[id].orb].proc;}
|
||||
/* Why zone z cannot take a circuit on bird id (g Gbps, when given); '' when it can. Its capacity comes down at the teleport
|
||||
in the zone's own city: tracking antennas for MEO, a Starblink gateway on your fiber for LEO (and none once your own
|
||||
constellation carries traffic, leoReachLL). One circuit and one move at a time. */
|
||||
function wispSatWhy(z,id,g){if(!own(WISP,z))return tr('satellites.no_such_circuit');const W=WISP[z],c=W.c,C=CITY[c].name;
|
||||
if(lvl()<SAT_ORB.geo.lv)return tr('satellites.teleports_unlock_at_level',{lv:SAT_ORB.geo.lv});
|
||||
const B=own(SATS,id)?SATS[id]:null;if(!B||!wispOn())return tr('satellites.no_such_circuit');const O=SAT_ORB[B.orb];
|
||||
if(!own(S.pops,c))return tr('wisp.why_no_pop',{city:C});
|
||||
if(lvl()<O.lv)return tr('satellites.orbit_unlocks_at_level',{orb:O.n,lv:O.lv});
|
||||
if(!teleOf(c))return tr('satellites.no_teleport_in_city',{city:C});
|
||||
const far=tr('satellites.out_of_footprint',{bird:B.n,a:C,b:W.n});if(!satPairAt(id,CITY[c],W))return far;
|
||||
if(B.orb==='meo'&&teleOf(c)<2)return tr('satellites.needs_tracking_antennas',{city:C});
|
||||
if(B.orb==='leo'){if(!leoGw(c))return tr('satellites.needs_leo_gateway',{city:C});if(!satWired(c))return tr('satellites.leo_needs_fiber',{city:C});if(leoRival())return tr('satellites.leo_no_rivals',{prov:SAT_PROV[B.p].n});
|
||||
if(!leoReachLL(c,W.lat,W.lon))return far;}
|
||||
if(g!==undefined&&!O.g.includes(g))return tr('satellites.no_such_circuit');
|
||||
const Z=wispZ(z);if(Z&&Z.nxt)return tr('wisp.why_moving');if(Z&&Z.sat&&Z.sat.bird===id)return tr('wisp.why_same',{bird:B.n});
|
||||
return '';}
|
||||
// Why zone z cannot get a spur; '' when it can.
|
||||
function wispSpurWhy(z){if(!own(WISP,z)||!wispOn())return tr('satellites.no_such_circuit');const W=WISP[z];
|
||||
if(!own(S.pops,W.c))return tr('wisp.why_no_pop',{city:CITY[W.c].name});
|
||||
if(!W.km)return tr('wisp.spur_none');if(lvl()<WISP_SPUR_LV)return tr('wisp.spur_level',{lv:WISP_SPUR_LV});
|
||||
const Z=wispZ(z);if(Z&&Z.sp)return tr('wisp.why_spur_have');return '';}
|
||||
// The zones whose circuits (running or being commissioned) start at the teleport in c; orb: only that orbit's.
|
||||
const wispSats=(c,orb)=>wispAt(c).filter(z=>{const Z=wispZ(z);return !!Z&&[Z.sat,Z.nxt].some(o=>o&&(!orb||wispOrb(o)===orb));});
|
||||
// The lit spurs no cut holds down: what a failure can find.
|
||||
const wispSpurs=()=>wispAll().filter(([z,Z])=>wispLit(Z)&&!wispCut(z)).map(([z])=>z);
|
||||
// A commissioned LEO circuit for a zone: a solar storm can find it too (leoLive).
|
||||
const wispLeoLive=()=>!!S&&wispOn()&&wispAll().some(([,Z])=>!!Z.sat&&!(Z.sat.ready>S.day)&&wispOrb(Z.sat)==='leo');
|
||||
/* compute(): each zone's homes (Gbps, with the day's viral factor) and what reaches them, added to its city's demand.
|
||||
null when you run none. by: Gbps carried, by city; L: [{z, c, zd: wanted, car: carried}]. */
|
||||
function wispIn(viral){let L=null;const by={};
|
||||
for(const [z,Z] of wispAll()){const c=WISP[z].c,k=wispLink(z,Z),zd=Z.d*viral,car=k?Math.min(zd,k.g):0;(L||(L=[])).push({z,c,zd,car});if(car>0)by[c]=(by[c]||0)+car;}
|
||||
return L?{by,L}:null;}
|
||||
/* computeMoney(): what the islanders pay for what reached them, served as well as their city (sfOf), and the towers and
|
||||
lit spurs' upkeep. R.wisp[z]: d wanted, car carried, sf served, k the take-up cap today. Circuit rent is the
|
||||
satellite row (satMoAll). */
|
||||
function wispMoney(R2,C,V){const L=R2.wispL;if(!L.length)return;let v=0,up=0;
|
||||
for(const x of L){const Z=wispZ(x.z),sf=x.zd>0?sfOf(R2,x.c)*x.car/x.zd:0;R2.wisp[x.z]={d:x.zd,car:x.car,sf,k:wispK(x.z,Z)};v+=x.zd*sf*wispRate(x.z);
|
||||
up+=wispUpMo(x.z)+(wispLit(Z)?wispSpurMo(x.z):0);}
|
||||
V.wisp=v;if(up>0)C.wisp=up;}
|
||||
// The rent of the zones' circuits, from the order on (satMoAll).
|
||||
const wispSatMoAll=()=>wispAll().reduce((a,[,Z])=>a+(Z.sat?Z.sat.mo||0:0)+(Z.nxt?Z.nxt.mo||0:0),0);
|
||||
/* The day's take-up, after broadband's (10-day-tick.js), on the last routing: served well, more islanders sign up toward
|
||||
the cap; served badly, they leave down to the floor; above a cap that dropped, they drift down to it. */
|
||||
function wispGrow(){if(!wispOn())return;for(const [z,Z] of wispAll()){const r=R&&R.wisp&&R.wisp[z],sf=r?r.sf:0,K=wispK(z,Z),fl=wispStart(z);
|
||||
if(sf<0.9)Z.d=Math.max(fl,Z.d*(1-(0.9-sf)*0.04));else if(Z.d<K)Z.d+=WISP_GROW*sf*Z.d*(1-Z.d/K);else if(Z.d>K)Z.d-=(Z.d-K)*0.01;}}
|
||||
// The day's news: a move done, the first islanders online, a spur lit.
|
||||
function wispDay(d){if(!wispOn())return;for(const [z,Z] of wispAll()){const zone=esc(WISP[z].n),go=[{l:tr('common.open'),act:'wispOpen',args:{z}}];
|
||||
const mv=!!Z.nxt&&!(Z.nxt.ready>d);if(mv){Z.sat=Z.nxt;delete Z.nxt;toast(tr('wisp.moved',{zone,bird:esc(SATS[Z.sat.bird].n)}),'good',go);}
|
||||
else if(Z.sat&&Z.sat.ready===d&&!(Z.sp&&Z.sp.ready<d))toast(tr('wisp.online',{zone}),'good',go);
|
||||
if(Z.sp&&Z.sp.ready===d){toast(tr('wisp.spur_ready',{zone}),'goal',go);sfx('coin');}}}
|
||||
/* Saves: a zone sits at its own city's POP, a circuit on a bird that sees both ends from a teleport able to work it (MEO:
|
||||
tracking antennas; LEO: a Starblink gateway), at a size its orbit sells; a spur only where one can be laid. Runs after
|
||||
satSanitize (the teleports first), and repairs in place, so live state is what a reload makes of it. */
|
||||
function wispSanitize(s){
|
||||
for(const c of Object.keys(s.pops)){const p=s.pops[c];if(p.wisp===undefined)continue;
|
||||
if(!p.wisp||typeof p.wisp!=='object'||Array.isArray(p.wisp)){delete p.wisp;continue;}
|
||||
for(const z of Object.keys(p.wisp)){const Z=p.wisp[z];if(!own(WISP,z)||WISP[z].c!==c||!Z||typeof Z!=='object'||Array.isArray(Z)){delete p.wisp[z];continue;}const W=WISP[z];
|
||||
Z.day=int(Z.day,0,s.day,s.day);Z.d=Math.min(W.P*20,Math.max(0,num(Z.d,0)));
|
||||
const ok=o=>{const B=o&&typeof o==='object'&&typeof o.bird==='string'&&own(SATS,o.bird)?SATS[o.bird]:null;
|
||||
if(!B||!p.tele||B.orb==='meo'&&p.tele<2||B.orb==='leo'&&p.leo!==1||!satPairAt(o.bird,CITY[c],W))return false;
|
||||
const G=SAT_ORB[B.orb].g;if(!G.includes(o.g))o.g=G.reduce((x,v)=>v<=num(o.g,0)?v:x,G[0]);
|
||||
o.mo=Math.max(0,Math.round(num(o.mo,0)));o.day=int(o.day,0,s.day,s.day);o.ready=int(o.ready,0,1e7,o.day);return true;};
|
||||
for(const k of ['sat','nxt'])if(Z[k]!==undefined&&!ok(Z[k]))delete Z[k];
|
||||
if(Z.nxt&&!Z.sat){Z.sat=Z.nxt;delete Z.nxt;}
|
||||
if(Z.sp!==undefined){const o=Z.sp;if(!W.km||!o||typeof o!=='object')delete Z.sp;else{o.day=int(o.day,0,s.day,s.day);o.ready=int(o.ready,o.day,o.day+3650,o.day);}}}
|
||||
if(!Object.keys(p.wisp).length)delete p.wisp;}
|
||||
// A cut holds down a spur that is there, at the zone's own city.
|
||||
s.inc=s.inc.filter(i=>i.type!=='wspur'||typeof i.z==='string'&&own(WISP,i.z)&&i.ref===WISP[i.z].c&&!!(s.pops[i.ref]&&s.pops[i.ref].wisp&&own(s.pops[i.ref].wisp,i.z)&&s.pops[i.ref].wisp[i.z].sp));}
|
||||
// An incident for a zone that is gone (closed, or its POP decommissioned): purgeInc() drops it.
|
||||
const wispIncOk=i=>typeof i.z==='string'&&own(WISP,i.z)&&!!wispZ(i.z)&&!!wispZ(i.z).sp;
|
||||
|
|
@ -110,7 +110,7 @@ function bstdPlan(intern){const J=[];J.held=[];J.wv=[];if(!S||!S.popStd||pzOn())
|
|||
// the floor for every job after it.
|
||||
// mo: what it does to the month's IPv4 bill, counted one city after another on a copy, so the sum is all of them done.
|
||||
if(D.v6&&ip4On()){const v6=cs.filter(ip6Todo).sort((a,b)=>ip6Homes(S.pops[b])-ip6Homes(S.pops[a])||(a<b?-1:1));
|
||||
const eye=(R.rev&&R.rev.eyeballs)||0,m=b=>b.box+b.box64+b.refund,s={ip4:S.ip4,biz:S.biz,pops:{...S.pops}};let b0=v6.length?m(ip4Bill(eye,s)):0;
|
||||
const eye=ip4Eye(),m=b=>b.box+b.box64+b.refund,s={ip4:S.ip4,biz:S.biz,pops:{...S.pops}};let b0=v6.length?m(ip4Bill(eye,s)):0;
|
||||
for(const c of v6){const p=S.pops[c];s.pops[c]={...p,bb:{...p.bb,v6:1}};const b1=m(ip4Bill(eye,s)),mo=b1-b0;b0=b1;
|
||||
job('pop','v6','6:'+c,c+' IPv6',ip6Cost(c),mo,()=>{if(!ip6Todo(c))return false;ACT.ip6Go({city:c});return !!S.pops[c].bb.v6e;},{c,later:true,price:()=>ip6Cost(c)});}}
|
||||
// Ports: LAG members up to the standard, then the members split over both buildings.
|
||||
|
|
|
|||
|
|
@ -99,8 +99,11 @@ function compute(){RW.gen++;
|
|||
const bizBw={};for(const b of S.biz){const T=BIZ_T[b.type];if(!T.l2&&!T.fiber&&(!T.event||eventLive(b))){if(T.orbit){const g=PX&&PX.gs[b.id];if(g)bizBw[g]=(bizBw[g]||0)+PX.term[b.id];continue;}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');
|
||||
// Island Wi-Fi (46-wisp-zones.js): a zone's homes are its city's demand, as far as its backhaul reaches them.
|
||||
const WZI=wispOn()?wispIn(viral):null;R2.wispL=WZI?WZI.L:[];
|
||||
(()=>{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;
|
||||
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 wz=WZI?WZI.by[c]||0:0;if(wz)R2.cityWisp[c]=wz;const d0=eye+wz+biz;
|
||||
// Goggle video is throttled in Russia (#70): people there get half of it, so they ask for half. It is not
|
||||
// traffic you failed to deliver, and it does not cross your links only to be thrown away.
|
||||
const ru=ruCity(c),thr=n=>n==='ggl'&&ru?0.5:1;let sa=shArr.get(SH),sm=shSum.get(SH);if(!sa){shArr.set(SH,sa=NETS.map(n=>SH[n.id]||0));shSum.set(SH,sm=[]);}
|
||||
|
|
@ -266,11 +269,12 @@ function computeMoney(R2,PX=null){
|
|||
C.wholesale=0;C.levy=0;const lev=scnRule('levy');for(const c in S.pops){const sf=sfOf(R2,c)*(R2.bbF[c]??1),v=R2.cityEye[c]*sf*EYE_RATE*arpuOf(c);V.eyeballs+=v;if(CITY[c].au){if(lev)C.levy+=v*AU_LEVY;else C.wholesale+=v*AU_WHOLESALE;}}
|
||||
const ids=linkIds();for(const b of S.biz){if(capPend(b)||BIZ_T[b.type].orbit)continue;const sf=BIZ_T[b.type].fiber?(fiberOk(b,ids)?1:0):BIZ_T[b.type].l2?clamp((R2.l2[b.id]||0)/b.bw,0,1):sfOf(R2,b.city)*(R2.tgtF[b.id]??1);V.business+=b.bw*b.rate*Math.min(1,sf/0.95);}
|
||||
for(const c in S.myIx)V.ix+=S.myIx[c].members.length*MYIX_FEE;
|
||||
wispMoney(R2,C,V);
|
||||
ip4Money(C,V);
|
||||
if(PX)pieMoney(PX,R2,V);
|
||||
// The UK grant for Pitcairn, its satellite tier once orbit is known; the Rural Digital Pie Fund (99-pie-subsidies.js).
|
||||
{const on=grantOn(R2),sky=!on&&!!PX&&grantSky(R2);V.grant=on?GRANT_MO:sky?GRANT_SKY_MO:0;if(PX)V.gov=pieGovMo();if(PX)R2.pie.gov={rdf:V.gov||0,sky:sky?GRANT_SKY_MO:0};}
|
||||
C.revshare=(S.loans||[]).reduce((a,l)=>a+(BANKS[l.bank].equity||l.bal>0?l.share||0:0),0)*(V.eyeballs+V.business+V.ix+(V.orbit||0));
|
||||
C.revshare=(S.loans||[]).reduce((a,l)=>a+(BANKS[l.bank].equity||l.bal>0?l.share||0:0),0)*(V.eyeballs+V.business+V.ix+(V.orbit||0)+(V.wisp||0));
|
||||
R2.costMo=Object.values(C).reduce((a,b)=>a+b,0);
|
||||
R2.revMo=V.eyeballs+V.business+V.ix+V.grant+(V.gov||0)+(V.orbit||0)+(V.ip4||0);
|
||||
R2.revMo=V.eyeballs+V.business+V.ix+V.grant+(V.gov||0)+(V.orbit||0)+(V.ip4||0)+(V.wisp||0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ function sanitize(s){
|
|||
cmFix(s);
|
||||
pieSanitize(s);pieIncFix(s);volFix(s);
|
||||
ip4Fix(s);
|
||||
satSanitize(s);
|
||||
satSanitize(s);wispSanitize(s);
|
||||
if(s.te){if(typeof s.te!=='object')s.te=null;else{s.te.on=!!s.te.on;s.te.script=typeof s.te.script==='string'?s.te.script.slice(0,4000):'';}}
|
||||
return s;}
|
||||
function migrate(s){sanitize(s);
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ function* failureRun(only){
|
|||
if(fabsUsed.length)opts.push(['fabric',1.5]);
|
||||
// A geomagnetic storm: rare, and only while a LEO circuit of yours is in the sky.
|
||||
if(!leoStorm()&&leoLive())opts.push(['leostorm',LEO_STORM_W]);
|
||||
// An island zone's spur cable (46-wisp-zones.js): only while one is lit and whole, so other games draw as before.
|
||||
const wsp=wispOn()?wispSpurs():[];if(wsp.length)opts.push(['wspur',WISP_CUT_W*wsp.length]);
|
||||
// Amp huts and ROADMs carry every channel in the glass, the expresses' too; an optic of its own needs a channel of its own.
|
||||
const lit=S.links.filter(l=>l.kind==='df'&&dfCap(l)>0&&!linkDown(l)),amps=lit.concat(bare);if(amps.length)opts.push(['amp',1.5+amps.length*0.3]);if(lit.length)opts.push(['optic',1.5+lit.length*0.3]);
|
||||
// Two vendors' idea of the same protocol: the higher the backbone runs, the more often they disagree.
|
||||
|
|
@ -124,6 +126,11 @@ function* failureRun(only){
|
|||
const f=pick(fabsUsed);S.ev.fab=S.ev.fab||{};S.ev.fab[f]=S.day+2+Math.floor(Math.random()*3);
|
||||
addInc({type,ref:f,until:S.ev.fab[f],msg:tr('failures.fabric_is_having_a_bad_day',{fabric:FAB[f].name}),cost:0});
|
||||
}else if(type==='leostorm'){leoStormGo();
|
||||
}else if(type==='wspur'){
|
||||
// The repair ship comes from far away: weeks, unless cuts mend on a timer (Best Effort).
|
||||
if(!wsp.length)return;const z=pick(wsp),Z=wispZ(z),c=WISP[z].c,dur=rule('sea')==='timer'?3+Math.floor(Math.random()*5):14+Math.floor(Math.random()*22),
|
||||
en=pick([N_('wisp.cut_anchor'),N_('wisp.cut_trawler'),N_('wisp.cut_slide'),...(WISP[z].v?[N_('wisp.cut_volcano')]:[])]),up=!!Z.sat&&!(Z.sat.ready>S.day);
|
||||
addInc({type,ref:c,z,until:S.day+dur,msg:tr(en,{zone:WISP[z].n,city:CITY[c].name})+' '+(up?tr('wisp.cut_sat'):tr('wisp.cut_dark')),cost:WISP_RUSH,fix:tr('wisp.rush')},en);
|
||||
}else if(type==='ddos'){ddosAttack(false);yield;yield* ddosNewsRun();return;
|
||||
}
|
||||
// This failure's incident, kept before the routing: the player may repair it (or another) while the worker routes.
|
||||
|
|
@ -131,13 +138,13 @@ function* failureRun(only){
|
|||
yield;
|
||||
if(!last)return;
|
||||
last.impact=Math.max(0,before-R.served);
|
||||
if(before>1&&last.impact<before*0.03&&type!=='ddos'){S.stats.survived++;toast(`<b>${incTitle(type)}</b><br>${esc(last.msg)} ${tr('failures.traffic_rerouted_customers_barely')}`,'good',[],incOpen(last));}
|
||||
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&&S.inc.includes(last)?[{l:`${last.fix||tr('common.rush_repair')} ${fmt$(last.cost)}`,act:'fixInc',args:{id:last.id}}]:[]).concat(paused?[resumeAct()]:[]),incOpen(last));}
|
||||
if(before>1&&last.impact<before*0.03&&type!=='ddos'&&type!=='wspur'){S.stats.survived++;toast(`<b>${incTitle(type)}</b><br>${esc(last.msg)} ${tr('failures.traffic_rerouted_customers_barely')}`,'good',[],incOpen(last));}
|
||||
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&&S.inc.includes(last)?[{l:`${last.fix||tr('common.rush_repair')} ${fmt$(last.cost)}`,act:'fixInc',args:{id:last.id}}]:[]).concat(type==='wspur'?[{l:tr('common.open'),act:'wispOpen',args:{z:last.z}}]:[]).concat(paused?[resumeAct()]:[]),incOpen(last));}
|
||||
sfx('alert');
|
||||
}
|
||||
const gamingCount=()=>S.biz.reduce((n,b)=>n+(BIZ_T[b.type]?.gaming?1:0),0);
|
||||
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'),interop:tr('core.interop_failure'),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'),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'),leostorm:tr('pie_inc.t_storm')}[t]||pieIncTitle(t)||tr('common.incident');}
|
||||
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'),interop:tr('core.interop_failure'),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'),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'),leostorm:tr('pie_inc.t_storm'),wspur:tr('wisp.inc_title')}[t]||pieIncTitle(t)||tr('common.incident');}
|
||||
const LINKCUT_TR=['cut','redsea'],LINKCUT_ID=['fatwave','label','interop'],POPDOWN=['crash','power','oops','cleaner','maint','shutdown'],IXDOWN=['ixloop'],TDOWN=['transit','prepend'],LINKEQ=['mtu','amp','roadmff','optic'];
|
||||
function remainUntil(pred){let u=0;for(const x of S.inc)if(pred(x))u=Math.max(u,x.until);return u;}
|
||||
// Remove an incident, then restore each affected thing to whatever other incidents still hold it down.
|
||||
|
|
@ -164,4 +171,4 @@ function clearInc(i){
|
|||
else if(T.startsWith('pie'))pieIncClear(i);
|
||||
else if(T==='optic'){const l=S.links.find(x=>x.id===i.ref);if(l&&!S.inc.some(x=>x.type==='optic'&&x.ref===i.ref))l.chFail=null;}
|
||||
}
|
||||
function purgeInc(){S.inc=S.inc.filter(i=>{const T=i.type;if(LINKCUT_TR.includes(T))return S.links.some(l=>(l.trench||l.id)===i.ref);if(LINKCUT_ID.includes(T)||LINKEQ.includes(T))return S.links.some(l=>l.id===i.ref);if(TDOWN.includes(T))return S.transit.some(t=>t.id===i.ref);if(IXDOWN.includes(T))return S.ixp[i.ref]!==undefined;if(POPDOWN.includes(T)||T==='ac')return !!S.pops[i.ref];return true;});}
|
||||
function purgeInc(){S.inc=S.inc.filter(i=>{const T=i.type;if(LINKCUT_TR.includes(T))return S.links.some(l=>(l.trench||l.id)===i.ref);if(LINKCUT_ID.includes(T)||LINKEQ.includes(T))return S.links.some(l=>l.id===i.ref);if(TDOWN.includes(T))return S.transit.some(t=>t.id===i.ref);if(IXDOWN.includes(T))return S.ixp[i.ref]!==undefined;if(POPDOWN.includes(T)||T==='ac')return !!S.pops[i.ref];if(T==='wspur')return wispIncOk(i);return true;});}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ function* dayPreRun(){
|
|||
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));
|
||||
if(p.bb.v6||p.bb.v6e)ip6Grow(p.bb,d0);}
|
||||
wispGrow();
|
||||
return d;}
|
||||
function* dayPost(d){
|
||||
yield* ddosNewsRun();ddosTrack();
|
||||
|
|
@ -63,6 +64,7 @@ function* dayPost(d){
|
|||
S.stats.peak=Math.max(S.stats.peak,R.served);volDay();
|
||||
S.hist=S.hist||[];S.hist.push({d,dem:+R.demand.toFixed(2),srv:+R.served.toFixed(2),c:+(R.egT.c||0).toFixed(2),p:+(R.egT.p||0).toFixed(2),ix:+(R.egT.ix||0).toFixed(2),t:+(R.egT.t||0).toFixed(2),l2:+(R.egT.l2||0).toFixed(2),rev:Math.round(R.revMo),cost:Math.round(R.costMo),cash:Math.round(S.cash),inc:S.inc.length});if(S.hist.length>180)S.hist.shift();
|
||||
{const top=custLevel();if(top>(S.lvl||1)){for(let lv=(S.lvl||1)+1;lv<=top;lv++){track('level_'+lv);toast(tr('day_tick.customer_level_lv_name_new_customers',{lv,name:LEVELS[lv-1].n,unlock:LEVELS[lv-1].unlock})+`<br><i>${esc(LEVELS[lv-1].q)}</i>`,'goal');}S.lvl=top;sfx('coin');}}
|
||||
wispDay(d);
|
||||
for(const l of S.links){if(l.kind!=='df')continue;
|
||||
if(l.ready===d){delete l.lay;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');}}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Teleports and satellite capacity (#83): build the gateway, rent circuits on its birds, resize them. Cancel is rmLink.
|
||||
// A Starblink gateway on a teleport sells LEO circuits from there (teleLeo, teleLeoRm).
|
||||
// A Starblink gateway on a teleport sells LEO circuits from there (teleLeo, teleLeoRm). Island zones' circuits start at
|
||||
// their city's teleport too (87-wisp-zones.js).
|
||||
Object.assign(ACT,{
|
||||
teleBuild:({city})=>{const p=S.pops[city];if(!p||teleOf(city))return;
|
||||
const why=teleWhy(city);if(why){toast(why,'bad');sfx('err');return;}
|
||||
|
|
@ -7,15 +8,15 @@ Object.assign(ACT,{
|
|||
teleTrk:({city})=>{const p=S.pops[city];if(!p||teleOf(city)!==1)return;
|
||||
const why=trkWhy(city);if(why){toast(why,'bad');sfx('err');return;}
|
||||
if(!spend(TRK_COST))return;p.tele=2;toast(tr('satellites.tracking_antennas_up',{city:CITY[city].name}),'good');after();},
|
||||
// Closing a teleport asks twice, and never while circuits still start there.
|
||||
teleRm:({city})=>{const p=S.pops[city];if(!p||!teleOf(city))return;const n=S.links.filter(l=>l.kind==='sat'&&l.a===city).length;
|
||||
// Closing a teleport asks twice, and never while circuits still start there (an island zone's too).
|
||||
teleRm:({city})=>{const p=S.pops[city];if(!p||!teleOf(city))return;const n=S.links.filter(l=>l.kind==='sat'&&l.a===city).length+wispSats(city).length;
|
||||
if(n){toast(trn('satellites.cancel_n_circuits_first',n),'bad');sfx('err');return;}
|
||||
if(UI.confirm!=='tele:'+city){UI.confirm='tele:'+city;renderPanel();return;}
|
||||
delete p.tele;delete p.leo;UI.confirm=null;toast(tr('satellites.teleport_closed',{city:CITY[city].name}));after();},
|
||||
teleLeo:({city})=>{if(!own(S.pops,city)||leoGw(city))return;const why=leoGwWhy(city);if(why){toast(why,'bad');sfx('err');return;}
|
||||
if(!spend(LEO_GW_COST))return;S.pops[city].leo=1;toast(tr('satellites.leo_gateway_up',{prov:SAT_PROV.sbk.n,city:CITY[city].name,km:SAT_ORB.leo.km.toLocaleString()}),'good');after();},
|
||||
// Closing the gateway asks twice, and never while LEO circuits still start there.
|
||||
teleLeoRm:({city})=>{if(!leoGw(city))return;const n=S.links.filter(l=>l.a===city&&leoLink(l)).length;
|
||||
teleLeoRm:({city})=>{if(!leoGw(city))return;const n=S.links.filter(l=>l.a===city&&leoLink(l)).length+wispSats(city,'leo').length;
|
||||
if(n){toast(trn('satellites.cancel_n_circuits_first',n),'bad');sfx('err');return;}
|
||||
if(UI.confirm!=='leo:'+city){UI.confirm='leo:'+city;renderPanel();return;}
|
||||
delete S.pops[city].leo;UI.confirm=null;toast(tr('satellites.leo_gateway_closed',{city:CITY[city].name}));after();},
|
||||
|
|
|
|||
30
src/game/90-actions/87-wisp-zones.js
Normal file
30
src/game/90-actions/87-wisp-zones.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Island Wi-Fi (#83): satellite capacity for a zone from its city's teleport, a spur cable, closing either (rules:
|
||||
// 60-features/46-wisp-zones.js). The first order of a zone brings the island kit too. Every act names the zone (z) only;
|
||||
// its city is the zone's own.
|
||||
Object.assign(ACT,{
|
||||
// A circuit for the zone. With one running, one on another bird is a move: the old one carries until the new one is up.
|
||||
wispSat:({z,bird,g})=>{if(!own(WISP,z))return;g=+g;const why=wispSatWhy(z,bird,g);if(why){toast(why,'bad');sfx('err');return;}
|
||||
const c=WISP[z].c,Z=wispZ(z),mo=wispSatMo(bird,g);if(!spend(mo+(Z?0:wispKit(z))))return;
|
||||
const n=leadDays(SAT_ORB[SATS[bird].orb].days),o={bird,g,mo,day:S.day,ready:S.day+n},mv=!!(Z&&Z.sat),v={cap:fmtCap(g),bird:esc(SATS[bird].n),zone:esc(WISP[z].n)};
|
||||
if(!Z){const p=S.pops[c];(p.wisp||(p.wisp={}))[z]={day:S.day,d:wispStart(z),sat:o};}else if(mv)Z.nxt=o;else Z.sat=o;
|
||||
toast(mv?trn('wisp.moving',n,v):trn('wisp.ordered',n,v),'good');after();},
|
||||
// Bigger or smaller on the same bird: a bigger one pays its new month up front, as satSize does.
|
||||
wispSatSize:({z,g})=>{if(!own(WISP,z))return;g=+g;const Z=wispZ(z),o=Z&&Z.sat;if(!o||g===o.g||!SAT_ORB[wispOrb(o)].g.includes(g))return;
|
||||
if(g>o.g&&wispOrb(o)==='leo'){const w=leoGrowWhy({a:WISP[z].c});if(w){toast(w,'bad');sfx('err');return;}}
|
||||
const mo=wispSatMo(o.bird,g);if(g>o.g&&!spend(mo))return;o.g=g;o.mo=mo;sfx('click');after();},
|
||||
// Cancelling asks twice; a move being commissioned goes with it.
|
||||
wispSatRm:({z})=>{if(!own(WISP,z))return;const Z=wispZ(z);if(!Z||!Z.sat&&!Z.nxt)return;
|
||||
if(UI.confirm!=='wsat:'+z){UI.confirm='wsat:'+z;renderPanel();return;}delete Z.sat;delete Z.nxt;UI.confirm=null;after();},
|
||||
// A spur cable from the city: the price of the day, and the island kit when the zone starts with it.
|
||||
wispSpur:({z})=>{if(!own(WISP,z))return;const why=wispSpurWhy(z);if(why){toast(why,'bad');sfx('err');return;}
|
||||
const c=WISP[z].c,Z=wispZ(z);if(!spend(wispSpurCost(z)+(Z?0:wispKit(z))))return;const n=wispSpurDays(z),sp={day:S.day,ready:S.day+n};
|
||||
if(Z)Z.sp=sp;else{const p=S.pops[c];(p.wisp||(p.wisp={}))[z]={day:S.day,d:wispStart(z),sp};}
|
||||
toast(trn('wisp.spur_ordered',n,{zone:esc(WISP[z].n)}),'good');sfx('build');after();},
|
||||
// Closing a zone asks twice: its circuits, spur, homes and any cut go with it.
|
||||
wispRm:({z})=>{if(!own(WISP,z))return;const Z=wispZ(z);if(!Z)return;
|
||||
if(UI.confirm!=='wz:'+z){UI.confirm='wz:'+z;renderPanel();return;}const p=S.pops[WISP[z].c];delete p.wisp[z];if(!Object.keys(p.wisp).length)delete p.wisp;
|
||||
S.inc=S.inc.filter(i=>!(i.type==='wspur'&&i.z===z));UI.confirm=null;if(UI.wz===z)UI.wz=null;toast(tr('wisp.closed',{zone:esc(WISP[z].n)}));after();},
|
||||
// A zone in its city's Customers tab (a view): the same button again on the open zone folds it.
|
||||
wispOpen:({z})=>{if(!own(WISP,z))return;const c=WISP[z].c,here=!!UI.sel&&UI.sel.type==='city'&&UI.sel.id===c;
|
||||
const same=here&&UI.tab==='cust'&&UI.wz===z;UI.tab='cust';UI.wz=same?null:z;if(here){UI.confirm=null;renderPanel();}else selectCity(c);},
|
||||
});
|
||||
|
|
@ -3,14 +3,14 @@ function cityPanel(c){
|
|||
// Your POP's router model, as a picture left of the name (10-catalog/25-router-art.js).
|
||||
const art=p?rgArt(p.rgen||0):'';
|
||||
let h=`<div class="ph">${art?`<span class="rgpic big phpic">${art}</span>`:''}<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)}${satFact(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.kr&&scnRule('sender')?`<span class="fact">${tr('city_panel.sender_pays_fee_per_gbps',{fee:fmt$(KR_FEE)})}</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>
|
||||
<div class="facts"><span class="fact">${tr('city_panel.g_of_eyeballs',{g:fmtG(eyeP(c))})}</span>${grantFact(c)}${satFact(c)}${wispFact(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.kr&&scnRule('sender')?`<span class="fact">${tr('city_panel.sender_pays_fee_per_gbps',{fee:fmt$(KR_FEE)})}</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>`:''}${(q=>btn(tr('city_panel.build_pop_cost_mo_mo',{cost:fmt$(popCost(c)+(q?q.cost:0)),mo:fmt$(popMo(c)+(q?q.mo:0))}),'buildPop',{city:c},'pink big',S.cash<popCost(c))+(q?`<p class="note">${q.site2||q.gen?tr('pop_std.includes_the_build_standard',{list:esc(bstdPopParts({g:q.g,rt:q.rt,site2:q.site2,gen:q.gen}).join(', ')),cost:fmt$(q.cost),mo:fmt$(q.mo)}):tr('pop_std.includes_the_standard_n_model',{n:q.rt,model:esc(RG[q.g].n),cost:fmt$(q.cost),mo:fmt$(q.mo)})}</p>`:''))(popStdQuote())}
|
||||
<p class="note">${tr('city_panel.or_drag_from_one_of_your')}</p></section>${opsTplHtml(c)}`}`;
|
||||
h+=offersHere(c)+satNoPop(c);
|
||||
h+=offersHere(c)+satNoPop(c)+wispNoPop(c);
|
||||
const trs=NETS.filter(n=>sellsAt(n,c));
|
||||
const fh=FABS.filter(f=>f.cities.includes(c));
|
||||
if(ix&&fh.length){if(remoteCities().includes(c))h+=ixSection(c).replace('<h3>'+tr('common.internet_exchange')+'</h3>','<h3>'+tr('city_panel.remote_peering_at_the_ix')+'</h3>');
|
||||
|
|
@ -34,7 +34,7 @@ function cityPanel(c){
|
|||
<div class="kv"><span>${tr('city_panel.network_wide_peering_ratio')}</span><b>${pct(R.peerShare||0)}</b></div><p class="note">${tr('city_panel.more_traffic_over_peering_pnis_and')}</p>
|
||||
${sf<0.9?`<p class="why">${tr('city_panel.customers_are_unhappy_and_leaving')}</p>`:''}
|
||||
<div class="btns">${p.boost>S.day?`<span class="tag st on">${tr('city_panel.ad_campaign_n_d_left',{n:p.boost-S.day})}</span>`:btn(tr('city_panel.run_ad_campaign_8k_2_growth'),'ad',{city:c},'',S.cash<8000)}</div>${ip6Html(c)}`;}
|
||||
h+=`</section><section><h3>${tr('common.business_customers')}</h3>`;
|
||||
h+=`</section>`+wispHtml(c)+`<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)}${clTermTxt(b)?' · '+clTermTxt(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(--tx-red,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(--tx-red,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):''}${pathCtl(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>`;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ function decomModal(){const sel=[...(UI.decom||[])],im=decomImpact(sel),all=Obje
|
|||
const rows=all.map(c=>`<label class="row" style="cursor:pointer"><input type="checkbox" data-act="decomToggle" data-args='${esc(JSON.stringify({city:c}))}' ${sel.includes(c)?'checked':''}><div class="grow"><div class="nm">${esc(CITY[c].name)}${c===S.home?` <span class="tag st">${tr('common.home')}</span>`:''}</div><div class="meta">${trn('decommission.n_link',S.links.filter(l=>l.a===c||l.b===c).length)} · ${trn('decommission.n_customer',S.biz.filter(b=>bCities(b).includes(c)).length)}</div></div></label>`).join('');
|
||||
openModal(`<div style="display:flex;align-items:center"><h2 style="font-size:24px">${tr('common.decommission_pops')}</h2><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div>
|
||||
<p class="lead" style="margin-top:6px">${tr('decommission.pick_the_pops_to_shut_down')}</p>${rows}
|
||||
${sel.length?`<div class="kv"><span>${tr('common.links_removed')}</span><b>${im.links.length}</b></div><div class="kv"><span>${tr('decommission.eyeballs_you_stop_serving')}</span><b>${fmtG(im.eye)}</b></div><div class="kv"><span>${trn('decommission.n_customer_let_go',im.biz.length)}</span><b style="color:var(--tx-red,var(--bad))">${fmt$(im.fee)}</b></div>${im.biz.length?`<p class="meta">${im.biz.map(b=>esc(b.name)+' '+fmt$(im.pen(b))).join(' · ')}</p>`:''}`:''}
|
||||
${sel.length?`<div class="kv"><span>${tr('common.links_removed')}</span><b>${im.links.length}</b></div><div class="kv"><span>${tr('decommission.eyeballs_you_stop_serving')}</span><b>${fmtG(im.eye)}</b></div><div class="kv"><span>${trn('decommission.n_customer_let_go',im.biz.length)}</span><b style="color:var(--tx-red,var(--bad))">${fmt$(im.fee)}</b></div>${im.biz.length?`<p class="meta">${im.biz.map(b=>esc(b.name)+' '+fmt$(im.pen(b))).join(' · ')}</p>`:''}${(z=>z.length?`<p class="why">${tr('wisp.decom',{list:z.map(x=>esc(WISP[x].n)).join(', ')})}</p>`:'')(sel.flatMap(c=>wispAt(c).filter(wispZ)))}`:''}
|
||||
${left<1?`<p class="why">${tr('decommission.keep_at_least_one_pop')}</p>`:''}
|
||||
<div class="btns" style="margin-top:10px">${btn(sel.length?trn('decommission.decommission_n_pop_pay_fee',sel.length,{fee:fmt$(im.fee)}):tr('decommission.pick_a_pop'),'decomGo',{},'red',!sel.length||left<1)}${btn(tr('common.keep_them'),'closeModal',{},'ghost')}</div>`);}
|
||||
function decommission(cities){const set=new Set(cities),im=decomImpact(cities),lids=new Set(im.links.map(l=>l.id)),bids=new Set(im.biz.map(b=>b.id));
|
||||
|
|
|
|||
|
|
@ -16,12 +16,13 @@ function teleHtml(c){if(pzOn())return '';const t=teleOf(c),from=satFrom(c),open=
|
|||
<div class="meta">${satInView(c)}</div>`;
|
||||
for(const l of out){const u=capOf(l)?(R.load[l.id]||0)/capOf(l):0;
|
||||
h+=`<div class="row"><div class="grow"><div class="nm">→ ${CITY[l.b].name}${l.standby?' <span class="tag st">'+tr('common.standby')+'</span>':''}</div><div class="meta">${capName(l)} · ${esc(satName(l))}${l.ready>S.day?' · '+tr('city_panel.ready_in_n_d',{n:l.ready-S.day}):''} · ${tr('common.price_mo',{price:fmt$(l.mo)})}</div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div></div>${btn(tr('common.open'),'selLink',{id:l.id},'ghost sm')}</div>`;}
|
||||
h+=`<div class="btns">${btn(tr('satellites.rent_satellite_capacity'),'satOpen',{a:c},'pink sm')}${t===1&&lvl()>=SAT_ORB.meo.lv&&meo?btn(tr('satellites.add_tracking_antennas_cost_mo',{cost:fmt$(TRK_COST),mo:fmt$(TRK_MO)}),'teleTrk',{city:c},'sm',S.cash<TRK_COST):''}${out.length?'':btn(cf?tr('satellites.really_close_it'):tr('satellites.close_the_teleport'),'teleRm',{city:c},'ghost sm')}</div>
|
||||
h+=wispTeleRows(c);
|
||||
h+=`<div class="btns">${btn(tr('satellites.rent_satellite_capacity'),'satOpen',{a:c},'pink sm')}${t===1&&lvl()>=SAT_ORB.meo.lv&&meo?btn(tr('satellites.add_tracking_antennas_cost_mo',{cost:fmt$(TRK_COST),mo:fmt$(TRK_MO)}),'teleTrk',{city:c},'sm',S.cash<TRK_COST):''}${out.length||wispSats(c).length?'':btn(cf?tr('satellites.really_close_it'):tr('satellites.close_the_teleport'),'teleRm',{city:c},'ghost sm')}</div>
|
||||
${t===1&&lvl()<SAT_ORB.meo.lv&&meo?`<p class="note">${tr('satellites.meo_comes_at_level',{lv:SAT_ORB.meo.lv})}</p>`:''}`;
|
||||
h+=leoHtml(c);}
|
||||
// Before the build: what its dishes would see and reach at your level, and no button to a teleport that reaches nothing.
|
||||
else if(open){const why=teleWhy(c),n=why?0:satTargets(c).filter(x=>satBirds(c,x).some(id=>lvl()>=SAT_ORB[SATS[id].orb].lv)).length;
|
||||
h+=`<p class="lead">${tr('satellites.a_teleport_is_a_satellite_gateway')}</p><div class="meta">${satInView(c)}${why?'':' '+trn('satellites.n_places_in_reach',n)}</div>${why&&teleSees(c).length?`<div class="why">${esc(why)}</div>`:''}
|
||||
else if(open){const why=teleWhy(c),n=why?0:satTargets(c).filter(x=>satBirds(c,x).some(id=>lvl()>=SAT_ORB[SATS[id].orb].lv)).length,nz=why||!wispOn()?0:wispAt(c).length;
|
||||
h+=`<p class="lead">${tr('satellites.a_teleport_is_a_satellite_gateway')}</p><div class="meta">${satInView(c)}${why?'':' '+trn('satellites.n_places_in_reach',n)}</div>${nz?`<div class="meta">${tr('wisp.tele_reaches')} ${trn('wisp.n_zones',nz)}</div>`:''}${why&&teleSees(c).length?`<div class="why">${esc(why)}</div>`:''}
|
||||
<div class="btns">${btn(tr('satellites.build_a_teleport_cost_mo',{cost:fmt$(TPORT_COST),mo:fmt$(TPORT_MO)}),'teleBuild',{city:c},'sm',S.cash<TPORT_COST||!!why)}</div>`;}
|
||||
if(from.length)h+=satReach(c,from);
|
||||
return h+`</section>`;}
|
||||
|
|
@ -31,11 +32,12 @@ function leoHtml(c){const O=SAT_ORB.leo;if(!satSees(LEO_BIRD,c))return '';
|
|||
if(lvl()<O.lv)return `<p class="note">${tr('satellites.leo_comes_at_level',{lv:O.lv})}</p>`;
|
||||
if(!leoGw(c)){const why=leoGwWhy(c);
|
||||
return `${why?`<div class="why">${esc(why)}</div>`:''}<div class="btns">${btn(tr('satellites.host_leo_gateway_cost_mo',{cost:fmt$(LEO_GW_COST),mo:fmt$(LEO_GW_MO)}),'teleLeo',{city:c},'sm',!!why||S.cash<LEO_GW_COST)}</div>`;}
|
||||
const out=S.links.filter(l=>l.a===c&&leoLink(l)),n=satTargets(c).filter(x=>satPairOk(LEO_BIRD,c,x)).length,C=CITY[c].name;
|
||||
// An island zone of this city over LEO lands here too (46-wisp-zones.js).
|
||||
const out=S.links.filter(l=>l.a===c&&leoLink(l)),zl=wispSats(c,'leo'),n=satTargets(c).filter(x=>satPairOk(LEO_BIRD,c,x)).length,C=CITY[c].name;
|
||||
let h=`<div class="kv"><span>${tr('satellites.leo_gateway')}</span><b>${esc(SAT_PROV.sbk.n)} · ${tr('common.price_mo',{price:fmt$(LEO_GW_MO)})}</b></div><div class="meta">${trn('satellites.n_in_leo_reach',n,{km:O.km.toLocaleString()})}</div>`;
|
||||
if(!satWired(c))h+=`<div class="why">${tr('satellites.leo_gateway_unwired',{city:C})}</div>`;
|
||||
if(!out.length)return h+`<div class="btns">${btn(UI.confirm==='leo:'+c?tr('satellites.really_close_it'):tr('satellites.close_the_leo_gateway'),'teleLeoRm',{city:c},'ghost sm')}</div>`;
|
||||
const land=out.reduce((a,l)=>a+(R.load[l.id]||0),0),nl=R.nodeLoad[c]||0,nc=R.nodeCap[c]||nodeCap(c)||1,un=nl/nc,
|
||||
if(!out.length&&!zl.length)return h+`<div class="btns">${btn(UI.confirm==='leo:'+c?tr('satellites.really_close_it'):tr('satellites.close_the_leo_gateway'),'teleLeoRm',{city:c},'ghost sm')}</div>`;
|
||||
const land=out.reduce((a,l)=>a+(R.load[l.id]||0),0)+zl.reduce((a,z)=>{const Z=wispZ(z),x=R.wisp&&R.wisp[z];return a+(x&&Z.sat&&wispOrb(Z.sat)==='leo'&&wispLink(z,Z)===Z.sat?x.car:0);},0),nl=R.nodeLoad[c]||0,nc=R.nodeCap[c]||nodeCap(c)||1,un=nl/nc,
|
||||
ws=S.links.filter(l=>(l.a===c||l.b===c)&&wiredLink(l)&&!linkDown(l)&&!l.standby),wl=ws.reduce((a,l)=>a+(R.load[l.id]||0),0),wc=ws.reduce((a,l)=>a+capOf(l),0),uw=wc>0?wl/wc:0;
|
||||
return h+`<div class="kv"><span>${tr('satellites.leo_landing')}</span><b>${fmtG(land)}</b></div>
|
||||
<div class="kv"><span>${tr('common.forwarding_load')}</span><b>${fmtG(nl)} / ${fmtG(nc)}</b></div><div class="bar ${barCls(un)}"><i style="width:${Math.min(100,un*100)}%"></i></div>
|
||||
|
|
|
|||
63
src/game/93-ui/73-wisp-panels.js
Normal file
63
src/game/93-ui/73-wisp-panels.js
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
// Island Wi-Fi on screen (#83): a city's fact chip and teaser, the zones in its Customers tab, their rows at the teleport.
|
||||
// Rows are laid out as the teleport section's (name, meta, a bar, small buttons that wrap), so they fit a phone at 360 px.
|
||||
const wispFact=c=>{if(!wispOn())return '';const n=wispAt(c).length;return n?`<span class="fact">🏝️ ${trn('wisp.n_zones',n)}</span>`:'';};
|
||||
// A city without a POP of yours: what its islands are, and that a POP comes first.
|
||||
function wispNoPop(c){if(!wispOn()||S.pops[c])return '';const zs=wispAt(c);if(!zs.length)return '';
|
||||
return `<section><h3>🏝️ ${tr('wisp.section')}</h3><p class="lead">${tr('wisp.no_pop',{list:zs.map(z=>`<b>${esc(WISP[z].n)}</b> (${tr('wisp.pool',{g:fmtG(wispPool(z))})})`).join(', ')})}</p></section>`;}
|
||||
// A zone's status: what carries it today, or why nothing does.
|
||||
function wispStatus(z,Z){if(!Z)return {t:tr('wisp.st_none'),k:'st'};if(wispLit(Z))return wispCut(z)?{t:tr('wisp.st_cut'),k:'restrictive'}:{t:tr('wisp.st_spur'),k:'open'};
|
||||
const o=Z.sat;if(o&&!(o.ready>S.day))return {t:SAT_ORB[wispOrb(o)].n,k:''};return o||Z.sp?{t:tr('wisp.st_soon'),k:'st'}:{t:tr('wisp.st_none'),k:'st'};}
|
||||
// In a POP's Customers tab, after Home broadband: one row per zone, one of them open at a time (UI.wz).
|
||||
function wispHtml(c){if(!wispOn()||!S.pops[c])return '';const zs=wispAt(c);if(!zs.length)return '';
|
||||
return `<section><h3>🏝️ ${tr('wisp.section')}</h3><p class="lead">${tr('wisp.lead',{rate:fmt$(wispRate(zs[0]))})}</p>${zs.map(wispRow).join('')}</section>`;}
|
||||
function wispRow(z){const W=WISP[z],Z=wispZ(z),r=R.wisp&&R.wisp[z],P=wispPool(z),st=wispStatus(z,Z),open=UI.wz===z,d=Z?Z.d:0,sf=r?r.sf:0;
|
||||
let h=`<div class="row"><div class="grow"><div class="nm">${esc(W.n)} <span class="tag ${st.k}">${st.t}</span></div><div class="meta">${tr('wisp.pool',{g:fmtG(P)})}${Z?' · '+tr('pie_gov.served',{p:pct(sf)}):''}</div>${Z?`<div class="bar me"><i style="width:${Math.min(100,d/P*100)}%"></i></div>`:''}</div>${btn(open?tr('common.close'):tr('common.open'),'wispOpen',{z},'ghost sm')}</div>`;
|
||||
return open?h+wispOpenHtml(z,Z,r):h;}
|
||||
// The open zone: its homes and money, its backhaul (the circuit, the birds to order on), the spur, closing it.
|
||||
function wispOpenHtml(z,Z,r){const K=Z?wispK(z,Z):0,k=Z?wispLink(z,Z):null;let h='';
|
||||
if(Z){const sf=r?r.sf:0,cl=sf<0.9?'var(--tx-red,var(--bad))':'var(--eye)';
|
||||
h+=`<div class="kv"><span>${tr('wisp.homes_online')}</span><b>${tr('city_panel.a_of_b',{a:fmtG(Z.d),b:fmtG(K)})}</b></div>
|
||||
<div class="kv"><span>${tr('wisp.served')}</span><b style="color:${cl}">${pct(sf)}</b></div>
|
||||
<div class="kv"><span>${tr('common.revenue')}</span><b>${tr('common.price_mo',{price:fmt$(r?r.d*r.sf*wispRate(z):0)})}</b></div>
|
||||
<div class="kv"><span>${tr('wisp.upkeep')}</span><b>${tr('common.price_mo',{price:fmt$(wispUpMo(z)+(wispLit(Z)?wispSpurMo(z):0))})}</b></div>
|
||||
${k&&r&&r.d>=k.g*0.98?`<p class="why">${tr('wisp.full')}</p>`:''}`;}
|
||||
h+=`<p class="note">${tr('wisp.take',{geo:pct(SAT_ORB.geo.wisp),meo:pct(SAT_ORB.meo.wisp),leo:pct(SAT_ORB.leo.wisp)})}</p>${ip4On()?`<p class="note">${tr('wisp.ipv6')}</p>`:''}`;
|
||||
return `<div class="wisp">${h}${wispBackhaul(z,Z,k)}${wispSpurHtml(z,Z)}${Z?`<div class="btns">${btn(UI.confirm==='wz:'+z?tr('satellites.really_close_it'):tr('wisp.close'),'wispRm',{z},'ghost sm')}</div>`:''}</div>`;}
|
||||
// Backhaul: the circuit (and a move under way), then a row per bird that sees both the city and the islands.
|
||||
function wispBackhaul(z,Z,k){const W=WISP[z],c=W.c,C=CITY[c].name,t=teleOf(c);
|
||||
let h=`<h4 class="sub4">${tr('wisp.backhaul')}</h4>`;
|
||||
if(satOnly(c))h+=`<p class="why">${tr('wisp.double_hop',{city:C})}</p>`;
|
||||
const o=Z&&Z.sat,run=(x,now)=>{const O=SAT_ORB[wispOrb(x)],P=SAT_PROV[SATS[x.bird].p],car=now&&k===x&&R.wisp&&R.wisp[z]?R.wisp[z].car:0,u=x.g?car/x.g:0,sb=now&&k&&k.sp;
|
||||
return `<div class="row">${satLogo(P)}<div class="grow"><div class="nm">${esc(SATS[x.bird].n)} <span class="tag">${O.n}</span>${sb?` <span class="tag st">${tr('common.standby')}</span>`:''}</div><div class="meta">${fmtCap(x.g)} · ${tr('satellites.ms_round_trip',{ms:Math.round(2*wispMs(z,x.bird))})} · ${tr('common.price_mo',{price:fmt$(x.mo)})}${x.ready>S.day?' · '+tr('city_panel.ready_in_n_d',{n:x.ready-S.day}):''}</div>
|
||||
${now&&wispOrb(x)==='leo'&&leoStorm()?`<p class="why">${trn('satellites.leo_safe_mode_n_days',S.ev.sky-S.day)}</p>`:''}${now?`<div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div>`:''}</div></div>`;};
|
||||
if(o){const G=SAT_ORB[wispOrb(o)].g;h+=run(o,true)+`<div class="btns">${G.filter(g=>g!==o.g).map(g=>btn(`${g>o.g?tr('satellites.grow_to',{cap:fmtCap(g)}):tr('satellites.shrink_to',{cap:fmtCap(g)})} <small>${tr('common.price_mo',{price:fmt$(wispSatMo(o.bird,g))})}</small>`,'wispSatSize',{z,g},'sm',g>o.g&&S.cash<wispSatMo(o.bird,g))).join('')}${btn(UI.confirm==='wsat:'+z?tr('common.really_cancel'):tr('common.cancel_circuit'),'wispSatRm',{z},'ghost sm')}</div>`;}
|
||||
if(Z&&Z.nxt)h+=run(Z.nxt,false);
|
||||
if(!t){h+=`<p class="note">${tr('wisp.no_teleport',{city:C})}</p><div class="btns">${btn(tr('satellites.build_a_teleport_cost_mo',{cost:fmt$(TPORT_COST),mo:fmt$(TPORT_MO)}),'teleBuild',{city:c},'sm',S.cash<TPORT_COST||!!teleWhy(c))}</div>`;return h;}
|
||||
if(Z&&Z.nxt)return h;
|
||||
h+=o?`<p class="note">${tr('wisp.move_note')}</p>`:Z?'':`<p class="note">${tr('wisp.kit',{cost:fmt$(wispKit(z))})}</p>`;
|
||||
const kit=Z?0:wispKit(z);
|
||||
for(const id of wispBirds(z)){if(o&&o.bird===id)continue;const B=SATS[id],O=SAT_ORB[B.orb],P=SAT_PROV[B.p];if(lvl()<O.lv)continue;
|
||||
// The teleport's own upgrade, where the bird needs one: tracking antennas for MEO, a Starblink gateway for LEO (and why
|
||||
// that cannot go up, when it cannot).
|
||||
const trk=B.orb==='meo'&&t<2,gw=B.orb==='leo'&&!leoGw(c),why=(trk?trkWhy(c):gw?leoGwWhy(c):'')||wispSatWhy(z,id);
|
||||
const up=trk?btn(tr('satellites.add_tracking_antennas_cost_mo',{cost:fmt$(TRK_COST),mo:fmt$(TRK_MO)}),'teleTrk',{city:c},'sm',S.cash<TRK_COST||!!trkWhy(c))
|
||||
:gw?btn(tr('satellites.host_leo_gateway_cost_mo',{cost:fmt$(LEO_GW_COST),mo:fmt$(LEO_GW_MO)}),'teleLeo',{city:c},'sm',S.cash<LEO_GW_COST||!!leoGwWhy(c)):'';
|
||||
h+=`<div class="row">${satLogo(P)}<div class="grow"><div class="nm">${esc(B.n)} <span class="tag">${O.n}</span></div><div class="meta">${esc(P.n)} · ${tr('satellites.ms_round_trip',{ms:Math.round(2*wispMs(z,id))})} · ${trn('satellites.up_in_n_days',leadDays(O.days))}</div>${why?`<div class="why">${esc(why)}</div>`:''}
|
||||
<div class="btns">${up||O.g.map(g=>btn(`${fmtCap(g)} <small>${tr('common.price_mo',{price:fmt$(wispSatMo(id,g))})}</small>`,'wispSat',{z,bird:id,g},'sm',!!why||S.cash<wispSatMo(id,g)+kit)).join('')}</div></div></div>`;}
|
||||
return h;}
|
||||
// The spur: what it costs and takes, laying it, lit, or cut (with the incident's own rush button).
|
||||
function wispSpurHtml(z,Z){const W=WISP[z],c=W.c;let h=`<h4 class="sub4">${tr('wisp.spur')}</h4>`;
|
||||
if(!W.km)return h+`<p class="note">${tr('wisp.spur_none')}</p>`;
|
||||
const sp=Z&&Z.sp;
|
||||
if(!sp){const why=wispSpurWhy(z),cost=wispSpurCost(z)+(Z?0:wispKit(z));
|
||||
return h+`<p class="lead">${tr('wisp.spur_lead',{km:W.km.toLocaleString(),city:CITY[c].name})}</p><div class="meta">${tr('common.price_mo',{price:fmt$(wispSpurMo(z))})} · ${trn('satellites.up_in_n_days',wispSpurDays(z))}</div>
|
||||
${why?`<div class="why">${esc(why)}</div>`:''}${lvl()<WISP_SPUR_LV?'':`<div class="btns">${btn(tr('wisp.lay_spur',{cost:fmt$(cost)}),'wispSpur',{z},'pink sm',!!why||S.cash<cost)}</div>`}`;}
|
||||
if(sp.ready>S.day){const tot=Math.max(1,sp.ready-sp.day),done=clamp((S.day-sp.day)/tot,0,1);
|
||||
return h+`<div class="kv"><span>${tr('wisp.spur_laying')}</span><b>${tr('common.n_days_left',{n:sp.ready-S.day})}</b></div><div class="bar me"><i style="width:${done*100}%"></i></div>`;}
|
||||
const cut=wispCut(z);if(!cut)return h+`<div class="kv"><span>${tr('wisp.spur_lit',{cap:fmtCap(WISP_SPUR_G)})}</span><b>${W.km.toLocaleString()} km</b></div>`;
|
||||
const i=S.inc.filter(x=>x.type==='wspur'&&x.z===z).sort((a,b)=>b.until-a.until)[0],up=!!Z.sat&&!(Z.sat.ready>S.day);
|
||||
return h+`<p class="why">${trn('wisp.spur_cut',cut-S.day)}</p>${i&&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>`:''}${up?'':`<p class="note">${tr('wisp.spur_trap')}</p>`}`;}
|
||||
// In the teleport section: the zones' circuits from here, each opening its zone.
|
||||
function wispTeleRows(c){const zs=wispSats(c);if(!zs.length)return '';
|
||||
return `<div class="meta">${tr('wisp.tele_reaches')}</div>`+zs.map(z=>{const Z=wispZ(z),o=Z.sat||Z.nxt,k=wispLink(z,Z),car=R.wisp&&R.wisp[z]&&k===Z.sat?R.wisp[z].car:0,u=Z.sat&&Z.sat.g?car/Z.sat.g:0;
|
||||
return `<div class="row"><div class="grow"><div class="nm">🏝️ ${esc(WISP[z].n)}${k&&k.sp&&Z.sat?' <span class="tag st">'+tr('common.standby')+'</span>':''}</div><div class="meta">${fmtCap(o.g)} · ${esc(SATS[o.bird].n)}${o.ready>S.day?' · '+tr('city_panel.ready_in_n_d',{n:o.ready-S.day}):''} · ${tr('common.price_mo',{price:fmt$(o.mo)})}</div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div></div>${btn(tr('common.open'),'wispOpen',{z},'ghost sm')}</div>`;}).join('');}
|
||||
|
|
@ -9,7 +9,7 @@ function renderDash(){checkLayer();
|
|||
<div class="dgrid">${tile(tr('common.traffic_now'),fmtG(R.served),tr('dashboard.of_g_wanted',{g:fmtG(R.demand)}))}${tile(tr('common.peak'),fmtG(S.stats.peak))}${tile(tr('dashboard.carried'),fmtVol(S.vol||0),tr('dashboard.carried_sub'))}${tile(tr('dashboard.delivered_30_days'),(up*100).toFixed(1)+'%',up>=0.999?tr('dashboard.five_nines_ish'):up>=0.99?tr('dashboard.two_nines_and_change'):tr('dashboard.customers_are_upset'))}${tile(tr('common.peering_ratio'),pct(R.peerShare||0),tr('dashboard.caches_pnis_and_ix'))}${tile(tr('dashboard.monthly_p_l'),`<span style="color:${net>=0?'var(--eye)':'var(--tx-red,var(--bad))'}">${net>=0?'+':''}${fmt$(net)}</span>`,tr('dashboard.in_in_out_out',{in:fmt$(R.revMo),out:fmt$(R.costMo)}))}${tile(tr('common.incidents'),S.stats.incidents,tr('dashboard.n_shrugged_off',{n:S.stats.survived}))}</div>
|
||||
<div class="dcols"><div class="panel2"><h3>${tr('dashboard.traffic_by_way_out')}</h3>${svgChart(rows,['c','p','ix','t','l2'],[{k:'dem',col:'var(--text)',dash:true}],v=>fmtCap(Math.round(v)),'traffic')}${chartLegend('traffic',k=>k==='dem'?'':' '+pct((R.egT[k]||0)/tot))}</div>
|
||||
<div class="panel2"><h3>${tr('dashboard.money_per_month')}</h3>${svgChart(rows,[],[{k:'rev',col:'#16A866'},{k:'cost',col:'#FF4D5E'}],v=>fmt$(v),'money')}${chartLegend('money')}
|
||||
<h3 style="margin-top:8px">${tr('dashboard.where_the_money_goes')}</h3>${Object.entries(R.cost).filter(([k,v])=>v>0).sort((a,b)=>b[1]-a[1]).map(([k,v])=>`<div class="kv"><span>${{pops:tr('dashboard.pops_and_routers'),links:tr('dashboard.waves_and_fiber'),transit:tr('common.transit'),ix:tr('common.ix_ports'),pni:tr('common.pnis'),caches:tr('common.cache_power'),nni:tr('common.fabric_ports'),optical:tr('dashboard.amp_huts_and_spares'),loans:tr('common.loan_repayments'),revshare:tr('dashboard.investor_revenue_share'),extras:tr('dashboard.licenses_and_scrubbing'),wholesale:tr('dashboard.nearly_broadband_network_wholesale'),levy:tr('dashboard.regional_broadband_levy'),pie:tr('pie.costs_row'),ip4:tr('ip4.leases_cgnat_nat64'),sat:tr('satellites.costs_row')}[k]||k}</span><b>${tr('common.price_mo',{price:fmt$(v)})}</b></div>`).join('')}</div></div>`;
|
||||
<h3 style="margin-top:8px">${tr('dashboard.where_the_money_goes')}</h3>${Object.entries(R.cost).filter(([k,v])=>v>0).sort((a,b)=>b[1]-a[1]).map(([k,v])=>`<div class="kv"><span>${{pops:tr('dashboard.pops_and_routers'),links:tr('dashboard.waves_and_fiber'),transit:tr('common.transit'),ix:tr('common.ix_ports'),pni:tr('common.pnis'),caches:tr('common.cache_power'),nni:tr('common.fabric_ports'),optical:tr('dashboard.amp_huts_and_spares'),loans:tr('common.loan_repayments'),revshare:tr('dashboard.investor_revenue_share'),extras:tr('dashboard.licenses_and_scrubbing'),wholesale:tr('dashboard.nearly_broadband_network_wholesale'),levy:tr('dashboard.regional_broadband_levy'),pie:tr('pie.costs_row'),ip4:tr('ip4.leases_cgnat_nat64'),sat:tr('satellites.costs_row'),wisp:tr('wisp.costs_row')}[k]||k}</span><b>${tr('common.price_mo',{price:fmt$(v)})}</b></div>`).join('')}</div></div>`;
|
||||
const tT=(R.egT.t||0)||1;
|
||||
const offMix=(UI.chartOff&&UI.chartOff.mix)||{},filt=Object.keys(offMix).length>0;
|
||||
// The legend above the table picks which ways in count; "lost" still looks at everything the network gets.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
some are IPv6-only), the CGNAT and NAT64 ratios, your blocks, and the transfer market. Phones: the boxes are full
|
||||
width, the dropdowns stack and every button row wraps. */
|
||||
const ip4Pc=x=>(x*100).toFixed(1).replace(/\.0$/,'')+'%';
|
||||
function ip4Bank(){if(!S||!ip4On())return '';const I=S.ip4,B=ip4Bill((R.rev&&R.rev.eyeballs)||0),u=B.u,len=ip4LenOk(UI.ip4Len)?UI.ip4Len:IP4_MAX,px=ip4Px(),full=ip4Full();
|
||||
function ip4Bank(){if(!S||!ip4On())return '';const I=S.ip4,B=ip4Bill(ip4Eye()),u=B.u,len=ip4LenOk(UI.ip4Len)?UI.ip4Len:IP4_MAX,px=ip4Px(),full=ip4Full();
|
||||
const kv=(l,v,bad)=>`<div class="kv"><span>${l}</span><b${bad?' style="color:var(--tx-red,var(--bad))"':''}>${v}</b></div>`,mo=v=>tr('common.price_mo',{price:fmt$(v)});
|
||||
let h=`<section class="bank-gov bank-ip4"><h3 id="bankIp4" style="font-size:18px;margin-top:14px">🔢 ${tr('ip4.section')}</h3><p class="meta">${tr('ip4.note')}</p>`;
|
||||
h+=`<div class="ops-o">${kv(tr('ip4.yours'),ip4N(u.T))}${kv(tr('ip4.business'),ip4N(u.B))}`;
|
||||
|
|
|
|||
|
|
@ -5260,6 +5260,58 @@
|
|||
"utilities.title":"Utilities",
|
||||
"utilities.two_routers":"At least two routers",
|
||||
"utilities.view_pop":"View PoP",
|
||||
"wisp.backhaul":"Backhaul",
|
||||
"wisp.close":"Close island Wi-Fi",
|
||||
"wisp.closed":"Island Wi-Fi on {zone} is closed.",
|
||||
"wisp.costs_row":"Island Wi-Fi: towers and spurs",
|
||||
"wisp.cut_anchor":"A ship's anchor dragged across the {zone} spur off {city}.",
|
||||
"wisp.cut_dark":"Nothing else reaches the islands: they are offline until it is mended.",
|
||||
"wisp.cut_sat":"The satellite circuit carries the islands meanwhile.",
|
||||
"wisp.cut_slide":"An undersea landslide snapped the {zone} spur.",
|
||||
"wisp.cut_trawler":"A trawler snagged the {zone} spur.",
|
||||
"wisp.cut_volcano":"An undersea volcano erupted on top of the {zone} spur.",
|
||||
"wisp.decom":"Island Wi-Fi closes with it: {list}.",
|
||||
"wisp.double_hop":"Double hop: {city} reaches the world only by satellite, so the islands' traffic would go up twice. Bring {city} a cable first.",
|
||||
"wisp.full":"The link is full: homes are waiting.",
|
||||
"wisp.homes_online":"Homes online",
|
||||
"wisp.inc_title":"Spur cut",
|
||||
"wisp.ipv6":"Its homes are IPv6-only (464XLAT) from day one: their IPv4 shares the NAT64 pool, so the islands never need a block of their own.",
|
||||
"wisp.kit":"The first order brings the island kit too: towers, solar panels and home radios, {cost}.",
|
||||
"wisp.lay_spur":"Lay the spur {cost}",
|
||||
"wisp.lead":"No cable reaches these islands' homes, so you can be their internet: satellite capacity from a teleport here first, a spur cable later. Islanders pay island prices: {rate} a Gbps a month.",
|
||||
"wisp.move_note":"Order on another satellite to move the islands there: the old circuit carries until the new one is up.",
|
||||
"wisp.moved":"{zone} now rides {bird}.",
|
||||
"wisp.moving":{"one":"{cap} on {bird} ordered for {zone}: the islands move over in {n} day.","other":"{cap} on {bird} ordered for {zone}: the islands move over in {n} days."},
|
||||
"wisp.n_zones":{"one":"{n} island zone","other":"{n} island zones"},
|
||||
"wisp.no_pop":"Open a POP here to bring Wi-Fi to the islands around it: {list}.",
|
||||
"wisp.no_teleport":"Satellite capacity for the islands comes down at a teleport in {city}. Build one there first.",
|
||||
"wisp.online":"{zone} is online: the first islanders are signing up.",
|
||||
"wisp.ordered":{"one":"{cap} on {bird} ordered for {zone}: islanders go online in {n} day.","other":"{cap} on {bird} ordered for {zone}: islanders go online in {n} days."},
|
||||
"wisp.pool":"{g} of homes",
|
||||
"wisp.rush":"Charter a repair ship",
|
||||
"wisp.section":"Island Wi-Fi",
|
||||
"wisp.served":"Served on the islands",
|
||||
"wisp.spur":"Spur cable",
|
||||
"wisp.spur_cut":{"one":"Cut: the repair ship is {n} day away.","other":"Cut: the repair ship is {n} days away."},
|
||||
"wisp.spur_laying":"Cable ship laying the spur",
|
||||
"wisp.spur_lead":"{km} km of unrepeatered cable from {city}. Development banks paid for most of it; this is your share. Everyone on the islands can sign up once it is lit, and nothing is rented.",
|
||||
"wisp.spur_level":"Spurs come at level {lv}.",
|
||||
"wisp.spur_lit":"Spur lit, {cap}",
|
||||
"wisp.spur_none":"Too far, or too much sea ice, for a spur: these islands stay on satellites.",
|
||||
"wisp.spur_ordered":{"one":"A cable ship sails to lay the {zone} spur: lit in {n} day.","other":"A cable ship sails to lay the {zone} spur: lit in {n} days."},
|
||||
"wisp.spur_ready":"The {zone} spur is lit: everyone on the islands can sign up now.",
|
||||
"wisp.spur_trap":"One cable is one point of failure: when it is cut, the repair ship takes weeks. A satellite circuit kept on standby carries the islands meanwhile.",
|
||||
"wisp.st_cut":"Spur cut",
|
||||
"wisp.st_none":"No link yet",
|
||||
"wisp.st_soon":"Coming up",
|
||||
"wisp.st_spur":"Spur",
|
||||
"wisp.take":"Islanders sign up as far as the link lets them: about {geo} over GEO, {meo} over MEO, {leo} over LEO, all of them over a cable.",
|
||||
"wisp.tele_reaches":"Island Wi-Fi from this teleport:",
|
||||
"wisp.upkeep":"Towers, solar and crews",
|
||||
"wisp.why_moving":"A move to another satellite is under way.",
|
||||
"wisp.why_no_pop":"Open a POP in {city} first: the islands' crews and licence work from there.",
|
||||
"wisp.why_same":"The islands ride {bird} already: resize that circuit instead.",
|
||||
"wisp.why_spur_have":"The spur is laid already.",
|
||||
"wkscn.copy_my_result":"Copy my result",
|
||||
"wkscn.desc_a_g_event_comes_to":"A {g} event comes to {city} on day {day}. Build the network it needs, from nothing.",
|
||||
"wkscn.desc_a_ship_dragged_its_anchor":"A ship dragged its anchor across {cab}. Find another way from {a} to {b}.",
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const { load } = require('./harness');
|
|||
const BAD = ['__proto__', 'constructor', 'prototype', 'toString', 'hasOwnProperty', 'valueOf'];
|
||||
// The other args an action may need before it looks the name up: ptSave a kind, ptApply a kind and a price.
|
||||
const WITH = { k: 'micro', cost: 0 };
|
||||
const ARGS = ['city', 'id', 'net', 'k', 'c', 'v', 'a', 'b', 'to', 'from', 'link', 's'];
|
||||
const ARGS = ['city', 'id', 'net', 'k', 'c', 'v', 'a', 'b', 'to', 'from', 'link', 's', 'z'];
|
||||
|
||||
test('no action reaches a built-in through an arg that names one', (t) => {
|
||||
// The development page: API_CMD is every action an agent may send (the MCP facade), the sent ones of a server's page.
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
// the server checks every action against the save path; both need migrate(live S) to change nothing. A year of a big
|
||||
// network with everything on (DDoS, failures, events, the intern on every order, the sales desk on auto, IPv6-only, and
|
||||
// once before the year everything else a network can own: an own exchange, scrubbing centers, teleports, LEO gateways,
|
||||
// satellites, dark fiber, an own cable, a subsea seat, exchange points, the backbone core, the redundancy kit, the bulk
|
||||
// orders),
|
||||
// satellites, an island Wi-Fi zone with a circuit and a spur, dark fiber, an own cable, a subsea seat, exchange points,
|
||||
// the backbone core, the redundancy kit, the bulk orders),
|
||||
// checked every day. T1_BASE=<git ref> also plays the same year on the page at that ref: the same money, customers,
|
||||
// incidents, dice and ids every day, so making the state canonical changed no play.
|
||||
const test = require('node:test');
|
||||
|
|
@ -32,6 +32,7 @@ function open(file) {
|
|||
for(const c of pops.slice(0,4))tryA('teleBuild',{city:c});
|
||||
for(const c of pops.slice(0,4))tryA('teleLeo',{city:c});
|
||||
{let n=0;for(const a of pops.slice(0,4))for(const b of satTargets(a)){if(n>=1)break;if(!satWhy(a,b,LEO_BIRD,5)){tryA('buySat',{a,b,bird:LEO_BIRD,g:5});n++;}}}
|
||||
tryA('buildPop',{city:'suv'});tryA('teleBuild',{city:'suv'});tryA('wispSat',{z:'vanualevu',bird:'kac1',g:2});tryA('wispSpur',{z:'vanualevu'});
|
||||
{let n=0;for(const a of pops.slice(0,12))for(const b of pops.slice(12,30)){if(n>=2)break;for(const bird of Object.keys(SATS))for(const g of [1,2,5,10]){if(n>=2)break;if(!satWhy(a,b,bird,g)){tryA('buySat',{a,b,bird,g});n++;}}}}
|
||||
{let n=0;for(const a of pops.slice(0,10))for(const b of pops.slice(10,40)){if(n>=2)break;if(kmBetween(a,b)<900&&!noTalk(a,b)){UI.pending={a,b};UI.dfSrc='build';const k=S.links.length;tryA('orderDf');if(S.links.length>k)n++;}}}
|
||||
{let n=0;for(const a of pops.slice(0,30))for(const b of Object.keys(CITY)){if(n>=1)break;if(S.pops[b]||a===b)continue;UI.pending={a,b};const k=S.links.length;if(!ownCabWhy(a,b)){tryA('orderCable');if(S.links.length>k)n++;}}}
|
||||
|
|
@ -44,7 +45,7 @@ function open(file) {
|
|||
UI.pending=null;closeModal();compute();`);
|
||||
return h;
|
||||
}
|
||||
const BUILT = ['foundIx', 'buildScrub', 'teleBuild', 'teleLeo', 'buySat', 'orderDf', 'orderCable', 'seatBuy', 'coreUp', 'xpBuild', 'utilityKit', 'pniAll', 'bstdApply'];
|
||||
const BUILT = ['foundIx', 'buildScrub', 'teleBuild', 'teleLeo', 'buySat', 'wispSat', 'wispSpur', 'orderDf', 'orderCable', 'seatBuy', 'coreUp', 'xpBuild', 'utilityKit', 'pniAll', 'bstdApply'];
|
||||
|
||||
// In the page: every top-level key whose JSON differs between live S and what a reload makes of it, both ways a reload
|
||||
// happens (the full state a page takes, and the save text). uidN and the dice are put back: a reload may draw ids.
|
||||
|
|
|
|||
2
tests/fixtures/mp-sim/snap.json
vendored
2
tests/fixtures/mp-sim/snap.json
vendored
File diff suppressed because one or more lines are too long
2
tests/fixtures/mp-sim/upd-act.json
vendored
2
tests/fixtures/mp-sim/upd-act.json
vendored
File diff suppressed because one or more lines are too long
2
tests/fixtures/mp-sim/upd-day.json
vendored
2
tests/fixtures/mp-sim/upd-day.json
vendored
File diff suppressed because one or more lines are too long
|
|
@ -171,6 +171,14 @@ test('W5: every island city can be reached: it shares its land, has a cable, or
|
|||
fail('W5', bad, 'land a cable there or give it beach:true');
|
||||
});
|
||||
|
||||
test('W6: every island Wi-Fi zone hangs off a satellite city within 1,000 km, seen with it by a GEO bird; pool 3 to 12 G; a spur of at most 1,500 km or none', () => {
|
||||
const ids = J('Object.keys(WISP)');
|
||||
assert.deepEqual(ids, [...ids].sort(), 'W6: zone ids sorted');
|
||||
fail('W6', J(`Object.keys(WISP).filter(z=>{const W=WISP[z],C=CITY[W.c];return !C||!satRemote(W.c)||hav(C.lon,C.lat,W.lon,W.lat)>1000
|
||||
||!Object.keys(SATS).some(id=>SATS[id].orb==='geo'&&satPairAt(id,C,W))||!(W.P>=3&&W.P<=12)||!(W.km===0||W.km>0&&W.km<=1500)||typeof W.n!=='string'||!W.n.trim();}).map(z=>z+' ('+WISP[z].c+')')`),
|
||||
'hang the zone off the island city it looks to (one a satellite serves), within 1,000 km, where a GEO bird sees both; 3 to 12 G of homes; a spur of at most 1,500 km, or km:0');
|
||||
});
|
||||
|
||||
// ---------- Networks ----------
|
||||
|
||||
test('N1: network ids and ASNs are unique, ASNs are valid', () => {
|
||||
|
|
@ -555,6 +563,21 @@ test('F10: growth goes sideways, plus one paid way up (#61, #323)', () => {
|
|||
fail('F10', J("MEGA.filter(m=>!CITY[m.c]).map(m=>m.c)"), 'campuses sit in real cities');
|
||||
});
|
||||
|
||||
test('F12: island Wi-Fi pays on its own books on some way in; a spur beats every satellite, and pays back within 5 years up to 250 km, 10 up to 1,000 km', () => {
|
||||
// The zone's own books at full take-up, era 1: its homes at island prices, less the towers' upkeep and the backhaul
|
||||
// rent. The teleport, tracking antennas and a Starblink gateway serve more than one zone and are left out. Each way in
|
||||
// at its best size; a spur at its price before the market moves it.
|
||||
const rows = J(`Object.keys(WISP).map(z=>{const W=WISP[z],R=wispRate(z),up=wispUpMo(z),o={z,km:W.km};
|
||||
for(const id of wispBirds(z)){const orb=SATS[id].orb;for(const g of SAT_ORB[orb].g){const pl=Math.min(W.P*SAT_ORB[orb].wisp,g)*R-wispSatMo(id,g)-up;if(o[orb]===undefined||pl>o[orb])o[orb]=pl;}}
|
||||
if(W.km){o.sp=W.P*R-up-wispSpurMo(z);o.cost=Math.round((WISP_SPUR+WISP_SPUR_KM*W.km)/1000)*1000;}return o;})`);
|
||||
fail('F12', rows.filter((r) => !(Math.max(r.geo ?? -Infinity, r.meo ?? -Infinity, r.leo ?? -Infinity, r.sp ?? -Infinity) > 0)).map((r) => r.z), 'every zone makes money on at least one way in: raise WISP_ARPU or WISP_SHARE, or the pool');
|
||||
fail('F12', rows.filter((r) => r.sp !== undefined && ['geo', 'meo', 'leo'].some((o) => r[o] !== undefined && r[o] >= r.sp)).map((r) => r.z), 'a spur earns more than any satellite option');
|
||||
fail('F12', rows.filter((r) => r.meo !== undefined && r.geo !== undefined && r.meo < r.geo || r.leo !== undefined && r.meo !== undefined && r.leo < r.meo).map((r) => r.z), 'MEO earns at least as much as GEO, and LEO as MEO, where both reach');
|
||||
// Payback in whole months against the best GEO or MEO stage (LEO needs a level-5 gateway, off the zone's books).
|
||||
const pay = (r) => Math.round(r.cost / (r.sp - Math.max(r.geo ?? 0, r.meo ?? 0, 0)));
|
||||
fail('F12', rows.filter((r) => r.sp !== undefined && (r.km <= 250 && pay(r) > 60 || r.km <= 1000 && pay(r) > 120)).map((r) => `${r.z} (${r.km} km): ${pay(r)} months`), 'spurs up to 250 km pay back within 5 years, up to 1,000 km within 10');
|
||||
});
|
||||
|
||||
test('D1: attack sizes come from the world, never from your network', () => {
|
||||
const g = load();
|
||||
ddFra(g.ev);
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ test('a dry run prices every command that has a price, and changes nothing', ()
|
|||
utilityKit: { city: 'fra' }, utilityCaches: { city: 'fra' }, acceptFix: { id: 'none' }, ptApply: { city: 'fra', k: 'medium' }, ptAll: { k: 'medium' }, teDeploy: { script: 'spill at 85%' }, upLinkX: {},
|
||||
pieRd: { k: 'reuse' }, pieAnt: { id: 'none' }, ip4Buy: { len: 24 }, ip4Lease: { len: 22 }, ip6Go: { city: 'fra' },
|
||||
teleBuild: { city: 'fra' }, teleTrk: { city: 'fra' }, teleLeo: { city: 'fra' }, buySat: { a: 'fra', b: 'rek', bird: 'is37', g: 1 }, satSize: { id: wave, g: 2 },
|
||||
wispSat: { z: 'vanualevu', bird: 'kac1', g: 2 }, wispSatSize: { z: 'vanualevu', g: 5 }, wispSpur: { z: 'vanualevu' },
|
||||
};
|
||||
const missing = quoted.filter((n) => !sample[n] && T('schema', { section: 'commands' })[n].args.some((a) => a.required));
|
||||
assert.deepEqual(missing, [], 'every priced command with arguments has a sample here');
|
||||
|
|
|
|||
|
|
@ -30,11 +30,13 @@ test('SEND is the agent\'s game commands without the puzzles, teCheck, traceRun
|
|||
});
|
||||
|
||||
/* A rich network with something behind every two-click button: the big fixture, an intern, a sales head, a scrubbing
|
||||
center, a teleport with a LEO gateway, an own exchange. Its S also goes to the realm, so both sides start the same. */
|
||||
center, a teleport with a LEO gateway, an own exchange, an island Wi-Fi zone with a circuit. Its S also goes to the
|
||||
realm, so both sides start the same. */
|
||||
function rich() {
|
||||
const P = page({ save: bigScenic() });
|
||||
P.ev(`S.lvl=Math.max(S.lvl,6);ACT.opsHire({id:'kevin'});closeModal();ACT.salesHire({id:'eng'});closeModal();
|
||||
ACT.buildScrub({city:'fra'});closeModal();ACT.teleBuild({city:'sea'});closeModal();ACT.teleLeo({city:'sea'});closeModal();UI.confirm=null;UI.sel=null;
|
||||
ACT.buildScrub({city:'fra'});closeModal();ACT.teleBuild({city:'sea'});closeModal();ACT.teleLeo({city:'sea'});closeModal();
|
||||
ACT.buildPop({city:'suv'});ACT.teleBuild({city:'suv'});ACT.wispSat({z:'vanualevu',bird:'kac1',g:2});closeModal();UI.confirm=null;UI.sel=null;
|
||||
S.day=Math.max(S.day,IP4_HOLD+30);S=migrate(JSON.parse(JSON.stringify(S)));compute();`);
|
||||
// (Address blocks are held two years before they may be sold: these were bought long ago.)
|
||||
return P;
|
||||
|
|
@ -74,6 +76,8 @@ test('two-click buttons: the first click arms SRV_ARM\'s key (or waits for ok),
|
|||
ev('UI.confirm=null;UI.sel=null;closeModal();');
|
||||
// (The gateway closes before its teleport, which would take it along.)
|
||||
Object.assign(found, { rmScrub: { city: 'fra' }, teleLeoRm: { city: 'sea' }, teleRm: { city: 'sea' }, cancelVxc: found.cancelVxc || { id: 'nolink' }, dkOptOut: found.dkOptOut || { city: 'fra', n: 'Nobody' } }, found);
|
||||
// (A zone's circuit is cancelled before the zone, which would take it along.)
|
||||
for (const a of ['wispSatRm', 'wispRm']) { const v = found[a] || { z: 'vanualevu' }; delete found[a]; found[a] = v; }
|
||||
const missing = Object.keys(A.CONFIRM).filter((a) => !found[a] && a !== 'repayLoan');
|
||||
assert.deepEqual(missing, [], 'a button for every two-click act');
|
||||
const changed = {};
|
||||
|
|
@ -99,7 +103,7 @@ test('two-click buttons: the first click arms SRV_ARM\'s key (or waits for ok),
|
|||
if (changed[a]) assert.equal(r.outcome, 'applied', a);
|
||||
}
|
||||
// The ones with a real target were really done.
|
||||
for (const a of ['cancelTransit', 'cancelIx', 'cancelPni', 'rmLink', 'rmSite', 'dropBiz', 'salesFire', 'opsFire', 'rmScrub', 'teleLeoRm', 'teleRm', 'connCancel']) if (found[a]) assert.equal(changed[a], true, `${a} did its thing`);
|
||||
for (const a of ['cancelTransit', 'cancelIx', 'cancelPni', 'rmLink', 'rmSite', 'dropBiz', 'salesFire', 'opsFire', 'rmScrub', 'teleLeoRm', 'teleRm', 'wispSatRm', 'wispRm', 'connCancel']) if (found[a]) assert.equal(changed[a], true, `${a} did its thing`);
|
||||
assert.deepEqual(P.errors, []);
|
||||
});
|
||||
const closeAll = (ev) => ev('closeModal();');
|
||||
|
|
|
|||
375
tests/wisp-zones.test.js
Normal file
375
tests/wisp-zones.test.js
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
// Island Wi-Fi (#83): 18 zones of outer islands, each a pool of homes hanging off one island city. Your POP there brings
|
||||
// them online over satellite capacity from its teleport (GEO about 35% sign up, MEO about 75%, Starblink LEO from a
|
||||
// gateway there about 90%) or a spur cable (all of them). Their Gbps join the city's demand; they are IPv6-only homes;
|
||||
// a spur can be cut for weeks, and a satellite kept beside it carries the islands meanwhile.
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const { load } = require('./harness');
|
||||
|
||||
const SAVE = fs.readFileSync(path.join(__dirname, 'fixtures', 'big-network.json'), 'utf8');
|
||||
// Level 3, Change Freeze (nothing breaks by itself, lead times quick), plenty of cash.
|
||||
const BASE = "ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;S.lvl=3;S.nextFail=S.nextEvent=1e9;UI.speed=0;S.rules=makeRules('freeze');";
|
||||
// Suva: a POP with transit (so its traffic gets out) and a teleport.
|
||||
const SUV = "ACT.buildPop({city:'suv'});ACT.buyTransit({city:'suv',net:NETS.find(n=>sellsAt(n,'suv')).id,tier:1});ACT.teleBuild({city:'suv'});";
|
||||
const VL = "ACT.wispSat({z:'vanualevu',bird:'kac1',g:2});";
|
||||
function game(t, setup = '') {
|
||||
const h = load();
|
||||
t.after(() => h.dom.window.close());
|
||||
h.ev(BASE + setup);
|
||||
return h;
|
||||
}
|
||||
const J = (ev, s) => JSON.parse(ev(`JSON.stringify(${s})`));
|
||||
const Z = "wispZ('vanualevu')";
|
||||
// Past the day the zone's circuit (or a move) is commissioned.
|
||||
const ready = `S.day=Math.max(${Z}.sat?${Z}.sat.ready:0,${Z}.nxt?${Z}.nxt.ready:0,${Z}.sp?${Z}.sp.ready:0);compute()`;
|
||||
const days = (ev, n) => ev(`for(let i=0;i<${n};i++)dayTick()`);
|
||||
// The first top-level keys whose JSON differs between two states (never deepEqual on S).
|
||||
const firstDiff = (a, b) => { const A = JSON.parse(a), B = JSON.parse(b); return [...new Set([...Object.keys(A), ...Object.keys(B)])].filter((k) => JSON.stringify(A[k]) !== JSON.stringify(B[k])).slice(0, 5); };
|
||||
|
||||
test('the catalog and the geometry: zones off satellite cities, seen by a GEO bird; points give exactly the city answers', (t) => {
|
||||
const { ev, errors } = game(t);
|
||||
const ids = J(ev, 'Object.keys(WISP)');
|
||||
assert.equal(ids.length, 18);
|
||||
assert.deepEqual(ids, [...ids].sort(), 'ids sorted');
|
||||
const bad = J(ev, `Object.keys(WISP).filter(z=>{const W=WISP[z],C=CITY[W.c];return !C||!satRemote(W.c)||hav(C.lon,C.lat,W.lon,W.lat)>1000||!Object.keys(SATS).some(id=>SATS[id].orb==='geo'&&satPairAt(id,C,W))
|
||||
||!(W.P>=3&&W.P<=12)||!(W.km===0||W.km>=50&&W.km<=1500)||typeof W.n!=='string'||!W.n;})`);
|
||||
assert.deepEqual(bad, []);
|
||||
// The point versions, on cities, are the city versions: every bird, every satellite city against every city.
|
||||
const diff = J(ev, `(()=>{const out=[];for(const id of Object.keys(SATS))for(const A of CITIES.filter(C=>satRemote(C.id))){if(satSeesAt(id,A)!==satSees(id,A.id))out.push('sees '+id+A.id);
|
||||
for(const B of CITIES){if(A.id===B.id)continue;const p=satPairOk(id,A.id,B.id);if(p!==satPairAt(id,A,B))out.push(id+A.id+B.id);else if(p&&satKmAt(id,A,B)!==satKm(id,A.id,B.id))out.push('km '+id+A.id+B.id);}}return out.slice(0,5);})()`);
|
||||
assert.deepEqual(diff, []);
|
||||
// Starblink reaches a zone from a gateway in its own city wherever both are under the shell: all but the two beyond 56°.
|
||||
assert.deepEqual(J(ev, "Object.keys(WISP).filter(z=>!wispBirds(z).includes(LEO_BIRD))"), ['nunavut', 'seak']);
|
||||
assert.deepEqual(J(ev, "wispBirds('nunavut').map(b=>SATS[b].orb)"), ['geo'], 'Nunavut: GEO only');
|
||||
assert.deepEqual(J(ev, "wispBirds('vanualevu').map(b=>SATS[b].orb)"), ['geo', 'geo', 'meo', 'leo'], 'GEO first, cheapest first, then MEO and LEO');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('launch over GEO: the kit and the first month, homes at the floor, then the city carries them and they pay island prices', (t) => {
|
||||
const { ev, errors } = game(t, SUV + "ACT.launchBB({city:'suv'});");
|
||||
ev('compute()');
|
||||
const eye0 = ev('R.cityEye.suv'), c0 = ev('S.cash');
|
||||
ev(VL);
|
||||
assert.equal(c0 - ev('S.cash'), ev("wispKit('vanualevu')+wispSatMo('kac1',2)"), 'the island kit and the first month');
|
||||
assert.equal(ev(`${Z}.d`), ev("wispStart('vanualevu')"));
|
||||
assert.equal(ev('R.wisp.vanualevu.car'), 0, 'nothing before the circuit is commissioned');
|
||||
assert.equal(ev('R.cost.sat'), ev("TPORT_MO+wispSatMo('kac1',2)"), 'the rent from the order on');
|
||||
assert.equal(ev('R.cost.wisp'), ev("wispUpMo('vanualevu')"));
|
||||
ev(ready);
|
||||
const car = ev('R.wisp.vanualevu.car');
|
||||
assert.ok(car > 0);
|
||||
assert.ok(Math.abs(ev('R.cityWisp.suv') - car) < 1e-9, 'the city carries the homes');
|
||||
assert.ok(Math.abs(ev('R.cityEye.suv') - eye0) < 1e-9, 'broadband stays broadband');
|
||||
assert.ok(ev('R.wisp.vanualevu.sf') > 0.9, 'served');
|
||||
assert.ok(Math.abs(ev('R.rev.wisp') - ev('R.wisp.vanualevu.d*R.wisp.vanualevu.sf*wispRate("vanualevu")')) < 1e-6);
|
||||
assert.equal(ev("wispRate('vanualevu')"), ev('EYE_RATE*14'), 'island prices');
|
||||
assert.ok(ev('R.revMo') >= ev('R.rev.eyeballs+R.rev.wisp') - 1e-6);
|
||||
// Investors on a revenue share take their slice of island homes too.
|
||||
ev("S.loans=[{id:'v',bank:'vult',share:0.1,bal:0}];compute()");
|
||||
assert.ok(Math.abs(ev('R.cost.revshare') - 0.1 * ev('R.rev.eyeballs+R.rev.business+R.rev.ix+(R.rev.orbit||0)+R.rev.wisp')) < 1e-6);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('take-up grows to the link\'s cap and no further; a small circuit fills, and growing it lets homes in', (t) => {
|
||||
const { ev, errors } = game(t, SUV + "ACT.wispSat({z:'vanualevu',bird:'kac1',g:5});");
|
||||
ev(ready);
|
||||
const K = ev(`wispK('vanualevu',${Z})`);
|
||||
assert.ok(Math.abs(K - ev("wispPool('vanualevu')*SAT_ORB.geo.wisp")) < 1e-9, 'about 35% over GEO');
|
||||
let top = 0;
|
||||
for (let i = 0; i < 40; i++) { days(ev, 10); top = Math.max(top, ev(`${Z}.d`)); }
|
||||
assert.ok(top <= K + 1e-9, `never past the cap: ${top} of ${K}`);
|
||||
assert.ok(ev(`${Z}.d`) > 0.9 * K, 'close to it after a year');
|
||||
// A 1G circuit: homes hover where it serves 90% of them.
|
||||
ev("ACT.wispSatSize({z:'vanualevu',g:1})");
|
||||
days(ev, 200);
|
||||
const d1 = ev(`${Z}.d`);
|
||||
assert.ok(d1 > 0.95 && d1 < 1.25, `about 1/0.9 G: ${d1}`);
|
||||
ev("selectCity('suv');UI.tab='cust';UI.wz='vanualevu';renderPanel()");
|
||||
assert.match(ev("document.getElementById('panel').textContent"), /The link is full: homes are waiting/);
|
||||
const c0 = ev('S.cash');
|
||||
ev("ACT.wispSatSize({z:'vanualevu',g:5})");
|
||||
assert.equal(c0 - ev('S.cash'), ev("wispSatMo('kac1',5)"), 'a bigger one pays its month up front');
|
||||
days(ev, 100);
|
||||
assert.ok(ev(`${Z}.d`) > 1.5, 'more homes come in');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('moving to MEO: tracking antennas first, then the old circuit carries until the new one is up', (t) => {
|
||||
const { ev, errors } = game(t, SUV + VL);
|
||||
ev(ready);
|
||||
const c0 = ev('S.cash');
|
||||
ev("ACT.wispSat({z:'vanualevu',bird:'o3b',g:5})");
|
||||
assert.equal(ev('S.cash'), c0, 'nothing charged');
|
||||
assert.match(ev("wispSatWhy('vanualevu','o3b',5)"), /tracking antennas/);
|
||||
ev("ACT.teleTrk({city:'suv'});ACT.wispSat({z:'vanualevu',bird:'o3b',g:5})");
|
||||
assert.equal(ev(`${Z}.nxt.bird`), 'o3b');
|
||||
assert.equal(ev(`${Z}.sat.bird`), 'kac1');
|
||||
assert.match(ev("wispSatWhy('vanualevu','is18',2)"), /move to another satellite is under way/);
|
||||
ev('compute()');
|
||||
assert.equal(ev(`wispLink('vanualevu',${Z})===${Z}.sat`), true, 'the old circuit carries meanwhile');
|
||||
assert.ok(ev('R.wisp.vanualevu.car') > 0);
|
||||
assert.equal(ev('R.cost.sat'), ev("TPORT_MO+TRK_MO+wispSatMo('kac1',2)+wispSatMo('o3b',5)"), 'both rents while it moves');
|
||||
ev(`S.day=${Z}.nxt.ready-1;dayTick()`);
|
||||
assert.equal(ev(`${Z}.sat.bird`), 'o3b');
|
||||
assert.equal(ev(`${Z}.nxt`), undefined);
|
||||
assert.ok(Math.abs(ev(`wispK('vanualevu',${Z})`) - ev("wispPool('vanualevu')*SAT_ORB.meo.wisp")) < 1e-9, 'about 75% over MEO');
|
||||
assert.match(ev("JSON.stringify(S.log.slice(0,8).map(e=>e.t))"), /Vanua Levu & Taveuni now rides O3bservant/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the spur: level 3, never where one cannot be laid, the price of the day; lit, everyone signs up and the satellite stands by', (t) => {
|
||||
const { ev, errors } = game(t, SUV + VL + "ACT.buildPop({city:'yfb'});");
|
||||
ev('S.lvl=2');
|
||||
assert.match(ev("wispSpurWhy('vanualevu')"), /level 3/);
|
||||
ev('S.lvl=3');
|
||||
assert.match(ev("wispSpurWhy('nunavut')"), /sea ice/);
|
||||
const c0 = ev('S.cash');
|
||||
ev("ACT.wispSpur({z:'nunavut'})");
|
||||
assert.equal(ev('S.cash'), c0, 'refused');
|
||||
ev("ACT.wispSpur({z:'vanualevu'})");
|
||||
assert.equal(c0 - ev('S.cash'), ev("wispSpurCost('vanualevu')"));
|
||||
assert.equal(ev("wispSpurCost('vanualevu')"), Math.round((150000 + 600 * 220) / 1000) * 1000, 'today\'s price, no market under Change Freeze');
|
||||
assert.match(ev("wispSpurWhy('vanualevu')"), /laid already/);
|
||||
ev(ready);
|
||||
assert.ok(Math.abs(ev(`wispK('vanualevu',${Z})`) - ev("wispPool('vanualevu')")) < 1e-9, 'everyone may sign up');
|
||||
assert.equal(ev(`wispLink('vanualevu',${Z}).sp`), true, 'the spur carries');
|
||||
ev(`${Z}.d=5;compute()`);
|
||||
assert.ok(ev('R.wisp.vanualevu.car') > 2 + 1e-6, 'more than the 2G circuit could');
|
||||
assert.equal(ev('R.cost.sat'), ev("TPORT_MO+wispSatMo('kac1',2)"), 'the circuit standing by is still rented');
|
||||
assert.equal(ev('R.cost.wisp'), ev("wispUpMo('vanualevu')+wispSpurMo('vanualevu')"));
|
||||
ev("UI.sel={type:'city',id:'suv'};UI.tab='links';renderAll()");
|
||||
assert.match(ev("document.getElementById('panel').textContent"), /Vanua Levu & Taveuni[^]*Standby/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the single-spur trap: a cut takes weeks; a satellite beside it carries the islands, without one they go dark and leave', (t) => {
|
||||
const { ev, errors } = game(t, SUV + VL + "ACT.wispSpur({z:'vanualevu'});");
|
||||
ev(ready + `;${Z}.d=5;compute()`);
|
||||
// A spur that is lit and whole is something a failure can find; nothing else gives it a weight.
|
||||
const opts = "(()=>{window.__opts=null;runNow(eval('('+failureRun.toString().replace('if(!opts.length)return;','window.__opts=opts.map(o=>o.join(\":\"));return;')+')')());return __opts;})()";
|
||||
assert.ok(J(ev, opts).includes('wspur:1.5'));
|
||||
ev('fireFailure("wspur")');
|
||||
const inc = J(ev, "S.inc.find(i=>i.type==='wspur')");
|
||||
assert.ok(inc && inc.z === 'vanualevu' && inc.ref === 'suv' && inc.cost === 250000);
|
||||
assert.ok(inc.until - ev('S.day') >= 14, 'weeks for the repair ship');
|
||||
assert.match(inc.msg, /The satellite circuit carries the islands meanwhile/);
|
||||
assert.equal(ev("incTitle('wspur')"), 'Spur cut');
|
||||
assert.ok(!J(ev, opts).some((o) => o.startsWith('wspur')), 'a cut spur is not cut again');
|
||||
ev('compute()');
|
||||
assert.ok(Math.abs(ev('R.wisp.vanualevu.car') - 2) < 1e-9, 'the 2G circuit carries what it can');
|
||||
// The rush button charges the ship and mends it.
|
||||
const c0 = ev('S.cash');
|
||||
ev(`ACT.fixInc({id:${JSON.stringify(inc.id)}})`);
|
||||
assert.equal(c0 - ev('S.cash'), 250000);
|
||||
assert.equal(ev("wispCut('vanualevu')"), 0);
|
||||
assert.ok(ev('R.wisp.vanualevu.car') > 2 + 1e-6, 'the spur carries again');
|
||||
// Without a satellite: dark, and homes leave toward the floor.
|
||||
ev("ACT.wispSatRm({z:'vanualevu'});ACT.wispSatRm({z:'vanualevu'});fireFailure('wspur')");
|
||||
assert.match(J(ev, "S.inc.find(i=>i.type==='wspur')").msg, /offline until it is mended/);
|
||||
ev('compute()');
|
||||
assert.equal(ev('R.wisp.vanualevu.car'), 0);
|
||||
assert.equal(ev('R.wisp.vanualevu.sf'), 0);
|
||||
const d0 = ev(`${Z}.d`);
|
||||
days(ev, 5);
|
||||
assert.ok(ev(`${Z}.d`) < d0, 'homes leave');
|
||||
assert.ok(ev(`${Z}.d`) >= ev("wispStart('vanualevu')") - 1e-9, 'never below the floor');
|
||||
// The intern's repair order rushes it, once its budget is raised past the ship.
|
||||
ev("ACT.opsHire({id:'kevin'});S.ops.floor=0;closeModal();S.ops.on.repair=true;S.ops.cap.repair=1e6;");
|
||||
ev('opsDay(S.day)');
|
||||
assert.equal(ev("S.inc.some(i=>i.type==='wspur')"), false, 'rushed');
|
||||
// No spur at all: the failure has nothing to find.
|
||||
ev("S.inc=[];ACT.wispRm({z:'vanualevu'});ACT.wispRm({z:'vanualevu'})");
|
||||
assert.ok(!J(ev, opts).some((o) => o.startsWith('wspur')));
|
||||
const n = ev('S.inc.length');
|
||||
ev("fireFailure('wspur')");
|
||||
assert.equal(ev('S.inc.length'), n, 'nothing to cut');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('IPv4: island homes are IPv6-only from day one, in the NAT64 pool, never behind CGNAT', (t) => {
|
||||
const { ev, errors } = game(t, "S.rules=makeRules('oncall');" + SUV);
|
||||
assert.equal(ev('ip4On()'), true);
|
||||
const u0 = J(ev, 'ip4Use()');
|
||||
ev(VL + `${Z}.d=3;compute()`);
|
||||
const u1 = J(ev, 'ip4Use()');
|
||||
assert.ok(Math.abs(u1.H6 - u0.H6 - 30) <= 1, `H6 grows by d×${ev('IP4_BB')}: ${u0.H6} → ${u1.H6}`);
|
||||
assert.equal(u1.cg, u0.cg, 'no home behind CGNAT for it');
|
||||
ev("selectCity('suv');UI.tab='cust';UI.wz='vanualevu';renderPanel()");
|
||||
assert.match(ev("document.getElementById('panel').textContent"), /IPv6-only \(464XLAT\) from day one/);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('saves: zones and circuits survive a reload, broken ones are repaired, and the state stays canonical', (t) => {
|
||||
const { ev, errors } = game(t, SUV + VL + "ACT.wispSpur({z:'vanualevu'});ACT.buildPop({city:'tbu'});ACT.buildPop({city:'yfb'});");
|
||||
ev(ready + ";fireFailure('wspur');compute()");
|
||||
const s0 = ev('JSON.stringify(S)'), s1 = ev('JSON.stringify(migrate(JSON.parse(JSON.stringify(S))))');
|
||||
assert.ok(s0 === s1, 'a reload changes nothing: ' + firstDiff(s0, s1).join(', '));
|
||||
// Broken saves.
|
||||
const fix = (code) => J(ev, `(()=>{const s=JSON.parse(JSON.stringify(S));${code};return migrate(s);})()`);
|
||||
let s = fix("s.pops.suv.wisp.bogus={day:0,d:1};s.pops.suv.wisp.vavau={day:0,d:1};s.pops.suv.wisp.constructor={day:0,d:1}");
|
||||
assert.deepEqual(Object.keys(s.pops.suv.wisp), ['vanualevu'], 'unknown and misplaced zones go');
|
||||
s = fix("s.pops.suv.wisp.vanualevu.sat.bird='is37'");
|
||||
assert.equal(s.pops.suv.wisp.vanualevu.sat, undefined, 'a bird that does not see the islands');
|
||||
s = fix("s.pops.suv.wisp.vanualevu.sat.bird='o3b'");
|
||||
assert.equal(s.pops.suv.wisp.vanualevu.sat, undefined, 'MEO without tracking antennas');
|
||||
s = fix("s.pops.suv.wisp.vanualevu.nxt=s.pops.suv.wisp.vanualevu.sat;delete s.pops.suv.wisp.vanualevu.sat");
|
||||
assert.equal(s.pops.suv.wisp.vanualevu.sat.bird, 'kac1', 'a move without a circuit is the circuit');
|
||||
assert.equal(s.pops.suv.wisp.vanualevu.nxt, undefined);
|
||||
s = fix("s.pops.suv.wisp.vanualevu.sat.g=3;s.pops.suv.wisp.vanualevu.d='x'");
|
||||
assert.equal(s.pops.suv.wisp.vanualevu.sat.g, 2, 'a size the orbit sells');
|
||||
assert.equal(s.pops.suv.wisp.vanualevu.d, 0);
|
||||
s = fix("s.pops.yfb.wisp={nunavut:{day:0,d:1,sp:{day:0,ready:5}}}");
|
||||
assert.deepEqual(s.pops.yfb.wisp.nunavut, { day: 0, d: 1 }, 'no spur where none can be laid');
|
||||
s = fix("delete s.pops.suv.wisp.vanualevu.sp");
|
||||
assert.equal(s.inc.some((i) => i.type === 'wspur'), false, 'a cut without its spur goes');
|
||||
s = fix("delete s.pops.suv.tele");
|
||||
assert.equal(s.pops.suv.wisp.vanualevu.sat, undefined, 'no teleport, no circuit');
|
||||
s = fix("s.pops.suv.wisp=[1]");
|
||||
assert.equal(s.pops.suv.wisp, undefined);
|
||||
// The gate flipping (below level 2) leaves the homes as they were, and nothing in the money.
|
||||
const d0 = ev(`${Z}.d`);
|
||||
ev('S.lvl=1;compute();dayTick()');
|
||||
assert.equal(ev(`${Z}.d`), d0);
|
||||
assert.ok(Number.isFinite(ev(`${Z}.d`)));
|
||||
assert.equal(ev("'wisp' in R.rev||'wisp' in R.cost"), false);
|
||||
assert.deepEqual(J(ev, 'R.cityWisp'), {});
|
||||
// An old save has no zones and runs as it did.
|
||||
ev(`S=migrate(JSON.parse(${JSON.stringify(SAVE)}));compute()`);
|
||||
assert.equal(ev("Object.values(S.pops).some(p=>'wisp' in p)"), false);
|
||||
assert.equal(ev("'wisp' in R.cost||'wisp' in R.rev"), false);
|
||||
assert.ok(ev('R.served') > 0);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the teleport stays while a zone rides it; decommissioning the city closes its zones and their cuts at once', (t) => {
|
||||
const { ev, errors } = game(t, SUV + VL + "ACT.wispSpur({z:'vanualevu'});ACT.buildPop({city:'syd'});");
|
||||
ev(ready + ";fireFailure('wspur')");
|
||||
ev("ACT.teleRm({city:'suv'})");
|
||||
assert.equal(ev('teleOf("suv")'), 1, 'refused');
|
||||
assert.match(ev("JSON.stringify(S.log.slice(0,3).map(e=>e.t))"), /Cancel its satellite circuit first/);
|
||||
ev("UI.sel={type:'city',id:'suv'};UI.tab='links';renderAll()");
|
||||
assert.ok(!J(ev, "[...document.querySelectorAll('#panel [data-act]')].map(b=>b.dataset.act)").includes('teleRm'), 'no close button');
|
||||
ev("ACT.decomOpen({city:'suv'})");
|
||||
assert.match(ev("document.getElementById('modalCard').textContent"), /Island Wi-Fi closes with it: Vanua Levu & Taveuni/);
|
||||
ev('ACT.decomGo()');
|
||||
assert.equal(ev('!!S.pops.suv'), false);
|
||||
assert.equal(ev("S.inc.some(i=>i.type==='wspur')"), false, 'the cut goes with it');
|
||||
assert.equal(ev('wispAll().length'), 0);
|
||||
assert.equal(ev('R.cost.sat||0'), 0);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('gates: never in puzzles, the Architect or scenarios, and not below level 2', (t) => {
|
||||
const { ev, errors } = game(t, SUV + VL);
|
||||
ev(ready);
|
||||
assert.equal(ev('wispOn()'), true);
|
||||
ev("S.lvl=1;compute();UI.sel={type:'city',id:'suv'};UI.tab='cust';renderAll()");
|
||||
assert.equal(ev('wispOn()'), false);
|
||||
assert.doesNotMatch(ev("document.getElementById('panel').textContent"), /Island Wi-Fi/);
|
||||
assert.equal(ev("wispFact('suv')+wispHtml('suv')"), '');
|
||||
assert.equal(ev('R.wispL.length'), 0, 'its homes are no demand');
|
||||
assert.match(ev("wispSatWhy('vanualevu','kac1',2)"), /level 2/);
|
||||
ev("ACT.startScn({id:SCN[0].id})");
|
||||
assert.equal(ev('!!S.scn&&wispOn()'), false, 'scenarios');
|
||||
ev("ACT.pzStart({id:PZ[0].id})");
|
||||
assert.equal(ev("S.mode==='puzzle'&&wispOn()"), false, 'puzzles');
|
||||
ev("ACT.pzArStart({id:'euro'})");
|
||||
assert.equal(ev('!!S.ar&&wispOn()'), false, 'the Architect');
|
||||
ev("ACT.pzLeave();ACT.modeSet({m:'sandbox'});ACT.start({});if(UI.pendGame)ACT.pitchSkip()");
|
||||
assert.equal(ev("S.mode==='sandbox'&&wispOn()"), true, 'sandbox has them');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('Starblink: a gateway on your fiber in the zone\'s own city brings 90% of the islands online at about 30 ms', (t) => {
|
||||
const { ev, errors } = game(t, 'S.lvl=5;' + SUV + "ACT.buildPop({city:'yfb'});ACT.teleBuild({city:'yfb'});");
|
||||
assert.match(ev("wispSatWhy('vanualevu','sb53',5)"), /gateway/);
|
||||
ev("ACT.wispSat({z:'vanualevu',bird:'sb53',g:5})");
|
||||
assert.equal(ev(Z), null, 'refused without a gateway');
|
||||
ev("ACT.teleLeo({city:'suv'})");
|
||||
assert.equal(ev("wispSatWhy('vanualevu','sb53',5)"), '');
|
||||
assert.equal(ev(`leoReachLL('suv',WISP.vanualevu.lat,WISP.vanualevu.lon)`), true);
|
||||
const rtt = ev("Math.round(2*wispMs('vanualevu','sb53'))");
|
||||
assert.ok(rtt >= 25 && rtt <= 45, `about 30 ms round trip, got ${rtt}`);
|
||||
// Nunavut is past the shell: GEO only, whatever you build.
|
||||
assert.ok(!J(ev, "wispBirds('nunavut')").includes('sb53'));
|
||||
assert.match(ev("wispSatWhy('nunavut','sb53',5)"), /does not see both/);
|
||||
const c0 = ev('S.cash');
|
||||
ev("ACT.wispSat({z:'vanualevu',bird:'sb53',g:5})");
|
||||
assert.equal(c0 - ev('S.cash'), ev("wispKit('vanualevu')+wispSatMo('sb53',5)"));
|
||||
assert.equal(ev("wispSatMo('sb53',5)"), Math.round(ev("satMo('sb53',5)") * 0.6 / 10) * 10, 'a contended share of Starblink\'s own price');
|
||||
ev(ready);
|
||||
assert.ok(Math.abs(ev(`wispK('vanualevu',${Z})`) - ev("wispPool('vanualevu')*SAT_ORB.leo.wisp")) < 1e-9, 'about 90% over LEO');
|
||||
ev(`${Z}.d=4;compute()`);
|
||||
assert.ok(Math.abs(ev('R.wisp.vanualevu.car') - 4) < 1e-9);
|
||||
assert.equal(ev('R.cost.sat'), ev("TPORT_MO*2+LEO_GW_MO+wispSatMo('sb53',5)"));
|
||||
// The gateway's readout counts the islands landing there; it stays while they ride it.
|
||||
ev("UI.sel={type:'city',id:'suv'};UI.tab='links';renderAll()");
|
||||
const infra = ev("document.getElementById('panel').textContent");
|
||||
assert.match(infra, /Landing here from orbit4\.0 Gbps/);
|
||||
assert.ok(!J(ev, "[...document.querySelectorAll('#panel [data-act]')].map(b=>b.dataset.act)").includes('teleLeoRm'));
|
||||
ev("ACT.teleLeoRm({city:'suv'});ACT.teleLeoRm({city:'suv'})");
|
||||
assert.equal(ev("leoGw('suv')"), true, 'not while a zone rides it');
|
||||
// A storm puts it in safe mode too, and a zone alone is enough for one to come.
|
||||
assert.equal(ev('leoLive()'), true, 'a zone over LEO is in the sky');
|
||||
ev('fireFailure("leostorm");compute()');
|
||||
assert.ok(ev('S.ev.sky') > ev('S.day'));
|
||||
assert.equal(ev('R.wisp.vanualevu.car'), 0, 'safe mode');
|
||||
ev("UI.sel={type:'city',id:'suv'};UI.tab='cust';UI.wz='vanualevu';renderAll()");
|
||||
assert.match(ev("document.getElementById('panel').textContent"), /Safe mode through a solar storm/);
|
||||
ev('S.day=S.ev.sky;compute()');
|
||||
assert.ok(ev('R.wisp.vanualevu.car') > 0, 'back after the storm');
|
||||
// Once your own constellation carries, Starblink sells nothing new: no growth, no new zone; the circuit keeps running.
|
||||
ev("S.pieV=1;pieInit();S.pie.crusts.short.cohorts=[{n:CRUSTS.short.full,day:S.day,las:false}];compute()");
|
||||
assert.equal(ev('leoRival()'), true);
|
||||
ev("ACT.wispSatSize({z:'vanualevu',g:10})");
|
||||
assert.equal(ev(`${Z}.sat.g`), 5, 'no growth');
|
||||
assert.match(ev("wispSatWhy('santo','sb53',5)"), /rival constellation|POP in/);
|
||||
assert.ok(ev('R.wisp.vanualevu.car') > 0, 'the circuit already rented keeps carrying');
|
||||
ev("ACT.wispSatSize({z:'vanualevu',g:5})");
|
||||
// A reload without the gateway drops the LEO circuit; a GEO one stays.
|
||||
const s = J(ev, "(()=>{const s=JSON.parse(JSON.stringify(S));delete s.pops.suv.leo;return migrate(s);})()");
|
||||
assert.equal(s.pops.suv.wisp.vanualevu.sat, undefined);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('on a phone: the zones in the Customers tab, the order rows, the spur and the teleport rows, at 360 px', (t) => {
|
||||
const { ev, errors } = game(t, SUV);
|
||||
ev('window.innerWidth=360;window.innerHeight=740;window.dispatchEvent(new window.Event("resize"))');
|
||||
assert.equal(ev('isPhone()'), true);
|
||||
const text = (sel) => ev(`(document.querySelector('${sel}')||{}).textContent||''`);
|
||||
const acts = (sel) => J(ev, `[...document.querySelectorAll('${sel} [data-act]')].map(b=>b.dataset.act)`);
|
||||
// A city with zones and no POP: the chip and the teaser.
|
||||
ev("UI.sel={type:'city',id:'tbu'};renderAll()");
|
||||
assert.match(text('#panel'), /1 island zone/);
|
||||
assert.match(text('#panel'), /Open a POP here to bring Wi-Fi to the islands around it: Vava’u & Ha’apai \(3\.\d Gbps of homes\)/);
|
||||
// With a POP and no teleport yet, the teleport's reach counts the islands too.
|
||||
ev("ACT.buildPop({city:'tbu'});UI.sel={type:'city',id:'tbu'};UI.tab='links';renderAll()");
|
||||
assert.match(text('#panel'), /in reach at your level\.\s*Island Wi-Fi from this teleport: 1 island zone/);
|
||||
// The zone, opened, before anything is bought: the birds, the kit, the spur.
|
||||
ev("UI.sel={type:'city',id:'suv'};UI.tab='cust';renderAll();ACT.wispOpen({z:'vanualevu'})");
|
||||
assert.equal(ev('UI.wz'), 'vanualevu');
|
||||
assert.match(text('#panel'), /Island Wi-Fi[^]*No link yet[^]*Backhaul[^]*island kit[^]*Spur cable[^]*Lay the spur/);
|
||||
assert.ok(acts('#panel').filter((a) => a === 'wispSat').length >= 4, 'sizes as buttons');
|
||||
assert.ok(acts('#panel').includes('teleTrk'), 'MEO: the tracking antennas first');
|
||||
ev(VL + ready + ';renderAll()');
|
||||
assert.match(text('#panel'), /Homes online[^]*Served on the islands[^]*Towers, solar and crews/);
|
||||
assert.ok(acts('#panel').includes('wispSatSize') && acts('#panel').includes('wispSatRm') && acts('#panel').includes('wispRm'));
|
||||
// The same button folds it.
|
||||
ev("ACT.wispOpen({z:'vanualevu'})");
|
||||
assert.equal(ev('UI.wz'), null);
|
||||
ev("ACT.wispOpen({z:'vanualevu'})");
|
||||
const h = ev("[...document.querySelectorAll('#panel section')].filter(s=>/Island Wi-Fi/.test(s.querySelector('h3').textContent)).map(s=>s.innerHTML).join('')");
|
||||
assert.match(h, /Homes online/);
|
||||
assert.doesNotMatch(h, /width:\s*\d+px|min-width|color:var\(--bad\)/, 'no fixed widths, no red that dark mode cannot read');
|
||||
for (const s of ['#panel', '#toasts']) assert.doesNotMatch(text(s), /wisp\.|satellites\.|undefined|NaN/, s);
|
||||
// The teleport lists the zone's circuit, which opens the zone.
|
||||
ev("UI.tab='links';renderAll()");
|
||||
assert.match(text('#panel'), /Island Wi-Fi from this teleport:[^]*Vanua Levu & Taveuni/);
|
||||
assert.ok(acts('#panel').includes('wispOpen'));
|
||||
// The dashboard's cost row.
|
||||
ev("ACT.wispSpur({z:'vanualevu'});" + ready + ";ACT.dash&&ACT.dash();renderDash&&renderDash()");
|
||||
assert.equal(ev("tr('wisp.costs_row')"), 'Island Wi-Fi: towers and spurs');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue