Compare commits
11 commits
3e30621684
...
9601345201
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9601345201 | ||
|
|
9496c26a25 | ||
|
|
417160f383 | ||
|
|
02b6c24d7b | ||
|
|
286ae48207 | ||
|
|
1f76639b8f | ||
|
|
ae78e82ddb | ||
|
|
2dc8274f34 | ||
|
|
7930d332f1 | ||
|
|
27ffa33d7c | ||
|
|
8068a45abd |
67 changed files with 2440 additions and 192 deletions
|
|
@ -6,6 +6,11 @@ All notable changes to this project are documented here. The project follows
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
- Linking to an island or remote town where no subsea cable lands, like Iqaluit or Adamstown, now says that a satellite can get there too. The window has a button to the order sheet from your teleports that reach it, up to four of them; without one, it says where a teleport would have to go (#83).
|
||||
- IPv4 notices in the NOC's notifications now have an Open button to the bank's Address space (#150). Notices like "Your IPv4 is full" already had that button when they popped up; now they keep it.
|
||||
- Red warning text and the capacity market's Hot and Cool tags now read well in dark mode (#80). The red is a lighter one on the dark panels, and the tags take the night colours instead of staying bright pastel chips.
|
||||
- The build standard can now take every broadband city IPv6-only while IPv4 is scarce (#150). Its new target, Broadband: IPv6-only, swaps the home routers of every city still on dual stack for 464XLAT ones, the cities with the most dual-stack homes first. "Bring everything up now" and your intern's Keep to the build standard order start a city's swap only with all of it to spare, and the intern counts it against the order's monthly budget. What the swaps under way still owe is set aside: the button's other jobs and every one of your intern's standing orders leave it alone, above the cash floor.
|
||||
- "Bring everything up now" in the build standard no longer takes a fiber dark for a day while a customer's alien or managed wave rides it. Such a fiber keeps its line system and the sheet says why; the upgrade button on the fiber itself still does it when you choose. Your intern waits for those fibers too, but no longer skips fibers that only carry leased pairs or IRUs, which a line system swap never touches.
|
||||
- The NOC dashboard's connections list no longer breaks when one of your fabric ports is already at 400G, the biggest a fabric port gets: it offers a LAG member instead of an upgrade.
|
||||
- Broadband cities can now go IPv6-only with 464XLAT, a second way to save IPv4 next to CGNAT. Start it from a city's Home broadband, which also says what it does to your monthly IPv4 bill: its home routers are swapped over a month or more, paid as each one goes in (new homes there get one too, at the same price), and the homes then need no IPv4 address of their own, only a share of a NAT64 pool at up to 256 homes per address, with fewer refunds than CGNAT at the same ratio. The bank's Address space section shows your homes as public, behind CGNAT and IPv6-only, with the NAT64 ratio next to the CGNAT one, and says which of the two to stretch when space runs out.
|
||||
- CGNAT gets a little cheaper every year: the world moves to IPv6 about two points a year, so less of your homes' traffic needs IPv4 and the CGNAT and NAT64 boxes carry less of it.
|
||||
|
|
@ -17,6 +22,8 @@ All notable changes to this project are documented here. The project follows
|
|||
- Teleports bring satellites to small islands and remote towns, long before you have a cable there or a rocket company (#83). Build one at a POP from level 2 and rent GEO circuits (about 600 ms round trip, and users notice) or, with tracking antennas from level 3, MEO circuits (about 130 ms) to any island or town its satellites see. Next to an island's only cable a circuit waits on standby (whether the cable or the circuit came first) and carries the island when the cable is cut, and a city with no cable at all gets a POP and a circuit in one order.
|
||||
- Set a build standard for your whole network: routers, a second building and a generator at every POP, LAGs, exchange ports and PNIs, line systems, optics and wave sizes, all in one sheet. New POPs get the POP part the day they open, the sheet shows what is below the standard and what fixing it costs, one tap brings everything up, and the new "Keep to the build standard" order has your intern do it a few jobs a day with money to spare. Find it in the menu, the Standing orders sheet and every POP's router section.
|
||||
- IPv4 is scarce now: business customers need public address blocks, and the homes that do not fit share addresses behind CGNAT. A new network starts with a /21 from its registry, enough for its first months; buy, lease or sell blocks from /24 to /16 on the transfer market in the bank's new Address space section, or lease spare ones out for a monthly income. An offer you have no addresses for says so and waits, a customer that wants to grow at renewal stays at its size until you have the addresses, CGNAT costs a little and annoys some gamers, and you pick how many homes share an address. IPv6 stays free for everyone. This is part of On-call and BGP at 3 a.m.; the gentler rules, Sandbox, puzzles and scenarios keep IPv4 plentiful, and saved games get the addresses they already use plus room to grow (#150).
|
||||
- Express lightpaths now pay their share when you add a regen site, and a dirty connector on a fiber dims the expresses riding it too (#58). A regen site added to a fiber that already carries expresses needs a regen card for each of their channels, just as for the fiber's own, and the price on the fiber's button includes them. A dirty connector dims every wave in that fiber, and the express's panel says which fiber it is; an MTU mismatch, microbursts or a marginal optic stay with that fiber's own routers and optics, which an express passes by.
|
||||
- Many selective networks now refuse to peer where a satellite circuit is your only way out (#83). On an island or in a remote town that only a satellite joins to the rest of your network, they would hand you traffic for your whole network to haul through orbit, so more of them turn down a GEO hop (about 600 ms there and back) than a MEO one (about 130 ms), and each says why on the exchange and PNI lists. Once a wave, fiber or cable to the island is lit they peer again. An exchange session you already had there pauses until then; a PNI you already have and the members of an exchange you run yourself keep peering.
|
||||
|
||||
## [3.3.0] — 2026-11-09
|
||||
|
||||
|
|
|
|||
|
|
@ -93,6 +93,28 @@ Development runs on `npm run dev` (assembles the development page on every reque
|
|||
| `scripts/weekly-scenario.js`, `scripts/lib/scenario-bot.js`, `site/scenarios/weekly/` | The weekly scenario generator, its reference player and its output (see below) |
|
||||
| `docs/adr/` | Decisions: GitHub Pages only (0001), one page assembled at build (0002), translations by label (0003), development-only code (0004) |
|
||||
|
||||
## This fork's own files
|
||||
|
||||
This copy adds features upstream does not have. They follow the same rules as the rest of `src/`, and are listed here
|
||||
apart so that upstream's tables above merge cleanly. The multiplayer server is for self-hosted copies only: a plain
|
||||
build stays the static page described above.
|
||||
|
||||
| Path | What it is |
|
||||
| --- | --- |
|
||||
| `src/game/60-features/96-pop-standard.js` (grown from upstream's POP standard), `src/game/90-actions/88-build-standard.js`, `src/game/93-ui/59-build-standard.js` | The build standard: one target for every POP, port and fiber (`BSTD`, saved sparse in `S.popStd`), what is below it and what bringing it up costs (`bstdPlan()`, `bstdQuote()`), the sheet, "Bring everything up now" (`bstdApply`) and the intern's "Keep to the build standard" order (`std`, in `95-standing-orders.js`). The router model and the line system are picked here and nowhere else |
|
||||
| `src/game/93-ui/15-theme.js`, `src/styles/05-theme.css`, `src/game/96-map/15-palette.js` | Dark mode (#80): Light, Dark or Auto per device (`sot-theme`), set on `<html data-theme>` before the first paint; the panels' dark colours as CSS custom properties; the map's colours per theme |
|
||||
| `src/game/60-features/33-address-space.js`, `src/game/90-actions/54-address-space.js`, `src/game/94-dashboard/72-address-space.js` | IPv4 address space (#150): blocks held, bought, leased in and leased out (`S.ip4`), customers' blocks, CGNAT and its ratio; the bank's Address space section |
|
||||
| `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/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 |
|
||||
| `scripts/lib/mp-sim-acts.js` | Server-run play's act tables (SEND, ASK, VOTE, LOCAL, CONFIRM, DRAFTS, TEXT, WINDOWS…) and the envelope check every request passes |
|
||||
| `scripts/lib/mp-sim-engine.js`, `scripts/lib/mp-sim-worker.js`, `scripts/lib/mp-sim-realm.js` | The server-run engine (merged, not wired in yet): worker threads, each holding a vm realm per network that runs the plain page's game, behind the promise API the session host will use ([plans/server-run.md](plans/server-run.md)) |
|
||||
| `tests/lib/mp-sim-*.js`, `tests/fixtures/mp-sim/` | Server-run play's contracts for the tests: the shape checker, the fake engine, the fixtures and their generator, the button crawl, and the player that plays a realm against a page |
|
||||
| `docs/plans/next-session.md`, `server-run.md`, `multiplayer-phase2.md` | What is left and what waits for a decision; the server-run design and its status; the phase 2 design (on hold) |
|
||||
|
||||
## Globals
|
||||
|
||||
- **`S`**: the whole saved game (one JSON object). Cash, day, POPs, links, transit,
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@ is switched on only when the build is told where the session server lives.
|
|||
Not yet (phase 2): peering, transit and competition between players inside the simulation. The card already carries
|
||||
what that will need (POPs, links, exchanges, transit, peering policy, reach).
|
||||
|
||||
## Being built: the server runs the game
|
||||
|
||||
Work has started on server-run play. In a multiplayer build, the session server will run every network's days, so all
|
||||
players of a session share one calendar and one speed, and the page will only show the network and send the player's
|
||||
clicks. The engine that runs networks on the server is in the source (`scripts/lib/mp-sim-*.js`), but nothing uses it
|
||||
yet and it is not switched on: sessions work exactly as this page describes, with each network simulated in its own
|
||||
player's browser. The design and how far it has got are in [plans/server-run.md](plans/server-run.md).
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
|
|
@ -209,3 +217,6 @@ Cards are what each player's browser says: nothing on the server checks that a n
|
|||
`src/game/95-modals/48-multiplayer.js` (door, sheets, panel, chip), `src/game/90-actions/92-multiplayer.js`
|
||||
(actions), `src/styles/41-multiplayer.css`. The build stamps `MP_API` into `src/game/00-core/20-analytics.js`.
|
||||
- Tests: `tests/mp-server.test.js`, `tests/multiplayer.test.js`.
|
||||
- Server-run play (being built, not switched on): the act tables `scripts/lib/mp-sim-acts.js`, the engine
|
||||
`scripts/lib/mp-sim-engine.js`, `mp-sim-worker.js` and `mp-sim-realm.js`, the page's side `src/game/98-server-play/`
|
||||
(a comment so far), and the tests `tests/mp-sim-*.test.js` and `tests/server-sim-prereqs.test.js`.
|
||||
|
|
|
|||
|
|
@ -1,75 +1,168 @@
|
|||
# What is left (as of 2026-11-07)
|
||||
# What is left (as of 2026-11-09)
|
||||
|
||||
Work in this fork, pushed to the `vanvik` Forgejo remote (never to `origin`). Built so far: the build standard (the only
|
||||
place for the router model and line system), multiplayer phase 1, dark mode (#80), IPv4 address space (#150) with
|
||||
IPv6-only broadband and NAT64, express fiber (#58) and satellite teleports (#83). Everything below is planned or known,
|
||||
not built. Items 5 and 6 wait for the owner's go.
|
||||
Work in this fork, pushed to the `vanvik` Forgejo remote (never to `origin`). Written on top of 3e30621, with the
|
||||
batch of fixes below ("Built in the batch of 2026-11-09"). Nothing below is switched on or built unless it says so.
|
||||
|
||||
## Promised and not done yet
|
||||
## Built so far
|
||||
|
||||
1. and 2. are built: the router model and the line system are picked in the Build standard sheet only (the `routers` and
|
||||
`optup` orders read `bstd().g` / `bstd().sys`; sanitize moves an old setting into `S.popStd`), and `std` takes a fiber
|
||||
dark on `optup`'s routing test (`opsDark()`), sharing its budget a night, with one owner per fiber a shift (`X.fib`).
|
||||
On top of upstream, merged up to 3.3.0 (61e31c5 "Merge upstream: Lambda Bazaar, traffic badges, moving customers and
|
||||
faster routing (3.3.0)"; earlier merges 032470f and 4b922ab):
|
||||
- **Build standard**: 2b48a6a "A build standard for the whole network, kept by the intern", and fbae6fc "The build
|
||||
standard owns the router model and the line system; one owner per fiber" (the router model and line system are
|
||||
picked in the sheet only; the `routers` and `optup` orders read them from there).
|
||||
- **Multiplayer phase 1** for self-hosted copies: 95aa9b6 "Multiplayer for self-hosted copies: sessions, server-side
|
||||
saves, a leaderboard" (`docs/MULTIPLAYER.md`).
|
||||
- **Dark mode (#80)**: 2cd6b71 "Dark mode: Light, Dark or Auto under Settings › Theme".
|
||||
- **IPv4 address space (#150)**: eac0604 "IPv4 address space: scarce, bought, leased, leased out; IPv6 is free", and
|
||||
69328ce "IPv6-only broadband: 464XLAT city by city, a NAT64 pool next to CGNAT".
|
||||
- **Express fiber (#58)**: 8e1f2d6 "Express fiber: light a wave through a city without its router".
|
||||
- **Satellite teleports (#83)**: e1ae8e0 "Satellite teleports: GEO and MEO circuits for islands and remote towns".
|
||||
- A fix after the 3.1.0 merge: e8808f6 "The connections list no longer breaks on a 400G fabric port".
|
||||
- **Server-run play, parts 1 and 2** (merged, not switched on): T1 is d1e127d "Server-run play, part 1: game
|
||||
prerequisites and shared contracts". T2 is 065c922 "Server-run play, part 2: the engine" with its fixes c5c7ea9,
|
||||
72f31e8, 3b8c331, 9597d89, 77f4035 and 3e30621. The design, its status and what building T2 changed in it are in
|
||||
`docs/plans/server-run.md`.
|
||||
|
||||
## Next features
|
||||
### Built in the batch of 2026-11-09
|
||||
|
||||
3. **The server runs every game of a multiplayer build** (decided 2026-11-07, being designed and built). In a page built
|
||||
with `MP_API`, each network's days run on the session server, not in the browser, so every player of a session is on
|
||||
the same day at the same speed. A single-player game in that build is a session of one and runs there too; old local
|
||||
saves keep working in the browser, and the plain build stays exactly as it is (static, no server, no requests).
|
||||
- **Speed:** 1× by default (one day per `DAY_MS`, 2.5 s). Players vote for another speed, pause included; alone in a
|
||||
session your vote decides at once. The world pauses while no player is connected.
|
||||
- **Absent players:** while anyone plays, the networks of those away keep running on the server (their intern's
|
||||
standing orders help), so nobody falls behind.
|
||||
- **Why:** the same day for everyone, which phase 2's trades need, and less work for phones at higher speeds (at 1× the
|
||||
day is about 10–15% of a phone's CPU on the big test network, at 8× about half; map and panels stay in the browser).
|
||||
- **What stays in the browser:** map drawing and panels. The flow tables (`R.ef`/`R.fl`, about 3 MB per routing on the
|
||||
big network) cannot be shipped every day, so what reads them (a selected link on the map, the link panel, PNI value,
|
||||
puzzles) has to ask for them.
|
||||
- **Phase 2 gets simpler:** with every world in one server process, its wall-clock timing (tenders that close after 10
|
||||
real minutes, `idle` ≥ 300 s, notice on each player's own clock) can move to game days.
|
||||
4. **IPv6-only broadband, the follow-up** (after the server-run game, or alongside it: it touches the build standard and
|
||||
the intern, not the server). A build-standard row "Broadband: IPv6-only" (cities with broadband start the swap) and the
|
||||
intern's `std` order rolling it out when there is money, busiest CGNAT cities first. `ip6Go`/`ip6Stop` and the city
|
||||
panel are in `src/game/60-features/34-ipv6-only.js`; the row goes into `BSTD` and `bstdPlan` (96-pop-standard.js).
|
||||
5. **Wave B: #97 co-op companies** (several players run one network with roles, budgets and approvals), host-authoritative
|
||||
over the multiplayer server, and **multiplayer phase 2** (players as carriers in each other's simulations: transit,
|
||||
peering, PNIs, shared fiber): design in `docs/plans/multiplayer-phase2.md`.
|
||||
6. **Wave C: #144 directional traffic**, last and on its own: keep the totals, split them by traffic profile, utilization is
|
||||
the busier direction. It comes after #58 because both touch link capacity (express channels now count too).
|
||||
Nine commits after 3e30621, the one that wrote this list and "Review fixes for the small-fix batch" (folded into
|
||||
the entries below); every code change comes with its test:
|
||||
- 8068a45 "Plans: the server-run design in the repo, what is left now, and the fork's files" (this file,
|
||||
`server-run.md`, the fork's files in `ARCHITECTURE.md`, a note in `MULTIPLAYER.md`).
|
||||
- **Dark mode (#80)**, 27ffa33: red text is `--tx-red` (a lighter red at night) everywhere it is text, in the styles
|
||||
and in 19 game files; fills, borders and bars that carry white letters keep `--bad`. The market's Hot and Cool tags
|
||||
take `--tint-o`/`--tx-amber` and `--tint-b`/`--tx-blue`. `tests/dark-mode.test.js` fails on any new
|
||||
`color:var(--bad)`. Decided not to: light mode's `--bad` on white (3.24, under AA) stays as upstream has it.
|
||||
- **IPv4 (#150)**, 7930d33: IPv4 notices in the notification log open the Address space (log target `{a:'ip4'}`,
|
||||
`ip4Open` in `NOC_GO`); with IPv4 off since, they open the bank.
|
||||
- **Satellites (#83)**, 2dc8274: the "no subsea cable lands here" hint (#321) names a satellite circuit where one can
|
||||
reach the city, with a "From X" button per teleport (up to four) to the order sheet (`satNoCable()`), or where a teleport would
|
||||
have to go. It covers only the city the hint names.
|
||||
- **Express fiber (#58)**, ae78e82: a regen site added later charges a regen card per express channel on its fiber
|
||||
(`regenAddCost()`, used by the action, the button's price and the MCP quote); a dirty connector (loss with
|
||||
`glass:true`) dims every express on the fiber (`xpGlassF()`), and the express panel names the fiber. Decided not to:
|
||||
an MTU mismatch, microbursts and a marginal optic's CRC errors stay with the fiber's own routers and optics, which an
|
||||
express passes by (as an optic failure already did, while amp-hut and ROADM incidents darken expresses).
|
||||
- **Satellites (#83)**, 1f76639: selective networks refuse to peer where a satellite circuit is the island's or
|
||||
town's only way out (`satOnly()`: a fiber or cable with no optics of its own does not count): 60 in 100 refuse a
|
||||
GEO hop, 15 in 100 a MEO one, each network's answer fixed; a session already there stops carrying until a wave or
|
||||
cable is lit. Decided not to: a worse traffic ratio for MEO,
|
||||
refusals at exchanges you run, and any effect on PNIs already there.
|
||||
- **Build standard**, 286ae48: "Bring everything up now" and the intern follow one rule: a fiber a customer's alien or
|
||||
managed wave rides keeps its line system (`dfWaveCust()`), and the sheet says why (`bstd.held_wave`); leased pairs
|
||||
and IRUs no longer hold a fiber for the intern. Left as it was: the fiber panel's own upgrade button (`ACT.upSys`)
|
||||
still swaps under a sold wave, with its warning toast.
|
||||
- **Standing orders**, 02b6c24: the shift's log keeps at most three broken orders, the week's tally no longer makes an
|
||||
empty list of places, and `opsTidy()` is gone (`tests/canonical-state.test.js` passes without it).
|
||||
- **IPv6-only broadband (#150)**, 417160f: the build standard's "Broadband: IPv6-only" row (`BSTD` `v6`, shown only
|
||||
while `ip4On()`). `bstdPlan()` makes one job per dual-stack broadband city (`ip6Todo()`), the most dual-stack homes
|
||||
first, priced as the whole swap (`ip6Cost()`); the button and the `std` order start one only with all of it above
|
||||
the floor on top of what running swaps still owe (`ip6Owed()`), and the order counts it against its month's budget.
|
||||
What running swaps owe, whoever started them, is set aside for every later job: the button's, and every standing
|
||||
order's (`X.ow` in `opsShift()`, refreshed when the `std` order starts a swap). Decided not to: a separate hold in
|
||||
`ip6Day()` at the cash floor; with the money set aside, the swaps pay down to the floor at most.
|
||||
|
||||
## The user's answers (2026-11-09)
|
||||
|
||||
The four questions of the server-run design:
|
||||
1. A player who joins an old session starts on the **session's date**: one shared calendar. The game's day-0 rules
|
||||
then have to count from each network's own start (`server-run.md`, "What Q1 changes").
|
||||
2. Single player in a multiplayer build runs **on the server** by default; "this device" stays an option.
|
||||
3. An empty session that wakes runs at **1×**.
|
||||
4. Phase-1 sessions **start fresh**: nothing is migrated.
|
||||
|
||||
## On hold until the user says go
|
||||
|
||||
- **#97 co-op companies** (several players run one network, with roles, budgets and approvals).
|
||||
- **Multiplayer phase 2** (players as carriers in each other's simulations: transit, peering, PNIs, shared fiber):
|
||||
design in `docs/plans/multiplayer-phase2.md`. When it restarts, that design needs rework for the shared server clock:
|
||||
it assumes each player's own clock, and tenders and notice timed in real minutes.
|
||||
- **#144 directional traffic**, last and on its own: keep the totals, split them by traffic profile, utilization is the
|
||||
busier direction. It comes after #58 because both touch link capacity (express channels count too).
|
||||
|
||||
## Open questions waiting for the user
|
||||
|
||||
Asked on 2026-11-09, not answered yet:
|
||||
1. **Late joiners' prices and beginner grace.** With one calendar, a friend who joins an old session meets its economy
|
||||
from day one: at day 1868, hardware about 18% dearer and customer prices about 34% lower, with the 180-day beginner
|
||||
grace long over. Keep that, or give a grace or extra starting cash counted from the joiner's own start?
|
||||
2. **Other players' POPs on the map.** Draw other players' POPs and links on your map (from their cards) as part of
|
||||
the server-run work, or wait for phase 2?
|
||||
3. **The other modes in a multiplayer build.** Sandbox, scenarios, puzzles and the weekly keep running on the device.
|
||||
Fine, or should sandbox (or all of them) also run on the server?
|
||||
4. **Dark mode and the build standard upstream.** Upstream contributors have said they will open pull requests for a
|
||||
dark mode (#80) and a bulk redundancy kit (#317), and a three-tier router standard sits on another contributor's
|
||||
branch (#315). Offer the fork's dark mode and build standard upstream before those land, or keep them fork-only and
|
||||
settle the clash at the next merge?
|
||||
5. **#58 whole-fiber splicing.** Is the express lightpath enough, or should a whole fiber pair also splice through a
|
||||
city (one dark fiber A–C through B, with no ROADM at B)? The issue asks for "waves and/or entire fibers".
|
||||
6. **#83 WISP zones and a rented LEO tier.** Add island demand pools served remotely on top of the existing island
|
||||
cities, and a tier between MEO and Pie in the Sky that rents LEO capacity from a partner network? Or are teleports
|
||||
with GEO and MEO circuits enough?
|
||||
7. **Investors' cut of IPv4 lease income.** Should investors on a revenue-share loan take their cut of the income from
|
||||
leasing out IPv4 blocks too? Today they do not (dark fiber sold to customers is in their share).
|
||||
8. **Founding an exchange on a basic router.** Founding your own exchange gives a 400G port even where the POP's router
|
||||
only takes 100G, though the shop would not sell that port. Document it as a limitation, block founding until the
|
||||
router takes 400G, or found at the router's largest port size? (`tests/server-sim-prereqs.test.js` asserts today's
|
||||
behaviour.)
|
||||
9. **The six old wip worktrees.** They hold nothing `main` lacks. Delete them and their branches?
|
||||
|
||||
## Next
|
||||
|
||||
- **After the user's go:** T3 (host and protocol), T4 (the browser client) and the integration of server-run play,
|
||||
as `docs/plans/server-run.md` describes them, with the corrections at its top. That includes the Q1 work: the game's
|
||||
`S.day0` and day-0 rules, a start day for a new network on the server, and `CLOCK.off` taken out of the contract.
|
||||
|
||||
## Known limitations of what shipped
|
||||
|
||||
- **Multiplayer:** other players' POPs are not drawn on the map (no clean hook yet); cards are what each browser reports,
|
||||
the server does not verify them; a save over ~60 KB sends only the card when the tab closes; the HUD chip in phone
|
||||
landscape wider than 760 px was not measured. Behind a reverse proxy, run the server with `--trust-proxy`, or every
|
||||
player shares one address for the rate limits.
|
||||
- **Build standard:** the game menu has 8 tiles in a multiplayer game (7 otherwise), so the last row is not full. The
|
||||
sheet's quote and "Bring everything up now" still judge a line-system swap without routing (`bstdDarkOk()`: a quiet
|
||||
fiber, under 10% of its capacity, or a parallel link with room; any express with traffic holds its fibers,
|
||||
`bstdXpBusy()`), so the quote is the bill; only the intern routes to test. A quiet fiber with no way around can still
|
||||
go dark from the button. An old save's `routers.model` moved into the standard (only from a running order with an
|
||||
intern hired; a paused one's is dropped) also becomes what new POPs get. A model or line system in the standard is a
|
||||
ceiling for the `routers` and `optup` orders (their next-one-up rule only applies with "keep"), as an order's own
|
||||
model was before; `optup` has no per-POP exceptions, so it moves fiber at POPs excepted from `std` too.
|
||||
- **Dark mode (#80):** red error text on dark tinted cards is about 3.8–4.3:1 (bold, but below AA 4.5); the share card PNG
|
||||
and the web manifest stay light; the WebGL map was checked by tests only, not by eye in a real GPU browser.
|
||||
- **IPv4 (#150):** the intern does not manage addresses (optional in the issue); transfers are instant; lease-out income
|
||||
is not in the investor revenue share; blocks granted to old saves can be sold after two years (a one-off windfall);
|
||||
CGNAT annoyance costs refunds but does not slow broadband growth; the NOC window's address-space button does nothing.
|
||||
- **IPv6-only broadband:** no one-off grumble while a city's home routers are swapped; the swap and the NAT64 ratio are
|
||||
not in the build standard or the intern's orders yet (item 4); a new home in an IPv6-only city pays its router even
|
||||
when cash is short (a running cost, so a finished city never looks like a stopped swap).
|
||||
- **Express fiber (#58):** splicing a whole fiber pair through a city was left out on purpose (every fiber end is a POP;
|
||||
expresses cover the need); loss and MTU incidents on a fiber do not reduce the expresses on it; the fiber panel's
|
||||
"n of max channels" line does not count express slots (the Express section does); regen sites added later do not charge
|
||||
regen cards for express channels.
|
||||
- **Satellites (#83):** no WISP zones, no satellite incidents (rain fade, sun outage), no footprints on the map, no
|
||||
satellite tab in the drag-to-link window (ordering is from the city panel); GEO/MEO losses and prices are design
|
||||
numbers; well-cabled islands (Wellington, Hobart) also count as "can be served"; MEO needs 5° elevation (10° would drop
|
||||
416 pairs); Pitcairn's $120k satellite grant stays Pie-only.
|
||||
- **Multiplayer (phase 1):** each browser runs its own clock, so the players' worlds drift apart (server-run play fixes
|
||||
this for new sessions only); other players' POPs are not drawn on the map (open question 2); cards are what each
|
||||
browser reports, and the server does not check them; a save over ~60 KB sends only the card when the tab closes, and
|
||||
the save goes with that device's next push; a session network still makes its save on the page, so it misses 3.3.0's
|
||||
smoother saves in the worker; the capacity market and path moves are each player's own, with no market shared
|
||||
between players; the HUD chip in phone landscape wider than 760 px has not been checked by eye (worth doing when T4
|
||||
changes the chip). Behind a reverse proxy, run the server with `--trust-proxy`, or every player shares one address's
|
||||
rate limits.
|
||||
- **Server-run engine (merged, not switched on):** a checkpoint is over its size budget, and so are a snapshot, a big
|
||||
realm's memory and a small network's day; a checkpoint written before c5c7ea9 restores close to exact, not exact; the
|
||||
engine has no per-call deadline of its own; a worker of its own whose session's loads all fail stays idle until the
|
||||
next unload; the path window would read routes the page never gets (`server-run.md`, "Corrections from building
|
||||
T2").
|
||||
- **Build standard:** the game menu's last row of tiles is not full (7 tiles, or 8 in a multiplayer game, in rows of
|
||||
3). The sheet's quote and "Bring everything up now" judge a line-system swap without routing (`bstdDarkOk()`: a
|
||||
quiet fiber, under 10% of its capacity, or a parallel link with room; any express with traffic holds its fibers,
|
||||
`bstdXpBusy()`), so the quote is the bill; only the intern routes to test. A quiet fiber with no way around can
|
||||
still go dark from the button for a day. A fiber a customer's alien or managed wave rides keeps its line system for
|
||||
both the button and the intern (`dfWaveCust()`); the fiber panel's own upgrade button still swaps it, with only a
|
||||
toast to warn. `bstdSet` accepts the `v6` target while IPv4 is plentiful: it is saved, hidden and never planned. An
|
||||
old save's `routers.model` moved into the standard (only from a running
|
||||
order with an intern hired; a paused one's is dropped) also becomes what new POPs get. A model or line system in the
|
||||
standard is a ceiling for the `routers` and `optup` orders (their next-one-up rule only applies with "keep"), as an
|
||||
order's own model was before; `optup` has no per-POP exceptions, so it moves fiber at POPs excepted from `std` too.
|
||||
- **Dark mode (#80):** the share card PNG and the web manifest stay light; the WebGL map was checked by tests only, not
|
||||
by eye in a real GPU browser.
|
||||
- **IPv4 (#150):** the intern does not manage addresses (optional in the issue); transfers are instant (real ones take
|
||||
weeks); lease-out income is not in the investor revenue share (open question 7); blocks granted to old saves can be
|
||||
sold after two years (a one-off windfall); CGNAT annoyance costs refunds but does not slow broadband growth.
|
||||
- **IPv6-only broadband:** no one-off grumble while a city's home routers are swapped; a new home in an IPv6-only city
|
||||
pays its router even when cash is short (a running cost, so a finished city never looks like a stopped swap). The
|
||||
NAT64 ratio is not in the build standard (the swap is), and the standard starts a swap only with the whole of it to
|
||||
spare, stricter than the city panel's button (the first day's routers).
|
||||
- **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
|
||||
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
|
||||
networks judge a satellite-only island by fixed shares (60 in 100 refuse GEO, 15 in 100 MEO), not by its traffic;
|
||||
GEO/MEO losses and prices are design numbers; well-cabled islands (Wellington, Hobart) also count as "can be
|
||||
served"; MEO needs 5° elevation (10° would drop 416 pairs); Pitcairn's $120k satellite grant stays Pie-only.
|
||||
|
||||
## Housekeeping
|
||||
|
||||
- `npm run perf -- --browser` runs with `PERF_CHROME=/usr/bin/chromium`.
|
||||
- The merged worktrees under `.claude/worktrees/` and their `worktree-wf_*` branches can be removed.
|
||||
- The phase-1 playtest on port 8090 runs from its own checkout outside the repo, with its data in
|
||||
`mp-data/playtest`: leave it alone unless the user asks. Its one session can go once a server-run build replaces it
|
||||
(answer 4).
|
||||
- The six old wip worktrees under `.claude/worktrees/` wait for the user's answer (open question 9).
|
||||
|
|
|
|||
1418
docs/plans/server-run.md
Normal file
1418
docs/plans/server-run.md
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -421,6 +421,7 @@
|
|||
"bstd.cost_mo":"Laufende Kosten",
|
||||
"bstd.cost_now":"Um jetzt alles hochzuziehen",
|
||||
"bstd.edit":"Build-Standard bearbeiten",
|
||||
"bstd.every_bb_city":"In jeder Breitband-Stadt",
|
||||
"bstd.every_exchange":"Wo es einen IX gibt",
|
||||
"bstd.fastest":"Die schnellste, die reicht",
|
||||
"bstd.fiber_note_two":"Ein Line-System-Tausch legt die Glasfaser einen Tag dunkel. Der Button macht das nur bei ruhiger Faser oder wenn ein paralleler Link ihre Last trägt; dein Praktikant nur, wenn der ganze Verkehr um die Faser herumkommt.",
|
||||
|
|
@ -429,6 +430,7 @@
|
|||
"bstd.g_port":"Ports und Peering",
|
||||
"bstd.generator":"Generator",
|
||||
"bstd.held":{"one":"Eine Glasfaser behält vorerst ihr Line System, bis sie ruhig ist oder ein paralleler Link ihre Last für den Tag trägt, an dem sie dunkel ist. Bis dahin bekommt sie die schnellste Optik, die ihr Line System nimmt.","other":"{n} Glasfasern behalten vorerst ihr Line System, bis sie ruhig sind oder ein paralleler Link ihre Last für den Tag trägt, an dem sie dunkel sind. Bis dahin bekommen sie die schnellste Optik, die ihr Line System nimmt."},
|
||||
"bstd.held_wave":{"one":"Eine Glasfaser behält ihr Line System: Auf ihr läuft die Wave eines Kunden, die am Tag des Tauschs mit ihr dunkel wäre. Der Upgrade-Button an der Glasfaser selbst macht es trotzdem, wann du willst. Bis dahin bekommt sie die schnellste Optik, die ihr Line System nimmt.","other":"{n} Glasfasern behalten ihr Line System: Auf ihnen laufen Waves von Kunden, die am Tag des Tauschs mit ihnen dunkel wären. Der Upgrade-Button an jeder Glasfaser macht es trotzdem, wann du willst. Bis dahin bekommen sie die schnellste Optik, die ihr Line System nimmt."},
|
||||
"bstd.hire_note":"Stell in Ops einen NOC-Praktikanten ein, dann hält er jeden POP, Port und jede Glasfaser auf dem Standard: ein paar Jobs pro Tag, die meistbelasteten zuerst, im Monatsbudget und nur mit Geld übrig.",
|
||||
"bstd.in_n_cities":"In mindestens {n} Städten",
|
||||
"bstd.intern_keeps":"{name} hält das Netz auf Standard",
|
||||
|
|
@ -439,6 +441,7 @@
|
|||
"bstd.l_pni":"PNIs pro Netz",
|
||||
"bstd.l_site2":"Zweites Gebäude",
|
||||
"bstd.l_split":"LAGs aufteilen",
|
||||
"bstd.l_v6":"Breitband: nur IPv6",
|
||||
"bstd.left":{"one":"Noch eine Sache liegt darunter und wartet auf Geld, eine ruhige Glasfaser oder eine Erweiterung.","other":"Noch {n} Sachen liegen darunter und warten auf Geld, eine ruhige Glasfaser oder eine Erweiterung."},
|
||||
"bstd.n_more_targets":{"one":"{n} weiteres Ziel","other":"{n} weitere Ziele"},
|
||||
"bstd.new_pops_note":"Ein neuer POP bekommt das sofort, solange er noch leer ist: kein Wartungsfenster. Reicht das Geld nicht, bekommt er, was passt. Ein noch gesperrtes Modell heißt: das beste freigeschaltete darunter.",
|
||||
|
|
@ -449,6 +452,7 @@
|
|||
"bstd.second_building":"zweites Gebäude",
|
||||
"bstd.tagline":"Ein Design fürs ganze Netz: was jeder POP, Port und jede Glasfaser haben soll. Neue POPs bekommen den POP-Teil am Tag der Eröffnung; dein Praktikant oder der Button unten zieht den Rest nach.",
|
||||
"bstd.title":"Build-Standard",
|
||||
"bstd.v6_note":"Nur IPv6 tauscht die Heimrouter jeder Breitband-Stadt, zuerst dort, wo die meisten Dual-Stack-Haushalte sind. Der Preis ist der ganze Tausch, bezahlt beim Einbau, und eine Stadt startet erst, wenn du den ganzen Betrag übrig hast.",
|
||||
"businesses.a_free_pni_with_voda_phony":"Ein kostenloser PNI mit Voda-Phony. Hardware: Absolute-Unit-3.2T-Router, 3.2T-Ports und 12.8T-Waves.",
|
||||
"businesses.agi_lab_allegedly":"AGI-Labor (angeblich)",
|
||||
"businesses.agi_labs_allegedly_wanting_ai_wans":"AGI-Labore (angeblich), die KI-WANs mit 12,8 bis 25,6 Tbps wollen, und kostenlose PNIs mit Du-opoly und Ooh-redoo. Hardware: Mikrowtik-CCR-3.2T-Router.",
|
||||
|
|
@ -2068,6 +2072,7 @@
|
|||
"express.dark_gone":"Eine der Glasfasern darunter gibt es nicht mehr.",
|
||||
"express.dark_reach":"Keine ihrer Optiken schafft diese Strecke.",
|
||||
"express.dark_system":"Auf {span} ist das Line System down.",
|
||||
"express.dim":"{span} hat einen verschmutzten Stecker: Jede Wave auf dieser Glasfaser, auch dieser Express, läuft mit {p}, bis jemand den Stecker reinigt.",
|
||||
"express.express_to":"Express nach …",
|
||||
"express.eyebrow":"Express-Lightpath · {km} km",
|
||||
"express.fiber_busy":{"one":"<b>Über diese Glasfaser läuft ein Express-Lightpath.</b><br>Bau ihn zuerst ab: Öffne ihn im Express-Abschnitt dieser Glasfaser.","other":"<b>Über diese Glasfaser laufen {n} Express-Lightpaths.</b><br>Bau sie zuerst ab: Öffne sie im Express-Abschnitt dieser Glasfaser."},
|
||||
|
|
@ -2943,6 +2948,7 @@
|
|||
"link_modal.no_subsea_cable_lands_in_city":"In {city} landet kein Seekabel an. Die nächste Landestation ist {near}: Verleg zuerst Glasfaser dorthin und nimm dann von dort ein Kabel.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_land":"In {city} landet noch kein Seekabel an. Komm über Land hin oder verleg dein eigenes Seekabel.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own":"In {city} landet noch kein Seekabel an, und keine Straße und keine Glasfaser führen über Land dorthin. Nur ein eigenes Seekabel kommt da hin.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own_sat":"In {city} landet noch kein Seekabel an, und keine Straße und keine Glasfaser führen über Land dorthin. Nur eine Satellitenverbindung oder ein eigenes Seekabel kommt da hin.",
|
||||
"link_modal.nobody_sells_capacity_between_kyiv":"Niemand verkauft Kapazität zwischen Kyjiw und Moskau, und niemand wird es tun. Route stattdessen über Warschau, Bukarest oder Helsinki.",
|
||||
"link_modal.not_without_a_license":"Nicht ohne Lizenz",
|
||||
"link_modal.premium_crossing_60_3_loss":"Premium-Übergang <small>+60 % · ~3 % Verlust</small>",
|
||||
|
|
@ -3608,7 +3614,7 @@
|
|||
"ops.o_optics":"Mehr Dark Fiber beleuchten",
|
||||
"ops.o_optics_d":"Optiken auf heiß laufende Dark Fiber stecken und neue Glasfaser am Tag der Übergabe beleuchten.",
|
||||
"ops.o_optup":"Optischen Transport ausbauen",
|
||||
"ops.o_optup_std_d":"Auf Glasfaser, die voll ist und heiß läuft, das Line System eine Größe hochziehen oder die kleinsten Kanäle gegen größere Optiken tauschen (die alten kommen ins Ersatzteillager). Steht ein Line System im Build-Standard, wird jede Faser mit einem kleineren darauf hochgezogen. Ein Tausch des Line Systems legt die Faser für einen Tag lahm, also nur, wo der Traffic einen Weg drumherum hat und kein Kunde darauf fährt, einer pro Nacht zusammen mit „Build-Standard einhalten“.",
|
||||
"ops.o_optup_wave_d":"Auf Glasfaser, die voll ist und heiß läuft, das Line System eine Größe hochziehen oder die kleinsten Kanäle gegen größere Optiken tauschen (die alten kommen ins Ersatzteillager). Steht ein Line System im Build-Standard, wird jede Faser mit einem kleineren darauf hochgezogen. Ein Tausch des Line Systems legt die Faser für einen Tag lahm, also nur, wo der Traffic einen Weg drumherum hat und keine Wave eines Kunden darauf läuft, einer pro Nacht zusammen mit „Build-Standard einhalten“.",
|
||||
"ops.o_pni":"PNI mit den Großen",
|
||||
"ops.o_pni_d":"Jede Woche: mit jedem willigen Netz, das an deinen POPs genug Traffic schickt, einen PNI bestellen, in der jeweils kleinsten Größe des Netzes.",
|
||||
"ops.o_ports":"Peering-Reserve halten",
|
||||
|
|
@ -3618,7 +3624,7 @@
|
|||
"ops.o_routers":"Router voraus halten",
|
||||
"ops.o_routers_std_d":"Einen Router dazustellen oder auf die nächste Generation tauschen, wo ein zweiter Router den Traffic trägt, sobald Last oder Ports eine Grenze überschreiten. Steht ein Router-Modell im Build-Standard, wird stattdessen jeder POP mit einem kleineren darauf getauscht, der am meisten ausgelastete zuerst, im Rahmen des Budgets.",
|
||||
"ops.o_std":"Build-Standard einhalten",
|
||||
"ops.o_std_around_d":"POPs, Ports und Glasfaser auf deinen Build-Standard bringen, die meistbelasteten zuerst, ein paar Jobs pro Schicht. Vor einem Tausch kommt ein zweiter Router rein, und ein Line System wechselt nur, wo der Traffic für den dunklen Tag einen Weg um die Faser hat und kein Kunde darauf fährt, einer pro Nacht zusammen mit „Optischen Transport ausbauen“.",
|
||||
"ops.o_std_wave_d":"POPs, Ports und Glasfaser auf deinen Build-Standard bringen, die meistbelasteten zuerst, ein paar Jobs pro Schicht. Vor einem Tausch kommt ein zweiter Router rein, und ein Line System wechselt nur, wo der Traffic für den dunklen Tag einen Weg um die Faser hat und keine Wave eines Kunden darauf läuft, einer pro Nacht zusammen mit „Optischen Transport ausbauen“.",
|
||||
"ops.o_transit":"Transit-Reserve halten",
|
||||
"ops.o_transit_d":"Transit an jedem POP über einem Vielfachen seiner 30-Tage-Spitze halten: ein LAG-Member dazu oder eine Portgröße hoch.",
|
||||
"ops.ops":"Ops",
|
||||
|
|
@ -3719,6 +3725,7 @@
|
|||
"peering_policy.already_reach_you_through_your":"Erreichen dich hier schon über deinen Transit-Provider und finden das in Ordnung.",
|
||||
"peering_policy.moved_everything_in_this_city_to":"Haben in dieser Stadt alles auf PNIs umgestellt. Bitte lies ihre PearingDB-Seite, alle 40 Seiten davon.",
|
||||
"peering_policy.not_accepting_new_peers_in_this":"Nehmen in dieser Region gerade keine neuen Peers an.",
|
||||
"peering_policy.not_while_a_satellite_is_your_only_way":"Peert nicht in {city}, solange ein {orb}-Satellit dein einziger Weg hinaus ist ({ms} ms hin und zurück): Sie wollen dein Backbone dort, wo sie dich treffen.",
|
||||
"peering_policy.only_peers_over_pnis_in_this":"Peert in dieser Stadt nur über PNIs. Bestell stattdessen einen Cross-Connect.",
|
||||
"peering_policy.only_peers_with_members_they_can":"Peert nur mit Mitgliedern, die sie ohne 1.500-km-Haarnadelkurve erreichen.",
|
||||
"peering_policy.policy_no_remote_peers_be_in":"Policy: keine Remote-Peers. Sei im Gebäude oder auf der Transit-Rechnung.",
|
||||
|
|
|
|||
|
|
@ -419,6 +419,7 @@
|
|||
"bstd.cost_mo":"Costes mensuales",
|
||||
"bstd.cost_now":"Para ponerlo todo al día ahora",
|
||||
"bstd.edit":"Editar el estándar de red",
|
||||
"bstd.every_bb_city":"En cada ciudad con banda ancha",
|
||||
"bstd.every_exchange":"Donde haya un IX",
|
||||
"bstd.fastest":"La más rápida que llegue",
|
||||
"bstd.fiber_note_two":"Cambiar el sistema de línea deja la fibra apagada un día. El botón solo lo hace si va tranquila o un enlace paralelo lleva su carga; tu becario, solo si todo el tráfico puede rodear la fibra.",
|
||||
|
|
@ -427,6 +428,7 @@
|
|||
"bstd.g_port":"Puertos y peering",
|
||||
"bstd.generator":"generador",
|
||||
"bstd.held":{"one":"Una fibra mantiene por ahora su sistema de línea, hasta que vaya tranquila o un enlace paralelo pueda llevar su carga el día que quede apagada. Mientras tanto recibe la óptica más rápida que admite su sistema de línea.","other":"{n} fibras mantienen por ahora su sistema de línea, hasta que vayan tranquilas o un enlace paralelo pueda llevar su carga el día que queden apagadas. Mientras tanto reciben la óptica más rápida que admite su sistema de línea."},
|
||||
"bstd.held_wave":{"one":"Una fibra mantiene su sistema de línea: lleva la wave de un cliente, que se apagaría con ella el día del cambio. El botón de mejora de la propia fibra lo hace igualmente, cuando tú decidas. Mientras tanto recibe la óptica más rápida que admite su sistema de línea.","other":"{n} fibras mantienen su sistema de línea: llevan waves de clientes, que se apagarían con ellas el día del cambio. El botón de mejora de cada fibra lo hace igualmente, cuando tú decidas. Mientras tanto reciben la óptica más rápida que admite su sistema de línea."},
|
||||
"bstd.hire_note":"Contrata a un becario del NOC en Ops y mantendrá cada POP, puerto y fibra en el estándar: unos pocos trabajos al día, los más cargados primero, dentro de un presupuesto mensual y solo con dinero de sobra.",
|
||||
"bstd.in_n_cities":"En al menos {n} ciudades",
|
||||
"bstd.intern_keeps":"{name} mantiene la red en el estándar",
|
||||
|
|
@ -437,6 +439,7 @@
|
|||
"bstd.l_pni":"PNI por red",
|
||||
"bstd.l_site2":"Segundo edificio",
|
||||
"bstd.l_split":"Repartir los LAG",
|
||||
"bstd.l_v6":"Banda ancha: solo IPv6",
|
||||
"bstd.left":{"one":"Queda una cosa por debajo, esperando dinero, una fibra tranquila o que llegue una ampliación.","other":"Quedan {n} cosas por debajo, esperando dinero, una fibra tranquila o que llegue una ampliación."},
|
||||
"bstd.n_more_targets":{"one":"{n} objetivo más","other":"{n} objetivos más"},
|
||||
"bstd.new_pops_note":"Un POP nuevo recibe esto enseguida, mientras sigue vacío: sin ventana de mantenimiento. Si falta dinero, recibe lo que alcance. Un modelo aún bloqueado significa el mejor desbloqueado por debajo.",
|
||||
|
|
@ -447,6 +450,7 @@
|
|||
"bstd.second_building":"segundo edificio",
|
||||
"bstd.tagline":"Un solo diseño para toda la red: lo que debe tener cada POP, puerto y fibra. Los POP nuevos reciben la parte del POP el día que abren; tu becario, o el botón de abajo, pone el resto al día.",
|
||||
"bstd.title":"Estándar de red",
|
||||
"bstd.v6_note":"Solo IPv6 cambia los routers domésticos de cada ciudad con banda ancha, primero donde hay más hogares en doble pila. Su precio es el cambio entero, pagado a medida que se instalan, y una ciudad empieza solo cuando te sobra todo ese importe.",
|
||||
"businesses.a_free_pni_with_voda_phony":"Un PNI gratis con Voda-Phony. Equipo: routers Absolute Unit 3.2T, puertos de 3.2T y ondas de 12.8T.",
|
||||
"businesses.agi_lab_allegedly":"Laboratorio de AGI (supuestamente)",
|
||||
"businesses.agi_labs_allegedly_wanting_ai_wans":"Laboratorios de AGI (supuestamente) que quieren WAN de IA de 12.8 a 25.6 Tbps, y PNIs gratis con Du-opoly y Ooh-redoo. Equipo: routers Mikrowtik CCR 3.2T.",
|
||||
|
|
@ -2066,6 +2070,7 @@
|
|||
"express.dark_gone":"Una de las fibras por debajo ya no existe.",
|
||||
"express.dark_reach":"Ninguna de sus ópticas llega tan lejos.",
|
||||
"express.dark_system":"{span} tiene el sistema de línea caído.",
|
||||
"express.dim":"{span} tiene un conector sucio: cada onda de esa fibra, también este exprés, va al {p} hasta que alguien lo limpie.",
|
||||
"express.express_to":"Exprés a…",
|
||||
"express.eyebrow":"Lightpath exprés · {km} km",
|
||||
"express.fiber_busy":{"one":"<b>Un lightpath exprés va por esta fibra.</b><br>Desmóntalo primero: ábrelo desde la sección Exprés de esta fibra.","other":"<b>{n} lightpaths exprés van por esta fibra.</b><br>Desmóntalos primero: ábrelos desde la sección Exprés de esta fibra."},
|
||||
|
|
@ -2941,6 +2946,7 @@
|
|||
"link_modal.no_subsea_cable_lands_in_city":"Ningún cable submarino aterriza en {city}. La estación de aterrizaje más cercana es {near}: tiende fibra hasta allí primero y luego toma un cable desde ella.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_land":"Ningún cable submarino aterriza todavía en {city}. Llega por tierra o tiende tu propio cable submarino.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own":"Ningún cable submarino aterriza todavía en {city}, y ninguna carretera ni fibra llega por tierra. Solo un cable submarino propio puede llegar allí.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own_sat":"Ningún cable submarino aterriza todavía en {city}, y ninguna carretera ni fibra llega por tierra. Solo un circuito satelital o un cable submarino propio puede llegar allí.",
|
||||
"link_modal.nobody_sells_capacity_between_kyiv":"Nadie vende capacidad entre Kiev y Moscú, y nadie va a hacerlo. Rodea por Varsovia, Bucarest o Helsinki.",
|
||||
"link_modal.not_without_a_license":"No sin licencia",
|
||||
"link_modal.premium_crossing_60_3_loss":"Cruce premium <small>+60 % · ~3 % de pérdida</small>",
|
||||
|
|
@ -3606,7 +3612,7 @@
|
|||
"ops.o_optics":"Encender más fibra",
|
||||
"ops.o_optics_d":"Añadir ópticas a la fibra oscura que va caliente y encender la fibra nueva el día que te la entregan.",
|
||||
"ops.o_optup":"Mejorar el transporte óptico",
|
||||
"ops.o_optup_std_d":"En la fibra que está llena y va caliente, sube el sistema de línea un tamaño o cambia los canales más pequeños por ópticas más grandes (las viejas van a la estantería). Con un sistema de línea en el estándar de red, cada fibra con uno más pequeño sube a ese. Cambiar el sistema de línea deja la fibra sin servicio un día, así que solo donde el tráfico puede rodearla y ningún cliente va por ella, uno por noche junto con «Mantener el estándar de red».",
|
||||
"ops.o_optup_wave_d":"En la fibra que está llena y va caliente, sube el sistema de línea un tamaño o cambia los canales más pequeños por ópticas más grandes (las viejas van a la estantería). Con un sistema de línea en el estándar de red, cada fibra con uno más pequeño sube a ese. Cambiar el sistema de línea deja la fibra sin servicio un día, así que solo donde el tráfico puede rodearla y ninguna wave de un cliente va por ella, uno por noche junto con «Mantener el estándar de red».",
|
||||
"ops.o_pni":"PNI con los grandes",
|
||||
"ops.o_pni_d":"Cada semana: pedir un PNI a cada red dispuesta que envíe suficiente tráfico en tus POPs, con el tamaño mínimo de cada red.",
|
||||
"ops.o_ports":"Margen en puertos de peering",
|
||||
|
|
@ -3616,7 +3622,7 @@
|
|||
"ops.o_routers":"Routers por delante",
|
||||
"ops.o_routers_std_d":"Añadir un router, o pasar a la siguiente generación donde un segundo router lleve el tráfico, cuando la carga o los puertos pasen de un nivel. Con un modelo de router en el estándar de red, cada POP con uno más pequeño se cambia a ese, primero el más cargado, dentro del presupuesto.",
|
||||
"ops.o_std":"Mantener el estándar de red",
|
||||
"ops.o_std_around_d":"Poner los POP, los puertos y la fibra al nivel de tu estándar de red, los más cargados primero, unos pocos trabajos por turno. Antes de un cambio entra un segundo router, y el sistema de línea solo cambia donde el tráfico puede rodear la fibra el día que queda a oscuras y ningún cliente va por ella, uno por noche junto con «Mejorar el transporte óptico».",
|
||||
"ops.o_std_wave_d":"Poner los POP, los puertos y la fibra al nivel de tu estándar de red, los más cargados primero, unos pocos trabajos por turno. Antes de un cambio entra un segundo router, y el sistema de línea solo cambia donde el tráfico puede rodear la fibra el día que queda a oscuras y ninguna wave de un cliente va por ella, uno por noche junto con «Mejorar el transporte óptico».",
|
||||
"ops.o_transit":"Margen de tránsito",
|
||||
"ops.o_transit_d":"Mantener el tránsito de cada POP por encima de un múltiplo de su pico de 30 días: un miembro LAG más o un tamaño de puerto mayor.",
|
||||
"ops.ops":"Ops",
|
||||
|
|
@ -3717,6 +3723,7 @@
|
|||
"peering_policy.already_reach_you_through_your":"Ya llegan a ti a través de tu proveedor de tránsito aquí y creen que eso está bien.",
|
||||
"peering_policy.moved_everything_in_this_city_to":"Movieron todo en esta ciudad a PNIs. Lee su página de PearingDB, las 40 páginas.",
|
||||
"peering_policy.not_accepting_new_peers_in_this":"No aceptan peers nuevos en esta región por ahora.",
|
||||
"peering_policy.not_while_a_satellite_is_your_only_way":"No hace peering en {city} mientras un satélite {orb} sea tu única salida ({ms} ms de ida y vuelta): quieren tu backbone allí donde te encuentran.",
|
||||
"peering_policy.only_peers_over_pnis_in_this":"Solo hacen peering por PNIs en esta área metropolitana. Pide una interconexión cruzada.",
|
||||
"peering_policy.only_peers_with_members_they_can":"Solo hacen peering con miembros a los que llegan sin una horquilla de 1500 km.",
|
||||
"peering_policy.policy_no_remote_peers_be_in":"Política: sin peers remotos. Estás en el edificio o estás en la factura de tránsito.",
|
||||
|
|
|
|||
|
|
@ -419,6 +419,7 @@
|
|||
"bstd.cost_mo":"Coûts mensuels",
|
||||
"bstd.cost_now":"Pour tout mettre à niveau maintenant",
|
||||
"bstd.edit":"Modifier le standard réseau",
|
||||
"bstd.every_bb_city":"Dans chaque ville avec du haut débit",
|
||||
"bstd.every_exchange":"Partout où il y a un IX",
|
||||
"bstd.fastest":"La plus rapide qui porte",
|
||||
"bstd.fiber_note_two":"Changer le système de ligne éteint la fibre pendant un jour. Le bouton ne le fait que si elle est calme ou qu’un lien parallèle porte sa charge ; ton stagiaire, seulement si tout le trafic peut contourner la fibre.",
|
||||
|
|
@ -427,6 +428,7 @@
|
|||
"bstd.g_port":"Ports et peering",
|
||||
"bstd.generator":"groupe électrogène",
|
||||
"bstd.held":{"one":"Une fibre garde son système de ligne pour l’instant, jusqu’à ce qu’elle soit calme ou qu’un lien parallèle puisse porter sa charge le jour où elle est éteinte. D’ici là, elle reçoit l’optique la plus rapide que son système de ligne accepte.","other":"{n} fibres gardent leur système de ligne pour l’instant, jusqu’à ce qu’elles soient calmes ou qu’un lien parallèle puisse porter leur charge le jour où elles sont éteintes. D’ici là, elles reçoivent l’optique la plus rapide que leur système de ligne accepte."},
|
||||
"bstd.held_wave":{"one":"Une fibre garde son système de ligne : la wave d’un client y passe et s’éteindrait avec elle le jour du changement. Le bouton de mise à niveau de la fibre elle-même le fait quand même, quand tu le décides. D’ici là, elle reçoit l’optique la plus rapide que son système de ligne accepte.","other":"{n} fibres gardent leur système de ligne : des waves de clients y passent et s’éteindraient avec elles le jour du changement. Le bouton de mise à niveau de chaque fibre le fait quand même, quand tu le décides. D’ici là, elles reçoivent l’optique la plus rapide que leur système de ligne accepte."},
|
||||
"bstd.hire_note":"Recrute un stagiaire NOC dans Ops et il garde chaque POP, port et fibre au standard : quelques chantiers par jour, les plus chargés d’abord, dans un budget mensuel et seulement avec de l’argent en trop.",
|
||||
"bstd.in_n_cities":"Dans au moins {n} villes",
|
||||
"bstd.intern_keeps":"{name} garde le réseau au standard",
|
||||
|
|
@ -437,6 +439,7 @@
|
|||
"bstd.l_pni":"PNI par réseau",
|
||||
"bstd.l_site2":"Second bâtiment",
|
||||
"bstd.l_split":"Répartir les LAG",
|
||||
"bstd.l_v6":"Haut débit : IPv6 uniquement",
|
||||
"bstd.left":{"one":"Encore un élément en dessous : il attend de l’argent, une fibre calme ou une extension.","other":"Encore {n} éléments en dessous : ils attendent de l’argent, une fibre calme ou une extension."},
|
||||
"bstd.n_more_targets":{"one":"{n} autre objectif","other":"{n} autres objectifs"},
|
||||
"bstd.new_pops_note":"Un nouveau POP reçoit tout ça d’un coup, tant qu’il est vide : pas de fenêtre de maintenance. Si l’argent manque, il reçoit ce qui rentre. Un modèle pas encore débloqué veut dire le meilleur débloqué en dessous.",
|
||||
|
|
@ -447,6 +450,7 @@
|
|||
"bstd.second_building":"second bâtiment",
|
||||
"bstd.tagline":"Un seul design pour tout le réseau : ce que chaque POP, port et fibre doit avoir. Les nouveaux POP reçoivent la partie POP le jour de leur ouverture ; ton stagiaire, ou le bouton plus bas, met le reste à niveau.",
|
||||
"bstd.title":"Standard réseau",
|
||||
"bstd.v6_note":"IPv6 uniquement remplace les box de chaque ville avec du haut débit, en commençant par celles qui ont le plus de foyers en double pile. Son prix est le remplacement entier, payé au fil de la pose, et une ville ne commence que si tu as tout en réserve.",
|
||||
"businesses.a_free_pni_with_voda_phony":"Un PNI gratuit avec Voda-Phony. Matos : routeurs Absolute Unit 3.2T, ports 3.2T et longueurs d’onde 12.8T.",
|
||||
"businesses.agi_lab_allegedly":"Labo d’AGI (soi-disant)",
|
||||
"businesses.agi_labs_allegedly_wanting_ai_wans":"Des labos d’AGI (soi-disant) qui veulent des WAN IA de 12,8 à 25,6 Tbps, et des PNI gratuits avec Du-opoly et Ooh-redoo. Matos : routeurs Mikrowtik CCR 3.2T.",
|
||||
|
|
@ -2066,6 +2070,7 @@
|
|||
"express.dark_gone":"Une des fibres en dessous n’existe plus.",
|
||||
"express.dark_reach":"Aucune de ses optiques ne porte aussi loin.",
|
||||
"express.dark_system":"{span} a son système de ligne en panne.",
|
||||
"express.dim":"{span} a un connecteur sale : chaque onde de cette fibre, cet express aussi, tourne à {p} jusqu’à ce que quelqu’un le nettoie.",
|
||||
"express.express_to":"Express vers…",
|
||||
"express.eyebrow":"Lightpath express · {km} km",
|
||||
"express.fiber_busy":{"one":"<b>Un lightpath express passe par cette fibre.</b><br>Démonte-le d’abord : ouvre-le depuis la section Express de cette fibre.","other":"<b>{n} lightpaths express passent par cette fibre.</b><br>Démonte-les d’abord : ouvre-les depuis la section Express de cette fibre."},
|
||||
|
|
@ -2941,6 +2946,7 @@
|
|||
"link_modal.no_subsea_cable_lands_in_city":"Aucun câble sous-marin n’atterrit à {city}. La station d’atterrissement la plus proche est {near} : amène d’abord la fibre jusque-là, puis prends un câble depuis là-bas.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_land":"Aucun câble sous-marin n’atterrit encore à {city}. Arrive par voie terrestre, ou pose ton propre câble sous-marin.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own":"Aucun câble sous-marin n’atterrit encore à {city}, et aucune route ni fibre n’y mène par voie terrestre. Seul ton propre câble sous-marin peut y arriver.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own_sat":"Aucun câble sous-marin n’atterrit encore à {city}, et aucune route ni fibre n’y mène par voie terrestre. Seul un circuit satellite ou ton propre câble sous-marin peut y arriver.",
|
||||
"link_modal.nobody_sells_capacity_between_kyiv":"Personne ne vend de capacité entre Kyiv et Moscow, et personne ne le fera. Passe plutôt par Warsaw, Bucharest ou Helsinki.",
|
||||
"link_modal.not_without_a_license":"Pas sans licence",
|
||||
"link_modal.premium_crossing_60_3_loss":"Passage premium <small>+60 % · ~3 % de perte</small>",
|
||||
|
|
@ -3606,7 +3612,7 @@
|
|||
"ops.o_optics":"Allumer plus de fibre",
|
||||
"ops.o_optics_d":"Ajouter des optiques sur la fibre noire qui chauffe, et allumer la nouvelle fibre le jour de sa livraison.",
|
||||
"ops.o_optup":"Améliorer le transport optique",
|
||||
"ops.o_optup_std_d":"Sur une fibre pleine qui chauffe, passer le système de ligne à la taille au-dessus, ou échanger les plus petits canaux contre des optiques plus grandes (les anciennes partent sur l’étagère). Avec un système de ligne dans le standard réseau, chaque fibre équipée d’un plus petit y passe. Un changement de système de ligne coupe la fibre pour une journée : seulement là où le trafic peut la contourner et où aucun client ne passe, un par nuit avec « Tenir le standard réseau ».",
|
||||
"ops.o_optup_wave_d":"Sur une fibre pleine qui chauffe, passer le système de ligne à la taille au-dessus, ou échanger les plus petits canaux contre des optiques plus grandes (les anciennes partent sur l’étagère). Avec un système de ligne dans le standard réseau, chaque fibre équipée d’un plus petit y passe. Un changement de système de ligne coupe la fibre pour une journée : seulement là où le trafic peut la contourner et où aucune wave de client ne passe, un par nuit avec « Tenir le standard réseau ».",
|
||||
"ops.o_pni":"PNI avec les gros",
|
||||
"ops.o_pni_d":"Chaque semaine : commander un PNI avec chaque réseau partant qui envoie assez de trafic sur tes POP, à la taille minimale de chaque réseau.",
|
||||
"ops.o_ports":"Garder de la marge sur les ports de peering",
|
||||
|
|
@ -3616,7 +3622,7 @@
|
|||
"ops.o_routers":"Garder les routeurs en avance",
|
||||
"ops.o_routers_std_d":"Ajouter un routeur, ou passer à la génération suivante là où un second routeur porte le trafic, quand la charge ou les ports dépassent un seuil. Avec un modèle de routeur dans le standard réseau, chaque POP équipé d’un plus petit passe à celui-ci, le plus chargé d’abord, dans la limite du budget.",
|
||||
"ops.o_std":"Tenir le standard réseau",
|
||||
"ops.o_std_around_d":"Mettre POP, ports et fibre au niveau de ton standard réseau, les plus chargés d’abord, quelques chantiers par service. Un second routeur arrive avant un échange, et le système de ligne ne change que là où le trafic peut contourner la fibre le jour où elle est coupée et où aucun client ne passe, un par nuit avec « Améliorer le transport optique ».",
|
||||
"ops.o_std_wave_d":"Mettre POP, ports et fibre au niveau de ton standard réseau, les plus chargés d’abord, quelques chantiers par service. Un second routeur arrive avant un échange, et le système de ligne ne change que là où le trafic peut contourner la fibre le jour où elle est coupée et où aucune wave de client ne passe, un par nuit avec « Améliorer le transport optique ».",
|
||||
"ops.o_transit":"Garder de la marge de transit",
|
||||
"ops.o_transit_d":"Garder le transit de chaque POP au-dessus d'un multiple de son pic sur 30 jours : un membre LAG de plus, ou une taille de port au-dessus.",
|
||||
"ops.ops":"Ops",
|
||||
|
|
@ -3717,6 +3723,7 @@
|
|||
"peering_policy.already_reach_you_through_your":"Te joignent déjà via ton fournisseur de transit ici et trouvent que ça suffit.",
|
||||
"peering_policy.moved_everything_in_this_city_to":"Ont tout migré en PNI dans cette ville. Merci de lire leur page PearingDB, les 40 pages.",
|
||||
"peering_policy.not_accepting_new_peers_in_this":"N’acceptent pas de nouveaux peers dans cette région pour le moment.",
|
||||
"peering_policy.not_while_a_satellite_is_your_only_way":"Ne fait pas de peering à {city} tant qu’un satellite {orb} est ta seule sortie ({ms} ms aller-retour) : ils veulent ton backbone là où ils te rencontrent.",
|
||||
"peering_policy.only_peers_over_pnis_in_this":"Ne peere qu’en PNI dans cette métropole. Commande plutôt un cross-connect.",
|
||||
"peering_policy.only_peers_with_members_they_can":"Ne fait du peering qu’avec les membres joignables sans hairpin de 1 500 km.",
|
||||
"peering_policy.policy_no_remote_peers_be_in":"Politique : pas de peers distants. Sois dans le bâtiment, ou sur la facture de transit.",
|
||||
|
|
|
|||
|
|
@ -419,6 +419,7 @@
|
|||
"bstd.cost_mo":"Costi mensili",
|
||||
"bstd.cost_now":"Per portare tutto a standard ora",
|
||||
"bstd.edit":"Modifica lo standard di rete",
|
||||
"bstd.every_bb_city":"In ogni città con banda larga",
|
||||
"bstd.every_exchange":"Ovunque ci sia un IX",
|
||||
"bstd.fastest":"La più veloce che arriva",
|
||||
"bstd.fiber_note_two":"Cambiare il sistema di linea spegne la fibra per un giorno. Il pulsante lo fa solo se è tranquilla o se un link parallelo ne regge il carico; il tuo stagista solo se tutto il traffico può aggirare la fibra.",
|
||||
|
|
@ -427,6 +428,7 @@
|
|||
"bstd.g_port":"Porte e peering",
|
||||
"bstd.generator":"generatore",
|
||||
"bstd.held":{"one":"Una fibra tiene per ora il suo sistema di linea, finché non è tranquilla o un link parallelo può reggerne il carico il giorno in cui resta spenta. Nel frattempo riceve l’ottica più veloce che il suo sistema di linea accetta.","other":"{n} fibre tengono per ora il loro sistema di linea, finché non sono tranquille o un link parallelo può reggerne il carico il giorno in cui restano spente. Nel frattempo ricevono l’ottica più veloce che il loro sistema di linea accetta."},
|
||||
"bstd.held_wave":{"one":"Una fibra tiene il suo sistema di linea: ci passa la wave di un cliente, che resterebbe spenta con lei il giorno del cambio. Il pulsante di upgrade sulla fibra stessa lo fa comunque, quando decidi tu. Nel frattempo riceve l’ottica più veloce che il suo sistema di linea accetta.","other":"{n} fibre tengono il loro sistema di linea: ci passano wave di clienti, che resterebbero spente con loro il giorno del cambio. Il pulsante di upgrade su ogni fibra lo fa comunque, quando decidi tu. Nel frattempo ricevono l’ottica più veloce che il loro sistema di linea accetta."},
|
||||
"bstd.hire_note":"Assumi uno stagista NOC in Ops e terrà ogni POP, porta e fibra a standard: qualche lavoro al giorno, i più carichi prima, dentro un budget mensile e solo con soldi in avanzo.",
|
||||
"bstd.in_n_cities":"In almeno {n} città",
|
||||
"bstd.intern_keeps":"{name} tiene la rete a standard",
|
||||
|
|
@ -437,6 +439,7 @@
|
|||
"bstd.l_pni":"PNI per rete",
|
||||
"bstd.l_site2":"Secondo edificio",
|
||||
"bstd.l_split":"Dividi i LAG",
|
||||
"bstd.l_v6":"Banda larga: solo IPv6",
|
||||
"bstd.left":{"one":"Resta una cosa sotto lo standard: aspetta soldi, una fibra tranquilla o un ampliamento.","other":"Restano {n} cose sotto lo standard: aspettano soldi, una fibra tranquilla o un ampliamento."},
|
||||
"bstd.n_more_targets":{"one":"{n} altro obiettivo","other":"altri {n} obiettivi"},
|
||||
"bstd.new_pops_note":"Un POP nuovo riceve tutto subito, finché è vuoto: niente finestra di manutenzione. Se mancano i soldi, riceve quello che ci sta. Un modello non ancora sbloccato vuol dire il migliore sbloccato sotto di lui.",
|
||||
|
|
@ -447,6 +450,7 @@
|
|||
"bstd.second_building":"secondo edificio",
|
||||
"bstd.tagline":"Un solo design per tutta la rete: cosa deve avere ogni POP, porta e fibra. I POP nuovi ricevono la parte POP il giorno in cui aprono; il tuo stagista, o il pulsante qui sotto, porta il resto a standard.",
|
||||
"bstd.title":"Standard di rete",
|
||||
"bstd.v6_note":"Solo IPv6 sostituisce i router di casa di ogni città con banda larga, prima dove ci sono più case in dual stack. Il prezzo è l’intera sostituzione, pagata man mano che i router vengono installati, e una città parte solo quando hai tutto da parte.",
|
||||
"businesses.a_free_pni_with_voda_phony":"Un PNI gratuito con Voda-Phony. Gear: router Absolute Unit 3.2T, porte 3.2T e wave 12.8T.",
|
||||
"businesses.agi_lab_allegedly":"Laboratorio AGI (a sentir loro)",
|
||||
"businesses.agi_labs_allegedly_wanting_ai_wans":"Laboratori AGI (a sentir loro) che vogliono AI WAN da 12.8 a 25.6 Tbps, e PNI gratuiti con Du-opoly e Ooh-redoo. Gear: router Mikrowtik CCR 3.2T.",
|
||||
|
|
@ -2066,6 +2070,7 @@
|
|||
"express.dark_gone":"Una delle fibre sotto non c’è più.",
|
||||
"express.dark_reach":"Nessuna delle sue ottiche arriva così lontano.",
|
||||
"express.dark_system":"{span} ha il line system giù.",
|
||||
"express.dim":"{span} ha un connettore sporco: ogni wave in quella fibra, anche questo express, va al {p} finché qualcuno non lo pulisce.",
|
||||
"express.express_to":"Express verso…",
|
||||
"express.eyebrow":"Lightpath express · {km} km",
|
||||
"express.fiber_busy":{"one":"<b>Su questa fibra passa un lightpath express.</b><br>Smontalo prima: aprilo dalla sezione Express di questa fibra.","other":"<b>Su questa fibra passano {n} lightpath express.</b><br>Smontali prima: aprili dalla sezione Express di questa fibra."},
|
||||
|
|
@ -2941,6 +2946,7 @@
|
|||
"link_modal.no_subsea_cable_lands_in_city":"Nessun cavo sottomarino approda a {city}. La stazione di approdo più vicina è {near}: porta prima la fibra fin lì, poi prendi un cavo da lì.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_land":"Nessun cavo sottomarino approda ancora a {city}. Arrivaci via terra, oppure posa un cavo sottomarino tutto tuo.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own":"Nessun cavo sottomarino approda ancora a {city}, e nessuna strada o fibra ci arriva via terra. Solo un cavo sottomarino tutto tuo può arrivarci.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own_sat":"Nessun cavo sottomarino approda ancora a {city}, e nessuna strada o fibra ci arriva via terra. Solo un circuito satellitare o un cavo sottomarino tutto tuo può arrivarci.",
|
||||
"link_modal.nobody_sells_capacity_between_kyiv":"Nessuno vende capacità tra Kyiv e Moscow, e nessuno lo farà mai. Passa invece da Warsaw, Bucharest o Helsinki.",
|
||||
"link_modal.not_without_a_license":"Non senza una licenza",
|
||||
"link_modal.premium_crossing_60_3_loss":"Attraversamento premium <small>+60% · ~3% di perdita</small>",
|
||||
|
|
@ -3606,7 +3612,7 @@
|
|||
"ops.o_optics":"Accendi più fibra",
|
||||
"ops.o_optics_d":"Aggiungi ottiche alla dark fiber che scotta e accendi la fibra nuova il giorno della consegna.",
|
||||
"ops.o_optup":"Potenzia il trasporto ottico",
|
||||
"ops.o_optup_std_d":"Sulla fibra piena che va calda, porta il line system alla taglia successiva, o scambia i canali più piccoli con ottiche più grandi (le vecchie finiscono a scaffale). Con un line system nello standard di rete, ogni fibra con uno più piccolo passa a quello. Cambiare line system spegne la fibra per un giorno, quindi solo dove il traffico può girarle intorno e nessun cliente ci passa, uno per notte insieme a “Tieni lo standard di rete”.",
|
||||
"ops.o_optup_wave_d":"Sulla fibra piena che va calda, porta il line system alla taglia successiva, o scambia i canali più piccoli con ottiche più grandi (le vecchie finiscono a scaffale). Con un line system nello standard di rete, ogni fibra con uno più piccolo passa a quello. Cambiare line system spegne la fibra per un giorno, quindi solo dove il traffico può girarle intorno e nessuna wave di un cliente ci passa, uno per notte insieme a “Tieni lo standard di rete”.",
|
||||
"ops.o_pni":"PNI con i grandi",
|
||||
"ops.o_pni_d":"Ogni settimana: ordina un PNI con ogni rete disponibile che manda abbastanza traffico nei tuoi POP, alla taglia minima di ciascuna rete.",
|
||||
"ops.o_ports":"Margine sulle porte di peering",
|
||||
|
|
@ -3616,7 +3622,7 @@
|
|||
"ops.o_routers":"Router sempre avanti",
|
||||
"ops.o_routers_std_d":"Aggiungi un router, o passa alla generazione successiva dove un secondo router regge il traffico, quando carico o porte superano una soglia. Con un modello di router nello standard di rete, ogni POP con uno più piccolo passa a quello, prima il più carico, nei limiti del budget.",
|
||||
"ops.o_std":"Tieni lo standard di rete",
|
||||
"ops.o_std_around_d":"Porta POP, porte e fibra al tuo standard di rete, i più carichi prima, qualche lavoro a turno. Prima di uno scambio arriva un secondo router, e il sistema di linea cambia solo dove il traffico può girare intorno alla fibra nel giorno in cui è spenta e nessun cliente ci passa, uno per notte insieme a “Potenzia il trasporto ottico”.",
|
||||
"ops.o_std_wave_d":"Porta POP, porte e fibra al tuo standard di rete, i più carichi prima, qualche lavoro a turno. Prima di uno scambio arriva un secondo router, e il sistema di linea cambia solo dove il traffico può girare intorno alla fibra nel giorno in cui è spenta e nessuna wave di un cliente ci passa, uno per notte insieme a “Potenzia il trasporto ottico”.",
|
||||
"ops.o_transit":"Margine di transit",
|
||||
"ops.o_transit_d":"Tieni il transit di ogni POP sopra un multiplo del suo picco a 30 giorni: un membro LAG in più, o una porta più grande.",
|
||||
"ops.ops":"Ops",
|
||||
|
|
@ -3717,6 +3723,7 @@
|
|||
"peering_policy.already_reach_you_through_your":"Ti raggiungono già tramite il tuo provider di transit qui, e per loro va bene così.",
|
||||
"peering_policy.moved_everything_in_this_city_to":"In questa città hanno spostato tutto su PNI. Leggi la loro pagina PearingDB, tutte e 40 le pagine.",
|
||||
"peering_policy.not_accepting_new_peers_in_this":"Per ora non accettano nuovi peer in questa regione.",
|
||||
"peering_policy.not_while_a_satellite_is_your_only_way":"Non fa peering a {city} finché un satellite {orb} è la tua unica via d’uscita ({ms} ms andata e ritorno): vogliono il tuo backbone dove ti incontrano.",
|
||||
"peering_policy.only_peers_over_pnis_in_this":"In questa metro fa peering solo via PNI. Ordina un cross-connect.",
|
||||
"peering_policy.only_peers_with_members_they_can":"Fanno peering solo con membri raggiungibili senza un hairpin di 1.500 km.",
|
||||
"peering_policy.policy_no_remote_peers_be_in":"Policy: niente peer remoti. O sei nell’edificio, o sei nella bolletta del transit.",
|
||||
|
|
|
|||
|
|
@ -419,6 +419,7 @@
|
|||
"bstd.cost_mo":"Custos mensais",
|
||||
"bstd.cost_now":"Para colocar tudo no padrão agora",
|
||||
"bstd.edit":"Editar o padrão de rede",
|
||||
"bstd.every_bb_city":"Em cada cidade com banda larga",
|
||||
"bstd.every_exchange":"Onde houver um IX",
|
||||
"bstd.fastest":"A mais rápida que alcança",
|
||||
"bstd.fiber_note_two":"Trocar o sistema de linha apaga a fibra por um dia. O botão só faz isso quando ela está tranquila ou um link paralelo leva a carga; seu estagiário só quando todo o tráfego consegue contornar a fibra.",
|
||||
|
|
@ -427,6 +428,7 @@
|
|||
"bstd.g_port":"Portas e peering",
|
||||
"bstd.generator":"gerador",
|
||||
"bstd.held":{"one":"Uma fibra mantém por enquanto o seu sistema de linha, até ficar tranquila ou um link paralelo poder levar a carga dela no dia em que ela fica apagada. Até lá, ela recebe a óptica mais rápida que o seu sistema de linha aceita.","other":"{n} fibras mantêm por enquanto o seu sistema de linha, até ficarem tranquilas ou um link paralelo poder levar a carga delas no dia em que ficam apagadas. Até lá, elas recebem a óptica mais rápida que o seu sistema de linha aceita."},
|
||||
"bstd.held_wave":{"one":"Uma fibra mantém o seu sistema de linha: a wave de um cliente passa por ela e ficaria apagada com ela no dia da troca. O botão de atualizar da própria fibra faz isso mesmo assim, quando você quiser. Até lá, ela recebe a óptica mais rápida que o seu sistema de linha aceita.","other":"{n} fibras mantêm o seu sistema de linha: waves de clientes passam por elas e ficariam apagadas com elas no dia da troca. O botão de atualizar de cada fibra faz isso mesmo assim, quando você quiser. Até lá, elas recebem a óptica mais rápida que o seu sistema de linha aceita."},
|
||||
"bstd.hire_note":"Contrate um estagiário de NOC em Ops e ele mantém cada POP, porta e fibra no padrão: alguns trabalhos por dia, os mais carregados primeiro, dentro de um orçamento mensal e só com dinheiro sobrando.",
|
||||
"bstd.in_n_cities":"Em pelo menos {n} cidades",
|
||||
"bstd.intern_keeps":"{name} mantém a rede no padrão",
|
||||
|
|
@ -437,6 +439,7 @@
|
|||
"bstd.l_pni":"PNIs por rede",
|
||||
"bstd.l_site2":"Segundo prédio",
|
||||
"bstd.l_split":"Dividir LAGs",
|
||||
"bstd.l_v6":"Banda larga: só IPv6",
|
||||
"bstd.left":{"one":"Ainda falta uma coisa abaixo do padrão, esperando dinheiro, uma fibra tranquila ou uma ampliação.","other":"Ainda faltam {n} coisas abaixo do padrão, esperando dinheiro, uma fibra tranquila ou uma ampliação."},
|
||||
"bstd.n_more_targets":{"one":"mais {n} meta","other":"mais {n} metas"},
|
||||
"bstd.new_pops_note":"Um POP novo recebe isso na hora, enquanto ainda está vazio: sem janela de manutenção. Se faltar dinheiro, recebe o que couber. Um modelo ainda bloqueado significa o melhor desbloqueado abaixo dele.",
|
||||
|
|
@ -447,6 +450,7 @@
|
|||
"bstd.second_building":"segundo prédio",
|
||||
"bstd.tagline":"Um só design para a rede toda: o que cada POP, porta e fibra deve ter. POPs novos recebem a parte do POP no dia em que abrem; seu estagiário, ou o botão abaixo, coloca o resto no padrão.",
|
||||
"bstd.title":"Padrão de rede",
|
||||
"bstd.v6_note":"Só IPv6 troca os roteadores domésticos de cada cidade com banda larga, primeiro onde há mais casas em pilha dupla. O preço é a troca inteira, paga conforme os roteadores são instalados, e uma cidade só começa quando sobra tudo isso.",
|
||||
"businesses.a_free_pni_with_voda_phony":"Um PNI grátis com a Voda-Phony. Gear: routers Absolute Unit 3.2T, portas 3.2T e waves de 12.8T.",
|
||||
"businesses.agi_lab_allegedly":"Laboratório de AGI (supostamente)",
|
||||
"businesses.agi_labs_allegedly_wanting_ai_wans":"Laboratórios de AGI (supostamente) querendo AI WANs de 12.8 a 25.6 Tbps, e PNIs grátis com a Du-opoly e a Ooh-redoo. Gear: routers Mikrowtik CCR 3.2T.",
|
||||
|
|
@ -2066,6 +2070,7 @@
|
|||
"express.dark_gone":"Uma das fibras por baixo não existe mais.",
|
||||
"express.dark_reach":"Nenhuma das suas ópticas alcança essa distância.",
|
||||
"express.dark_system":"{span} está com o line system fora do ar.",
|
||||
"express.dim":"{span} tem um conector sujo: cada onda nessa fibra, este expresso também, roda a {p} até alguém limpá-lo.",
|
||||
"express.express_to":"Expresso para…",
|
||||
"express.eyebrow":"Lightpath expresso · {km} km",
|
||||
"express.fiber_busy":{"one":"<b>Um lightpath expresso passa por esta fibra.</b><br>Desmonte-o primeiro: abra-o na seção Expresso desta fibra.","other":"<b>{n} lightpaths expressos passam por esta fibra.</b><br>Desmonte-os primeiro: abra-os na seção Expresso desta fibra."},
|
||||
|
|
@ -2941,6 +2946,7 @@
|
|||
"link_modal.no_subsea_cable_lands_in_city":"Nenhum cabo submarino chega a {city}. A estação de chegada mais próxima é {near}: leve fibra até lá primeiro e depois pegue um cabo de lá.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_land":"Nenhum cabo submarino chega a {city} ainda. Chegue lá por terra ou lance seu próprio cabo submarino.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own":"Nenhum cabo submarino chega a {city} ainda, e nenhuma estrada ou fibra chega lá por terra. Só um cabo submarino seu pode chegar lá.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own_sat":"Nenhum cabo submarino chega a {city} ainda, e nenhuma estrada ou fibra chega lá por terra. Só um circuito de satélite ou um cabo submarino seu pode chegar lá.",
|
||||
"link_modal.nobody_sells_capacity_between_kyiv":"Ninguém vende capacidade entre Kyiv e Moscou, e ninguém vai vender. Passe por Varsóvia, Bucareste ou Helsinque.",
|
||||
"link_modal.not_without_a_license":"Não sem licença",
|
||||
"link_modal.premium_crossing_60_3_loss":"Travessia premium <small>+60% · ~3% de perda</small>",
|
||||
|
|
@ -3606,7 +3612,7 @@
|
|||
"ops.o_optics":"Acender mais fibra",
|
||||
"ops.o_optics_d":"Adicionar ópticas à fibra escura que está esquentando e acender a fibra nova no dia da entrega.",
|
||||
"ops.o_optup":"Melhorar o transporte óptico",
|
||||
"ops.o_optup_std_d":"Na fibra que está cheia e esquentando, sobe o sistema de linha um tamanho ou troca os canais menores por ópticas maiores (as antigas vão para a prateleira). Com um sistema de linha no padrão de rede, cada fibra com um menor sobe para ele. Trocar o sistema de linha derruba a fibra por um dia, então só onde o tráfego consegue contorná-la e nenhum cliente passa por ela, uma por noite junto com “Manter o padrão de rede”.",
|
||||
"ops.o_optup_wave_d":"Na fibra que está cheia e esquentando, sobe o sistema de linha um tamanho ou troca os canais menores por ópticas maiores (as antigas vão para a prateleira). Com um sistema de linha no padrão de rede, cada fibra com um menor sobe para ele. Trocar o sistema de linha derruba a fibra por um dia, então só onde o tráfego consegue contorná-la e nenhuma wave de cliente passa por ela, uma por noite junto com “Manter o padrão de rede”.",
|
||||
"ops.o_pni":"PNI com os grandes",
|
||||
"ops.o_pni_d":"Toda semana: pedir um PNI com cada rede disposta que mande tráfego suficiente nos seus POPs, no tamanho mínimo de cada rede.",
|
||||
"ops.o_ports":"Folga nas portas de peering",
|
||||
|
|
@ -3616,7 +3622,7 @@
|
|||
"ops.o_routers":"Roteadores à frente",
|
||||
"ops.o_routers_std_d":"Adicionar um roteador, ou trocar para a próxima geração onde um segundo roteador segura o tráfego, quando a carga ou as portas passarem de um nível. Com um modelo de roteador no padrão de rede, cada POP com um menor é trocado para ele, o mais carregado primeiro, dentro do orçamento.",
|
||||
"ops.o_std":"Manter o padrão de rede",
|
||||
"ops.o_std_around_d":"Colocar POPs, portas e fibra no seu padrão de rede, os mais carregados primeiro, alguns trabalhos por turno. Antes de uma troca entra um segundo roteador, e o sistema de linha só muda onde o tráfego consegue contornar a fibra no dia em que ela fica apagada e nenhum cliente passa por ela, uma por noite junto com “Melhorar o transporte óptico”.",
|
||||
"ops.o_std_wave_d":"Colocar POPs, portas e fibra no seu padrão de rede, os mais carregados primeiro, alguns trabalhos por turno. Antes de uma troca entra um segundo roteador, e o sistema de linha só muda onde o tráfego consegue contornar a fibra no dia em que ela fica apagada e nenhuma wave de cliente passa por ela, uma por noite junto com “Melhorar o transporte óptico”.",
|
||||
"ops.o_transit":"Folga de trânsito",
|
||||
"ops.o_transit_d":"Manter o trânsito de cada POP acima de um múltiplo do seu pico de 30 dias: mais um membro LAG, ou um tamanho de porta acima.",
|
||||
"ops.ops":"Ops",
|
||||
|
|
@ -3717,6 +3723,7 @@
|
|||
"peering_policy.already_reach_you_through_your":"Já chegam até você pelo seu provedor de transit aqui e acham que está ótimo.",
|
||||
"peering_policy.moved_everything_in_this_city_to":"Passaram tudo nesta cidade para PNI. Leia a página deles no PearingDB, todas as 40 páginas.",
|
||||
"peering_policy.not_accepting_new_peers_in_this":"No momento não aceitam novos peers nesta região.",
|
||||
"peering_policy.not_while_a_satellite_is_your_only_way":"Não faz peering em {city} enquanto um satélite {orb} for sua única saída ({ms} ms ida e volta): querem seu backbone onde encontram você.",
|
||||
"peering_policy.only_peers_over_pnis_in_this":"Nesta metro, só faz peering via PNI. Peça um cross-connect.",
|
||||
"peering_policy.only_peers_with_members_they_can":"Só fazem peering com membros que alcançam sem um hairpin de 1.500 km.",
|
||||
"peering_policy.policy_no_remote_peers_be_in":"Policy: nada de peers remotos. Ou você está no prédio, ou está na conta do transit.",
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ const API_CMD={
|
|||
quote:a=>{const l=S.links.find(x=>x.id===a.id);return l?{setup:sysUpCost(l)}:{};},
|
||||
doc:'Upgrade the line system: Rainbow to ROADMaster to C+L. Every channel goes down for a day.'},
|
||||
regen:{args:[['id','entityId'],['d','step']],watch:['links.#id'],
|
||||
quote:a=>{const l=S.links.find(x=>x.id===a.id);return l&&a.d>0?{setup:REGEN_COST+Math.round((l.ch||[]).reduce((x,c)=>x+optCost(c),0)*REGEN_CH)}:{setup:0};},
|
||||
quote:a=>{const l=S.links.find(x=>x.id===a.id);return l&&a.d>0?{setup:regenAddCost(l)}:{setup:0};},
|
||||
doc:'Add or remove a regeneration site on a terrestrial span, up to REGEN_MAX. Removing is refused if the optics then cannot reach.'},
|
||||
spares:{args:[['id','entityId']],watch:['links.#id'],
|
||||
doc:'Toggle keeping spare optics on site for this span, so a card failure is fixed in hours instead of days.'},
|
||||
|
|
@ -446,10 +446,12 @@ const API_CMD={
|
|||
popStdClear:{args:[],watch:['popStd'],
|
||||
doc:'Clear the whole build standard; new POPs go back to one basic router.'},
|
||||
bstdSet:{args:[['k','bstdKey'],['v','string',false]],watch:['popStd'],
|
||||
doc:'Set one target of the build standard: g router model, rt routers, site2 second building, gen generator, lag LAG members on transit, IX and PNI ports, split LAGs across both buildings, ix an IX port wherever the city has an exchange, pni PNIs per network in at least that many cities, sys line system, opt fastest optics, wv waves at least that size. g and sys are also what the intern\'s routers and optup orders standardize on. Without v it steps to the next value; with v (a position in the list the sheet shows, 0 first, "keep" first) it picks that one.'},
|
||||
doc:'Set one target of the build standard: g router model, rt routers, site2 second building, gen generator, v6 every broadband city IPv6-only (ip6Go, only while IPv4 is scarce: rule ip4), lag LAG members on transit, IX and PNI ports, split LAGs across both buildings, ix an IX port wherever the city has an exchange, pni PNIs per network in at least that many cities, sys line system, opt fastest optics, wv waves at least that size. g and sys are also what the intern\'s routers and optup orders standardize on. Without v it steps to the next value; with v (a position in the list the sheet shows, 0 first, "keep" first) it picks that one.'},
|
||||
bstdApply:{args:[['quote','string',false],['q','shownTotal',false]],watch:['pops','transit','pni','ixp','ixn','ixSite','links','spares'],
|
||||
quote:a=>{const q=bstdQuote(false);return {setup:q.cost,monthly:q.mo,key:bstdPlanKey(bstdPlan(false)),blocked:q.held.map(w=>w.split('|').map(c=>CITY[c].name).join('–')+': its line system waits until the fiber is quiet or a parallel link can carry its load for the day it goes dark')};},
|
||||
doc:'Bring everything up to the build standard now, the busiest first, while cash lasts: routers, buildings, generators, LAG members, IX ports, PNIs, line systems, optics and waves. A line-system swap waits unless the fiber is quiet or a parallel link carries its load: such a fiber gets the best optics its line system takes, and the quote lists it under blocked. The quote is the whole bill. quote and q (optional): the plan\'s key and the total you were shown; another plan, or a total more than 1% away, is refused and the sheet shown again.'},
|
||||
quote:a=>{const q=bstdQuote(false),nm=w=>w.split('|').map(c=>CITY[c].name).join('–');return {setup:q.cost,monthly:q.mo,key:bstdPlanKey(bstdPlan(false)),
|
||||
blocked:[...q.wait.map(w=>nm(w)+': its line system waits until the fiber is quiet or a parallel link can carry its load for the day it goes dark'),
|
||||
...q.wv.map(w=>nm(w)+': its line system waits: a customer\'s wave rides it and would go dark with it for the day (upSys on the fiber still swaps it)')]};},
|
||||
doc:'Bring everything up to the build standard now, the busiest first, while cash lasts: routers, buildings, generators, IPv6-only swaps (the cities with the most dual-stack homes first; each priced as its whole swap, paid as the routers go in, and started only with that much cash on top of what the swaps under way still owe), LAG members, IX ports, PNIs, line systems, optics and waves. A line-system swap waits unless the fiber is quiet or a parallel link carries its load, and while a customer\'s alien or managed wave rides the fiber (leased pairs and IRUs do not count: they are glass): such a fiber gets the best optics its line system takes, and the quote lists it under blocked. The quote is the whole bill. quote and q (optional): the plan\'s key and the total you were shown; another plan, or a total more than 1% away, is refused and the sheet shown again.'},
|
||||
/* ---------- utilities ---------- */
|
||||
utilityRouteServers:{args:[['city','cityId',false]],watch:['rs'],
|
||||
doc:'Join the route server at every IX you have a port at. One call does what the button does.'},
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ const API_STATE_DOC={
|
|||
core:{type:'map',doc:'Your backbone technology: lv bought, the level it runs at, the interop lab.'},
|
||||
ddosAuto:{type:'map',doc:'The NOC\'s auto-mitigation switches: rtbh and scrub.'},
|
||||
ip4:{type:'map',doc:'IPv4 address space (rule ip4): b, the blocks, at most 256 (len: prefix length 16-24, k: rir from the registry, buy bought, in leased in; d: the day it last moved, out: leased out, mo: the monthly fee or income), nat: homes per address behind CGNAT, n64: IPv6-only homes per address in the NAT64 pool, w: which warnings were shown. What customers use is derived from their kind and size.'},
|
||||
popStd:{type:'map',doc:'The build standard, or null for none. g router model (an RG index), rt routers, then only the targets that are set: site2, gen (true), lag (2 or 4 members), split, ix (true), pni (2 or 3 cities per network), sys (roadm, cl), opt (fast), wv (an LT index). New POPs get g, rt, site2 and gen at once; the std standing order and bstdApply bring the rest up. g and sys are also the model the routers order and the line system the optup order standardize on.'},
|
||||
popStd:{type:'map',doc:'The build standard, or null for none. g router model (an RG index), rt routers, then only the targets that are set: site2, gen, v6 (true; v6: every broadband city goes IPv6-only, only while rule ip4 is on), lag (2 or 4 members), split, ix (true), pni (2 or 3 cities per network), sys (roadm, cl), opt (fast), wv (an LT index). New POPs get g, rt, site2 and gen at once; the std standing order and bstdApply bring the rest up (v6 with ip6Go, city by city). g and sys are also the model the routers order and the line system the optup order standardize on.'},
|
||||
mp:{type:'map',doc:'Multiplayer, only in a self-hosted copy with a session server: the session code, your player id, the AS number and seed the session gave you, its rules preset, your colour, its title and the last save number the server holds; null in every other game.'},
|
||||
demo:{type:'map',doc:'Vendor demo units on order, by "kind:id" → ready day.'},
|
||||
seatOff:{type:'map',doc:'The pending consortium-cable seat offer: landings, km, name, expiry day.'},
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ const dfCap0=l=>Math.max(0,dfLit(l)-mwG(l));
|
|||
// Whether a fiber carries anything for you (linkDown() asks of every fiber, often): dfCap(l)>0 without adding up every
|
||||
// channel. An optic out of service, or managed waves sold on it, take the sum.
|
||||
const dfOn=l=>{if(l.ready>S.day||l.eqDown>S.day)return false;if(l.chFail&&l.chFail.until>S.day||mwG(l)>0)return dfCap(l)>0;let o=null;for(const c of l.ch||[])if(c!==o){o=c;if(optG(c,l)>0)return true;}return false;};
|
||||
const capOf=l=>(l.kind==='vxc'?VXC[l.vt].g:l.kind==='df'?dfCap(l):l.kind==='xp'?xpG(l):l.kind==='sat'?l.g:LT[l.tier].g)*(l.deg>S.day?0.5:1)*(l.loss&&l.loss.until>S.day?l.loss.f:1);
|
||||
const capOf=l=>(l.kind==='vxc'?VXC[l.vt].g:l.kind==='df'?dfCap(l):l.kind==='xp'?xpG(l)*xpGlassF(l):l.kind==='sat'?l.g:LT[l.tier].g)*(l.deg>S.day?0.5:1)*(l.loss&&l.loss.until>S.day?l.loss.f:1);
|
||||
// A sick LAG (LACP trouble) keeps only part of its capacity until the incident clears.
|
||||
const lagF=o=>o&&o.lacp&&o.lacp.until>S.day?o.lacp.f:1,ixLagF=x=>lagF(S.ev&&S.ev.ixlacp&&{lacp:S.ev.ixlacp[x]});
|
||||
const tierW=l=>{if(l.kind==='wave')return l.tier;if(l.kind==='vxc'||l.kind==='sat')return 0;const g=l.kind==='xp'?xpG(l):dfCap(l);return g>=6400?4:g>=1600?3:g>=400?2:g>=100?1:0;};
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ function ip6Free(c){const p=ip6Pop(c);if(!p||!p.bb)return 0;return ip4Use(ip6If(
|
|||
/* And what it does to the month's IPv4 bill, counted the same way (eye: what broadband earns a month): NAT64 gateways and
|
||||
refunds against the CGNAT boxes and refunds it saves. While no home is behind CGNAT it only adds. */
|
||||
function ip6Mo(c,eye){const p=ip6Pop(c);if(!p||!p.bb)return 0;const m=b=>b.box+b.box64+b.refund;return m(ip4Bill(eye,ip6If(c,p)))-m(ip4Bill(eye));}
|
||||
// A city the build standard's IPv6-only row would start (bstdPlan()): broadband with dual-stack homes, no swap running.
|
||||
const ip6Todo=c=>{const p=ip6Pop(c);return !!p&&!!p.bb&&!p.bb.v6e&&!(p.bb.v6>=1)&&ip6Homes(p)>0;};
|
||||
// What the swaps under way still have to pay for, router by router: the build standard's button starts a job, and the
|
||||
// intern's orders anything, only with that much on top of its own price (above the cash floor), since a swap pays as it
|
||||
// goes and the cash has not moved yet. Nothing while IPv4 is plentiful: the swaps wait then (ip6Day()).
|
||||
const ip6Owed=()=>{if(!ip4On())return 0;let n=0;for(const c in S.pops){const b=S.pops[c].bb;if(b&&b.v6e)n+=ip6Homes(S.pops[c])*IP6_CPE;}return n;};
|
||||
// Why this city cannot start a swap now ('' when it can).
|
||||
function ip6Why(c){const p=ip6Pop(c);if(!ip4On())return tr('ip4.off');if(!p||!p.bb)return tr('ip6.no_bb');if(p.bb.v6e)return tr('ip6.busy');if(p.bb.v6>=1)return tr('ip6.already');return '';}
|
||||
// Today's routers: an even share of what is left, so the swap ends on its day however the city grows meanwhile.
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ function circuitTargets(b){const G=pathEdges(),now=pathNow(b,G);if(!now)return {
|
|||
function pinRoute(p,edges){const path=[];for(let i=1;i<p.length;i++){const e=edges[hopKey(p[i-1],p[i])];if(!e)return null;path.push(e);}return {path,ni:p.map(x=>CIDX[x]),share:1};}
|
||||
// Under a customer in the panels.
|
||||
function pathCtl(b){if(!pathKind(b))return '';
|
||||
const pin=b.pin?`<div class="meta">${tr('customer_paths.pinned_to_path',{path:esc(pathStr(b.pin))})}${pinUp(b)?'':` · <b style="color:var(--bad)">${tr('customer_paths.that_path_is_down')}</b>`}</div>`:'';
|
||||
const pin=b.pin?`<div class="meta">${tr('customer_paths.pinned_to_path',{path:esc(pathStr(b.pin))})}${pinUp(b)?'':` · <b style="color:var(--tx-red,var(--bad))">${tr('customer_paths.that_path_is_down')}</b>`}</div>`:'';
|
||||
return `${pin}<div class="btns">${btn(tr('customer_paths.move_to_another_path'),'pathOpen',{id:b.id},'ghost sm')}</div>`;}
|
||||
function pathModal(b){const a=pathCity(b.city),z=pathCity(b.city2),k=pathKind(b);let h=`<div style="display:flex;align-items:center"><h2 style="font-size:24px">${tr('customer_paths.move_name',{name:esc(b.name)})}</h2><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div>`;
|
||||
const row=(nm,meta,tag,button)=>`<div class="row"><div class="grow"><div class="nm">${nm}${tag?` <span class="tag st">${tag}</span>`:''}</div>${meta?`<div class="meta">${meta}</div>`:''}</div>${button}</div>`;
|
||||
|
|
@ -70,6 +70,6 @@ function pathModal(b){const a=pathCity(b.city),z=pathCity(b.city2),k=pathKind(b)
|
|||
if(now)h+=`<div class="kv"><span>${tr('customer_paths.now_on')}</span><b>${esc(pathStr(now))}</b></div>`;
|
||||
if(b.pin)h+=`<div class="btns">${btn(tr('customer_paths.let_routing_choose_again'),'pathAuto',{id:b.id},'ghost sm')}</div>`;
|
||||
if(!alts.length)h+=`<p class="empty">${tr('customer_paths.no_other_path',{a,b:z})}</p>`;
|
||||
for(const t of alts){const warn=[t.room<b.bw?`<b style="color:var(--bad)">${tr('customer_paths.fits_only_g_of_bw',{g:fmtG(t.room),bw:fmtG(b.bw)})}</b>`:'',b.latMax&&t.lat>b.latMax?`<b style="color:var(--bad)">${tr('customer_paths.over_the_ms_budget',{ms:b.latMax})}</b>`:''].filter(Boolean).join(' · ');
|
||||
for(const t of alts){const warn=[t.room<b.bw?`<b style="color:var(--tx-red,var(--bad))">${tr('customer_paths.fits_only_g_of_bw',{g:fmtG(t.room),bw:fmtG(b.bw)})}</b>`:'',b.latMax&&t.lat>b.latMax?`<b style="color:var(--tx-red,var(--bad))">${tr('customer_paths.over_the_ms_budget',{ms:b.latMax})}</b>`:''].filter(Boolean).join(' · ');
|
||||
h+=row(esc(pathStr(t.p)),tr('customer_paths.path_facts',{km:Math.round(t.km).toLocaleString(),ms:t.lat.toFixed(1)})+(warn?' · '+warn:''),t.shared?trn('customer_paths.shares_n_spans',t.shared):tr('customer_paths.fully_diverse'),btn(tr('customer_paths.move'),'pathPin',{id:b.id,via:t.p.join()},'sm'));}}
|
||||
openModal(h);}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,14 @@ const satFrom=b=>satRemote(b)?teleCities().filter(a=>a!==b&&satBirds(a,b).length
|
|||
// it, as one ordered next to a link does, and the player hears about it. Without this the pair's load is shared with orbit.
|
||||
function satBeside(a,b){const ls=pairLinks(a,b).filter(l=>l.kind==='sat'&&!l.standby);for(const l of ls)l.standby=true;
|
||||
if(ls.length)toast(trn('satellites.n_circuits_go_on_standby',ls.length,{a:CITY[a].name,b:CITY[b].name}));return ls.length;}
|
||||
/* An island or remote town that only satellites join to the rest of your network: its fastest circuit (null when a wave,
|
||||
a lit fiber, a cable or a pie dish reaches it too). What is built and lit counts, never today's cuts: a selective peer
|
||||
judges what you built, not this week's repair (50-peering-policy.js). A fiber or cable with no optics of its own yet
|
||||
carries nothing (an express only passes through a city's ROADM, and is a link of its own where it ends). */
|
||||
function satOnly(c){if(!satRemote(c)||!S.pops[c]||S.pie&&(S.pie.dishes||[]).some(x=>x.city===c))return null;let best=null;
|
||||
for(const l of S.links){if(l.a!==c&&l.b!==c)continue;
|
||||
if(l.kind!=='sat'){if(!(l.ready>S.day)&&(l.kind!=='df'||(l.ch||[]).length))return null;continue;}if(!best||satLat(l)<satLat(best))best=l;}
|
||||
return best;}
|
||||
// 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);}for(const l of S.links)if(l.kind==='sat')m+=l.mo||0;return m;}
|
||||
/* compute(): what users notice on the edges a satellite circuit is on. sv: the losses of the orbits there; sx: the edge's
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ const OPS=[
|
|||
// The model to standardize on is the build standard's, set in its sheet (96-pop-standard.js): none of its own here.
|
||||
{k:'routers',i:'🧠',pop:1,cap:250000,t:N_('ops.o_routers'),d:N_('ops.o_routers_std_d'),p:{at:{d:80,v:[60,70,80,90],l:N_('ops.p_at'),f:v=>v+'%'},how:{d:'auto',v:['auto','add','swap'],l:N_('ops.p_how'),f:v=>tr({auto:N_('ops.how_auto'),add:N_('ops.how_add'),swap:N_('ops.how_swap')}[v])}}},
|
||||
// The build standard (96-pop-standard.js): its targets are set in their own sheet, so here it has only the budget.
|
||||
{k:'std',i:'📐',pop:1,cap:250000,t:N_('ops.o_std'),d:N_('ops.o_std_around_d'),p:{}},
|
||||
{k:'std',i:'📐',pop:1,cap:250000,t:N_('ops.o_std'),d:N_('ops.o_std_wave_d'),p:{}},
|
||||
{k:'caches',i:'📦',pop:1,cap:5000,mo:1,t:N_('ops.o_caches'),d:N_('ops.o_caches_d'),p:{g:{d:5,v:[1,5,10,25,50],l:N_('ops.p_g'),f:v=>fmtG(v)}}},
|
||||
{k:'ix',i:'🔀',t:N_('ops.o_ix'),d:N_('ops.o_ix_d'),p:{}},
|
||||
{k:'pni',i:'🤝',pop:1,cap:50000,t:N_('ops.o_pni'),d:N_('ops.o_pni_d'),p:{g:{d:25,v:[5,10,25,50,100],l:N_('ops.p_g'),f:v=>fmtG(v)},tier:{d:0,v:[0,1,2],l:N_('ops.p_tier'),f:v=>tr('ops.at_least_port',{port:PORT[v].n})},paid:{d:false,v:[false,true],l:N_('ops.p_paid'),f:v=>v?tr('common.on'):tr('common.off')}}},
|
||||
|
|
@ -29,7 +29,7 @@ const OPS=[
|
|||
{k:'optics',i:'🌈',cap:250000,t:N_('ops.o_optics'),d:N_('ops.o_optics_d'),p:{at:{d:70,v:[50,60,70,80,90],l:N_('ops.p_at'),f:v=>v+'%'},pick:{d:'cheap',v:['cheap','big'],l:N_('ops.p_pick'),f:v=>tr({cheap:N_('ops.pick_cheap'),big:N_('ops.pick_big')}[v])}}},
|
||||
// Line systems up to a bigger one, and optics swapped for bigger ones, on fiber that is full and runs hot, or every fiber up to
|
||||
// the build standard's line system. A line system swap is a day without that fiber: only where the traffic gets around it.
|
||||
{k:'optup',i:'🔭',cap:250000,t:N_('ops.o_optup'),d:N_('ops.o_optup_std_d'),p:{at:{d:80,v:[60,70,80,90],l:N_('ops.p_at'),f:v=>v+'%'},
|
||||
{k:'optup',i:'🔭',cap:250000,t:N_('ops.o_optup'),d:N_('ops.o_optup_wave_d'),p:{at:{d:80,v:[60,70,80,90],l:N_('ops.p_at'),f:v=>v+'%'},
|
||||
swap:{d:true,v:[true,false],l:N_('ops.p_swap'),f:v=>v?tr('common.on'):tr('common.off')}}},
|
||||
{k:'decom',i:'🧹',t:N_('ops.o_decom'),d:N_('ops.o_decom_d'),p:{keep:{d:true,v:[true,false],l:N_('ops.p_keep'),f:v=>v?tr('common.on'):tr('common.off')}}},
|
||||
];
|
||||
|
|
@ -126,12 +126,15 @@ function opsQuiet(fn){const a=after,t=toast,s=sfx,f=floater,sel=UI.sel,cf=UI.con
|
|||
// up/mo: what this shift paid up front and added to the monthly bill.
|
||||
// dk: the night's fibers taken dark (n) and routings to test one (t), shared by the orders that do it (opsDarkRoom()).
|
||||
// fib: the fibers and waves an order worked on this shift, by order: one owner per fiber a shift.
|
||||
// ow: money already promised that has not left yet, what the IPv6-only swaps under way still owe (ip6Owed()), whoever
|
||||
// started them: every order keeps it above the cash floor, so the swaps pay their routers without going under it.
|
||||
// The order that starts a swap counts it again (bstdShift()).
|
||||
function opsShift(){const r=new Map(),broke=new Set();
|
||||
return {r,broke,dirty:false,up:0,mo:0,dk:{n:0,t:0},fib:new Map(),did(k,w){this.dirty=true;const x=r.get(k)||{n:0,w:[]};x.n++;if(w&&x.w.length<3&&!x.w.includes(w))x.w.push(w);r.set(k,x);},
|
||||
return {r,broke,dirty:false,up:0,mo:0,dk:{n:0,t:0},fib:new Map(),ow:ip6Owed(),did(k,w){this.dirty=true;const x=r.get(k)||{n:0,w:[]};x.n++;if(w&&x.w.length<3&&!x.w.includes(w))x.w.push(w);r.set(k,x);},
|
||||
// A job that costs nothing up front still has to pass the cash floor if it adds to the monthly bill.
|
||||
// quiet: only asking, so a no is not logged as the budget running out.
|
||||
can(k,cost,mo=0,quiet){const O=S.ops,cap=opsCap(k);if(cost<=0&&!(mo>0))return true;
|
||||
if(S.cash-Math.max(0,cost)<O.floor||(cap&&(OPSK[k].mo?(O.addMo[k]||0)+mo:(O.spent[k]||0)+cost)>cap)){if(!quiet)broke.add(k);return false;}return true;},
|
||||
if(S.cash-Math.max(0,cost)-this.ow<O.floor||(cap&&(OPSK[k].mo?(O.addMo[k]||0)+mo:(O.spent[k]||0)+cost)>cap)){if(!quiet)broke.add(k);return false;}return true;},
|
||||
book(k,d,dm){const O=S.ops;if(d>0){this.up+=d;if(OPSK[k].cap)O.spent[k]=(O.spent[k]||0)+d;}if(dm){this.mo+=dm;O.addMo[k]=(O.addMo[k]||0)+dm;}},
|
||||
// Run a click and book what it really cost; false when the action refused (no ports, no cash, a quote changed).
|
||||
pay(k,fn){const c0=S.cash,m0=opsMoNow(),x=fn();this.book(k,c0-S.cash,opsMoNow()-m0);return x===undefined?c0-S.cash>0:x;}};}
|
||||
|
|
@ -305,9 +308,10 @@ function opsAround(l){const adj={};for(const x of S.links){if(x===l||linkDown(x)
|
|||
// answers (OPS_ROUTE, then {dark}: opsDarkTrial(), in play in the route worker).
|
||||
// Nothing rides the fiber: no traffic of its own (customers' circuits are in it), none on an express through it (#58).
|
||||
const opsUnused=l=>{const L=(R&&R.load)||{};return !(L[l.id]>1e-6)&&!xpOver(l.id).some(x=>L[x.id]>1e-6);};
|
||||
// What a day dark comes to, said without routing: false (a customer rides it, or it carries traffic with no other way
|
||||
// between its cities), true (nothing rides it, so nothing is lost), null (a routing decides: opsDarkTrial()).
|
||||
function opsDarkPre(l){if(S.biz.some(b=>b.link===l.id))return false;return opsUnused(l)?true:opsAround(l)?null:false;}
|
||||
// What a day dark comes to, said without routing: false (a customer's wave rides its line system, or it carries traffic
|
||||
// with no other way between its cities), true (nothing rides it, so nothing is lost), null (a routing decides:
|
||||
// opsDarkTrial()). Leased pairs and IRUs are glass: a line-system swap never touches them. ws: as dfWaveCust() takes it.
|
||||
function opsDarkPre(l,ws){if(dfWaveCust(l,ws))return false;return opsUnused(l)?true:opsAround(l)?null:false;}
|
||||
const OPS_ROUTE={route:true};
|
||||
// X.dk.t counts the tests that route.
|
||||
function* opsDark(l,X){let k=opsDarkPre(l);if(k===false)return false;if(X.dirty){yield OPS_ROUTE;X.dirty=false;k=opsDarkPre(l);}
|
||||
|
|
@ -370,7 +374,8 @@ function* opsRun(d){if(!opsHired())return;const O=S.ops,m=monthIdx(d);if(m!==O.m
|
|||
for(const k of OPS_ORDER.slice(0,-1))if(O.on[k]){yield* order(k);yield DAY_REST;}
|
||||
if(O.on.decom&&X.dirty&&opsDecomWaits()){yield;X.dirty=false;}
|
||||
ui=null;if(O.on.decom)yield* order('decom');
|
||||
const e={d,i:O.intern,r:[]};for(const [k,x] of X.r)e.r.push([k,x.n,x.w]);if(X.broke.size)e.r.push(['broke',X.broke.size,[...X.broke]]);
|
||||
// At most three places a kind, as the shift log keeps them (opsLogOk()): the count still says how many budgets ran out.
|
||||
const e={d,i:O.intern,r:[]};for(const [k,x] of X.r)e.r.push([k,x.n,x.w]);if(X.broke.size)e.r.push(['broke',X.broke.size,[...X.broke].slice(0,3)]);
|
||||
// Very rarely, and never under Change Freeze, the intern fat-fingers something harmless.
|
||||
// Kevin rolls the same dice (so a seeded game plays the same whoever is hired) and catches it before pressing Enter.
|
||||
const ff=OPS_FF_RATE[rulePreset()];if(ff&&Object.keys(S.pops).length&&Math.random()<ff){const c=pick(Object.keys(S.pops));let f=Math.floor(Math.random()*OPS_FF.length);
|
||||
|
|
@ -382,7 +387,8 @@ function* opsRun(d){if(!opsHired())return;const O=S.ops,m=monthIdx(d);if(m!==O.m
|
|||
if(X.dirty)yield;
|
||||
if(e.r.length||e.f!==undefined){O.log.unshift(e);O.log.length=Math.min(O.log.length,OPS_LOG);}
|
||||
// The day's detail stays in the Ops sheet; the NOC gets one notice a week (above).
|
||||
const W=O.wk;for(const [k,n,ws] of e.r){W.n[k]=(W.n[k]||0)+n;const a=W.wh[k]||(W.wh[k]=[]);for(const x of ws)if(a.length<3&&!a.includes(x))a.push(x);}
|
||||
// A job with no place (a rushed repair, a route server) adds no empty list to the tally: a reload keeps none (opsWkOk()).
|
||||
const W=O.wk;for(const [k,n,ws] of e.r){W.n[k]=(W.n[k]||0)+n;if(!ws.length)continue;const a=W.wh[k]||(W.wh[k]=[]);for(const x of ws)if(a.length<3&&!a.includes(x))a.push(x);}
|
||||
W.up+=e.up||0;W.mo+=e.mo||0;if(e.f!==undefined)W.ff=Math.min(7,W.ff+1);}
|
||||
// New POP from the template: price the whole bundle first, then click through it in one go.
|
||||
function opsTplQuote(c){if(!S||S.pops[c]||!cityOn(c)||(cnCity(c)&&!cnOk()))return null;const T=S.ops.tpl,parts=[];let cost=popCost(c),net=null,ix=null,kit=null;
|
||||
|
|
|
|||
|
|
@ -4,12 +4,14 @@
|
|||
system, the optics and the waves. A new POP gets its POP part at once, while the box is still idle (no maintenance
|
||||
window). The rest is brought up by the intern's "Keep to the build standard" order, or in one tap from the sheet. */
|
||||
// Every target, with the values its list offers ("keep" first: no target) and its default. Saved sparse: a target left
|
||||
// at its default is not in the save, so an old {g, rt} standard is exactly the routers it always was.
|
||||
// at its default is not in the save, so an old {g, rt} standard is exactly the routers it always was. on: only then is
|
||||
// the target in the sheet and in the plan (IPv6-only broadband needs scarce IPv4, rule ip4).
|
||||
const BSTD=[
|
||||
{k:'g',grp:'pop',l:N_('bstd.l_model'),d:'keep',v:()=>['keep',...RG.map((r,i)=>i).sort((a,b)=>RG[a].cls-RG[b].cls||RG[a].cap-RG[b].cap||a-b)],ok:v=>v==='keep'||(Number.isInteger(v)&&!!RG[v])},
|
||||
{k:'rt',grp:'pop',l:N_('common.routers'),d:1,v:()=>[1,2,3,4,6,8,12,16],ok:v=>Number.isInteger(v)&&v>=1&&v<=RMAX},
|
||||
{k:'site2',grp:'pop',l:N_('bstd.l_site2'),d:false,v:()=>[false,true]},
|
||||
{k:'gen',grp:'pop',l:N_('common.backup_generator'),d:false,v:()=>[false,true]},
|
||||
{k:'v6',grp:'pop',l:N_('bstd.l_v6'),d:false,v:()=>[false,true],on:()=>ip4On()},
|
||||
{k:'lag',grp:'port',l:N_('bstd.l_lag'),d:1,v:()=>[1,2,4]},
|
||||
{k:'split',grp:'port',l:N_('bstd.l_split'),d:false,v:()=>[false,true]},
|
||||
{k:'ix',grp:'port',l:N_('bstd.l_ix'),d:false,v:()=>[false,true]},
|
||||
|
|
@ -19,7 +21,7 @@ const BSTD=[
|
|||
{k:'wv',grp:'fiber',l:N_('common.waves'),d:'keep',v:()=>['keep',...LT.map((x,i)=>i).filter(i=>i>0&&waveShown(i))],ok:v=>v==='keep'||(Number.isInteger(v)&&v>0&&!!LT[v])},
|
||||
];
|
||||
const BSTDK=Object.fromEntries(BSTD.map(x=>[x.k,x])),BSTD_MAX=16,BSTD_SYS={lite:0,roadm:1,cl:2};
|
||||
const bstdOk=(x,v)=>x.ok?x.ok(v):x.v().includes(v);
|
||||
const bstdOk=(x,v)=>x.ok?x.ok(v):x.v().includes(v),bstdOn=x=>!x.on||x.on();
|
||||
// The whole standard, every target filled in. d: a saved one (untrusted: anything odd reads as "keep").
|
||||
function bstd(d=S&&S.popStd){const o={},ob=d&&typeof d==='object'&&!Array.isArray(d)?d:{};
|
||||
for(const x of BSTD){const v=ob[x.k];o[x.k]=x.k==='rt'?(own(ob,'rt')?int(v,1,RMAX,1):1):own(ob,x.k)&&bstdOk(x,v)?v:x.d;}return o;}
|
||||
|
|
@ -67,8 +69,8 @@ function popStdHtml(c){const p=S.pops[c];if(!p||pzOn())return '';const D=bstd(),
|
|||
return `<div class="kv"><span>${tr('bstd.title')}</span><b>${on?esc(bstdLine(D)):tr('pop_std.none')}</b></div><div class="btns">${btn(tr('bstd.edit'),'bstdOpen',{},'sm')}${same?'':btn(tr('pop_std.make_this_the_standard'),'popStdSet',{city:c},'ghost sm')}${on?btn(tr('pop_std.clear'),'popStdClear',{},'ghost sm'):''}</div>`;}
|
||||
// "2 × Absolute Unit 3.2T, second building, generator": the POP part, what a new POP gets.
|
||||
function bstdPopParts(D){const a=[];if(D.g!=='keep'||D.rt>1)a.push(`${D.rt} × ${D.g==='keep'?tr('bstd.any_model'):RG[D.g].n}`);if(D.site2)a.push(tr('bstd.second_building'));if(D.gen)a.push(tr('bstd.generator'));return a;}
|
||||
// The POP part first, then how many other targets.
|
||||
function bstdLine(D){const a=bstdPopParts(D),n=['lag','split','ix','pni','sys','opt','wv'].filter(k=>D[k]!==BSTDK[k].d).length;if(n)a.push(trn('bstd.n_more_targets',n));return a.join(', ')||tr('pop_std.none');}
|
||||
// The POP part first, then how many other targets (IPv6-only broadband is not part of a new POP: it has no homes yet).
|
||||
function bstdLine(D){const a=bstdPopParts(D),n=['v6','lag','split','ix','pni','sys','opt','wv'].filter(k=>D[k]!==BSTDK[k].d&&bstdOn(BSTDK[k])).length;if(n)a.push(trn('bstd.n_more_targets',n));return a.join(', ')||tr('pop_std.none');}
|
||||
|
||||
/* What the standard still asks for, as jobs in the order they get done: POPs busiest first, then ports hottest first,
|
||||
then fiber and waves hottest first. Pure: it reads S and R and changes nothing. Each job is priced with the game's
|
||||
|
|
@ -77,8 +79,9 @@ function bstdLine(D){const a=bstdPopParts(D),n=['lag','split','ix','pni','sys','
|
|||
rest of that chain waits. A job that needs another chain's work first (optics only the new router model takes, a split
|
||||
that needs the second building) names that job in dep and waits for it too. Whether a fiber may go dark is settled
|
||||
here, not on the way, so the plan is what the button does and its sum is the quote.
|
||||
intern: only where the intern may work (per-POP exceptions). J.held: fibers whose line system has to wait. */
|
||||
function bstdPlan(intern){const J=[];J.held=[];if(!S||!S.popStd||pzOn())return J;const D=bstd(),here=c=>!intern||opsHere('std',c);
|
||||
intern: only where the intern may work (per-POP exceptions). J.held: fibers whose line system has to wait; J.wv: those
|
||||
of them that wait because a customer's wave rides the line system (dfWaveCust()), which no traffic test changes. */
|
||||
function bstdPlan(intern){const J=[];J.held=[];J.wv=[];if(!S||!S.popStd||pzOn())return J;const D=bstd(),here=c=>!intern||opsHere('std',c);
|
||||
const load=c=>Math.max((R.nodeLoad[c]||0)/(R.nodeCap[c]||nodeCap(c)||1),portsUsed(c)/Math.max(1,portsMax(c)));
|
||||
const cs=Object.keys(S.pops).filter(here),ld={};for(const c of cs)ld[c]=load(c);cs.sort((a,b)=>ld[b]-ld[a]||(a<b?-1:1));
|
||||
// Router ports: what the POP will have once its own jobs are done, less what pending PNI augments will take.
|
||||
|
|
@ -100,6 +103,15 @@ function bstdPlan(intern){const J=[];J.held=[];if(!S||!S.popStd||pzOn())return J
|
|||
if(D.site2&&!p.site2)s2=job('pop','site2','s:'+c,c,SITE2_COST,SITE2_MO,()=>{ACT.addSite({city:c});return !!S.pops[c].site2;},{c});
|
||||
if(D.gen&&!p.gen&&!bstdNoGen())job('pop','gen','e:'+c,c,GEN_COST,GEN_MO,()=>{if(bstdNoGen())return false;ACT.addGen({city:c});return !!S.pops[c].gen;},{c});
|
||||
V[c]={g,rt,site2:!!p.site2||D.site2,sw,s2};}
|
||||
// Broadband IPv6-only: every city still on dual stack starts its home-router swap (ACT.ip6Go()), the most dual-stack
|
||||
// homes first: those are the most behind CGNAT, and free the most addresses. Its price is the whole swap, paid as the
|
||||
// routers go in (ip6Day()): later, so the shift and the button keep what it still owes, as for every swap running, above
|
||||
// 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;
|
||||
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.
|
||||
if(D.lag>1||D.split){const P=[];
|
||||
for(const t of S.transit)if(S.pops[t.city]&&here(t.city))P.push({k:'t',c:t.city,id:t.id,o:t,n:t.n||1,tier:t.tier,u:(R.useT[t.id]||0)/lagCap(PORT[t.tier].g,t.n)});
|
||||
|
|
@ -119,7 +131,7 @@ function bstdPlan(intern){const J=[];J.held=[];if(!S||!S.popStd||pzOn())return J
|
|||
if(!q||!take(c,q.slots))continue;const tier=q.tier;k--;
|
||||
job('port','pni','n:'+net+'@'+c,c+' '+net,q.cost,pniMo({net,tier,n:1},0),()=>{const x=pniQuote(c,net,tier,resv(c));if(!x||x.why||x.ex||!spend(x.cost))return false;pniPlace(x);return true;},{c});}}}
|
||||
// Fiber and waves, hottest first. A POP excepted from the order keeps its links as they are too.
|
||||
if(D.sys!=='keep'||D.opt!=='keep'||D.wv!=='keep'){const sp={...(S.spares||{})},dk=new Map(),wv=new Map();
|
||||
if(D.sys!=='keep'||D.opt!=='keep'||D.wv!=='keep'){const sp={...(S.spares||{})},dk=new Map(),wv=new Map();let wc=null;
|
||||
const ls=S.links.filter(l=>(l.kind==='df'||l.kind==='wave')&&here(l.a)&&here(l.b)&&S.pops[l.a]&&S.pops[l.b]).map(l=>({l,u:(R.load[l.id]||0)/Math.max(1e-9,capOf(l))})).sort((a,b)=>b.u-a.u||(a.l.id<b.l.id?-1:1));
|
||||
// Waves: the size each goes up to. The decom order hands back the smaller waves a pair no longer needs, judged with
|
||||
// the sizes these upgrades give: never pay a month's rent on one it is about to return.
|
||||
|
|
@ -131,13 +143,15 @@ function bstdPlan(intern){const J=[];J.held=[];if(!S||!S.popStd||pzOn())return J
|
|||
if(l.kind==='wave'){const t=wv.get(l);if(t){const nm=Math.round(waveMo(l.km,l.sub,t)*(l.mult||1));job('fiber','wv',ch,l.a+'|'+l.b,nm,nm-(l.mo||0),()=>{ACT.upLink({id:l.id,tier:t});return l.tier===t;},{l});}continue;}
|
||||
if(l.eqDown>S.day)continue;
|
||||
let sys=l.sys;const lit=l.ready<=S.day,nx=D.sys!=='keep'&&BSTD_SYS[sys]<BSTD_SYS[D.sys]&&sysNext({sys});
|
||||
// A lit fiber goes dark for a day. Busy with nothing parallel to carry it: it keeps its line system for now, and
|
||||
// gets the best optics that one takes. A parallel fiber goes dark first in this plan: it waits for next time.
|
||||
// The intern's plan leaves the rest to the shift's own test (opsDark(): a routing without the fiber), as the optical
|
||||
// order does: here only what is known without one (opsDarkPre()), and a fiber that failed the test this week.
|
||||
if(nx&&techOk('sys',nx,DF_SYS[nx].lvl)){
|
||||
if(lit&&!(intern?!(OPTUP_NO.get(l.id)>S.day)&&opsDarkPre(l)!==false:bstdDarkOk(l)))J.held.push(l);
|
||||
else if(lit&&(intern?pairLinks(l.a,l.b).some(x=>x!==l&&dk.get(x.id)):!bstdDarkOk(l,dk))){J.held.push(l);continue;}
|
||||
// A lit fiber goes dark for a day. Busy with nothing parallel to carry it, or a customer's wave on its line system:
|
||||
// it keeps its line system for now, and gets the best optics that one takes. A parallel fiber goes dark first in
|
||||
// this plan: it waits for next time. The intern's plan leaves the rest to the shift's own test (opsDark(): a
|
||||
// routing without the fiber), as the optical order does: here only what is known without one (opsDarkPre()), and
|
||||
// a fiber that failed the test this week.
|
||||
if(nx&&techOk('sys',nx,DF_SYS[nx].lvl)){const ws=lit?wc||(wc=dfWaveSet()):null;
|
||||
if(lit&&dfWaveCust(l,ws)){J.held.push(l);J.wv.push(l);}
|
||||
else if(lit&&!(intern?!(OPTUP_NO.get(l.id)>S.day)&&opsDarkPre(l,ws)!==false:bstdDarkOk(l,undefined,ws)))J.held.push(l);
|
||||
else if(lit&&(intern?pairLinks(l.a,l.b).some(x=>x!==l&&dk.get(x.id)):!bstdDarkOk(l,dk,ws))){J.held.push(l);continue;}
|
||||
else{const busy=lit&&(intern?!opsUnused(l):bstdBusy(l));
|
||||
while(BSTD_SYS[sys]<BSTD_SYS[D.sys]){const to=sysNext({sys});if(!to||!techOk('sys',to,DF_SYS[to].lvl))break;
|
||||
const s0=sys;job('fiber','sys',ch,l.a+'|'+l.b,sysCost(to)*(to==='cl'&&l.own?Math.max(1,l.pairs|0):1),0,()=>{if(l.sys!==s0)return false;ACT.upSys({id:l.id});return l.sys===to;},{l,dark:lit,busy});sys=to;}
|
||||
|
|
@ -189,16 +203,17 @@ function bstdOptJobs(l,sys,sp,V,take,ch){const rg=c=>V[c]?V[c].g:(S.pops[c].rgen
|
|||
// The new ones could not go in (ports, cash): the old optics go back in from the shelf.
|
||||
(l.ch=l.ch||[]).push(...Array(k).fill(o0));S.spares[o0]-=k;return false;}});}
|
||||
return out;}
|
||||
// The button's test of a line-system swap, which darkens the fiber for a day: only while it carries little, or its
|
||||
// parallel links can take its load. No routing, so the quote is what the click does. (The intern routes: opsDark().)
|
||||
// The button's test of a line-system swap, which darkens the fiber for a day: never under a customer's wave (it would go
|
||||
// dark with the fiber: dfWaveCust()), and only while it carries little, or its parallel links can take its load. No
|
||||
// routing, so the quote is what the click does. (The intern routes: opsDark().)
|
||||
// ex: fibers already going dark today (id → whether they carry traffic): they carry nothing for this one, and one whose
|
||||
// traffic leans on its parallel links keeps them lit.
|
||||
// traffic leans on its parallel links keeps them lit. ws: as dfWaveCust() takes it.
|
||||
const bstdBusy=l=>((R.load&&R.load[l.id])||0)>Math.max(1,capOf(l)*0.1);
|
||||
// Express lightpaths (#58) ride the fiber's glass: its own load says nothing about them, and its parallel links do not
|
||||
// carry them, so an express with any traffic at all keeps the fiber lit (the line system waits, as for a busy fiber).
|
||||
// The intern's routing test needs no such rule: an express goes dark with its fiber there (opsDarkTrial()).
|
||||
const bstdXpBusy=l=>xpSlots(l)>0&&xpOver(l.id).some(x=>((R.load&&R.load[x.id])||0)>1e-6);
|
||||
function bstdDarkOk(l,ex){if(bstdXpBusy(l))return false;const P=pairLinks(l.a,l.b).filter(x=>x!==l);if(ex&&P.some(x=>ex.get(x.id)))return false;if(!bstdBusy(l))return true;
|
||||
function bstdDarkOk(l,ex,ws){if(dfWaveCust(l,ws)||bstdXpBusy(l))return false;const P=pairLinks(l.a,l.b).filter(x=>x!==l);if(ex&&P.some(x=>ex.get(x.id)))return false;if(!bstdBusy(l))return true;
|
||||
return P.filter(x=>!linkDown(x)&&!x.standby&&!(ex&&ex.has(x.id))).reduce((a,x)=>a+Math.max(0,capOf(x)-((R.load&&R.load[x.id])||0)),0)>=((R.load&&R.load[l.id])||0);}
|
||||
/* Do the plan's jobs in order. can(j): may it be paid for (budget, floor, cash); pay(j): run it, true if it took.
|
||||
dark(j, ex): may the first job that darkens a fiber go ahead (ex: fibers gone dark so far, as bstdDarkOk() takes them),
|
||||
|
|
@ -219,9 +234,11 @@ function bstdDo(J,can,pay){const g=bstdRun(J,can,pay,function*(j,ex){return bstd
|
|||
const bstdPrice=j=>j.price?j.price():j.cost;
|
||||
// The sheet's summary and the MCP quote: how much is below the standard, and what bringing it all up costs. The plan is
|
||||
// what the button does, so its sum is the bill. held: the fibers whose line system waits ("fra|ams"); they are below it.
|
||||
// Of them, wait: the ones that wait for their traffic, wv: the ones that wait for a customer's wave to leave.
|
||||
function bstdQuote(intern){const J=bstdPlan(intern),P=new Set(),Q=new Set(),L=new Set(J.held.map(l=>l.id));let cost=0,mo=0;
|
||||
for(const j of J){cost+=j.cost;mo+=j.mo;if(j.grp==='pop')P.add(j.c);else if(j.grp==='port')Q.add(j.ch);else L.add(j.l.id);}
|
||||
return {cost:Math.round(cost),mo:Math.round(mo),pops:P.size,ports:Q.size,links:L.size,n:J.length,held:J.held.map(l=>l.a+'|'+l.b)};}
|
||||
const w=l=>l.a+'|'+l.b;
|
||||
return {cost:Math.round(cost),mo:Math.round(mo),pops:P.size,ports:Q.size,links:L.size,n:J.length,held:J.held.map(w),wait:J.held.filter(l=>!J.wv.includes(l)).map(w),wv:J.wv.map(w)};}
|
||||
// The optics order lights the standard's fastest optics while this order keeps to a standard that wants them.
|
||||
const bstdFast=()=>!!(S.popStd&&opsHired()&&S.ops.on.std&&bstd().opt==='fast');
|
||||
/* The intern's shift: the same plan, every job through the budget and the cash floor at what it costs then, a few at a
|
||||
|
|
@ -231,7 +248,11 @@ const bstdFast=()=>!!(S.popStd&&opsHired()&&S.ops.on.std&&bstd().opt==='fast');
|
|||
is its own until tomorrow (X.fib: that order and decom leave it alone). The plan is made once a shift, and the shift
|
||||
rests between jobs: a POP decommissioned or a link given up meanwhile is not worked on (the links last: a walk of them,
|
||||
only for a job the budget lets through). */
|
||||
// An IPv6-only swap (j.later) pays nothing today: the whole swap counts against the month's budget when it starts, and
|
||||
// from then on it is owed (X.ow): every later job of every order keeps it above the cash floor, as for the swaps already
|
||||
// under way. Not in what the shift paid up front.
|
||||
function* bstdShift(X){const mine=j=>(!j.c||!!S.pops[j.c])&&(!j.l||(X.fib.get(j.l.id)||'std')==='std');
|
||||
yield* bstdRun(bstdPlan(true),j=>mine(j)&&X.can('std',bstdPrice(j),j.mo)&&(!j.l||S.links.includes(j.l)),j=>X.pay('std',()=>j.go())&&(X.did('std',j.w),true),
|
||||
yield* bstdRun(bstdPlan(true),j=>mine(j)&&X.can('std',bstdPrice(j),j.mo)&&(!j.l||S.links.includes(j.l)),
|
||||
j=>{const k=j.later?bstdPrice(j):0;if(!X.pay('std',()=>j.go()))return false;if(k){S.ops.spent.std=(S.ops.spent.std||0)+k;X.ow=ip6Owed();}X.did('std',j.w);return true;},
|
||||
function*(j){const l=j.l;if(OPTUP_NO.get(l.id)>S.day||!opsDarkRoom(X))return false;const ok=yield* opsDark(l,X);if(!ok)OPTUP_NO.set(l.id,S.day+OPTUP_WAIT);return ok;},
|
||||
(j,first)=>{if(j.l)X.fib.set(j.l.id,'std');if(first)X.dk.n++;},BSTD_MAX);}
|
||||
|
|
|
|||
|
|
@ -106,13 +106,13 @@ function pieGovHtml(){const P=S.pie,G=P.gov,can=pieCanBuild();let h=`<div class=
|
|||
<div class="ops-p">${PIE_RDF_BIDS.map(f=>btn(tr('pie_gov.ask',{mo:fmt$(Math.round(a.ask*f))}),'pieBid',{id:a.id,f},a.bid===f?'pink sm':'ghost sm',!can)).join('')}</div>`;
|
||||
if(!G.auc.length)h+=`<p class="meta">${tr('pie_gov.no_auction')}</p>`;
|
||||
for(const w of G.aw){const s=pieRdfSrv(w.city),ok=s>=PIE_RDF_NEED;
|
||||
h+=`<div class="kv"><span>${esc(CITY[w.city].name)} · ${tr('common.price_mo',{price:fmt$(w.mo)})}</span><b style="color:${ok?'var(--eye)':'var(--bad)'}">${tr('pie_gov.served',{p:pct(s)})}</b></div>
|
||||
<div class="meta">${S.day<w.due?tr('pie_gov.due',{p:pct(PIE_RDF_NEED),d:dateStr(w.due)}):tr('pie_gov.until',{d:dateStr(w.end)})}${w.k?' · <b style="color:var(--bad)">'+tr('pie_gov.warned')+'</b>':''}</div>`;}
|
||||
h+=`<div class="kv"><span>${esc(CITY[w.city].name)} · ${tr('common.price_mo',{price:fmt$(w.mo)})}</span><b style="color:${ok?'var(--eye)':'var(--tx-red,var(--bad))'}">${tr('pie_gov.served',{p:pct(s)})}</b></div>
|
||||
<div class="meta">${S.day<w.due?tr('pie_gov.due',{p:pct(PIE_RDF_NEED),d:dateStr(w.due)}):tr('pie_gov.until',{d:dateStr(w.end)})}${w.k?' · <b style="color:var(--tx-red,var(--bad))">'+tr('pie_gov.warned')+'</b>':''}</div>`;}
|
||||
h+=`</div><div class="ops-o"><div class="nm">🇵🇳 ${tr('pie_gov.pitcairn')}</div><p class="meta">${tr('pie_gov.pitcairn_note',{mo:fmt$(GRANT_MO),sky:fmt$(GRANT_SKY_MO)})}</p>${grantFact('pcn')}</div>`;
|
||||
const l=pieEximLoan(),o=G.ex;h+=`<div class="ops-o"><div class="nm">🏦 ${tr('pie_gov.exim')}</div>`;
|
||||
if(l){const q=l.pie;h+=`<div class="kv"><span>${tr('common.still_owed')}</span><b>${fmt$(l.bal)}</b></div><div class="meta">${loanLine(l)}</div>
|
||||
<div class="meta"><b style="color:${pieEximLaunchOk(l)?'var(--eye)':'var(--bad)'}">${pieEximLaunchOk(l)?'✓':'✗'}</b> ${esc(covLabel('pielaunch',l))}</div>
|
||||
<div class="meta"><b style="color:${pieEximDishOk(l)?'var(--eye)':'var(--bad)'}">${pieEximDishOk(l)?'✓':'✗'}</b> ${esc(covLabel('piedish',l))}</div>`;}
|
||||
<div class="meta"><b style="color:${pieEximLaunchOk(l)?'var(--eye)':'var(--tx-red,var(--bad))'}">${pieEximLaunchOk(l)?'✓':'✗'}</b> ${esc(covLabel('pielaunch',l))}</div>
|
||||
<div class="meta"><b style="color:${pieEximDishOk(l)?'var(--eye)':'var(--tx-red,var(--bad))'}">${pieEximDishOk(l)?'✓':'✗'}</b> ${esc(covLabel('piedish',l))}</div>`;}
|
||||
else if(o){const pay=Math.round(annuity(o.amt,o.apr,o.term));h+=`<p class="meta">${tr('pie_gov.exim_offer',{amt:fmt$(o.amt),apr:(o.apr*100).toFixed(1),n:o.term,pay:fmt$(pay)})}</p>
|
||||
<div class="meta">• ${tr('pie_gov.cov_launch',{n:o.n,d:dateStr(S.day+PIE_EXIM_BY)})}</div><div class="meta">• ${tr('pie_gov.cov_dish',{a:esc(pieLicCountry(o.cc))})}</div>
|
||||
<p class="meta">${tr('pie_gov.exim_breach',{apr:(PIE_EXIM_PEN*100).toFixed(0)})}</p><div class="btns">${btn(tr('bank.take_the_money'),'pieExim',{},'pink sm',!can)}</div>`;}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,10 @@ function lagName(tier,n){return (n||1)>1?`${n}×${PORT[tier].n} LAG`:tr('common.
|
|||
function ixCap(c){return ixLagF(c)*(S.myIx[c]?myFab(c).g*(myIxLive(c)?1:0):liveCap(PORT[S.ixp[c]].g,ixCity(c),(S.ixSite||{})[c],(S.ixn||{})[c])*(isRemote(c)?REMOTE_CAP:1));}
|
||||
function ixSessions(c){
|
||||
const s=new Set(); if(S.ixp[c]===undefined)return s;
|
||||
// satNo() for every member, with the city's satellite circuit (most cities have none) looked up once.
|
||||
const so=satOnly(ixCity(c)),orb=so&&SATS[so.bird].orb;
|
||||
for(const id of ixMembers(c)){const n=NET[id];
|
||||
if(S.peers[id+'@'+c]&&!snub(id,c)&&!(isRemote(c)&&noRemote(id)))s.add(id);
|
||||
if(S.peers[id+'@'+c]&&!snub(id,c)&&!(isRemote(c)&&noRemote(id))&&!(so&&noSat(id,orb)))s.add(id);
|
||||
else if(S.rs[c]&&n.pol==='open'&&ppol()==='open')s.add(id);
|
||||
else if(S.myIx[c]&&(n.pol==='open'||n.pol==='selective'))s.add(id);}
|
||||
return s;
|
||||
|
|
|
|||
|
|
@ -16,10 +16,18 @@ function snub(id,c){
|
|||
/* Remote peering: offered, but discouraged. A reseller marks up the port, oversubscribes it,
|
||||
and many selective networks refuse members who are not physically in the building. */
|
||||
const REMOTE_FEE=1.5,REMOTE_CAP=0.8;
|
||||
const REMOTE_WARN=`<p class="note" style="color:var(--bad)">${tr('peering_policy.remote_peering_is_a_last_resort')}</p>`;
|
||||
const REMOTE_WARN=`<p class="note" style="color:var(--tx-red,var(--bad))">${tr('peering_policy.remote_peering_is_a_last_resort')}</p>`;
|
||||
const REMOTE_WHY=[tr('peering_policy.policy_no_remote_peers_be_in'),tr('peering_policy.saw_your_session_come_in_over'),tr('peering_policy.only_peers_with_members_they_can'),tr('peering_policy.their_pearingdb_entry_says_remote'),tr('peering_policy.tried_a_remote_peer_once_it')];
|
||||
function isRemote(c){return S.ixp[c]!==undefined&&!S.pops[ixCity(c)]&&!S.myIx[c];}
|
||||
function noRemote(id){const n=NET[id];if(!n||n.pol!=='selective')return false;return hstr(id+'|remote')%100<(n.share>=0.03?60:30);}
|
||||
/* Satellite islands (#83): where a satellite circuit is your only way out of a city, many selective networks will not
|
||||
peer there. They would hand you traffic for your whole network to haul through orbit: most refuse a GEO hop (about
|
||||
600 ms there and back), few a MEO one (about 130 ms). A stable verdict per network, like remote peering. */
|
||||
const SAT_NO={geo:60,meo:15};
|
||||
const noSat=(id,orb)=>{const n=NET[id];return !!n&&n.pol==='selective'&&own(SAT_NO,orb)&&hstr(id+'|sat')%100<SAT_NO[orb];};
|
||||
// The circuit network id will not take your traffic over in city c (null when it will, or no satellite is in the way).
|
||||
function satNo(id,c){const n=NET[id];if(!n||n.pol!=='selective'||hstr(id+'|sat')%100>=SAT_NO.geo)return null;const l=satOnly(c);return l&&noSat(id,SATS[l.bird].orb)?l:null;}
|
||||
function satPeerWhy(id,c){const l=satNo(id,c);return l?tr('peering_policy.not_while_a_satellite_is_your_only_way',{city:CITY[c].name,orb:SAT_ORB[SATS[l.bird].orb].n,ms:Math.round(2*satLat(l))}):'';}
|
||||
/* Europe's peering market is crowded and competitive: ports are cheaper, and incumbents cut prices
|
||||
when a challenger in the same metro gets too popular. DE-KICKS harmonises instead. */
|
||||
const IX_REG={EU:0.8};
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ function peerOk(id,via,city){
|
|||
const sn=snub(id,city);if(sn&&(via==='ix'||sn.all))return {ok:false,snub:true,why:snubWhy(sn)};
|
||||
if(msfNope(id,city))return {ok:false,why:tr(MSF_NOPE[hstr(ixCity(city)+S.day)%MSF_NOPE.length])};
|
||||
if(via==='ix'&&city&&isRemote(city)&&noRemote(id))return {ok:false,remote:true,why:REMOTE_WHY[hstr(id)%REMOTE_WHY.length]};
|
||||
if(city&&(via==='ix'||via==='pni')){const w=satPeerWhy(id,ixCity(city));if(w)return {ok:false,sat:true,why:w};}
|
||||
if(n.pol==='open')return {ok:true};
|
||||
// In the Cogentle Spat, Goggle's peering desk wants eight times the usual traffic first, so cheap Cogentle-only transit really costs you Goggle (playtest).
|
||||
if(n.pol==='selective'){const need=Math.round((via==='pni'?n.minPni:n.minIx)*confBoost(id)*salesPeerMul()*(id==='ggl'&&scnRule('spat')?8:1));return dem>=need?{ok:true}:{ok:false,why:tr('sold_out.wants_need_gbps_of_traffic_from',{need,dem:dem.toFixed(1)})};}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function sanitize(s){
|
|||
if(!isCity(s.home))s.home=Object.keys(s.pops)[0]||'fra';
|
||||
opsSanitize(s);
|
||||
const tier=v=>int(v,0,PORT.length-1,0),lag=v=>int(v,1,LAG_MAX,1),sid=v=>String(v==null?uid():v).slice(0,40);
|
||||
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);if(l.list!==undefined){const L=l.kind==='df'?cmClean(l.list):null;if(L)l.list=L;else delete l.list;}l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.cname!=null)l.cname=String(l.cname).slice(0,60);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc'&&l.kind!=='xp'&&l.kind!=='sat')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&(!own(CAB,l.cable)||!cablePair(l.cable,l.a,l.b)))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);if(l.day!==undefined)l.day=Math.min(s.day,Math.max(0,num(l.day,s.day)));for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);return l;});
|
||||
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);if(l.list!==undefined){const L=l.kind==='df'?cmClean(l.list):null;if(L)l.list=L;else delete l.list;}l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.cname!=null)l.cname=String(l.cname).slice(0,60);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc'&&l.kind!=='xp'&&l.kind!=='sat')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&(!own(CAB,l.cable)||!cablePair(l.cable,l.a,l.b)))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);if(l.day!==undefined)l.day=Math.min(s.day,Math.max(0,num(l.day,s.day)));for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss){const g=l.loss.glass===true;l.loss=deg(l.loss);if(g&&l.loss)l.loss.glass=true;}return l;});
|
||||
for(const l of s.links)repairSubUpgradeDates(l,s.day);
|
||||
xpSanitize(s);
|
||||
/* Metrics moved from each link to its city pair (#122). Older saves routed a pair at the lowest metric of its
|
||||
|
|
@ -82,7 +82,7 @@ function sanitize(s){
|
|||
for(const l of s.links){const v=l.lay;if(v===undefined)continue;if(!(v&&typeof v==='object'&&!Array.isArray(v)&&l.kind==='df'&&l.own&&l.sub&&l.ready>s.day)){delete l.lay;continue;}
|
||||
const t=Math.round(clamp(num(v.t,s.day),0,l.ready));l.lay={s:Math.round(clamp(num(v.s,s.day),0,Math.min(s.day,t))),q:clamp(num(v.q,0),0,1),t};}}
|
||||
s.loans=s.loans.filter(l=>l&&own(BANKS,l.bank));for(const l of s.loans){if(l.model!==undefined&&!['balloon','storm','transit','astro'].includes(l.model))delete l.model;for(const k of ['apr0','cut','share'])if(l[k]!==undefined&&!isFinite(+l[k]))delete l[k];if(!Array.isArray(l.covs))l.covs=[];l.covs=l.covs.filter(c=>own(COVS,c));}s.loanOffers=s.loanOffers.filter(l=>l&&own(BANKS,l.bank));
|
||||
s.usedNames=[...new Set(s.usedNames.filter(x=>typeof x==='string'))];s.log=s.log.filter(e=>e&&typeof e.t==='string').slice(0,LOG_KEEP).map(e=>{const o=e.o&&typeof e.o==='object'&&e.o.a==='inbox'?{a:'tab',v:'nets'}:e&&e.o&&typeof e.o==='object'&&LOG_OPEN.includes(e.o.a)?(e.o.a==='bank'||e.o.a==='ops'?{a:e.o.a}:typeof e.o.v==='string'&&e.o.v.length<=64&&(e.o.a!=='city'||isCity(e.o.v))&&(e.o.a!=='tab'||LOG_TABS.includes(e.o.v))?{a:e.o.a,v:e.o.v}:null):null;
|
||||
s.usedNames=[...new Set(s.usedNames.filter(x=>typeof x==='string'))];s.log=s.log.filter(e=>e&&typeof e.t==='string').slice(0,LOG_KEEP).map(e=>{const o=e.o&&typeof e.o==='object'&&e.o.a==='inbox'?{a:'tab',v:'nets'}:e&&e.o&&typeof e.o==='object'&&LOG_OPEN.includes(e.o.a)?(e.o.a==='bank'||e.o.a==='ip4'||e.o.a==='ops'?{a:e.o.a}:typeof e.o.v==='string'&&e.o.v.length<=64&&(e.o.a!=='city'||isCity(e.o.v))&&(e.o.a!=='tab'||LOG_TABS.includes(e.o.v))?{a:e.o.a,v:e.o.v}:null):null;
|
||||
return {id:typeof e.id==='string'&&e.id.length<=40?e.id:uid(),d:num(e.d,0),t:e.t.slice(0,600),h:typeof e.h==='string'?e.h.slice(0,200):'',k:LOG_KINDS.includes(e.k)?e.k:'',at:Number.isFinite(+e.at)?+e.at:0,o,n:int(e.n,1,9999,1)};});
|
||||
// One scrubbing center became a list (#117): older saves carry theirs over.
|
||||
if(!Array.isArray(s.scrubs))s.scrubs=s.scrubAt&&isCity(s.scrubAt)?[{city:s.scrubAt,tier:s.scrubTier}]:[];delete s.scrubAt;delete s.scrubTier;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ function terrestrialPath(a,b){if(TERR&&TERR.S===S){if(TERR.gen!==RW.gen||!TERR.m
|
|||
const reqOk=b=>(b.reqs||[]).every(k=>REQS[k]&&REQS[k].ok(b));
|
||||
// Some requirements only make sense for some customers: nobody can reach another continent without getting wet.
|
||||
const reqCan=(k,b)=>!REQS[k].can||REQS[k].can(b);
|
||||
function reqList(o){return (o.reqs||[]).map(k=>{const ok=REQS[k].ok(o),lab=typeof REQS[k].l==='function'?REQS[k].l(o):REQS[k].l;return `<div class="meta"><b style="color:${ok?'var(--eye)':'var(--bad)'}">${ok?'✓':'✗'}</b> ${esc(lab)}</div>`;}).join('');}
|
||||
function reqList(o){return (o.reqs||[]).map(k=>{const ok=REQS[k].ok(o),lab=typeof REQS[k].l==='function'?REQS[k].l(o):REQS[k].l;return `<div class="meta"><b style="color:${ok?'var(--eye)':'var(--tx-red,var(--bad))'}">${ok?'✓':'✗'}</b> ${esc(lab)}</div>`;}).join('');}
|
||||
/* diversePaths(): a shortest path by hops over the live links (and VXCs to remote cities), then another one that shares
|
||||
none of its risks. divGraph() numbers the cities and the risks and lists each city's links once, in list order, as
|
||||
disjointOn() reads them; divOn() asks it, so many pairs on one network (spots0(), opsDecomSafe()) share one graph. The
|
||||
|
|
@ -95,7 +95,15 @@ const linkIds=()=>{const m=new Map();for(const l of S.links)if(!m.has(l.id))m.se
|
|||
function fiberUse(){const sold=new Map(),dfp=new Map(),pairs=new Set();
|
||||
for(const b of S.biz){if(b.type==='wwave')sold.set(b.link,(sold.get(b.link)||0)+(b.slots||0));else if(b.type==='dfpair')dfp.set(b.link,(dfp.get(b.link)||0)+1);else if(b.type==='pairs'||b.type==='capfib')pairs.add(b.link);}
|
||||
return {sold,dfp,pairs};}
|
||||
function fiberOk(b,ids){const l=ids?ids.get(b.link):S.links.find(x=>x.id===b.link);if(!l)return false;if(b.type==='dfpair'||b.type==='pairs'||b.type==='capfib')return l.ready<=S.day&&!(l.cut>S.day);return l.ready<=S.day&&!(l.cut>S.day)&&!(l.eqDown>S.day)&&(b.type!=='mwave'||dfLit(l)>=mwG(l));}
|
||||
// Fiber customers come in two kinds: glass (a leased pair, an IRU, a hyperscaler's pairs) needs only the fiber; the rest
|
||||
// (alien and managed waves) ride its line system too, and go dark with it for the day a line-system swap takes.
|
||||
const FIB_GLASS=new Set(['dfpair','pairs','capfib']);
|
||||
function fiberOk(b,ids){const l=ids?ids.get(b.link):S.links.find(x=>x.id===b.link);if(!l)return false;if(FIB_GLASS.has(b.type))return l.ready<=S.day&&!(l.cut>S.day);return l.ready<=S.day&&!(l.cut>S.day)&&!(l.eqDown>S.day)&&(b.type!=='mwave'||dfLit(l)>=mwG(l));}
|
||||
// A customer rides this fiber's line system: a swap would take it dark (the build standard and the intern wait for the
|
||||
// player). ws: the fibers that carry one (dfWaveSet()), when many fibers are asked about at once.
|
||||
const dfOnSys=b=>!!b.link&&!!BIZ_T[b.type]&&!!BIZ_T[b.type].fiber&&!FIB_GLASS.has(b.type);
|
||||
const dfWaveSet=()=>{const s=new Set();for(const b of S.biz)if(dfOnSys(b))s.add(b.link);return s;};
|
||||
const dfWaveCust=(l,ws)=>ws?ws.has(l.id):S.biz.some(b=>b.link===l.id&&dfOnSys(b));
|
||||
function soldSlots(l,u){return u?u.sold.get(l.id)||0:S.biz.filter(b=>b.type==='wwave'&&b.link===l.id).reduce((a,b)=>a+(b.slots||0),0);}
|
||||
// Spare capacity other carriers can rent on a dark fiber (#51): free channels for alien waves, and on your own build
|
||||
// a spare pair in the trench. Random offers and broker listings follow the same rules and the same prices.
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ function xpRunKm(sp){let cur=0,mx=0;for(const s of sp){const r=s.regen|0,p=s.km/
|
|||
// What optic o carries over that run (0: out of reach), cached like every channel (optG).
|
||||
const xpOptG=(o,run)=>OPT[o]?optG(o,{km:run}):0;
|
||||
function xpG(l){const sp=xpSpans(l);if(!sp)return 0;const run=xpRunKm(sp);let g=0;for(const o of l.ch||[])g+=xpOptG(o,run);return g;}
|
||||
/* What still gets through: a dirty connector in the glass of a fiber under it dims every wave there, this one's too. An
|
||||
MTU mismatch, microbursts or a marginal optic on that fiber belong to its routers and optics, which the express skips. */
|
||||
function xpGlassF(l){const sp=xpSpans(l);if(!sp)return 1;let f=1;for(const s of sp){const x=s.loss;if(x&&x.glass&&x.until>S.day)f*=x.f;}return f;}
|
||||
// The fibers under it with a dirty connector today, for its panel.
|
||||
const xpDim=l=>(xpSpans(l)||[]).filter(s=>s.loss&&s.loss.glass&&s.loss.until>S.day);
|
||||
// The fastest single channel, as a scenario's fast path asks of every hop.
|
||||
function xpHopG(l){const sp=xpSpans(l);if(!sp)return 0;const run=xpRunKm(sp);return Math.max(0,...(l.ch||[]).map(o=>xpOptG(o,run)));}
|
||||
// Dark when a fiber under it is cut, still being built or has its line system down, or nothing lit reaches.
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ function clPanel(){const C=S.cl||{mo:[]},mo=C.mo.slice(-12);const soon=S.biz.fil
|
|||
const sum=k=>mo.reduce((a,e)=>a+(k==='lost'?Object.values(e.lost).reduce((x,y)=>x+y,0):e[k]||0),0),why={};for(const e of mo)for(const k in e.lost)why[k]=(why[k]||0)+e.lost[k];
|
||||
let h=`<div class="panel2" id="churnSec" style="margin-top:12px"><h3>${tr('lifecycle.won_and_lost')}</h3><p class="note" style="margin-top:0">${tr('lifecycle.won_and_lost_note')}</p>
|
||||
<div class="dgrid" style="margin:0 0 8px"><div class="tile"><div class="lbl">${tr('lifecycle.won')}</div><div class="val">${sum('won')}</div><div class="sub">${tr('lifecycle.last_12_months')}</div></div>
|
||||
<div class="tile"><div class="lbl">${tr('lifecycle.lost')}</div><div class="val" style="color:${sum('lost')>sum('won')?'var(--bad)':'inherit'}">${sum('lost')}</div><div class="sub">${trn('lifecycle.n_grew',sum('grew'))}</div></div>
|
||||
<div class="tile"><div class="lbl">${tr('lifecycle.lost')}</div><div class="val" style="color:${sum('lost')>sum('won')?'var(--tx-red,var(--bad))':'inherit'}">${sum('lost')}</div><div class="sub">${trn('lifecycle.n_grew',sum('grew'))}</div></div>
|
||||
<div class="tile"><div class="lbl">${tr('lifecycle.renewals_soon')}</div><div class="val">${soon}</div><div class="sub">${tr('lifecycle.next_30_days')}</div></div>
|
||||
<div class="tile"><div class="lbl">${tr('lifecycle.bandwidth_market')}</div><div class="val">${Math.round(mkt()*100)}</div><div class="sub">${mktTxt()}</div></div></div>`;
|
||||
if(mo.length){const max=Math.max(1,...mo.map(e=>Math.max(e.won,Object.values(e.lost).reduce((x,y)=>x+y,0)))),W=600,H=120,mid=H/2,bw=W/12;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function waveOk(a,b,i){return [a,b].every(c=>i<=RG[S.pops[c]?(S.pops[c].rgen||0)
|
|||
function waveNeed(i){const g=RG.find(r=>r.maxLT>=i);return g?tr('sites_and_service.pn_routers',{pn:g.pn}):'?';}
|
||||
function routerModels(c){const p=S.pops[c],g=p.rgen||0,rt=p.routers||1;
|
||||
return `<div style="margin-top:6px">${RG.map((M,i)=>{if(i===g)return '';const why=modelFits(c,i),lk=!techOk('rg',i,M.lvl);
|
||||
return `<div class="row"><span class="logo" style="--c:${M.badge?'#2C7A7B':'#FF4F9A'}">${M.badge||'R'+(M.cls+1)}</span><div class="grow"><div class="nm">${esc(M.n)} <span class="meta">${M.pn} · ${tr('sites_and_service.n_ports',{n:M.ports})} · ${fmtG(M.cap)} · ${tr('sites_and_service.boots_in_n_min',{n:M.boot})}${M.flaky?' · '+tr('common.crashes_more'):''}</span></div><div class="meta">${esc(M.blurb)}</div><div class="meta">${coreMeta(i)}${coreOn()&&coreRun()>0&&!rgCore(i,coreRun())?' · <b style="color:var(--bad)">'+tr('core.can_t_run_your_lv',{lv:tr(CORE_LV[coreRun()])})+'</b>':''}</div>${why?`<div class="why">${esc(why)}</div>`:''}</div>${lk?demoBtn('rg',i,M.lvl,tr('sites_and_service.level_n',{n:M.lvl}),'sm'):btn(tr('sites_and_service.swap_cost_mo_mo',{cost:fmt$(swapCost(c,i)),mo:fmt$(M.mo*rt)}),'upRouter',{city:c,g:i},'sm',!!why||S.cash<swapCost(c,i)||p.rupDay===S.day)}</div>`;}).join('')}</div>`;}
|
||||
return `<div class="row"><span class="logo" style="--c:${M.badge?'#2C7A7B':'#FF4F9A'}">${M.badge||'R'+(M.cls+1)}</span><div class="grow"><div class="nm">${esc(M.n)} <span class="meta">${M.pn} · ${tr('sites_and_service.n_ports',{n:M.ports})} · ${fmtG(M.cap)} · ${tr('sites_and_service.boots_in_n_min',{n:M.boot})}${M.flaky?' · '+tr('common.crashes_more'):''}</span></div><div class="meta">${esc(M.blurb)}</div><div class="meta">${coreMeta(i)}${coreOn()&&coreRun()>0&&!rgCore(i,coreRun())?' · <b style="color:var(--tx-red,var(--bad))">'+tr('core.can_t_run_your_lv',{lv:tr(CORE_LV[coreRun()])})+'</b>':''}</div>${why?`<div class="why">${esc(why)}</div>`:''}</div>${lk?demoBtn('rg',i,M.lvl,tr('sites_and_service.level_n',{n:M.lvl}),'sm'):btn(tr('sites_and_service.swap_cost_mo_mo',{cost:fmt$(swapCost(c,i)),mo:fmt$(M.mo*rt)}),'upRouter',{city:c,g:i},'sm',!!why||S.cash<swapCost(c,i)||p.rupDay===S.day)}</div>`;}).join('')}</div>`;}
|
||||
function portNote(c){const p=S.pops[c];if(!p)return '';const g=p.rgen||0;return RG[g].maxP<PORT.length-1?`<p class="note" style="margin-top:0">${tr('sites_and_service.your_model_here_tops_out_at',{model:esc(RG[g].n),pn:RG[g].pn})}</p>`:'';}
|
||||
// Service: what you deliver, times how it feels. Traffic backhauled far to transit is slow, and users notice.
|
||||
const latSlow=c=>!!(R&&R.latF&&R.latF[c]<0.97&&R.latFar[c]);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function* failureRun(only){
|
|||
let tot=opts.reduce((a,o)=>a+o[1],0),r=Math.random()*tot,type=opts[0][0];
|
||||
for(const o of opts){r-=o[1];if(r<=0){type=o[0];break;}}
|
||||
if(only)type=only;
|
||||
if(type==='funny'){const f=['oops','cleaner','harmless','harmless','harmless','ac'];if(live.length)f.push('fatwave','fatwave','mtu','label','loss','loss');if(lagsN().length)f.push('lacp','lacp');if(R.demand>1)f.push('pmtud');if(S.transit.length)f.push('prepend');if(S.day>30)f.push('rpki');if(amps.length)f.push('roadmff');type=pick(f);}
|
||||
if(type==='funny'){const f=['oops','cleaner','harmless','harmless','harmless','ac'];if(live.length)f.push('fatwave','fatwave','mtu','label','loss','loss');else if(bare.length)f.push('loss','loss');if(lagsN().length)f.push('lacp','lacp');if(R.demand>1)f.push('pmtud');if(S.transit.length)f.push('prepend');if(S.day>30)f.push('rpki');if(amps.length)f.push('roadmff');type=pick(f);}
|
||||
const before=R.served;
|
||||
if(type==='harmless'){const m=pick(HARMLESS);S.stats.incidents++;S.stats.survived++;toast(`<b>${m[0]}</b><br>${m[1]}`,'goal');sfx('alert');return;}
|
||||
if(type==='ring'){const cs=Object.keys(S.pops).filter(c=>S.pops[c].site2),c=pick(cs),pp=S.pops[c],dur=2+Math.floor(Math.random()*3);pp.ringcut=S.day+dur;
|
||||
|
|
@ -55,9 +55,11 @@ function* failureRun(only){
|
|||
addInc({type,ref:g.k+':'+g.id,until,msg:tr(msg,{lab}),cost:600,fix:tr('failures.fix_the_lacp_config')},msg);
|
||||
}else if(type==='loss'){
|
||||
const deep=l=>[l.a,l.b].every(c=>S.pops[c]&&/deep-buffer/.test(RG[S.pops[c].rgen||0].chip));
|
||||
const l=pick(live),v=Math.floor(Math.random()*3);
|
||||
// Only the dirty connector (v 0) is in the glass, so it dims the expresses riding the fiber too; microbursts and a
|
||||
// marginal optic are its own routers' and optics'. A fiber that only carries expresses has nothing else to go wrong.
|
||||
const l=pick(live.concat(bare)),r=Math.floor(Math.random()*3),v=xpBare(l)?0:r;
|
||||
if(v===1&&deep(l)){S.stats.incidents++;S.stats.survived++;toast(tr('failures.microbursts_on_a_b_your_deep',{a:CITY[l.a].name,b:CITY[l.b].name}),'goal');return;}
|
||||
const f=[0.6,0.8,0.7][v],dur=2+Math.floor(Math.random()*3);l.loss={until:S.day+dur,f};
|
||||
const f=[0.6,0.8,0.7][v],dur=2+Math.floor(Math.random()*3);l.loss=v?{until:S.day+dur,f}:{until:S.day+dur,f,glass:true};
|
||||
const msg=[N_('failures.a_dirty_connector_on_a_b'),
|
||||
N_('failures.microbursts_on_a_b_overflow_shallow'),
|
||||
N_('failures.crc_errors_on_a_b_a')][v];
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ function* dayPost(d){
|
|||
// the sales desk signs and declines deals, when the player lets it (39-sales-auto.js), then the intern's shift sees them
|
||||
yield* slAutoRun(d);
|
||||
if(opsHired())yield DAY_REST;
|
||||
yield* opsRun(d);opsTidy();
|
||||
yield* opsRun(d);
|
||||
if(S.pie){pieDay(d);pieTier();}
|
||||
// payday floaters
|
||||
if(cal(d).d===1){for(const c in S.pops){let v=(R.cityEye[c]*sfOf(R,c)*EYE_RATE)+S.biz.filter(b=>b.city===c).reduce((a,b)=>a+b.bw*b.rate,0);v=v-R.cityEye[c]*sfOf(R,c)*EYE_RATE*(1-arpuOf(c));if(v>500)floater(CITY[c].x,CITY[c].y-30,'+'+fmt$(v),'#16A866');}sfx('coin');}
|
||||
|
|
@ -130,10 +130,6 @@ function* dayPost(d){
|
|||
{const c=cal(d);if(c.m===0&&c.d===1&&[2,3,5].includes(c.y))track('game_year_'+c.y,true);}
|
||||
if(d%10===0)save();
|
||||
}
|
||||
// The shift's notes as a reload keeps them (opsSanitize): at most three places a job in the day's log (the broken links
|
||||
// were all listed), and no empty list in the week's tally. So live state is what a reload makes of it (server-sim 5.4).
|
||||
function opsTidy(){const O=S.ops;if(!O)return;for(const e of O.log||[])for(const r of e.r||[])if(Array.isArray(r[2])&&r[2].length>3)r[2]=r[2].slice(0,3);
|
||||
for(const w of [O.wk,O.rep])if(w&&w.wh)for(const k of Object.keys(w.wh))if(Array.isArray(w.wh[k])&&!w.wh[k].length)delete w.wh[k];}
|
||||
function spawnOffer(){
|
||||
const mine=spMine(Object.keys(S.pops).filter(bizCity)),lv=lvl();
|
||||
const types=['dia','dia','game','host'];if(mine.length>=2)types.push('l2vpn','l2vpn');if(S.day>60)types.push('scrub');
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ const ACT={
|
|||
if(o.a==='city'&&isCity(o.v)){ACT.focusCity({city:o.v});return;}
|
||||
if(o.a==='link'){if(S.links.some(l=>l.id===o.v)){ACT.selLink({id:o.v});return;}toast(tr('interface.that_link_is_gone_it_was'),'');return;}
|
||||
if(o.a==='cust'){if(S.biz.some(b=>b.id===o.v)){ACT.custGo({id:o.v});return;}toast(tr('interface.that_customer_is_gone_the_contract'),'');return;}
|
||||
if(o.a==='bank'){ACT.bank({});return;}if(o.a==='ops'){ACT.opsOpen();return;}if(o.a==='tab'&&LOG_TABS.includes(o.v))ACT.leftTab({t:o.v});},
|
||||
if(o.a==='ip4'&&ip4On()){ACT.ip4Open();return;}if(o.a==='bank'||o.a==='ip4'){ACT.bank({});return;}if(o.a==='ops'){ACT.opsOpen();return;}if(o.a==='tab'&&LOG_TABS.includes(o.v))ACT.leftTab({t:o.v});},
|
||||
logAll:()=>{UI.logAll=!UI.logAll;renderLeft();},
|
||||
findOpen:()=>findOpen(),
|
||||
findGo:({city})=>{if(!isCity(city))return;closeModal();$('dash').hidden=true;ACT.focusCity({city});},
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ Object.assign(ACT,{
|
|||
toast(own?tr('fiber_and_hardware.groundbreaking_your_own_fiber_from_a',{a:CITY[a].name,b:CITY[b].name,n:dfBuildDays(km)}):tr('fiber_and_hardware.dark_fiber_iru_signed_a_b',{a:CITY[a].name,b:CITY[b].name}),'goal');after();},
|
||||
regen:({id,d})=>{d=+d;const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||(l.sub&&!l.seat)||(d!==1&&d!==-1))return;const n=(l.regen|0)+d;if(n<0||n>REGEN_MAX)return;
|
||||
if(d<0&&((l.ch||[]).some(o=>!optMode(o,Object.assign({},l,{regen:n})))||xpRegenBad(l,n))){toast(tr('fiber_and_hardware.those_optics_need_the_regen_site'),'bad');sfx('err');return;}
|
||||
if(d>0&&!spend(REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH)))return;l.regen=n;toast(d>0?tr('fiber_and_hardware.regen_site_n_is_up_optical',{n,a:CITY[l.a].name,b:CITY[l.b].name,km:spanKm(l).toLocaleString()}):tr('fiber_and_hardware.regen_site_removed'),'good');sfx('build');after();},
|
||||
if(d>0&&!spend(regenAddCost(l)))return;l.regen=n;toast(d>0?tr('fiber_and_hardware.regen_site_n_is_up_optical',{n,a:CITY[l.a].name,b:CITY[l.b].name,km:spanKm(l).toLocaleString()}):tr('fiber_and_hardware.regen_site_removed'),'good');sfx('build');after();},
|
||||
addCh:({id,o})=>{const l=S.links.find(x=>x.id===id),O=OPT[o];if(!l||!O||l.kind!=='df')return;const why=chWhy(l,o);if(why){toast(tr('fiber_and_hardware.can_t_add_optic_why',{optic:O.n,why:esc(why)}),'bad');sfx('err');return;}if(!portGate(l.a,chPorts(o,l.a))||!portGate(l.b,chPorts(o,l.b)))return;const sp=spareN(o)>0;if(!spend(chCost(l,o)))return;if(sp)S.spares[o]--;(l.ch=l.ch||[]).push(o);floater((CITY[l.a].x+CITY[l.b].x)/2,(CITY[l.a].y+CITY[l.b].y)/2-20,`+${O.n}`,'#FF4F9A');after();},
|
||||
rmCh:({id,o})=>{const l=S.links.find(x=>x.id===id);if(!l||!OPT[o]||l.kind==='xp')return;const i=(l.ch||[]).lastIndexOf(o);if(i<0)return;l.ch.splice(i,1);S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)+1;floater((CITY[l.a].x+CITY[l.b].x)/2,(CITY[l.a].y+CITY[l.b].y)/2-20,tr('fiber_and_hardware.optic_to_spares',{optic:OPT[o].n}),'#7B61FF');after();},
|
||||
hwLock:()=>{if(hwLock())return;const c=hwLockCost();if(!spend(c))return;S.hw=S.hw||{};S.hw.lock={until:S.day+HW_LOCK_DAYS,mul:hwTrend(S.day)};toast(tr('fiber_and_hardware.prices_locked_until_date_your_vendor',{date:dateStr(S.hw.lock.until)}),'good');after();},
|
||||
|
|
|
|||
|
|
@ -14,9 +14,11 @@ Object.assign(ACT,{
|
|||
// (quoteNear), or nothing left to do is shown again, not built.
|
||||
bstdApply:({quote,q}={})=>{if(!S||pzOn()||!S.popStd)return;const J=bstdPlan(false);
|
||||
if((quote!==undefined||q!==undefined)&&(!J.length||(quote!==undefined&&String(quote)!==bstdPlanKey(J))||(q!==undefined&&!quoteNear(+q,bstdSum(J))))){bstdModal(tr('utilities.quote_changed'));sfx('err');return;}
|
||||
if(!J.length)return;const c0=S.cash;let n=0;
|
||||
opsQuiet(()=>{n=bstdDo(J,j=>{const c=bstdPrice(j);return c<=0||S.cash>=c;},j=>!!j.go()).length;});
|
||||
if(!J.length)return;const c0=S.cash;let n=0,later=0;
|
||||
// An IPv6-only swap pays as its routers go in: what the swaps under way still owe (one this click started too) stays
|
||||
// in hand, so every job, a swap or not, needs its price on top of that. The toast counts a swap whole, as the quote did.
|
||||
opsQuiet(()=>{const did=bstdDo(J,j=>{const c=bstdPrice(j);return c<=0||S.cash-ip6Owed()>=c;},j=>!!j.go());n=did.length;for(const j of did)if(j.later)later+=j.cost;});
|
||||
after();const z=bstdQuote(false),left=z.pops+z.ports+z.links;
|
||||
toast((n?trn('bstd.applied',n,{cost:fmt$(c0-S.cash)}):tr('bstd.applied_none'))+(left?' '+trn('bstd.left',left):''),n?'good':'bad');sfx(n?'build':'err');
|
||||
toast((n?trn('bstd.applied',n,{cost:fmt$(c0-S.cash+later)}):tr('bstd.applied_none'))+(left?' '+trn('bstd.left',left):''),n?'good':'bad');sfx(n?'build':'err');
|
||||
if(bstdShown())bstdModal();},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ const SPARE_RESALE=0.4,spareN=o=>(S&&S.spares&&S.spares[o])|0,spareValue=o=>Math
|
|||
// A fiber given up (a cancelled IRU, a cable called off, a decommissioned POP) keeps its optics: they go on the shelf too (#229).
|
||||
const chBack=links=>{let n=0;for(const l of links)for(const o of (l&&l.ch)||[])if(OPT[o]){S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)+1;n++;}return n;};
|
||||
function chCost(l,o){const r=REGEN_CH*(l.regen|0);return Math.round(optCost(o)*(spareN(o)>0?r:1+r));}
|
||||
// One more regen site on fiber l: the hut, and a regen card for every channel in its glass, the expresses riding it too.
|
||||
function regenAddCost(l){let o=(l.ch||[]).reduce((a,c)=>a+optCost(c),0);for(const x of xpOver(l.id))for(const c of x.ch||[])o+=optCost(c);return REGEN_COST+Math.round(o*REGEN_CH);}
|
||||
function optCost(o){return Math.round(OPT[o].cost*techMul(OPT[o].lvl)*hwMul('opt')*(S&&S.ev&&S.ev.tariff>S.day?1.4:1));}
|
||||
// Line systems upgrade in place: Rainbow → ROADMaster → C+L. Every lit pair gets the new gear.
|
||||
const sysNext=l=>l.sys==='lite'?'roadm':l.sys==='roadm'?'cl':null,sysUpCost=l=>{const t=sysNext(l);return t?sysCost(t)*(t==='cl'&&l.own?Math.max(1,l.pairs|0):1):0;};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Object.assign(ACT,{
|
|||
slotMenu:({id})=>{const h=slotMenuHtml(id);if(h)openModal(h);},
|
||||
slotExport:({id})=>exportSlot(id),
|
||||
slotDel:({id,back})=>{const e=slotIdx().find(x=>x.id===id);if(!e)return;
|
||||
openModal(`<h2 style="font-size:26px">${tr('slots.delete_name',{name:esc(e.name||tr('common.unnamed_network'))})}</h2><p class="tagline">${tr('game_and_settings.name_and_everything_it_owns_will',{name:esc(e.name||tr('common.unnamed_network'))})}</p>${slotBusy(id)?`<p class="note" style="color:var(--bad)">${tr('slots.it_is_open_in_another_window')}</p>`:''}<div class="btns">${btn(tr('slots.delete_forever'),'slotDelGo',{id,back},'red big')}${btn(tr('slots.keep_it'),back==='space'?'slotSpace':'slotBack',{},'ghost big')}</div>`);},
|
||||
openModal(`<h2 style="font-size:26px">${tr('slots.delete_name',{name:esc(e.name||tr('common.unnamed_network'))})}</h2><p class="tagline">${tr('game_and_settings.name_and_everything_it_owns_will',{name:esc(e.name||tr('common.unnamed_network'))})}</p>${slotBusy(id)?`<p class="note" style="color:var(--tx-red,var(--bad))">${tr('slots.it_is_open_in_another_window')}</p>`:''}<div class="btns">${btn(tr('slots.delete_forever'),'slotDelGo',{id,back},'red big')}${btn(tr('slots.keep_it'),back==='space'?'slotSpace':'slotBack',{},'ghost big')}</div>`);},
|
||||
slotDelGo:({id,back})=>{if(!slotIdx().some(e=>e.id===id))return;
|
||||
if(id===UI.slot){ACT.newgame();return;}
|
||||
slotDrop(id);try{BC&&BC.postMessage({t:'gone',id});}catch(e){}sfx('click');
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ function renderHUD(){
|
|||
if(pzOn()){$('hName').textContent=pzName(pzDef(S.pz.id)||S.pz);$('hAsn').textContent=tr('puzzles.puzzle');renderTabbar();return;}
|
||||
{const rt=ruleTag(),ha=$('hAsn');ha.title=rt?tr('rules.rules_are_locked_for_this_network',{rules:rt}):'';}
|
||||
$('hName').textContent=S.name;$('hAsn').textContent='AS'+S.asn+(S.mode==='sandbox'||ruleTag()&&!S.scn?' · '+ruleTag():S.scn?' · '+(scnName())+(S.scn.done||S.scn.failed?'':` · ${tr('ui.n_d_left',{n:Math.max(0,S.scn.days-S.day)})}`):'');
|
||||
$('hCash').textContent=fmt$(S.cash);$('hCash').style.color=S.cash<0?'var(--bad)':'';
|
||||
$('hCash').textContent=fmt$(S.cash);$('hCash').style.color=S.cash<0?'var(--tx-red,var(--bad))':'';
|
||||
const net=R.revMo-R.costMo;$('hRate').innerHTML=`<span class="${net>=0?'up':'down'}">${net>=0?'▲':'▼'} ${tr('common.price_mo',{price:fmt$(Math.abs(net))})}</span>`;
|
||||
$('hTraffic').textContent=`${fmtG(R.served)}`;
|
||||
$('hTrafBar').style.width=(R.demand?R.served/R.demand*100:0)+'%';
|
||||
$('hTrafBar').style.background=R.demand&&R.served/R.demand<0.9?'var(--bad)':'var(--ok)';
|
||||
$('hReach').textContent=reachPct(R.reach);$('hReach').style.color=R.reach<0.99?'var(--bad)':'var(--eye)';
|
||||
$('hReach').textContent=reachPct(R.reach);$('hReach').style.color=R.reach<0.99?'var(--tx-red,var(--bad))':'var(--eye)';
|
||||
$('hTier').textContent=tierLabel()+' · '+tr('hud_and_panels.lv_n',{n:S.lvl||1});
|
||||
{const P=scnProg(),hs=$('hScn');hs.hidden=!P;if(P){const sc=S.scn;$('hScnVal').textContent=sc.done?tr('common.done'):sc.failed?tr('common.time_s_up'):`${Math.round(P.f*100)}% · ${tr('ui.n_d_left',{n:Math.max(0,sc.days-S.day)})}`;}}
|
||||
$('hDate').textContent=dateStr(S.day);
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@ function cityPanel(c){
|
|||
h+=`<nav class="tabs">${tabs.map(([k,l])=>`<button class="${UI.tab===k?'on':''}" data-act="tab" data-args='{"t":"${k}"}'>${l}</button>`).join('')}</nav><div class="scroll">`;
|
||||
if(C.cn&&UI.tab==='cust')h+=chinaSection(c);
|
||||
const sf=sfOf(R,c),dem=R.cityDem[c]||0;
|
||||
if(down){const i=S.inc.filter(x=>x.ref===c&&POPDOWN.includes(x.type)).sort((a,b)=>b.until-a.until)[0];h+=`<section><h3 style="color:var(--bad)">${tr('city_panel.this_pop_is_down')}</h3><p class="lead">${i?esc(i.msg):''} ${tr('city_panel.customers_here_get_nothing_until_it')}</p>${i&&i.cost?btn(`${esc(i.fix||tr('common.rush_repair'))} ${fmt$(i.cost)}`,'fixInc',{id:i.id},'red'):''}</section>`;}
|
||||
if(down){const i=S.inc.filter(x=>x.ref===c&&POPDOWN.includes(x.type)).sort((a,b)=>b.until-a.until)[0];h+=`<section><h3 style="color:var(--tx-red,var(--bad))">${tr('city_panel.this_pop_is_down')}</h3><p class="lead">${i?esc(i.msg):''} ${tr('city_panel.customers_here_get_nothing_until_it')}</p>${i&&i.cost?btn(`${esc(i.fix||tr('common.rush_repair'))} ${fmt$(i.cost)}`,'fixInc',{id:i.id},'red'):''}</section>`;}
|
||||
if(UI.tab==='cust'){
|
||||
{const nl=R.nodeLoad[c]||0,nc=R.nodeCap[c]||1;if(nl>=nc*0.95)h+=`<section><h3 style="color:var(--bad)">${tr('city_panel.router_maxed_out')}</h3><p class="lead">${tr('city_panel.your_routers_here_are_forwarding',{load:fmtG(nl),cap:fmtG(nc)})}</p>${btn(tr('common.open_infra'),'tab',{t:'links'},'pink sm')}</section>`;}
|
||||
{const nl=R.nodeLoad[c]||0,nc=R.nodeCap[c]||1;if(nl>=nc*0.95)h+=`<section><h3 style="color:var(--tx-red,var(--bad))">${tr('city_panel.router_maxed_out')}</h3><p class="lead">${tr('city_panel.your_routers_here_are_forwarding',{load:fmtG(nl),cap:fmtG(nc)})}</p>${btn(tr('common.open_infra'),'tab',{t:'links'},'pink sm')}</section>`;}
|
||||
h+=`<section><h3>${tr('common.home_broadband')}</h3>`;
|
||||
if(!p.bb){const s=bbStart(c);h+=`<p class="lead">${tr('city_panel.sell_internet_to_homes_here_starts',{start:fmtG(s),max:fmtG(eyeP(c)),rate:fmt$(EYE_RATE*arpuOf(c))})}${C.au?` ${scnRule('levy')?tr('city_panel.it_runs_on_your_own_fibre',{pct:pct(AU_LEVY)}):tr('city_panel.the_nearly_broadband_network_keeps',{pct:pct(AU_WHOLESALE)})}`:''}</p>${btn(tr('city_panel.launch_broadband_cost',{cost:fmt$(bbCost(c))}),'launchBB',{city:c},'pink big',S.cash<bbCost(c))}`;}
|
||||
else{const eye=R.cityEye[c]||0;
|
||||
h+=`<div class="kv"><span>${tr('common.eyeball_demand')}</span><b>${tr('city_panel.a_of_b',{a:fmtG(eye),b:fmtG(eyeP(c))})}</b></div><div class="bar me"><i style="width:${Math.min(100,eye/eyeP(c)*100)}%"></i></div>
|
||||
<div class="kv"><span>${tr('city_panel.served_in_city',{city:C.name})}</span><b style="color:${sf<0.9?'var(--bad)':'var(--eye)'}">${pct(sf)}</b></div><div class="bar ${sf<0.9?'bad':''}"><i style="width:${sf*100}%"></i></div>
|
||||
<div class="kv"><span>${tr('city_panel.served_in_city',{city:C.name})}</span><b style="color:${sf<0.9?'var(--tx-red,var(--bad))':'var(--eye)'}">${pct(sf)}</b></div><div class="bar ${sf<0.9?'bad':''}"><i style="width:${sf*100}%"></i></div>
|
||||
<div class="kv"><span>${tr('common.revenue')}</span><b>${tr('common.price_mo',{price:fmt$(eye*sf*EYE_RATE*arpuOf(c))})}</b></div>
|
||||
<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>`:''}
|
||||
|
|
@ -37,7 +37,7 @@ function cityPanel(c){
|
|||
h+=`</section><section><h3>${tr('common.business_customers')}</h3>`;
|
||||
const bz=S.biz.filter(b=>bCities(b).includes(c));
|
||||
if(!bz.length)h+=`<p class="empty">${tr('city_panel.no_businesses_yet_offers_pop_up')}</p>`;
|
||||
for(const b of bz)h+=`<div class="row"><div class="grow"><div class="nm">${esc(b.name)}</div><div class="meta">${esc(BIZ_T[b.type].l)}${b.city2?` ${CITY[b.city].name} ⇄ ${CITY[b.city2].name}`:''} · ${bTerms(b)}${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(--bad)">'+tr('city_panel.fiber_is_down')+'</b>':''}${BIZ_T[b.type].event&&eventLive(b)?` · <b>${tr('city_panel.serving_v',{v:pct(sfOf(R,b.city))})}</b>`:''}${b.type==='scrub'&&!hasScrub()?' · <b style="color:var(--bad)">'+tr('common.needs_a_scrubbing_center')+'</b>':''}${S.day-(b.since||0)<15?` · <b>${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}</b>`:''}</div>${bRisk(b)}${reqList(b)}${BIZ_T[b.type].l2?routeCtl(b):''}${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>`;
|
||||
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>`;
|
||||
h+=`</section>`+offersHere(c);
|
||||
}else if(UI.tab==='up'){
|
||||
h+=portNote(c)+latNote(c);
|
||||
|
|
@ -47,7 +47,7 @@ function cityPanel(c){
|
|||
for(const n of prov){const t=S.transit.find(x=>x.city===c&&x.net===n.id);const pr=transitPerG(n,c,premOnlyAt(n,c)||!!(t&&premOn(t)))*S.priceMul;
|
||||
h+=`<div class="row">${logo(n)}<div class="grow"><div class="nm">${esc(n.name)} <span class="tag ${n.type}">${TYPE_L[n.type]}</span></div><div class="meta">${tr('city_panel.price_per_gbps_month_billed_on',{price:pr.toFixed(2)})}</div>${premOnlyAt(n,c)&&!t?`<div class="meta">${tr('city_panel.only_the_cn_too_premium_crossing')}</div>`:''}`;
|
||||
if(t){const u=R.useT[t.id]||0,cap=lagCap(PORT[t.tier].g,t.n),tdown=t.down>S.day;
|
||||
h+=`<div class="kv"><span>${lagName(t.tier,t.n)}${tdown?' · <b style="color:var(--bad)">'+tr('common.outage')+'</b>':''}</span><b>${fmtG(u)}</b></div><div class="bar ${barCls(u/cap)}"><i style="width:${u/cap*100}%"></i></div>${prefCtl('t',t.id,t.pref)}${carryCtl(t)}${siteCtl('t',t.id,c,t.site)}${premOnlyAt(n,c)?`<p class="note">${tr('city_panel.only_the_cn_too_premium_crossing')}</p>`:premCity(n,c)?`<div class="btns">${btn(t.premium?tr('city_panel.cn_too_premium_on'):tr('city_panel.switch_to_cn_too_premium_x',{x:n.premium}),'togglePrem',{id:t.id},t.premium?'green sm':'sm')}</div>`:''}${(()=>{const top=transitTop([t.id],4);return top.length?`<div class="ttop"><div class="meta"><b>${tr('city_panel.top_destinations_on_this_port')}</b></div>${top.map(([id,v])=>`<div class="meta">${esc(NET[id].name)} · ${fmtG(v)} · <i>${esc(offTransitHint(id,c))}</i></div>`).join('')}</div>`:'';})()}<div class="meta">${tr('city_panel.95th_pct_p95_commit_commit_bill',{p95:fmtG(R.p95[t.id]||0),commit:fmtG(cap*.2),bill:fmt$(Math.max(R.p95[t.id]||0,PORT[t.tier].g*(t.n||1)*.2)*pr+PORT[t.tier].tmo*(t.n||1))})}</div>
|
||||
h+=`<div class="kv"><span>${lagName(t.tier,t.n)}${tdown?' · <b style="color:var(--tx-red,var(--bad))">'+tr('common.outage')+'</b>':''}</span><b>${fmtG(u)}</b></div><div class="bar ${barCls(u/cap)}"><i style="width:${u/cap*100}%"></i></div>${prefCtl('t',t.id,t.pref)}${carryCtl(t)}${siteCtl('t',t.id,c,t.site)}${premOnlyAt(n,c)?`<p class="note">${tr('city_panel.only_the_cn_too_premium_crossing')}</p>`:premCity(n,c)?`<div class="btns">${btn(t.premium?tr('city_panel.cn_too_premium_on'):tr('city_panel.switch_to_cn_too_premium_x',{x:n.premium}),'togglePrem',{id:t.id},t.premium?'green sm':'sm')}</div>`:''}${(()=>{const top=transitTop([t.id],4);return top.length?`<div class="ttop"><div class="meta"><b>${tr('city_panel.top_destinations_on_this_port')}</b></div>${top.map(([id,v])=>`<div class="meta">${esc(NET[id].name)} · ${fmtG(v)} · <i>${esc(offTransitHint(id,c))}</i></div>`).join('')}</div>`:'';})()}<div class="meta">${tr('city_panel.95th_pct_p95_commit_commit_bill',{p95:fmtG(R.p95[t.id]||0),commit:fmtG(cap*.2),bill:fmt$(Math.max(R.p95[t.id]||0,PORT[t.tier].g*(t.n||1)*.2)*pr+PORT[t.tier].tmo*(t.n||1))})}</div>
|
||||
<div class="btns">${PORT.map((P2,i)=>i>t.tier&&portShown(i)?btn((t.n||1)>1?tr('common.upgrade_all_to_port_cost_mo',{port:P2.n,cost:fmt$(P2.setup*(t.n||1)),mo:fmt$(P2.tmo*(t.n||1))}):tr('common.upgrade_port_cost_mo_mo',{port:P2.n,cost:fmt$(P2.setup*(t.n||1)),mo:fmt$(P2.tmo*(t.n||1))}),'buyTransit',{city:c,net:n.id,tier:i},'sm',S.cash<P2.setup*(t.n||1)||!portOk(c,i)):'').join('')}${t.tier>0?btn(tr('link_panels.downgrade_port_price',{port:PORT[t.tier-1].n,price:portMo(PORT[t.tier-1].tmo*(t.n||1))}),'downT',{id:t.id},'ghost sm'):''}${(t.n||1)<LAG_MAX?btn(tr('common.lag_member_cost_mo_mo',{cost:fmt$(PORT[t.tier].setup),mo:fmt$(PORT[t.tier].tmo)}),'lagT',{id:t.id,d:1},'sm',S.cash<PORT[t.tier].setup||!portOk(c,t.tier)):''}${(t.n||1)>1?btn(tr('common.member'),'lagT',{id:t.id,d:-1},'ghost sm'):''}${btn(t.clean?tr('city_panel.clean_pipe_on'):tr('city_panel.clean_pipe_mo_mo_scrubs_ddos',{mo:fmt$(cleanMo(t))}),'cleanPipe',{id:t.id},t.clean?'green sm':'sm')}${btn(UI.confirm===t.id?tr('common.really_cancel'):tr('common.cancel'),'cancelTransit',{id:t.id},'ghost sm')}</div>`;}
|
||||
else h+=`<div class="btns">${PORT.map((P2,i)=>portShown(i)?btn(tr('city_panel.port_cost_mo_mo',{port:P2.n,cost:fmt$(P2.setup),mo:fmt$(P2.tmo)}),'buyTransit',{city:c,net:n.id,tier:i},'sm',S.cash<P2.setup||!portOk(c,i)):'').join('')}</div>`;
|
||||
h+=`</div></div>`;}
|
||||
|
|
@ -69,7 +69,7 @@ function cityPanel(c){
|
|||
h+=`<section><h3>${tr('common.routers')}</h3><p class="lead">${tr('city_panel.the_model_sets_your_fastest')}</p>
|
||||
<div class="row"><span class="logo" style="--c:${G.badge?'#2C7A7B':'#FF4F9A'}">${G.badge||'R'+(G.cls+1)}</span><div class="grow"><div class="nm">${rt} × ${esc(G.n)}</div><div class="meta">${tr('city_panel.up_to_pn_interfaces_ports_ports',{pn:G.pn,ports:G.ports,cap:fmtG(G.cap)})} · ${esc(G.blurb)}</div><div class="meta">${coreMeta(g)}</div>${coreOn()&&coreRun()>0&&!inCore(c)?`<div class="why">${tr('core.this_router_can_t_run_your',{lv:tr(CORE_LV[coreRun()])})}</div>`:''}</div></div>
|
||||
<div class="kv"><span>${tr('common.router_ports')}</span><b>${tr('city_panel.used_max_in_use',{used:fmtPorts(pu),max:pm})}</b></div><div class="bar ${barCls(pu/pm)}"><i style="width:${Math.min(100,pu/pm*100)}%"></i></div>${pu>=pm?`<p class="why">${tr('city_panel.every_port_is_taken_add_a')}</p>`:''}
|
||||
<div class="kv"><span>${tr('common.forwarding_chip')}</span><b>${esc(G.chip)}</b></div><div class="kv"><span>${tr('common.boot_time')}</span><b>${slowBoot(c)?`<span style="color:var(--bad)">${tr('city_panel.n_min_a_slow_one',{n:bootMin(c)})}</span>`:tr('city_panel.n_min',{n:bootMin(c)})}</b></div>${slowBoot(c)?`<p class="note">${tr('city_panel.this_chassis_takes_forever_to_boot')}</p>`:''}
|
||||
<div class="kv"><span>${tr('common.forwarding_chip')}</span><b>${esc(G.chip)}</b></div><div class="kv"><span>${tr('common.boot_time')}</span><b>${slowBoot(c)?`<span style="color:var(--tx-red,var(--bad))">${tr('city_panel.n_min_a_slow_one',{n:bootMin(c)})}</span>`:tr('city_panel.n_min',{n:bootMin(c)})}</b></div>${slowBoot(c)?`<p class="note">${tr('city_panel.this_chassis_takes_forever_to_boot')}</p>`:''}
|
||||
${(()=>{const fc=G.fsN||0,u=(R.fsUse&&R.fsUse[c])?R.fsUse[c].used:0;return `<div class="kv"><span>${tr('ddos.fs_rules')}</span><b>${fc?tr('ddos.fs_used',{used:u,cap:fc}):tr('ddos.fs_no_tcam')}</b></div>${fc?`<div class="bar ${barCls(u/fc)}"><i style="width:${Math.min(100,u/fc*100)}%"></i></div>`:''}`;})()}
|
||||
<div class="kv"><span>${tr('common.forwarding_load')}</span><b>${fmtG(nl)} / ${fmtG(nc)}</b></div><div class="bar ${barCls(nl/nc)}"><i style="width:${Math.min(100,nl/nc*100)}%"></i></div>
|
||||
${nl>=nc*0.95?`<p class="why">${tr('city_panel.maxed_out_traffic_here_is_being')}</p>`:''}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ function bstdVal(k,v){if(v===BSTDK[k].d&&k!=='rt')return tr('bstd.keep');
|
|||
switch(k){case 'g':return RG[v].n+(rgOpen(v)?'':' '+tr('bstd.from_level',{lv:RG[v].lvl}));
|
||||
case 'rt':return v>1?tr('bstd.at_least_n',{n:v}):tr('bstd.keep');
|
||||
case 'site2':case 'gen':return tr('bstd.at_every_pop');
|
||||
case 'v6':return tr('bstd.every_bb_city');
|
||||
case 'lag':return tr('bstd.at_least_n',{n:v});
|
||||
case 'split':return tr('bstd.both_buildings');
|
||||
case 'ix':return tr('bstd.every_exchange');
|
||||
|
|
@ -21,17 +22,17 @@ const bstdShown=()=>!!$('modal')&&!$('modal').hidden&&!!$('modalCard').querySele
|
|||
function bstdModal(msg){if(!S||pzOn())return;const D=bstd(),q=bstdQuote(false),hired=opsHired(),on=hired&&S.ops.on.std;
|
||||
let h=`<div data-sheet="bstd" style="display:flex;align-items:center"><div><div class="eyebrow">${tr('ops.ops')}</div><h2 style="font-size:26px">${tr('bstd.title')}</h2></div><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div>
|
||||
<p class="tagline">${tr('bstd.tagline')}</p>${typeof msg==='string'&&msg?`<p class="why">${esc(msg)}</p>`:''}`;
|
||||
for(const [g,lab] of BSTD_GRP)h+=`<section><h3>${tr(lab)}</h3><div class="ops-p">${BSTD.filter(x=>x.grp===g).map(x=>opsSel(tr(x.l),'bstdSet',{k:x.k},bstdOpts(x.k),D[x.k],v=>bstdVal(x.k,v))).join('')}</div>
|
||||
<p class="note">${g==='pop'?tr('bstd.new_pops_note'):g==='port'?tr('bstd.port_note'):tr('bstd.fiber_note_two')}</p></section>`;
|
||||
for(const [g,lab] of BSTD_GRP)h+=`<section><h3>${tr(lab)}</h3><div class="ops-p">${BSTD.filter(x=>x.grp===g&&bstdOn(x)).map(x=>opsSel(tr(x.l),'bstdSet',{k:x.k},bstdOpts(x.k),D[x.k],v=>bstdVal(x.k,v))).join('')}</div>
|
||||
<p class="note">${g==='pop'?tr('bstd.new_pops_note')+(bstdOn(BSTDK.v6)?' '+tr('bstd.v6_note'):''):g==='port'?tr('bstd.port_note'):tr('bstd.fiber_note_two')}</p></section>`;
|
||||
// What is below it today, and what bringing it all up costs: a quote, nothing changes until the button. A fiber whose
|
||||
// line system has to wait is below it too, but not on the bill.
|
||||
const n={pop:q.pops,port:q.ports,fiber:q.links},w=q.held.length;
|
||||
h+=`<section><h3>${tr('bstd.below')}</h3>${q.n||w?BSTD_GRP.map(([g,lab])=>`<div class="kv"><span>${tr(lab)}</span><b>${n[g]}</b></div>`).join('')
|
||||
+`<div class="kv"><span>${tr('bstd.cost_now')}</span><b>${fmt$(q.cost)}</b></div><div class="kv"><span>${tr('bstd.cost_mo')}</span><b>${tr('common.price_mo',{price:opsMo$(q.mo)})}</b></div>`
|
||||
+(w?`<p class="meta">${trn('bstd.held',w)}</p>`:'')
|
||||
+(q.wait.length?`<p class="meta">${trn('bstd.held',q.wait.length)}</p>`:'')+(q.wv.length?`<p class="meta">${trn('bstd.held_wave',q.wv.length)}</p>`:'')
|
||||
:`<p class="meta">${S.popStd?tr('bstd.all_up'):tr('bstd.none_set')}</p>`}</section>`;
|
||||
// The intern keeps it there: the order's switch and budget, or a word on hiring one.
|
||||
h+=`<section><h3>${tr('ops.o_std')}</h3>${hired?`<div class="ops-o${on?' on':''}"><div class="ops-h"><span class="ops-i" aria-hidden="true">${INTERNS[S.ops.intern].i}</span><div class="grow"><div class="nm">${esc(tr('bstd.intern_keeps',{name:opsName()}))}</div><div class="meta">${tr('ops.o_std_around_d')}</div></div>
|
||||
h+=`<section><h3>${tr('ops.o_std')}</h3>${hired?`<div class="ops-o${on?' on':''}"><div class="ops-h"><span class="ops-i" aria-hidden="true">${INTERNS[S.ops.intern].i}</span><div class="grow"><div class="nm">${esc(tr('bstd.intern_keeps',{name:opsName()}))}</div><div class="meta">${tr('ops.o_std_wave_d')}</div></div>
|
||||
<button class="b sm ${on?'green':'ghost'}" data-act="opsToggle" data-args='{"k":"std"}' aria-pressed="${on}" aria-label="${esc(tr('ops.o_std'))}">${on?tr('common.on'):tr('ops.paused')}</button></div>
|
||||
${on?`<div class="ops-p">${opsSel(tr('ops.budget'),'opsCap',{k:'std'},opsCaps('std'),opsCap('std'),v=>opsCapName('std',v))}</div>`:''}</div>`
|
||||
:`<p class="meta">${tr('bstd.hire_note')}</p><div class="btns">${btn(tr('ops.hire_an_intern'),'opsOpen',{},'ghost sm',!opsCanHire()||!rule('clock'))}</div>`}</section>`;
|
||||
|
|
|
|||
|
|
@ -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(--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>`:''}`:''}
|
||||
${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));
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ function ixBlock(c,multi){const city=ixCity(c),C=CITY[city],ix=ixName(c),X=XIXM[
|
|||
else if(!ix){h+=`<p class="lead">${tr('link_panels.there_s_no_ix_in_city',{city:C.name})}</p>${S.pops[city]?btn(tr('link_panels.found_your_own_ix_cost_mo',{cost:fmt$(MYIX_COST),mo:fmt$(MYIX_MO)}),'foundIx',{city:c},'pink',S.cash<MYIX_COST):'<p class="note">'+tr('link_panels.build_a_pop_here_first')+'</p>'}`;}
|
||||
else if(S.ixp[c]===undefined){h+=`<p class="lead">${tr('link_panels.ix_is_a_shared_switch_one',{ix:esc(ix),list:(()=>{const m=ixMembers(c),big=m.filter(id=>!NET[id].tail),t=m.length-big.length;return (big.map(id=>esc(NET[id].name)).join(', ')||tr('common.nobody_yet'))+(t?trn('link_panels.plus_n_small_network',t):'');})()})}</p>${S.pops[city]?'':REMOTE_WARN}${X?`<p class="note">${esc(X.blurb)} ${X.freeTo!==undefined?tr('link_panels.ports_up_to_port_are_free',{port:PORT[X.freeTo].n}):tr('link_panels.ports_at_p_of_the_usual',{p:Math.round(ixMul(c)*100)})}</p>`:''}${CITY[city].ixCheap?`<p class="note">${tr('link_panels.run_by_a_nonprofit_public_prices')}</p>`:''}${isDk(c)?`<p class="note">${tr('link_panels.run_by_de_kicks_group_no')}</p>`:''}<div class="btns">${PORT.map((P2,i)=>btn(isDk(c)?tr('link_panels.port_port_price_on_request',{port:P2.n}):tr('link_panels.port_port_price',{port:P2.n,price:portMo(ixPortMo(c,i))}),'buyIx',{city:c,tier:i},'',(!isDk(c)&&S.cash<ixPortMo(c,i))||(!!S.pops[city]&&!portOk(city,i))||(!S.pops[city]&&i>1))).join('')}</div>`;}
|
||||
else{const mine=!!S.myIx[c],u=R.useIx[c]||0,cap=ixCap(c),set=ixSessions(c),xdown=S.ev.ixdown&&S.ev.ixdown[c]>S.day;
|
||||
h+=`<div class="kv"><span>${mine?tr('link_panels.your_own_fabric_name',{name:myFab(c).n}):lagName(S.ixp[c],(S.ixn||{})[c])}${xdown?' · <b style="color:var(--bad)">FABRIC DOWN</b>':''}</span><b>${fmtG(u)}</b></div><div class="bar ${barCls(u/cap)}"><i style="width:${u/cap*100}%"></i></div>${prefCtl('ix',c,S.ixPref&&S.ixPref[c])}${S.pops[city]?siteCtl('ix',c,city,(S.ixSite||{})[c]):''}`;
|
||||
h+=`<div class="kv"><span>${mine?tr('link_panels.your_own_fabric_name',{name:myFab(c).n}):lagName(S.ixp[c],(S.ixn||{})[c])}${xdown?' · <b style="color:var(--tx-red,var(--bad))">FABRIC DOWN</b>':''}</span><b>${fmtG(u)}</b></div><div class="bar ${barCls(u/cap)}"><i style="width:${u/cap*100}%"></i></div>${prefCtl('ix',c,S.ixPref&&S.ixPref[c])}${S.pops[city]?siteCtl('ix',c,city,(S.ixSite||{})[c]):''}`;
|
||||
if(isDk(c)&&S.dk){const ad=S.dk.add[c]||[],rt=S.dk.ret[c];h+=`<p class="note">${rt&&rt>S.day?tr('link_panels.de_kicks_personalised_pricing_p_of',{p:Math.round(dkMult(c)*100),n:rt-S.day}):tr('link_panels.de_kicks_personalised_pricing_p_of_3d4f',{p:Math.round(dkMult(c)*100)})}</p>`;
|
||||
for(const x of ad)h+=`<div class="row"><div class="grow"><div class="nm">${esc(x.n)} <span class="tag paid">${tr('common.auto_enrolled')}</span></div><div class="meta">${esc(x.blurb)} · ${tr('common.price_mo',{price:fmt$(x.mo)})}</div></div>${btn(UI.confirm==='dk'+c+x.n?tr('link_panels.lose_exclusive_benefits'):tr('common.opt_out'),'dkOptOut',{city:c,n:x.n},'ghost sm')}</div>`;}
|
||||
if(isRemote(c))h+=`<p class="note">${trn('link_panels.remote_port_via_a_reseller_1',ixMembers(c).filter(noRemote).length)}</p>`;
|
||||
|
|
@ -25,7 +25,7 @@ function ixBlock(c,multi){const city=ixCity(c),C=CITY[city],ix=ixName(c),X=XIXM[
|
|||
function vxcPanel(l){
|
||||
const load=R.load[l.id]||0,cap=VXC[l.vt].g,u=load/cap,down=linkDown(l),f=FAB[l.prov];
|
||||
let h=`<div class="ph"><div><div class="eyebrow">${tr('link_panels.virtual_circuit_name_km_km',{name:esc(f.name),km:l.km.toLocaleString()})}</div><h2>${CITY[l.a].name} ⇄ ${CITY[l.b].name}</h2></div><button class="x" data-act="closePanel" aria-label="${tr('common.close')}">×</button></div><div class="scroll">`;
|
||||
if(down)h+=`<section><h3 style="color:var(--bad)">${tr('common.fabric_outage')}</h3><p class="lead">${tr('link_panels.name_is_down_nothing_you_can',{name:esc(f.name)})}</p></section>`;
|
||||
if(down)h+=`<section><h3 style="color:var(--tx-red,var(--bad))">${tr('common.fabric_outage')}</h3><p class="lead">${tr('link_panels.name_is_down_nothing_you_can',{name:esc(f.name)})}</p></section>`;
|
||||
h+=`<section><h3>${tr('common.capacity')}</h3><div class="kv"><span>${tr('link_panels.name_circuit',{name:VXC[l.vt].n})}</span><b>${fmtG(load)} / ${fmtG(cap)}</b></div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div>
|
||||
<div class="kv"><span>${tr('common.monthly')}</span><b>${tr('common.price_mo',{price:fmt$(l.mo)})}</b></div>${!S.pops[l.b]?`<p class="note">${tr('link_panels.remote_peering_leg_into_ix',{ix:esc(CITY[l.b].ix)})}</p>`:''}
|
||||
<div class="btns">${VXC.map((V,t)=>t>l.vt?btn(`${V.n} <small>${tr('common.price_mo',{price:fmt$(vxcMo(l.km,l.sub,t))})}</small>`,'upVxc',{id:l.id,t},'sm'):'').join('')}</div></section>
|
||||
|
|
@ -93,7 +93,7 @@ function chinaSection(c){const st=S.cnLic?S.cnLic.state:'none',loss=S.ev.gfw>S.d
|
|||
if(st==='none')h+=`<p class="lead">${tr('link_panels.foreign_networks_need_a_local_joint')}</p>${btn(tr('link_panels.apply_for_a_license_price_mo_n_days',{price:fmt$(CN_LIC),mo:fmt$(CN_JV_MO),n:leadDays(45)}),'applyCn',{},'pink',S.cash<CN_LIC)}`;
|
||||
else if(st==='pending')h+=`<p class="note">${tr('link_panels.license_paperwork_in_progress_n_days',{n:Math.max(0,S.cnLic.ready-S.day)})}</p>`;
|
||||
else h+=`<p class="note">${tr('link_panels.your_joint_venture_holds_an')}</p>`;
|
||||
if(R.gfwCross>0.5)h+=`<div class="kv"><span>${tr('link_panels.your_traffic_crossing_the_border')}</span><b>${fmtG(R.gfwCross)}</b></div><div class="kv"><span>${tr('link_panels.lost_on_the_way')}</span><b style="color:var(--bad)">${fmtG(R.gfwLost)}</b></div>`;
|
||||
if(R.gfwCross>0.5)h+=`<div class="kv"><span>${tr('link_panels.your_traffic_crossing_the_border')}</span><b>${fmtG(R.gfwCross)}</b></div><div class="kv"><span>${tr('link_panels.lost_on_the_way')}</span><b style="color:var(--tx-red,var(--bad))">${fmtG(R.gfwLost)}</b></div>`;
|
||||
return h+`</section>`;}
|
||||
function subUpgradePanel(l){return `<h4 class="sub4">${tr('common.submarine_transmission')}</h4><p class="note">${tr('common.better_terminals_and_optical_tuning')}</p>`+Object.entries(SUB_UPGRADES).map(([k,U])=>{
|
||||
const at=l['sub'+k],done=subUpgradeReady(l,k),cost=subUpgradeCost(l,k),preview={...l,['sub'+k]:S.day},use=at!==undefined||subHelps(l.km,k,l['sub'+subOther(k)]!==undefined);
|
||||
|
|
@ -116,7 +116,7 @@ function dfPanel(l){
|
|||
let h=`<div class="ph"><div><div class="eyebrow">${tr('link_panels.dark_fiber_kind_km_km',{kind:l.own?tr('link_panels.your_own_build'):tr('common.leased_iru'),km:l.km.toLocaleString()})}</div><h2>${A} ⇄ ${B}</h2></div><button class="x" data-act="closePanel" aria-label="${tr('common.close')}">×</button></div><div class="scroll">`;
|
||||
if(bld){const tot=Math.max(1,l.ready-l.day),done=clamp((S.day-l.day)/tot,0,1);
|
||||
h+=`<section><h3>${l.own?tr('common.under_construction'):tr('common.being_spliced')}</h3><div class="kv"><span>${l.own?tr('link_panels.permits_trenching_splicing'):tr('common.iru_handover')}</span><b>${tr('common.n_days_left',{n:l.ready-S.day})}</b></div><div class="bar me"><i style="width:${done*100}%"></i></div>${l.own&&l.sub?layPanel(l):l.own?`<div class="btns">${btn(tr('link_panels.hire_extra_crews_price_30_days',{price:fmt$(crewCost(l))}),'crews',{id:l.id},'sm',!crewSteps(l)||S.cash<crewCost(l))}${btn(trn('link_panels.all_crews_done_in_n_days_price',Math.max(1,crewFloor(l)-S.day),{price:fmt$(crewSteps(l)*crewCost(l))}),'crews',{id:l.id,all:1},'sm',!crewSteps(l)||S.cash<crewSteps(l)*crewCost(l))}</div>${!crewSteps(l)&&l.ready>S.day+1?`<p class="note">${tr('link_panels.crews_can_halve_a_build_at_most')}</p>`:''}`:''}<p class="note">${tr('link_panels.you_can_pre_install_optics_now')}</p></section>`;}
|
||||
else if(inc&&linkDown(l))h+=`<section><h3 style="color:var(--bad)">${tr('common.dark_6bf5')}</h3><p class="lead">${esc(inc.msg)}</p>${shipNote(inc)}${inc.cost?btn(`${esc(inc.fix||tr('common.rush_repair'))} ${fmt$(inc.cost)}`,'fixInc',{id:inc.id},'red',S.cash<inc.cost):''}</section>`;
|
||||
else if(inc&&linkDown(l))h+=`<section><h3 style="color:var(--tx-red,var(--bad))">${tr('common.dark_6bf5')}</h3><p class="lead">${esc(inc.msg)}</p>${shipNote(inc)}${inc.cost?btn(`${esc(inc.fix||tr('common.rush_repair'))} ${fmt$(inc.cost)}`,'fixInc',{id:inc.id},'red',S.cash<inc.cost):''}</section>`;
|
||||
h+=`<section><h3>${tr('common.capacity')}</h3><div class="kv"><span>${tr('link_panels.n_of_max_channels_lit',{n:(l.ch||[]).length,max:chMax(l)})}${soldSlots(l)?` · ${tr('link_panels.n_sold_as_alien_waves',{n:soldSlots(l)})}`:''}${mwG(l)?` · ${tr('market.g_sold_as_managed',{g:fmtCap(mwG(l))})}`:''}${xpSlots(l)?` · ${trn('express.n_carry_expresses',xpSlots(l))}`:''}</span><b>${fmtG(load)} / ${fmtG(cap)}</b></div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div>
|
||||
${seatPanel(l)}${l.own&&l.sub?`<div class="kv"><span>${tr('common.cable_design')}</span><b>${tr((SEA_DESIGNS[l.seaDesign]||SEA_DESIGNS.standard).n)}</b></div>`:''}
|
||||
<div class="kv"><span>${tr('common.latency')}</span><b>${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}</b></div><div class="kv"><span>${l.own?tr('link_panels.right_of_way_upkeep'):tr('common.iru_lease')}</span><b>${tr('common.price_mo',{price:fmt$(l.mo)})}</b></div><div class="kv"><span>${tr('link_panels.n_amp_huts',{n:amps})}</span><b>${tr('common.price_mo',{price:fmt$(amps*AMP_MO)})}</b></div>${!bld&&!(l.ch||[]).length?`<p class="why">${tr('link_panels.this_fiber_is_dark_add_optics')}</p>`:''}</section>`;
|
||||
|
|
@ -131,7 +131,7 @@ function dfPanel(l){
|
|||
h+=`<div class="row"><div class="grow"><div class="nm">${O.n} <span class="meta">${optModes(k,l).map(([g,r])=>tr('link_panels.g_to_km_km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')}</span></div><div class="meta">${esc(O.blurb)}${n?` · <b>${tr('link_panels.n_lit',{n})}</b>`:''}${sp?` · ${trn('link_panels.n_spare_on_the_shelf',sp)}`:''}${(np=>np>1?` · ${trn('link_panels.takes_n_router_ports_per_end',np)}`:'')(Math.max(chPorts(k,l.a),chPorts(k,l.b)))}</div>${md&&!md.full?`<div class="meta">⚠️ ${tr('link_panels.runs_at_g_per_channel_on',{g:fmtG(md.g)})} ${(!l.sub||l.seat)&®enNeed(k,l)>(l.regen|0)?trn('link_panels.n_regen_site_would_bring_it',regenNeed(k,l),{g:fmtG(O.g)}):''}</div>`:''}${why?`<div class="why">${esc(why)}</div>`:''}${!techOk('opt',k,O.lvl)&&demoCan(O.lvl)?`<div class="btns">${demoBtn('opt',k,O.lvl,'','ghost sm')}</div>`:''}${opticCountControl(l,k,n)}</div>${n?btn('−','rmCh',{id:l.id,o:k},'ghost sm'):''}${btn(sp?`+ <small>${cc?tr('link_panels.spare_price',{price:fmt$(cc)}):tr('common.spare')}</small>`:`+ <small>${fmt$(cc)}</small>`,'addCh',{id:l.id,o:k},'sm',!!why||S.cash<cc)}</div>`;}
|
||||
{const st=Object.keys(OPT).filter(k=>spareN(k)>0);h+=`<p class="note">${tr('link_panels.unplugged_optics_go_on_the_spares')}</p>`;
|
||||
{const used=[...new Set(l.ch||[])].filter(k=>OPT[k]&&OPT[k].lvl<=glassLvl());if(used.length)h+=`<div class="btns">${used.map(k=>btn(tr('link_panels.stock_a_spare_optic_price',{optic:OPT[k].n,price:fmt$(optCost(k))}),'buySpare',{o:k},'ghost sm',S.cash<optCost(k)||spareN(k)>=64)).join('')}</div><p class="meta">${tr('link_panels.spares_bought_now_are_already_paid')}</p>`;}if(st.length)h+=`<h4 class="sub4">${tr('common.spares_shelf')}</h4>`+st.map(k=>`<div class="row"><div class="grow"><div class="nm">${spareN(k)} × ${OPT[k].n}</div></div>${btn(tr('link_panels.sell_one_price',{price:fmt$(spareValue(k))}),'sellSpare',{o:k},'ghost sm')}</div>`).join('');}
|
||||
const rg=l.regen|0,rgAdd=REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH);
|
||||
const rg=l.regen|0,rgAdd=regenAddCost(l);
|
||||
h+=`</section><section><h3>${tr('common.line_system')}</h3><div class="kv"><span>${esc(sysD.n)}</span><b>${tr('link_panels.n_amplifiers',{n:amps})}</b></div>
|
||||
<div class="kv"><span>${tr('common.regen_sites')}</span><b>${rg?tr('link_panels.n_optical_spans_of_km_km',{n:rg,km:spanKm(l).toLocaleString()}):tr('common.none')}</b></div><p class="note">${tr('link_panels.a_regen_site_turns_the_light',{price:fmt$(REGEN_MO)})}</p>${l.seat?`<p class="note">${tr('broker.seat_regen_note')}</p>`:''}${l.sub&&l.own&&!l.seat?`<p class="note">${tr('link_panels.no_regen_sites_in_the_middle')}</p>`:`<div class="btns">${rg<REGEN_MAX?btn(tr('link_panels.regen_site_price',{price:fmt$(rgAdd)}),'regen',{id:l.id,d:1},'sm',S.cash<rgAdd):''}${rg?btn(tr('common.regen_site'),'regen',{id:l.id,d:-1},'ghost sm'):''}</div>`}<p class="note">${esc(sysD.blurb)}</p><div class="btns">${(()=>{const t=sysNext(l);if(!t)return '';const T=DF_SYS[t],c=sysUpCost(l);return !techOk('sys',t,T.lvl)?demoBtn('sys',t,T.lvl,tr('link_panels.sys_level_n',{sys:T.n,n:T.lvl}),'sm'):btn(tr('link_panels.upgrade_to_sys_price',{sys:T.n,price:fmt$(c)}),'upSys',{id:l.id},'sm',S.cash<c);})()}${pairBtn(l)}${btn(l.spares?tr('link_panels.spares_kit_on'):tr('link_panels.keep_a_spares_kit_price_mo',{price:fmt$(Math.round(150+(l.ch||[]).length*80))}),'spares',{id:l.id},l.spares?'green sm':'sm')}</div><p class="note">${tr('link_panels.spare_optics_and_amplifier_cards_on')}</p></section>`;
|
||||
h+=xpDfSection(l);
|
||||
|
|
@ -151,7 +151,7 @@ function linkPanel(id){
|
|||
if(l.kind==='xp')return xpPanel(l);
|
||||
const load=R.load[l.id]||0,cap=LT[l.tier].g,u=load/cap,cut=l.cut>S.day,trk=l.trench||l.id,inc=S.inc.find(i=>(LINKCUT_TR.includes(i.type)&&i.ref===trk)||((i.type==='fatwave'||i.type==='label'||i.type==='mtu')&&i.ref===l.id)),sib=pairLinks(l.a,l.b).filter(x=>x!==l&&x.kind!=='vxc'),mates=sib.filter(x=>(x.trench||x.id)===trk);
|
||||
let h=`<div class="ph"><div><div class="eyebrow">${l.cable?esc(CAB[l.cable].name):l.sub?tr('common.subsea_cable'):tr('common.terrestrial_fiber')} · ${l.km.toLocaleString()} km</div><h2>${CITY[l.a].name} ⇄ ${CITY[l.b].name}</h2></div><button class="x" data-act="closePanel" aria-label="${tr('common.close')}">×</button></div><div class="scroll">`;
|
||||
if(cut)h+=`<section><h3 style="color:var(--bad)">${tr('common.cut_2e50')}</h3><p class="lead">${inc?esc(inc.msg):''} ${inc&&shipSea(inc)?'':tr('link_panels.back_in_n_days',{n:l.cut-S.day})}</p>${shipNote(inc)}${inc&&inc.cost?btn(`${esc(inc.fix||tr('common.rush_repair'))} ${fmt$(inc.cost)}`,'fixInc',{id:inc.id},'red',S.cash<inc.cost):''}</section>`;
|
||||
if(cut)h+=`<section><h3 style="color:var(--tx-red,var(--bad))">${tr('common.cut_2e50')}</h3><p class="lead">${inc?esc(inc.msg):''} ${inc&&shipSea(inc)?'':tr('link_panels.back_in_n_days',{n:l.cut-S.day})}</p>${shipNote(inc)}${inc&&inc.cost?btn(`${esc(inc.fix||tr('common.rush_repair'))} ${fmt$(inc.cost)}`,'fixInc',{id:inc.id},'red',S.cash<inc.cost):''}</section>`;
|
||||
h+=`<section><h3>${tr('common.capacity')}</h3><div class="kv"><span>${tr('link_panels.name_wave',{name:LT[l.tier].n})}</span><b>${fmtG(load)} / ${fmtG(cap)}</b></div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div>
|
||||
<div class="kv"><span>${tr('common.latency')}</span><b>${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}</b></div>${l.cable?`<div class="kv"><span>${tr('common.cable_system')}</span><b>${esc(CAB[l.cable].name)}</b></div>`:''}
|
||||
<div class="kv"><span>${tr('common.wave_lease')}</span><b>${tr('common.price_mo',{price:fmt$(l.mo)})}</b></div>${u>=0.9?`<p class="why">${tr('link_panels.congested_upgrade_it_or_add_a')}</p>`:''}
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ const xpSpanMeta=s=>`${s.own?tr('common.own_dark_fiber'):tr('common.leased_iru')
|
|||
const xpModes=(o,run)=>OPT[o].modes.map(([g,r])=>tr('link_panels.g_to_km_km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')+` · ${xpOptG(o,run)?tr('express.runs_at',{g:fmtG(xpOptG(o,run))}):tr('express.out_of_reach')}`;
|
||||
function xpPanel(l){const sp=xpSpans(l),load=R.load[l.id]||0,cap=capOf(l),u=cap?load/cap:0,down=linkDown(l),A=CITY[l.a].name,B=CITY[l.b].name,run=sp?xpRunKm(sp):0,ch=l.ch||[];
|
||||
let h=`<div class="ph"><div><div class="eyebrow">${tr('express.eyebrow',{km:Math.round(l.km).toLocaleString()})}</div><h2>${A} ⇄ ${B}</h2></div><button class="x" data-act="closePanel" aria-label="${tr('common.close')}">×</button></div><div class="scroll">`;
|
||||
if(down)h+=`<section><h3 style="color:var(--bad)">${tr('common.dark_6bf5')}</h3>${xpDarkWhy(l).map(t=>`<p class="lead">${t}</p>`).join('')}</section>`;
|
||||
if(down)h+=`<section><h3 style="color:var(--tx-red,var(--bad))">${tr('common.dark_6bf5')}</h3>${xpDarkWhy(l).map(t=>`<p class="lead">${t}</p>`).join('')}</section>`;
|
||||
h+=`<section><h3>${tr('common.capacity')}</h3><div class="kv"><span>${trn('express.n_channels',ch.length)}</span><b>${fmtG(load)} / ${fmtG(cap)}</b></div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div>
|
||||
<div class="kv"><span>${tr('common.latency')}</span><b>${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}</b></div><div class="kv"><span>${tr('express.optical_run')}</span><b>${run.toLocaleString()} km</b></div>
|
||||
${down?'':xpDim(l).map(s=>`<p class="why">${tr('express.dim',{span:xpSpanName(s),p:pct(s.loss.f)})}</p>`).join('')}<div class="kv"><span>${tr('common.latency')}</span><b>${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}</b></div><div class="kv"><span>${tr('express.optical_run')}</span><b>${run.toLocaleString()} km</b></div>
|
||||
<p class="note">${tr('express.passes',{via:esc(xpVia(l))})}</p></section>`;
|
||||
if(sp)h+=`<section><h3>${tr('express.its_fibers')}</h3>${sp.map(s=>`<div class="row"><div class="grow"><div class="nm">${xpSpanName(s)} ${linkCut(s)?'<span class="tag restrictive">'+tr('common.cut')+'</span>':''}</div><div class="meta">${xpSpanMeta(s)}</div></div>${btn(tr('common.open'),'selLink',{id:s.id},'ghost sm')}</div>`).join('')}<p class="note">${tr('express.slot_note')}</p></section>`;
|
||||
if(sp){h+=`<section><h3>${tr('common.optics')}</h3>`;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ function teleHtml(c){if(pzOn())return '';const t=teleOf(c),from=satFrom(c),open=
|
|||
return h+`</section>`;}
|
||||
// Teleports that reach city c: a button each, to the order sheet.
|
||||
const satReach=(c,from)=>`<p class="note">${tr('satellites.reachable_from_your_teleports',{city:CITY[c].name})}</p><div class="btns">${from.slice(0,4).map(a=>btn(tr('fiber_modals.from_city',{city:CITY[a].name}),'satOpen',{a,b:c},'ghost sm')).join('')}</div>`;
|
||||
// Whether a satellite can get to city c: a teleport of yours reaches it, or (once teleports are on sale) a bird you may
|
||||
// rent from sees it. Never in a puzzle, as the rest of the satellites.
|
||||
const satCan=c=>!pzOn()&&(satFrom(c).length>0||lvl()>=SAT_ORB.geo.lv&&satRemote(c)&&teleSees(c).some(id=>lvl()>=SAT_ORB[SATS[id].orb].lv));
|
||||
// Under the link window's "no subsea cable lands here" (#321): the teleports that reach c, a button each to the order
|
||||
// sheet, or where to build one.
|
||||
const satNoCable=c=>{const from=satFrom(c);return from.length?satReach(c,from):`<p class="note">${tr('satellites.no_teleport_reaches_city',{city:CITY[c].name})}</p>`;};
|
||||
// A city without a POP of yours, that a teleport of yours reaches: a POP and a circuit in one go.
|
||||
function satNoPop(c){if(pzOn()||S.pops[c])return '';const from=satFrom(c);if(!from.length)return '';
|
||||
return `<section><h3>🛰️ ${tr('satellites.by_satellite')}</h3><p class="lead">${tr('satellites.no_cable_needed_a_pop_here',{city:CITY[c].name})}</p>${satReach(c,from)}</section>`;}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function scnProg(){const sc=S&&S.scn;if(!sc)return null;
|
|||
const meas=items.filter(x=>x.max),f=sc.done?1:meas.length?meas.reduce((a,x)=>a+Math.min(1,x.v/x.max),0)/meas.length:0;return {goal:def.goal,items,f};}
|
||||
const pRow=x=>`<div class="kv"><span>${esc(x.l)}</span><b>${esc(x.txt)}</b></div>${x.max?`<div class="bar ${x.v>=x.max?'':'warn'}"><i style="width:${Math.min(100,x.max?x.v/x.max*100:0)}%"></i></div>`:''}`;
|
||||
function scnCard(){const sc=S.scn,P=scnProg();if(!sc||!P)return '';const left=Math.max(0,sc.days-S.day);
|
||||
const st=sc.done?`<b style="color:var(--eye)">${tr('progress.done_in_d_days',{d:sc.done})}</b>`:sc.failed?`<b style="color:var(--bad)">${tr('common.time_s_up')}</b>`:tr('common.n_days_left',{n:left});
|
||||
const st=sc.done?`<b style="color:var(--eye)">${tr('progress.done_in_d_days',{d:sc.done})}</b>`:sc.failed?`<b style="color:var(--tx-red,var(--bad))">${tr('common.time_s_up')}</b>`:tr('common.n_days_left',{n:left});
|
||||
return `<div class="pcard"><div class="eyebrow">${tr('common.scenario')} · ${Math.round(P.f*100)}%</div><div class="pt">${esc(sc.name)}</div><div class="meta">🎯 ${esc(P.goal)}</div>${P.items.map(pRow).join('')}<div class="kv"><span>${tr('common.time')}</span><b>${st}</b></div><div class="bar ${!sc.done&&left<sc.days*0.2?'bad':''}"><i style="width:${Math.min(100,S.day/sc.days*100)}%"></i></div></div>`;}
|
||||
function lvlItems(){const lv=S.lvl||1,pk=S.stats.peak||0,pops=Object.keys(S.pops).length,G=(l,v,max,txt)=>({l,v,max,txt}),q=LV_REQ[lv];if(!q)return [];
|
||||
const out=[G(tr('common.peak_traffic'),pk,q.pk,`${fmtG(pk)} / ${fmtG(q.pk)}`),G(tr('common.pops'),pops,q.pops,`${pops} / ${q.pops}`)],rg=lvReg(lv);if(rg)out.push(G(tr('common.continents'),regionsCount(),rg,`${regionsCount()} / ${rg}`));return out;}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ function custSection(){const F=UI.kf||{};let h=`<div class="panel2" id="custSec"
|
|||
if(!S.biz.length)return h+`<p class="empty">${tr('customers.no_customers_yet_offers_show_up')}</p></div>`;
|
||||
const st=custStats();
|
||||
h+=`<p class="note" style="margin-top:0">${tr('customers.everyone_who_pays_you_happiest_last')}</p>`;
|
||||
h+=`<div class="dgrid" style="margin:0 0 8px"><div class="tile"><div class="lbl">${tr('common.happiness')}</div><div class="val" style="color:${st.avg<60?'var(--bad)':'inherit'}">${Math.round(st.avg)}%</div><div class="sub">${tr('customers.weighted_by_what_they_pay')}</div></div><div class="tile"><div class="lbl">${tr('common.unhappy')}</div><div class="val" style="color:${st.unhappy?'var(--bad)':'inherit'}">${st.unhappy}</div><div class="sub">${trn('customers.n_furious',st.furious)}</div></div><div class="tile"><div class="lbl">${tr('common.at_risk')}</div><div class="val">${tr('common.price_mo',{price:fmt$(st.risk)})}</div><div class="sub">${tr('customers.from_unhappy_customers')}</div></div></div>`;
|
||||
h+=`<div class="dgrid" style="margin:0 0 8px"><div class="tile"><div class="lbl">${tr('common.happiness')}</div><div class="val" style="color:${st.avg<60?'var(--tx-red,var(--bad))':'inherit'}">${Math.round(st.avg)}%</div><div class="sub">${tr('customers.weighted_by_what_they_pay')}</div></div><div class="tile"><div class="lbl">${tr('common.unhappy')}</div><div class="val" style="color:${st.unhappy?'var(--tx-red,var(--bad))':'inherit'}">${st.unhappy}</div><div class="sub">${trn('customers.n_furious',st.furious)}</div></div><div class="tile"><div class="lbl">${tr('common.at_risk')}</div><div class="val">${tr('common.price_mo',{price:fmt$(st.risk)})}</div><div class="sub">${tr('customers.from_unhappy_customers')}</div></div></div>`;
|
||||
const cities=[...new Set(S.biz.map(b=>b.city))].sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name));
|
||||
h+=`<div class="trsel" style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:6px"><div class="seg">${btn(tr('dashboard.all_n',{n:S.biz.length}),'custF',{v:''},!F.f?'pink sm':'ghost sm')}${btn(tr('customers.unhappy_n',{n:S.biz.filter(b=>b.mood<60).length}),'custF',{v:'sad'},F.f==='sad'?'pink sm':'ghost sm')}</div><label>${tr('common.city_906b')} <select data-chg="custCity"><option value="">${tr('common.all_cities')}</option>${cities.map(c=>`<option value="${c}"${F.city===c?' selected':''}>${esc(CITY[c].name)}</option>`).join('')}</select></label></div>`;
|
||||
const rows=S.biz.filter(b=>(!F.f||b.mood<60)&&(!F.city||b.city===F.city||b.city2===F.city||(b.sites||[]).includes(F.city)));
|
||||
|
|
@ -27,7 +27,7 @@ function custSection(){const F=UI.kf||{};let h=`<div class="panel2" id="custSec"
|
|||
rows.sort((a,b)=>{const A=val(a),B=val(b);return (A<B?-1:A>B?1:0)*dir||a.mood-b.mood;});
|
||||
if(!rows.length)return h+`<p class="empty">${F.f?tr('customers.nobody_is_unhappy_enjoy_it_while'):tr('customers.no_customers_here')}</p></div>`;
|
||||
const where=b=>b.sites?b.sites.map(c=>CITY[c].name).join(', '):b.city2?`${CITY[b.city].name} ⇄ ${CITY[b.city2].name}`:CITY[b.city].name;
|
||||
const trend=b=>b.pm===undefined||Math.abs(b.mood-b.pm)<0.05?'':b.mood>b.pm?' <span style="color:var(--eye)">▲</span>':' <span style="color:var(--bad)">▼</span>';
|
||||
const trend=b=>b.pm===undefined||Math.abs(b.mood-b.pm)<0.05?'':b.mood>b.pm?' <span style="color:var(--eye)">▲</span>':' <span style="color:var(--tx-red,var(--bad))">▼</span>';
|
||||
const sorts=[['mood',tr('common.happiness')],['mo',tr('common.per_month')],['name',tr('common.name')],['city',tr('common.where')]];
|
||||
h+=`<div class="seg" style="margin-bottom:4px">${sorts.map(([k,l])=>btn(l+(sk===k?(dir>0?' ▲':' ▼'):''),'custSort',{k},sk===k?'pink sm':'ghost sm')).join('')}</div>`;
|
||||
h+=rows.slice(0,listN('cust')).map(b=>{const why=bizWhy(b),grace=S.day-(b.since||0)<15;return `<div class="row"><div class="grow"><div class="nm">${esc(b.name)} <span class="meta">${esc(BIZ_T[b.type].l)}</span></div><div class="meta">${esc(where(b))} · ${BIZ_T[b.type].event?esc(bTerms(b)):tr('common.price_mo',{price:fmt$(bizMo(b))})}${grace?` · ${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}`:''}${clTermTxt(b)?' · '+clTermTxt(b):''}</div>${bRisk(b)}${why.length?`<div class="why">${why.map(esc).join(' · ')}</div>`:''}<div class="bar ${moodCls(b.mood)}"><i style="width:${b.mood}%"></i></div><div class="meta">${tr('common.happiness_p',{p:Math.round(b.mood)})}${trend(b)}</div></div>${btn(tr('common.open'),'custGo',{id:b.id},'ghost sm')}</div>`;}).join('');
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ function leaseSwaps(){const by={};
|
|||
.sort((p,q)=>((p.best===undefined)-(q.best===undefined))||(q.best||0)-(p.best||0)||q.mo-p.mo);}
|
||||
function leaseTab(){const xs=leaseSwaps(),tot=xs.reduce((s,x)=>s+x.mo,0);
|
||||
const kind=l=>l.kind==='vxc'?tr('lease_swaps.cap_fabric_circuit',{cap:capName(l)}):l.kind==='df'?tr('lease_swaps.cap_on_a_dark_fiber_iru',{cap:capName(l)}):tr('lease_swaps.cap_wave',{cap:capName(l)});
|
||||
const line=(x,o)=>{const a={up:fmt$(o.up),mo:fmt$(o.omo),n:o.days};return `<div class="meta">${o.k==='iru'?tr('lease_swaps.lease_dark_fiber_up_up_front',a):o.k==='cab'?tr('lease_swaps.your_own_cable_up_up_front',a):tr('lease_swaps.your_own_fiber_up_up_front',a)} <b style="color:${o.save>0?'var(--eye)':'var(--bad)'}">${o.save>0?tr('lease_swaps.saves_price_mo_pays_for_itself',{price:fmt$(o.save),n:o.pay}):tr('lease_swaps.costs_more_than_leasing_at_this')}</b></div>`;};
|
||||
const line=(x,o)=>{const a={up:fmt$(o.up),mo:fmt$(o.omo),n:o.days};return `<div class="meta">${o.k==='iru'?tr('lease_swaps.lease_dark_fiber_up_up_front',a):o.k==='cab'?tr('lease_swaps.your_own_cable_up_up_front',a):tr('lease_swaps.your_own_fiber_up_up_front',a)} <b style="color:${o.save>0?'var(--eye)':'var(--tx-red,var(--bad))'}">${o.save>0?tr('lease_swaps.saves_price_mo_pays_for_itself',{price:fmt$(o.save),n:o.pay}):tr('lease_swaps.costs_more_than_leasing_at_this')}</b></div>`;};
|
||||
const plan=(x,o)=>btn(o.k==='iru'?tr('lease_swaps.plan_dark_fiber'):o.k==='cab'?tr('lease_swaps.plan_a_cable'):tr('lease_swaps.plan_your_own_fiber'),'leaseSwap',{a:x.a,b:x.b,src:o.k==='iru'?'lease':o.k==='cab'?'cable':'build'},o.save>0&&o.save===x.best?'pink sm':'ghost sm');
|
||||
return `<div class="panel2" style="margin-top:12px"><h3>${tr('common.leased_lines')}</h3><p class="note" style="margin-top:0">${tr('lease_swaps.every_wave_fabric_circuit_and_dark')}</p>
|
||||
${xs.length?`<div class="kv"><span>${tr('lease_swaps.you_pay_for_leases')}</span><b>${tr('common.price_mo',{price:fmt$(tot)})}</b></div>`+xs.map(x=>`<div class="row"><div class="grow"><div class="nm">${CITY[x.a].name} ⇄ ${CITY[x.b].name} <span class="tag st">${x.sub?tr('common.subsea'):tr('common.land')}</span></div><div class="meta">${Object.entries(x.ls.reduce((m,l)=>(m[kind(l)]=(m[kind(l)]||0)+1,m),{})).map(([k,n])=>n>1?`${n} × ${k}`:k).join(', ')} · ${tr('common.price_mo',{price:fmt$(x.mo)})}</div>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ const cmSeg=(vals,cur,act,args,f)=>`<div class="seg">${vals.map(v=>btn(f(v),act,
|
|||
function cmHeatTag(r){const H=cmHeat(r,'spec',S.day);return H>=1.15?`<span class="tag cmhot">${tr('market.hot',{x:H.toFixed(1)})}</span>`:H<=0.85?`<span class="tag cmcool">${tr('market.cool',{x:H.toFixed(1)})}</span>`:`<span class="tag st">${tr('market.steady')}</span>`;}
|
||||
function cmProdLine(r,p,s,L,fc){const C=S.cm.p[p],D=cmDem(r,p,S.day),i=cmIdx(r,p,s,0,S.day),pc=Math.round(i*100),m=mkt()*cmCut();
|
||||
const price=p==='iru'?tr('market.price_pair',{up:fmt$(Math.round(cmUpList(r)*i*m)),price:fmt$(Math.round(cmList(r,p)*m)),pct:pc}):tr('market.price',{price:fmt$(Math.round(cmList(r,p)*i*m)),pct:pc});
|
||||
return `<div class="cmp"><div class="meta"><b>${tr(CM_NAME[p])}</b> · ${tr('market.row',{want:cmN(D),sold:s,listed:L})} · ${price}${C.on&&pc<C.floor?` <b style="color:var(--bad)">${tr('market.below_floor')}</b>`:C.on&&!L&&D>=C.min&&p!=='iru'&&!S.cm.off[r.k]?` <b style="color:var(--warn)">${CM_G[p]&&!r.ls.some(l=>cmOptG(l)>=CM_G[p])?tr('market.needs_optic',{g:fmtCap(CM_G[p])}):tr('market.no_room')}</b>`:''}</div>
|
||||
return `<div class="cmp"><div class="meta"><b>${tr(CM_NAME[p])}</b> · ${tr('market.row',{want:cmN(D),sold:s,listed:L})} · ${price}${C.on&&pc<C.floor?` <b style="color:var(--tx-red,var(--bad))">${tr('market.below_floor')}</b>`:C.on&&!L&&D>=C.min&&p!=='iru'&&!S.cm.off[r.k]?` <b style="color:var(--warn)">${CM_G[p]&&!r.ls.some(l=>cmOptG(l)>=CM_G[p])?tr('market.needs_optic',{g:fmtCap(CM_G[p])}):tr('market.no_room')}</b>`:''}</div>
|
||||
${cmBar(D,s,C.on?C.min:0)}${fc?`<div class="meta">${tr('market.forecast',{a:cmN(cmFc(r,p,30)),b:cmN(cmFc(r,p,90))})}</div>`:''}</div>`;}
|
||||
function marketTab(){const C=S.cm,rs=[...cmRoutes().values()].sort((x,y)=>brMarket(y.a,y.b)-brMarket(x.a,x.b)),sold=cmSold(new Map(rs.map(r=>[r.k,r]))),bk=broker();
|
||||
const mo=S.biz.reduce((a,b)=>a+(['wwave','mwave','dfpair'].includes(b.type)?bizMo(b):0),0),ago=n=>S.day-n.d<1?tr('market.today'):trn('market.days_ago',S.day-n.d);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ function renderDash(){checkLayer();
|
|||
const net=R.revMo-R.costMo,tot=Object.values(R.egT).reduce((a,b)=>a+b,0)||1;
|
||||
const tile=(l,v,sub)=>`<div class="tile"><div class="lbl">${l}</div><div class="val">${v}</div>${sub?`<div class="sub">${sub}</div>`:''}</div>`;
|
||||
let h=`<div style="display:flex;align-items:center;gap:10px"><div><div class="eyebrow">AS${S.asn} · ${esc(S.name)} · ${tierLabel()}</div><h2 style="font-size:28px">${tr('common.noc_dashboard')}</h2></div><button class="x" data-act="dashClose" aria-label="${tr('common.close')}">×</button></div>`+dashTabs();const DT=UI.dtab||'overview';if(DT==='overview')h+=`
|
||||
<div class="dgrid">${tile(tr('common.traffic_now'),fmtG(R.served),tr('dashboard.of_g_wanted',{g:fmtG(R.demand)}))}${tile(tr('common.peak'),fmtG(S.stats.peak))}${tile(tr('dashboard.carried'),fmtVol(S.vol||0),tr('dashboard.carried_sub'))}${tile(tr('dashboard.delivered_30_days'),(up*100).toFixed(1)+'%',up>=0.999?tr('dashboard.five_nines_ish'):up>=0.99?tr('dashboard.two_nines_and_change'):tr('dashboard.customers_are_upset'))}${tile(tr('common.peering_ratio'),pct(R.peerShare||0),tr('dashboard.caches_pnis_and_ix'))}${tile(tr('dashboard.monthly_p_l'),`<span style="color:${net>=0?'var(--eye)':'var(--bad)'}">${net>=0?'+':''}${fmt$(net)}</span>`,tr('dashboard.in_in_out_out',{in:fmt$(R.revMo),out:fmt$(R.costMo)}))}${tile(tr('common.incidents'),S.stats.incidents,tr('dashboard.n_shrugged_off',{n:S.stats.survived}))}</div>
|
||||
<div class="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>`;
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ function renderBank(){
|
|||
if(o.model==='balloon')return `<span class="tag st on">${tr('bank.nothing_to_pay_until_the_end_2a38')}</span><span class="tag st">${tr('bank.apr_apr',{apr:(o.apr*100).toFixed(1)})}</span><span class="tag st">${tr('bank.n_months',{n:o.term})}</span><span class="tag selective">${tr('bank.then_about_price_at_once',{price:fmt$(o.amount*Math.pow(1+o.apr/12,o.term))})}</span>${sh}`;
|
||||
const extra=o.model==='storm'?`<span class="tag selective">${tr('bank.2_per_open_incident')}</span>`:o.model==='astro'?`<span class="tag selective">${tr('bank.rate_set_by_the_stars_each')}</span>`:'';
|
||||
return (B.equity?`<span class="tag st on">${tr('common.no_repayments')}</span><span class="tag st">${tr('bank.pct_of_revenue_forever',{pct:pct(o.share)})}</span><span class="tag st">${tr('bank.buy_out_price',{price:fmt$(o.amount*3)})}</span>`:`<span class="tag st on">${tr('bank.apr_apr',{apr:(o.apr*100).toFixed(1)})}</span><span class="tag st">${tr('bank.n_months',{n:o.term})}</span><span class="tag st">${tr('common.price_mo',{price:fmt$(o.pay)})}</span>${B.crypto?'<span class="tag selective">'+tr('bank.paid_in_tubecoin')+'</span>':''}`)+extra+sh;};
|
||||
const covList=(l)=>l.covs.length?l.covs.map(c=>{const ok=COVS[c].ok(l);return `<div class="meta"><b style="color:${ok?'var(--eye)':'var(--bad)'}">${ok?'✓':'✗'}</b> ${esc(covLabel(c,l))}</div>`;}).join(''):'<div class="meta">'+tr('bank.no_conditions_that_is_the_scary')+'</div>';
|
||||
const covList=(l)=>l.covs.length?l.covs.map(c=>{const ok=COVS[c].ok(l);return `<div class="meta"><b style="color:${ok?'var(--eye)':'var(--tx-red,var(--bad))'}">${ok?'✓':'✗'}</b> ${esc(covLabel(c,l))}</div>`;}).join(''):'<div class="meta">'+tr('bank.no_conditions_that_is_the_scary')+'</div>';
|
||||
let h=`<div style="display:flex;align-items:center;gap:12px"><div><div class="eyebrow">AS${S.asn} · ${esc(S.name)}</div><h2 style="font-size:28px">${tr('common.bank')}</h2></div><button class="x" data-act="bankClose" aria-label="${tr('common.close')}">×</button></div>
|
||||
<div class="dgrid"><div class="tile"><div class="lbl">${tr('common.cash')}</div><div class="val" style="color:${S.cash<0?'var(--bad)':'inherit'}">${fmt$(S.cash)}</div><div class="sub">${S.cash<0?tr('bank.bankrupt_at_100k'):tr('bank.in_the_vault')}</div></div>
|
||||
<div class="tile"><div class="lbl">${tr('dashboard.monthly_p_l')}</div><div class="val" style="color:${net>=0?'var(--eye)':'var(--bad)'}">${net>=0?'+':''}${fmt$(net)}</div><div class="sub">${tr('bank.after_loan_payments')}</div></div>
|
||||
<div class="dgrid"><div class="tile"><div class="lbl">${tr('common.cash')}</div><div class="val" style="color:${S.cash<0?'var(--tx-red,var(--bad))':'inherit'}">${fmt$(S.cash)}</div><div class="sub">${S.cash<0?tr('bank.bankrupt_at_100k'):tr('bank.in_the_vault')}</div></div>
|
||||
<div class="tile"><div class="lbl">${tr('dashboard.monthly_p_l')}</div><div class="val" style="color:${net>=0?'var(--eye)':'var(--tx-red,var(--bad))'}">${net>=0?'+':''}${fmt$(net)}</div><div class="sub">${tr('bank.after_loan_payments')}</div></div>
|
||||
<div class="tile"><div class="lbl">${tr('common.credit_rating')}</div><div class="val">${rt}</div><div class="sub">${rIdx(rt)>=5?tr('bank.bankers_return_your_calls'):rIdx(rt)>=3?tr('bank.bankers_return_your_emails'):tr('bank.bankers_pretend_to_be_out')}</div></div>
|
||||
<div class="tile"><div class="lbl">${tr('common.debt')}</div><div class="val">${fmt$(loanDebt())}</div><div class="sub">${trn('bank.n_loan',S.loans.length)}</div></div></div>`;
|
||||
const CT=CALL_TERMS[rt];
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
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();
|
||||
const kv=(l,v,bad)=>`<div class="kv"><span>${l}</span><b${bad?' style="color:var(--bad)"':''}>${v}</b></div>`,mo=v=>tr('common.price_mo',{price:fmt$(v)});
|
||||
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))}`;
|
||||
// Public, behind CGNAT, IPv6-only: the three groups once there is a third.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
const NOC_HB=3000,NOC_LOST=10000,NOC_GAP=1000;
|
||||
// What a click in the window does: changes only its own view, or runs in the game. Every button the dashboard draws is in one list.
|
||||
const NOC_LOCAL=['chartToggle','connCity','connF','connNet','connSort','custCity','custF','custSort','dashClose','dashSort','dashTab','listMore','popsReg','popsSort'];
|
||||
const NOC_GO=['buyIx','buyNni','buyTransit','cache','connCancel','custGo','dashLink','goConn','lagIx','lagNni','lagP','lagT','leaseSwap','mktCfg','mktHold','mktRoute','netFocus','opsOpen','pni','pniAllOpen','popGo'];
|
||||
const NOC_GO=['buyIx','buyNni','buyTransit','cache','connCancel','custGo','dashLink','goConn','ip4Open','lagIx','lagNni','lagP','lagT','leaseSwap','mktCfg','mktHold','mktRoute','netFocus','opsOpen','pni','pniAllOpen','popGo'];
|
||||
const NOC={win:false,id:null,ctl:null,st:null,stId:null,peer:false,until:0,dirty:false,sent:0,speed:1,hid:false,yoAt:0,gone:false};
|
||||
{const id=RW_IN?null:new URLSearchParams(location.search).get('noc');if(slotOkId(id)){NOC.win=true;NOC.id=id;}}
|
||||
if(!RW_IN)try{if(typeof BroadcastChannel==='function'){NOC.ctl=new BroadcastChannel('sot-noc');NOC.ctl.onmessage=e=>{const m=e.data;if(!m||typeof m!=='object'||!slotOkId(m.id))return;if(NOC.win)nocWinMsg(m);else nocGameMsg(m);};}}catch(e){}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
/* ---------- notifications: the NOC keeps the last ten minutes, readable and openable ---------- */
|
||||
const LOG_KEEP=60,LOG_MS=10*60*1000,LOG_KINDS=['','good','bad','goal'],LOG_OPEN=['city','link','cust','bank','tab','ops'],LOG_TABS=['goals','deals','noc','nets'];
|
||||
const LOG_KEEP=60,LOG_MS=10*60*1000,LOG_KINDS=['','good','bad','goal'],LOG_OPEN=['city','link','cust','bank','ip4','tab','ops'],LOG_TABS=['goals','deals','noc','nets'];
|
||||
// What a notification is about, from the button it came with: the same place its own button would take you.
|
||||
function openOf(actions){for(const a of actions||[]){const g=a.args||{};
|
||||
if(a.act==='focusCity'&&isCity(g.city))return {a:'city',v:g.city};if(a.act==='selLink'&&g.id)return {a:'link',v:String(g.id)};
|
||||
if(a.act==='custGo'&&g.id)return {a:'cust',v:String(g.id)};if(a.act==='bank')return {a:'bank'};if(a.act==='leftTab'&&LOG_TABS.includes(g.t))return {a:'tab',v:g.t};}return null;}
|
||||
if(a.act==='custGo'&&g.id)return {a:'cust',v:String(g.id)};if(a.act==='bank')return {a:'bank'};if(a.act==='ip4Open')return {a:'ip4'};if(a.act==='leftTab'&&LOG_TABS.includes(g.t))return {a:'tab',v:g.t};}return null;}
|
||||
// Otherwise from the text: a link between two of your cities it names, or the first of your cities it names.
|
||||
function openFromText(t){const cs=Object.keys(S.pops).map(c=>[c,t.indexOf(CITY[c].name)]).filter(([,i])=>i>=0).sort((a,b)=>a[1]-b[1]).map(([c])=>c);
|
||||
if(cs.length>=2){const l=S.links.find(l=>(l.a===cs[0]&&l.b===cs[1])||(l.a===cs[1]&&l.b===cs[0]));if(l)return {a:'link',v:l.id};}return cs.length?{a:'city',v:cs[0]}:null;}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ function openLinkModal(a,b){
|
|||
if(mode==='df'){openModal(head+dfModalBody(a,b,km,pop));return;}
|
||||
if(mode==='xp'){openModal(head+xpModalBody(a,b,xr));return;}
|
||||
if(sub&&!cablesOk(a,b).length){const fr=[...new Set(CABLE_PAIRS.filter(c=>c.a===a||c.b===a).map(c=>CITY[c.a===a?c.b:c.a].name))],dry=[a,b].find(c=>!landing(c));
|
||||
// a beach with no cable yet (#321): hopping cannot help, only a road in or a cable of your own
|
||||
const bare=!dry&&[a,b].find(c=>!CABLE_PAIRS.some(p=>p.a===c||p.b===c)),road=bare&&CITIES.some(x=>x.id!==bare&&!isSub(bare,x.id));
|
||||
openModal(head+`<p class="lead" style="margin-top:10px">${dry?tr('link_modal.no_subsea_cable_lands_in_city',{city:CITY[dry].name,near:CITY[nearLanding(dry)].name}):bare?(road?tr('link_modal.no_subsea_cable_lands_in_city_land',{city:CITY[bare].name}):tr('link_modal.no_subsea_cable_lands_in_city_own',{city:CITY[bare].name})):tr('link_modal.no_subsea_cable_lands_in_both',{a:CITY[a].name,b:CITY[b].name,list:fr.join(', ')})}</p>${(cabOpen()?!ownCabWhy(a,b):bare)?ownCabTeaser(a,b):''}`);return;}
|
||||
// a beach with no cable yet (#321): hopping cannot help, only a road in, a cable of your own, or a satellite (#83)
|
||||
const bare=!dry&&[a,b].find(c=>!CABLE_PAIRS.some(p=>p.a===c||p.b===c)),road=bare&&CITIES.some(x=>x.id!==bare&&!isSub(bare,x.id)),far=dry||bare,sat=!!far&&satCan(far);
|
||||
openModal(head+`<p class="lead" style="margin-top:10px">${dry?tr('link_modal.no_subsea_cable_lands_in_city',{city:CITY[dry].name,near:CITY[nearLanding(dry)].name}):bare?(road?tr('link_modal.no_subsea_cable_lands_in_city_land',{city:CITY[bare].name}):sat?tr('link_modal.no_subsea_cable_lands_in_city_own_sat',{city:CITY[bare].name}):tr('link_modal.no_subsea_cable_lands_in_city_own',{city:CITY[bare].name})):tr('link_modal.no_subsea_cable_lands_in_both',{a:CITY[a].name,b:CITY[b].name,list:fr.join(', ')})}</p>${sat?satNoCable(far):''}${(cabOpen()?!ownCabWhy(a,b):bare)?ownCabTeaser(a,b):''}`);return;}
|
||||
if(isSub(a,b)&&S.ev.landban&&S.ev.landban.until>S.day&&[a,b].includes(S.ev.landban.city)){openModal(head+`<p class="lead" style="margin-top:10px">${tr('link_modal.the_landing_permit_dispute_in_city',{city:CITY[S.ev.landban.city].name,n:S.ev.landban.until-S.day})}</p>`);return;}
|
||||
if(uaePair(a,b)||andesPair(a,b)||rainPair(a,b)||borderPair(a,b))route+=`<p class="note" style="margin-top:8px">${landWhy(a,b)}</p>`;
|
||||
route+=`<p class="note" style="margin-top:6px">📈 ${esc(marketNote(a,b,sub))}</p>`;
|
||||
|
|
|
|||
|
|
@ -420,6 +420,7 @@
|
|||
"bstd.cost_mo":"Running costs",
|
||||
"bstd.cost_now":"To bring it all up now",
|
||||
"bstd.edit":"Edit the build standard",
|
||||
"bstd.every_bb_city":"In every broadband city",
|
||||
"bstd.every_exchange":"Wherever there is an IX",
|
||||
"bstd.fastest":"Fastest that reaches",
|
||||
"bstd.fiber_note_two":"A line system swap takes the fiber dark for a day. The button does it only on a quiet fiber or where a parallel link carries its load; your intern only where all the traffic gets around the fiber.",
|
||||
|
|
@ -428,6 +429,7 @@
|
|||
"bstd.g_port":"Ports and peering",
|
||||
"bstd.generator":"generator",
|
||||
"bstd.held":{"one":"One fiber keeps its line system for now, until it is quiet or a parallel link can carry its load for the day it goes dark. Until then it gets the fastest optics its line system takes.","other":"{n} fibers keep their line system for now, until they are quiet or a parallel link can carry their load for the day they go dark. Until then they get the fastest optics their line system takes."},
|
||||
"bstd.held_wave":{"one":"One fiber keeps its line system: a customer's wave rides it and would go dark with it for the day of the swap. The upgrade button on the fiber itself still does it, when you choose. Until then it gets the fastest optics its line system takes.","other":"{n} fibers keep their line system: customers' waves ride them and would go dark with them for the day of the swap. The upgrade button on each fiber still does it, when you choose. Until then they get the fastest optics their line system takes."},
|
||||
"bstd.hire_note":"Hire a NOC intern in Ops and they keep every POP, port and fiber to the standard: a few jobs a day, the busiest first, within a monthly budget and only with money to spare.",
|
||||
"bstd.in_n_cities":"In at least {n} cities",
|
||||
"bstd.intern_keeps":"{name} keeps the network to it",
|
||||
|
|
@ -438,6 +440,7 @@
|
|||
"bstd.l_pni":"PNIs per network",
|
||||
"bstd.l_site2":"Second building",
|
||||
"bstd.l_split":"Split LAGs",
|
||||
"bstd.l_v6":"Broadband: IPv6-only",
|
||||
"bstd.left":{"one":"One thing is still below it, waiting for cash, a quiet fiber or an augment to land.","other":"{n} things are still below it, waiting for cash, a quiet fiber or an augment to land."},
|
||||
"bstd.n_more_targets":{"one":"{n} more target","other":"{n} more targets"},
|
||||
"bstd.new_pops_note":"A new POP gets these at once, while it is still empty: no maintenance window. Short on cash, it gets what fits. A model you have not unlocked yet means the best unlocked one below it.",
|
||||
|
|
@ -448,6 +451,7 @@
|
|||
"bstd.second_building":"second building",
|
||||
"bstd.tagline":"One design for the whole network: what every POP, port and fiber should have. New POPs get the POP part the day they open; your intern, or the button below, brings the rest up to it.",
|
||||
"bstd.title":"Build standard",
|
||||
"bstd.v6_note":"IPv6-only swaps the home routers of every broadband city, the most dual-stack homes first. Its price is the whole swap, paid as the routers go in, and a city starts only with all of it to spare.",
|
||||
"businesses.a_free_pni_with_voda_phony":"A free PNI with Voda-Phony. Gear: Absolute Unit 3.2T routers, 3.2T ports and 12.8T waves.",
|
||||
"businesses.agi_lab_allegedly":"AGI lab (allegedly)",
|
||||
"businesses.agi_labs_allegedly_wanting_ai_wans":"AGI labs (allegedly) wanting AI WANs of 12.8 to 25.6 Tbps, and free PNIs with Du-opoly and Ooh-redoo. Gear: Mikrowtik CCR 3.2T routers.",
|
||||
|
|
@ -2067,6 +2071,7 @@
|
|||
"express.dark_gone":"One of the fibers under it is gone.",
|
||||
"express.dark_reach":"None of its optics reach over this run.",
|
||||
"express.dark_system":"{span} has its line system down.",
|
||||
"express.dim":"{span} has a dirty connector: every wave in that fiber, this express too, runs at {p} until someone cleans it.",
|
||||
"express.express_to":"Express to…",
|
||||
"express.eyebrow":"Express lightpath · {km} km",
|
||||
"express.fiber_busy":{"one":"<b>An express lightpath rides this fiber.</b><br>Tear it down first: open it from this fiber's Express section.","other":"<b>{n} express lightpaths ride this fiber.</b><br>Tear them down first: open them from this fiber's Express section."},
|
||||
|
|
@ -2942,6 +2947,7 @@
|
|||
"link_modal.no_subsea_cable_lands_in_city":"No subsea cable lands in {city}. The nearest landing station is {near}: run fiber there first, then take a cable from it.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_land":"No subsea cable lands in {city} yet. Reach it overland, or lay a subsea cable of your own.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own":"No subsea cable lands in {city} yet, and no road or fiber reaches it overland. Only a subsea cable of your own can get there.",
|
||||
"link_modal.no_subsea_cable_lands_in_city_own_sat":"No subsea cable lands in {city} yet, and no road or fiber reaches it overland. Only a satellite circuit or a subsea cable of your own can get there.",
|
||||
"link_modal.nobody_sells_capacity_between_kyiv":"Nobody sells capacity between Kyiv and Moscow, and nobody is going to. Route through Warsaw, Bucharest or Helsinki instead.",
|
||||
"link_modal.not_without_a_license":"Not without a license",
|
||||
"link_modal.premium_crossing_60_3_loss":"Premium crossing <small>+60% · ~3% loss</small>",
|
||||
|
|
@ -3607,7 +3613,7 @@
|
|||
"ops.o_optics":"Light more fiber",
|
||||
"ops.o_optics_d":"Add optics to dark fiber that runs hot, and light new fiber the day it is handed over.",
|
||||
"ops.o_optup":"Upgrade optical transport",
|
||||
"ops.o_optup_std_d":"On fiber that is full and runs hot, move the line system up a size, or trade the smallest channels for bigger optics (the old ones go on the shelf). With a line system in the build standard, every fiber on a smaller one is moved up to it. A line system swap takes the fiber down for a day, so only where the traffic gets around it and no customer rides it, one a night together with Keep to the build standard.",
|
||||
"ops.o_optup_wave_d":"On fiber that is full and runs hot, move the line system up a size, or trade the smallest channels for bigger optics (the old ones go on the shelf). With a line system in the build standard, every fiber on a smaller one is moved up to it. A line system swap takes the fiber down for a day, so only where the traffic gets around it and no customer's wave rides it, one a night together with Keep to the build standard.",
|
||||
"ops.o_pni":"PNI with the big ones",
|
||||
"ops.o_pni_d":"Every week: order a PNI with every willing network sending enough traffic at your POPs, at each network's own minimum size.",
|
||||
"ops.o_ports":"Keep peering headroom",
|
||||
|
|
@ -3617,7 +3623,7 @@
|
|||
"ops.o_routers":"Keep routers ahead",
|
||||
"ops.o_routers_std_d":"Add a router, or swap to the next generation where a second router carries the traffic, when load or ports pass a level. With a router model in the build standard, every POP on a smaller one is swapped to it instead, the busiest first, within the budget.",
|
||||
"ops.o_std":"Keep to the build standard",
|
||||
"ops.o_std_around_d":"Bring POPs, ports and fiber up to your build standard, the busiest first, a few jobs a shift. A second router goes in before a swap, and a line system only changes where the traffic gets around the fiber for its day dark and no customer rides it, one a night together with Upgrade optical transport.",
|
||||
"ops.o_std_wave_d":"Bring POPs, ports and fiber up to your build standard, the busiest first, a few jobs a shift. A second router goes in before a swap, and a line system only changes where the traffic gets around the fiber for its day dark and no customer's wave rides it, one a night together with Upgrade optical transport.",
|
||||
"ops.o_transit":"Keep transit headroom",
|
||||
"ops.o_transit_d":"Keep transit at each POP above a multiple of its 30-day peak: add a LAG member, or move up a port size.",
|
||||
"ops.ops":"Ops",
|
||||
|
|
@ -3718,6 +3724,7 @@
|
|||
"peering_policy.already_reach_you_through_your":"Already reach you through your transit provider here and think that is fine.",
|
||||
"peering_policy.moved_everything_in_this_city_to":"Moved everything in this city to PNIs. Please read their PearingDB page, all 40 pages of it.",
|
||||
"peering_policy.not_accepting_new_peers_in_this":"Not accepting new peers in this region right now.",
|
||||
"peering_policy.not_while_a_satellite_is_your_only_way":"Won't peer in {city} while a {orb} satellite is your only way out ({ms} ms there and back): they want your backbone where they meet you.",
|
||||
"peering_policy.only_peers_over_pnis_in_this":"Only peers over PNIs in this metro. Order a cross-connect instead.",
|
||||
"peering_policy.only_peers_with_members_they_can":"Only peers with members they can reach without a 1,500 km hairpin.",
|
||||
"peering_policy.policy_no_remote_peers_be_in":"Policy: no remote peers. Be in the building or be in the transit bill.",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
/* Dark (#80): <html data-theme="dark">, set by the page's <head> from Settings › Theme (93-ui/15-theme.js). The panels take
|
||||
the night colours of the NOC window: dark paper, light text, the stickers' outlines darker still. Light tints (a goal
|
||||
to work on, a toast, a pick) are written where they are used as var(--tint-…, light colour): only this look sets them.
|
||||
Text on bright fills (yellow buttons, warning tags) stays dark ink in both looks. */
|
||||
Text on bright fills (yellow buttons, warning tags) stays dark ink in both looks. Red text is var(--tx-red,var(--bad)):
|
||||
--bad stays the fill under white letters, and as text on these cards it falls below AA. */
|
||||
:root[data-theme="dark"]{
|
||||
color-scheme:dark;
|
||||
--sea:#0E2A44; --ink:#070B16; --ink2:#A9B7D8; --text:#E9EFFB; --paper:#1A2340; --soft:#232E50; --line:#364470; --eye:#2BC987;
|
||||
--tint-y:#3B3418; --tint-g:#173B2C; --tint-r:#45212B; --tint-p:#43213D; --tint-b:#17324F; --tint-v:#2C2752; --tint-o:#42301A;
|
||||
--tint-n:#252F4C; --tint-nl:var(--line); --tx-red:#FF8E9B; --tx-amber:#FFB65C;
|
||||
--tint-n:#252F4C; --tint-nl:var(--line); --tx-red:#FF8E9B; --tx-amber:#FFB65C; --tx-blue:#7FD3F5;
|
||||
scrollbar-color:#4A5B8E transparent;
|
||||
}
|
||||
/* The green of good news is lighter as text on dark paper; a tag keeps the deeper green under its white letters. */
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
.brand .val{font-size:20px}
|
||||
.brand .lbl{color:#FFE0EE}
|
||||
.tube{width:30px;height:30px;flex:none}
|
||||
.up{color:var(--ok)} .down{color:var(--bad)}
|
||||
.up{color:var(--ok)} .down{color:var(--tx-red,var(--bad))}
|
||||
.note{align-items:flex-start}.note .ndot{width:9px;height:9px;border-radius:50%;margin-top:6px;flex:none;background:var(--ink2);border:2px solid var(--ink)}
|
||||
.note.bad .ndot{background:var(--bad)}.note.good .ndot{background:var(--ok)}.note.goal .ndot{background:#FFD23F}
|
||||
.note .nbody{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,4 @@
|
|||
.pft-ck li{display:flex;gap:8px;align-items:flex-start;min-height:32px;margin:4px 0}
|
||||
.pft-ck li span:last-child{display:flex;flex-direction:column;min-width:0}
|
||||
.pft-ck small{font-size:12px;color:var(--ink2);overflow-wrap:anywhere}
|
||||
.pft-st{color:var(--bad);font-weight:800}
|
||||
.pft-st{color:var(--tx-red,var(--bad));font-weight:800}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ label.f+select.pick{width:100%}
|
|||
.mix{display:flex;height:10px;width:100px;border:1.5px solid var(--ink);border-radius:5px;overflow:hidden;background:var(--paper)}
|
||||
.mix i{display:block;height:100%}
|
||||
/* The NOC's traffic table has a row per network: classes, not inline styles, keep its hundreds of rows cheap to parse. */
|
||||
.nmc{display:inline-flex;align-items:center;gap:6px}.dlost{color:var(--bad)}.b.pall{display:block;margin-top:5px}
|
||||
.nmc{display:inline-flex;align-items:center;gap:6px}.dlost{color:var(--tx-red,var(--bad))}.b.pall{display:block;margin-top:5px}
|
||||
.tscroll{overflow-x:auto}
|
||||
#modal{position:fixed;inset:0;background:rgba(30,38,64,.45);display:grid;place-items:center;z-index:20;padding:16px max(16px,env(safe-area-inset-right,0px)) 16px max(16px,env(safe-area-inset-left,0px))}
|
||||
#modal .card{width:min(560px,100%);max-height:calc(100% - 20px);overflow:auto;padding:20px 22px}
|
||||
|
|
@ -229,5 +229,5 @@ h2 .rn{font-size:18px;vertical-align:middle;padding:2px 4px}
|
|||
.cmbar b{position:absolute;top:-4px;bottom:-4px;width:3px;margin-left:-1.5px;background:var(--ink);border-radius:2px}
|
||||
.cmbar u{position:absolute;top:-5px;bottom:-5px;width:0;margin-left:-1px;border-left:3px dotted var(--me)}
|
||||
.cmroute{align-items:flex-start}
|
||||
.tag.cmhot{background:#FFE1D6;color:#B43A12}
|
||||
.tag.cmcool{background:#DDF1FB;color:#1E6A8C}
|
||||
.tag.cmhot{background:var(--tint-o,#FFE1D6);color:var(--tx-amber,#B43A12)}
|
||||
.tag.cmcool{background:var(--tint-b,#DDF1FB);color:var(--tx-blue,#1E6A8C)}
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ body.pz #hud .chip:not(.brand):not(.speed),body.pz #hud .speed button:not(#muteB
|
|||
.pzc.s1{background:var(--tint-p,#FFE3F0)}.pzc.s2{background:var(--ok);color:#fff}
|
||||
.pzsrc{font-size:12px;font-weight:800;color:var(--ink2);margin:4px 0}
|
||||
.pzfl{margin:4px 0 6px}.pzf{margin:4px 0;padding:3px 6px;border:2px solid var(--line);border-radius:10px}.pzf.ok{border-color:var(--ok)}
|
||||
.pzf .kv{font-size:12px;gap:6px}.pzf .bar{margin:2px 0}.pzf .meta .bad{color:var(--bad);font-weight:900}.pzf .seg.pzrt{margin-top:3px}
|
||||
.pzf .kv{font-size:12px;gap:6px}.pzf .bar{margin:2px 0}.pzf .meta .bad{color:var(--tx-red,var(--bad));font-weight:900}.pzf .seg.pzrt{margin-top:3px}
|
||||
.pzpair{border-top:2px dashed var(--line);padding-top:4px;margin-top:4px}.pzhave{font-size:13px;font-weight:800;margin:6px 0;padding:4px 8px;border-radius:10px;background:var(--tint-y,#FFF4D6)}
|
||||
.pznote{font-weight:800;font-size:13.5px;margin:8px 0;padding:8px 10px;border:2.5px solid var(--ink);border-radius:12px;background:var(--tint-y,#FFF3C4)}
|
||||
.row.on{background:var(--tint-p,#FFE3F0);border-radius:10px}
|
||||
.pztw{font-size:12.5px;font-weight:800;color:var(--bad);margin:3px 0}.pztw.ok{color:var(--eye)}.pztw.rule{color:var(--ink2)}
|
||||
.pztw{font-size:12.5px;font-weight:800;color:var(--tx-red,var(--bad));margin:3px 0}.pztw.ok{color:var(--eye)}.pztw.rule{color:var(--ink2)}
|
||||
.pzbud{margin:6px 0}.pzbud .kv{font-size:12.5px}
|
||||
.pzn1{font-size:12.5px;font-weight:800;margin:6px 0;padding:4px 8px;border:2px solid var(--line);border-radius:10px;color:var(--ink2)}
|
||||
.pzn1.on{border-color:var(--ok);background:var(--tint-g,#DFFBEA);color:var(--text);animation:pzglow 1.6s ease-in-out infinite}.pzn1.bad{border-color:var(--warn);background:var(--tint-y,#FFF4D6);color:var(--text)}
|
||||
|
|
@ -62,7 +62,7 @@ body.pz #hud .chip:not(.brand):not(.speed),body.pz #hud .speed button:not(#muteB
|
|||
.pzd-stars{display:flex;gap:2px;flex:none}
|
||||
.pzd-st{display:inline-grid;place-items:center;width:22px;height:22px;border:2px solid var(--line);border-radius:50%;font:900 11px var(--body);color:var(--ink2);box-sizing:border-box}
|
||||
.pzd-st.on{border:0;font-size:17px}.pzd-st.cur{border-color:var(--warn);background:var(--tint-y,#FFF4D6);color:var(--text)}
|
||||
.pzd-bud{flex:none;font-weight:900;font-size:12.5px;font-variant-numeric:tabular-nums;white-space:nowrap}.pzd-bud.bad{color:var(--bad)}
|
||||
.pzd-bud{flex:none;font-weight:900;font-size:12.5px;font-variant-numeric:tabular-nums;white-space:nowrap}.pzd-bud.bad{color:var(--tx-red,var(--bad))}
|
||||
#pzBox.dock .pzd-bar .b.sm{min-width:36px;min-height:36px;padding:2px 8px;font-size:16px}
|
||||
.pzd-goal{display:flex;align-items:center;gap:8px;margin-top:6px;padding:5px 8px;background:var(--tint-y,#FFF4D6);border:2px solid var(--warn);border-radius:12px}
|
||||
.pzd-goal.done{background:var(--tint-g,#DFFBEA);border-color:var(--ok)}.pzd-goal.bad{background:var(--tint-r,#FFE6E9);border-color:var(--bad)}
|
||||
|
|
@ -73,7 +73,7 @@ body.pz #hud .chip:not(.brand):not(.speed),body.pz #hud .speed button:not(#muteB
|
|||
.pzd-ga{flex:none;display:flex;flex-direction:column;gap:4px}#pzBox.dock .pzd-ga{margin-left:auto}#pzBox.dock .pzd-ga .b{min-height:32px;padding:2px 10px;font-size:13px;white-space:nowrap}
|
||||
.pzd-chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
|
||||
.pzd-chip{font:800 12px/1.2 var(--body);color:var(--text);background:var(--paper);border:2px solid var(--line);border-radius:999px;padding:3px 8px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
|
||||
.pzd-chip b{font-weight:900;font-variant-numeric:tabular-nums}.pzd-chip .bad{color:var(--bad)}
|
||||
.pzd-chip b{font-weight:900;font-variant-numeric:tabular-nums}.pzd-chip .bad{color:var(--tx-red,var(--bad))}
|
||||
.pzd-chip.ok{border-color:var(--ok);background:var(--tint-g,#DFFBEA)}.pzd-chip.part{border-color:var(--warn);background:var(--tint-y,#FFF4D6)}.pzd-chip.none{border-color:var(--bad);background:var(--tint-r,#FFE6E9)}
|
||||
.pzd-chip.rule{cursor:default;color:var(--ink2)}
|
||||
/* The card: as tall as its tab, under the bar at most; tabs keep each part short enough to need no scrolling. */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
.arsites{display:flex;flex-wrap:wrap;gap:5px;margin:4px 0 6px}
|
||||
.arsite{font-weight:900;font-size:12px;border:2px solid var(--line);border-radius:999px;padding:1px 8px;background:var(--paper);color:var(--ink2)}
|
||||
.arsite.ok{border-color:var(--ok);color:var(--text)}.arsite.gold{border-color:#E5484D;background:var(--tint-r,#FFE8E8)}
|
||||
.arline{font-size:12.5px;font-weight:800;margin:3px 0;color:var(--ink2)}.arline.ok{color:var(--text)}.arline.bad{color:var(--bad)}
|
||||
.arline{font-size:12.5px;font-weight:800;margin:3px 0;color:var(--ink2)}.arline.ok{color:var(--text)}.arline.bad{color:var(--tx-red,var(--bad))}
|
||||
.arshape{font-size:12.5px;font-weight:900;margin:4px 0}
|
||||
.arrev{font-size:12.5px;font-weight:800;margin:6px 0;padding:5px 8px;border:2px solid var(--line);border-radius:10px;color:var(--ink2)}
|
||||
.arrev.on{border-color:#FF8A3D;background:var(--tint-o,#FFF0E3);color:var(--text)}.arrev.ok{border-color:var(--ok);background:var(--tint-g,#DFFBEA);color:var(--text)}
|
||||
|
|
|
|||
|
|
@ -330,6 +330,40 @@ test('the day says it once when homes go behind CGNAT, and when even CGNAT canno
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
// The notices came with an Address space button, but their line in the NOC's notifications had no Open: the log did not
|
||||
// know the button (openOf), so it fell back to the text, which names no POP. Open now goes where the button went.
|
||||
test('an address-space notice in the notifications opens the bank at its Address space, and the NOC window may ask for it', (t) => {
|
||||
const { ev, dom, errors } = game(t);
|
||||
const doc = dom.window.document;
|
||||
// Where the bank scrolls to: the Address space's own button scrolls it into view.
|
||||
ev("S.log=[];window.__into=[];(()=>{const s=Element.prototype.scrollIntoView;Element.prototype.scrollIntoView=function(){__into.push(this.id);if(s)return s.apply(this,arguments);};})()");
|
||||
homes(ev, 250);
|
||||
ev('ip4Day(S.day)');
|
||||
assert.match(ev('S.log[0].t'), /Your IPv4 is full/);
|
||||
assert.deepEqual(J(ev, 'S.log[0].o'), { a: 'ip4' });
|
||||
ev("closeModal();ACT.leftTab({t:'noc'})");
|
||||
const b = doc.querySelector(`#leftBody [data-act=logOpen][data-args='${lit({ id: ev('S.log[0].id') })}']`);
|
||||
assert.ok(b, 'the notice has an Open button');
|
||||
b.click();
|
||||
assert.equal(doc.getElementById('bankBox').hidden, false, 'the bank is open');
|
||||
assert.ok(doc.getElementById('bankIp4'));
|
||||
assert.deepEqual(J(ev, '__into'), ['bankIp4'], 'at its Address space');
|
||||
// A renewal that could not grow carries the same button.
|
||||
biz(ev, { id: 'h1', name: 'Hoster' });
|
||||
ev("ACT.bankClose();S.log=[];ip4News([[S.biz.find(b=>b.id==='h1'),20]])");
|
||||
assert.deepEqual(J(ev, 'S.log[0].o'), { a: 'ip4' });
|
||||
// Kept in the save; with IPv4 off (a save from a gentler preset) it still opens the bank.
|
||||
ev("S=migrate(JSON.parse(JSON.stringify(S)));");
|
||||
assert.deepEqual(J(ev, 'S.log[0].o'), { a: 'ip4' });
|
||||
ev("ACT.bankClose();S.rules.ip4=false;__into.length=0;ACT.logOpen({id:S.log[0].id})");
|
||||
assert.equal(ev('ip4On()'), false);
|
||||
assert.equal(doc.getElementById('bankBox').hidden, false);
|
||||
assert.deepEqual(J(ev, '__into'), []);
|
||||
// The NOC window's clicks run in the game only from its list; the address space is on it (#150).
|
||||
assert.ok(ev("NOC_GO.includes('ip4Open')&&!NOC_LOCAL.includes('ip4Open')"));
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('rule off means no effect: gentler presets, sandbox, puzzles and scenarios unless they opt in', (t) => {
|
||||
const { ev, dom, errors } = game(t);
|
||||
assert.deepEqual(J(ev, "['soft','freeze','oncall','bgp','sandbox','puzzle'].map(p=>makeRules(p).ip4)"), [false, false, null, null, false, false], 'On-call and BGP keep the default (on), written nowhere');
|
||||
|
|
|
|||
209
tests/bstd-ipv6-only.test.js
Normal file
209
tests/bstd-ipv6-only.test.js
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
// The build standard's "Broadband: IPv6-only" row (96-pop-standard.js, the swap itself in 34-ipv6-only.js): every
|
||||
// broadband city still on dual stack starts its home-router swap, the most dual-stack homes first, priced as the city
|
||||
// panel prices it (the whole swap, paid as the routers go in), from the sheet's button or the intern's standing order,
|
||||
// within the order's budget and the cash floor. Only while IPv4 is scarce (rule ip4).
|
||||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
const { lit } = require('../scripts/lib/js-literal');
|
||||
|
||||
// On-call (IPv4 is scarce), plenty of cash, nothing breaking. Broadband in Amsterdam (3,000 homes), Frankfurt (1,300) and
|
||||
// Paris (500): their swaps cost $12k, $5.2k and $2k.
|
||||
const BASE = "ACT.start({});if(UI.pendGame)ACT.pitchSkip();S.rules=makeRules('oncall');S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;S.lvl=9;S.nextFail=S.nextEvent=1e9;UI.speed=0;S.offers=[];S.biz=[];" +
|
||||
"ACT.launchBB({city:'fra'});S.pops.fra.rgen=3;ACT.buyTransit({city:'fra',net:'lvl',tier:3});for(const c of ['ams','par']){ACT.buildPop({city:c});ACT.launchBB({city:c});}" +
|
||||
"S.pops.fra.bb.d=130;S.pops.ams.bb.d=300;S.pops.par.bb.d=50;compute()";
|
||||
function game(t, opts) {
|
||||
const h = load(opts);
|
||||
t.after(() => h.dom.window.close());
|
||||
h.ev(BASE);
|
||||
return h;
|
||||
}
|
||||
const J = (ev, x) => JSON.parse(ev(`JSON.stringify(${x})`));
|
||||
const std = (ev, d) => ev(`S.popStd=${lit(d)}`);
|
||||
const v6 = (ev, plan = 'bstdPlan(false)') => J(ev, `${plan}.filter(j=>j.k==='v6').map(j=>[j.c,j.cost])`);
|
||||
const swapping = ev => J(ev, "['ams','fra','par'].filter(c=>S.pops[c].bb.v6e)");
|
||||
const COST = { ams: 12000, fra: 5200, par: 2000 };
|
||||
|
||||
test('the row: every dual-stack broadband city, the most homes first, at the swap\'s own price and its IPv4 bill', (t) => {
|
||||
const h = game(t, { agent: true });
|
||||
const { ev, errors } = h;
|
||||
assert.equal(ev('ip4On()'), true);
|
||||
assert.deepEqual(J(ev, "['ams','fra','par'].map(ip6Cost)"), [COST.ams, COST.fra, COST.par]);
|
||||
assert.deepEqual(v6(ev), [], 'no standard, no jobs');
|
||||
std(ev, { v6: true });
|
||||
assert.deepEqual(v6(ev), [['ams', COST.ams], ['fra', COST.fra], ['par', COST.par]], 'Amsterdam first: the most homes behind CGNAT');
|
||||
assert.equal(ev('bstdLine(bstd())'), '1 more target');
|
||||
// The plan's running costs are the IPv4 bill with every city done, against today's.
|
||||
const want = ev("(()=>{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}};for(const c of ['ams','fra','par'])s.pops[c]={...S.pops[c],bb:{...S.pops[c].bb,v6:1}};return m(ip4Bill(eye,s))-m(ip4Bill(eye));})()");
|
||||
const q = J(ev, 'bstdQuote(false)');
|
||||
assert.deepEqual([q.pops, q.n, q.cost], [3, 3, COST.ams + COST.fra + COST.par]);
|
||||
assert.equal(q.mo, Math.round(want));
|
||||
// A city already swapping, one done, one with no homes yet: nothing to do there.
|
||||
ev("S.pops.ams.bb.v6e=S.day+40;S.pops.par.bb.v6=1;ACT.buildPop({city:'lon'});ACT.launchBB({city:'lon'});S.pops.lon.bb.d=0;compute()");
|
||||
assert.deepEqual(v6(ev), [['fra', COST.fra]]);
|
||||
// A POP the intern is told to leave alone keeps its routers as they are.
|
||||
ev("ACT.opsHire({id:'annie'});closeModal();S.ops.skip.fra=['std']");
|
||||
assert.deepEqual(v6(ev, 'bstdPlan(true)'), []);
|
||||
assert.deepEqual(v6(ev), [['fra', COST.fra]], 'the button is not the intern');
|
||||
// The MCP tools: the target and the quote.
|
||||
ev("S.popStd=null;apiRun('bstdSet',{k:'v6'})");
|
||||
assert.deepEqual(J(ev, 'S.popStd'), { rt: 1, v6: true });
|
||||
assert.equal(J(ev, "apiRun('bstdApply',{},{dryRun:true})").quote.setup, COST.fra);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the button starts every swap it can pay in full, on top of what the swaps under way still owe', (t) => {
|
||||
const { ev, dom, errors } = game(t);
|
||||
std(ev, { v6: true });
|
||||
// Enough for Amsterdam and Paris, not for Frankfurt as well: the busiest first, then whatever still fits.
|
||||
ev(`S.cash=${COST.ams + COST.fra - 1};ACT.bstdOpen()`);
|
||||
const btn = dom.window.document.querySelector('#modalCard [data-act="bstdApply"]');
|
||||
assert.equal(btn.textContent, `Bring everything up now · ${ev(`fmt$(${COST.ams + COST.fra + COST.par})`)}`);
|
||||
btn.click();
|
||||
assert.deepEqual(swapping(ev), ['ams', 'par']);
|
||||
assert.equal(ev('S.cash'), COST.ams + COST.fra - 1, 'nothing paid yet: the routers are paid as they go in');
|
||||
assert.equal(ev('ip6Owed()'), COST.ams + COST.par);
|
||||
const said = `2 jobs done for the build standard, ${ev(`fmt$(${COST.ams + COST.par})`)}.`;
|
||||
assert.ok(dom.window.document.getElementById('toasts').textContent.includes(said), 'the toast counts the swaps whole, as the quote did');
|
||||
// Day by day the swaps pay what the button counted, and Frankfurt waits for the money.
|
||||
ev('for(let i=0;i<60;i++){S.day++;ip4Day(S.day);}compute()');
|
||||
assert.deepEqual(J(ev, "['ams','par'].map(c=>S.pops[c].bb.v6)"), [1, 1]);
|
||||
assert.ok(Math.abs(ev('S.cash') - (COST.fra - 1 - COST.par)) < 1e-6, 'the swaps cost what the button counted: ' + ev('S.cash'));
|
||||
assert.deepEqual(v6(ev), [['fra', COST.fra]]);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test("the intern rolls it out within the order's budget and the cash floor, and the shift log names the cities", (t) => {
|
||||
const { ev, errors } = game(t);
|
||||
std(ev, { v6: true });
|
||||
ev("ACT.opsHire({id:'annie'});closeModal();S.ops.on.std=true;S.ops.floor=0;S.ops.cap.std=OPS_CAPS[0]");
|
||||
// A $10k month: Amsterdam's $12k swap never fits it; Frankfurt and Paris do.
|
||||
const c0 = ev('S.cash');
|
||||
ev('opsDay(S.day)');
|
||||
assert.deepEqual(swapping(ev), ['fra', 'par']);
|
||||
assert.equal(ev('S.ops.spent.std'), COST.fra + COST.par, 'the whole swaps count against the month');
|
||||
assert.equal(ev('S.cash'), c0, 'and are paid as the routers go in');
|
||||
const e = J(ev, 'S.ops.log[0]');
|
||||
assert.equal(e.up, undefined, 'nothing paid up front');
|
||||
assert.ok(e.r.some(x => x[0] === 'broke'), 'Amsterdam waits for the budget');
|
||||
assert.match(ev('opsLine(S.ops.log[0])'), /did 2 jobs for the build standard \(Frankfurt IPv6, Paris IPv6\)/);
|
||||
assert.equal(ev('S.ops.log[0].r.find(x=>x[0]===\'std\')[2].every(opsWhereOk)'), true, 'the log survives a save');
|
||||
// No budget, a $50k floor and $15k above it: Amsterdam starts; Frankfurt does not fit on top of what Amsterdam owes,
|
||||
// Paris does.
|
||||
ev("for(const c of ['fra','par']){delete S.pops[c].bb.v6e;delete S.pops[c].bb.v6;}S.ops.cap.std=0;S.ops.floor=50000;S.cash=50000+15000;S.day++;compute();opsDay(S.day)");
|
||||
assert.deepEqual(swapping(ev), ['ams', 'par']);
|
||||
assert.equal(ev('S.cash'), 65000);
|
||||
// Paid down, the next shift starts Frankfurt.
|
||||
ev('for(let i=0;i<60;i++){S.day++;ip4Day(S.day);}S.cash=1e6;compute();opsDay(S.day)');
|
||||
assert.deepEqual(swapping(ev), ['fra']);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
// Only Amsterdam has homes to swap: one $12k swap. A quiet lite fiber Frankfurt–Paris for the line-system target.
|
||||
const AMS_ONLY = "S.pops.fra.bb.d=0;S.pops.par.bb.d=0;compute()";
|
||||
const FIBER = "S.links.push({id:'q',a:'fra',b:'par',kind:'df',own:false,sys:'lite',ch:[],km:Math.round(kmBetween('fra','par')),sub:false,cable:null,mo:1000,trench:'q',cut:0,day:0,ready:0,spares:false});compute()";
|
||||
|
||||
test("what a swap still owes stays above the intern's cash floor for every job after it, in every order", (t) => {
|
||||
const { ev, errors } = game(t);
|
||||
ev(AMS_ONLY);
|
||||
ev("ACT.opsHire({id:'annie'});closeModal();for(const k in S.ops.on)S.ops.on[k]=false;S.ops.on.std=true;S.ops.floor=50000;S.ops.cap.std=1e6");
|
||||
std(ev, { v6: true });
|
||||
ev(`S.cash=50000+${COST.ams}+500;opsDay(S.day)`);
|
||||
assert.deepEqual(swapping(ev), ['ams']);
|
||||
assert.equal(ev('ip6Owed()'), COST.ams);
|
||||
// The next day the standard wants a generator at every POP too. The cash above the floor covers one only with the
|
||||
// swap's money: it waits.
|
||||
assert.equal(ev('GEN_COST'), 12000);
|
||||
std(ev, { v6: true, gen: true });
|
||||
ev('S.day++;compute();opsDay(S.day)');
|
||||
assert.deepEqual(J(ev, 'Object.keys(S.pops).filter(c=>S.pops[c].gen)'), []);
|
||||
assert.deepEqual(J(ev, 'S.ops.log[0].r'), [['broke', 1, ['std']]]);
|
||||
// With no income at all, the swap then pays its routers day by day and never takes the cash under the floor.
|
||||
const low = ev('(()=>{let m=S.cash;for(let i=0;i<60;i++){S.day++;ip6Day(S.day);m=Math.min(m,S.cash);}return m;})()');
|
||||
assert.equal(ev('S.pops.ams.bb.v6'), 1);
|
||||
assert.ok(low >= 50000 - 1e-6, 'the floor held: ' + low);
|
||||
// A swap started by hand is owed too, and every order keeps it aside: the routers order here.
|
||||
ev("S.pops.ams.bb.d=600;delete S.pops.ams.bb.v6;compute();ACT.ip6Go({city:'ams'})");
|
||||
assert.equal(ev('!!S.pops.ams.bb.v6e'), true);
|
||||
const owed = ev('ip6Owed()');
|
||||
assert.ok(owed > 0);
|
||||
assert.deepEqual(J(ev, `(()=>{const r=[];for(const d of [-1,0]){S.cash=50000+1000+${owed}+d;r.push(opsShift().can('routers',1000));}return r;})()`), [false, true]);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the button keeps what a swap it just started owes for the jobs after it in the same click', (t) => {
|
||||
const { ev, dom, errors } = game(t);
|
||||
ev(AMS_ONLY);
|
||||
ev(FIBER);
|
||||
std(ev, { v6: true, sys: 'roadm' });
|
||||
const plan = J(ev, 'bstdPlan(false).map(j=>[j.k,j.w,j.cost])');
|
||||
assert.deepEqual(plan.map((j) => j.slice(0, 2)), [['v6', 'ams IPv6'], ['sys', 'fra|par']], 'the swap first, then the fiber');
|
||||
const sys = plan[1][2];
|
||||
// A dollar short of both: the swap starts, and the fiber waits rather than spend the swap's routers.
|
||||
ev(`S.cash=${COST.ams + sys - 1};ACT.bstdApply({})`);
|
||||
assert.deepEqual(swapping(ev), ['ams']);
|
||||
assert.equal(ev("S.links.find(l=>l.id==='q').sys"), 'lite');
|
||||
assert.equal(ev('S.cash'), COST.ams + sys - 1);
|
||||
assert.ok(dom.window.document.getElementById('toasts').textContent.includes(`One job done for the build standard, ${ev(`fmt$(${COST.ams})`)}. One thing is still below it`), "the toast: the swap, and the fiber still below the standard");
|
||||
// A dollar more, and the next tap swaps the fiber with the swap's routers still in hand.
|
||||
ev('S.cash+=1;ACT.bstdApply({})');
|
||||
assert.equal(ev("S.links.find(l=>l.id==='q').sys"), 'roadm');
|
||||
assert.equal(ev('S.cash'), COST.ams);
|
||||
assert.equal(ev('ip6Owed()'), COST.ams);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('only while IPv4 is scarce: no row, no jobs and no count in the gentler rules; saves keep the target', (t) => {
|
||||
const { ev, dom, errors } = game(t);
|
||||
std(ev, { v6: true });
|
||||
ev("S.rules=makeRules('freeze');compute()");
|
||||
assert.equal(ev('ip4On()'), false);
|
||||
assert.deepEqual(v6(ev), []);
|
||||
assert.equal(ev('bstdLine(bstd())'), 'None');
|
||||
ev('ACT.bstdOpen()');
|
||||
const sel = [...dom.window.document.querySelectorAll('#modalCard select[data-chg="bstdSet"]')].map(s => JSON.parse(s.dataset.args).k);
|
||||
assert.ok(sel.length > 0 && !sel.includes('v6'), 'no IPv6-only list');
|
||||
assert.doesNotMatch(dom.window.document.getElementById('modalCard').textContent, /IPv6/);
|
||||
// The target stays in the standard: back on scarce IPv4 it is there again.
|
||||
ev("closeModal();S.rules=makeRules('oncall');compute()");
|
||||
assert.deepEqual(v6(ev).map(x => x[0]), ['ams', 'fra', 'par']);
|
||||
// Saves: the target round-trips; an old standard has none; junk is no target.
|
||||
const rt = d => J(ev, `(()=>{const s={popStd:${lit(d)}};popStdSanitize(s);return s.popStd;})()`);
|
||||
assert.deepEqual(rt({ rt: 1, v6: true }), { rt: 1, v6: true });
|
||||
assert.deepEqual(rt({ g: 1, rt: 2 }), { g: 1, rt: 2 });
|
||||
assert.equal(rt({ rt: 1, v6: 'yes' }), null);
|
||||
assert.deepEqual(J(ev, 'migrate(JSON.parse(JSON.stringify(S))).popStd'), { rt: 1, v6: true });
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('the sheet at 360 px, portrait and landscape, in every language: the row, its note and what is below it', () => {
|
||||
for (const lang of ['en', 'de', 'es', 'fr', 'it', 'pt']) {
|
||||
const { ev, dom, errors } = load(lang === 'en' ? {} : { lang });
|
||||
ev(BASE);
|
||||
const doc = dom.window.document;
|
||||
for (const [w, hgt] of [[360, 740], [740, 360]]) {
|
||||
ev(`window.innerWidth=${w};window.innerHeight=${hgt};S.popStd=null;closeModal();ACT.bstdOpen()`);
|
||||
assert.equal(ev('isPhone()'), true, lang);
|
||||
const sel = () => [...doc.querySelectorAll('#modalCard select[data-chg="bstdSet"]')].find(s => JSON.parse(s.dataset.args).k === 'v6');
|
||||
let s = sel();
|
||||
assert.ok(s && s.closest('.ops-sel'), lang + ': two to a row with the other POP targets');
|
||||
s.value = String(s.options.length - 1);
|
||||
s.dispatchEvent(new dom.window.Event('change', { bubbles: true }));
|
||||
assert.equal(ev('bstd().v6'), true, lang);
|
||||
assert.ok(ev('bstdShown()'), lang);
|
||||
s = sel();
|
||||
assert.equal(s.options[s.selectedIndex].textContent, ev("tr('bstd.every_bb_city')"), lang);
|
||||
const txt = doc.getElementById('modalCard').textContent;
|
||||
assert.ok(txt.includes(ev("tr('bstd.v6_note')")), lang + ': the note');
|
||||
assert.ok(txt.includes(ev(`fmt$(${COST.ams + COST.fra + COST.par})`)), lang + ': the bill');
|
||||
assert.doesNotMatch(txt, /\b(bstd|ops|pop_std|common|ip6)\.[a-z_0-9]+/, lang + ': a raw label');
|
||||
assert.doesNotMatch(txt, /\{[a-z]\w*\}|undefined|NaN/, lang);
|
||||
for (const b of doc.querySelectorAll('#modalCard button.b')) assert.ok(b.closest('.btns') || b.closest('.ops-h'), lang + ': ' + b.textContent);
|
||||
}
|
||||
// The city panel's line counts it.
|
||||
ev("closeModal();selectCity('fra');ACT.tab({t:'links'})");
|
||||
assert.ok(doc.getElementById('panelBody').textContent.includes(ev("trn('bstd.n_more_targets',1)")), lang);
|
||||
assert.deepEqual(errors, [], lang);
|
||||
dom.window.close();
|
||||
}
|
||||
});
|
||||
|
|
@ -283,6 +283,51 @@ test('a busy fiber with nothing parallel keeps its line system: the sheet, the b
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test("a customer's wave keeps its fiber's line system, for the button and the intern; leased pairs and IRUs do not", t => {
|
||||
const h = load({ agent: true });
|
||||
t.after(() => h.dom.window.close());
|
||||
const { ev, errors } = h;
|
||||
ev(BASE);
|
||||
const chonk = ev("RG.findIndex(r=>r.n==='Chonk 800')");
|
||||
ev(`ACT.buildPop({city:'par'});for(const c of ['fra','ams','par']){S.pops[c].rgen=${chonk};S.pops[c].routers=4;}`);
|
||||
// Two quiet fibers: Amsterdam's carries a carrier's managed 100G wave (Lambda Bazaar), Paris's nothing.
|
||||
const a = fiber(ev, 'fra', 'ams', ['zr4', 'zr4']), b = fiber(ev, 'fra', 'par', ['zr4', 'zr4']);
|
||||
ev(`S.biz.push({id:'mw',name:'Photon Express',city:'fra',city2:'ams',link:${lit(a)},slots:1,g:100,type:'mwave',bw:1,rate:1000,reqs:[],mood:100,since:S.day})`);
|
||||
const quiet = 'compute();for(const l of S.links)R.load[l.id]=0;';
|
||||
ev(quiet);
|
||||
assert.equal(ev("fiberOk(S.biz.find(b=>b.id==='mw'))"), true);
|
||||
std(ev, { sys: 'roadm' });
|
||||
const q = JSON.parse(ev('JSON.stringify(bstdQuote(false))'));
|
||||
assert.deepEqual([q.held, q.wv, q.wait, q.links, q.n], [['fra|ams'], ['fra|ams'], [], 2, 1], 'only Paris\'s fiber is on the bill');
|
||||
ev(`closeModal();${quiet}`);
|
||||
const dry = JSON.parse(ev("JSON.stringify(apiRun('bstdApply',{},{dryRun:true}))"));
|
||||
assert.match(dry.quote.blocked[0], /^Frankfurt–Amsterdam: its line system waits: a customer's wave rides it/);
|
||||
ev(`${quiet}ACT.bstdOpen()`);
|
||||
const txt = h.dom.window.document.getElementById('modalCard').textContent;
|
||||
assert.match(txt, /One fiber keeps its line system: a customer's wave rides it/);
|
||||
assert.doesNotMatch(txt, /until it is quiet/, 'not the reason a busy fiber waits for');
|
||||
ev(`${quiet}document.querySelector('#modalCard [data-act="bstdApply"]').click()`);
|
||||
const L = id => JSON.parse(ev(`JSON.stringify(S.links.find(l=>l.id===${lit(id)}))`));
|
||||
assert.equal(L(b).sys, 'roadm', 'the free fiber is swapped');
|
||||
assert.deepEqual([L(a).sys, L(a).eqDown > ev('S.day')], ['lite', false], 'the wave\'s fiber stays lit');
|
||||
ev('compute()');
|
||||
assert.equal(ev("fiberOk(S.biz.find(b=>b.id==='mw'))"), true, 'and the customer is served');
|
||||
// The intern waits on it too: no swap, however quiet.
|
||||
hire(ev, 'annie');
|
||||
ev(`S.day+=2;${quiet}opsDay(S.day)`);
|
||||
assert.equal(L(a).sys, 'lite');
|
||||
// Glass only (an IRU, or a hyperscaler's pairs on your own build) never notices a line-system swap: the intern goes ahead.
|
||||
for (const type of ['dfpair', 'pairs']) {
|
||||
ev(`S.links.find(l=>l.id===${lit(a)}).sys='lite';S.links.find(l=>l.id===${lit(a)}).own=true;S.biz=S.biz.filter(b=>b.id!=='mw'&&b.id!=='g');S.biz.push({id:'g',name:'Strand Theft Auto',city:'fra',city2:'ams',link:${lit(a)},type:'${type}',bw:1,rate:1000,reqs:[],mood:100,since:S.day})`);
|
||||
ev(`S.day+=2;${quiet}`);
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(bstdQuote(true).held)')), [], type + ': nothing waits');
|
||||
ev(`${quiet}opsDay(S.day)`);
|
||||
assert.deepEqual([L(a).sys, L(a).eqDown > ev('S.day')], ['roadm', true], type + ': the intern swapped it');
|
||||
assert.equal(ev("fiberOk(S.biz.find(b=>b.id==='g'))"), true, type + ': and the pair stays up');
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('optics a new router model takes are on the bill with it, and wait for its swap', t => {
|
||||
const { ev, errors } = game(t);
|
||||
// Edge Lords take no zr8: the Absolute Unit does.
|
||||
|
|
@ -304,7 +349,7 @@ test('optics a new router model takes are on the bill with it, and wait for its
|
|||
ev('ACT.bstdApply()');
|
||||
assert.equal(c0 - ev('S.cash'), q.cost);
|
||||
assert.deepEqual(JSON.parse(ev(`JSON.stringify(S.links.find(l=>l.id===${lit(a)}).ch)`)), ['zr8', 'zr8']);
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(bstdQuote(false))')), { cost: 0, mo: 0, pops: 0, ports: 0, links: 0, n: 0, held: [] }, 'one tap brought everything up');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(bstdQuote(false))')), { cost: 0, mo: 0, pops: 0, ports: 0, links: 0, n: 0, held: [], wait: [], wv: [] }, 'one tap brought everything up');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
|
@ -377,7 +422,7 @@ test('"Bring everything up now" spends what the quote said and does what it list
|
|||
const c0 = ev('S.cash');
|
||||
ev("document.querySelector('#modalCard [data-act=\"bstdApply\"]').click()");
|
||||
assert.equal(c0 - ev('S.cash'), q.cost, 'it cost exactly the quote');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(bstdQuote(false))')), { cost: 0, mo: 0, pops: 0, ports: 0, links: 0, n: 0, held: [] }, 'and everything is up to the standard');
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(bstdQuote(false))')), { cost: 0, mo: 0, pops: 0, ports: 0, links: 0, n: 0, held: [], wait: [], wv: [] }, 'and everything is up to the standard');
|
||||
assert.match(ev("document.getElementById('toasts').textContent"), /jobs done for the build standard/);
|
||||
assert.match(ev("document.getElementById('modalCard').textContent"), /Everything meets the standard/);
|
||||
assert.equal(ev('S.ixSite.ams'), 'ab');
|
||||
|
|
@ -435,8 +480,9 @@ test('the sheet at 360 px in every language: every list works by changing it, fr
|
|||
doc.querySelector('#modalCard [data-act="bstdOpen"]').click();
|
||||
assert.ok(ev('bstdShown()'), lang + ': from the menu');
|
||||
leaks();
|
||||
// Every target is a list; pick its last value and the standard follows, the sheet stays open and in focus.
|
||||
const keys = JSON.parse(ev('JSON.stringify(BSTD.map(x=>x.k))'));
|
||||
// Every target is a list; pick its last value and the standard follows, the sheet stays open and in focus. (IPv6-only
|
||||
// broadband is a target only while IPv4 is scarce, not in Change Freeze: tests/bstd-ipv6-only.test.js.)
|
||||
const keys = JSON.parse(ev('JSON.stringify(BSTD.filter(bstdOn).map(x=>x.k))'));
|
||||
assert.equal(doc.querySelectorAll('#modalCard select[data-chg="bstdSet"]').length, keys.length);
|
||||
for (const k of keys) {
|
||||
const s = [...doc.querySelectorAll('#modalCard select[data-chg="bstdSet"]')].find(x => JSON.parse(x.dataset.args).k === k);
|
||||
|
|
|
|||
|
|
@ -349,7 +349,8 @@ test('the dark look defines every token it is used with, and its text reads (AA)
|
|||
for (const m of css.matchAll(/var\(--([a-z0-9-]+)\)/g)) if (!/^(tabbar|app-h|c|rc|d|x|t|r|dl|pzdock)$/.test(m[1])) assert.ok(val(light, m[1]), `--${m[1]} is defined`);
|
||||
const bgs = ['paper', 'soft', 'tint-y', 'tint-g', 'tint-r', 'tint-p', 'tint-b', 'tint-v', 'tint-o', 'tint-n'].map((k) => [k, val(dark, k)]);
|
||||
for (const t of ['text', 'ink2', 'eye']) for (const [k, b] of bgs) assert.ok(cr(val(dark, t), b) >= 4.5, `--${t} on --${k}: ${cr(val(dark, t), b).toFixed(2)}`);
|
||||
for (const t of ['tx-red', 'tx-amber']) assert.ok(cr(val(dark, t), val(dark, 'paper')) >= 4.5, `--${t} on the dark paper`);
|
||||
// The text colours of warnings and tags read on every card and tint they sit on, not only on the paper.
|
||||
for (const t of ['tx-red', 'tx-amber', 'tx-blue']) for (const [k, b] of bgs) assert.ok(cr(val(dark, t), b) >= 4.5, `--${t} on --${k}: ${cr(val(dark, t), b).toFixed(2)}`);
|
||||
// The outline stays dark in both looks, so text on bright fills (yellow buttons, warning tags) keeps reading.
|
||||
assert.ok(cr(val(dark, 'ink'), '#FFD23F') >= 7, 'dark ink on the yellow buttons');
|
||||
// Badge labels (10px, so 4.5:1) on their night cards: each variant's gradient, and the dimmed card of one not earned now.
|
||||
|
|
@ -366,6 +367,47 @@ test('the dark look defines every token it is used with, and its text reads (AA)
|
|||
assert.ok(cr(val(dark, 'text'), val(dark, 'paper')) >= 3, 'at night the key\'s outline shows on the card');
|
||||
});
|
||||
|
||||
// Two things that kept their day colours at night: the capacity market's Hot and Cool tags (bright pastel chips on the
|
||||
// dark dashboard), and red warning text in var(--bad), 3.8 to 4.8:1 on the dark cards. --bad stays the fill under white
|
||||
// letters (buttons, counters, bars); text takes var(--tx-red,var(--bad)), which by day is --bad as before.
|
||||
test('at night the market\'s Hot and Cool tags take the dark tints, and red text reads (AA) on every card', () => {
|
||||
const html = assemble().html, css = html.slice(html.indexOf('<style>'), html.indexOf('</style>')).replace(/\/\*[\s\S]*?\*\//g, '');
|
||||
const block = (sel) => { const i = css.indexOf(sel + '{'); return css.slice(i, css.indexOf('}', i)); };
|
||||
const dark = block(':root[data-theme="dark"]'), light = block(':root');
|
||||
const val = (b, k) => { const m = new RegExp(`--${k}:\\s*([^;\\n]+);`).exec(b); return m && m[1].trim(); };
|
||||
const rules = css.split('}').map((r) => { const i = r.indexOf('{'); return i < 0 ? null : { sel: r.slice(0, i).split(',').map((x) => x.trim()), body: r.slice(i + 1) }; }).filter(Boolean);
|
||||
const decl = (sel, prop) => { let v = null; for (const r of rules) if (r.sel.includes(sel)) { const m = new RegExp(`(?:^|;)\\s*${prop}\\s*:\\s*([^;]+)`).exec(r.body); if (m) v = m[1].trim(); } return v; };
|
||||
// var(--token,fallback) as each look paints it: the dark value, or the fallback (the light look never sets the tint).
|
||||
const paint = (v, look) => { const m = /^var\(--([a-z-]+),\s*(#[0-9A-Fa-f]{6})\)$/.exec(v); assert.ok(m, `a themed colour: ${v}`); return look === 'dark' ? val(dark, m[1]) : (assert.equal(val(light, m[1]), null, `--${m[1]} is dark-only`), m[2]); };
|
||||
for (const [tag, bg, fg, was] of [['cmhot', 'tint-o', 'tx-amber', ['#FFE1D6', '#B43A12']], ['cmcool', 'tint-b', 'tx-blue', ['#DDF1FB', '#1E6A8C']]]) {
|
||||
const b = decl(`.tag.${tag}`, 'background'), c = decl(`.tag.${tag}`, 'color');
|
||||
assert.ok(b.startsWith(`var(--${bg},`) && c.startsWith(`var(--${fg},`), `.tag.${tag}: ${b} / ${c}`);
|
||||
assert.deepEqual([paint(b, 'light'), paint(c, 'light')], was, `.tag.${tag} looks as it did by day`);
|
||||
const r = cr(paint(c, 'dark'), paint(b, 'dark'));
|
||||
assert.ok(r >= 4.5, `.tag.${tag} at night: ${r.toFixed(2)}`);
|
||||
}
|
||||
// No tag keeps a bare pastel fill: it would be a bright patch on the dark panels.
|
||||
const pale = (h) => lum(h) > 0.5;
|
||||
for (const r of rules) if (!r.sel.some((s) => s.startsWith(':root')) && r.sel.some((s) => /\.tag\b/.test(s))) {
|
||||
const m = /(?:^|;)\s*background\s*:\s*(#[0-9A-Fa-f]{6})\b/.exec(r.body);
|
||||
assert.ok(!(m && pale(m[1])), `${r.sel.join(',')} has a bare pastel background ${m && m[1]}`);
|
||||
}
|
||||
// Red as text takes the dark-aware colour everywhere, in the styles and in the game's own markup and HUD (the test
|
||||
// above checks --tx-red on every card and tint). `color:var(--bad)`, `color:${x?'var(--bad)':…}`, `.style.color=…'var(--bad)'`.
|
||||
const RED = /(?<![-\w])color\s*(?::|=)\s*(?:\$\{[^}]*?|[^;'"`{}(]*?)'?(?<!--tx-red,)var\(--bad\)/g;
|
||||
const cssLeft = [...css.matchAll(RED)].map((m) => m[0]);
|
||||
assert.deepEqual(cssLeft, [], 'red text in the styles in --bad');
|
||||
const dir = path.join(__dirname, '..', 'src', 'game'), left = [];
|
||||
for (const f of fs.readdirSync(dir, { recursive: true }).filter((f) => f.endsWith('.js'))) {
|
||||
const s = fs.readFileSync(path.join(dir, f), 'utf8');
|
||||
for (const m of s.matchAll(RED)) left.push(`${f}: ${m[0].slice(-60)}`);
|
||||
}
|
||||
assert.deepEqual(left, [], 'red text in the game\'s markup in --bad');
|
||||
// The fills keep --bad (white letters on it): a button, a counter, a bar.
|
||||
assert.equal(decl('.b.red', 'background'), 'var(--bad)');
|
||||
assert.equal(decl('.b.red', 'color'), '#fff');
|
||||
});
|
||||
|
||||
test('the dashboard\'s Demand key matches its dashed line, by night too', () => {
|
||||
const { dom, ev, errors } = load({ storage: { 'sot-theme': 'dark' } });
|
||||
ev(started + "for(let i=0;i<3;i++)dayTick();ACT.dash({});");
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
const test = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { load } = require('./harness');
|
||||
const { createSession, TOOLS } = require('../scripts/lib/mcp-game');
|
||||
|
||||
// Three POPs on routers that take 400G optics, broadband in Paris, transit in Frankfurt, and two ROADM fibers
|
||||
// (s1 Frankfurt–Brussels, s2 Brussels–Paris), finished and dark. df(a,b,extra) lays another one.
|
||||
|
|
@ -139,6 +140,103 @@ test('reach: the light must make the whole run between regen sites, through Brus
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a regen site added later under an express needs a regen card for its channels too: the fiber panel and the MCP quote say so', (t) => {
|
||||
const { ev, errors } = game(t, SPANS + "ACT.buildPop({city:'ams'});S.pops.ams.rgen=1;window.s3=df('fra','ams');compute();");
|
||||
ev(BUILD + "ACT.xpCh({id:x,o:'zr4',d:1});L(s1).ch=['zr4'];compute()");
|
||||
assert.equal(ev('L(x).ch.length'), 2);
|
||||
const card = ev("Math.round(optCost('zr4')*REGEN_CH)"), two = ev("Math.round(optCost('zr4')*2*REGEN_CH)"), three = ev("Math.round(optCost('zr4')*3*REGEN_CH)");
|
||||
assert.equal(ev('regenAddCost(L(s3))'), ev('REGEN_COST'), 'a dark fiber with nothing in it: the hut alone');
|
||||
assert.equal(ev('regenAddCost(L(s2))'), ev('REGEN_COST') + two, 'two express channels and nothing of its own');
|
||||
assert.equal(ev('regenAddCost(L(s1))'), ev('REGEN_COST') + three, 'its own channel and the two expresses');
|
||||
// The fiber panel's button shows that price, and adding the site charges it.
|
||||
ev('selectLink(s2)');
|
||||
assert.ok(ev("$('panel').textContent").includes('Regen site ' + ev('fmt$(REGEN_COST+' + two + ')')), "the price on the fiber's regen button");
|
||||
let cash = ev('S.cash');
|
||||
ev('ACT.regen({id:s2,d:1})');
|
||||
assert.equal(ev('L(s2).regen'), 1);
|
||||
assert.equal(cash - ev('S.cash'), ev('REGEN_COST') + two);
|
||||
cash = ev('S.cash');
|
||||
ev('ACT.regen({id:s3,d:1})');
|
||||
assert.equal(cash - ev('S.cash'), ev('REGEN_COST'), 'no express on it: no card');
|
||||
// Lighting another channel afterwards pays its card at the new site, as before.
|
||||
cash = ev('S.cash');
|
||||
ev("ACT.xpCh({id:x,o:'zr4',d:1})");
|
||||
assert.equal(cash - ev('S.cash'), ev("optCost('zr4')") + card);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('a dirty connector in the glass under an express dims it too; an MTU mismatch, microbursts or a marginal optic there do not', (t) => {
|
||||
const { ev, errors } = game(t);
|
||||
ev(BUILD + "L(s1).ch=['zr4'];compute()");
|
||||
const cap = (id) => Math.round(ev(`capOf(L(${id}))`));
|
||||
assert.equal(cap('x'), 400);
|
||||
// The fiber's own routers and optics: the fiber suffers, the express riding past them does not.
|
||||
for (const [set, name] of [['L(s1).deg=S.day+3', 'an MTU mismatch'], ['L(s1).loss={until:S.day+3,f:0.8}', 'microbursts'], ['L(s1).loss={until:S.day+3,f:0.7}', 'a marginal optic']]) {
|
||||
ev(`L(s1).deg=0;L(s1).loss=null;${set};compute()`);
|
||||
assert.ok(cap('s1') < 400, name + ' slows the fiber');
|
||||
assert.equal(cap('x'), 400, name + ' leaves the express alone');
|
||||
}
|
||||
// A dirty connector is in the glass: every wave there, the express too.
|
||||
ev('L(s1).deg=0;L(s1).loss=null;L(s2).loss={until:S.day+3,f:0.6,glass:true};compute()');
|
||||
assert.equal(cap('x'), 240, 'Brussels–Paris lets 60% through');
|
||||
assert.equal(ev('linkDown(L(x))'), false, 'dimmed, not dark');
|
||||
assert.ok(ev('R.load[x]') > 1, 'it still carries traffic');
|
||||
ev('selectLink(x)');
|
||||
assert.match(ev("$('panel').textContent"), /Brussels ⇄ Paris has a dirty connector: every wave in that fiber, this express too, runs at 60%/);
|
||||
ev('L(s1).loss={until:S.day+3,f:0.6,glass:true};compute()');
|
||||
assert.equal(cap('x'), 144, 'two dirty fibers: both bite');
|
||||
ev('L(s1).loss.until=S.day;L(s2).loss.until=S.day;compute();selectLink(x)');
|
||||
assert.equal(cap('x'), 400, 'cleaned: full rate again');
|
||||
assert.doesNotMatch(ev("$('panel').textContent"), /dirty connector/);
|
||||
// Dealt by the dice: on a fiber with channels of its own, only the dirty connector (the first of the three) is in the glass.
|
||||
for (const v of [0, 1, 2]) {
|
||||
ev(`L(s1).loss=null;L(s2).loss=null;S.inc=[];compute();{const q=[0.5,0.1,${(v + 0.5) / 3},0];const r0=Math.random;Math.random=()=>q.length?q.shift():r0();fireFailure('loss');Math.random=r0;}compute()`);
|
||||
assert.equal(ev('!!L(s2).loss'), false, 'the dice picked the fiber with its own channel');
|
||||
if (v !== 1) assert.ok(cap('s1') < 400, 'the fiber itself slows, variant ' + v);
|
||||
assert.equal(ev('!!(L(s1).loss&&L(s1).loss.glass)'), v === 0, 'variant ' + v);
|
||||
assert.equal(cap('x'), v === 0 ? 240 : 400, 'variant ' + v);
|
||||
}
|
||||
// A fiber that only carries expresses has nothing but glass to go wrong: the dice find it, and it is always the connector.
|
||||
ev("L(s1).ch=[];L(s1).loss=null;S.inc=[];compute();fireFailure('loss');compute()");
|
||||
assert.equal(ev('S.inc.at(-1).type'), 'loss');
|
||||
assert.ok(ev('[s1,s2].includes(S.inc.at(-1).ref)'));
|
||||
assert.equal(ev('L(S.inc.at(-1).ref).loss.glass'), true);
|
||||
assert.equal(cap('x'), 240);
|
||||
// Fixed: the express is back.
|
||||
ev('clearInc(S.inc.at(-1));compute()');
|
||||
assert.equal(cap('x'), 400);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('saves: a dirty connector keeps dimming the express after a reload; an old save\'s loss stays on its own fiber', (t) => {
|
||||
const { ev, errors } = game(t);
|
||||
ev(BUILD + "L(s2).loss={until:S.day+3,f:0.6,glass:true};compute()");
|
||||
ev('S=migrate(JSON.parse(JSON.stringify(S)));compute()');
|
||||
assert.equal(ev('JSON.stringify(L(s2).loss)'), ev('JSON.stringify({until:S.day+3,f:0.6,glass:true})'));
|
||||
assert.equal(Math.round(ev('capOf(L(x))')), 240);
|
||||
// A loss from before the connector was told apart, or a hand-edited flag that is not true: router-side, as it was.
|
||||
for (const loss of ['{until:S.day+3,f:0.6}', '{until:S.day+3,f:0.6,glass:"yes"}']) {
|
||||
ev(`{const o=JSON.parse(JSON.stringify(S));o.links.find(l=>l.id===s2).loss=${loss};S=migrate(o);compute();}`);
|
||||
assert.equal(ev('JSON.stringify(L(s2).loss)'), ev('JSON.stringify({until:S.day+3,f:0.6})'), loss);
|
||||
assert.equal(Math.round(ev('capOf(L(x))')), 400, loss);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('MCP: the dry run of a regen site under an express quotes what the game then charges', () => {
|
||||
const s = createSession(), T = (n, a = {}) => TOOLS.find((x) => x.name === n).run(s, a), ev = (x) => s.game.ev(x);
|
||||
T('new_game', { city: 'fra', preset: 'sandbox', seed: 7, name: 'Probe' });
|
||||
ev(BASE.replace(/^ACT\.start\(\{\}\);if\(UI\.pendGame\)ACT\.pitchSkip\(\);/, '') + SPANS + BUILD);
|
||||
assert.equal(ev("S.links.filter(l=>l.kind==='xp').length"), 1);
|
||||
const q = T('act', { action: 'regen', args: { id: ev('s1'), d: 1 }, dryRun: true }).quote;
|
||||
assert.deepEqual(q.blocked, []);
|
||||
assert.equal(q.setup, ev("REGEN_COST+Math.round(optCost('zr4')*REGEN_CH)"), 'the hut and a card for the express channel');
|
||||
const c0 = ev('S.cash');
|
||||
T('act', { action: 'regen', args: { id: ev('s1'), d: 1 } });
|
||||
assert.equal(q.setup, c0 - ev('S.cash'), 'quote equals charge');
|
||||
assert.deepEqual(s.errors(), []);
|
||||
});
|
||||
|
||||
test('slots: lit channels, sold alien waves and express channels share every line system', (t) => {
|
||||
const { ev, errors } = game(t);
|
||||
ev("L(s1).ch=Array(10).fill('zr4');S.biz.push({id:uid(),city:'fra',city2:'bru',link:s1,slots:53,type:'wwave',name:'Alien Co',bw:1,rate:1000,reqs:[],mood:100,since:S.day});for(const c of ['fra','bru','par'])S.pops[c].routers=4;compute()");
|
||||
|
|
|
|||
|
|
@ -69,6 +69,15 @@ test('no way around, or a customer on the fiber: no swap; bigger optics instead,
|
|||
heat(ev2);
|
||||
ev2('opsDay(S.day)');
|
||||
assert.equal(fiber(ev2).sys, 'lite');
|
||||
// A managed wave too. Leased pairs and IRUs are glass: the swap never touches them, so it goes ahead.
|
||||
for (const [type, sys] of [['mwave', 'lite'], ['dfpair', 'roadm'], ['pairs', 'roadm']]) {
|
||||
const { ev: ev3, errors: e3 } = game(t, `S.biz.push({id:'cx',name:'Customer',city:'fra',city2:'ams',type:'${type}',link:'f',slots:1,g:100,bw:1,rate:1})`);
|
||||
order(ev3, { at: 80, swap: false });
|
||||
heat(ev3);
|
||||
ev3('opsDay(S.day)');
|
||||
assert.equal(fiber(ev3).sys, sys, type);
|
||||
assert.deepEqual(e3, []);
|
||||
}
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -37,3 +37,55 @@ test('#321 a coast with no cable but a road in: reach it overland, never "hop th
|
|||
assert.doesNotMatch(t, /reach \./);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
// #83 in the fork: a teleport reaches small islands and remote towns, so "only a cable of your own can get there" was
|
||||
// wrong for Iqaluit and Adamstown (and Pevek's hint left satellites out). Once teleports are on sale (level 2) the hint
|
||||
// names the satellite too, with a button to the order sheet from each teleport of yours that reaches the city.
|
||||
test('#83 no cable lands there, but a satellite does: the hint says so, with the way to order it', () => {
|
||||
const { ev, dom, errors } = load();
|
||||
const doc = dom.window.document;
|
||||
ev("ACT.start({});if(UI.pendGame)ACT.pitchSkip();closeModal();S.cash=1e9;S.lvl=1;for(const g of GOALS)S.done[g.id]=0;S.nextFail=S.nextEvent=1e9;UI.speed=0");
|
||||
const own = (c) => ev(`tr('link_modal.no_subsea_cable_lands_in_city_own',{city:CITY.${c}.name})`);
|
||||
const ownSat = (c) => ev(`tr('link_modal.no_subsea_cable_lands_in_city_own_sat',{city:CITY.${c}.name})`);
|
||||
const none = (c) => ev(`tr('satellites.no_teleport_reaches_city',{city:CITY.${c}.name})`);
|
||||
const reach = (c) => ev(`tr('satellites.reachable_from_your_teleports',{city:CITY.${c}.name})`);
|
||||
assert.notEqual(ownSat('yfb'), 'link_modal.no_subsea_cable_lands_in_city_own_sat', 'the new text is there');
|
||||
// Level 1: no teleport on sale yet, the hint is as before.
|
||||
let t = card(ev, 'nuk', 'yfb');
|
||||
assert.ok(t.includes(own('yfb')), t);
|
||||
assert.doesNotMatch(t, /satellite/i);
|
||||
// Level 2: a bird sees Iqaluit and Adamstown, so the cable is not the only way; no teleport of yours reaches them yet.
|
||||
ev('S.lvl=2');
|
||||
for (const [a, b] of [['nuk', 'yfb'], ['yfb', 'nuk'], ['nyc', 'pcn']]) {
|
||||
const c = b === 'nuk' ? a : b;
|
||||
t = card(ev, a, b);
|
||||
assert.ok(t.includes(ownSat(c)) && !t.includes(own(c)), `${a}→${b}: ${t}`);
|
||||
assert.ok(t.includes(none(c)), `${a}→${b} says where a teleport would have to go: ${t}`);
|
||||
assert.match(t, /level 9 or Tier 1/, 'the cable of your own is still offered');
|
||||
}
|
||||
// Pevek has a road in: that text stays, and the satellite comes after it. Alice Springs has no beach at all.
|
||||
t = card(ev, 'nyc', 'pvs');
|
||||
assert.ok(t.includes(ev("tr('link_modal.no_subsea_cable_lands_in_city_land',{city:CITY.pvs.name})")) && t.includes(none('pvs')), t);
|
||||
t = card(ev, 'nyc', 'asp');
|
||||
assert.ok(t.includes(none('asp')), t);
|
||||
// Murmansk is no remote town: no satellite serves it.
|
||||
t = card(ev, 'nyc', 'mmk');
|
||||
assert.doesNotMatch(t, /satellite|teleport/i, t);
|
||||
// A teleport in New York sees Iqaluit over the Americas bird: a button to the order sheet, from there.
|
||||
ev("ACT.buildPop({city:'nyc'});closeModal();ACT.teleBuild({city:'nyc'})");
|
||||
assert.ok(ev("teleOf('nyc')===1&&satBirds('nyc','yfb').includes('gx19')"));
|
||||
ev("window.innerWidth=360;window.innerHeight=740;UI.lmode='wave';openLinkModal('nuk','yfb')");
|
||||
t = doc.getElementById('modalCard').textContent;
|
||||
assert.ok(t.includes(ownSat('yfb')) && t.includes(reach('yfb')) && !t.includes(none('yfb')), t);
|
||||
const go = [...doc.querySelectorAll('#modalCard [data-act="satOpen"]')];
|
||||
assert.deepEqual(go.map((b) => JSON.parse(b.dataset.args)), [{ a: 'nyc', b: 'yfb' }]);
|
||||
go[0].click();
|
||||
assert.equal(doc.getElementById('modal').hidden, false);
|
||||
assert.match(doc.getElementById('modalCard').textContent, /New York → Iqaluit/);
|
||||
assert.ok(doc.querySelector('#modalCard [data-act="buySat"]'), 'the order sheet, with its circuits');
|
||||
ev('closeModal()');
|
||||
// Not in a puzzle, as the satellites themselves.
|
||||
ev("localStorage.removeItem('sot-puzzles');pzBegin(pzDef('baltic'));closeModal()");
|
||||
assert.equal(ev("JSON.stringify([pzOn(),satCan('yfb')])"), '[true,false]');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -107,6 +107,74 @@ test('a teleport and a GEO circuit: level, price, lead time, capacity, latency,
|
|||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('selective peers will not meet you on an island only a satellite reaches: many refuse GEO, few MEO, none once a cable lands', (t) => {
|
||||
// Suva has an exchange with the big content networks on it; Sydney's teleport reaches it over Intelsplat 18.
|
||||
const { ev, errors } = game(t, "ACT.buildPop({city:'syd'});ACT.launchBB({city:'syd'});ACT.buyTransit({city:'syd',net:'cog',tier:1});ACT.teleBuild({city:'syd'});ACT.buySat({a:'syd',b:'suv',bird:'is18',g:5});");
|
||||
ev('window.innerWidth=360;window.innerHeight=740;window.dispatchEvent(new window.Event("resize"))');
|
||||
ev(ready + ";ACT.buyIx({city:'suv',tier:0});closeModal();compute()");
|
||||
assert.equal(ev("S.ixp.suv"), 0, 'a port on the island exchange');
|
||||
assert.equal(ev("satOnly('suv').bird"), 'is18', 'the circuit is the only way out of Suva');
|
||||
assert.equal(ev("satOnly('syd')"), null, 'Sydney is no island');
|
||||
const sel = J(ev, "ixMembers('suv').filter(id=>NET[id].pol==='selective')");
|
||||
const geoNo = sel.filter((id) => ev(`noSat('${id}','geo')`));
|
||||
assert.ok(geoNo.length > 0 && geoNo.length < sel.length, 'some selective members refuse, some do not: ' + geoNo.join(','));
|
||||
const ms = ev(`Math.round(2*satLat(${sat}))`);
|
||||
assert.ok(ms > 500 && ms < 650, 'a GEO round trip: ' + ms);
|
||||
for (const id of geoNo) {
|
||||
for (const via of ['ix', 'pni']) {
|
||||
const r = J(ev, `peerOk('${id}','${via}','suv')`);
|
||||
assert.equal(r.ok, false, id + ' ' + via);
|
||||
assert.equal(r.sat, true, id + ' ' + via);
|
||||
assert.equal(r.why, `Won't peer in Suva while a GEO satellite is your only way out (${ms} ms there and back): they want your backbone where they meet you.`);
|
||||
}
|
||||
}
|
||||
for (const id of sel.filter((x) => !geoNo.includes(x))) assert.ok(!J(ev, `peerOk('${id}','ix','suv')`).sat, id + ' does not mind');
|
||||
for (const id of J(ev, "ixMembers('suv').filter(id=>NET[id].pol==='open')")) assert.equal(ev(`peerOk('${id}','ix','suv').ok`), true, id + ' is open');
|
||||
// A session from before stays on the books but carries nothing while only the satellite reaches the island.
|
||||
const k = geoNo[0];
|
||||
ev(`S.peers['${k}@suv']=true;compute()`);
|
||||
assert.equal(ev(`ixSessions('suv').has('${k}')`), false);
|
||||
assert.equal(ev(`!!S.peers['${k}@suv']`), true, 'not torn down');
|
||||
// Glass to the island with no optics yet carries nothing: the satellite is still the way out until it is lit.
|
||||
const d1 = "S.links.find(l=>l.id==='d1')";
|
||||
ev("S.links.push({id:'d1',a:'syd',b:'suv',kind:'df',own:false,sys:'roadm',ch:[],km:Math.round(kmBetween('syd','suv')),sub:true,cable:null,mo:1,trench:'d1',cut:0,day:0,ready:0,spares:false,regen:0});compute()");
|
||||
assert.equal(ev(`linkDown(${d1})`), true);
|
||||
assert.equal(ev("satOnly('suv').bird"), 'is18', 'dark glass is no way out');
|
||||
for (const id of geoNo) assert.equal(J(ev, `peerOk('${id}','pni','suv')`).sat, true, id + ' over dark glass');
|
||||
assert.equal(ev(`ixSessions('suv').has('${k}')`), false);
|
||||
const opt = ev(`Object.keys(OPT).find(o=>optG(o,${d1})>0)`);
|
||||
assert.ok(opt, 'an optic that reaches Suva');
|
||||
ev(`${d1}.ch=['${opt}'];compute()`);
|
||||
assert.equal(ev("satOnly('suv')"), null, 'lit');
|
||||
assert.equal(ev(`ixSessions('suv').has('${k}')`), true);
|
||||
ev("S.links=S.links.filter(l=>l.id!=='d1');compute()");
|
||||
assert.equal(ev("satOnly('suv').bird"), 'is18');
|
||||
// The why, in the island's exchange section, at 360 px.
|
||||
ev("UI.sel={type:'city',id:'suv'};UI.tab='peer';renderAll()");
|
||||
assert.ok(ev("$('panel').textContent").includes(`Won't peer in Suva while a GEO satellite is your only way out (${ms} ms there and back)`));
|
||||
// Fewer selective networks mind a MEO hop, and only ones that also mind GEO; the faster circuit is the one they judge.
|
||||
const all = J(ev, "NETS.filter(n=>n.pol==='selective').map(n=>[n.id,noSat(n.id,'geo'),noSat(n.id,'meo')])");
|
||||
const nGeo = all.filter((x) => x[1]).length, nMeo = all.filter((x) => x[2]).length;
|
||||
assert.ok(nMeo > 0 && nMeo < nGeo / 2, `MEO ${nMeo}, GEO ${nGeo}`);
|
||||
assert.ok(all.every((x) => !x[2] || x[1]), 'a network that minds MEO minds GEO too');
|
||||
ev("ACT.teleTrk({city:'syd'});ACT.buySat({a:'syd',b:'suv',bird:'o3b',g:2});closeModal();S.day=S.links.find(l=>l.bird==='o3b').ready;compute()");
|
||||
assert.equal(ev("satOnly('suv').bird"), 'o3b', 'MEO is the faster way out');
|
||||
for (const id of geoNo) assert.equal(!!J(ev, `peerOk('${id}','ix','suv')`).sat, ev(`noSat('${id}','meo')`), id + ' over MEO');
|
||||
// A wave lands: only once it is lit does Suva stop being a satellite island.
|
||||
ev("UI.pending={a:'syd',b:'suv'};ACT.buildLink({tier:1});closeModal();compute()");
|
||||
const w = "S.links.find(l=>l.kind==='wave')";
|
||||
ev(`${w}.ready=S.day+5;compute()`);
|
||||
assert.ok(ev("!!satOnly('suv')"), 'still being provisioned');
|
||||
ev(`S.day=${w}.ready;compute()`);
|
||||
assert.equal(ev("satOnly('suv')"), null);
|
||||
for (const id of geoNo) assert.ok(!J(ev, `peerOk('${id}','ix','suv')`).sat, id + ' with a backbone to meet');
|
||||
assert.equal(ev(`ixSessions('suv').has('${k}')`), true, 'the old session carries again');
|
||||
// A cut does not change what is built: the island is still on the backbone as far as the peers go.
|
||||
ev(`${w}.cut=S.day+30;compute()`);
|
||||
assert.equal(ev("satOnly('suv')"), null);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('MEO needs tracking antennas and a higher level, and users barely notice it', (t) => {
|
||||
const { ev, errors } = game(t, ISLE + "ACT.teleBuild({city:'syd'});");
|
||||
ev("ACT.buySat({a:'syd',b:'tbu',bird:'o3b',g:5})");
|
||||
|
|
|
|||
|
|
@ -146,6 +146,26 @@ test('repairs: rush what has a price, as the Rush repair button would', t => {
|
|||
ev => on(ev, 'repair'), "ACT.fixInc({id:'amp'})", 'S.inc.length');
|
||||
});
|
||||
|
||||
test("the shift's log and the week's tally are what a reload keeps: three places a kind at most, no empty lists", t => {
|
||||
const { ev, errors } = game(t, "S.links=[{id:'f',a:'fra',b:'ams',kind:'df',sys:'lite',ch:['zr4'],km:450,sub:false,ready:0,cut:0,eqDown:10,mo:1}];S.inc=[{id:'amp',type:'amp',ref:'f',until:10,cost:3000,msg:'amp'}];S.pops.ams={day:0,bb:null,boost:0,down:0,routers:1,gen:false}");
|
||||
hire(ev);
|
||||
on(ev, 'repair');
|
||||
// Five orders that each find a job today's money cannot pay for.
|
||||
const K = ['transit', 'ports', 'routers', 'std', 'optics'];
|
||||
ev(`for(const k of ${lit(K)}){S.ops.on[k]=true;OPS_RUN[k]=function*(X){X.can(k,1e12);};}`);
|
||||
shift(ev);
|
||||
const r = JSON.parse(ev('JSON.stringify(S.ops.log[0].r)'));
|
||||
assert.deepEqual(r.find(x => x[0] === 'repair'), ['repair', 1, []], 'a rushed repair names no place');
|
||||
assert.deepEqual(r.find(x => x[0] === 'broke'), ['broke', 5, ['std', 'routers', 'transit']], 'five budgets ran out, the first three in the shift named');
|
||||
assert.equal(ev("own(S.ops.wk.wh,'repair')"), false, "no empty list in the week's tally");
|
||||
assert.equal(ev("S.ops.wk.wh.broke.length"), 3);
|
||||
// Straight from the shift (dayTick() is not in between): what a reload makes of it, key for key.
|
||||
const same = ev(`(()=>{const u0=uidN,r0=S.rng,k=v=>Array.isArray(v)?v.map(k):v&&typeof v==='object'?Object.keys(v).sort().reduce((o,x)=>(v[x]!==undefined&&(o[x]=k(v[x])),o),{}):v,
|
||||
pick=o=>JSON.stringify(k({log:o.log,wk:o.wk,rep:o.rep})),a=pick(JSON.parse(JSON.stringify(S.ops))),b=pick(migrate(JSON.parse(JSON.stringify(S))).ops);uidN=u0;S.rng=r0;return a===b||a+' vs '+b;})()`);
|
||||
assert.equal(same, true);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('optics: light hot fiber with the optic already in it, at the #177 batch price', t => {
|
||||
const extra = "ACT.buildPop({city:'ams'});S.pops.ams.rgen=1;S.links.push({id:'f',a:'fra',b:'ams',kind:'df',sys:'lite',ch:['zr4'],km:450,sub:false,ready:0,cut:0,mo:1,trench:'f'});compute();R.load.f=dfCap(S.links.at(-1))*0.95";
|
||||
const A = twins(t, extra, ev => on(ev, 'optics', { at: 70 }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue