diff --git a/.claude/skills/add-strings/SKILL.md b/.claude/skills/add-strings/SKILL.md index 52fb997..38f4c0e 100644 --- a/.claude/skills/add-strings/SKILL.md +++ b/.claude/skills/add-strings/SKILL.md @@ -1,43 +1,66 @@ --- name: add-strings -description: Add or change player-facing text in Series of Tubes and keep every translation (site/i18n/*.js) complete. +description: Add or change player-facing text in Series of Tubes: labels in the code, English in src/i18n/en.js, and every translation (site/i18n/*.js) kept complete. --- # Adding or changing player-facing text -The English text is the translation key. Every string a player can see must go -through the translation helpers and have an entry in every dictionary in `site/i18n/` -(currently `it.js`, Italian). +Text is keyed by **label** ([docs/adr/0003-translations-by-label.md](../../../docs/adr/0003-translations-by-label.md)). +The code says `tr('pnis.delivery_2_to_6_weeks')`; the English is in `src/i18n/en.js`; Italian, Portuguese +and French are `site/i18n/it.js`, `pt.js`, `fr.js`. Every label the code uses needs English, and every +language needs every label. ## In the code -- `tr('Text with {name}', {name})`: translate now and fill placeholders. -- `trn('{n} router', '{n} routers', n, vars)`: plurals; both forms are keys. -- `N_('Text')`: marks a literal kept in a table for later `tr()` (e.g. labels stored in - constants). Call `tr(x)` where it's shown. -- Static HTML: add `data-i18n` to the element; `aria-label` and `title` attributes are - collected automatically. -- Text must be a string literal inside the call, or the checker can't see it. -- Keep HTML (``, `
`, ``) and `{placeholders}` identical in translations. -- Don't build sentences by concatenating translated fragments; translate whole sentences. +- `tr('area.label', {name})`: translate now and fill `{placeholders}`. +- `trn('area.label', n, vars)`: plurals. One label, whose entries are `{"one": "…", "other": "…"}`; + `{n}` is filled in for you. +- `N_('area.label')`: a label kept in a table or a save and translated where it is shown with + `tr(x)`. Anything stored in `S` must be an `N_()` label (or an index), never translated text and never + a label written any other way: the build shortens every label it sees in `tr()`/`trn()` to an id that + changes between releases, and keeps the `N_()` ones whole. +- The label is always a string literal, the first argument of `tr`/`trn`/`N_`. A label anywhere else + (`const x='pnis.ready'`) is an error in `npm run i18n:check`. +- Static HTML in `src/index.html`: `data-i18n="area.label"` on the element, with its English inside it; + `data-i18n-aria-label="…"` and `data-i18n-title="…"` next to those attributes. +- Keep HTML (``, `
`, ``) and `{placeholders}` identical in every language. +- Don't build sentences from translated fragments; translate whole sentences. -## In the dictionary +## Naming a label -`site/i18n/it.js` is one object, `"English": "Italiano",` per line, ending with `};`. -Append new entries before the closing `};`. A small script avoids quoting mistakes: +`area.some_words`: the area is the file or topic it is shown in (`pnis`, `own_cable`, `dashboard`, +`page` for the static markup), or `common` for text used all over and short everyday words +(`common.close`, `common.customers`). The words are the first few words of the English, lower case, +`_` between them: `pnis.ready_in_about_n_days`. Labels are only for finding things; players never see +them. Reuse an existing label when the text and the meaning are the same (`grep -n '"Close"' src/i18n/en.js`). -```python -import json -it = {"New English text": "Nuovo testo italiano"} -q = 'site/i18n/it.js'; t = open(q).read().rstrip() -assert t.endswith('};') -t = t[:-2] + ''.join(json.dumps(k, ensure_ascii=False) + ':' + json.dumps(v, ensure_ascii=False) + ',\n' - for k, v in it.items() if json.dumps(k, ensure_ascii=False) + ':' not in t) + '};\n' -open(q, 'w').write(t) +## In the dictionaries + +Every dictionary is one entry per line, **sorted by label**, so new text from different pull requests +lands on different lines. Don't edit them by hand; the script writes English and translations together: + +```bash +cat > /tmp/strings.json <<'JSON' +{ + "en": { "pnis.ready_in_about_n_days": "Ready in about {n} days", + "save.n_pop": { "one": "{n} POP", "other": "{n} POPs" } }, + "it": { "pnis.ready_in_about_n_days": "Pronto tra circa {n} giorni", + "save.n_pop": { "one": "{n} POP", "other": "{n} POP" } }, + "pt": { "pnis.ready_in_about_n_days": "Pronto em cerca de {n} dias" }, + "fr": { "pnis.ready_in_about_n_days": "Prêt dans environ {n} jours" } +} +JSON +node scripts/i18n-add.js /tmp/strings.json # a string or {one, other} sets an entry, null removes it +node scripts/i18n-add.js --rename old.label new.label # in every dictionary and everywhere in src/ ``` -When you **change** English text, rename the key in every dictionary too; when you -remove text, delete its entry. +- **Changing English wording** (a typo, a clearer phrase, same meaning): change only the English. The + translations stay right. +- **Changing the meaning**: give the text a new label (`--rename`, then update the English and every + translation), so no language keeps a translation that now says something else. +- **Removing text**: `null` under `"en"` removes the label from every dictionary. + +`npm run i18n:fix` re-sorts a dictionary that got out of order (a hand edit, a merge). ## Italian style @@ -48,6 +71,6 @@ into an Italian joke when one fits; otherwise keep the pun name and translate th ## Check ```bash -node scripts/i18n-check.js # must say: 0 missing, 0 unused, 0 broken -npm test # includes tests/i18n.test.js +node scripts/i18n-check.js # en.js: 0 problems; each language: 0 missing, 0 unused, 0 broken +npm test # includes tests/i18n.test.js (every screen in every language) and the shipped page ``` diff --git a/.claude/skills/edit-the-game/SKILL.md b/.claude/skills/edit-the-game/SKILL.md new file mode 100644 index 0000000..bfacf0e --- /dev/null +++ b/.claude/skills/edit-the-game/SKILL.md @@ -0,0 +1,67 @@ +--- +name: edit-the-game +description: Find, change and add game code in Series of Tubes, which lives in many small files under src/ that the build joins into one page. Use for any feature, fix or refactor in the game itself (anything in src/). +--- + +# Editing the game + +The game's source is `src/`. The build (`scripts/lib/page.js`) pastes the files together, in path order, +into one `index.html` with one inline `` at the start of a line. +File names are `NN-lower-case.js` / `.css`; `tests/build.test.js` checks both. + +## Still the same rules + +Everything in CLAUDE.md applies unchanged: translate every string (`add-strings`), sanitize saves, +phones first, a test with every change (`write-tests`), performance shown against `main` +(`performance`), hosting on GitHub Pages only (`github-pages`), a CHANGELOG bullet for players. +The CHANGELOG is the one file every change touches; a conflict there is expected: keep both bullets. diff --git a/.claude/skills/github-pages/SKILL.md b/.claude/skills/github-pages/SKILL.md new file mode 100644 index 0000000..3eafcfb --- /dev/null +++ b/.claude/skills/github-pages/SKILL.md @@ -0,0 +1,52 @@ +--- +name: github-pages +description: Series of Tubes is hosted on GitHub Pages and nowhere else, non-negotiably. Use before any change to hosting, deploys, the build output, caching, the service worker, new runtime requests or anything that would need a server, and whenever someone suggests another host. +--- + +# GitHub Pages, always + +Series of Tubes is served by GitHub Pages at https://seriesoftub.es and **only** there. This is settled +([docs/adr/0001-github-pages-only.md](../../../docs/adr/0001-github-pages-only.md)) and not up for +discussion: do not propose, prepare or "keep the door open" for another host, a CDN in front, a +backend or server-side rendering, even when asked to evaluate options. If a feature seems to need +one, redesign the feature. + +## What that means for a change + +- **The output is static files.** `npm run build` writes `_site/`: the assembled page, `site/`'s files, + `version.json`. No server code, no runtime secrets: everything there is public. +- **No HTTP headers, redirects or rewrites.** Pages ignores `_headers`, `_redirects`, `.htaccess`, + `vercel.json`, `netlify.toml`. Need a policy? Use a `` tag. Need a different URL? Add a + static file there. +- **Caching is Pages' (short, the same for every file) plus the service worker's.** Offline play and + updates are `site/sw.js`'s job; its cache name carries the version. When you add a file the game + needs offline, add it to `CORE` there. +- **Same origin.** The page, dictionaries, icons and data come from seriesoftub.es. Do not add CDN + libraries or third-party APIs the game needs to work; the web fonts and the analytics counter are + the only exceptions and the game runs without them. +- **More files are fine, from the same origin.** Pages serves many small files well over HTTP/2. + Still: the game page itself stays one assembled `index.html` (see + [ADR 0002](../../../docs/adr/0002-one-page-assembled-at-build.md)), and anything the first frame + needs must not add a round trip. +- **Limits:** about 1 GB for the whole site, 100 MB per file. +- **Paths:** the site lives at the domain root (`site/CNAME`), so `/` paths are fine; unknown paths get + `404.html`. + +## How it deploys + +Only releases deploy. Bumping `version` in `package.json` on `main` runs `auto-release.yml`, which tags, +publishes the GitHub release and starts `release.yml`: test, `REQUIRE_NOTES=1 npm run build`, +`actions/upload-pages-artifact` with `./_site`, `actions/deploy-pages`. That job is the only one with +`pages: write`. Pushes to `main` and pull requests build but never deploy. The `release` skill has the +steps. + +## Before you hand back a change that touches the build, deploy or loading + +```bash +npm run build && npm run serve # the production build, served as static files +npm test -- tests/pages.test.js # static-only, all references resolve, Pages-only deploy +``` + +`tests/pages.test.js` fails on host configuration files, files over the limits, local references +that do not exist in `_site/`, scripts loaded from other origins, and any workflow that deploys +anywhere else. Do not weaken it to make a change pass; change the change. diff --git a/.claude/skills/performance/SKILL.md b/.claude/skills/performance/SKILL.md index 1f1e598..c071f46 100644 --- a/.claude/skills/performance/SKILL.md +++ b/.claude/skills/performance/SKILL.md @@ -5,7 +5,7 @@ description: Measure and demonstrate the performance of every Series of Tubes ch # Performance is always demonstrated -Every change to the game (anything in `site/`) shows its performance on a very large network, +Every change to the game (anything in `src/` or `site/`) shows its performance on a very large network, compared with `main`, before it is merged or released. A speed claim without numbers does not count, and neither does "it feels fine on my small game". Most players who complain about lag have huge late-game networks, and most of them are on phones. @@ -13,11 +13,14 @@ have huge late-game networks, and most of them are on phones. ## Measure ```bash -git show origin/main:site/index.html > /tmp/base.html -npm run perf -- --base /tmp/base.html # headless only, a few minutes -npm run perf -- --base /tmp/base.html --browser # plus real Chromium, desktop and phone (what CI runs) +npm run perf -- --base-ref origin/main # headless only, a few minutes +npm run perf -- --base-ref origin/main --browser # plus real Chromium, desktop and phone (what CI runs) ``` +`--base-ref` assembles that commit's page with its own scripts (`node scripts/lib/page.js --ref REF`; +for commits from before the split it reads their `site/index.html`). `--base FILE` takes a built page +instead. The head is always this checkout's `src/`, assembled the way the build does it. + `scripts/perf-bench.js` loads `tests/fixtures/big-network.json` (about 100 POPs, 150 links, 950 PNIs, 830 cache boxes, 110 IX ports, 170 customers) into the base and into this checkout and times them in alternating turns, 15 runs each. It prints one table per environment: @@ -57,7 +60,7 @@ Without `--base` it just times this checkout. `--runs N`, `--md FILE`, `--json F save and a file from the in-game menu's Export save work: ```bash -npm run perf -- --save ~/Downloads/series-of-tubes-save.json --base /tmp/base.html +npm run perf -- --save ~/Downloads/series-of-tubes-save.json --base-ref origin/main ``` Routing speed-ups must also keep the two equivalence tests green: `tests/speed.test.js` (the fast @@ -70,10 +73,10 @@ incidents and failures). - **Every pull request**: the Performance workflow runs the same comparison and posts the table as a comment on the PR (updated on every push). Read it before merging. Locally, paste the table into the PR description or the commit summary you report. -- **Everything you hand back to Frederic** that touched `site/`: include the table, or at least the +- **Everything you hand back to Frederic** that touched `src/` or `site/`: include the table, or at least the rows that moved, in your summary. Say plainly when something got slower. - **Before a release**: compare the release against the previous tag - (`git show v:site/index.html > /tmp/base.html`) and mention notable changes. + (`npm run perf -- --base-ref v`) and mention notable changes. ## Read the table diff --git a/.claude/skills/release/SKILL.md b/.claude/skills/release/SKILL.md index 6307236..79087df 100644 --- a/.claude/skills/release/SKILL.md +++ b/.claude/skills/release/SKILL.md @@ -7,8 +7,10 @@ description: Cut and ship a Series of Tubes release (patch or minor) from main v Bumping `version` in `package.json` on `main` is the release button. The `auto-release.yml` workflow tests, tags `v`, publishes a GitHub release with -that version's CHANGELOG section as notes, and dispatches `release.yml`, which deploys -to GitHub Pages (https://seriesoftub.es). +that version's CHANGELOG section as notes, and dispatches `release.yml`, which builds +`_site/` (`npm run build`: the page assembled from `src/` plus `site/`) and deploys it +to GitHub Pages (https://seriesoftub.es). GitHub Pages is the only host, ever: see the +`github-pages` skill. ## Only release when Frederic says so @@ -53,7 +55,7 @@ gh api repos/fjaeckel/seriesoftubes/releases/latest --jq '.tag_name+" "+.publish - `package-lock.json` → top-level `"version"` and `packages[""].version` 4. `npm test` once more. Then compare performance with the previous release and mention anything notable to Frederic: - `git show v:site/index.html > /tmp/base.html && npm run perf -- --base /tmp/base.html`. + `npm run perf -- --base-ref v`. 5. Commit on `main` as Frederic, with no attribution trailers: ```bash git -c user.name="Frederic Jung" -c user.email="frederic@jc-ix.net" commit \ diff --git a/.claude/skills/write-tests/SKILL.md b/.claude/skills/write-tests/SKILL.md index 4f0ce7c..efe406c 100644 --- a/.claude/skills/write-tests/SKILL.md +++ b/.claude/skills/write-tests/SKILL.md @@ -5,8 +5,8 @@ description: Write deterministic jsdom tests for Series of Tubes features and fi # Writing tests -Tests use `node:test` and `tests/harness.js`, which loads `site/index.html` in jsdom -with the animation loop off, a seeded `Math.random` and a recording fake canvas. +Tests use `node:test` and `tests/harness.js`, which assembles the game page from `src/` +(once per test file) and loads it in jsdom with the animation loop off, a seeded `Math.random` and a recording fake canvas. Code runs inside the page through `ev()`. ## Pattern @@ -29,18 +29,24 @@ test('what the player should see happen', () => { Pick the suite by topic: `game` (core loop), `build`, `persist` (save/import/migrate), `services` (customers), `peering`, `issues` (GitHub issue regressions, name them -`#NN …`), `regions`, `modes` (scenarios, sandbox, weekly), `i18n`. A new file must be -added to the `test` script in `package.json`. +`#NN …`), `regions`, `modes` (scenarios, sandbox, weekly), `i18n`, `pages` (hosting). +For a new feature, prefer a new file named after it (`tests/route-servers.test.js`): every +`tests/*.test.js` runs on its own (`scripts/test.js`), and a file of your own never conflicts +with someone else's tests. Appending to the big suites (`issues`, `regions`) is where +pull requests collide. Run one file with `npm test -- tests/route-servers.test.js`. ## Rules +- **Text in assertions:** match what the player sees (`/Ready in about 3 days/`), or compare with + `ev("tr('pnis.ready_in_about_n_days',{n:3})")`. Tests run the source page, where labels are readable; + the shipped page (ids instead of labels) is covered by `tests/pages.test.js`. - **Deterministic.** Never rely on luck. Use the default seed, `window.__reseed(n)`, or set state directly (`S.day=…`, `S.ev.x=…`). - **Force a specific random failure or event** by patching the picker: ```js ev("eval('('+fireFailure.toString().replace('const e=pick(opts);',\"const e='crash';\")+')')()"); ``` - Check the current source for the exact `pick` line first; it may differ. + Check the current source for the exact `pick` line first (`grep -rn "function fireFailure" src/game`); it may differ. - **Drive the game through `ACT`** like a player would, then `compute()` or `dayTick()`. - **Saves:** for persistence changes, round-trip `JSON.stringify(S)` through `parseSave()`/`migrate()`, and test that an *old* save without the new field still loads. diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cb714b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# The assembler joins src/ byte for byte and refuses CR line endings; keep LF everywhere it reads. +src/** text eol=lf +site/i18n/*.js text eol=lf diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 749bba5..b4f1a0a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -8,8 +8,7 @@ ## Performance - diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index 98dbd90..48c05e4 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -6,7 +6,9 @@ name: Performance on: pull_request: paths: + - 'src/**' - 'site/**' + - 'scripts/lib/**' - 'scripts/perf-*.js' - 'tests/fixtures/**' - 'tests/harness.js' @@ -32,7 +34,8 @@ jobs: BASE_SHA: ${{ github.event.pull_request.base.sha }} run: | git fetch --depth=1 origin "$BASE_SHA" - git show FETCH_HEAD:site/index.html > "$RUNNER_TEMP/base.html" + # The base's page, assembled by the base's own scripts (or its site/index.html from before the split). + node scripts/lib/page.js --ref FETCH_HEAD -o "$RUNNER_TEMP/base.html" echo "BASE_ARG=--base $RUNNER_TEMP/base.html" >> "$GITHUB_ENV" - name: Benchmark # The runner image ships Google Chrome; playwright-core (a dev dependency) drives it, no browser download. diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b188d5..9214827 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ All notable changes to this project are documented here. The project follows - DDoS bandwidth now adds up: upstream scrubbing, edge filters and scrubbing centers work in sequence. The NOC uses the same figures as traffic routing, including floods that cannot reach a remote center. - Attacks can now use Memcached amplification or an ACK flood. Flowspec catches the former; the latter need mitigation. +## [1.34.1] — 2026-10-27 + +- The game starts faster in Italian, Portuguese and French: their translations are about 40% smaller to download. + ## [1.34.0] — 2026-10-27 - Choose your peering policy: Open to all, Selective or Closed. Open accepts everyone and keeps the route servers, Selective means fewer requests but you ask peers yourself, and Closed scares customers away. diff --git a/CLAUDE.md b/CLAUDE.md index 9eaf5e8..bf2ab35 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,30 +1,43 @@ # Series of Tubes: notes for Claude A free cartoon browser game about how the internet works, live at -https://seriesoftub.es. The whole game is one static page: `site/index.html` -(HTML, CSS and JS in one file, no framework, no build step for development). +https://seriesoftub.es, hosted on GitHub Pages. The game is one static page with no framework. +Its source is many small files in `src/` (`src/styles/*.css`, `src/game/**/*.js`, the shell +`src/index.html`); the build pastes them together, in path order, into a single `index.html`, the +same one-file page players have always loaded. Static files (dictionaries, icons, service worker) +live in `site/`. Read these before larger changes: -- `docs/ARCHITECTURE.md`: how the code is laid out and how a day of simulation runs. -- `.claude/skills/`: step-by-step procedures (release, translations, tests). +- `docs/ARCHITECTURE.md`: where the code is, and how a day of simulation runs. +- `docs/adr/`: decisions that are settled (GitHub Pages only; one page assembled at build). +- `.claude/skills/`: step-by-step procedures (`edit-the-game`, `github-pages`, release, + translations, tests, performance). ## Commands ```bash npm ci # once: installs jsdom for the tests -npm test # node:test + jsdom, all suites, must stay green -node scripts/i18n-check.js # must report "0 missing, 0 unused, 0 broken" -npm run build # builds _site/ (stamps version, bakes release notes) -npm run serve # build and serve locally -npm run perf -- --base /tmp/base.html # big-network benchmark vs another version (see `performance`) -npm run perf -- --base /tmp/base.html --browser # the same, also in real Chromium (desktop and phone) +npm run dev # play while developing: http://localhost:8080, reloads on save +npm test # node:test + jsdom, every tests/*.test.js, must stay green +node scripts/i18n-check.js # must report "0 missing, 0 unused, 0 broken" (and sorted dictionaries) +node scripts/i18n-add.js FILE.json # add/change/remove translations (see `add-strings`) +npm run build # builds _site/ for GitHub Pages (assembles src/, stamps version, bakes release notes) +npm run serve # build and serve the production site locally +npm run perf -- --base-ref origin/main # big-network benchmark vs main (see `performance`) +npm run perf -- --base-ref origin/main --browser # the same, also in real Chromium (desktop and phone) ``` -To play during development, open `site/index.html` directly or run `npm run serve`. - ## Hard rules +- **GitHub Pages, always.** The game is hosted on GitHub Pages and nowhere else. This is not up + for discussion: never propose or prepare another host, a CDN in front, a backend, server-side + rendering, redirects or custom headers. The build output stays plain static files from one + origin. If a feature seems to need a server, redesign the feature. See the `github-pages` skill + and `docs/adr/0001-github-pages-only.md`. +- **No runtime cost for structure.** The page ships as one assembled `index.html`. Organise code + into files under `src/` freely (build time is cheap), but never in a way that adds requests or + work to page load or to the game loop. - **Git:** work on `main`, no branches. Commits are authored and committed as `Frederic Jung `. Never add `Co-Authored-By`, `Claude-Session` or any other attribution trailers. @@ -41,26 +54,35 @@ To play during development, open `site/index.html` directly or run `npm run serv a real pun, or keep the plain word. - **Easter eggs stay secret.** Never mention hidden jokes or easter eggs (for example whatever `elephant()` does) in commit messages, release notes or the CHANGELOG. -- **Every player-facing string is translated.** Wrap it in `tr()`, `trn()` or `N_()` - and add the Italian to `site/i18n/it.js` in the same change (see `add-strings`). +- **Every player-facing string is translated, by label.** Code uses `tr('area.label')`, + `trn('area.label', n)` or `N_('area.label')` (anything stored in a save: `N_()`), never English text. + Add the English (`src/i18n/en.js`) and every translation (`site/i18n/*.js`) in the same change with + `scripts/i18n-add.js` (see `add-strings`). - **Phones first.** About 70% of players are on phones. Every new panel, button and modal must work at 360 px wide, in portrait and landscape, using the phone tab bar and bottom sheets. Check `isPhone()` layouts, not just desktop. - **Saves are sacred.** Old saves must keep loading. Any new state field gets a default in `newGame()` and a check/repair in `sanitize()`; renamed fields are migrated there. -- **Performance is always demonstrated.** Every change to `site/` is measured on the big-network - fixture against `main` (`npm run perf -- --base /tmp/base.html`, see the `performance` skill), +- **Performance is always demonstrated.** Every change to `src/` or `site/` is measured on the big-network + fixture against `main` (`npm run perf -- --base-ref origin/main`, see the `performance` skill), and the numbers go into the PR and into your summary. Every PR also gets them as a comment from CI. Anything slower needs a reason or a fix. - **Tests come with features.** Add or extend a test in `tests/` for every feature or - fix. Tests are seeded, so they must not depend on luck. + fix (a new feature gets its own `tests/.test.js`). Tests are seeded, so they must not + depend on luck. - **CHANGELOG style:** plain English, written for players, one bullet per change, - issue numbers in parentheses like `(#37)`. No internal names, no jokes explained. + issue numbers in parentheses like `(#37)`. No internal names, no jokes explained. The CHANGELOG + is the one file every change touches; conflicts there are expected (keep both bullets). ## Style of the code -- Dense, single-file JavaScript. Match the surrounding style: short helper names, - arrow functions, template-literal HTML, no new dependencies. +- Dense JavaScript in small topic files under `src/game/` (see `edit-the-game`): a new feature gets + its own `NN-name.js` in the folder of its topic, actions go in the matching + `src/game/90-actions/*.js`. All files share one top-level scope; top-level values may only use + top-level values from earlier files. Match the surrounding style: short helper names, arrow + functions, template-literal HTML, no new dependencies. +- Lists people add to (cities, cables, networks, dictionaries) are one entry per line; id-keyed + objects and dictionaries stay sorted, so additions do not collide. - UI is rebuilt from state: change `S`, then call `after()` (recompute, check goals, re-render, save). Buttons are `btn(label, actName, args, cls, disabled)`, which dispatch to `ACT[actName](args)` through `data-act`/`data-args`. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..77ad90b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,60 @@ +# Code of Conduct + +Series of Tubes is a cartoon game about how the internet works, built by people who +love networks and people who are just curious about them. Everyone is welcome here: +seasoned network engineers, students, translators, players who have never heard of BGP, +and people who just want to suggest a city with a funny data center name. + +The short version: **be excellent to each other.** + +## Where this applies + +Everywhere people meet around this project: GitHub issues, pull requests, reviews and +discussions, the Series of Tubes Signal group, and anywhere else you represent the +project, online or at a conference bar after NANOG. + +## What we want + +- **Welcome people.** Newcomers are how every community stays alive. Nobody was born + knowing what a route reflector is. Explain things kindly, and assume the question is + sincere. +- **Be patient across languages.** Many of us write in our second or third language. + Judge the idea, not the grammar. +- **Disagree about ideas, not people.** Argue about peering policy, balance and puns as + hard as you like. Criticise the change, never the person who made it. +- **Assume good intent.** Text loses tone. If something reads badly, ask before you + react. +- **Give credit.** Thank people for reports, fixes and ideas, and say where an idea came + from. +- **Own your mistakes.** We all fat-finger a config now and then. Apologise, fix it, + move on. +- **Keep the jokes kind.** This game runs on puns. The target of a joke is a network, + a cable or a backhoe, never a person or a group of people. + +## What we don't accept + +- Harassment of any kind, in public or in private messages. +- Insults, slurs, or demeaning comments about anyone's gender, gender identity or + expression, sexual orientation, disability, appearance, body, age, race, ethnicity, + nationality, religion, experience level or anything else about who they are. +- Sexual language or imagery, and unwelcome attention of any kind. +- Threats, intimidation, stalking, or encouraging anyone else to do these things. +- Sharing someone's private information (an address, a phone number, a real name they + have not shared) without their permission. +- Trolling, deliberately derailing discussions, or flooding issues and chats. +- Continuing to contact someone after they have asked you to stop. + +## If something happens + +If someone makes you or others feel unwelcome or unsafe, tell the maintainer, Frederic, +in a private message in the Signal group. You do not need to be the person it happened +to, and you do not need proof or perfect wording. Reports are kept confidential. + +We will listen, look at what happened, and do what fits: a friendly word, a request to +edit or delete something, a warning, or removing someone from the project's spaces for a +while or for good. Whoever reports in good faith will never be punished for it. + +## Making it better + +This document is for everyone here. If something is missing or unclear, open an issue +or a pull request, like for any other part of the project. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d945d44..67e71ca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,6 +3,9 @@ Thanks for wanting to help build the cartoon internet. Bug reports, ideas, puns, translations and code are all welcome. +Everyone is welcome here, and everyone follows our [Code of Conduct](CODE_OF_CONDUCT.md). +The short version: be excellent to each other. + ## Reporting bugs and ideas Open an issue on GitHub and pick the form that fits: bug report, feature request, @@ -18,19 +21,52 @@ Not sure yet whether something is a bug or an idea worth an issue? Ask in the ## Development -The game is one static page, `site/index.html`, with no framework and no build step -while developing. +The game is one static page with no framework, hosted on GitHub Pages. Its source is split into +small files under `src/` (styles in `src/styles/`, the game script in `src/game/`), which the build +joins, in path order, into a single `index.html`. Static files such as the translations live in `site/`. ```bash npm ci # installs jsdom for the tests -npm run serve # builds and serves the game locally +npm run dev # http://localhost:8080, reloads when you save a file npm test # all tests must pass -node scripts/i18n-check.js # translations must be complete +node scripts/i18n-check.js # translations must be complete and sorted +npm run serve # the production build, as GitHub Pages will serve it ``` -Opening `site/index.html` directly in a browser also works. +Where things are, and how a day of the simulation runs: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). -A tour of the code is in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). +### Keeping pull requests apart + +Many people work on the game at once. A few habits keep your pull request from colliding with theirs: + +- Put a new feature in its own file in the folder of its topic (for example + `src/game/70-rules/85-route-servers.js`), and its tests in their own `tests/.test.js`. + New files in `src/` and `tests/` are picked up automatically; nothing needs registering. +- Add actions to the matching file in `src/game/90-actions/`, not wherever there is room. +- Lists (cities, cables, networks) take one entry per line; keep id-keyed tables sorted. +- Text is keyed by labels (`tr('pnis.ready_in_about_n_days')`, English in `src/i18n/en.js`). Add new + text with `node scripts/i18n-add.js` rather than by hand: it writes the English and the translations + and keeps every dictionary sorted, so your new strings don't land on the same lines as everyone + else's. Fixing English wording no longer touches the translations. +- The `CHANGELOG.md` bullet is the one place everybody writes. If it conflicts, keep both bullets. + +### Your branch still edits `site/index.html`? + +Until version 1.34 the whole game was one file, `site/index.html`. If your branch was started before +the split, merge `main` and let a script move your changes into `src/`: + +```bash +git fetch origin +git merge origin/main # stops: site/index.html was deleted on main +node scripts/legacy/port-branch.js # moves your edits into the matching src/ files +git status # fix any conflict it lists, then +npm test && git commit +``` + +It splits your version of the page and the one you started from the same way `src/` was made (your +English text becomes labels too), merges each piece into `src/`, and applies your English and +dictionary changes entry by entry. It only reports conflicts +where your change and `main` touched the same lines. ## Pull requests @@ -42,11 +78,14 @@ A tour of the code is in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). must not depend on luck. - Add a bullet for players under `## [Unreleased]` in `CHANGELOG.md`, in plain English. Releases are cut by the maintainer. -- Show the performance of changes to `site/` on a big network. The Performance check posts a table +- Show the performance of changes to `src/` on a big network. The Performance check posts a table comparing your PR with `main` as a comment; to run it yourself: - `git show origin/main:site/index.html > /tmp/base.html && npm run perf -- --base /tmp/base.html` + `npm run perf -- --base-ref origin/main` (add `--browser` to also time it in Chromium as a desktop and a phone, like CI does). Anything marked slower needs an explanation. +- The game is hosted on GitHub Pages, and that will not change. Changes must work as plain static + files: no server code, no other host, no redirects or custom headers (see + [docs/adr/0001-github-pages-only.md](docs/adr/0001-github-pages-only.md)). - Old saves must keep loading. New state needs a default for new games and a check in `sanitize()`. - Check your change on a phone-sized screen (about 360 px wide). Most players are on @@ -64,8 +103,9 @@ A tour of the code is in [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). ## Translations Every player-facing string goes through `tr()`, `trn()` or `N_()`. Dictionaries live -in `site/i18n/` (English text → translation). To add a language, copy `it.js`, translate -the values, register the language in the language list in `site/index.html`, and run +in `site/i18n/` (label → translation, one entry per line, sorted; the English for each label is in +`src/i18n/en.js`). To add a language, copy `it.js`, translate the values (`en.js` lists the same labels +in the same order), register the language in the language list in `src/index.html`, and run `node scripts/i18n-check.js ` until it reports nothing missing, unused or broken. The CI job "translations" runs the same check on every pull request, shows each language's coverage in the run summary, and also fails if a new language is not added to the language list or to the offline cache in `site/sw.js`. Language pull requests must be reviewed by a human who speaks the language, and diff --git a/README.md b/README.md index 9940c8b..820f3cc 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,11 @@ an hour there than from a year of laying cartoon fiber here. ## Playing locally -It is a single static page with no build step for development: +It is a single static page, assembled from the files in `src/` by a small Node script: ```sh -open site/index.html # or: npm run serve +npm ci +npm run dev # http://localhost:8080 ``` Progress is saved in your browser's local storage. @@ -51,35 +52,42 @@ and remembers the one you pick under Settings or on the title screen. ```sh npm ci +npm run dev # development server: assembles src/ on every request, reloads on save npm test # headless tests: boot, geography, a year of play, every incident, every panel -npm run build # writes the deployable site to _site/ with version and date stamped in +npm run build # writes the site for GitHub Pages to _site/, with version and date stamped in npm run i18n:check # lists text missing from (or stale in) the translations ``` ``` -site/ everything that is deployed - index.html the whole game (HTML, CSS and JS in one file) - i18n/it.js Italian translation, loaded only when the game runs in Italian +src/ the game page, in pieces (joined into one index.html at build) + index.html the shell: , static markup, @include lines + i18n/en.js English for every label, inlined into the page + styles/ CSS + game/ the game script, by topic: world, networks, simulation, actions, UI, map… +site/ static files, deployed as they are + i18n/it.js Italian translation (label → text), loaded only when the game runs in Italian i18n/pt.js Portuguese (Brazil) translation, loaded only when the game runs in Portuguese i18n/fr.js French translation, loaded only when the game runs in French images/og-image.png social preview (1200×630) favicon.*, icon-* favicons, app icons, manifest + sw.js service worker (offline play) robots.txt, sitemap.xml, llms.txt, 404.html, CNAME -scripts/build.sh copies site/ to _site/ and stamps __VERSION__ / __BUILD_DATE__ +scripts/build.js builds _site/ for GitHub Pages: site/ + the assembled page, stamped +scripts/lib/page.js joins src/ into the page tests/ node:test + jsdom -.github/workflows/ ci.yml (pushes to main and PRs) and release.yml (Pages deploy) +docs/ architecture and decisions (docs/adr/) +.github/workflows/ ci.yml (pushes to main and PRs) and release.yml (GitHub Pages deploy) ``` ## Translations -English is the source text. Player-facing strings in `index.html` go through -`tr('Unlocks at level {n}.', {n})` (or `trn(one, other, n)` for plurals); static markup -uses `data-i18n`, and `aria-label`/`title` are translated at boot. Each language is a -`site/i18n/.js` file mapping the English text to its translation, plus an entry in -`SOT_LANGS` (the language loader at the top of the page). Missing entries fall back to -English, so new English text never breaks the game; `npm run i18n:check` lists what -needs translating, and the tests make sure every translation keeps its `{placeholders}` -and HTML tags. +Player-facing text is keyed by label, and English is a dictionary like the others. Code says +`tr('pnis.ready_in_about_n_days', {n})` (or `trn('save.n_pop', n)` for plurals); static markup uses +`data-i18n="label"`. The English is in `src/i18n/en.js`, inlined into the page; each other language is +a `site/i18n/.js` file mapping the same labels to its text, plus an entry in `SOT_LANGS` (the +language loader in `src/index.html`). Missing translations fall back to English, so new text never +breaks the game; `npm run i18n:check` lists what needs translating, and the tests make sure every +translation keeps its `{placeholders}`, HTML tags and plural forms. ## Releasing @@ -156,7 +164,7 @@ There are fewer backhoes there than in the real thing. ## Contributing -Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md). +Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md). Everyone taking part follows the [Code of Conduct](CODE_OF_CONDUCT.md): be excellent to each other. ## License diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index bd626c8..15ca65b 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -1,50 +1,78 @@ # Architecture -Everything that runs in the browser lives in `site/index.html`. It is large (several -thousand lines), so find things by the section banners rather than by line number: +Series of Tubes is a static web game hosted on **GitHub Pages, and only there** +([ADR 0001](adr/0001-github-pages-only.md)). Its source is split into many small files under `src/`; +the build joins them into **one self-contained `index.html`** (one inline ` - - -
-

Series of Tubes: build the internet, one tube at a time

-

A free cartoon browser game about how the internet works. Start as a tiny network in one city, launch home broadband, buy IP transit from Tier 1 and Tier 2 carriers, peer at internet exchanges, set up private interconnects and embedded CDN caches, and lay terrestrial fiber, subsea waves and your own dark fiber with DWDM and ZR optics. Sign enterprise, hosting, high-frequency trading, AI GPU and hyperscaler customers, and keep them happy while backhoes, sharks, fat fingers, route leaks, DDoS attacks and geopolitics break things.

-
- - - -
- - -
Traffic served
0
-
Reach
0%
-
Rank
Tier 3
- - - -
-
Date
Y1 · Jan 1
-
- - - - - - - - - -
-
- - - - - - - - - -
- - - - - - - - - - - diff --git a/src/game/00-core/10-language.js b/src/game/00-core/10-language.js new file mode 100644 index 0000000..affe784 --- /dev/null +++ b/src/game/00-core/10-language.js @@ -0,0 +1,18 @@ +/* ================= LANGUAGE ================= + Text is looked up by label: tr('pnis.delivery_2_to_6_weeks',vars) returns the player's language, or the + English from src/i18n/en.js (inlined above the game) when a translation is missing, and fills {placeholders}. + trn(label,n,vars) picks the "one" or "other" form of a plural. N_() marks a label kept in a table or a + save, translated where it is shown. A label that is not in any dictionary comes back as it is. */ +// English when the dictionary did not load (offline, or a copy without the i18n folder). +const LANGS=window.SOT_LANGS,LANG=window.I18N?.[window.SOT_LANG]?window.SOT_LANG:'en'; +document.documentElement.lang=LANG; +const EN=window.I18N.en,DICT=Object.assign(Object.create(null),EN,LANG!=='en'&&window.I18N[LANG]); +// Saves from before labels (1.34 and older) hold English text where newer ones hold a label: map it on first use. +let EN_TEXT=null; +function trKey(k){const o=DICT[k];if(o!==undefined)return o; + if(!EN_TEXT){EN_TEXT=new Map();for(const l in EN){const e=EN[l],t=DICT[l];if(typeof e==='string')EN_TEXT.set(e,t);else{EN_TEXT.set(e.one,t.one||e.one);EN_TEXT.set(e.other,t.other||e.other);}}} + return EN_TEXT.get(k)??k;} +const fillIn=(o,v)=>v?o.replace(/\{(\w+)\}/g,(m,k)=>k in v?v[k]:m):o; +function tr(k,v){const o=trKey(k);return fillIn(typeof o==='string'?o:o.other,v);} +function trn(k,n,v){const o=trKey(k);return fillIn(typeof o==='string'?o:n===1?o.one:o.other,{n,...v});} +function N_(s){return s;} diff --git a/src/game/00-core/20-analytics.js b/src/game/00-core/20-analytics.js new file mode 100644 index 0000000..ccbe936 --- /dev/null +++ b/src/game/00-core/20-analytics.js @@ -0,0 +1,21 @@ +/* ================= ANALYTICS (ridiculytics) ================= + Off unless ANALYTICS.host is set. Fill in your collector when you self-host the game. + Inside the claude.ai viewer outside requests are blocked, so it only reports from your own domain. */ +const APP_VERSION='__VERSION__'; +// Filled in by scripts/build.sh from CHANGELOG.md for this version. +const RELEASE_NOTES=/*__RELEASE_NOTES__*/[]; +const IS_DEV=APP_VERSION.startsWith('__'); +// Only report from the real site; previews, localhost and the Claude viewer stay silent. +const ANALYTICS={host:/(^|\.)seriesoftub\.es$/.test(location.hostname)?'https://stats.seriesoftub.es':'',site:'seriesoftub.es'}; +(function(){ + try{ + window.ridiculytics=window.ridiculytics||function(){const q=window.ridiculytics.q=window.ridiculytics.q||[];if(q.length<100)q.push(arguments);}; + if(!ANALYTICS.host)return; + const sc=document.createElement('script');sc.defer=true;sc.src='https://cdn.jsdelivr.net/npm/ridiculytics@1.0.1/web/counter.min.js'; + sc.setAttribute('data-host',ANALYTICS.host);if(ANALYTICS.site)sc.setAttribute('data-site',ANALYTICS.site);sc.setAttribute('data-spa','false');sc.integrity='sha384-uNCU8e2RB7Yn6lVNut2gupQsJwKwXPZu2i4t/Eg6Q59ki0kchBR4L4yoS3ZxxjEX';sc.crossOrigin='anonymous';sc.referrerPolicy='no-referrer'; + document.head.appendChild(sc); + }catch(e){} +})(); +const TRACKED=new Set(); +function track(name,once){if(!ANALYTICS.host)return;if(once){if(TRACKED.has(name))return;TRACKED.add(name);}try{window.ridiculytics(name);}catch(e){}} +const PLAY_MARKS=[1,5,15,30,60,120]; diff --git a/src/game/10-catalog/10-economy.js b/src/game/10-catalog/10-economy.js new file mode 100644 index 0000000..d31e324 --- /dev/null +++ b/src/game/10-catalog/10-economy.js @@ -0,0 +1,54 @@ +/* ================= CONSTANTS ================= */ +const W=2000, H=1000, KM=14; +const POP_COST=20000, POP_MO=1500, EYE_RATE=150, CACHE_CAP=100, CACHE_MO=400; +const DAY_MS=2500, ROUTER_COST=15000, ROUTER_MO=1500, GEN_COST=12000, GEN_MO=600, DIVERSE=1.4; +const RU_BOX=40000, RU_BOX_MO=2000; +const UAE_LIC=15000,KSA_LIC=25000; +// Korea: "sender pays" interconnection makes transit into Seoul about four times the usual price. +const KR_TRANSIT=4; +/* Australia: a long way from everywhere. Every gigabit out of the country rides a long, thin subsea + cable, so transit and waves cost more than almost anywhere else. IX ports are the exception: a + nonprofit exchange sells 10G for about AUD 350 a month. Retail broadband is dear, but the national + wholesale network keeps roughly half of every home bill (about AUD 50 a month per home). */ +const AU_TRANSIT=3,AU_WAVE={land:1.8,sub:2.6,ew:1.3},AU_IX=0.8,AU_ARPU=1.8,AU_WHOLESALE=0.45; +// Fibre to the Basement: on your own fibre you skip the wholesale cut, but competing networks pay the +// Regional Broadband Scheme levy instead (about $7 a month on a ~$90 bill). +const AU_LEVY=0.08; +const SITE2_COST=45000,SITE2_MO=3000,TE_COST=60000,TE_MO=4000; +const SITE2_N=[tr('economy.the_other_building'),tr('economy.campus_b_the_one_with_parking'),tr('economy.across_the_river_dc'),tr('common.the_annex'),tr('economy.suburban_mega_shed'),tr('economy.the_cheaper_one'),tr('economy.formerly_a_shopping_mall'),tr('common.bunker_two')]; +// A city's buildings: '#' becomes a site number from 1 to dcN (dc2N for the second building) that stays put for this network. +const siteNo=(name,n)=>name.replace('#',1+((S&&S.asn)|0)%(n||1)); +const siteName=(c,s)=>s==='b'?CITY[c].dc2?siteNo(CITY[c].dc2,CITY[c].dc2N):SITE2_N[hstr(c)%SITE2_N.length]:siteNo(CITY[c].dc,CITY[c].dcN); +const BE_TAPE=30000; +const popCost=c=>POP_COST+(c&&CITY[c]&&CITY[c].tape?BE_TAPE:0)+(c&&CITY[c]&&CITY[c].ru?RU_BOX:0)+(c&&CITY[c]&&CITY[c].uae?UAE_LIC:0)+(c&&CITY[c]&&CITY[c].saudi?KSA_LIC:0); +const CN_LIC=150000, CN_JV_MO=6000; +// Scrubbing centers come in tiers by clean bandwidth. Always-on diverts instantly; on-demand is cheaper +// but takes a couple of days to engage. A clean-pipe add-on on a transit scrubs upstream, per port. +const SCRUB_TIERS=[{n:'100G',g:100,cost:60000,mo:5000,lvl:1},{n:'1T',g:1000,cost:180000,mo:15000,lvl:3},{n:'10T',g:10000,cost:500000,mo:40000,lvl:4},{n:'100T',g:100000,cost:1500000,mo:110000,lvl:10}]; +const SCRUB_DELAY=2, SLA_PEN=20000; +const scrubMo1=x=>Math.round(SCRUB_TIERS[x.tier||0].mo*(S.scrubMode==='ondemand'?0.6:1)),scrubMo=()=>S.scrubs.reduce((a,x)=>a+scrubMo1(x),0); +const hasScrub=()=>!!(S&&S.scrubs&&S.scrubs.length),SCRUB_FAR_MS=30; +const cleanMo=t=>Math.round(PORT[t.tier].g*(t.n||1)*5); +// DDoS has a shape now: a vector, a size and an entry point. A vector's `fs` is whether Flowspec can drop +// it at the edge — it catches the known volumetric UDP floods, but an application-layer HTTP flood sails +// through. Whether a POP can run Flowspec at all is a router-model property (`fs` on RG): the rules live in +// hardware TCAM, and the budget differs by platform. FS_RES is the junk left after filtering, by capability +// (0 none → no help · 1 basic merchant/whitebox → 40% leaks · 2 full big iron → 15% leaks). +const FS_RES=[1,0.4,0.15]; +const DDOS_VEC={ + dns:{n:tr('common.dns_reflection'),fs:true}, + ntp:{n:tr('common.ntp_amplification'),fs:true}, + memcached:{n:tr('common.memcached_amplification'),fs:true}, + ack:{n:tr('common.ack_flood'),fs:false}, + cldap:{n:tr('common.cldap_flood'),fs:true}, + syn:{n:tr('common.syn_flood'),fs:true}, + http:{n:tr('common.http_flood'),fs:false}, + racknet:{n:tr('common.racknet'),fs:false,gaming:true}, + teamspooked:{n:tr('common.teamspooked'),fs:false,gaming:true}, +}; +const MYIX_COST=80000, MYIX_MO=3000, MYIX_FEE=1500, START_CASH=200000; +// Your own exchange's switching fabric. Bigger fabrics carry more and attract more members. +const MYIX_FAB=[{n:'400G',g:400,cost:0,mo:3000,max:12},{n:'1.6T',g:1600,cost:60000,mo:6000,max:20,lvl:2},{n:'6.4T',g:6400,cost:200000,mo:12000,max:30,lvl:3},{n:'25.6T',g:25600,cost:600000,mo:25000,max:45,lvl:4},{n:'102.4T',g:102400,cost:1800000,mo:60000,max:60,lvl:9}]; +const myFab=c=>MYIX_FAB[Math.min(MYIX_FAB.length-1,Math.max(0,(S.myIx[c]&&S.myIx[c].fab)|0))]; +const LT=[{n:'10G',g:10,m:1},{n:'100G',g:100,m:2.8},{n:'400G',g:400,m:6},{n:'800G',g:800,m:9},{n:'1.6T',g:1600,m:13},{n:'6.4T',g:6400,m:28,car:1600,note:tr('economy.handed_off_as_4_1_6t')},{n:'12.8T',g:12800,m:45,car:3200,note:tr('economy.handed_off_as_4_3_2t')}]; +const PORT=[{n:'10G',g:10,setup:500,tmo:150,ix:400,pni:200},{n:'100G',g:100,setup:1500,tmo:400,ix:1500,pni:350},{n:'400G',g:400,setup:4000,tmo:900,ix:4000,pni:600},{n:'800G',g:800,setup:8000,tmo:1600,ix:7000,pni:1000},{n:'1.6T',g:1600,setup:16000,tmo:2800,ix:12000,pni:1600},{n:'3.2T',g:3200,setup:32000,tmo:5000,ix:20000,pni:2600}]; diff --git a/src/game/10-catalog/20-routers.js b/src/game/10-catalog/20-routers.js new file mode 100644 index 0000000..627d169 --- /dev/null +++ b/src/game/10-catalog/20-routers.js @@ -0,0 +1,24 @@ +const RG=[ + {n:'Rusty Router 9000',pn:'100G',cap:400,cost:0,mo:0,maxLT:1,maxP:1,ports:8,cls:0,lvl:1,boot:6,slowP:10,fs:0,chip:tr('routers.a_mystery_asic'),blurb:tr('routers.bought_used_on_ebuy_the_fans')}, + {n:'Edge Lord 400',pn:'400G',cap:3200,cost:30000,mo:1000,maxLT:2,maxP:2,ports:24,cls:1,lvl:2,boot:11,slowP:20,fs:1,chip:tr('common.merchant_silicon'),blurb:tr('routers.sharp_edgy_and_finally_speaks_400g')}, + {n:'Chonk 800',pn:'800G',cap:12800,cost:90000,mo:3000,maxLT:3,maxP:3,ports:36,cls:2,lvl:3,boot:25,slowP:45,fs:2,chip:'Junipurr PacketOinker™',blurb:tr('routers.an_absolute_unit_with_800g_ports')}, + {n:'Absolute Unit 1.6T',pn:'1.6T',cap:51200,cost:250000,mo:8000,maxLT:5,maxP:4,ports:40,cls:3,lvl:4,boot:40,slowP:60,fs:2,chip:tr('routers.packetoinker2_two_pigs_one_chassis'),blurb:tr('routers.1_6t_ports_its_own_weather')}, + {n:'Mikrowtik CCR',pn:'100G',cap:300,cost:4000,mo:150,maxLT:1,maxP:1,ports:16,cls:0,lvl:1,boot:2,slowP:5,badge:'M',fs:1,chip:tr('routers.a_few_dozen_arm_cores'),blurb:tr('routers.costs_less_than_lunch_and_has')}, + {n:'Sonic the Whitebox 32',pn:'400G',cap:3200,cost:14000,mo:400,maxLT:2,maxP:2,ports:32,cls:1,lvl:2,boot:9,slowP:25,flaky:true,badge:'W',fs:1,chip:tr('routers.tomahack_merchant_silicon'),blurb:tr('routers.a_bare_metal_switch_running_open')}, + {n:'Arrrhipster 7280R',pn:'400G',cap:4800,cost:42000,mo:1300,maxLT:2,maxP:2,ports:48,cls:1,lvl:2,boot:3,slowP:2,badge:'A',fs:2,chip:tr('routers.jerry_cho_deep_buffer_silicon'),blurb:tr('routers.fixed_config_deep_buffers_a_well')}, + {n:'Arrrhipster 7800R',pn:'800G',cap:16000,cost:130000,mo:4200,maxLT:3,maxP:3,ports:96,cls:2,lvl:3,boot:7,slowP:4,badge:'A',fs:2,chip:tr('routers.jerry_cho3_deep_buffer_silicon'),blurb:tr('routers.the_modular_one_ninety_six_800g')}, + {n:'Disco 8K',pn:'800G',cap:12800,cost:80000,mo:4800,maxLT:3,maxP:3,ports:64,cls:2,lvl:3,boot:20,slowP:35,badge:'D',fs:2,chip:'Silly-con One',blurb:tr('routers.cheap_to_buy_expensive_to_own')}, + {n:'Knockia 7750',pn:'1.6T',cap:40000,cost:200000,mo:7000,maxLT:5,maxP:4,ports:56,cls:3,lvl:4,boot:30,slowP:15,badge:'K',fs:2,chip:tr('routers.fin_p_network_processor'),blurb:tr('routers.finnish_engineering_indestructible')}, + {n:'Sonic the Whitebox 64',pn:'1.6T',cap:25600,cost:60000,mo:1500,maxLT:5,maxP:4,ports:64,cls:3,lvl:5,boot:9,slowP:25,flaky:true,badge:'W',fs:1,chip:tr('routers.tomahack_5_merchant_silicon'),blurb:tr('routers.sixty_four_1_6t_ports_on')}, + {n:'Disco 8K Ultra',pn:'1.6T',cap:51200,cost:140000,mo:11000,maxLT:5,maxP:4,ports:72,cls:3,lvl:6,boot:22,slowP:35,badge:'D',fs:2,chip:'Silly-con One G3',blurb:tr('routers.cheap_chassis_eternal_subscription')}, + {n:'Absolute Unit 3.2T',pn:'3.2T',cap:204800,cost:600000,mo:18000,maxLT:6,maxP:5,ports:48,cls:4,lvl:7,boot:50,slowP:60,fs:2,chip:tr('routers.packetoinker3_a_whole_litter'),blurb:tr('routers.3_2t_ports_and_12_8t')}, + {n:'Arrrhipster 7800R5',pn:'3.2T',cap:160000,cost:450000,mo:14000,maxLT:6,maxP:5,ports:144,cls:4,lvl:9,boot:8,slowP:4,badge:'A',fs:2,chip:tr('routers.jerry_cho5_deep_buffer_silicon'),blurb:tr('routers.a_hundred_and_forty_four_3')}, + {n:'Knockia 7950 XRS',pn:'3.2T',cap:180000,cost:520000,mo:15000,maxLT:6,maxP:5,ports:96,cls:4,lvl:10,boot:32,slowP:15,badge:'K',fs:2,chip:tr('routers.fin_p6_network_processor'),blurb:tr('routers.built_like_a_sauna_door_heavy')}, + {n:'Mikrowtik CCR 3.2T',pn:'3.2T',cap:51200,cost:45000,mo:900,maxLT:6,maxP:5,ports:32,cls:4,lvl:11,boot:3,slowP:5,flaky:true,badge:'M',fs:1,chip:tr('routers.several_hundred_arm_cores_and_a'),blurb:tr('routers.a_3_2t_router_for_the')}, + {n:'The Router at the End of the Universe',pn:'3.2T',cap:819200,cost:3000000,mo:60000,maxLT:6,maxP:5,ports:256,cls:4,lvl:13,boot:42,slowP:42,badge:'U',fs:2,chip:tr('routers.forty_two_of_them'),blurb:tr('routers.two_hundred_and_fifty_six_3')} +]; +/* Some routers take forever to boot. Each POP's chassis has a personality per model: most come + back in minutes, a few sit through every line card self-test known to the vendor. */ +const SLOW_BOOT=[tr('routers.is_oinking_through_the_self_test'),tr('routers.is_running_fsck_on_a_compact'),tr('routers.found_a_newer_firmware_on_the'),tr('routers.is_counting_to_2_million_routes'),tr('routers.is_waiting_for_the_line_cards'),tr('routers.booted_panicked_about_a_missing_fan'),tr('routers.is_synchronising_the_routing_engines')]; +function slowBoot(c){const p=S.pops[c];if(!p)return false;const g=p.rgen||0;return hstr(c+'|boot|'+g+'|'+S.asn)%100Math.min(HW_CAP,1+HW_YR*Math.max(0,(d-HW_FREE)/365)); +const hwShock=()=>{const s=S&&S.hw&&S.hw.shock;return s&&s.until>S.day?s:null;},hwLock=()=>{const l=S&&S.hw&&S.hw.lock;return l&&l.until>S.day?l:null;}; +function hwMul(k){if(!S)return 1;const l=hwLock();if(l)return l.mul;const s=hwShock();return hwTrend(S.day)*(s&&s.k===k?s.mul:1);} +// A lock costs a little more for a bigger network, and twice as much in the middle of a shortage. +const hwLockCost=()=>Math.round((80000+30000*Object.keys(S.pops).length)*(hwShock()?2:1)/1000)*1000; +function hwShockStart(){const k=pick(Object.keys(HW_SHOCK)),n=45+Math.floor(Math.random()*31);S.hw=S.hw||{};S.hw.shock={k,until:S.day+n,mul:HW_SHOCK[k].mul}; + toast(tr(HW_SHOCK[k].msg,{n})+(hwLock()?'
'+tr('supply_chain.your_price_lock_covers_you_until',{date:dateStr(hwLock().until)}):''),hwLock()?'':'bad');sfx('alert');} +function hwCard(){if(!S||(S.day<=HW_FREE&&!hwShock()&&!hwLock()))return '';const t=hwTrend(S.day),s=hwShock(),l=hwLock(); + return `
`; + return h;} +// Where you connect to one network, as buttons that jump to the POP (Networks tab). +// Where you connect to each network, as [label, city, kind]: transit, PNIs, IX sessions, then caches. Built for all +// networks at once, so the network list works out each IX port's sessions a single time, not once per network. +function netWhereIdx(){const B={t:{},p:{},ix:{},c:{}},add=(k,id,x)=>(B[k][id]||(B[k][id]=[])).push(x); + for(const t of S.transit)add('t',t.net,[tr('common.transit'),t.city,'t']); + for(const x of S.pni)add('p',x.net,['PNI',x.city,'p']); + for(const c in S.ixp){const nm=ixName(c),ct=ixCity(c);for(const id of ixSessions(c))add('ix',id,[nm,ct,'ix']);} + const seen=new Set();for(const x of S.caches){const k=x.net+'|'+x.city;if(!seen.has(k)){seen.add(k);add('c',x.net,[tr('common.cache'),x.city,'c']);}} + return id=>[].concat(B.t[id]||[],B.p[id]||[],B.ix[id]||[],B.c[id]||[]);} +function netWhere(n,where){const ch=(where||netWhereIdx())(n.id); + if(!ch.length)return '';const MAX=6; + return `
${ch.slice(0,MAX).map(([l,c,k])=>btn(`${esc(l)} ${esc(CITY[c].name)}`,'goConn',{city:c,k},'ghost sm')).join('')}${ch.length>MAX?btn(tr('dashboard.n_more',{n:ch.length-MAX}),'connFor',{net:n.id},'ghost sm'):''}
`;} +const DTABS=['overview','cust','conn','traffic','infra','lease']; diff --git a/src/game/94-dashboard/50-lease-swaps.js b/src/game/94-dashboard/50-lease-swaps.js new file mode 100644 index 0000000..c8ffe46 --- /dev/null +++ b/src/game/94-dashboard/50-lease-swaps.js @@ -0,0 +1,37 @@ +/* Leased lines you could swap for your own glass: waves, fabric circuits and IRUs between two of your POPs, + priced against digging (land) or laying a cable (subsea), with enough optics to match what you lease today. */ +function swapOptics(km,cap,sub,sys){for(let r=0;r<=(sub?0:REGEN_MAX);r++){const l={km,regen:r,sub};let b=null; + for(const o in OPT){if(OPT[o].lvl>lvl()||sys==='lite'&&OPT[o].sys==='roadm')continue;const g=optG(o,l),c=optCost(o);if(g&&(!b||c/gls.reduce((s,l)=>s+(l.kind==='vxc'?VXC[l.vt].g:l.kind==='df'?(l.ch||[]).reduce((t,o)=>t+optG(o,l),0):LT[l.tier].g),0); +const swapOpt=(k,up,omo,days,mo)=>{const save=mo-omo;return {k,up,omo,days,save,pay:save>0?Math.ceil(up/save):0};}; +// Lighting leased capacity on a fiber you already have (#72 review): needs free channels, and optics cost money. +function litOn(L,cap){const free=chMax(L)-(L.ch||[]).length-soldSlots(L);let b=null; + for(const o in OPT){const O=OPT[o];if(O.lvl>lvl()||(O.sys==='roadm'&&!isRdm(L.sys))||[L.a,L.b].some(c=>S.pops[c]&&RG[S.pops[c].rgen||0].cls{const [a,b]=k.split('|'),sub=isSub(a,b),mo=ls.reduce((s,l)=>s+(l.mo||0),0),cap=leaseCap(ls); + const x={a,b,sub,ls,mo,cap,opts:[],own:pairLinks(a,b).find(l=>l.kind==='df'&&l.own&&l.ready<=S.day)};if(x.own){x.fit=litOn(x.own,cap);if(x.fit.fits)x.best=mo;return x;} + // Waves and fabric circuits can also move onto a leased fiber pair: cheaper glass, but you buy the gear. + const ws=ls.filter(l=>l.kind!=='df'),wmo=ws.reduce((s,l)=>s+(l.mo||0),0),sc=sub?subDfCable(a,b):null;x.iru=ls.find(l=>l.kind==='df'); + if(ws.length&&x.iru){x.fit=litOn(x.iru,leaseCap(ws));if(x.fit.fits)x.lit=wmo;} + else if(ws.length&&lvl()>=2&&(sub?sc:dfAllowed(a,b))){const km=sc?sc.km:kmBetween(a,b),sys=lvl()>=3?'roadm':'lite',wc=leaseCap(ws),op=swapOptics(km,wc,sub,sys); + if(op&&op.n<=DF_SYS[sys].max)x.opts.push(swapOpt('iru',DF_SYS[sys].cost+ampCount(km)*AMP_COST+op.up,dfLeaseMo(km)+ampCount(km)*AMP_MO+op.mo,30,wmo));} + // Dig on land, lay a cable between landing stations (even ones that share a landmass), or both. + const whys=[];for(const cab of [false,true]){if(cab?!seaCab(a,b):sub)continue; + const why=cab?ownCabWhy(a,b):!dfAllowed(a,b)?tr('lease_swaps.nobody_lets_you_dig_on_this'):lvl()<3?tr('lease_swaps.digging_your_own_fiber_unlocks_at'):''; + if(why){whys.push(why);continue;}const km=cab?ownCabKm(a,b):kmBetween(a,b),op=swapOptics(km,cap,cab,'roadm'); + if(!op){whys.push(tr('lease_swaps.no_optic_you_can_buy_reaches',{km:km.toLocaleString()}));continue;} + x.opts.push(swapOpt(cab?'cab':'own',(cab?ownCabCost(km):dfBuildCost(km)+DF_SYS.roadm.cost+ampCount(km)*AMP_COST)+op.up,(cab?ownCabMo(km):Math.round(km*0.15)+ampCount(km)*AMP_MO)+op.mo,cab?ownCabDays(km):dfBuildDays(km),mo));} + x.why=x.opts.some(o=>o.k!=='iru')?'':whys.join(' '); + const sv=[...x.opts.map(o=>o.save),x.lit].filter(v=>v!==undefined);if(sv.length)x.best=Math.max(...sv);return x;}) + .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 `
${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)} ${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')}
`;}; + 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 `

${tr('common.leased_lines')}

${tr('lease_swaps.every_wave_fabric_circuit_and_dark')}

+ ${xs.length?`
${tr('lease_swaps.you_pay_for_leases')}${tr('common.price_mo',{price:fmt$(tot)})}
`+xs.map(x=>`
${CITY[x.a].name} ⇄ ${CITY[x.b].name} ${x.sub?tr('common.subsea'):tr('common.land')}
${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)})}
+ ${x.fit&&x.fit.fits?`
${x.own?tr('lease_swaps.you_already_own_fiber_here_light',{n:x.fit.n,up:fmt$(x.fit.up),price:fmt$(x.best)}):tr('lease_swaps.you_already_lease_dark_fiber_here',{n:x.fit.n,up:fmt$(x.fit.up),price:fmt$(x.lit)})}
`:x.fit?`
${x.fit.n?tr('lease_swaps.your_fiber_here_has_room_for',{free:Math.max(0,x.fit.free),n:x.fit.n}):tr('lease_swaps.no_optic_you_can_buy_works')}
`:''}${x.opts.map(o=>line(x,o)).join('')}${!x.own&&x.why?`
${esc(x.why)}
`:''} +
${x.own?btn(tr('lease_swaps.open_your_fiber'),'dashLink',{id:x.own.id},'pink sm'):''}${x.iru&&x.fit?btn(tr('lease_swaps.open_your_dark_fiber'),'dashLink',{id:x.iru.id},x.lit!==undefined?'pink sm':'ghost sm'):''}${x.opts.map(o=>plan(x,o)).join('')}${btn(tr('common.open_lease'),'dashLink',{id:(x.ls.find(l=>l.kind!=='df')||x.ls[0]).id},'ghost sm')}
`).join(''):`

${tr('lease_swaps.you_do_not_lease_any_lines')}

`}
`;} diff --git a/src/game/94-dashboard/60-dashboard.js b/src/game/94-dashboard/60-dashboard.js new file mode 100644 index 0000000..5bb0282 --- /dev/null +++ b/src/game/94-dashboard/60-dashboard.js @@ -0,0 +1,31 @@ +function dashTabs(){const u=custStats().unhappy,cur=UI.dtab||'overview',L={overview:tr('common.overview'),cust:tr('common.customers'),conn:tr('common.connections'),traffic:tr('common.traffic'),infra:tr('common.links_routers'),lease:tr('common.leased_lines')}; + return ``;} +function renderDash(){checkLayer(); + const H=S.hist||[],rows=H.slice(-90),last30=H.slice(-30); + const up=last30.length?last30.reduce((a,r)=>a+(r.dem?Math.min(1,r.srv/r.dem):1),0)/last30.length:1; + const net=R.revMo-R.costMo,tot=Object.values(R.egT).reduce((a,b)=>a+b,0)||1; + const tile=(l,v,sub)=>`
${l}
${v}
${sub?`
${sub}
`:''}
`; + let h=`
AS${S.asn} · ${esc(S.name)} · ${tierLabel()}

${tr('common.noc_dashboard')}

`+dashTabs();const DT=UI.dtab||'overview';if(DT==='overview')h+=` +
${tile(tr('common.traffic_now'),fmtG(R.served),tr('dashboard.of_g_wanted',{g:fmtG(R.demand)}))}${tile(tr('common.peak'),fmtG(S.stats.peak))}${tile(tr('dashboard.delivered_30_days'),(up*100).toFixed(1)+'%',up>=0.999?tr('dashboard.five_nines_ish'):up>=0.99?tr('dashboard.two_nines_and_change'):tr('dashboard.customers_are_upset'))}${tile(tr('common.peering_ratio'),pct(R.peerShare||0),tr('dashboard.caches_pnis_and_ix'))}${tile(tr('dashboard.monthly_p_l'),`${net>=0?'+':''}${fmt$(net)}`,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}))}
+

${tr('dashboard.traffic_by_way_out')}

${svgChart(rows,['c','p','ix','t','l2'],[{k:'dem',col:'#1E2640',dash:true}],v=>fmtCap(Math.round(v)))}
${Object.keys(EGC).map(k=>`${EGC[k][0]} ${pct((R.egT[k]||0)/tot)}`).join('')}${tr('common.demand')}
+

${tr('dashboard.money_per_month')}

${svgChart(rows,[],[{k:'rev',col:'#16A866'},{k:'cost',col:'#FF4D5E'}],v=>fmt$(v))}
${tr('common.revenue')}${tr('common.costs')}
+

${tr('dashboard.where_the_money_goes')}

${Object.entries(R.cost).filter(([k,v])=>v>0).sort((a,b)=>b[1]-a[1]).map(([k,v])=>`
${{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')}[k]||k}${tr('common.price_mo',{price:fmt$(v)})}
`).join('')}
`; + const tT=(R.egT.t||0)||1; + const row=(n,e,want)=>{const t=e.c+e.p+e.ix+e.t;return {n,e,t,want,cost:(R.cost.transit||0)*e.t/tT,lost:want>0.01?Math.max(0,1-t/want):0};}; + const nets=NETS.filter(n=>!n.tail).map(n=>row(n,R.netEg[n.id]||{c:0,p:0,ix:0,t:0},R.demTo[n.id]||0)); + {const e={c:0,p:0,ix:0,t:0};let w=0;for(const n of NETS)if(n.tail){const x=R.netEg[n.id];if(x)for(const k in e)e[k]+=x[k]||0;w+=R.demTo[n.id]||0;}nets.push(row({id:'_tail',name:tr('dashboard.the_long_tail_n_small_networks',{n:NETS.filter(n=>n.tail).length}),asn:'many',type:'eye',col:'#8A93B8'},e,w));} + for(let i=nets.length-1;i>=0;i--)if(!(nets[i].t>0.01||nets[i].want>0.01))nets.splice(i,1); + {const k=UI.dashSort||'traffic',dir=UI.dashDir||-1,val=x=>k==='name'?x.n.name.toLowerCase():k==='asn'?x.n.asn:k==='type'?x.n.type:k==='cost'?x.cost:k==='lost'?x.lost:x.t;nets.sort((a,b)=>{const A=val(a),B=val(b);return (AB?1:0)*dir||b.t-a.t;});} + if(DT==='cust')h+=custSection(); + if(DT==='conn')h+=connSection(); + if(DT==='traffic')h+=`

${tr('dashboard.traffic_by_network_asn')}

${tr('dashboard.where_your_users_traffic_comes_from')}

${['c','p','ix','t'].map(k=>`${EGC[k][0]}`).join('')}
${[['name',tr('common.network_6974'),''],['asn','AS',''],['type',tr('common.type'),''],['traffic',tr('common.traffic'),'r'],['mix',tr('dashboard.how_it_arrives'),''],['cost',tr('common.transit_cost'),'r'],['lost',tr('common.lost'),'r']].map(([k,l,c])=>``).join('')} + ${nets.map(({n,e,t,want})=>{return ``;}).join('')}
${k==='mix'?l:``}
${logo(n)}${esc(n.name)}${n.asn}${TYPE_L[n.type]}${fmtG(t)}
${['c','p','ix','t'].map(k=>``).join('')}
${e.t>0.01?tr('common.price_mo',{price:fmt$((R.cost.transit||0)*e.t/tT)}):'—'}${want>0.01?pct(Math.max(0,1-t/want)):'—'}
`; + if(DT==='traffic'){const top=transitTop(S.transit.map(t=>t.id),8);if(top.length)h+=`

${tr('dashboard.who_your_transit_carries')}

${tr('dashboard.the_networks_you_pay_transit_to')}

${top.map(([id,v])=>`
${logo(NET[id])}
${esc(NET[id].name)} AS${NET[id].asn} · ${fmtG(v)} · ${tr('dashboard.about_price_mo',{price:fmt$((R.cost.transit||0)*v/tT)})}
${esc(offTransitHint(id))}
${btn(tr('common.where_6276'),'netFocus',{id},'ghost sm')}
`).join('')}
`;} + const ls=S.links.filter(l=>capOf(l)>0).map(l=>({l,u:(R.load[l.id]||0)/capOf(l)})).sort((a,b)=>b.u-a.u).slice(0,8); + const rs=Object.keys(S.pops).map(c=>({c,u:(R.nodeLoad[c]||0)/(R.nodeCap[c]||1)})).sort((a,b)=>b.u-a.u).slice(0,6); + if(DT==='infra')h+=`

${tr('common.busiest_links')}

${ls.length?ls.map(({l,u})=>`
${CITY[l.a].name} ⇄ ${CITY[l.b].name} ${capName(l)} · ${linkLat(l).toFixed(1)} ms
${pct(u)}${btn(tr('common.open'),'dashLink',{id:l.id},'ghost sm')}
`).join(''):'

'+tr('common.no_links_yet')+'

'}
+

${tr('common.router_load')}

${rs.map(({c,u})=>`
${CITY[c].name} ${(S.pops[c].routers||1)} × ${esc(RG[S.pops[c].rgen||0].n)}
${pct(u)}
`).join('')} +

${tr('common.your_as')}

${tr('common.as_number')}AS${S.asn}
${tr('common.prefixes')}${Math.max(1,Math.ceil(Object.keys(S.pops).length/3))} × /22 IPv4, 1 × /32 IPv6
${tr('common.bgp_sessions')}${R.sessions}
${tr('common.upstreams')}${new Set(S.transit.map(t=>t.net)).size}
${tr('common.reach')}${pct(R.reach)}
${tr('common.customers')}${tr('dashboard.n_businesses',{n:S.biz.length})}
`; + if(DT==='lease')h+=leaseTab(); + if(h!==UI._dh){UI._dh=h;morph($('dashCard'),h);} +} diff --git a/src/game/94-dashboard/70-bank.js b/src/game/94-dashboard/70-bank.js new file mode 100644 index 0000000..7ec5c81 --- /dev/null +++ b/src/game/94-dashboard/70-bank.js @@ -0,0 +1,30 @@ +function loanSummary(o){return o.model==='transit'?tr('bank.you_pay_pct_of_your_transit',{pct:pct(o.cut||0.3),price:fmt$(o.owe||o.amount)}):o.model==='balloon'?tr('bank.nothing_to_pay_for_n_months',{n:o.term}):tr('bank.pay_mo_for_n_months',{pay:fmt$(o.pay),n:o.term})+(o.share?' '+tr('bank.plus_pct_of_your_revenue_until',{pct:pct(o.share)}):'');} +function loanLine(l){const sh=l.share?' · '+tr('bank.plus_pct_of_revenue',{pct:pct(l.share)}):'',fee=loanFees(l)?' · '+tr('bank.price_mo_in_extras',{price:fmt$(loanFees(l))}):''; + if(l.model==='transit')return tr('bank.pct_of_your_transit_bill_n',{pct:pct(l.cut||0.3),n:l.left})+sh+fee; + if(l.model==='balloon')return tr('bank.nothing_to_pay_until_the_end',{n:l.left,apr:(l.apr*100).toFixed(1)})+sh+fee; + return tr('bank.pay_mo_n_months_left_apr',{pay:fmt$(l.pay),n:l.left,apr:(l.apr*100).toFixed(1)})+(l.model==='storm'?' · '+tr('bank.2_per_open_incident'):l.model==='astro'?' · '+tr('bank.rate_set_by_the_stars_each'):'')+sh+fee;} +function renderBank(){ + if(!S||$('bankBox').hidden)return;const rt=rating(),net=R.revMo-R.costMo; + const terms=(o)=>{const B=BANKS[o.bank],sh=o.share&&!B.equity?`${tr('bank.plus_pct_of_revenue_until_repaid',{pct:pct(o.share)})}`:''; + if(o.model==='transit')return `${tr('bank.pct_of_your_transit_bill',{pct:pct(o.cut||0.3)})}${tr('bank.price_to_repay',{price:fmt$(o.owe||o.amount)})}${tr('bank.n_months',{n:o.term})}${tr('bank.the_rest_is_due_at_the')}${sh}`; + if(o.model==='balloon')return `${tr('bank.nothing_to_pay_until_the_end_2a38')}${tr('bank.apr_apr',{apr:(o.apr*100).toFixed(1)})}${tr('bank.n_months',{n:o.term})}${tr('bank.then_about_price_at_once',{price:fmt$(o.amount*Math.pow(1+o.apr/12,o.term))})}${sh}`; + const extra=o.model==='storm'?`${tr('bank.2_per_open_incident')}`:o.model==='astro'?`${tr('bank.rate_set_by_the_stars_each')}`:''; + return (B.equity?`${tr('common.no_repayments')}${tr('bank.pct_of_revenue_forever',{pct:pct(o.share)})}${tr('bank.buy_out_price',{price:fmt$(o.amount*3)})}`:`${tr('bank.apr_apr',{apr:(o.apr*100).toFixed(1)})}${tr('bank.n_months',{n:o.term})}${tr('common.price_mo',{price:fmt$(o.pay)})}${B.crypto?''+tr('bank.paid_in_tubecoin')+'':''}`)+extra+sh;}; + const covList=(l)=>l.covs.length?l.covs.map(c=>{const ok=COVS[c].ok(l);return `
${ok?'✓':'✗'} ${esc(covLabel(c))}
`;}).join(''):'
'+tr('bank.no_conditions_that_is_the_scary')+'
'; + let h=`
AS${S.asn} · ${esc(S.name)}

${tr('common.bank')}

+
${tr('common.cash')}
${fmt$(S.cash)}
${S.cash<0?tr('bank.bankrupt_at_100k'):tr('bank.in_the_vault')}
+
${tr('dashboard.monthly_p_l')}
${net>=0?'+':''}${fmt$(net)}
${tr('bank.after_loan_payments')}
+
${tr('common.credit_rating')}
${rt}
${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')}
+
${tr('common.debt')}
${fmt$(S.loans.reduce((a,l)=>a+(BANKS[l.bank].equity?0:l.bal),0))}
${trn('bank.n_loan',S.loans.length)}
`; + h+=`

${tr('common.offers')}

`; + if(!S.loanOffers.length)h+=`

${tr('bank.no_offers_right_now_banks_get')}

`; + for(const o of S.loanOffers){const B=BANKS[o.bank];h+=`
${tr('bank.bank_offers_amount',{bank:esc(B.name),amount:fmt$(o.amount)})}
${esc(B.blurb)} · ${tr('bank.offer_ends_in_n_d',{n:o.exp-S.day})}
${terms(o)}
${covList({covs:o.covs,start:S.day,base:{sub:S.links.filter(x=>x.sub).length}})}
${btn(tr('bank.take_the_money'),'takeLoan',{id:o.id},'pink')}${btn(tr('common.no_thanks'),'declineLoan',{id:o.id},'ghost sm')}
`;} + h+=`

${tr('common.your_loans')}

`; + if(!S.loans.length)h+=`

${tr('bank.debt_free_your_accountant_is')}

`; + for(const l of S.loans){const B=BANKS[l.bank];const cost=repayCost(l,B); + h+=`
${esc(B.name)} · ${fmt$(l.amount)}
+ ${B.equity?`
${tr('bank.taking_pct_of_your_revenue_every',{pct:pct(l.share)})}
`:`
${tr('common.still_owed')}${fmt$(l.bal)}
${loanLine(l)}
`} + ${covList(l)}${l.breach>=1?`
${trn('bank.condition_broken_for_n_day',l.breach)} ${l.breach<10?tr('bank.penalty_in_n_days',{n:10-l.breach}):tr('bank.penalties_are_running')}
`:''} +
${btn(UI.confirm===l.id?tr('bank.really_pay_price',{price:fmt$(cost)}):B.equity?tr('bank.buy_them_out_price',{price:fmt$(cost)}):tr('bank.repay_early_price_incl_2_fee',{price:fmt$(cost)}),'repayLoan',{id:l.id},UI.confirm===l.id?'red sm':'sm',S.cash
`;} + if(h!==UI._bh){UI._bh=h;$('bankCard').innerHTML=h;} +} diff --git a/src/game/94-dashboard/80-hint.js b/src/game/94-dashboard/80-hint.js new file mode 100644 index 0000000..1c8b175 --- /dev/null +++ b/src/game/94-dashboard/80-hint.js @@ -0,0 +1,9 @@ +function renderHint(){ + const hn=$('hint');if(!S||UI.hintOff||(S.tut!==undefined&&S.tut!==null)||(innerWidth<760&&(UI.sel||UI.leftOpen)&&!(UI.drag&&UI.drag.mode==='link'))){hn.hidden=true;return;} + let t=''; + if(UI.drag&&UI.drag.mode==='link')t=UI.snap?tr('hint.release_to_plan_a_link'):tr('hint.drag_onto_another_city'); + else if(!S.links.length&&S.done.tr)t=tr('hint.tip_drag_from_your_pink_router'); + else if(!S.done.bb)t=tr('hint.tap_your_city_then_launch_broadband'); + hn.textContent=t;hn.hidden=!t; +} + diff --git a/src/game/95-modals/10-toasts.js b/src/game/95-modals/10-toasts.js new file mode 100644 index 0000000..b319984 --- /dev/null +++ b/src/game/95-modals/10-toasts.js @@ -0,0 +1,8 @@ +/* ---------- toasts & modals ---------- */ +function toast(html,kind='',actions=[],open=null){ + if(S)logNote(html,kind,actions,open); + const el=document.createElement('div');el.className='toast '+kind;el.dataset.born=performance.now(); + el.innerHTML=`
${html}
${actions.map(a=>btn(a.l,a.act,a.args,'sm')).join('')}`; + const box=$('toasts');box.prepend(el);const max=innerWidth<760?2:3;while(box.children.length>max)box.lastChild.remove(); + setTimeout(()=>{el.style.transition='opacity .4s';el.style.opacity=0;setTimeout(()=>el.remove(),400);},actions.length?8000:4500); +} diff --git a/src/game/95-modals/20-notifications.js b/src/game/95-modals/20-notifications.js new file mode 100644 index 0000000..6062ebb --- /dev/null +++ b/src/game/95-modals/20-notifications.js @@ -0,0 +1,31 @@ +/* ---------- 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','inbox'],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==='inbox')return {a:'inbox'};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;} +// An incident points at a link, a trench, a city, or a port in a city. +function incOpen(i){const r=i&&i.ref;if(typeof r!=='string')return null;const l=S.links.find(l=>l.id===r||l.trench===r);if(l)return {a:'link',v:l.id}; + if(isCity(r))return {a:'city',v:r};const x=S.transit.find(t=>t.id===r)||S.pni.find(t=>t.id===r);if(x)return {a:'city',v:x.city};if(isIx(r)&&isCity(ixCity(r)))return {a:'city',v:ixCity(r)};return null;} +function logNote(html,kind,actions,open){S.log=S.log||[];const tmp=document.createElement('div');tmp.innerHTML=html.replace(/
/g,' ');const t=tmp.textContent.trim(); + const b=tmp.firstElementChild&&tmp.firstElementChild.tagName==='B'&&html.startsWith('')?tmp.firstElementChild.textContent.trim():''; + const o=open||openOf(actions)||openFromText(t),now=Date.now(),key=(b||t).replace(/[\d.,]+/g,'#'),last=S.log[0]; + // The same notice again within a minute folds into the last one, with a count: twenty "new sessions" read as one line. + if(last&&last.at&&now-last.at<60000&&last.k===kind&&(last.h||last.t).replace(/[\d.,]+/g,'#')===key&&JSON.stringify(last.o||null)===JSON.stringify(o)){last.n=(last.n||1)+1;last.t=t;last.h=b;last.at=now;last.d=S.day;return;} + S.log.unshift({id:uid(),d:S.day,t,h:b,k:kind,at:now,o,n:1});if(S.log.length>LOG_KEEP)S.log.length=LOG_KEEP;} +const logRecent=()=>{const now=Date.now();return (S.log||[]).filter(e=>e.at&&now-e.atlogRecent().filter(e=>e.at>(UI.logSeen||0)).length; +const agoStr=at=>{const m=Math.floor((Date.now()-at)/60000);return m<1?tr('common.just_now'):trn('notifications.n_min_ago',m);}; +function logSection(){const L=logRecent(),MAX=5,all=UI.logAll,sh=all?L:L.slice(0,MAX); + let h=`

${tr('common.notifications')} ${tr('notifications.last_10_minutes')}

`; + if(!L.length)return h+`

${tr('notifications.nothing_in_the_last_10_minutes')}

`; + h+=sh.map(e=>{const body=e.h&&e.t.startsWith(e.h)?e.t.slice(e.h.length).trim():e.t; + return `
${e.h?`
${esc(e.h)}${e.n>1?` ×${e.n}`:''}
`:''}${body?`
${esc(body)}${!e.h&&e.n>1?` ×${e.n}`:''}
`:''}
${agoStr(e.at)} · ${dateStr(e.d)}
${e.o?btn(tr('common.open'),'logOpen',{id:e.id},'ghost sm'):''}
`;}).join(''); + if(L.length>MAX)h+=`
${btn(all?tr('common.show_fewer'):tr('notifications.show_all_n',{n:L.length}),'logAll',{},'ghost sm')}
`; + return h;} +const markLayer=()=>{UI.layerAt=performance.now();}; +// Which layers are open: when that changes (a sheet, the dashboard, the bank, a selection), taps in flight are void. +function checkLayer(){const q=id=>{const e=$(id);return e?(e.hidden?0:1):0;},sig=[q('modal'),q('dash'),q('bankBox'),UI.leftOpen?1:0,UI.left||'',UI.sel?UI.sel.type+UI.sel.id:'',UI.tab||''].join('|');if(sig!==UI._layer){UI._layer=sig;markLayer();}} diff --git a/src/game/95-modals/30-modal-and-names.js b/src/game/95-modals/30-modal-and-names.js new file mode 100644 index 0000000..b9c9894 --- /dev/null +++ b/src/game/95-modals/30-modal-and-names.js @@ -0,0 +1,24 @@ +// Keyboard focus moves into the modal, so Enter or Space can't keep pressing a hidden button behind it. +function openModal(html){if($('modal').hidden)markLayer();$('modalCard').innerHTML=html;$('modal').hidden=false;const a=document.activeElement;if(a&&a!==document.body&&!a.closest('#modal')){a.blur();const m=$('modalCard');m.tabIndex=-1;m.focus({preventScroll:true});}} +function closeModal(){if(!$('modal').hidden)markLayer();$('modal').hidden=true;UI.pending=null;} +const NETWORK_NAMES=[ + 'Packet Pals','Shinternet','Post, Telegraph & Tubes','Peering Pressure','Best Effort Telecom', + 'Mostly Online','Buffering & Sons','Lord of the Pings','The Ping Dynasty', + 'LAN Before Time','Bits Please','Hopless Networks','Route of All Evil', + 'TTL You Later','Fiber McFiberface','RFC 1149 Avian Carriers','Spanning Tree Huggers', + 'Dial-Up & Cry','404 Telecom','Loss Leaders','Last Mile Standing', + 'Have You Tried Off & On','Bogon Voyage','Default Route 66','Anycast Away', + 'Hot Potato Routing','Null Route Rangers','Looking Glass Half Full','Jumbo Frame Shop', + 'Route Flap Jacks','Split Horizon & Co.','Path of Least Resistance', +]; +function randomNetworkName(current){ + // Naming must not advance a running scenario's seeded simulation. + const names=NETWORK_NAMES.filter(n=>n!==current); + return names[Math.floor(_rand()*names.length)]; +} +const HTIW='https://tkjaer.github.io/how-the-internet-works/'; +// The real thing: an interactive, zoomable guide to how packets actually travel. Go read it. +// Where players hang out: the community Signal group. +const SIGNAL='https://signal.group/#CjQKIJwvEt5fYt1pvw7J2pV664CyUyGJXmAJLV8ia3nUdAD7EhA_FzdxflEzkNmcvDHdVgLQ'; +const chatHtml=()=>`${tr('modal_and_names.join_the_noc_chat')}${tr('modal_and_names.our_signal_group_swap_screenshots')}${tr('common.join')}`; +const plugHtml=(big)=>`How the Internet Works${big?tr('modal_and_names.the_real_thing_by_thomas_kj'):tr('modal_and_names.the_real_thing_follow_a_packet')}${tr('common.explore')}`; diff --git a/src/game/95-modals/40-title.js b/src/game/95-modals/40-title.js new file mode 100644 index 0000000..c07dc78 --- /dev/null +++ b/src/game/95-modals/40-title.js @@ -0,0 +1,26 @@ +function showTitle(){ + const sv=loadSave(); + if(UI.nm==null)UI.nm=randomNetworkName(); + const starts=[['fra',tr('title.crossroads_of_europe_de_kicks_ix')],['nyc',tr('title.huge_eyeball_market_pricey')],['sin',tr('title.asia_hub_great_peering_far_from')],['sao',tr('title.big_hungry_market_few_providers')],['syd',tr('title.hard_mode_everything_overseas_costs')]]; + openModal(`
+

Series
of Tubes

+

${tr('title.build_an_internet_lay_fiber_between')}

${plugHtml(false)}${isPhone()?installRow():''} + ${sv?`
${btn(tr('title.continue_name_date',{name:esc(sv.name),date:dateStr(sv.day)}),'cont',{},'pink big')}
`:''} +
${btn(tr('common.another_one'),'randomName',{},'ghost sm')}
+
${starts.map(([c,d])=>``).join('')}
+
${[['normal',tr('common.normal')],['sandbox',tr('common.sandbox')]].map(([m,l])=>``).join('')}${btn(tr('title.scenarios_amp_weekly_challenge'),'scenarios',{},'sm')}
+
${segBtns('langSet',LANG,Object.entries(LANGS))}
+
${btn(sv?tr('common.start_a_new_network'):tr('common.start_building'),'start',{},'big')}${btn(tr('common.how_to_play'),'help',{},'ghost')}${btn(tr('common.import_a_save'),'importPick',{},'ghost sm')}${btn(tr('common.settings'),'settings',{},'ghost sm')}

v${APP_VERSION} · ${tr('title.source_on_github')} · ${tr('title.chat_on_signal')} · ${tr('title.cookieless_stats_no_tracking')}

`); + $('nmIn').addEventListener('input',e=>{UI.nm=e.target.value;}); + if(sv){S=migrate(sv);compute();} +} +// "What's new": shown once to returning players after an update, or on demand. +function whatsNew(returning,force){ + if(IS_DEV||!RELEASE_NOTES.length)return false;let seen=null; + try{seen=localStorage.getItem('sot-seen-version');localStorage.setItem('sot-seen-version',APP_VERSION);}catch(e){} + if(!force&&(!returning||seen===APP_VERSION))return false; + openModal(`
${tr('common.release_notes')}

${tr('title.new_in_series_of_tubes_v',{v:esc(APP_VERSION)})}

+ ${notesHtml(RELEASE_NOTES,APP_VERSION)} + ${returning&&S?`

${tr('title.your_network_name_was_saved_and',{name:esc(S.name)})}

`:''} +
${btn(UI.started?tr('title.back_to_my_network'):tr('common.got_it'),UI.started?'closeModal':'helpClose',{},'pink big')}${notesLong(RELEASE_NOTES)?'':`${tr('common.full_changelog')}`}
`); + return true;} diff --git a/src/game/95-modals/50-release-notes.js b/src/game/95-modals/50-release-notes.js new file mode 100644 index 0000000..3d4dbd1 --- /dev/null +++ b/src/game/95-modals/50-release-notes.js @@ -0,0 +1,17 @@ +/* In-app notes stay short: at most NOTE_MAX changes, each cut to its first sentence. When anything was cut, a + link leads to the full notes of this version on GitHub. The CHANGELOG and the GitHub release keep every word. */ +const NOTE_MAX=5,NOTE_CH=140; +function slimNote(n){const m=String(n).match(/^(.+?[.!?])(\s|$)/);let t=m?m[1]:String(n);if(t.length>NOTE_CH)t=t.slice(0,NOTE_CH-1).replace(/\s+\S*$/,'')+'…';return t;} +const notesLong=ns=>ns.length>NOTE_MAX||ns.some(n=>slimNote(n)!==n); +function notesHtml(ns,ver){const more=Math.max(0,ns.length-NOTE_MAX); + return `
    ${ns.slice(0,NOTE_MAX).map(n=>`
  • ${esc(slimNote(n))}
  • `).join('')}${more?`
  • ${trn('release_notes.and_n_more_change',more)}
  • `:''}
`+ + (notesLong(ns)?`

${tr('release_notes.read_the_full_notes_on_github')}

`:'');} +function newerVer(a,b){const x=String(a).split('.').map(Number),y=String(b).split('.').map(Number);for(let i=0;i<3;i++){if((x[i]||0)>(y[i]||0))return true;if((x[i]||0)<(y[i]||0))return false;}return false;} +// While the game is open, look for a newer release now and then and offer a reload. +function checkUpdate(){ + if(IS_DEV||location.protocol==='file:'||!window.fetch)return;const now=Date.now();if(now-(UI.updChecked||0)<60000)return;UI.updChecked=now; + fetch('/version.json',{cache:'no-store'}).then(r=>r.ok?r.json():null).then(j=>{ + if(!j||!j.version||!newerVer(j.version,APP_VERSION))return;if(UI.updLater&&now-UI.updLater<6*3600*1000)return; + const top=(j.notes||[])[0]||'';$('update').innerHTML=`
${tr('release_notes.series_of_tubes_v_is_out',{v:esc(j.version)})}${top?`
${esc(top.length>120?top.slice(0,117)+'…':top)}`:''}
${tr('release_notes.your_game_is_saved_automatically')}
${btn(tr('common.reload_now'),'updateNow',{},'pink sm')}${btn(tr('common.later'),'updateLater',{},'ghost sm')}`;$('update').hidden=false; + }).catch(()=>{}); +} diff --git a/src/game/95-modals/60-help.js b/src/game/95-modals/60-help.js new file mode 100644 index 0000000..282f511 --- /dev/null +++ b/src/game/95-modals/60-help.js @@ -0,0 +1,24 @@ +function showHelp(){ + openModal(`

${tr('help.how_the_internet_works_here')}

+

${tr('help.controls_drag_the_map_to_pan')}

+
+
${tr('common.eyeballs')}
${tr('help.home_broadband_users_they_mostly')}
+
POP
${tr('help.point_of_presence_your_router_in')}
+
${tr('common.ip_transit')}
${tr('help.you_pay_a_bigger_network_per')}
+
Tier 1 / Tier 2
${tr('help.tier_1s_reach_the_whole_internet')}
+
CDN
${tr('help.content_networks_like_netchill_and')}
+
${tr('help.ix_internet_exchange')}
${tr('help.a_shared_switch_in_a_city')}
+
PNI
${tr('help.private_network_interconnect_a_cable')}
+
${tr('help.pni_lead_times')}
${tr('help.a_cross_connect_with_a_small')}
+
${tr('common.supply_chain')}
${tr('help.routers_optics_and_new_builds_get')}
+
${tr('common.backhaul_latency')}
${tr('help.users_feel_the_round_trip_to')}
+
${tr('common.peering_inbox')}
${tr('help.every_ix_port_brings_peering')}
+
${tr('common.embedded_cache')}
${tr('help.a_cdn_s_server_in_your')}
+
DE-KICKS
${tr('help.the_group_behind_several_big')}
${tr('common.remote_peering')}
${tr('help.reach_an_ix_over_a_fabric')}
${tr('common.peering_policy')}
${tr('help.open_peers_with_anyone_selective')}
+
${tr('common.waves')}
${tr('help.your_fiber_links_are_leased_waves')}
${tr('common.95th_percentile')}
${tr('help.transit_bills_sample_your_usage')}
${tr('common.routers')}
${tr('help.each_pop_s_router_model_caps')}
${tr('common.dark_fiber')}
${tr('help.lease_an_iru_or_build_your')}
${tr('common.subsea_cables')}
${tr('help.subsea_waves_can_only_follow_cable')}
${tr('common.latency')}
${tr('help.every_link_has_latency_high')}
${tr('common.noc_dashboard')}
${tr('help.the_chart_button_at_the_top')}
${tr('common.asia')}
${tr('help.a_weird_underserved_market_transit')}
${tr('common.russia')}
${tr('help.moscow_needs_a_mandatory_government')}
${tr('help.events_chains_and_wholesale')}
${tr('help.event_networks_a_final_a_festival')}
${tr('common.bank')}
${tr('help.tap_your_cash_to_open_the')}
${tr('common.lags')}
${tr('help.out_of_port_speed_bundle_up')}
${tr('common.traffic_engineering')}
${tr('help.tap_a_link_to_see_which')}
${tr('common.china')}
${tr('help.mainland_china_needs_a_license_and')}
${tr('common.weird_requirements')}
${tr('help.some_customers_come_with_conditions')}
${tr('common.customer_levels')}
${tr('help.as_your_peak_traffic_and_footprint')}
${tr('help.l2vpn_ddos_protection')}
${tr('help.businesses_may_want_a_private')}
${tr('common.scrubbing_centers')}
${tr('help.build_one_in_as_many_pops')}
${tr('common.nni_fabrics')}
${tr('help.megapork_pocketfabric_and')}
+
${tr('common.conferences')}
${tr('help.nanog_ripe_denog_and_friends_come')}
${tr('common.modes')}
${tr('help.sandbox_gives_you_a_billion_dollars')}
${tr('common.traceroute')}
${tr('help.tap_traceroute_on_any_of_your')}
${tr('common.badges')}
${tr('help.below_your_goals_sits_a_wall')}
${tr('common.the_giants')}
${tr('help.at_customer_level_3_and_4')}
RouteScript
${tr('help.once_auto_te_is_installed_you')}
Auto-TE
${tr('help.traffic_follows_the_shortest_path_by')}
${tr('common.metro_diversity')}
${tr('help.a_pop_is_one_building_until')}
${tr('common.wave_markets')}
${tr('help.what_a_wave_costs_depends_on')}
${tr('common.regional_quirks')}
${tr('help.in_the_gulf_saudi_pops_need')}
${tr('common.boot_times')}
${tr('help.some_routers_take_forever_to_boot')}
${tr('common.failures')}
${tr('help.things_break_all_the_time_fiber')}
+
RouteScript
${tr('help.rules_for_your_auto_te_controller')}
+

${tr('help.want_to_know_how_it_really')}

${plugHtml(true)}${chatHtml()}
${btn(UI.started?tr('common.back_to_the_map'):tr('common.got_it'),'helpClose',{},'big')}${RELEASE_NOTES.length?btn(tr('common.what_s_new_in_v',{v:esc(APP_VERSION)}),'whatsNewShow',{},'ghost'):''}${UI.started&&S&&!S.lost?btn(tr('common.start_a_new_network'),'resetAsk',{},'ghost sm'):''}
${UI.started&&S&&!S.lost?btn(tr('common.export_save'),'exportSave',{},'ghost sm'):''}${btn(tr('common.import_a_save'),'importPick',{},'ghost sm')}${btn(tr('common.settings'),'settings',{},'ghost sm')}
`); +} +function showWin(){setTimeout(()=>{const m=$('modalCard');if(m&&!m.querySelector('[data-act=share]'))m.insertAdjacentHTML('beforeend',`
${btn(tr('help.share_my_network'),'share',{},'pink')}

${tr('help.you_built_a_cartoon_internet_now')}

${plugHtml(true)}`);},0);openModal(`

${tr('help.you_re_a_tier_1')}

${tr('help.name_as_asn_is_transit_free',{name:esc(S.name),asn:S.asn,days:S.day,n:S.stats.incidents})}

${btn(tr('common.keep_building'),'keepPlaying',{},'pink big')}`);sfx('coin');} +function showLose(){openModal(`

${tr('common.bankrupt')}

${tr('help.the_bank_repossessed_your_routers',{name:esc(S.name),days:S.day,peak:fmtG(S.stats.peak)})}

${btn(tr('common.try_again'),'newgame',{},'pink big')}`);try{localStorage.removeItem('sot-save-v1');}catch(e){}} diff --git a/src/game/95-modals/70-link-modal.js b/src/game/95-modals/70-link-modal.js new file mode 100644 index 0000000..d8342f3 --- /dev/null +++ b/src/game/95-modals/70-link-modal.js @@ -0,0 +1,21 @@ +function openLinkModal(a,b){ + if([a,b].includes('kyv')&&[a,b].includes('mos')){openModal(`

${tr('common.not_happening')}

${tr('link_modal.nobody_sells_capacity_between_kyiv')}

`);return;} + if((cnCity(a)||cnCity(b))&&!cnOk()){openModal(`

${tr('link_modal.not_without_a_license')}

${tr('link_modal.building_into_mainland_china_needs_a',{city:CITY[cnCity(a)?a:b].name})}

`);return;} + let route='';UI.pending={a,b};const km=kmBetween(a,b),sub=isSub(a,b),pop=S.pops[b]?0:popCost(b),sib=pairLinks(a,b).filter(l=>l.kind!=='vxc'); + if(!sib.length)UI.route='diverse';const border=cnCity(a)!==cnCity(b),jn=sib.length?routeJoin(a,b):null,ts=landTrenches(a,b),mult=(sib.length&&!(jn&&jn.k===(ts[0]||{}).k)?DIVERSE:1)*(border?3*(UI.cnPrem&&(a==='hkg'||b==='hkg')?1.6:1):1); + if(border)route+=`

${tr('link_modal.cross_border_circuits_into_mainland')}

${a==='hkg'||b==='hkg'?`
${btn(tr('common.regular_crossing'),'cnPrem',{v:0},!UI.cnPrem?'pink':'ghost')}${btn(tr('link_modal.premium_crossing_60_3_loss'),'cnPrem',{v:1},UI.cnPrem?'pink':'ghost')}
`:`

${tr('link_modal.premium_crossings_are_only_sold_in')}

`}`; + if(sib.length&&!(isSub(a,b)&&cablesFor(a,b).length)&&!(UI.via&&UI.via!=='land'&&cablesFor(a,b).some(c=>c.cid===UI.via))){route+=`

${trn('link_modal.you_already_have_n_link_here',sib.length,{list:sib.map(l=>capName(l)).join(', ')})}

+
${ts.length>1?ts.map((t,i)=>btn(`${i?tr('link_modal.diverse_route_n',{n:i}):tr('common.main_route')} ${esc(t.caps.join(', '))}${i?' · +40%':''}`,'route',{r:'t:'+t.k},jn&&jn.k===t.k?'pink':'ghost')).join('')+btn(tr('link_modal.new_diverse_route_40_survives_cuts'),'route',{r:'diverse'},!jn?'pink':'ghost'):btn(tr('link_modal.diverse_route_40_survives_cuts_alone'),'route',{r:'diverse'},!jn?'pink':'ghost')+btn(tr('link_modal.same_trench_cheaper_one_backhoe_cuts'),'route',{r:'same'},jn?'pink':'ghost')}
${ts.length>1?`

${tr('link_modal.waves_on_the_same_route_share')}

`:''}`;} + const mode=UI.lmode==='df'?'df':'wave',tabs=`
${btn(tr('link_modal.lease_a_wave'),'dfMode',{m:'wave'},mode==='wave'?'pink':'ghost')}${btn(tr('common.dark_fiber'),'dfMode',{m:'df'},mode==='df'?'pink':'ghost')}
`; + const head=`
${sub?tr('common.subsea_a6be'):tr('common.terrestrial_19e4')} · ${km.toLocaleString()} km

${CITY[a].name} → ${CITY[b].name}

${tabs}`; + if(mode==='df'){openModal(head+dfModalBody(a,b,km,pop));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));openModal(head+`

${dry?tr('link_modal.no_subsea_cable_lands_in_city',{city:CITY[dry].name,near:CITY[nearLanding(dry)].name}):tr('link_modal.no_subsea_cable_lands_in_both',{a:CITY[a].name,b:CITY[b].name,list:fr.join(', ')})}

${S.won&&!ownCabWhy(a,b)?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+`

${tr('link_modal.the_landing_permit_dispute_in_city',{city:CITY[S.ev.landban.city].name,n:S.ev.landban.until-S.day})}

`);return;} + if(uaePair(a,b)||andesPair(a,b)||rainPair(a,b)||borderPair(a,b))route+=`

${landWhy(a,b)}

`; + route+=`

📈 ${esc(marketNote(a,b,sub))}

`; + const wr=waveRoute(a,b,mult,border); + openModal(`${head} +

${tr('link_modal.waves_are_leased_at_a_flat')}

+ ${pop?`

${tr('link_modal.includes_a_new_pop_in_city',{city:CITY[b].name,price:fmt$(popCost(b)),extra:ruCity(b)?', '+tr('link_modal.government_box_included'):CITY[b].uae?', '+tr('link_modal.free_zone_license_included'):CITY[b].saudi?', '+tr('link_modal.local_telecom_licence_included'):''})}

`:''}${route}${viaSeg(a,b)} +
${LT.map((T,i)=>{const lc=Math.round(waveMo(wr.km,wr.sub,i)*wr.wm),c=lc+pop,sw=subWaveWhy(i,wr.km,wr.sub),so=!sw&&soldOut(a,b,i,wr.cab),ok=waveOk(a,b,i)&&!sw&&!so;return !waveShown(i)?'':``;}).join('')}
`); +} diff --git a/src/game/95-modals/80-own-cable.js b/src/game/95-modals/80-own-cable.js new file mode 100644 index 0000000..2564259 --- /dev/null +++ b/src/game/95-modals/80-own-cable.js @@ -0,0 +1,215 @@ +/* Your own subsea cable (#22). Tier 1 networks lay their own: very expensive, slow to build, and it pays for + itself after a few years if it replaces enough leased waves. Both ends need a cable landing station. You own + up to eight fiber pairs; the first comes lit with a ROADMaster, the repeaters are powered from shore. */ +const SEA_DELAYS=[N_('own_cable.a_whale_has_parked_on_the'),N_('own_cable.the_cable_ship_s_coffee_machine'),N_('own_cable.a_fishing_fleet_is_trawling_exactly'),N_('own_cable.the_seabed_survey_found_an_old'),N_('own_cable.storm_season_the_ship_is_sheltering'),N_('own_cable.the_crew_fished_out_somebody_else')]; +const OWNCAB_LAND=3000000,OWNCAB_KM=6000,OWNCAB_OM=25; +const OWNCAB_NAMES=['Big Wet Tube','Davy Jones’ Backhaul','Kraken-1','Mariana Trench Coat','The Wet Ethernet','Sea-ya Later','Deep Pockets Express','Salty Sausage','Poseidon’s Patch Cable','Neptune Neutrality','Moby Disk','Fibre Nemo','The Long Wet Thing','Bermuda Triangle Routing','Seabed & Breakfast','Atlantis Backhaul']; +const OWNCAB_SHIPS=['MV Cable Guy','Spool of Thought','Wet Willy','Reel Deal','Splice Girl','Knot Today','Seas the Day','HMS Unplugged']; +const landing=c=>CABLE_PAIRS.some(p=>p.a===c||p.b===c); +const nearLanding=c=>CITIES.filter(x=>x.id!==c&&landing(x.id)).sort((x,y)=>kmBetween(c,x.id)-kmBetween(c,y.id))[0].id; +const ownCabKm=(a,b)=>seaRoutes(a,b)[0]?.km||Infinity; +const ownCabCost=km=>Math.round((2*OWNCAB_LAND+km*OWNCAB_KM+DF_SYS.roadm.cost)*hwMul('build')); +const ownCabMo=km=>Math.round(km*OWNCAB_OM)+ampCount(km)*AMP_MO; +const ownCabDays=km=>Math.round(300+km*0.05); +// Marine routing uses the same coastline as the map, in geographic coordinates. +// A quarter-degree grid keeps narrow passages open; edges are checked against +// coastline segments as well as water cells, so diagonal steps cannot cut land. +// Nothing is built until an order is quoted; topology and finished routes are reused. +const SEA_NAV={step:0.25,nx:1440,ny:641,rows:new Map(),edges:null,tiles:new Map(),fine:new Set(),routes:new Map(),ports:new Map(),pass:null,closed:new Set()}; +// Real Europe–Asia cables land at Port Said and cross Egypt beside the canal to Suez; PAN AM crosses Panama by land. +// Each is an overland edge between two sea cells, priced as the distance it covers. +const SEA_PASS=[{id:'suez',a:[32.30,31.30],b:[32.58,29.85]},{id:'panama',a:[-79.90,9.40],b:[-79.50,8.85]}]; +function seaSnap(p){const cx=Math.round((seaLon(p[0])+180)/SEA_NAV.step)%SEA_NAV.nx,cy=Math.round((p[1]+80)/SEA_NAV.step);let best=null; + for(let r=0;r<=16&&!best;r++)for(let dy=-r;dy<=r;dy++)for(let dx=-r;dx<=r;dx++){if(Math.max(Math.abs(dx),Math.abs(dy))!==r)continue;const x=(cx+dx+SEA_NAV.nx)%SEA_NAV.nx,y=cy+dy;if(!seaWater(x,y)||!seaNode(x,y))continue;const id=y*SEA_NAV.nx+x;if(!seaOpen(id))continue;const d=hav(...p,...seaPoint(id));if(!best||d(a((x+180)%360+360)%360-180; +function seaInit(){if(SEA_NAV.edges)return; + SEA_NAV.edges=Array.from({length:181},()=>[]); + for(const poly of COAST_LL)for(let i=0,j=poly.length-1;i{let inside=false;for(const e of SEA_NAV.edges[clamp(Math.floor(lat)+90,0,180)])if((e[1]>lat)!==(e[3]>lat)&&x<(e[2]-e[0])*(lat-e[1])/(e[3]-e[1])+e[0])inside=!inside;return inside;}; + return ray(lon)||(lon<-170&&ray(lon+360)); +} +function seaWater(x,y){if(y<0||y>=SEA_NAV.ny)return false;x=(x+SEA_NAV.nx)%SEA_NAV.nx; + let row=SEA_NAV.rows.get(y);if(!row){row=new Uint8Array(SEA_NAV.nx);const lat=-80+y*SEA_NAV.step;for(let i=0;i=0&&t<=1&&v>=0&&v<=1; +} +function seaClear(A,B,margin=0){const a=[A[0],A[1]],b=[a[0]+seaLon(B[0]-a[0]),B[1]],n=Math.max(1,Math.ceil(Math.max(Math.abs(b[0]-a[0]),Math.abs(b[1]-a[1]))/0.25)); + const checked=new Set(); + for(let i=0;i<=n;i++){const t=i/n,x=a[0]+(b[0]-a[0])*t,y=a[1]+(b[1]-a[1])*t; + if(seaLand(x,y))return false; + if(margin&&[[margin,0],[-margin,0],[0,margin],[0,-margin]].some(([dx,dy])=>seaLand(x+dx,y+dy)))return false; + const tx=Math.floor(x/2),ty=Math.floor(y/2); + // Include adjacent tiles so segments touching a tile boundary are checked too. + for(let v=ty-1;v<=ty+1;v++)for(let u=tx-1;u<=tx+1;u++){const k=(((u+90)%180+180)%180)+','+v;if(checked.has(k))continue;checked.add(k); + for(const e of SEA_NAV.tiles.get(k)||[])if(seaCross(a,b,e))return false;} + }return true; +} +const seaPoint=id=>[-180+(id%SEA_NAV.nx)*SEA_NAV.step,-80+Math.floor(id/SEA_NAV.nx)*SEA_NAV.step]; +const seaNode=(x,y)=>x%4===0&&y%4===0||SEA_NAV.fine.has(Math.floor(-180+x*SEA_NAV.step)+','+Math.floor(-80+y*SEA_NAV.step)); +// A coarse city marker must not snap into a tiny disconnected estuary or lake. +function seaOpen(id){if(!SEA_NAV.connected)SEA_NAV.connected=new Map();if(SEA_NAV.connected.has(id))return SEA_NAV.connected.get(id); + const seen=new Set([id]),queue=[id];let open=false; + for(let i=0;i256){open=true;break;}const x=v%SEA_NAV.nx,y=Math.floor(v/SEA_NAV.nx); + for(const stride of (x%4===0&&y%4===0?[4,1]:[1]))for(let sy=-1;sy<=1;sy++)for(let sx=-1;sx<=1;sx++){if(!sx&&!sy)continue;const dx=sx*stride,dy=sy*stride,xx=(x+dx+SEA_NAV.nx)%SEA_NAV.nx,yy=y+dy,n=yy*SEA_NAV.nx+xx; + if(seen.has(n)||!seaNode(xx,yy)||!seaWater(xx,yy)||!seaStep(v,dx,dy))continue;seen.add(n);queue.push(n);} + }for(const v of seen)SEA_NAV.connected.set(v,open);return open; +} +function seaPorts(city){if(SEA_NAV.ports.has(city))return SEA_NAV.ports.get(city); + const c=CITY[city],p=[c.lon,c.lat],cx=Math.round((seaLon(c.lon)+180)/SEA_NAV.step)%SEA_NAV.nx,cy=Math.round((c.lat+80)/SEA_NAV.step),wet=!seaLand(...p),bins=new Map(); + // Inland city markers may reach more than one sea (Cairo, for example). + // Keep shore approaches in different directions; routing chooses the right sea. + for(let r=0;r<=16;r++)for(let dy=-r;dy<=r;dy++)for(let dx=-r;dx<=r;dx++){ + if(Math.max(Math.abs(dx),Math.abs(dy))!==r)continue;const x=(cx+dx+SEA_NAV.nx)%SEA_NAV.nx,y=cy+dy;if(!seaWater(x,y)||!seaNode(x,y))continue; + const id=y*SEA_NAV.nx+x,q=seaPoint(id),d=hav(...p,...q),angle=Math.atan2(q[1]-p[1],seaLon(q[0]-p[0])*Math.cos(c.lat*Math.PI/180)),bin=Math.floor((angle+Math.PI)*8/Math.PI)%16+'|'+Math.floor(d/100); + if(d>350||bins.has(bin)&&d>=bins.get(bin).d)continue; + if(wet&&!seaClear(p,q))continue; + if(!wet){const n=Math.max(2,Math.ceil(d/2));let water=false,ok=true;for(let i=0;i<=n;i++){const t=i/n,pt=[p[0]+seaLon(q[0]-p[0])*t,p[1]+(q[1]-p[1])*t];if(!seaLand(...pt)){water=true;if(!seaClear(pt,q)){ok=false;break;}}else if(water){ok=false;break;}}if(!ok)continue;} + if(seaOpen(id))bins.set(bin,{id,d,bin}); + } + // Nearby approaches are the default. A low-latency survey may also land further off and backhaul overland, like real + // transatlantic systems that land in the west of England and run to London on land. + const sorted=[...bins.values()].sort((a,b)=>a.d-b.d),limit=sorted.length?(sorted[0].d<30?sorted[0].d+15:sorted[0].d*1.75):0,dir=new Set(),ports=sorted.map(p=>{const k=p.bin.split('|')[0]>>1;const first=!dir.has(k);dir.add(k);return {id:p.id,d:p.d,near:first&&p.d<=limit};});SEA_NAV.ports.set(city,ports);return ports; +} +const seaPort=city=>seaPorts(city)[0]?.id??null,seaNear=ps=>ps.filter(p=>p.near); +// The grid topology is shared by all designs. Test each edge only once. +function seaStep(id,dx,dy){if(!SEA_NAV.known){const n=SEA_NAV.nx*SEA_NAV.ny;SEA_NAV.known=new Uint8Array(n);SEA_NAV.open=new Uint8Array(n);SEA_NAV.knownWide=new Uint8Array(n);SEA_NAV.openWide=new Uint8Array(n);} + const wide=Math.abs(dx)>1||Math.abs(dy)>1,sx=Math.sign(dx),sy=Math.sign(dy),bit=1<<((sy+1)*3+sx+1-(sy>0||sy===0&&sx>0?1:0)),known=wide?SEA_NAV.knownWide:SEA_NAV.known,open=wide?SEA_NAV.openWide:SEA_NAV.open; + if(known[id]&bit)return !!(open[id]&bit);known[id]|=bit; + const a=seaPoint(id),b=[a[0]+dx*SEA_NAV.step,a[1]+dy*SEA_NAV.step]; + for(let y=Math.floor(Math.min(a[1],b[1])/2);y<=Math.floor(Math.max(a[1],b[1])/2);y++)for(let x=Math.floor(Math.min(a[0],b[0])/2);x<=Math.floor(Math.max(a[0],b[0])/2);x++) + for(const e of SEA_NAV.tiles.get((((x+90)%180+180)%180)+','+y)||[])if(seaCross(a,b,e))return false; + open[id]|=bit;return true; +} +function seaSearch(starts,ends,target,clearance){const PASS=seaPasses(); + const dist=new Map(),prev=new Map(),done=new Set(),heap=[],goals=new Map(ends.map(p=>[p.id,p.d]));let goal=Infinity,goalEnd=null; + const put=(id,g)=>{const v={id,g,f:g+(id===-1?0:hav(...seaPoint(id),...target))};let i=heap.length;heap.push(v);while(i){const p=(i-1)>>1;if(heap[p].f<=v.f)break;heap[i]=heap[p];i=p;}heap[i]=v;}; + const take=()=>{const out=heap[0],v=heap.pop();if(heap.length){let i=0;while(i*2+1=v.f)break;heap[i]=heap[j];i=j;}heap[i]=v;}return out;}; + for(const p of starts){dist.set(p.id,p.d);put(p.id,p.d);} + while(heap.length){const {id,g}=take();if(id===-1){const path=[];for(let v=goalEnd;v!==undefined;v=prev.get(v))path.push(seaPoint(v));return path.reverse();}if(done.has(id))continue;done.add(id);if(goals.has(id)&&g+goals.get(id)i+1&&!seaClear(path[i],path[j],margin))j--;out.push(path[j]);i=j;}return out;} +function seaDensify(path){const out=[path[0].slice()];for(let i=1;i[Math.cos(la*r)*Math.cos(lo*r),Math.cos(la*r)*Math.sin(lo*r),Math.sin(la*r)],A=v(a),B=v(b),w=Math.acos(Math.min(1,A[0]*B[0]+A[1]*B[1]+A[2]*B[2])); + const n=Math.max(1,Math.ceil(w/r/0.5)),out=[];if(w<1e-9)return [b.slice()];for(let i=1;i<=n;i++){const t=i/n,f=Math.sin((1-t)*w)/Math.sin(w),g=Math.sin(t*w)/Math.sin(w),x=f*A[0]+g*B[0],y=f*A[1]+g*B[1],z=f*A[2]+g*B[2];out.push([seaLon(Math.atan2(y,x)/r),Math.atan2(z,Math.hypot(x,y))/r]);}return out;} +// A straight line on the map is not the shortest way across an ocean. Long legs follow the great circle where it stays at sea. +function seaGreat(path,margin){const out=[path[0]];for(let i=1;i300){const gc=seaGC(a,b);let ok=true,q=a;for(const p of gc){if(!seaClear(q,p,margin)){ok=false;break;}q=p;}if(ok){out.push(...gc);continue;}}out.push(b);}return out;} +const seaLength=pts=>Math.round(pts.slice(1).reduce((s,p,i)=>s+hav(...pts[i],...p),0)); +function seaRoutes(a,b){seaSync();const reverse=a>b,key=seaKey(a,b);let routes=SEA_NAV.routes.get(key); + if(!routes){const A=reverse?b:a,B=reverse?a:b,PA=seaPorts(A),PB=seaPorts(B);routes=[]; + if(seaNear(PA).length&&seaNear(PB).length)for(const [penalty,margin,all] of [[1,0.5,false],[0.3,0.25,false],[0,0,true]]){ + const raw=seaSearch(all?PA:seaNear(PA),all?PB:seaNear(PB),[CITY[B].lon,CITY[B].lat],penalty);if(!raw)break; + const pts=seaDensify(seaGreat([[CITY[A].lon,CITY[A].lat],...seaSimplify(raw,margin),[CITY[B].lon,CITY[B].lat]],margin)),r={pts,km:seaLength(pts),shore:[raw[0],raw[raw.length-1]]}; + // A survey can reuse the previous feasible route if its new candidate is longer. + routes.push(routes.length&&r.km>routes[routes.length-1].km?routes[routes.length-1]:r); + }SEA_NAV.routes.set(key,routes); + } + return reverse?routes.map(r=>({km:r.km,pts:r.pts.slice().reverse(),shore:r.shore.slice().reverse()})):routes; +} +// Surveys run off the UI thread in browsers. Tests and browsers without workers +// use the same deterministic router synchronously. Switching designs uses the cache. +const SEA_SURVEY={worker:null,pending:new Set(),failed:false}; +function seaReady(a,b){seaSync();const key=seaKey(a,b); + if(SEA_NAV.routes.has(key)||typeof Worker==='undefined'||SEA_SURVEY.failed)return true; + if(SEA_SURVEY.pending.has(key))return false; + try{ + if(!SEA_SURVEY.worker){ + const helpers=[seaSnap,seaPasses,seaGC,seaGreat,seaNear,seaKey,seaSync,seaLon,seaInit,seaLand,seaWater,seaCross,seaClear,seaPoint,seaNode,seaOpen,seaPorts,seaPort,seaStep,seaSearch,seaSimplify,seaDensify,seaLength,seaRoutes,hav,clamp]; + const code='const SEA_PASS='+JSON.stringify(SEA_PASS)+';const COAST_LL='+JSON.stringify(COAST_LL)+';const CITY='+JSON.stringify(Object.fromEntries(CITIES.map(c=>[c.id,{lon:c.lon,lat:c.lat}])))+';const SEA_NAV={step:0.25,nx:1440,ny:641,rows:new Map(),edges:null,tiles:new Map(),fine:new Set(),routes:new Map(),ports:new Map(),pass:null,closed:new Set()};'+ + helpers.map(f=>'const '+f.name+'='+f.toString()+';').join('')+'onmessage=({data:{a,b,key,closed}})=>{try{SEA_NAV.closed=new Set(closed||[]);postMessage({key,routes:seaRoutes(a,b)});}catch(e){postMessage({key,error:String(e)});}};'; + const url=URL.createObjectURL(new Blob([code],{type:'text/javascript'})); + try{SEA_SURVEY.worker=new Worker(url);}finally{URL.revokeObjectURL(url);} + const refresh=key=>{if(!S)return;const survey=$('modalCard').querySelector('[data-sea-survey]');if(UI.pending&&!$('modal').hidden&&survey&&(!key||survey.dataset.seaSurvey===key))openLinkModal(UI.pending.a,UI.pending.b);renderPanel();renderLeft();if(!$('dash').hidden)renderDash();}; + SEA_SURVEY.worker.onmessage=({data})=>{SEA_SURVEY.pending.delete(data.key);if(data.error){SEA_SURVEY.failed=true;SEA_SURVEY.worker.terminate();SEA_SURVEY.worker=null;SEA_SURVEY.pending.clear();}else SEA_NAV.routes.set(data.key,data.routes);refresh(data.error?undefined:data.key);}; + SEA_SURVEY.worker.onerror=()=>{SEA_SURVEY.failed=true;SEA_SURVEY.worker.terminate();SEA_SURVEY.worker=null;SEA_SURVEY.pending.clear();refresh();}; + } + SEA_SURVEY.pending.add(key);const [from,to]=key.split('|');SEA_SURVEY.worker.postMessage({a:from,b:to,key,closed:[...SEA_NAV.closed]});return false; + }catch(e){SEA_SURVEY.failed=true;if(SEA_SURVEY.worker)SEA_SURVEY.worker.terminate();SEA_SURVEY.worker=null;SEA_SURVEY.pending.clear();return true;} +} +const seaSurveyAttr=(a,b)=>{seaSync();const k=seaKey(a,b);return SEA_SURVEY.pending.has(k)?`data-sea-survey="${k}"`:'';}; +function seaMapPoints(pts){const out=[];for(const p of pts){const q=proj(...p);if(out.length)q[0]+=W*Math.round((out[out.length-1][0]-q[0])/W);out.push(q);}return out;} + +// Designs pay for progressively tighter surveys; all use a feasible marine path. +const SEA_DESIGNS={standard:{n:N_('common.standard'),cost:1,time:1},optimized:{n:N_('common.optimized'),cost:3,time:1.3},express:{n:N_('common.low_latency'),cost:7,time:1.7}}; +function seaReference(a,b,express){ + const cs=cablesFor(a,b).filter(c=>express||(CAB[c.cid].lat||1)>=1); + return cs.sort((x,y)=>x.km*(express?(CAB[x.cid].lat||1):1)-y.km*(express?(CAB[y.cid].lat||1):1))[0]; +} +// Routing asks for link latency often; the cables on a route never change, so the express factor is worked out once. +const SEA_XF=new Map(); +function seaLatencyFactor(l){if(l.seaDesign==='optimized')return 1;if(l.seaDesign!=='express')return 1.1; + const k=CIDX[l.a]*4096+CIDX[l.b];let f=SEA_XF.get(k);if(f===undefined){const c=seaReference(l.a,l.b,true);SEA_XF.set(k,f=Math.min(0.9,c?(CAB[c.cid].lat||1):0.9));}return f;} +// The low-latency survey may also follow the corridor of the fastest cable already on this route, where that is shorter +// (only a cable that is in service: one cut by a crisis proves nothing): +// that cable proves the path, and it keeps the fastest design as fast as the fastest cable on the map. +function seaCorridor(a,b){const c=cablesOk(a,b).sort((x,y)=>x.km*(CAB[x.cid].lat||1)-y.km*(CAB[y.cid].lat||1))[0];if(!c)return null;const P=CAB[c.cid].pairs.find(([x,y])=>x===c.a&&y===c.b);if(!P)return null; + let ll=[[CITY[c.a].lon,CITY[c.a].lat],...P[2],[CITY[c.b].lon,CITY[c.b].lat]].map(q=>[seaLon(q[0]),q[1]]);if(c.a!==a)ll=ll.reverse(); + const pts=[ll[0]];for(let i=1;iisSub(a,b)||(landing(a)&&landing(b)&&cablesFor(a,b).length>0); +// What you get back for giving up your own subsea cable (#88): what you paid for it (design and upgrades included) +// if no optic can light it even with both upgrades, +// one still being laid returns most of the part not laid yet, a working one is yours for good. +const cabBack=l=>{if(!l||l.kind!=='df'||!l.own||!l.sub)return 0;const c=l.paid>0?l.paid:ownCabCost(l.km);if(!subNeed(l.km))return c; + if(l.ready>S.day){const tot=Math.max(1,l.ready-(l.day||0));return Math.round(c*0.75*Math.min(1,(l.ready-S.day)/tot));}return 0;}; +function ownCabWhy(a,b){if(!seaCab(a,b))return tr('own_cable.this_route_is_on_land_build'); + if(!S.won)return tr('own_cable.laying_your_own_subsea_cable_is'); + for(const c of [a,b])if(!landing(c))return tr('own_cable.city_has_no_cable_landing_station',{city:CITY[c].name}); + if(cnCity(a)||cnCity(b))return tr('own_cable.nobody_gives_a_foreign_network_a'); + if(!seaReady(a,b))return tr('own_cable.surveying_a_sea_route'); + const routes=seaRoutes(a,b);if(!routes.length)return tr('own_cable.no_navigable_sea_route_connects'); + const km=Math.min(...routes.map(r=>r.km));if(!subNeed(km))return tr('own_cable.km_km_is_more_than_any',{km:km.toLocaleString(),max:Math.round(SUB_MAXKM()).toLocaleString()}); + return '';} +function ownCabTeaser(a,b){const why=ownCabWhy(a,b);return `
${btn(S.won?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_tier_1'),'ownCab',{},S.won&&!why?'pink':'ghost',!!why)}
${why&&S.won?`

${esc(why)}

`:''}`;} +function ownCabBody(a,b,pop){const why=ownCabWhy(a,b);if(why)return `

${esc(why)}

${btn(tr('common.back'),'dfSrc',{v:'lease'},'ghost sm')}`; + const design=own(SEA_DESIGNS,UI.seaDesign)?UI.seaDesign:'standard',upgrades={terminal:!!UI.seaterminal,engineering:!!UI.seaengineering},q=seaQuote(a,b,design,upgrades),{km,cost,days}=q,lack=seaLack(km,upgrades),mo=ownCabMo(km),wt=subMaxTier(km),w=Math.round(waveMo(km,true,wt)*waveMarket(a,b,true).m),save=10*w*LT[4].g/LT[wt].g-mo,pay=save>0?Math.ceil(cost/save):0; + return `

${tr('own_cable.your_very_own_subsea_cable_a')}

+

${tr('common.cable_design')}

${Object.entries(SEA_DESIGNS).map(([v,D])=>{const o=seaQuote(a,b,v,upgrades);return ``;}).join('')}
+

${tr('common.submarine_transmission')}

${Object.entries(SUB_UPGRADES).map(([k,U])=>btn(`${tr(U.n)} ${upgrades[k]?'✓ · ':''}${fmt$(subUpgradeCost({km},k))} · ${tr('own_cable.n_days',{n:U.days})}`,'seaPackage',{k},upgrades[k]?'green sm':'ghost sm')).join('')} + ${lack.length?`

${lack[0]==='design'?tr('own_cable.this_design_s_route_is_km',{km:km.toLocaleString()}):tr('own_cable.km_km_is_too_far_for',{km:km.toLocaleString(),what:lack.length>1?tr('own_cable.a_and_b',{a:tr(SUB_UPGRADES[lack[0]].n),b:tr(SUB_UPGRADES[lack[1]].n)}):tr(SUB_UPGRADES[lack[0]].n)})}

`:`

${tr('common.up_to_g_per_channel',{g:fmtG(submarineRate({a,b,km,kind:'df',own:true,sub:true,subterminal:upgrades.terminal?S.day:undefined,subengineering:upgrades.engineering?S.day:undefined}))})} · ${tr('common.better_terminals_and_optical_tuning')}

`} +
${tr('common.estimated_latency')}${tr('common.ms_ms_one_way',{ms:q.ms.toFixed(1)})}
+
${tr('common.route')}${tr('own_cable.km_km_of_seabed',{km:km.toLocaleString()})}
+
${tr('common.fiber_pairs')}${tr('own_cable.n_in_the_cable_the_first',{n:SUB_PAIRS_MAX})}
+
${tr('common.landing_stations')}${tr('own_cable.a_and_b',{a:CITY[a].name,b:CITY[b].name})}
+
${tr('common.build_time')}${tr('own_cable.about_n_days',{n:days})}
+
${tr('common.due_now')}${fmt$(cost+pop)}
${tr('common.monthly')}${tr('common.price_mo',{price:fmt$(mo)})}
+

${subCarrier(km)?`${tr('own_cable.a_leased_wave_wave_on_this',{wave:LT[wt].n,price:fmt$(w)})} ${pay?tr('own_cable.replace_16_tbps_of_them_and',{n:pay}):''} `:''}${tr('own_cable.cuts_still_happen_anchors_and_sharks')}

+
${btn(tr('own_cable.lay_the_cable_price',{price:fmt$(cost+pop)}),'orderCable',{},'pink big',S.cash0)}${btn(tr('common.back'),'dfSrc',{v:'lease'},'ghost')}
`;} diff --git a/src/game/95-modals/90-fiber-modals.js b/src/game/95-modals/90-fiber-modals.js new file mode 100644 index 0000000..d05d01e --- /dev/null +++ b/src/game/95-modals/90-fiber-modals.js @@ -0,0 +1,35 @@ +function dfModalBody(a,b,km,pop){ + if(seaCab(a,b)&&UI.dfSrc==='cable')return ownCabBody(a,b,pop); + const sea=!isSub(a,b)&&seaCab(a,b)?ownCabTeaser(a,b):''; + if(isSub(a,b)&&!subDfCable(a,b))return `

${tr('fiber_modals.nobody_sells_dark_fiber_on_a')}

`+ownCabTeaser(a,b); + const sc=isSub(a,b)?subDfCable(a,b):null;if(sc)km=sc.km; + if(uaePair(a,b))return `

${tr('fiber_modals.no_dark_fiber_inside_the_uae')}

`+sea; + if(landX(a,b)&&cnCity(a)===cnCity(b))return `

${tr('fiber_modals.nobody_sells_one_fiber_pair_across')}

`+sea; + if(!dfAllowed(a,b))return `

${tr('fiber_modals.dark_fiber_across_the_chinese_border')}

`+sea; + if(lvl()<2)return `

${tr('fiber_modals.dark_fiber_unlocks_at_customer_level')}

`+sea; + const src=UI.dfSrc==='build'&&lvl()>=3&&!sc?'build':'lease',sys=DF_SYS[UI.dfSys]&&DF_SYS[UI.dfSys].lvl<=lvl()?UI.dfSys:'lite',amps=ampCount(km); + const up=(src==='build'?dfBuildCost(km):0)+DF_SYS[sys].cost+amps*AMP_COST+pop,mo=(src==='build'?Math.round(km*0.15):dfLeaseMo(km))+amps*AMP_MO; + const w=Math.round(waveMo(km,false,4)); + return `

${tr('fiber_modals.a_fiber_pair_of_your_own',{km:AMP_EVERY})}

+

${tr('common.the_glass')}

${btn(tr('fiber_modals.lease_an_iru_price_mo_ready',{price:fmt$(dfLeaseMo(km))}),'dfSrc',{v:'lease'},src==='lease'?'pink':'ghost')}${sc?btn(S.won?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_tier_1'),'ownCab',{},'ghost',!!ownCabWhy(a,b)):btn(lvl()>=3?tr('fiber_modals.build_your_own_price_n_days',{price:fmt$(dfBuildCost(km)),n:dfBuildDays(km)}):tr('fiber_modals.build_your_own_level_3'),'dfSrc',{v:'build'},src==='build'?'pink':'ghost',lvl()<3)}${sea?btn(S.won?tr('modals.lay_your_own_subsea_cable'):tr('modals.your_own_subsea_cable_tier_1'),'ownCab',{},'ghost',!!ownCabWhy(a,b)):''}
${sc?`

${tr('fiber_modals.a_fiber_pair_on_cable_km',{cable:esc(CAB[sc.cid].name),km:sc.km.toLocaleString()})}

`:''} + ${src==='build'?`

${tr('fiber_modals.your_own_trench_almost_no_rent')}

`:''} +

${tr('common.line_system')}

${Object.keys(DF_SYS).map(k=>btn(`${DF_SYS[k].n} ${DF_SYS[k].lvl>lvl()?tr('fiber_modals.level_n',{n:DF_SYS[k].lvl}):fmt$(DF_SYS[k].cost)}`,'dfSys',{v:k},sys===k?'pink':'ghost',DF_SYS[k].lvl>lvl())).join('')}
+

${esc(DF_SYS[sys].blurb)} ${trn('fiber_modals.plus_n_in_line_amplifier_price',amps,{price:fmt$(AMP_COST),mo:fmt$(AMP_MO)})}

${km>reachOn(OPT.tp16.reach,!!sc)?`

${tr('fiber_modals.km_km_is_longer_than_any',{km:km.toLocaleString()})}

`:''} +
${tr('common.due_now')}${fmt$(up)}
${tr('common.monthly')}${tr('common.price_mo',{price:fmt$(mo)})}
+

${tr('fiber_modals.for_comparison_a_leased_1_6t',{price:fmt$(w)})}

+
${btn(`${src==='build'?tr('common.start_construction'):tr('fiber_modals.sign_the_iru')} ${fmt$(up)}`,'orderDf',{},'pink big',S.cash`; +} +function openVxcModal({from,to,prov}){ + let rows='';const row=(f,a,b)=>{const km=kmBetween(a,b),sub=isSub(a,b),pb=S.pops[b]?nniPort(b,f.id):null,remote=!S.pops[b]; + const label=remote?tr('fiber_modals.remote_peering_at_ix_discouraged',{ix:esc(CITY[b].ix)}):pb?tr('common.your_pop'):tr('fiber_modals.your_pop_needs_a_fabric_port'); + const freeA=nniPort(a,f.id)?NNI[nniPort(a,f.id).tier].g-nniUsed(a,f.id):0,freeB=remote?1e9:pb?NNI[pb.tier].g-nniUsed(b,f.id):0; + return `
${CITY[a].name} → ${CITY[b].name}
${label} · ${km.toLocaleString()} km${sub?' '+tr('common.subsea'):''}
+
${VXC.map((V,t)=>btn(`${V.n} ${tr('common.price_mo',{price:fmt$(vxcMo(km,sub,t))})}`,'buyVxc',{a,b,prov:f.id,t},'sm',(!remote&&!pb)||V.g>freeA||V.g>freeB||S.cash
`;}; + for(const f of FABS){if(prov&&f.id!==prov)continue; + if(from){if(!nniPort(from,f.id))continue;for(const b of f.cities){if(b===from)continue;if(!S.pops[b]&&!CITY[b].ix)continue;rows+=row(f,from,b);}} + else if(to&&f.cities.includes(to)){for(const a of Object.keys(S.pops))if(a!==to&&nniPort(a,f.id))rows+=row(f,a,to);}} + if(!rows){const fs=FABS.filter(f=>!to||f.cities.includes(to));rows=`

${tr('fiber_modals.you_need_a_fabric_port_at',{list:fs.map(f=>`${esc(f.name)} (${f.cities.filter(c=>S.pops[c]).map(c=>CITY[c].name).join(', ')||tr('fiber_modals.no_pop_of_yours_on_it')})`).join(', ')})}

`;} + openModal(`
${tr('fiber_modals.virtual_circuit_over_an_nni_fabric')}

${from?tr('fiber_modals.from_city',{city:CITY[from].name}):tr('fiber_modals.to_city',{city:CITY[to].name})}

+

${tr('fiber_modals.no_install_fee_live_in_minutes')}

${rows}`); +} + diff --git a/src/game/96-map/10-canvas.js b/src/game/96-map/10-canvas.js new file mode 100644 index 0000000..3210b61 --- /dev/null +++ b/src/game/96-map/10-canvas.js @@ -0,0 +1,27 @@ +/* ================= CANVAS ================= */ +const cv=$('map'),ctx=cv.getContext('2d'); +const cam={x:1050,y:330,z:0.8}; +let CW=0,CH=0,DPR=1; +/* Installed on an iPhone home screen with a translucent status bar, iOS can report a viewport one status bar + shorter than the screen while drawing from the very top, leaving an empty strip under the tab bar. + Measure the screen instead, on standalone iPhones only. It must not depend on the gap it fixes: once + the page is sized to the screen, iOS reports a full viewport, and switching back would bring the strip back. */ +function fixStandaloneHeight(){const R0=document.documentElement; + const sa=window.navigator.standalone===true||!!(window.matchMedia&&matchMedia('(display-mode: standalone)').matches); + const sh=screen&&screen.width&&screen.height?(innerWidth>innerHeight?Math.min(screen.width,screen.height):Math.max(screen.width,screen.height)):0,gap=sh-innerHeight; + const on=sa&&/iPhone|iPod/.test(navigator.userAgent)&&sh>0&&gap>=0&&gap<=80; + R0.classList.toggle('iosfix',on);if(on)R0.style.setProperty('--app-h',sh+'px');else R0.style.removeProperty('--app-h');return on?sh:0;} +function resize(){const ah=fixStandaloneHeight();DPR=Math.min(2,window.devicePixelRatio||1);CW=innerWidth;CH=ah||innerHeight;cv.width=CW*DPR;cv.height=CH*DPR;} +addEventListener('resize',()=>{resize();WL.key=null;renderLeft();fitHud();});resize(); +// Viewport readout for debugging phone layouts: open the game once with ?vp in the address (or the start URL). +function vpDebug(){let el=document.getElementById('vpdbg');if(!el){el=document.createElement('pre');el.id='vpdbg';el.style.cssText='position:fixed;left:8px;bottom:calc(var(--tabbar,0px) + 8px);z-index:99;margin:0;padding:6px 8px;background:rgba(30,38,64,.85);color:#7CFFB2;font:11px/1.35 ui-monospace,monospace;border-radius:8px;pointer-events:none';document.body.appendChild(el); + const pr=document.createElement('div');pr.id='vpprobe';pr.style.cssText='position:fixed;visibility:hidden;padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px)';document.body.appendChild(pr);} + const pr=document.getElementById('vpprobe'),cs=getComputedStyle(pr),vv=window.visualViewport,de=document.documentElement,tb=document.getElementById('tabbar').getBoundingClientRect(); + el.textContent=`inner ${innerWidth}×${innerHeight} · screen ${screen.width}×${screen.height}\nvv ${vv?Math.round(vv.width)+'×'+Math.round(vv.height)+' top '+Math.round(vv.offsetTop):'-'} · client ${de.clientHeight}\nsafe top ${cs.paddingTop} bottom ${cs.paddingBottom}\nstandalone ${navigator.standalone===true||!!(window.matchMedia&&matchMedia('(display-mode: standalone)').matches)} · iosfix ${de.classList.contains('iosfix')} · CH ${CH}\nbody ${Math.round(document.body.getBoundingClientRect().height)} · tabbar ${Math.round(tb.top)}–${Math.round(tb.bottom)}`;} +let VP_T=null;const vpOn=on=>{clearInterval(VP_T);VP_T=null;const el=document.getElementById('vpdbg');if(el)el.remove();if(on){VP_T=setInterval(vpDebug,500);vpDebug();}try{on?localStorage.setItem('sot-vp','1'):localStorage.removeItem('sot-vp');}catch(e){}}; +if(/[?&]vp\b/.test(location.search))vpOn(true);else if(/[?&]novp\b/.test(location.search))vpOn(false); +try{if(localStorage.getItem('sot-vp')==='1')vpOn(true);}catch(e){} +// Inside an installed app there is no address bar: five quick taps on the date toggle the readout. +{let taps=[];document.getElementById('hDate').closest('.chip,div').addEventListener('click',()=>{const t=performance.now();taps=taps.filter(x=>t-x<1500).concat(t);if(taps.length>=5){taps=[];vpOn(!VP_T);}});} +// iOS settles the standalone viewport a moment after launch and after rotating. +for(const t of [300,1000])setTimeout(()=>{resize();WL.key=null;},t);addEventListener('pageshow',()=>{resize();WL.key=null;}); diff --git a/src/game/96-map/20-land-and-clouds.js b/src/game/96-map/20-land-and-clouds.js new file mode 100644 index 0000000..ed77503 --- /dev/null +++ b/src/game/96-map/20-land-and-clouds.js @@ -0,0 +1,18 @@ +function rng(seed){return()=>{seed|=0;seed=seed+0x6D2B79F5|0;let t=Math.imul(seed^seed>>>15,1|seed);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296;};} +function inPoly(x,y,pts){let ins=false;for(let i=0,j=pts.length-1;iy)!==(yj>y))&&(x<(xj-xi)*(y-yi)/(yj-yi)+xi))ins=!ins;}return ins;} +function smoothPath(pts){const p=new Path2D();const n=pts.length;const mid=(a,b)=>[(a[0]+b[0])/2,(a[1]+b[1])/2];let m=mid(pts[n-1],pts[0]);p.moveTo(m[0],m[1]);for(let i=0;i{let a=0;for(let i=0,j=p.length-1;iringArea(p)>=600||CITIES.some(c=>inPoly(c.x,c.y,p))?LANDP_ALL[i]:null).filter(Boolean); +const ALLPOLY=COAST; +const onLand=(x,y)=>ALLPOLY.some(p=>inPoly(x,y,p)); +const R1=rng(7),WAVES=[],HILLS=[]; +while(WAVES.length<220){const x=R1()*W,y=R1()*H;if(!onLand(x,y)&&!onLand(x+12,y)&&!onLand(x-12,y))WAVES.push([x,y,R1()]);} +while(HILLS.length<130){const x=R1()*W,y=R1()*H;if(onLand(x,y)&&!CITIES.some(c=>Math.hypot(c.x-x,c.y-y)<40))HILLS.push([x,y,6+R1()*10,R1()]);} +const CLOUDS=Array.from({length:7},(_,i)=>({x:R1()*W,y:60+R1()*(H-120),s:.7+R1()*.6,v:3+R1()*4})); +const FLOATS=[]; +// Stamped with the map's animation clock, which stops while paused: on the real clock, every floater born after a +// pause lingered off-screen for as long as the pause had lasted, and paydays piled up hundreds of them. +function floater(x,y,text,col){if(!animOn()||UI.mapHid)return;FLOATS.push({x,y,text,col,t:animT});} diff --git a/src/game/96-map/30-settings.js b/src/game/96-map/30-settings.js new file mode 100644 index 0000000..5dd5c11 --- /dev/null +++ b/src/game/96-map/30-settings.js @@ -0,0 +1,33 @@ +// Static markup: elements with data-i18n="label" get their text, and data-i18n-aria-label / data-i18n-title +// their attribute, from the dictionary once at boot. The English stays in the markup for search engines. +function i18nDom(){if(LANG==='en')return;for(const el of document.querySelectorAll('[data-i18n]'))el.textContent=tr(el.dataset.i18n); + for(const a of ['aria-label','title'])for(const el of document.querySelectorAll(`[data-i18n-${a}]`))el.setAttribute(a,tr(el.getAttribute('data-i18n-'+a)));} +// One button per [value,label] option; the current one is highlighted. +function segBtns(act,cur,opts){return opts.map(([v,l])=>btn(l,act,{v},cur===v?'pink sm':'ghost sm')).join('');} +/* Animation setting: auto follows the system's reduced-motion preference, or force it on or off. */ +/* Settings are per device (localStorage), not part of the save: they are about how you like to play. */ +const PREF_DEF={pauseFurious:true,warnUnhappy:true,pauseIncident:false}; +let PREFS=(()=>{try{const j=JSON.parse(localStorage.getItem('sot-prefs')||'{}');return j&&typeof j==='object'?j:{};}catch(e){return {};}})(); +const pref=k=>typeof PREFS[k]==='boolean'?PREFS[k]:PREF_DEF[k]; +function setPref(k,v){if(!own(PREF_DEF,k))return;PREFS[k]=!!v;try{localStorage.setItem('sot-prefs',JSON.stringify(PREFS));}catch(e){}} +// Stop the clock for something the player must see. Nothing happens if the game is already paused. +function autoPause(){if(!S||!UI.speed)return false;UI.resumeSpeed=UI.speed;UI.speed=0;renderHUD();return true;} +const resumeAct=()=>({l:tr('common.resume'),act:'speed',args:{v:UI.resumeSpeed||1}}); +function settingsHtml(){const seg=(lab,act,cur,opts,note)=>`
${lab}
${segBtns(act,cur,opts)}
${note?`

${note}

`:''}`; + const onoff=k=>[[k+':1',tr('common.on')],[k+':0',tr('common.off')]],cur=k=>k+':'+(pref(k)?1:0); + return `

⚙️ ${tr('common.settings')}

${tr('settings.saved_on_this_device')}

+

${tr('settings.customers_and_alerts')}

+ ${seg(tr('settings.pause_when_a_customer_is_furious'),'prefSet',cur('pauseFurious'),onoff('pauseFurious'),tr('settings.the_game_stops_so_you_can'))} + ${seg(tr('settings.warn_when_a_customer_gets_unhappy'),'prefSet',cur('warnUnhappy'),onoff('warnUnhappy'),tr('settings.an_early_heads_up_below_60'))} + ${seg(tr('settings.pause_on_outages_that_hurt'),'prefSet',cur('pauseIncident'),onoff('pauseIncident'),tr('settings.stops_the_game_when_a_failure'))} +

${tr('settings.display_and_sound')}

+ ${seg(tr('common.animations'),'animSet',UI.anim||'auto',[['auto',tr('common.auto')],['on',tr('common.on')],['off',tr('common.off')]],tr('settings.auto_follows_your_device_s_reduce'))} + ${seg(tr('common.sound'),'soundSet',UI.muted?'off':'on',[['on',tr('common.on')],['off',tr('common.off')]])} + ${seg(tr('common.language'),'langSet',LANG,Object.entries(LANGS))} + ${seg(tr('common.viewport_info'),'vpSet',VP_T?'on':'off',[['on',tr('common.on')],['off',tr('common.off')]],tr('settings.for_reporting_layout_bugs_shows_what'))} + ${installRow()}
${btn(tr('common.done_8dd3'),'settingsClose',{},'pink')}
`;} +const refreshSettings=()=>{if(UI.setOpen)openModal(settingsHtml());}; +function animOn(){const m=UI.anim||'auto';if(m==='on')return true;if(m==='off')return false;try{return !matchMedia('(prefers-reduced-motion: reduce)').matches;}catch(e){return true;}} +function applyAnim(){const r=document.documentElement;r.classList.toggle('no-anim',UI.anim==='off');r.classList.toggle('anim-force',UI.anim==='on');if(!animOn())FLOATS.length=0;} +const toS=(wx,wy,k=0)=>[(wx+k*W-cam.x)*cam.z+CW/2,(wy-cam.y)*cam.z+CH/2]; +const iconScale=()=>clamp(Math.sqrt(cam.z),0.7,1.35); diff --git a/src/game/96-map/40-level-of-detail.js b/src/game/96-map/40-level-of-detail.js new file mode 100644 index 0000000..5336f30 --- /dev/null +++ b/src/game/96-map/40-level-of-detail.js @@ -0,0 +1,8 @@ +/* Level of detail (#37): zoomed out the map turns into a network map, with dots for cities, small + router pills for your POPs and thinner links. Phones switch a little earlier, the screen is small. */ +const lodFar=()=>cam.z<(innerWidth<=760?0.95:0.72); +// One native call draws the same rounded box where the browser has it and the corners fit (hundreds per frame). +function rr(x,y,w,h,r){ctx.beginPath();if(ctx.roundRect&&2*r<=w&&2*r<=h){ctx.roundRect(x,y,w,h,r);return;}ctx.moveTo(x+r,y);ctx.arcTo(x+w,y,x+w,y+h,r);ctx.arcTo(x+w,y+h,x,y+h,r);ctx.arcTo(x,y+h,x,y,r);ctx.arcTo(x,y,x+w,y,r);ctx.closePath();} +// Enough world copies to cover any screen width at any zoom (the map wraps horizontally). +function visibleKs(){const ks=[];for(let k=-5;k<=5;k++){const a=toS(0,0,k)[0],b=toS(W,0,k)[0];if(b>-200&&a{const pr=l.a{const ks=[];for(const x of pl||pairLinks(l.a,l.b)){const k=gKey(x);if(!ks.includes(k))ks.push(k);}return ks.indexOf(gKey(l));}; +// pairLinks() for every pair at once (same links, same order), for code that asks about all of them. +function pairIdx(){const m=new Map();for(const l of S.links){const k=edgeKey(l),a=m.get(k);if(a)a.push(l);else m.set(k,[l]);}return m;} +function linkGroups(){const m=new Map();for(const l of S.links){const key=gKey(l);const g=m.get(key);if(g)g.push(l);else m.set(key,[l]);}return [...m.values()];} +// Mixed sizes are spelled out per size ("2×800G + 400G"): "2 × 1.2T" read like two 1.2T waves (#56). +function groupLabel(grp,up){const n=[];for(const x of grp)n[x.tier]=(n[x.tier]||0)+1;let s='';for(let t=n.length-1;t>=0;t--)if(n[t])s+=(s?' + ':'')+(n[t]>1||n[t]===grp.length?n[t]+'×':'')+LT[t].n;return s+(up.lengthp.slice());const same=pairLinks(l.a,l.b).filter(x=>x.cable===l.cable).indexOf(l);if(same>0)for(let j=1;jx.kind==='df'&&x.own&&x.sub).indexOf(l),c0=cablesFor(l.a,l.b).slice().sort((x,y)=>x.km-y.km)[0],cp=c0&&cablePair(c0.cid,l.a,l.b); + if(cp)pts=besideLine(cp.pts,2+k*1.5); + else{const g=bezGeom(l,k);pts=[];for(let j=0;j<=20;j++)pts.push(qpt(g,j/20));}} + if(!pts){const g=bezGeom(l);pts=[];for(let j=0;j<=20;j++)pts.push(qpt(g,j/20));} + const cum=[0];let L=0;for(let j=1;jv/L),t),a=polyAt(sp,c.map(v=>v/L),Math.max(0,t-.02)),b=polyAt(sp,c.map(v=>v/L),Math.min(1,t+.02)),dx=b[0]-a[0],dy=b[1]-a[1],n=Math.hypot(dx,dy)||1,f=d*Math.sin(Math.PI*t);out.push([q[0]+dy/n*f,q[1]-dx/n*f]);}return out;} +function polyAt(sp,cum,t){let i=1;while(it0?(t-t0)/(t1-t0):0;return [sp[i-1][0]+(sp[i][0]-sp[i-1][0])*f,sp[i-1][1]+(sp[i][1]-sp[i-1][1])*f];} +// polyAt() on screen points kept in two arrays (draw() reuses them for every link instead of making new points). +function polyAtXY(X,Y,cum,t){let i=1;while(it0?(t-t0)/(t1-t0):0;return [X[i-1]+(X[i]-X[i-1])*f,Y[i-1]+(Y[i]-Y[i-1])*f];} +let SX=new Float64Array(64),SY=new Float64Array(64); +function segDist(x,y,a,b){const dx=b[0]-a[0],dy=b[1]-a[1],L=dx*dx+dy*dy||1;const t=clamp(((x-a[0])*dx+(y-a[1])*dy)/L,0,1);return Math.hypot(x-a[0]-t*dx,y-a[1]-t*dy);} +// `cached`: the cables are already painted into the world layer. Zoomed in, the layer is painted without +// them (#49), so they are drawn here every frame instead. +function drawCables(ks){const z=cam.z,selC=UI.drag&&UI.drag.mode==='link'?UI.drag.from:(UI.sel&&UI.sel.type==='city'?UI.sel.id:null),cached=!!(WL.cv&&WL.key&&WL.cab); + if(!selC&&z<1.7&&cached)return; + ctx.font='800 10px Nunito, sans-serif';ctx.textAlign='center';ctx.textBaseline='middle'; + for(const cp of CABLE_PAIRS){const C=CAB[cp.cid],hot=!!selC&&(cp.a===selC||cp.b===selC);if(!hot&&cached&&z<1.7)continue;const col=cableCol(C); + for(const k of ks){const sp=cp.pts.map(p=>toS(p[0],p[1],k));let mn=Infinity,mx=-Infinity;for(const q of sp){if(q[0]mx)mx=q[0];}if(mx<-20||mn>CW+20)continue; + if(hot||!cached){ctx.globalAlpha=hot?0.95:0.4;ctx.strokeStyle=col;ctx.lineWidth=hot?3:1.6;ctx.lineJoin='round';ctx.setLineDash(C.age==='old'?[6,5]:[]);ctx.beginPath();ctx.moveTo(sp[0][0],sp[0][1]);for(let i=1;i=1.7){const m=sp[Math.floor(sp.length/2)];ctx.globalAlpha=hot?1:0.75;ctx.lineWidth=3;ctx.strokeStyle='rgba(255,255,255,.85)';ctx.strokeText(C.name,m[0],m[1]-8);ctx.fillStyle=col;ctx.fillText(C.name,m[0],m[1]-8);} + ctx.globalAlpha=1;}}} +function bezGeom(l,at){const A=CITY[l.a],B=CITY[l.b];const i=at!==undefined?at:lineIdx(l);const key=l.id+'|b'+i;const hit=GEO.get(key);if(hit)return hit; + const bx=A.x+wrapDx(A.x,B.x),by=B.y;const dx=bx-A.x,dy=by-A.y,len=Math.hypot(dx,dy)||1;let nx=-dy/len,ny=dx/len;if(ny>0){nx=-nx;ny=-ny;} + const base=Math.max(4,Math.min(len*0.1,90)),step=Math.min(16,len*.06),off0=i<=0?base:(i%2?-1:1)*(base*(i%2?0.2:1)+Math.ceil(i/2)*step); + const mx=(A.x+bx)/2,my=(A.y+by)/2; + const obs=CITIES.filter(c=>c.id!==l.a&&c.id!==l.b).map(c=>[mx+wrapDx(mx,c.x),c.y]); + const clear=(cx,cy)=>{let m=Infinity;const g={ax:A.x,ay:A.y,bx,by,cx,cy};for(let t=0.08;t<0.93;t+=0.06){const [px,py]=qpt(g,t);for(const [ox,oy] of obs){const d=Math.hypot(px-ox,py-oy);if(dMath.sign(o)*Math.min(Math.abs(o),cap); + const cand=[1,1.5,2.1,2.9,3.8].map(k=>lim(sg*mag*k)).concat([1,1.5,2.1,2.9,3.8].map(k=>lim(-sg*Math.max(mag,base)*k))); + let best=null,bs=-Infinity; + for(const off of cand){const cx=mx+nx*off,cy=my+ny*off,c=clear(cx,cy);if(c>=need){best=[cx,cy];break;}const sc=Math.min(c,need)-Math.abs(off)*0.35;if(sc>bs){bs=sc;best=[cx,cy];}} + const g={ax:A.x,ay:A.y,bx,by,cx:best[0],cy:best[1],len};GEO.set(key,g);return g;} +const qpt=(g,t)=>[(1-t)*(1-t)*g.ax+2*(1-t)*t*g.cx+t*t*g.bx,(1-t)*(1-t)*g.ay+2*(1-t)*t*g.cy+t*t*g.by]; +const utilCol=u=>u<=0.001?'#AFC0D6':u<0.65?'#22C47A':u<0.9?'#FFAA1F':'#FF4D5E'; + diff --git a/src/game/96-map/60-draw.js b/src/game/96-map/60-draw.js new file mode 100644 index 0000000..4ed461f --- /dev/null +++ b/src/game/96-map/60-draw.js @@ -0,0 +1,103 @@ +function draw(now){ + if(!ctx)return; + ctx.setTransform(DPR,0,0,DPR,0,0); + // sea + const g=ctx.createLinearGradient(0,0,0,CH);g.addColorStop(0,'#62CBEA');g.addColorStop(1,'#43AED6');ctx.fillStyle=g;ctx.fillRect(0,0,CW,CH); + const ks=visibleKs(),z=cam.z; + const wl=worldLayer(z); + for(const k of ks){ + ctx.setTransform(DPR*z,0,0,DPR*z,DPR*((k*W-cam.x)*z+CW/2),DPR*((-cam.y)*z+CH/2)); + // waves: one path, one stroke + ctx.strokeStyle='rgba(255,255,255,.45)';ctx.lineWidth=2/z;ctx.lineCap='round';ctx.beginPath(); + const ph0=now/900;for(const [x,y,ph] of WAVES){const o=Math.sin(ph0+ph*6)*3;ctx.moveTo(x-9+o,y);ctx.quadraticCurveTo(x-4.5+o,y-4,x+o,y);ctx.quadraticCurveTo(x+4.5+o,y+4,x+9+o,y);}ctx.stroke(); + } + for(const k of ks){if(wl)drawWorldLayer(wl,k,z,ks[0]);else{ctx.setTransform(DPR*z,0,0,DPR*z,DPR*((k*W-cam.x)*z+CW/2),DPR*((-cam.y)*z+CH/2));paintWorld(ctx,z,false);}} + for(const k of ks){ + ctx.setTransform(DPR*z,0,0,DPR*z,DPR*((k*W-cam.x)*z+CW/2),DPR*((-cam.y)*z+CH/2)); + // clouds + ctx.fillStyle='rgba(255,255,255,.55)';ctx.beginPath(); + for(const c of CLOUDS){const x=((c.x+now/1000*c.v)%(W+200))-100,y=c.y;ctx.moveTo(x+16*c.s,y);ctx.arc(x,y,16*c.s,0,7);ctx.moveTo(x+38*c.s,y-8*c.s);ctx.arc(x+18*c.s,y-8*c.s,20*c.s,0,7);ctx.moveTo(x+55*c.s,y);ctx.arc(x+40*c.s,y,15*c.s,0,7);}ctx.fill(); + } + ctx.setTransform(DPR,0,0,DPR,0,0); + if(!S)return; + const sc=iconScale(),day=S.day; + // cable systems + drawCables(ks); + // links + const far=lodFar(),PI=pairIdx(); + for(const grp of linkGroups()){const l=grp[0],many=grp.length>1,up=many?grp.filter(x=>!linkDown(x)):null; + const gm=linkGeom(l,PI.get(edgeKey(l))),cap=many?up.reduce((a,x)=>a+capOf(x),0):capOf(l),load=many?grp.reduce((a,x)=>a+(R.load[x.id]||0),0):(R.load[l.id]||0),u=cap?load/cap:0,df=l.kind==='df',bld=df&&l.ready>day,cut=!bld&&(many?!up.length:linkDown(l))&&!(df&&!(l.ch||[]).length),dark=df&&!bld&&!(l.ch||[]).length,vx=l.kind==='vxc'; + const sel=UI.sel&&UI.sel.type==='link'&&grp.some(x=>x.id===UI.sel.id); + const w=(vx?2.2:(2.5+Math.max(...grp.map(tierW))*1.8+(many?Math.min(1.5,(grp.length-1)*0.5):0)))*sc*(far?0.5:1),np=gm.pts.length; + if(SX.lengthmx)mx=x;} + if(mx<-40||mn>CW+40)continue; + const path=()=>{ctx.beginPath();ctx.moveTo(SX[0],SY[0]);for(let i=1;i0.001?utilCol(u):'#7FD8EE'):utilCol(u);ctx.lineWidth=w;ctx.stroke();ctx.setLineDash([]); + // Still the same path: strokes keep it, so the dotted fiber line goes on top without building it again. + if(df&&!bld&&!dark){ctx.strokeStyle='rgba(255,255,255,.75)';ctx.lineWidth=Math.max(1,w*0.25);ctx.setLineDash([1,6]);ctx.stroke();ctx.setLineDash([]);} + const at=t=>polyAtXY(SX,SY,gm.cum,t); + if(!cut&&load>0.01){const n=clamp(Math.round(2+u*10),2,12)>>(far?1:0)||1,len=gm.len*z,spd=90; + ctx.fillStyle='#fff';ctx.strokeStyle='#1E2640';ctx.lineWidth=far?1:1.5; + const rr2=far?1.6:Math.max(2.2,w*.42),base=now/1000*spd/Math.max(len,40);ctx.beginPath();for(let i=0;i0.9||sel){const t=many?groupLabel(grp,up):capName(l);ctx.font='800 11px "Baloo 2", sans-serif';let tw=LINKW.get(t);if(tw===undefined)LINKW.set(t,tw=ctx.measureText(t).width+10);ctx.fillStyle='#fff';ctx.strokeStyle='#1E2640';ctx.lineWidth=2;rr(mxx-tw/2,my-9,tw,17,8);ctx.fill();ctx.stroke();ctx.fillStyle='#1E2640';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(t,mxx,my+1);} + } + } + // drag preview + if(UI.drag&&UI.drag.mode==='link'){ + const A=CITY[UI.drag.from];let tx=UI.drag.cx,ty=UI.drag.cy; + if(UI.snap){const sv=UI.snap;tx=sv.sx;ty=sv.sy;} + let [ax,ay]=toS(A.x,A.y,0);if(UI.snap){const B=CITY[UI.snap.id];const bxw=A.x+wrapDx(A.x,B.x);[tx,ty]=toS(bxw,B.y,0);}else{/* nearest copy of origin to cursor */for(const k of [-1,1]){const [px,py]=toS(A.x,A.y,k);if(Math.abs(px-tx)x.id===UI.sel.id);const rec=sl&&R.ef[edgeKey(sl)];if(rec){UI.feed=new Set(Object.keys(rec.eg).map(k=>R.egDesc[k].city));UI.dest=new Set(Object.keys(rec.dst));}} + // Place labels: your POPs and the selected city first, then others; a label that would overlap moves above its city or hides. + const vis=[];for(const C of CITIES){if(C.off&&!cityOn(C.id))continue;for(const k of ks){const [sx,sy]=toS(C.x,C.y,k);if(sx<-60||sx>CW+60||sy<-60||sy>CH+60)continue;vis.push({C,sx,sy});}} + const prio=v=>(UI.sel&&UI.sel.type==='city'&&UI.sel.id===v.C.id?0:S.pops[v.C.id]?1:2);vis.sort((a,b)=>prio(a)-prio(b)||b.C.P-a.C.P); + const rects=[],labs=[],hit=(r)=>rects.some(q=>r.x1&&UI.hover!==v.C.id){v.ly=null;continue;} + const h=farL?6:12+Math.sqrt(v.C.P)*0.75;const below=farL?v.sy+15:v.sy+16*sc+8,above=farL?v.sy-15:v.sy-h*sc-17*sc;let ly=null; + for(const y of [below,above]){const r={x:v.sx-tw/2-2,y:y-10,w:tw+4,h:21};if(!hit(r)){ly=y;rects.push(r);labs.push(r);break;}} + // Your POPs may sit over a city icon, but not over another name: that one waits until you zoom in. + if(ly===null&&prio(v)===1)for(const y of [below,above]){const r={x:v.sx-tw/2,y:y-10,w:tw,h:21};if(!labs.some(q=>r.x=3||BIZ_T[o.type].event;for(const c of bCities(o)){CM.off.add(c);if(big)CM.big.add(c);}} + CM.inc=new Set(S.inc.filter(i=>i.type!=='leak').map(i=>i.ref));CM.far=farL; + for(const v of vis.slice().reverse())drawCity(v.C,v.sx,v.sy,sc,now,v.ly); + // floaters + for(let i=FLOATS.length-1;i>=0;i--){const f=FLOATS[i],a=(now-f.t)/1600;if(a>1){FLOATS.splice(i,1);continue;} + for(const k of ks){const [sx,sy]=toS(f.x,f.y,k);ctx.globalAlpha=1-a*a;ctx.font='800 17px "Baloo 2", sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';ctx.lineWidth=4;ctx.strokeStyle='#fff';ctx.strokeText(f.text,sx,sy-a*40);ctx.fillStyle=f.col;ctx.fillText(f.text,sx,sy-a*40);ctx.globalAlpha=1;}} +} +function drawCone(x,y,now){const b=Math.sin(now/300)*1.5;ctx.save();ctx.translate(x,y-12+b);ctx.strokeStyle='#1E2640';ctx.lineWidth=2;ctx.fillStyle='#FF8A3D';ctx.beginPath();ctx.moveTo(-7,9);ctx.lineTo(0,-10);ctx.lineTo(7,9);ctx.closePath();ctx.fill();ctx.stroke();ctx.fillStyle='#fff';ctx.fillRect(-4,-1,8,3);ctx.fillStyle='#1E2640';rr(-10,8,20,4,2);ctx.fill();ctx.restore();} +// Static land + cable map, rendered once per zoom bucket into an offscreen canvas. +function paintWorld(c,z,withCables){const LANDP=lodFar()?LANDP_FAR:LANDP_ALL; + for(const o of [0,W,-W]){c.save();c.translate(o+5/z,7/z);c.fillStyle='rgba(20,90,130,.35)';for(const p of LANDP)c.fill(p);c.restore();} + c.strokeStyle='#F8E6A8';c.lineWidth=10/z;c.lineJoin='round';for(const o of [0,W,-W]){c.save();c.translate(o,0);for(const p of LANDP)c.stroke(p);c.restore();} + c.fillStyle='#9BDA6C';for(const o of [0,W,-W]){c.save();c.translate(o,0);for(const p of LANDP)c.fill(p);c.restore();} + c.fillStyle='#86CB5B';c.beginPath();for(const [x,y,r] of HILLS){c.moveTo(x+r*1.4,y);c.ellipse(x,y,r*1.4,r*.8,0,0,Math.PI*2);}c.fill(); + c.fillStyle='rgba(255,255,255,.18)';c.beginPath();for(const [x,y,r] of HILLS){c.moveTo(x-r*.3+r*.6,y-r*.25);c.ellipse(x-r*.3,y-r*.25,r*.6,r*.3,0,0,Math.PI*2);}c.fill(); + c.strokeStyle='#1E2640';c.lineWidth=2.5/z;for(const o of [0,W,-W]){c.save();c.translate(o,0);for(const p of LANDP)c.stroke(p);c.restore();} + if(withCables)for(const off of [0,W,-W]){c.save();c.translate(off,0);for(const cp of CABLE_PAIRS){const C=CAB[cp.cid];c.globalAlpha=0.4;c.strokeStyle=cableCol(C);c.lineWidth=1.6/z;c.lineJoin='round';c.setLineDash(C.age==='old'?[6/z,5/z]:[]);c.beginPath();c.moveTo(cp.pts[0][0],cp.pts[0][1]);for(let i=1;i=WL.ox&&cam.x+hw<=WL.ox+w&&cam.y-hh>=WL.oy&&cam.y+hh<=WL.oy+h;} +function worldLayer(z){ + const now=performance.now();if(z!==WL.lastZ){WL.lastZ=z;WL.zAt=now;} + const sc=z*DPR,key=sc.toFixed(4),have=!!(WL.cv&&WL.key); + if(have&&WL.key===key&&wlCovers(z))return WL; + if(have&&now-WL.zAt<250)return WL; // mid-gesture: scale the last image + const full=W*sc+2<=MAXPX;let ox=0,oy=0,w=W,h=H; + if(!full){const mx=Math.min(MAXPX/sc,CW/z*2),my=Math.min(MAXPX/sc,CH/z*2);w=mx;h=my;ox=cam.x-w/2;oy=cam.y-h/2;} + const cv2=WL.cv||document.createElement('canvas');cv2.width=Math.ceil(w*sc)+2;cv2.height=Math.ceil(h*sc)+2; + const c=cv2.getContext('2d',SOFT_CANVAS?{willReadFrequently:true}:undefined);if(!c)return null; + const kk=full?0:Math.floor(cam.x/W)*W;c.setTransform(1,0,0,1,0,0);c.clearRect(0,0,cv2.width,cv2.height);c.setTransform(sc,0,0,sc,-(ox-kk)*sc,-oy*sc);paintWorld(c,z,z<1.7); + Object.assign(WL,{cv:cv2,key,sc,ox,oy,full,cab:z<1.7});return WL; +} +// Draw the world image for map copy k (full layers repeat per copy; a crop already holds what is visible). +function drawWorldLayer(wl,k,z,k0){if(!wl.full&&k!==k0)return;const f=z*DPR/wl.sc,ox=(wl.full?k*W:wl.ox); + ctx.setTransform(1,0,0,1,0,0);ctx.drawImage(wl.cv,Math.round(DPR*((ox-cam.x)*z+CW/2)),Math.round(DPR*((wl.oy-cam.y)*z+CH/2)),wl.cv.width*f,wl.cv.height*f);} +function cableCol(C){return C.price<=0.85?'#14A88C':C.price<=1.1?'#2F7BEA':'#A05AE0';} +function drawBackhoe(x,y,now,sub){ + const b=Math.sin(now/180)*2;ctx.save();ctx.translate(x,y-14+b); + ctx.strokeStyle='#1E2640';ctx.lineWidth=2.2; + if(sub){ // shark fin + ctx.fillStyle='#6B7C99';ctx.beginPath();ctx.moveTo(-12,8);ctx.quadraticCurveTo(-2,-14,10,-12);ctx.quadraticCurveTo(4,-2,12,8);ctx.closePath();ctx.fill();ctx.stroke(); + }else{ + ctx.fillStyle='#FFD23F';rr(-12,-4,18,12,3);ctx.fill();ctx.stroke();rr(-8,-12,10,9,2);ctx.fillStyle='#BDE8FF';ctx.fill();ctx.stroke(); + ctx.beginPath();ctx.moveTo(6,0);ctx.lineTo(14,-10);ctx.lineTo(19,2);ctx.stroke();ctx.fillStyle='#1E2640';ctx.beginPath();ctx.arc(-7,10,3,0,7);ctx.arc(2,10,3,0,7);ctx.fill(); + } + ctx.restore(); +} diff --git a/src/game/96-map/80-cities.js b/src/game/96-map/80-cities.js new file mode 100644 index 0000000..fb3a61a --- /dev/null +++ b/src/game/96-map/80-cities.js @@ -0,0 +1,74 @@ +// Label widths by text (city labels by id, link labels and far-view labels by text): measuring text every frame is slow. +const LBLW={},LINKW=new Map(),LBLF=new Map(),CM={off:new Set(),big:new Set(),inc:new Set(),far:false}; +try{document.fonts&&document.fonts.ready.then(()=>{for(const k in LBLW)delete LBLW[k];LINKW.clear();LBLF.clear();FRAME.length=0;});}catch(e){} +function drawCityFar(C,sx,sy,sc,now,lyOverride){ + const p=S.pops[C.id],down=p&&p.down>S.day,sel=UI.sel&&UI.sel.type==='city'&&UI.sel.id===C.id,hov=UI.hover===C.id||(UI.snap&&UI.snap.id===C.id); + ctx.save();ctx.translate(sx,sy);ctx.strokeStyle='#1E2640'; + if(sel){ctx.strokeStyle='#FF4F9A';ctx.lineWidth=2.5;ctx.setLineDash([4,4]);ctx.lineDashOffset=-now/40;ctx.beginPath();ctx.arc(0,0,p?14:9,0,7);ctx.stroke();ctx.setLineDash([]);ctx.strokeStyle='#1E2640';} + if(p){ + if(!down&&R.cityDem[C.id]>0&&sfOf(R,C.id)<0.9){ctx.fillStyle=`rgba(255,77,94,${.35+.25*Math.sin(now/200)})`;ctx.beginPath();ctx.arc(0,0,12,0,7);ctx.fill();} + const col=down?'#8A91A8':'#FF4F9A';ctx.lineWidth=1.8; + if(p.site2){ctx.setLineDash([2,2]);ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(9,6);ctx.stroke();ctx.setLineDash([]);ctx.fillStyle=col;rr(5,3,9,7,3);ctx.fill();ctx.stroke();} + if((p.routers||1)>=2){ctx.fillStyle=down?'#6E7590':'#D63B7F';rr(-6,-7,15,10,4);ctx.fill();ctx.stroke();} + ctx.fillStyle=col;rr(-8,-5,16,10,4);ctx.fill();ctx.stroke(); + }else{ctx.fillStyle=hasIxAt(C.id)?'#FFD23F':'#FFFFFF';ctx.lineWidth=1.5;ctx.beginPath();ctx.arc(0,0,hov?4.5:3.4,0,7);ctx.fill();ctx.stroke();} + if(CM.off.has(C.id)){ctx.fillStyle='#16A866';ctx.lineWidth=1.2;ctx.beginPath();ctx.arc(p?9:5,p?-7:-5,3,0,7);ctx.fill();ctx.stroke();} + if(CM.inc.has(C.id)){ctx.fillStyle='#FF4D5E';ctx.lineWidth=1.2;ctx.beginPath();ctx.arc(p?-9:-5,p?-7:-5,3.4,0,7);ctx.fill();ctx.stroke();} + ctx.restore(); + if(lyOverride!==null&&(p||sel||hov)){ctx.font=`800 ${p?12:11}px "Baloo 2", sans-serif`;const t=C.name,wk=C.id+(p?1:0);let tw=LBLF.get(wk);if(tw===undefined)LBLF.set(wk,tw=ctx.measureText(t).width+12);const ly=lyOverride==null?sy+15:lyOverride; + ctx.fillStyle=p?'#FF4F9A':'#FFFFFF';ctx.strokeStyle='#1E2640';ctx.lineWidth=1.6;rr(sx-tw/2,ly-8,tw,16,8);ctx.fill();ctx.stroke(); + ctx.fillStyle=p?'#FFFFFF':'#1E2640';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(t,sx,ly+1);} +} +function drawCity(C,sx,sy,sc,now,lyOverride){ + if(CM.far)return drawCityFar(C,sx,sy,sc,now,lyOverride); + const hot=(UI.hotMap||{})[C.id]; + const p=S.pops[C.id],down=p&&p.down>S.day,sel=UI.sel&&UI.sel.type==='city'&&UI.sel.id===C.id,hov=UI.hover===C.id||(UI.snap&&UI.snap.id===C.id); + const k=sc*(hov?1.15:1); + ctx.save();ctx.translate(sx,sy); + if(UI.feed&&UI.feed.has(C.id)){ctx.strokeStyle='#FF8A3D';ctx.lineWidth=4;ctx.setLineDash([3,5]);ctx.beginPath();ctx.arc(0,-6*k,36*k,0,7);ctx.stroke();ctx.setLineDash([]);} + if(sel){ctx.strokeStyle='#FF4F9A';ctx.lineWidth=3;ctx.setLineDash([6,6]);ctx.lineDashOffset=-now/40;ctx.beginPath();ctx.arc(0,-6*k,30*k,0,7);ctx.stroke();ctx.setLineDash([]);} + if(p&&!down&&R.cityDem[C.id]>0&&sfOf(R,C.id)<0.9){const a=.35+.25*Math.sin(now/200);ctx.fillStyle=`rgba(255,77,94,${a})`;ctx.beginPath();ctx.arc(0,-6*k,26*k,0,7);ctx.fill();} + ctx.scale(k,k); + ctx.fillStyle='rgba(30,38,64,.2)';ctx.beginPath();ctx.ellipse(0,9,20,5,0,0,7);ctx.fill(); + const h=p?18:12+Math.sqrt(C.P)*0.75; + ctx.strokeStyle='#1E2640';ctx.lineWidth=2.2; + if(!p){const bl=[[-15,h*.65,'#FFFFFF'],[-5,h,'#FFE7A1'],[5,h*.5,'#BDE8FF']]; + for(const [x,hh,col] of bl){ctx.fillStyle=col;rr(x,8-hh,10,hh,2);ctx.fill();ctx.stroke();} + ctx.fillStyle='rgba(30,38,64,.35)';ctx.beginPath();for(const [x,hh] of bl)for(let yy=8-hh+4;yy<5;yy+=5){ctx.rect(x+2.5,yy,2,2);ctx.rect(x+5.5,yy,2,2);}ctx.fill();} + if(p){ + // Second building: a small router B on the metro ring, so dual-site POPs stand out. + if(p.site2){const dB=siteDown(C.id,'b'),cut=p.ringcut>S.day;ctx.save();ctx.lineWidth=2.2;ctx.setLineDash(cut?[3,4]:[]);ctx.strokeStyle=cut?'#FF4D5E':'#1E2640';ctx.beginPath();ctx.moveTo(10,6);ctx.quadraticCurveTo(22,14,26,7);ctx.stroke();ctx.setLineDash([]);ctx.strokeStyle='#1E2640'; + ctx.fillStyle=dB?'#8A91A8':'#FF4F9A';rr(20,-1,18,12,4);ctx.fill();ctx.stroke();ctx.fillStyle='#fff';ctx.font='900 8px Nunito, sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText('B',29,5.5);ctx.restore();} + ctx.translate(0,2); + // Down Under the routers are mounted the other way up. The packets don't seem to mind. + const flip=!!C.au;if(flip){ctx.save();ctx.translate(0,-4);ctx.rotate(Math.PI);} + ctx.lineWidth=2.4;ctx.beginPath();ctx.moveTo(-10,-6);ctx.lineTo(-13,-17);ctx.moveTo(10,-6);ctx.lineTo(13,-17);ctx.stroke(); + ctx.fillStyle=down?'#FF4D5E':'#FFD23F';ctx.beginPath();ctx.arc(-13,-18,2.6,0,7);ctx.arc(13,-18,2.6,0,7);ctx.fill();ctx.stroke(); + if((p.routers||1)>=2){ctx.fillStyle=down?'#6E7590':'#D63B7F';rr(-13,-13,34,16,6);ctx.fill();ctx.stroke();} + if(p.gen){ctx.fillStyle='#FFD23F';rr(-27,-1,9,11,2);ctx.fill();ctx.stroke();} + ctx.fillStyle=down?'#8A91A8':'#FF4F9A';rr(-17,-7,34,16,6);ctx.fill();ctx.stroke(); + if(!down&&(R.nodeLoad[C.id]||0)>=(R.nodeCap[C.id]||1e12)*0.95){for(let i=0;i<3;i++){const t=(now/700+i/3)%1;ctx.fillStyle=`rgba(90,98,130,${0.55*(1-t)})`;ctx.beginPath();ctx.arc(6+i*3,-12-t*18,3+t*4,0,7);ctx.fill();}} + if((p.rgen||0)>0){const G=RG[p.rgen||0];ctx.fillStyle=G.badge?'#7CFFB2':'#FFD23F';ctx.beginPath();ctx.arc(17,-7,6,0,7);ctx.fill();ctx.lineWidth=1.8;ctx.stroke();ctx.fillStyle='#1E2640';ctx.font='900 8px Nunito, sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(G.badge||String(G.cls+1),17,-6.5);ctx.lineWidth=2.2;} + const sf=sfOf(R,C.id); + for(let i=0;i<4;i++){const on=down?false:(((now/(160+i*37))|0)+i)%3!==0;ctx.fillStyle=down?'#3B4260':on?(sf<0.9?'#FF4D5E':'#7CFFB2'):'#2A3150';ctx.beginPath();ctx.arc(-10+i*6.6,1,2.1,0,7);ctx.fill();} + if(down){ctx.fillStyle='#fff';ctx.font='900 14px "Baloo 2", sans-serif';ctx.textAlign='center';ctx.fillText('zzz',20,-14);} + if(flip)ctx.restore(); + ctx.translate(0,-2); + } + const ixn=ixName(C.id); + if(ixn){const mine=!!S.myIx[C.id],joined=hasIxAt(C.id);const ixHot=hot&&hot.ix;ctx.fillStyle=ixHot?(Math.sin(now/180)>0?'#FF4D5E':'#FF8A3D'):mine?'#FF4F9A':joined?'#FFD23F':'#FFFFFF';ctx.beginPath();for(let i=0;i<6;i++){const a=Math.PI/3*i+Math.PI/6;ctx.lineTo(19+8.5*Math.cos(a),-h+2+8.5*Math.sin(a));}ctx.closePath();ctx.fill();ctx.lineWidth=2;ctx.stroke(); + ctx.fillStyle=mine||ixHot?'#fff':'#1E2640';ctx.font='900 8px Nunito, sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText('IX',19,-h+2.5);} + if(hot&&p){let y=-14;const pulse=.75+.25*Math.sin(now/200);for(const k of ['r','t','p','c']){if(!hot[k])continue;ctx.globalAlpha=pulse;ctx.fillStyle='#FF4D5E';ctx.beginPath();ctx.arc(-29,y,6.5,0,7);ctx.fill();ctx.globalAlpha=1;ctx.lineWidth=2;ctx.strokeStyle='#1E2640';ctx.stroke();ctx.fillStyle='#fff';ctx.font='900 8px Nunito, sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(HOTL[k],-29,y+0.5);y+=14;}} + const off=CM.off.has(C.id); + if(off){const by=-h-16+Math.sin(now/250)*3;ctx.fillStyle='#fff';ctx.lineWidth=2.2;ctx.beginPath();ctx.ellipse(-2,by,11,9,0,0,7);ctx.fill();ctx.stroke();ctx.beginPath();ctx.moveTo(-5,by+8);ctx.lineTo(-7,by+14);ctx.lineTo(0,by+8);ctx.fillStyle='#fff';ctx.fill();const big=CM.big.has(C.id);ctx.fillStyle=big?'#FF4F9A':'#16A866';ctx.font='900 13px "Baloo 2", sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(big?'$$':'$',-2,by+1);} + const inc=CM.inc.has(C.id); + if(inc){ctx.fillStyle='#FF4D5E';ctx.beginPath();ctx.arc(-20,-h+2,7,0,7);ctx.fill();ctx.lineWidth=2;ctx.stroke();ctx.fillStyle='#fff';ctx.font='900 11px Nunito, sans-serif';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText('!',-20,-h+3);} + ctx.restore(); + // label + if((cam.z>=0.62||p||sel||hov)&&(lyOverride!==null||hov)){ + ctx.font=`800 ${p?13:12}px "Baloo 2", sans-serif`;const t=C.name,tw=LBLW[C.id+(p?1:0)]||(LBLW[C.id+(p?1:0)]=ctx.measureText(t).width+14),ly=lyOverride==null?sy+16*sc+8:lyOverride; + ctx.fillStyle=p?'#FF4F9A':'#FFFFFF';ctx.strokeStyle='#1E2640';ctx.lineWidth=2;rr(sx-tw/2,ly-9,tw,19,9);ctx.fill();ctx.stroke(); + ctx.fillStyle=p?'#FFFFFF':'#1E2640';ctx.textAlign='center';ctx.textBaseline='middle';ctx.fillText(t,sx,ly+1); + } +} + diff --git a/src/game/96-map/90-input.js b/src/game/96-map/90-input.js new file mode 100644 index 0000000..7165959 --- /dev/null +++ b/src/game/96-map/90-input.js @@ -0,0 +1,42 @@ +/* ---------- hit tests & input ---------- */ +function hitCity(x,y,r=28){let best=null,bd=r*iconScale();const KS=visibleKs();for(const C of CITIES){if(C.off&&!cityOn(C.id))continue;for(const k of KS){const [sx,sy]=toS(C.x,C.y,k);const d=Math.hypot(sx-x,sy+4-y);if(d{audioInit();cv.setPointerCapture(e.pointerId);ptrs.set(e.pointerId,{x:e.clientX,y:e.clientY}); + if(ptrs.size>=2){if(!UI.drag||UI.drag.mode!=='pinch'){const [a,b]=[...ptrs.values()];UI.drag={mode:'pinch',d0:Math.hypot(a.x-b.x,a.y-b.y)||1,z0:cam.z};UI.snap=null;cv.classList.remove('linking');}return;} + const hit=S&&hitCity(e.clientX,e.clientY); + if(hit&&S.pops[hit.id])UI.drag={mode:'maybeLink',from:hit.id,sx:e.clientX,sy:e.clientY,camx:cam.x,camy:cam.y,moved:false}; + else UI.drag={mode:'pan',sx:e.clientX,sy:e.clientY,camx:cam.x,camy:cam.y,moved:false}; +}); +cv.addEventListener('pointermove',e=>{ + if(ptrs.has(e.pointerId))ptrs.set(e.pointerId,{x:e.clientX,y:e.clientY}); + const d=UI.drag; + if(!d){const h=S&&pickCity(e.clientX,e.clientY);UI.hover=h?h.id:null;cv.style.cursor=h?(S.pops[h.id]?'crosshair':'pointer'):(hitLink(e.clientX,e.clientY)?'pointer':'grab');return;} + if(d.mode==='pinch'){if(ptrs.size>=2){const [a,b]=[...ptrs.values()];const mx=(a.x+b.x)/2,my=(a.y+b.y)/2;zoomAt(mx,my,clamp(d.z0*Math.hypot(a.x-b.x,a.y-b.y)/d.d0,ZMIN,ZMAX)/cam.z);}return;} + const dx=e.clientX-d.sx,dy=e.clientY-d.sy;if(Math.hypot(dx,dy)>6)d.moved=true; + if(d.mode==='maybeLink'&&d.moved){d.mode='link';cv.classList.add('linking');} + if(d.mode==='link'){d.cx=e.clientX;d.cy=e.clientY;const h=hitCity(e.clientX,e.clientY,40);UI.snap=h&&h.id!==d.from?h:null;renderHint();} + else if(d.mode==='pan'&&d.moved){cam.x=d.camx-dx/cam.z;cam.y=d.camy-dy/cam.z;wrapCam();cv.style.cursor='grabbing';} +}); +function endPtr(e){ + ptrs.delete(e.pointerId);const d=UI.drag;if(!d)return; + if(d.mode==='pinch'){if(ptrs.size===0){UI.drag=null;UI.snap=null;cv.classList.remove('linking');}return;} + if(d.mode==='link'){if(UI.snap&&UI.snap.id!==d.from){openLinkModal(d.from,UI.snap.id);sfx('click');}} + else if(!d.moved&&S){const h=pickCity(e.clientX,e.clientY); + if(h){selectCity(h.id);renderLeft();sfx('click');} + else{const l=hitLink(e.clientX,e.clientY);if(l){selectLink(l);sfx('click');}else{UI.sel=null;renderPanel();renderLeft();}}} + UI.drag=null;UI.snap=null;cv.classList.remove('linking');cv.style.cursor='grab';renderHint(); +} +// A cancelled pointer (scroll takeover, palm rejection, system gesture) is not a tap or a drop. +function cancelPtr(e){ptrs.delete(e.pointerId);if(ptrs.size)return;UI.drag=null;UI.snap=null;cv.classList.remove('linking');cv.style.cursor='grab';renderHint();} +cv.addEventListener('pointerup',endPtr);cv.addEventListener('pointercancel',cancelPtr); +// Dense regions (southern Brazil, the Benelux) need a close look: cities stop growing past 1.35×, so zooming spreads them out (#126). +const ZMIN=0.35,ZMAX=16; +function zoomAt(mx,my,f){const wx=cam.x+(mx-CW/2)/cam.z,wy=cam.y+(my-CH/2)/cam.z;cam.z=clamp(cam.z*f,ZMIN,ZMAX);cam.x=wx-(mx-CW/2)/cam.z;cam.y=wy-(my-CH/2)/cam.z;wrapCam();} +cv.addEventListener('wheel',e=>{e.preventDefault();zoomAt(e.clientX,e.clientY,Math.exp(-e.deltaY*0.0015));},{passive:false}); +addEventListener('keydown',e=>{if(e.target.closest&&e.target.closest('input,textarea,select,[contenteditable]'))return;if(e.ctrlKey||e.metaKey||e.altKey)return;if(e.code==='Space'&&e.target.closest&&e.target.closest('button,a'))return;if(e.code==='Space'){e.preventDefault();UI.speed=UI.speed?0:1;renderHUD();}if(e.key==='0')ACT.speed({v:0.5});if(e.key==='1')ACT.speed({v:1});if(e.key==='2')ACT.speed({v:2});if(e.key==='3')ACT.speed({v:4});if(e.key==='4')ACT.speed({v:8});if(e.key==='Escape'&&!$('bankBox').hidden){$('bankBox').hidden=true;return;}if(e.key==='Escape'&&!$('dash').hidden){$('dash').hidden=true;return;}if(e.key==='Escape'){if(!$('modal').hidden){if(S&&UI.started&&!S.lost)closeModal();}else{UI.sel=null;renderPanel();}}}); + diff --git a/src/game/96-map/95-clicks.js b/src/game/96-map/95-clicks.js new file mode 100644 index 0000000..7513a99 --- /dev/null +++ b/src/game/96-map/95-clicks.js @@ -0,0 +1,15 @@ +/* ---------- click delegation ---------- */ +let pressing=false; +document.addEventListener('pointerdown',e=>{if(e.target.closest('#panel,#left,#dash,#bankBox,#modal,#tabbar,#toasts'))pressing=true;}); +addEventListener('pointerup',()=>setTimeout(()=>pressing=false,0)); +addEventListener('pointercancel',()=>{pressing=false;});addEventListener('blur',()=>{pressing=false;}); +document.addEventListener('change',e=>{const el=e.target.closest('[data-chg]');if(!el||!S)return;const fn=ACT[el.dataset.chg];if(fn)fn({v:el.value});}); +/* Taps that land on the wrong thing (#44): a real tap only fires the button it went down on, never something that + appeared or moved under the finger, nothing behind a menu that opened or closed mid-tap, and no toast button in + the first half second after the toast popped up. Synthetic clicks (keyboard, tests) are not affected. */ +let PD={t:0,b:null}; +document.addEventListener('pointerdown',e=>{PD={t:performance.now(),b:e.target.closest('[data-act]')};},true); +function tapOk(e,b){if(!e.isTrusted||!PD.t||e.detail===0)return true;const now=performance.now();if(now-PD.t>4000)return true; + if(PD.b!==b)return false;if((UI.layerAt||0)>PD.t)return false;const ts=b.closest('.toast');if(ts&&PD.t-(+ts.dataset.born||0)<500)return false;return true;} +document.addEventListener('click',e=>{const b=e.target.closest('[data-act]');if(!b||b.disabled)return;if(!$('modal').hidden&&!b.closest('#modal'))return;if(!tapOk(e,b))return;audioInit();const fn=ACT[b.dataset.act];if(!fn)return;if(!S&&!['start','randomName','pickStart','cont','help','helpClose','newgame','mute','animSet','soundSet','langSet','closeModal','speed','bankClose','whatsNewShow','updateNow','updateLater','importPick','importGo','modeSet','scenarios','startScn','startWeekly','settings','settingsClose','prefSet','vpSet','install','pitchSkip'].includes(b.dataset.act))return;let a={};try{a=JSON.parse(b.dataset.args||'{}');}catch(_){}fn(a);}); + diff --git a/src/game/99-loop.js b/src/game/99-loop.js new file mode 100644 index 0000000..4487384 --- /dev/null +++ b/src/game/99-loop.js @@ -0,0 +1,48 @@ +/* ================= LOOP ================= */ +let last=performance.now(),acc=0,hudT=0,animT=0; +function frame(now){ + // Schedule the next frame first: one bad lookup in a day tick must not freeze the whole game. + if(!window.__TUBES_TEST__)requestAnimationFrame(frame); + const dt=Math.min(250,now-last);last=now; + if(ANALYTICS.host&&S&&!S.lost&&UI.speed&&document.visibilityState==='visible'){UI.playMs=(UI.playMs||0)+dt;const m=UI.playMs/60000;for(const k of PLAY_MARKS)if(m>=k)track('play_'+k+'m',true);} + if(S&&UI.started&&!S.lost&&now-(UI.lastSave||0)>5000)save(); + // The panels catch up on the frame after a day, so one frame does not carry both the day's simulation and them. + if(UI.panelsDue){UI.panelsDue=false;if(!pressing){renderPanel();renderLeft();if(!$('dash').hidden)renderDash();renderBank();}renderHint();} + if(S&&!S.lost&&$('modal').hidden&&UI.speed){acc+=dt*UI.speed;let n=0;while(acc>=DAY_MS&&n<4&&UI.speed){acc-=DAY_MS;try{dayTick();}catch(e){tickErr(e);}n++;} + if(n){UI.ticking=true;renderHUD();UI.ticking=false;UI.panelsDue=true;}} + if(UI.speed&&!(S&&S.lost))animT+=dt; /* paused = frozen dots, waves and clouds */ + const t=animOn()?animT:0; + if(!(UI.mapHid=mapHidden())&&!mapStill(t,now)){try{draw(t);}catch(e){tickErr(e);}UI.drawnAt=now;} +} +/* On a phone the NOC dashboard (or the bank), scrolled past its top edge, covers the whole map. Drawing the map + under it is work nobody sees, so it waits until the map shows again (and no payday money piles up meanwhile). */ +function mapHidden(){for(const id of ['dashCard','bankCard']){const c=$(id);if(c.parentNode.hidden)continue; + const r=c.getBoundingClientRect();if(r.top<=1&&r.left<=1&&r.right>=innerWidth-1&&r.bottom>=innerHeight-1)return true;}return false;} +/* Paused, or with animations off, the map only changes when you move it, point at something or the network changes. + Until then the last frame is still right, so it is not drawn again (phones keep cool). It is redrawn at least once + a second anyway, and every frame while the land picture is still catching up with a zoom. */ +const FRAME=[]; +function mapStill(t,now){const sl=UI.sel,dr=UI.drag; + const v=[t,cam.x,cam.y,cam.z,CW,CH,DPR,S,R,S&&S.day,S&&S.links.length,S&&S.offers.length,S&&S.inc.length,sl&&sl.type,sl&&sl.id,UI.hover,UI.snap&&UI.snap.id,dr&&dr.mode,dr&&dr.cx,dr&&dr.cy,FLOATS.length]; + let same=v.length===FRAME.length;for(let i=0;iS.day&&R.graceNets&&!S.grace.told){S.grace.told=1;toast(tr('loop.new_networks_on_the_map_this',{n:S.grace.until-S.day}),'goal',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}]);} + if(S.auNews){delete S.auNews;const c=Object.keys(S.pops).find(x=>CITY[x].au);toast(tr('loop.australia_got_more_australian'),'bad',[{l:tr('common.open'),act:'focusCity',args:{city:c}}],{a:'city',v:c});} + if(!whatsNew(true))toast(tr('loop.welcome_back_name_your_network_is',{name:esc(S.name),date:dateStr(S.day)}),'good');} + else{showTitle();whatsNew(false);if(sv)toast(tr('loop.your_saved_game_could_not_be'),'bad');}} + renderHUD();renderLeft(); + window.claude?.hot?.snapshot?.(()=>({S:S&&JSON.parse(JSON.stringify(S)),cam:{...cam}})); + if(!window.__TUBES_TEST__){requestAnimationFrame(frame);setTimeout(checkUpdate,4000);setInterval(checkUpdate,10*60*1000);} +} +window.claude?.hot?.ready ? window.claude.hot.ready(boot) : boot(window.claude?.hot?.data ?? {}); diff --git a/src/i18n/en.js b/src/i18n/en.js new file mode 100644 index 0000000..790c881 --- /dev/null +++ b/src/i18n/en.js @@ -0,0 +1,2915 @@ +// English: the text of every label the game uses (in tr(), trn() and N_() calls in src/, and data-i18n in src/index.html). +// Inlined into the page at build. One entry per line, sorted by label; plurals are {"one":…,"other":…}. +// Add or change text with scripts/i18n-add.js, check with npm run i18n:check. +(window.I18N=window.I18N||{}).en={ +"action_helpers.light_fiber_pair_n_price":"Light fiber pair {n} {price}", +"action_helpers.light_fiber_pair_n_price_mo":"Light fiber pair {n} {price} + {mo}/mo", +"action_helpers.n_fiber_pairs_lit_the_trench":"{n} fiber pairs lit, the trench is full", +"action_helpers.needs_a_roadmaster_9000_line_system":"Needs a ROADMaster 9000 line system.", +"action_helpers.needs_routers_with_pn_ports_or":"Needs routers with {pn} ports or bigger at both ends ({city}).", +"action_helpers.sys_is_full_max_channels":"{sys} is full ({max} channels).", +"action_helpers.sys_is_full_max_channels_sold":"{sys} is full ({max} channels, {sold} sold to customers).", +"action_helpers.this_channel_reaches_max_km_on":"This channel reaches {max} km on this cable; the route is {span} km. Consider submarine terminals or optical engineering.", +"action_helpers.too_far_even_at_its_slowest":"Too far even at its slowest setting: an optical span here is {span} km and it reaches {max} km. Add a regen site (Line system).", +"action_helpers.unlocks_at_customer_level_n":"Unlocks at customer level {n}.", +"actions.your_router_can_t_take_a":"Your router can't take a {port} port.
Upgrade it in the Infra tab.", +"badges.a_petabit_a_second":"A Petabit a Second", +"badges.a_secret_badge":"A secret badge", +"badges.attend_a_conference":"Attend a conference.", +"badges.attend_six_conferences_in_one_game":"Attend six conferences in one game.", +"badges.badge_unlocked_name":"Badge unlocked: {name}", +"badges.blackhole_one_of_your_own_cities":"Blackhole one of your own cities to stop a DDoS.", +"badges.bring_up_your_first_peering_session":"Bring up your first peering session.", +"badges.build_fiber_across_the_andes":"Build fiber across the Andes.", +"badges.buy_a_wave_inside_the_uae":"Buy a wave inside the UAE.", +"badges.complete_any_scenario":"Complete any scenario.", +"badges.complete_every_scenario":"Complete every scenario.", +"badges.complete_three_different_scenarios":"Complete three different scenarios.", +"badges.customer_success_story":"Customer Success Story", +"badges.de_kicks_bingo":"DE-KICKS Bingo", +"badges.debt_free_tier_1":"Debt-Free Tier 1", +"badges.deploy_a_routescript_that_cuts_your":"Deploy a RouteScript that cuts your transit bill by 10% without losing traffic.", +"badges.deploy_a_routescript_that_takes_down":"Deploy a RouteScript that takes down a third of your traffic.", +"badges.everywhere_at_once":"Everywhere at Once", +"badges.finish_a_weekly_challenge":"Finish a weekly challenge.", +"badges.fire_the_hackback_3000tm_and_flatten":"Fire the HackBack 3000™ and flatten an innocent.", +"badges.friend_of_giants":"Friend of Giants", +"badges.get_a_subsea_cable_bitten_by":"Get a subsea cable bitten by a shark.", +"badges.get_bitten_by_sharks_3_times":"Get bitten by sharks 3 times in one game.", +"badges.get_de_peered_by_a_big":"Get de-peered by a big network.", +"badges.go_transit_free":"Go transit-free.", +"badges.goal_complete_name":"Goal complete: {name}", +"badges.got_total_this_game_ever_ever":"{got}/{total} this game · {ever} ever", +"badges.haggle_a_de_kicks_quote_down":"Haggle a DE-KICKS quote down.", +"badges.have_a_cable_cut_by_a":"Have a cable cut by a dragged anchor.", +"badges.have_a_fiber_cut":"Have a fiber cut.", +"badges.have_a_second_site_in_3":"Have a second site in 3 metros.", +"badges.have_auto_te_move_100_gbps":"Have Auto-TE move 100 Gbps onto alternate paths at once.", +"badges.have_pops_in_50_cities":"Have POPs in 50 cities.", +"badges.have_ports_on_10_internet_exchanges":"Have ports on 10 internet exchanges.", +"badges.have_your_fiber_bitten_by_a":"Have your fiber bitten by a crocodile.", +"badges.have_your_fiber_chewed_through_by":"Have your fiber chewed through by a beaver.", +"badges.held_the_flood":"Held the Flood", +"badges.hold_a_billion_dollars_in_cash":"Hold a billion dollars in cash.", +"badges.hold_an_ai_wan_a_training":"Hold an AI WAN, a training run, an ingest and a fiber-pairs deal at the same time.", +"badges.hold_deals_at_3_different_ai":"Hold deals at 3 different AI campuses at once.", +"badges.i_survived_the_elephant":"I Survived the Elephant", +"badges.in_debt_we_trust":"In Debt We Trust", +"badges.iron_curtain_call":"Iron Curtain Call", +"badges.is_this_the_internet":"Is This the Internet?", +"badges.land_a_hackback_3000tm_that_actually":"Land a HackBack 3000™ that actually works.", +"badges.lease_hundreds_of_fiber_pairs_to":"Lease hundreds of fiber pairs to a hyperscaler.", +"badges.left_on_read":"Left on Read", +"badges.light_a_wave_on_the_humboldt":"Light a wave on the Humboldt cable to Sydney.", +"badges.link_panama_city_and_bogota":"Link Panama City and Bogotá.", +"badges.live_through_the_day_half_the":"Live through the day half the internet went down.", +"badges.lose_a_metro_ring_to_one":"Lose a metro ring to one backhoe.", +"badges.lose_fiber_to_a_llama_herd":"Lose fiber to a llama herd.", +"badges.met_the_backhoe":"Met the Backhoe", +"badges.never_paid_list_price":"Never Paid List Price", +"badges.opt_out_of_3_auto_enrolled":"Opt out of 3 auto-enrolled add-ons.", +"badges.over_the_mountains":"Over the Mountains", +"badges.paid_pnis_with_all_three_korean":"Paid PNIs with all three Korean incumbents.", +"badges.peer_at_an_ix_remotely":"Peer at an IX remotely.", +"badges.peering_from_the_couch":"Peering From the Couch", +"badges.peering_over_beer":"Peering Over Beer", +"badges.pops_all_the_way_round_the":"POPs all the way round the Pacific: Los Angeles, Tokyo, Taipei, Manila, Jakarta, Sydney, Auckland and Santiago.", +"badges.pops_in_every_region_on_the":"POPs in every region on the map.", +"badges.pops_in_reykjavik_dublin_london":"POPs in Reykjavik, Dublin, London, Colombo, Taipei, Manila, Tokyo and Auckland.", +"badges.pops_in_warsaw_prague_vienna":"POPs in Warsaw, Prague, Vienna, Budapest, Bucharest, Sofia, Belgrade and Tallinn.", +"badges.ports_at_all_six_de_kicks":"Ports at all six DE-KICKS exchanges. They thank you for your continued partnership.", +"badges.ports_on_ix_brrr_in_sao":"Ports on IX.brrr in São Paulo, Rio and Fortaleza.", +"badges.reach_customer_level_13":"Reach customer level 13.", +"badges.reach_tier_1_within_three_years":"Reach Tier 1 within three years.", +"badges.reach_tier_1_within_two_years":"Reach Tier 1 within two years.", +"badges.reach_tier_2_with_every_single":"Reach Tier 2 with every single session over the route server.", +"badges.reward_amt":"Reward: +{amt}", +"badges.ride_out_load_shedding_on_your":"Ride out load shedding on your own generator.", +"badges.ring_of_fire":"Ring of Fire", +"badges.run_a_licensed_pop_in_mainland":"Run a licensed POP in mainland China.", +"badges.run_a_link_round_cape_horn":"Run a link round Cape Horn.", +"badges.run_a_sacrificial_pni_choke_point":"Run a sacrificial PNI choke point.", +"badges.run_a_slow_booting_packetoinker":"Run a slow-booting PacketOinker chassis.", +"badges.run_two_routers_in_one_pop":"Run two routers in one POP.", +"badges.serve_100_tbps":"Serve 100 Tbps.", +"badges.serve_1_pbps_a_thousand_terabits":"Serve 1 Pbps: a thousand terabits of happy traffic.", +"badges.serve_99_5_of_demand_every":"Serve 99.5% of demand every single day for a whole year.", +"badges.set_up_a_pni_while_the":"Set up a PNI while the conference glow lasts.", +"badges.survive_100_incidents_without":"Survive 100 incidents without customer impact.", +"badges.take_a_de_kicks_retention_offer":"Take a DE-KICKS retention offer.", +"badges.take_out_a_loan":"Take out a loan.", +"badges.the_long_way_round":"The Long Way Round", +"badges.through_the_wall":"Through the Wall", +"badges.turn_on_a_transit_clean_pipe":"Turn on a transit clean-pipe add-on.", +"badges.two_buildings_three_cities":"Two Buildings, Three Cities", +"badges.weather_a_ddos_with_your_defences":"Weather a DDoS with your defences ready.", +"badges.weather_a_multi_terabit_ddos":"Weather a multi-terabit DDoS.", +"badges.win_without_ever_taking_a_loan":"Win without ever taking a loan.", +"badges.zero_peers_given":"Zero Peers Given", +"bank.2_per_open_incident":"+2% per open incident", +"bank.after_loan_payments":"after loan payments", +"bank.apr_apr":"{apr}% APR", +"bank.bank_offers_amount":"{bank} offers {amount}", +"bank.bankers_pretend_to_be_out":"Bankers pretend to be out", +"bank.bankers_return_your_calls":"Bankers return your calls", +"bank.bankers_return_your_emails":"Bankers return your emails", +"bank.bankrupt_at_100k":"Bankrupt at −$100k", +"bank.buy_out_price":"Buy-out {price}", +"bank.buy_them_out_price":"Buy them out {price}", +"bank.condition_broken_for_n_day":{"one":"Condition broken for {n} day.","other":"Condition broken for {n} days."}, +"bank.debt_free_your_accountant_is":"Debt-free. Your accountant is suspicious.", +"bank.in_the_vault":"in the vault", +"bank.n_loan":{"one":"{n} loan","other":"{n} loans"}, +"bank.n_months":"{n} months", +"bank.no_conditions_that_is_the_scary":"No conditions. That is the scary part.", +"bank.no_offers_right_now_banks_get":"No offers right now. Banks get in touch now and then, and much faster when you are in trouble. A better credit rating brings better banks.", +"bank.nothing_to_pay_for_n_months":"Nothing to pay for {n} months. Then everything.", +"bank.nothing_to_pay_until_the_end":"Nothing to pay until the end · {n} months left · growing at {apr}% a year", +"bank.nothing_to_pay_until_the_end_2a38":"Nothing to pay until the end", +"bank.offer_ends_in_n_d":"offer ends in {n}d", +"bank.paid_in_tubecoin":"Paid in TubeCoin", +"bank.pay_mo_for_n_months":"{pay}/mo for {n} months.", +"bank.pay_mo_n_months_left_apr":"{pay}/mo · {n} months left · {apr}% APR", +"bank.pct_of_revenue_forever":"{pct} of revenue, forever", +"bank.pct_of_your_transit_bill":"{pct} of your transit bill", +"bank.pct_of_your_transit_bill_n":"{pct} of your transit bill · {n} months left · the rest is due at the end", +"bank.penalties_are_running":"Penalties are running.", +"bank.penalty_in_n_days":"Penalty in {n} days.", +"bank.plus_pct_of_revenue":"plus {pct} of revenue", +"bank.plus_pct_of_revenue_until_repaid":"plus {pct} of revenue until repaid", +"bank.plus_pct_of_your_revenue_until":"Plus {pct} of your revenue until it is repaid.", +"bank.price_mo_in_extras":"{price}/mo in extras", +"bank.price_to_repay":"{price} to repay", +"bank.rate_set_by_the_stars_each":"rate set by the stars each month", +"bank.really_pay_price":"Really pay {price}?", +"bank.repay_early_price_incl_2_fee":"Repay early {price} incl. 2% fee", +"bank.take_the_money":"Take the money", +"bank.taking_pct_of_your_revenue_every":"Taking {pct} of your revenue every month.", +"bank.the_rest_is_due_at_the":"the rest is due at the end", +"bank.then_about_price_at_once":"then about {price} at once", +"bank.you_pay_pct_of_your_transit":"You pay {pct} of your transit bill until {price} is repaid.", +"banks.always_open_ask_no_questions_do":"Always open. Ask no questions. Do not be late.", +"banks.always_run_an_odd_number_of":"Always run an odd number of POPs. Our numerologist insists.", +"banks.bank_are_circling_they_now_take":"{bank} are circling.
They now take {pct} of your revenue.", +"banks.bank_is_unhappy_you_broke_a":"{bank} is unhappy.
You broke a loan condition: {cond} Fix it within 10 days or pay a penalty.", +"banks.bank_sign_is_in_retrograde_your":"{bank}: {sign} is in retrograde.
Your rate is now {apr}%.", +"banks.bank_the_balloon_popped_the":"{bank}: the balloon popped.
The remaining {price} was due today, all at once. It has left your account.", +"banks.bank_would_like_to_lend_you":"{bank} would like to lend you {amount}.", +"banks.cheap_patient_and_very_particular":"Cheap, patient, and very particular about Stuttgart.", +"banks.cheap_state_money_for_connecting_the":"Cheap state money for connecting the underserved. Bring a pen.", +"banks.cheap_while_the_sun_shines_every":"Cheap while the sun shines. Every open incident adds 2% to your rate.", +"banks.deliver_at_least_95_of_what":"Deliver at least 95% of what your customers want.", +"banks.do_the_kehrwoche_keep_your_noc":"Do the Kehrwoche: keep your NOC free of incidents older than a week.", +"banks.download_our_app_and_enable_all":"Download our app and enable all notifications.", +"banks.every_pop_needs_a_backup_generator":"Every POP needs a backup generator. Our risk team saw one disaster movie.", +"banks.fill_in_form_t_17b_in":"Fill in form T-17b in triplicate, every month, forever.", +"banks.give_our_ceo_s_nephew_a":"Give our CEO’s nephew a job. He needs {price}/mo and a parking spot.", +"banks.instant_approval_instant_regret":"Instant approval. Instant regret.", +"banks.keep_pops_on_at_least_2":"Keep POPs on at least 2 continents. Diversification!", +"banks.keep_your_peering_ratio_above_30":"Keep your peering ratio above 30%. The bank read a blog post about peering.", +"banks.lends_you_money_and_also_a":"Lends you money and also a little bit of their own.", +"banks.loan_from_bank_paid_off_they":"Loan from {bank} paid off!
They sent a fruit basket. It is mostly bananas.", +"banks.nervous_but_enthusiastic":"Nervous, but enthusiastic.", +"banks.never_build_in_bude_the_loan":"Never build in Bude. The loan officer had a bad surfing holiday there.", +"banks.never_let_cash_drop_below_50k":"Never let cash drop below $50k. It makes us sweat.", +"banks.never_sell_your_tubecoin_diamond":"Never sell your TubeCoin. Diamond hands.", +"banks.no_cogentle_transit_anywhere_our_ceo":"No Cogentle transit anywhere. Our CEO got de-peered once and has not recovered.", +"banks.no_diesel_generators_anywhere_our":"No diesel generators anywhere. Our sustainability team is watching.", +"banks.no_goggle_cache_boxes_our_chairman":"No Goggle cache boxes. Our chairman lost an argument with a search engine.", +"banks.no_new_links_on_a_friday":"No new links on a Friday. The stars do not allow it.", +"banks.no_new_subsea_links_while_this":"No new subsea links while this loan runs. We are afraid of sharks.", +"banks.no_payments_at_all_until_the":"No payments at all! Until the very end. Then all of them, at once.", +"banks.no_repayments_ever_just_a_slice":"No repayments, ever. Just a slice of your revenue, forever, and a lot of opinions.", +"banks.only_lends_to_people_who_do":"Only lends to people who do not need it.", +"banks.open_a_new_pop_at_least":"Open a new POP at least every 90 days. Blitzscale or die.", +"banks.opened_three_accounts_for_you_while":"Opened three accounts for you while you read this.", +"banks.our_chairman_needs_a_yacht_for":"Our chairman needs a yacht for the summer. You don’t own one, so you rent one: {price}/mo.", +"banks.our_logo_goes_on_every_router":"Our logo goes on every router you own.", +"banks.pays_out_in_tubecoin_value_may":"Pays out in TubeCoin. Value may vary. A lot.", +"banks.peer_at_the_spatzle_ix_in":"Peer at the Spätzle-IX in Stuttgart. Local money for local packets.", +"banks.penalty_from_bank_fee_added_to":"Penalty from {bank}: {fee}
Added to what you owe. Your monthly payment is now {pay}.", +"banks.pizza_for_the_whole_noc_after":"Pizza for the whole NOC after every incident: {price} each.", +"banks.pluto_which_is_not_even_a":"Pluto, which is not even a planet", +"banks.reach_99_of_the_internet_at":"Reach 99% of the internet at all times. We looked up what a network is for.", +"banks.run_home_broadband_somewhere":"Run home broadband somewhere underserved (Asia, Africa, Oceania or South America).", +"banks.send_us_your_monthly_report_by":"Send us your monthly report by fax.", +"banks.stay_out_of_mainland_china":"Stay out of mainland China. Compliance said so.", +"banks.stay_tier_3_number_go_up":"Stay Tier 3. Number go up, rank stay down.", +"banks.terms_apply_several_terms":"Terms apply. Several terms.", +"banks.the_banks_have_stopped_calling_you":"The banks have stopped calling.
You have more money than most of them. Loan offers come back if your cash ever drops below {cash}.", +"banks.the_cheapest_money_in_town_there":"The cheapest money in town. There is a catch, and it has extra cheese.", +"banks.the_loan_shark_sent_a_reminder":"The loan shark sent a reminder.
Your POP in {city} is dark until tomorrow.", +"banks.they_heard_you_might_be_in":"They heard you might be in a spot of bother.", +"banks.two_very_large_gentlemen_from_loan":"Two very large gentlemen from Loan Shark Telecom Finance unplugged your router in {city} \"as a reminder\".", +"banks.very_solid_mostly":"Very solid. Mostly.", +"banks.you_repay_with_30_of_your":"You repay with 30% of your transit bill. Go transit-free and you stop paying. Until the end.", +"banks.your_ceo_plays_golf_with_our":"Your CEO plays golf with our CEO every Thursday.", +"banks.your_rate_is_set_by_the":"Your rate is set by the stars every month. Mercury is in retrograde a lot.", +"banks.your_rising_sign":"Your rising sign", +"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.", +"businesses.ai_gpu_data_center":"AI GPU data center", +"businesses.ai_gpu_data_centers_and_cloud":"AI GPU data centers and cloud on-ramps. Gear: Chonk 800 routers, Sizzle 800ZR+ optics, ROADMaster 9000 line systems, building your own fiber.", +"businesses.ai_training_interconnect":"AI training interconnect", +"businesses.ai_training_interconnects_and":"AI training interconnects and hyperscaler DCI deals in the terabits. Gear: Absolute Unit 1.6T routers, Sienna WaveMagic 1.6T transponders.", +"businesses.ai_wan_between_two_ai_factories":"AI WAN between two AI factories", +"businesses.backbone_of_backbones":"Backbone of backbones", +"businesses.bulk_backup_transfer_latency_does":"Bulk backup transfer (latency does not matter)", +"businesses.cloud_gaming_platform":"Cloud gaming platform", +"businesses.cloud_gaming_platforms_and_the_cloud":"Cloud gaming platforms, and the cloud gaming era: eyeballs want another 15%. A free PNI with Tel-Mess. Gear: Sienna WaveMagic 3.2T transponders.", +"businesses.cloud_on_ramp":"Cloud on-ramp", +"businesses.customer_on_a_fabric_transit_over":"Customer on a fabric (transit over an NNI)", +"businesses.dark_fiber_pair_lease":"Dark fiber pair lease", +"businesses.dataset_ingest_elephant_flow":"Dataset ingest (elephant flow)", +"businesses.ddos_protection_dia":"DDoS protection + DIA", +"businesses.downstream_isp_buys_transit":"Downstream ISP (buys transit)", +"businesses.downstream_isps_streaming_startups":"Downstream ISPs, streaming startups and universities. Gear: Edge Lord 400 routers, dark fiber leases, Rainbow-in-a-Box DWDM, Ackackia 400ZR+ optics.", +"businesses.enterprises_game_servers_hosting":"Enterprises, game servers, hosting, L2VPNs and DDoS protection.", +"businesses.esports_world_final":"Esports world final", +"businesses.esports_world_finals_and_the_4k":"Esports world finals, and the 4K-everything era: eyeballs in every city want 15% more. Gear: Sonic the Whitebox 64 routers.", +"businesses.fabric_circuit_to_one_of_your":"Fabric circuit to one of your POPs", +"businesses.high_frequency_trading_link":"High-frequency trading link", +"businesses.hundreds_of_fiber_pairs":"Hundreds of fiber pairs", +"businesses.internet_weather_system":"Internet weather system", +"businesses.it_s_not_dns_there_s":"It's not DNS. There's no way it's DNS. It was DNS.", +"businesses.mars_mission_ground_station":"Mars mission ground station", +"businesses.mars_mission_ground_stations_gear":"Mars mission ground stations. Gear: The Router at the End of the Universe.", +"businesses.metaverse_platforms_it_finally_took":"Metaverse platforms (it finally took off), and a free PNI with Etis-a-lot. Gear: Arrrhipster 7800R5 routers, 102.4T fabrics for your own exchange.", +"businesses.multi_site_training_run":"Multi-site training run", +"businesses.peak_12_tbps_25_pops_5":"peak 12 Tbps, 25 POPs, 5 continents", +"businesses.peak_16_tbps_and_32_pops":"peak 16 Tbps and 32 POPs", +"businesses.peak_1_tbps_and_6_pops":"peak 1 Tbps and 6 POPs", +"businesses.peak_200_gbps_and_3_pops":"peak 200 Gbps and 3 POPs", +"businesses.peak_21_tbps_40_pops_6":"peak 21 Tbps, 40 POPs, 6 continents", +"businesses.peak_26_tbps_and_50_pops":"peak 26 Tbps and 50 POPs", +"businesses.peak_33_tbps_and_60_pops":"peak 33 Tbps and 60 POPs", +"businesses.peak_3_tbps_10_pops_3":"peak 3 Tbps, 10 POPs, 3 continents", +"businesses.peak_40_tbps_and_70_pops":"peak 40 Tbps and 70 POPs", +"businesses.peak_50_tbps_and_80_pops":"peak 50 Tbps and 80 POPs", +"businesses.peak_6_tbps_15_pops_4":"peak 6 Tbps, 15 POPs, 4 continents", +"businesses.peak_9_tbps_and_20_pops":"peak 9 Tbps and 20 POPs", +"businesses.people_phone_you_to_ask_if":"People phone you to ask if the internet is down. You are the internet. Have you tried turning yourself off and on again?", +"businesses.provedor_small_regional_isp":"Provedor (small regional ISP)", +"businesses.sd_wan_for_a_chain":"SD-WAN for a chain", +"businesses.six_continent_carrier":"Six-continent carrier", +"businesses.somewhere_on_every_continent_a":"Somewhere, on every continent, a backhoe is thinking about you.", +"businesses.sovereign_cloud_region":"Sovereign cloud region", +"businesses.sovereign_cloud_regions_and_a_free":"Sovereign cloud regions, and a free PNI with Doitsche Telekomm. Gear: ROADMaster 9000 C+L (128 channels), Disco 8K Ultra routers.", +"businesses.the_ai_agent_era_eyeballs_want":"The AI agent era: eyeballs want 25% more, because bots now browse the web for people and they never sleep. Gear: eight fiber pairs in your own land trenches.", +"businesses.the_vr_era_eyeballs_want_20":"The VR era: eyeballs want 20% more. A free PNI with China Moble. Gear: Knockia 7950 XRS routers, 100T scrubbing.", +"businesses.too_big_to_route":"Too big to route", +"businesses.when_your_bgp_sneezes_a_small":"When your BGP sneezes, a small country catches a cold.", +"businesses.you_joined_the_outages_mailing_list":"You joined the outages mailing list. Today you are the outage.", +"businesses.you_now_have_a_change_freeze":"You now have a change freeze. Nobody remembers who declared it.", +"businesses.your_asn_now_shows_up_in":"Your ASN now shows up in other people's traceroutes, and in their tickets.", +"businesses.your_last_fat_fingered_route_leak":"Your last fat-fingered route leak has its own Wikipedia page.", +"businesses.your_maintenance_window_is_2_a":"Your maintenance window is 2 a.m. in every time zone at once.", +"businesses.your_mtu_is_9000_on_every":"Your MTU is 9000 on every link except the one that matters.", +"businesses.your_network_diagram_is_a_photo":"Your network diagram is a photo of a whiteboard.", +"businesses.your_noc_has_a_chat_channel":"Your NOC has a chat channel called #its-always-the-fiber, and it is always the fiber.", +"businesses.your_routing_table_needs_its_own":"Your routing table needs its own routing table.", +"cables.a_bet_on_a_tiny_island":"A bet on a tiny island in the middle of the Pacific.", +"cables.a_friendly_cable_with_french_manners":"A friendly cable with French manners.", +"cables.a_gateway_from_europe_to_india":"A gateway from Europe to India, through the Red Sea. Pronounced like a very surprised cable.", +"cables.a_quick_hop_across_the_red":"A quick hop across the Red Sea between Egypt and Saudi Arabia.", +"cables.a_rainbow_bridge_from_singapore_to":"A rainbow bridge from Singapore to California, via Jakarta and Manila.", +"cables.a_short_cable_across_a_very":"A short cable across a very tense strait.", +"cables.a_small_sweet_cable_from_broadstairs":"A small, sweet cable from Broadstairs to Ostend, then inland to Oostkamp. Not to be confused with any other citrus-flavoured cable.", +"cables.across_the_mediterranean_egypt_to":"Across the Mediterranean, Egypt to France. Romantic, in a cable way.", +"cables.africa_coast_to_europe_twenty_odd":"Africa Coast to Europe: twenty-odd countries on one cable, from France to Cape Town. The best card in a lot of hands.", +"cables.all_the_way_around_africa_and":"All the way around Africa and back. Cheapest capacity on the map.", +"cables.always_agrees_with_you_iberia_to":"Always agrees with you. Iberia to West Africa.", +"cables.american_samoa_to_hawaii_and_samoa":"American Samoa to Hawaii and Samoa on old, smoky glass.", +"cables.an_asia_america_gateway_cable_that":"An Asia–America gateway cable that breaks so often it has its own support group.", +"cables.an_old_cable_from_cape_town":"An old cable from Cape Town round to India, via some very small islands.", +"cables.an_old_ring_around_the_whole":"An old ring around the whole continent, the long way round Cape Horn.", +"cables.another_hop_across_the_channel_with":"Another hop across the Channel, with dark fiber for sale. There is always room for one more.", +"cables.another_london_amsterdam_route":"Another London–Amsterdam route. Everyone has one, so prices are low.", +"cables.argentina_to_portugal_via_brazil":"Argentina to Portugal via Brazil, Cape Verde, Dakar and the Canaries. Laid in 2000 and slowly sinking into legend.", +"cables.asia_africa_europe_and_one_more":"Asia, Africa, Europe, and one more thing.", +"cables.athens_to_alexandria_and_up_the":"Athens to Alexandria, and up the Dardanelles to Istanbul. Opa!", +"cables.boston_to_dublin_nobody_has_thrown":"Boston to Dublin. Nobody has thrown it into the harbour yet.", +"cables.brand_new_cheap_and_it_lands":"Brand new, cheap, and it lands right next to your racks.", +"cables.brazil_straight_to_iberia_skipping":"Brazil straight to Iberia, skipping the US entirely.", +"cables.brazil_to_florida_the_invoice":"Brazil to Florida. The invoice arrives just as fast.", +"cables.brisbane_to_tokyo_with_a_beach":"Brisbane to Tokyo with a beach break in Guam.", +"cables.california_to_hong_kong_via_hawaii":"California to Hong Kong via Hawaii and Guam. A layered cake of repairs.", +"cables.california_to_singapore_via_guam":"California to Singapore via Guam. Everyone on it agrees with each other.", +"cables.casablanca_down_the_coast_to_abidjan":"Casablanca down the coast to Abidjan, served sweet and very hot.", +"cables.chennai_to_singapore_looking_it":"Chennai to Singapore, looking it straight in the eye.", +"cables.connects_doha_to_the_rest_of":"Connects Doha to the rest of the Gulf, by sea, which is handy when the land border is closed.", +"cables.cornwall_to_lagos_down_the_west":"Cornwall to Lagos down the West African coast. Glows faintly when it is working.", +"cables.crosses_bass_strait_faster_than_the":"Crosses Bass Strait faster than the ferry, and gets seasick less often.", +"cables.crosses_the_pacific_mildly_annoyed":"Crosses the Pacific, mildly annoyed about it.", +"cables.danish_for_sea_fun_probably":"Danish for “sea fun”. Probably.", +"cables.darwin_to_singapore_via_jakarta":"Darwin to Singapore via Jakarta. Survival of the fittest packets.", +"cables.discovered_the_atlantic_again_old":"Discovered the Atlantic again. Old, pricey and fragile.", +"cables.djibouti_down_to_durban_hugging_the":"Djibouti down to Durban, hugging the East African coast. Laughs at pirates and anchors.", +"cables.down_the_west_coast_and_across":"Down the west coast and across Cook Strait to the Mainland. The ferries bounce about; the cable mostly doesn’t.", +"cables.dubai_to_mumbai_hits_hard":"Dubai to Mumbai. Hits hard.", +"cables.dublin_to_london_across_the_irish":"Dublin to London across the Irish Sea.", +"cables.east_africa_up_to_europe_via":"East Africa up to Europe via the Red Sea. Lemon squeezy.", +"cables.fiji_to_samoa_always_room_for":"Fiji to Samoa. Always room for one more packet.", +"cables.fiji_to_tonga_the_only_way":"Fiji to Tonga, the only way in. Try saying it three times fast.", +"cables.florida_to_northern_spain_via":"Florida to northern Spain via Bermuda and the Azores. It goes straight through the Triangle and has come out the other side every time. So far.", +"cables.fujairah_to_mumbai_round_the_tip":"Fujairah to Mumbai, round the tip of India to Chennai, then on to Singapore.", +"cables.genoa_to_sicily_and_on_to":"Genoa to Sicily and on to Athens, laid by a search giant that got tired of renting.", +"cables.guam_to_the_marshall_islands_with":"Guam to the Marshall Islands, with a stop on every atoll that writes in.", +"cables.helsinki_to_germany_under_the_baltic":"Helsinki to Germany under the Baltic. Anchors keep finding it.", +"cables.hits_the_high_notes_across_the":"Hits the high notes across the Atlantic. Huge capacity, cheap waves.", +"cables.hops_from_new_york_to_the":"Hops from New York to the UK and Spain.", +"cables.hops_the_caribbean_so_bogota_can":"Hops the Caribbean so Bogotá can skip the jungle.", +"cables.hops_via_greenland_polar_bears":"Hops via Greenland. Polar bears included.", +"cables.iceland_s_lifeline_to_scotland":"Iceland’s lifeline to Scotland. Lonely but determined.", +"cables.iceland_to_denmark_choreographed":"Iceland to Denmark, choreographed.", +"cables.iceland_to_ireland_brand_new_and":"Iceland to Ireland, brand new and still smells like plastic.", +"cables.india_the_middle_east_and_western":"India, the Middle East and Western Europe, all on one cable. Lands in Cairo on the way.", +"cables.ireland_to_norway_the_long_way":"Ireland to Norway, the long way round the top of Scotland. Vikings, but in reverse.", +"cables.istanbul_to_bucharest_s_coast_across":"Istanbul to Bucharest's coast across the Black Sea.", +"cables.its_predecessor_was_faster_marketing":"Its predecessor was FASTER. Marketing had a good day.", +"cables.kenya_to_the_gulf_makes_the":"Kenya to the Gulf. Makes the dream work.", +"cables.laid_last_century_cuts_often_costs":"Laid last century. Cuts often, costs more, still somehow running.", +"cables.leaves_the_gulf_from_fujairah_and":"Leaves the Gulf from Fujairah and runs up the Red Sea to Europe.", +"cables.lighter_on_paperwork_than_its":"Lighter on paperwork than its namesake. Still heavy on paperwork.", +"cables.lisbon_to_barcelona_and_marseille":"Lisbon to Barcelona and Marseille along the coast. Look straight at the latency graph and it turns to stone.", +"cables.london_to_paris_under_the_channel":"London to Paris under the Channel. Cheaper than the train.", +"cables.long_island_to_cornwall_follow_it":"Long Island to Cornwall. Follow it all the way to the wizard in the cable hut.", +"cables.los_angeles_to_chile_with_a":"Los Angeles to Chile, with a small detour for Panama.", +"cables.los_angeles_to_hawaii_guam_and":"Los Angeles to Hawaii, Guam and the Philippines. See you later, packets.", +"cables.marseille_to_singapore_then_it":"Marseille to Singapore, then it leaves the party.", +"cables.named_after_a_planet_behaves_like":"Named after a planet, behaves like one: big and far away.", +"cables.named_after_a_wine_sao_paulo":"Named after a wine. São Paulo to Buenos Aires, past Uruguay.", +"cables.new_cables_increasingly_land_in":"New cables increasingly land in Jeddah instead of Egypt. This one heads for India and Singapore.", +"cables.new_york_to_ireland_the_tech":"New York to Ireland: the tech-tax express.", +"cables.new_york_to_the_cliffs_of":"New York to the cliffs of Bude. It made it home in the end.", +"cables.nobody_remembers_who_it_is_named":"Nobody remembers who it is named after.", +"cables.north_sea_workhorse_from_london_to":"North Sea workhorse from London to Amsterdam. Dark fiber pairs for sale by the dozen.", +"cables.norway_to_the_uk_across_the":"Norway to the UK across the North Sea. Fiber pairs for sale, because the oil money wanted a hobby.", +"cables.old_pacific_workhorse_everyone_hopes":"Old Pacific workhorse. Everyone hopes it holds.", +"cables.one_ring_to_bind_invercargill_to":"One ring to bind Invercargill to Sydney, Melbourne and Auckland. It lands next to a paddock where someone is building an AI factory, which is how you know it might really happen.", +"cables.palermo_to_marseille_and_alexandria":"Palermo to Marseille and Alexandria. Every Europe–Asia shortcut wants a stop in Sicily.", +"cables.perth_to_singapore_and_jakarta":"Perth to Singapore and Jakarta. Packed fresh every morning, and cut more often than a sandwich.", +"cables.perth_to_the_gulf_across_the":"Perth to the Gulf across the Indian Ocean. Oh man, it is long.", +"cables.portugal_to_lagos_with_stops_in":"Portugal to Lagos, with stops in Dakar, Abidjan and Accra. Only ever thinks about West Africa.", +"cables.portugal_to_the_us_southeast_via":"Portugal to the US Southeast via Bermuda. Means cloud in Portuguese, and is owned by one.", +"cables.quick_pacific_crossing_with_a_stop":"Quick Pacific crossing with a stop for snacks.", +"cables.samoa_to_tahiti_by_way_of":"Samoa to Tahiti by way of the Cook Islands. Steeped slowly.", +"cables.scotland_to_iceland_via_shetland_and":"Scotland to Iceland via Shetland and the Faroes. More sheep than packets.", +"cables.short_hop_across_the_north_sea":"Short hop across the North Sea. An odyssey it is not.", +"cables.short_hops_under_the_baltic_sea":"Short hops under the Baltic Sea. Every passing ship seems to find it.", +"cables.singapore_to_sydney_via_perth_on":"Singapore to Sydney via Perth, on the days it is up.", +"cables.sixth_in_a_long_running_series":"Sixth in a long-running series. Europe to India to Singapore.", +"cables.south_atlantic_cool_and_confident":"South Atlantic, cool and confident.", +"cables.southeast_asia_to_japan_with_snacks":"Southeast Asia to Japan, with snacks.", +"cables.stavanger_to_the_netherlands_via":"Stavanger to the Netherlands via every oil platform in the North Sea. The roughnecks stream a lot of football.", +"cables.straight_across_the_south_atlantic":"Straight across the South Atlantic from Fortaleza to Cameroon. No stops, no islands, no excuses.", +"cables.straight_from_sao_paulo_to_new":"Straight from São Paulo to New York, skipping the Miami hairpin.", +"cables.sydney_melbourne_adelaide_and_perth":"Sydney, Melbourne, Adelaide and Perth by sea, so your packets never have to cross the Nullarbor. Another one from the bloke who starts a fibre company every time he finishes a flat white.", +"cables.sydney_to_auckland_with_plenty_to":"Sydney to Auckland with plenty to spare.", +"cables.sydney_to_honolulu_and_not_a":"Sydney to Honolulu, and not a metre further. Getting to the mainland is your problem.", +"cables.sydney_to_noumea_wishes_it_were":"Sydney to Nouméa. Wishes it were a supercontinent.", +"cables.sydney_to_papua_new_guinea_and":"Sydney to Papua New Guinea and the Solomon Islands. Hums while it works.", +"cables.sydney_to_tokyo_by_way_of":"Sydney to Tokyo by way of Guam, going round and round since 2001.", +"cables.tahiti_to_hawaii_trolling_for":"Tahiti to Hawaii, trolling for bandwidth.", +"cables.tenerife_to_the_spanish_mainland_as":"Tenerife to the Spanish mainland. As long as it keeps singing, everything is fine.", +"cables.the_cable_that_brought_east_africa":"The cable that brought East Africa online, from Durban up to Djibouti and on to Mumbai. Still tells the story at every party.", +"cables.the_first_cable_from_south_america":"The first cable from South America to Oceania. 14,000 km of very lonely glass.", +"cables.the_old_workhorse_s_younger_sibling":"The old workhorse’s younger sibling: Los Angeles to Sydney with a branch to Fiji.", +"cables.the_pretty_way_around_east_asia":"The pretty way around East Asia.", +"cables.the_previous_generation_still":"The previous generation. Still carries most of Pakistan, Sri Lanka and Bangladesh, held together with hope.", +"cables.the_sea_stallion_blackpool_to":"The Sea Stallion: Blackpool to Denmark, galloping round the north of Scotland.", +"cables.the_straightest_line_across_the":"The straightest line across the Atlantic. Traders pay double to save a few milliseconds.", +"cables.up_the_west_coast_of_africa":"Up the west coast of Africa. Something on it is always down.", +"cables.west_africa_s_first_big_cable":"West Africa’s first big cable, from Portugal to Cape Town. Old and wobbly, but still holding things up.", +"cities.270_million_people_on_17_000":"270 million people on 17,000 islands. Mobile first, and very hungry for bandwidth.", +"cities.a_capital_high_in_the_andes":"A capital high in the Andes, just south of the equator, that pays in US dollars. Volcanoes on every horizon.", +"cities.a_capital_in_a_valley_under":"A capital in a valley under a green mountain. The national grid has had some famous bad days, so bring a generator.", +"cities.a_capital_next_to_the_ruins":"A capital next to the ruins of Carthage, where the Mediterranean is at its narrowest. Cables cross to Sicily in no time.", +"cities.a_city_on_seven_hills_by":"A city on seven hills by Lake Victoria. No coast, so every packet to the sea crosses Kenya or Tanzania first.", +"cities.a_mile_up_and_halfway_between":"A mile up and halfway between the coasts, so every cross-country route stops here for a breather.", +"cities.a_small_capital_in_the_middle":"A small capital in the middle of the desert. The cables land at Swakopmund, then cross the dunes.", +"cities.a_small_city_on_a_big":"A small city on a big crossroads. Cables from Asia, Africa and the Middle East land here to skip the long way round.", +"cities.a_small_island_at_the_crossroads":"A small island at the crossroads of every Indian Ocean cable.", +"cities.a_small_island_where_cables_from":"A small island where cables from the US, Japan, Australia, the Philippines and Singapore all meet. Split a crossing here and each half carries more. Typhoons take the grid down every few years, so bring a generator.", +"cities.a_small_town_with_its_own":"A small town with its own IX.brrr, because the local provedores wanted one. Peering is not just for big cities.", +"cities.a_thousand_kilometres_off_the":"A thousand kilometres off the Carolinas. The new cables from the US to Portugal and Spain stop here, so a POP splits the crossing and each half carries more. Ships are said to vanish nearby. Cables, occasionally, do.", +"cities.a_tiny_country_at_the_mouth":"A tiny country at the mouth of the Red Sea where a dozen cables between Europe, Asia and Africa come ashore. It charges accordingly.", +"cities.a_tiny_surfing_town_in_cornwall":"A tiny surfing town in Cornwall where a remarkable share of the transatlantic internet comes ashore. The cliffs are full of fiber.", +"cities.africa_s_westernmost_capital_where":"Africa’s westernmost capital, where half the cables down the coast stop for a rest. The Atlantic breeze is free cooling.", +"cities.agribusiness_capital_and_home_of":"Agribusiness capital and home of sertanejo music. Every truck, tractor and silo wants a connection.", +"cities.all_roads_lead_to_rome_most":"All roads lead to Rome. Most packets still go via Milan.", +"cities.almost_every_europe_asia_cable":"Almost every Europe–Asia cable crosses Egypt. The tolls are legendary.", +"cities.american_samoa_a_deep_harbour_tuna":"American Samoa: a deep harbour, tuna canneries and a branch of the cable from Australia to Oregon.", +"cities.an_enormous_very_online_city_a":"An enormous, very online city a long way from the sea. Every subsea byte rides a backhaul from Mumbai or Chennai.", +"cities.an_island_capital_of_beaches_and":"An island capital of beaches and startups. Half the city works remotely from a surf shack.", +"cities.an_island_capital_with_a_big":"An island capital with a big iron ore port. Its fish stew is the original, ask anyone from Espírito Santo.", +"cities.an_island_city_of_tiled_colonial":"An island city of tiled colonial houses, known as Brazil’s reggae capital. Its tides are among the biggest in the country.", +"cities.ancient_city_brand_new_cables_greece":"Ancient city, brand new cables. Greece wants to be the eastern Mediterranean’s landing hub.", +"cities.angola_s_oil_capital_and_the":"Angola’s oil capital, and the home of cables that run straight to Brazil. One of the priciest cities on Earth for a hotel room.", +"cities.argentina_s_second_city_universities":"Argentina’s second city: universities, car factories and fernet with cola, in a ratio locals will argue about for hours.", +"cities.asia_s_hub_expensive_humid_very":"Asia's hub. Expensive, humid, very well connected.", +"cities.balkan_peering_hub_with_famously":"Balkan peering hub with famously cheap ports.", +"cities.banks_very_punctual_packets_and":"Banks, very punctual packets, and racks inside old bank vaults.", +"cities.bavaria_s_capital_cars_insurers_and":"Bavaria’s capital: cars, insurers and a two-week beer festival that sends mobile traffic through the roof every autumn. Racks must be finished before noon, like the sausages.", +"cities.beaches_cable_landings_and_a":"Beaches, cable landings and a Carnival that melts traffic graphs every February.", +"cities.beer_is_cheaper_than_water_here":"Beer is cheaper than water here, and IX ports are cheaper than both.", +"cities.big_busy_and_flooded_with_traffic":"Big, busy and flooded with traffic, sometimes literally.", +"cities.botswana_quiet_safe_and_rich_in":"Botswana: quiet, safe and rich in diamonds, with Johannesburg a short drive away.", +"cities.brazil_s_agribusiness_capital":"Brazil’s agribusiness capital: sugarcane, orange juice and, by local opinion, the coldest draft beer in the country.", +"cities.brazil_s_coldest_big_city_and":"Brazil’s coldest big city, and the one that invented bus lanes for everyone else. Half the year, the air outside is free cooling.", +"cities.brazil_s_first_capital_with_cables":"Brazil’s first capital, with cables landing in the bay and a Carnival of two million people dancing behind trucks full of speakers.", +"cities.brazil_s_northernmost_capital_the":"Brazil’s northernmost capital. The only road south crosses an indigenous reserve that closes to traffic every night.", +"cities.brazil_s_planned_capital_shaped_like":"Brazil’s planned capital, shaped like an airplane. Every ministry sits in a neat row, and every one of them wants its own link.", +"cities.brazil_s_tech_hub_an_hour":"Brazil’s tech hub, an hour from São Paulo: universities, labs and data centers lined up along the highway.", +"cities.brazil_s_youngest_state_capital":"Brazil’s youngest state capital, built from scratch in 1989. The streets are numbered, and so is everything else.", +"cities.brisvegas_big_sky_a_thunderstorm_at":"BrisVegas: big sky, a thunderstorm at four every summer afternoon, and closer to the Pacific cables than Sydney would like to admit. Megapork grew up here.", +"cities.built_for_the_government_the_data":"Built for the government. The data centres have more security clearances than staff, and every road ends in a roundabout.", +"cities.cable_landing_hub_for_south_america":"Cable landing hub for South America.", +"cities.cameroon_s_port_city_a_cable":"Cameroon’s port city. A cable from here goes straight to Brazil, which is the shortest way across the South Atlantic.", +"cities.canada_s_capital_once_called_bytown":"Canada’s capital, once called Bytown, which suits it. The grid goes out when it is windy, icy or Tuesday, so bring a generator.", +"cities.canada_s_hub_polite_packets_long":"Canada’s hub. Polite packets, long winters, free cooling.", +"cities.canada_s_pacific_door_it_rains":"Canada’s Pacific door. It rains so much that the free cooling comes with free washing.", +"cities.cape_verde_s_capital_off_the":"Cape Verde’s capital, off the coast of Senegal. Cables between Brazil and Europe come ashore on the way, so a POP here splits the South Atlantic in two.", +"cities.cars_engineers_and_kehrwoche_every":"Cars, engineers and Kehrwoche: every rack is swept on a strict rota. Nobody sells transit here, there is only the Spätzle-IX. Peer locally or haul your traffic to Frankfurt.", +"cities.catalonia_s_own_exchange_small_and":"Catalonia’s own exchange. Small and proud, and local networks find it impossible to resist.", +"cities.central_america_s_biggest_city":"Central America’s biggest city, ringed by volcanoes. One of them smokes every single day.", +"cities.central_europe_s_rising_hub_more":"Central Europe’s rising hub. More data centers every year and a fiercely competitive ISP scene.", +"cities.cheap_hydro_power_makes_it_a":"Cheap hydro power makes it a data center favorite.", +"cities.cheap_land_cheap_power_and_48":"Cheap land, cheap power and 48 °C summers. Hyperscalers love it. Chillers do not.", +"cities.cheap_power_dry_air_and_a":"Cheap power, dry air and a surprising number of very quiet data centers.", +"cities.cheaper_than_singapore_next_door_the":"Cheaper than Singapore next door. The data center builders noticed, and so did the power grid.", +"cities.costa_rica_runs_almost_entirely_on":"Costa Rica runs almost entirely on renewable power, so your racks are green. The cloud forest next door is greener.", +"cities.crossroads_for_cables_between_europe":"Crossroads for cables between Europe, Asia and Africa. Some voice apps are blocked, and the A/C bill is legendary.", +"cities.digital_everything_e_residency_for":"Digital everything, e-residency for anyone, and Baltic cables that ships keep dragging their anchors over.", +"cities.dunes_buggies_and_the_corner_of":"Dunes, buggies and the corner of Brazil closest to Africa.", +"cities.east_africa_s_hub_cables_land":"East Africa’s hub. Cables land in Mombasa, and mobile money runs everything.", +"cities.ethiopia_s_capital_at_2_400":"Ethiopia’s capital at 2,400 m, with no coast of its own: everything comes up from Djibouti. The coffee is the best on the map.", +"cities.europe_s_crossroads_lots_of_networks":"Europe's crossroads. Lots of networks, lots of sausages.", +"cities.europe_s_new_atlantic_gateway_cables":"Europe’s new Atlantic gateway. Cables to Brazil, Africa and the US land down the coast in Sines.", +"cities.every_cable_between_the_americas":"Every cable between the Americas squeezes past here. Nothing crosses the Darién Gap by land, so South America is always a subsea hop away.", +"cities.every_hyperscaler_is_building_a":"Every hyperscaler is building a region here. The land is cheap and the biryani is excellent.", +"cities.every_hyperscaler_s_european_hq":"Every hyperscaler’s European HQ, mostly for tax reasons. The power grid is nervous.", +"cities.far_from_everything_every_packet":"Far from everything. Every packet here has a long journey home.", +"cities.fast_fiber_east_and_west_and":"Fast fiber east and west, and one very nervous subsea cable to Germany.", +"cities.fiji_s_capital_and_the_crossroads":"Fiji’s capital and the crossroads of the South Pacific. Cables between the US, Australia and New Zealand stop here, and smaller ones go on to Tonga and Samoa.", +"cities.four_seasons_in_one_day_and":"Four seasons in one day, and the racks feel every one of them.", +"cities.free_cooling_and_geothermal_power":"Free cooling and geothermal power. Plenty of data centers, very few cables.", +"cities.gateway_to_the_amazon_at_the":"Gateway to the Amazon, at the mouth of a river so wide you cannot see the other side. It rains every afternoon, right on schedule.", +"cities.germany_s_port_city_everyone_says":"Germany’s port city. Everyone says “Moin”, at any time of day, and the rain comes in sideways off the Elbe.", +"cities.ghana_s_capital_and_a_favourite":"Ghana’s capital and a favourite landing spot for cables. Fast fiber, slow traffic on the ring road.", +"cities.gigabit_home_broadband_for_the_price":"Gigabit home broadband for the price of a coffee. Customers here expect a lot for very little.", +"cities.halfway_between_california_and":"Halfway between California and everything else in the Pacific. Cables from the US, Australia, New Zealand, Guam and Tahiti come ashore on Oahu. A POP here ends the light’s long swim: waves start fresh on each side, so each half carries more.", +"cities.high_up_in_the_andes_no":"High up in the Andes. No fiber crosses the Darién Gap jungle to Panama, so the way north is under the sea.", +"cities.huge_dense_and_hungry_its":"Huge, dense and hungry. Its international traffic squeezes through a couple of cables, or comes overland from India.", +"cities.huge_mobile_market_most_of_its":"Huge mobile market. Most of its traffic still detours through the US.", +"cities.india_s_east_coast_landing_hub":"India’s east-coast landing hub, with cables to Singapore. Cyclone season is a thing.", +"cities.india_s_tech_capital_packets_move":"India’s tech capital. Packets move faster than the cars outside.", +"cities.inland_from_ostend_where_the_cables":"Inland from Ostend, where the cables from England come ashore. The North Sea is shallow, busy and full of trawlers.", +"cities.it_almost_never_rains_but_the":"It almost never rains, but the sea fog keeps the racks cool.", +"cities.italian_immigrants_vineyards_and":"Italian immigrants, vineyards and factories. Your racks share the hills with the grape harvest.", +"cities.italy_s_digital_capital_fashion_week":"Italy’s digital capital. Fashion-week traffic, an espresso-powered NOC and more exchanges than you would expect.", +"cities.japan_s_second_hub_and_tokyo":"Japan’s second hub, and Tokyo’s disaster-recovery plan. Earthquakes rarely hit both.", +"cities.landing_point_for_cables_from_the":"Landing point for cables from the US, Iceland and the Baltic.", +"cities.luxembourg_s_data_centers_are_not":"Luxembourg’s data centers are not in Luxembourg City. They are here, Tier IV, and cooled by a power plant that burns waste wood.", +"cities.mainland_china_behind_the_great":"Mainland China. Behind the Great Firewall, with its own rules for foreign networks.", +"cities.mainland_china_enormous_market":"Mainland China. Enormous market, strict rules, and a famously congested border.", +"cities.makes_most_of_the_world_s":"Makes most of the world’s chips and hangs on a handful of subsea cables. Ships keep “accidentally” dragging their anchors over them.", +"cities.mexico_s_data_center_boom_town":"Mexico’s data center boom town, high and dry in the middle of the country. Every cloud wants a region here.", +"cities.mexico_s_industrial_capital_a_few":"Mexico’s industrial capital, a few hours from Texas. Factories, steel and grilled goat on weekends.", +"cities.mexico_s_silicon_valley_home_of":"Mexico’s Silicon Valley, home of mariachi and tequila. Chip design by day, music by night.", +"cities.morocco_s_business_capital_on_the":"Morocco’s business capital on the Atlantic, the gateway between Europe and West Africa.", +"cities.most_uae_cables_land_on_this":"Most UAE cables land on this coast, outside the Strait of Hormuz. Getting from here to Dubai means renting from the duopoly.", +"cities.mountains_mines_and_more_bars_per":"Mountains, mines and more bars per head than anywhere else in Brazil. Peering deals get signed over cheese bread.", +"cities.mozambique_s_capital_an_hour_from":"Mozambique’s capital, an hour from South Africa. Its cables are the east coast’s backup when the others break.", +"cities.new_caledonia_a_slice_of_france":"New Caledonia, a slice of France in the Coral Sea, with a cable to Sydney and a nickel mine on every hill.", +"cities.norway_s_oil_capital_now_full":"Norway’s oil capital, now full of data centers inside mountains, run on hydro and cooled by the fjord. North Sea cables land here.", +"cities.nova_scotia_s_capital_and_the":"Nova Scotia’s capital, and the big North American port closest to Europe. The fastest cable to England starts here, on the shortest line across the ocean, built for traders who pay for every millisecond.", +"cities.oil_gas_and_hurricanes_the":"Oil, gas and hurricanes. The generators here are sized for a week, and they have needed it.", +"cities.on_an_island_so_every_link":"On an island, so every link off it is a subsea cable.", +"cities.one_foot_in_europe_one_in":"One foot in Europe, one in Asia. Every land route between them crosses here.", +"cities.one_of_africa_s_biggest_cities":"One of Africa’s biggest cities, right across the river from another capital. The grid comes and goes, the rumba never stops.", +"cities.one_of_the_most_remote_islands":"One of the most remote islands people live on: about 4,500 of them, and once Napoleon, sent here so he could not get away. Its first cable came ashore in 2021, a branch of the one from Portugal to South Africa. The power runs on diesel and hope.", +"cities.pacific_cables_land_nearby_and":"Pacific cables land nearby, and everyone meets in one famous building downtown.", +"cities.pakistan_s_door_to_the_sea":"Pakistan’s door to the sea. Every cable lands here, and so does every new firewall rule.", +"cities.palau_on_a_branch_cable_from":"Palau, on a branch cable from Guam. Coral reefs, jellyfish that do not sting, and very little traffic.", +"cities.papua_new_guinea_s_capital_in":"Papua New Guinea’s capital, in a country of eight hundred languages, with a cable to Sydney. The grid fails often, so bring a generator.", +"cities.paraguay_shares_two_giant_dams_with":"Paraguay shares two giant dams with its neighbours and has more power than it can use. Crypto miners noticed.", +"cities.probably_the_cleanest_capital_in":"Probably the cleanest capital in Africa, with fiber to every district and plastic bags banned at the border.", +"cities.purple_jacaranda_trees_and_long":"Purple jacaranda trees and long power cuts. Every POP here needs a generator and a lot of diesel.", +"cities.right_between_london_amsterdam_paris":"Right between London, Amsterdam, Paris and Frankfurt, and somehow pricier than all four. Two networks own every Belgian living room, and nobody switches unless you advertise.", +"cities.right_on_the_equator_at_the":"Right on the equator, at the mouth of the Amazon. No road links it to the rest of Brazil, and its power grid has had very long bad weeks.", +"cities.samoa_s_capital_with_cables_to":"Samoa’s capital, with cables to Fiji, American Samoa and Tahiti. Sunday is for church, so maintenance windows are on Saturday.", +"cities.saudi_arabia_s_red_sea_cable":"Saudi Arabia’s Red Sea cable hub. More and more of the cables between Europe, Africa and Asia stop here instead of in Egypt.", +"cities.scotland_s_capital_north_sea_cables":"Scotland’s capital. North Sea cables to Norway and the Faroes land up the coast.", +"cities.small_rich_and_very_well_connected":"Small, rich and very well connected, as long as the neighbours are on speaking terms. Its only land border is with Saudi Arabia.", +"cities.some_of_the_fastest_home_broadband":"Some of the fastest home broadband on the planet, and the strangest peering market. Under “sender pays”, the big three ISPs charge for every gigabit handed to them, and transit here is among the priciest anywhere.", +"cities.south_africa_s_east_coast_surf":"South Africa’s east coast: surf, curry and the beach where the Indian Ocean cables land.", +"cities.south_america_s_biggest_market_and":"South America’s biggest market, and home of IX.brrr: run by a nonprofit, public prices, and nearly everyone is on it.", +"cities.sovereign_internet_rules_every_pop":"Sovereign internet rules: every POP needs a government box in the rack, Goggle video is throttled, and the national firewall runs drills.", +"cities.startups_techno_and_a_surprising":"Startups, techno and a surprising number of data centers in old breweries.", +"cities.subsea_cables_to_africa_and_asia":"Subsea cables to Africa and Asia land here.", +"cities.tahiti_in_french_polynesia_a_cable":"Tahiti, in French Polynesia. A cable runs north to Hawaii, and the new one from Chile to Australia stops here: the stepping stone between South America and Oceania.", +"cities.tango_steak_and_a_currency_that":"Tango, steak and a currency that changes value while you read this.", +"cities.tanzania_s_biggest_city_and_the":"Tanzania’s biggest city and the sea gate for half a dozen countries with no coast of their own.", +"cities.the_azores_in_the_middle_of":"The Azores, in the middle of the Atlantic. Cables from Florida to Lisbon and Spain stop here, so a POP splits the crossing and each half carries more. The cows outnumber the servers.", +"cities.the_bottom_of_the_country_on":"The bottom of the country, on power lines built for an aluminium smelter. Someone is building a 280 MW AI campus in a paddock out of town, so the cables are coming. Probably.", +"cities.the_bottom_of_the_map_cool":"The bottom of the map. Cool air, cheap hydro, and all of Bass Strait between you and the mainland.", +"cities.the_business_capital_of_french":"The business capital of French-speaking West Africa, with glass towers on a lagoon and five cables in the bay.", +"cities.the_canary_islands_a_short_hop":"The Canary Islands, a short hop from Lisbon and Morocco. Almost every cable down the west coast of Africa stops here, which turns the long run to Lagos into two shorter ones.", +"cities.the_capital_building_ai_campuses_at":"The capital, building AI campuses at gigawatt scale. Data about Saudi users has to stay in the Kingdom, and every POP needs a local telecom licence.", +"cities.the_capital_of_acre_a_state":"The capital of Acre, a state Brazilians joke does not exist. Your traceroutes say otherwise.", +"cities.the_capital_of_the_marshall_islands":"The capital of the Marshall Islands, a ring of coral two metres above the sea. One cable to Guam, and every packet knows it.", +"cities.the_capital_sovereign_ai_money_and":"The capital. Sovereign AI money and very big data centers. Inside the UAE only the two licensed operators may run fiber.", +"cities.the_city_of_eternal_spring_with":"The city of eternal spring, with outdoor escalators up the hillsides and a busy startup scene.", +"cities.the_data_center_capital_rumor_says":"The data-center capital. Rumor says 70% of the internet passes through here, and nobody has checked.", +"cities.the_deep_south_halfway_to_buenos":"The deep south, halfway to Buenos Aires. Barbecue every Sunday, and a hot gourd of mate in every hand, even in summer.", +"cities.the_easternmost_city_of_the_americas":"The easternmost city of the Americas, where the sun rises first. Your NOC shift starts early too.", +"cities.the_garden_city_and_the_biggest":"The Garden City, and the biggest city on the South Island, which locals call the Mainland with a straight face. Everything bound for the North Island crosses Cook Strait.", +"cities.the_geographic_center_of_south":"The geographic center of South America, and one of the hottest cities in Brazil. The chillers never get a day off.", +"cities.the_geographic_middle_of_the_us":"The geographic middle of the US. Data centers sit in old limestone mines underground: steady temperature, no tornadoes, and somebody keeps finding Dorothy’s shoes.", +"cities.the_harbour_the_bridge_and_most":"The harbour, the bridge and most of the country’s data centres. Rent is the real latency.", +"cities.the_highest_seat_of_government_on":"The highest seat of government on Earth, at 3,600 m. Commuters ride cable cars, and so does some of the fiber.", +"cities.the_most_isolated_big_city_on":"The most isolated big city on Earth. Asia is closer than Sydney.", +"cities.the_north_s_hub_with_its":"The North’s hub, with its own exchange and very damp air-conditioning intakes. Cables to Ireland and Denmark come ashore up the coast.", +"cities.the_old_gateway_to_eastern_europe":"The old gateway to Eastern Europe. Packets still bow politely on the way through.", +"cities.the_only_northeastern_capital_away":"The only northeastern capital away from the sea. Famously hot, with lightning storms that keep the surge protectors busy.", +"cities.the_pacific_gateway_the_andes_sit":"The Pacific gateway. The Andes sit between it and everything else, and the ground shakes now and then.", +"cities.the_prairie_gateway_between":"The prairie gateway between Vancouver and the rest of Canada. A chinook melts the snow in an afternoon, then it snows again.", +"cities.the_rhine_ruhr_hub_more_carrier":"The Rhine-Ruhr hub: more carrier-neutral data centers than Hamburg or Munich, and an hour from the Dutch border, so fiber to Amsterdam is short and cheap. Order an Altbier here, never a Kölsch.", +"cities.the_solomon_islands_capital_on":"The Solomon Islands’ capital, on Guadalcanal. The cable to Sydney only arrived a few years ago; before that it was all satellite. The power is less reliable than the cable.", +"cities.the_southeast_s_carrier_hotel":"The Southeast’s carrier hotel. Busiest airport, busiest peering south of Ashburn.", +"cities.the_venice_of_brazil_all_bridges":"The Venice of Brazil, all bridges and rivers, with one of the country’s biggest tech parks in its old harbour.", +"cities.throws_the_biggest_sao_joao_festival":"Throws the biggest São João festival in the world: a whole month of forró every June. Also a university town full of engineers.", +"cities.tiny_tropical_and_the_closest":"Tiny, tropical and the closest Australian city to Asia. New cables to Singapore and Jakarta land here, next to the crocodiles.", +"cities.tonga_hangs_on_one_cable_from":"Tonga hangs on one cable from Fiji. In 2022 an undersea volcano cut it, and the country was offline for weeks.", +"cities.twenty_minutes_from_everything":"Twenty minutes from everything, except anywhere else.", +"cities.two_million_people_in_the_middle":"Two million people in the middle of the rainforest, with a duty-free factory zone. The fiber follows the rivers, and when it breaks, the repair crew goes by boat.", +"cities.typhoons_earthquakes_and_a_lot_of":"Typhoons, earthquakes and a lot of very online people.", +"cities.ukrainian_network_engineers_kept_the":"Ukrainian network engineers kept the internet running through blackouts and much worse. Generators, spare fiber and redundant everything are standard here, and the peering scene is famously tough.", +"cities.universities_biotech_and_a_carrier":"Universities, biotech and a carrier hotel that has outlived most of its carriers.", +"cities.uruguay_fiber_to_almost_every_home":"Uruguay: fiber to almost every home, a laptop for every schoolkid, and a state telco that runs most of it.", +"cities.very_online_and_badly_served_by":"Very online and badly served by the sea: at least one of its subsea cables is broken at any given time.", +"cities.waste_heat_goes_straight_into_the":"Waste heat goes straight into the spa next door.", +"cities.where_brazil_argentina_and_paraguay":"Where Brazil, Argentina and Paraguay meet, next to giant waterfalls and an even bigger hydro dam. Power is cheap, customs paperwork is not.", +"cities.where_east_africa_s_cables_come":"Where East Africa’s cables come ashore, then ride the railway up to Nairobi.", +"cities.where_south_america_s_cables":"Where South America’s cables actually land. Europe, Africa and the US come ashore here, then ride a long backhaul south.", +"cities.where_the_atlantic_cables_to_africa":"Where the Atlantic cables to Africa’s south land. Penguins on the beach, load shedding on the grid.", +"cities.white_houses_climbing_up_from_the":"White houses climbing up from the Mediterranean. The cables go north to Marseille, and so does a lot of the traffic.", +"cities.zambia_runs_on_hydro_power_from":"Zambia runs on hydro power from one big lake. In a dry year the lake runs low, and so does the grid.", +"city_panel.100g_per_box":"100G per box", +"city_panel.95th_pct_p95_commit_commit_bill":"95th pct {p95} · commit {commit} · bill {bill}/mo", +"city_panel.a_crash_here_only_costs_one":"A crash here only costs one router’s capacity for a few days.", +"city_panel.a_dedicated_cross_connect_to_one":"A dedicated cross-connect to one network in {dc}. Needs more traffic than IX peering, but has its own capacity.", +"city_panel.a_of_b":"{a} of {b}", +"city_panel.a_pop_point_of_presence_is":"A POP (point of presence) is your router in a rack here. Then connect it: lay fiber from one of your POPs, or buy transit right here.", +"city_panel.ad_campaign_n_d_left":"Ad campaign: {n}d left", +"city_panel.add_a_second_site_cost_mo":"Add a second site {cost} + {mo}/mo", +"city_panel.add_router_cost_mo_mo":"Add router {cost} + {mo}/mo", +"city_panel.ai_and_cloud_campuses_nearby_list":"AI and cloud campuses nearby: {list}", +"city_panel.attacks_go_to_your_nearest_scrubbing":"Attacks go to your nearest scrubbing center. From here that is {city}, {km} km away: the flood rides your backbone there and back, which adds latency, and whatever your links cannot carry is not scrubbed. A center here cleans attacks on the spot.", +"city_panel.augment_on_order_port_about_n":"Augment on order: {port}, about {n} days to go.", +"city_panel.boxes_a_in_a_b_in":"Boxes: {a} in A · {b} in B", +"city_panel.build_pop_cost_mo_mo":"Build POP {cost} + {mo}/mo", +"city_panel.build_tier_cost_mo_mo":"Build {tier} {cost} + {mo}/mo", +"city_panel.buy_a_port_on_a_fabric":"Buy a port on a fabric, then order virtual circuits to your other POPs or to a remote IX. Fast and flexible, but you share their fabric.", +"city_panel.carrying_g":"carrying {g}", +"city_panel.carrying_g_per_site":"carrying {g} per site", +"city_panel.cdns_put_free_cache_servers_inside":"CDNs put free cache servers inside your POP. Most of their traffic is then served right here, with no transit and no IX port.", +"city_panel.clean_pipe_mo_mo_scrubs_ddos":"+ Clean-pipe {mo}/mo · scrubs DDoS upstream", +"city_panel.clean_pipe_on":"Clean-pipe on ✓", +"city_panel.cleans_attacks_for_your_whole":"Cleans attacks for your whole network, up to its clean-bandwidth capacity, and unlocks DDoS protection contracts. Clean traffic returns over GRE, which can re-open the MSS black hole.", +"city_panel.cleans_ddos_attacks_for_your_whole":"Cleans DDoS attacks for your whole network, up to its clean-bandwidth capacity, and unlocks DDoS protection contracts for businesses.", +"city_panel.close_site_b":"Close site B", +"city_panel.cn_too_premium_on":"CN-Too premium on ✓", +"city_panel.customers_are_unhappy_and_leaving":"Customers are unhappy and leaving. Add upstream capacity, peering, or a bigger link.", +"city_panel.customers_here_get_nothing_until_it":"Customers here get nothing until it's back.", +"city_panel.dark_fiber_iru":"dark fiber IRU", +"city_panel.ddos_scrubbing_center":"DDoS scrubbing center", +"city_panel.decommission_city":"Decommission {city}…", +"city_panel.decommission_several_pops":"Decommission several POPs…", +"city_panel.drag_from_this_router_to_any":"Drag from this router to any city on the map to lay a new link. Two paths to every POP means a backhoe can't take you offline.", +"city_panel.every_port_is_taken_add_a":"Every port is taken. Add a router or swap to a model with more ports before you plug in anything new.", +"city_panel.everything_is_in_one_building_move":"Everything is in one building. Move some uplinks to the other site from the Transit and Peering tabs.", +"city_panel.fabrics_list":"Fabrics: {list}", +"city_panel.fiber_from_city":"Fiber from {city}", +"city_panel.fiber_is_down":"fiber is down", +"city_panel.g_of_circuits":"{g} of circuits", +"city_panel.g_of_eyeballs":"{g} of eyeballs", +"city_panel.hide_other_models":"Hide other models", +"city_panel.includes_the_mandatory_government":"Includes the mandatory government box in your rack: {cost} + {mo}/mo. It comes with its own listener.", +"city_panel.install_generator_cost_mo_mo":"Install generator {cost} + {mo}/mo", +"city_panel.interconnection_fabrics_nni":"Interconnection fabrics (NNI)", +"city_panel.it_runs_on_your_own_fibre":"It runs on your own fibre, so the Nearly Broadband Network gets nothing. The government still takes a {pct} levy.", +"city_panel.ix_ix":"IX: {ix}", +"city_panel.ix_members_on_ix_n":"IX members on {ix}: {n}", +"city_panel.ix_switch":"{ix} switch", +"city_panel.launch_broadband_cost":"Launch broadband {cost}", +"city_panel.make_sacrificial_contains_floods_1_2":"Make sacrificial contains floods · ½ capacity", +"city_panel.maxed_out_traffic_here_is_being":"Maxed out. Traffic here is being dropped.", +"city_panel.model_level_lv":"{model} level {lv}", +"city_panel.more_traffic_over_peering_pnis_and":"More traffic over peering, PNIs and caches means lower latency, and happier users grow faster.", +"city_panel.move_one_to_a":"Move one to A", +"city_panel.move_one_to_b":"Move one to B", +"city_panel.ms_ms_to_transit":"{ms} ms to transit", +"city_panel.n_min":"~{n} min", +"city_panel.n_min_a_slow_one":"~{n} min · a slow one", +"city_panel.needs_min_gbps_of_traffic_to":"Needs {min} Gbps of traffic to {net} (now {now})", +"city_panel.network_wide_peering_ratio":"Network-wide peering ratio", +"city_panel.new_routers_went_in_today_the":"New routers went in today. The next swap can wait until tomorrow.", +"city_panel.no_10g_net_starts_at_100g":"no 10G: {net} starts at 100G", +"city_panel.no_businesses_yet_offers_pop_up":"No businesses yet. Offers pop up as $ bubbles on the map.", +"city_panel.no_ix_here_yet_you_could":"No IX here yet. You could found one later.", +"city_panel.nobody_sells_transit_here_haul_your":"Nobody sells transit here. Haul your traffic over fiber to a city that has it.", +"city_panel.nothing_plugged_in_here_yet":"Nothing plugged in here yet", +"city_panel.on_demand_engages_in_n_d":"On-demand (engages in {n}d)", +"city_panel.one_router_is_a_single_point":"One router is a single point of failure.", +"city_panel.open_a_pop_here":"Open a POP here", +"city_panel.or_drag_from_one_of_your":"Or drag from one of your routers to this city to lay fiber and build the POP in one go.", +"city_panel.order_circuit_anyway":"Order circuit anyway", +"city_panel.paid_peering_price_mo_on_top":"Paid peering: {price}/mo on top", +"city_panel.pay_a_bigger_network_per_gbps":"Pay a bigger network per Gbps and it carries your traffic to the whole internet. Billed on the 95th percentile of the last 30 days, with a 20% commit and a port fee. Spikes like DDoS raise your bill.", +"city_panel.peer_at_ix_without_building_a":"Peer at {ix} without building a POP. Order a virtual circuit here from one of your POPs over {fabs}.", +"city_panel.port_cost_mo_mo":"{port} {cost} + {mo}/mo", +"city_panel.port_port_price_mo":"{port} port · {price}/mo", +"city_panel.port_port_price_mo_197d":"{port} port {price}/mo", +"city_panel.power_cuts_are_covered":"Power cuts are covered.", +"city_panel.price_per_gbps_month_billed_on":"${price} per Gbps / month · billed on 95th percentile", +"city_panel.prices_include_p_back_for_the":"Prices include {p} back for the old routers on eBuy.", +"city_panel.private_interconnects_pni":"Private interconnects (PNI)", +"city_panel.ready_in_n_d":"ready in {n}d", +"city_panel.really_close_it":"Really close it?", +"city_panel.really_shut_it_down":"Really shut it down?", +"city_panel.remote_peering_at_the_ix":"Remote peering at the IX", +"city_panel.right_now_city_is_one_building":"Right now {city} is one building. A power cut, an A/C failure or a cleaner with a vacuum takes the whole city dark, and a second router does not help with that. A second data center across town, joined by your own metro ring, keeps half the POP up.", +"city_panel.rolling_upgrade_one_router_at_a":"Rolling upgrade: one router at a time, no downtime.", +"city_panel.router_maxed_out":"Router maxed out", +"city_panel.run_ad_campaign_8k_2_growth":"Run ad campaign $8k · 2× growth 30d", +"city_panel.second_site_and_metro_ring":"Second site and metro ring", +"city_panel.sell_internet_to_homes_here_starts":"Sell internet to homes here. Starts around {start} and grows toward {max} while service is good. Pays {rate} per Gbps served, every month.", +"city_panel.sells_pnis_down_to_1g":"sells PNIs down to 1G", +"city_panel.served_in_city":"Served in {city}", +"city_panel.serving_v":"serving {v}", +"city_panel.shut_this_pop_down_its_links":"Shut this POP down: its links, ports and caches go with it, and every customer that depends on it is let go, with an early-termination penalty.", +"city_panel.switch_to_always_on":"Switch to always-on", +"city_panel.switch_to_cn_too_premium_x":"Switch to CN-Too premium {x}× price · ~3% loss into China", +"city_panel.switch_to_on_demand_cheaper":"Switch to on-demand cheaper", +"city_panel.the_model_sets_your_fastest":"The model sets your fastest interface and how much this POP can forward. More routers add capacity and survive crashes.", +"city_panel.the_nearly_broadband_network_keeps":"The Nearly Broadband Network keeps {pct} of it for the last mile.", +"city_panel.this_chassis_takes_forever_to_boot":"This chassis takes forever to boot: crashes last longer, and swapping the only router here takes 3 days. A second router hides it.", +"city_panel.this_pop_is_down":"This POP is down", +"city_panel.top_destinations_on_this_port":"Top destinations on this port", +"city_panel.transit_sellers_list":"Transit sellers: {list}", +"city_panel.transit_x_pricier":"Transit {x}× pricier", +"city_panel.two_buildings_joined_by_your_own":"Two buildings joined by your own metro ring. A power cut or cleaner in one leaves the other running at half capacity. Uplinks only work while their site is up, unless you split them: choose Both on a port to put LAG members in each building.", +"city_panel.underserved_users_grow_60_faster":"Underserved: users grow 60% faster", +"city_panel.up_to_pn_interfaces_ports_ports":"Up to {pn} interfaces · {ports} ports and {cap} per router", +"city_panel.upgrade_to_model_cost_mo_mo":"Upgrade to {model} {cost} + {mo}/mo", +"city_panel.upgrade_to_tier_cost":"Upgrade to {tier} {cost}", +"city_panel.used_max_in_use":"{used} / {max} in use", +"city_panel.virtual_circuit_via_fab":"virtual circuit via {fab}", +"city_panel.who_s_here":"Who's here", +"city_panel.with_one_router_the_upgrade_needs":"With one router, the upgrade needs a maintenance window: this POP goes dark for a day.", +"city_panel.your_own_subsea_cable_name":"your own subsea cable {name}", +"city_panel.your_routers_here_are_forwarding":"Your routers here are forwarding {load} of {cap}. Traffic is being dropped. Upgrade or add a router in the Infra tab.", +"common.95th_percentile":"95th percentile", +"common.about_average":"about average", +"common.accept":"Accept", +"common.ack_flood":"ACK flood", +"common.ad_campaign":"Ad campaign!", +"common.africa":"Africa", +"common.all_cities":"All cities", +"common.all_customers":"All customers", +"common.all_networks":"All networks", +"common.all_quiet":"All quiet", +"common.always_on":"Always-on", +"common.americas":"Americas", +"common.amplifier_failure":"Amplifier failure", +"common.anchors_away":"Anchors Away", +"common.anchors_aweigh":"Anchors Aweigh", +"common.animations":"Animations", +"common.another_one":"Another one", +"common.apr":"Apr", +"common.as_number":"AS number", +"common.asia":"Asia", +"common.at_risk":"At risk", +"common.auditor_visit":"Auditor visit", +"common.aug":"Aug", +"common.auto":"Auto", +"common.auto_enrolled":"auto-enrolled", +"common.average":"Average", +"common.avoid":"Avoid", +"common.back":"Back", +"common.back_to_the_map":"Back to the map", +"common.backhaul_latency":"Backhaul latency", +"common.backup":"backup", +"common.backup_generator":"Backup generator", +"common.backup_only":"Backup only", +"common.badges":"Badges", +"common.bank":"Bank", +"common.bankrupt":"Bankrupt", +"common.being_spliced":"Being spliced", +"common.better_terminals_and_optical_tuning":"Better terminals and optical tuning extend long-haul reach. Repeaters are already included; these upgrades do not change latency.", +"common.bgp_hijack":"BGP hijack", +"common.bgp_sessions":"BGP sessions", +"common.big_league":"Big league", +"common.black_hole":"Black hole", +"common.blitz":"Blitz", +"common.boot_time":"Boot time", +"common.boot_times":"Boot times", +"common.box":"+ box", +"common.box_6ee3":"− box", +"common.build_time":"Build time", +"common.building":"building", +"common.bumped":"bumped", +"common.bunker_two":"Bunker Two", +"common.busiest_links":"Busiest links", +"common.business_customers":"Business customers", +"common.cable_design":"Cable design", +"common.cable_system":"Cable system", +"common.cables_overseas":"Cables overseas", +"common.cache":"Cache", +"common.cache_power":"Cache power", +"common.caches":"Caches", +"common.cancel":"Cancel", +"common.cancel_circuit":"Cancel circuit", +"common.capacity":"Capacity", +"common.carnaval":"Carnaval", +"common.cash":"Cash", +"common.cash_bank":"Cash · Bank", +"common.cdn_content":"CDN / content", +"common.certificate_expired":"Certificate expired", +"common.challenger":"challenger", +"common.change_freeze":"Change freeze", +"common.chase_it":"Chase it", +"common.china":"China", +"common.city":"city", +"common.city_906b":"City", +"common.cldap_flood":"CLDAP flood", +"common.clean_pipes":"Clean Pipes", +"common.clear_filters":"Clear filters", +"common.close":"Close", +"common.closed":"Closed", +"common.collateral_damage":"Collateral Damage", +"common.commit_complete":"Commit complete.", +"common.commit_failed":"commit failed", +"common.common":"Common", +"common.conference_circuit":"Conference Circuit", +"common.conferences":"Conferences", +"common.confidence_100":"# Confidence: 100%.", +"common.confidential":"Confidential", +"common.congested_links":"Congested links", +"common.connections":"Connections", +"common.content_from":"Content from", +"common.continental_carrier":"Continental carrier", +"common.continents":"Continents", +"common.controller_off":"controller off", +"common.cooling_failure":"Cooling failure", +"common.copy":"Copy", +"common.costs":"Costs", +"common.courtesy_route":"Courtesy route", +"common.crashes_more":"crashes more", +"common.credit_rating":"Credit rating", +"common.customer":"Customer", +"common.customer_care":"Customer Care", +"common.customer_levels":"Customer levels", +"common.customers":"Customers", +"common.cut":"CUT", +"common.cut_2e50":"Cut!", +"common.dam_it":"Dam It", +"common.dark":"dark", +"common.dark_6bf5":"Dark!", +"common.dark_fiber":"Dark fiber", +"common.darwin_award":"Darwin Award", +"common.date":"Date", +"common.ddos_attack":"DDoS attack", +"common.ddos_junk":"DDoS junk", +"common.ddos_scrubbing":"DDoS scrubbing", +"common.dead_optic":"Dead optic", +"common.deals":"Deals", +"common.debt":"Debt", +"common.dec":"Dec", +"common.decline":"Decline", +"common.decommission":"Decommission", +"common.decommission_link":"Decommission link", +"common.decommission_pops":"Decommission POPs", +"common.demand":"Demand", +"common.deploy":"Deploy", +"common.deployed":"deployed", +"common.distributed_ingress":"Distributed ingress", +"common.diverse":"diverse", +"common.diverse_route":"diverse route", +"common.dns_reflection":"DNS reflection", +"common.done":"Done!", +"common.done_8dd3":"Done", +"common.down":"DOWN", +"common.download_png":"Download PNG", +"common.drop":"Drop", +"common.due_now":"Due now", +"common.duopoly_customer":"Duopoly Customer", +"common.earned_before":"earned before", +"common.edit_routescript":"Edit RouteScript", +"common.egress":"Egress:", +"common.embedded_cache":"Embedded cache", +"common.embedded_caches":"Embedded caches", +"common.enterprise_dia":"Enterprise DIA", +"common.epic":"Epic", +"common.estimated_latency":"Estimated latency", +"common.europe":"Europe", +"common.event_network":"Event network", +"common.every_customer_type_is_unlocked_go":"Every customer type is unlocked. Go get those terabits.", +"common.explore":"Explore →", +"common.export_save":"Export save", +"common.eyeball_demand":"Eyeball demand", +"common.eyeballs":"Eyeballs", +"common.eyeballs_online":"Eyeballs online!", +"common.fabric_circuit":"fabric circuit", +"common.fabric_outage":"Fabric outage", +"common.fabric_ports":"Fabric ports", +"common.failures":"Failures", +"common.fat_finger":"Fat Finger", +"common.feb":"Feb", +"common.fiber_cut":"Fiber cut", +"common.fiber_pairs":"Fiber pairs", +"common.five_continents":"Five continents", +"common.five_nines":"Five Nines", +"common.flat_rate":"flat rate", +"common.flawless":"Flawless.", +"common.flood_season":"Flood Season", +"common.floods_held":"Floods held", +"common.follow_metrics":"Follow metrics", +"common.forwarding_chip":"Forwarding chip", +"common.forwarding_load":"Forwarding load", +"common.free":"free", +"common.free_channels":"Free channels", +"common.from":"From", +"common.from_net":"from {net}", +"common.full_changelog":"Full changelog", +"common.full_screen":"Full screen.", +"common.game":"Game", +"common.game_paused":"Game paused.", +"common.game_servers":"Game servers", +"common.game_speed":"Game speed", +"common.generator":"Generator!", +"common.gigawatt_landlord":"Gigawatt Landlord", +"common.global_backbone":"Global backbone", +"common.go_global":"Go global", +"common.go_there":"Go there", +"common.go_transit_free_tier_1":"Go transit-free: Tier 1!", +"common.goal":"Goal", +"common.goals":"Goals", +"common.goals_noc":"Goals & NOC", +"common.goose_incident":"Goose incident", +"common.got_it":"Got it", +"common.government_shutdown":"Government shutdown", +"common.haggle":"Haggle", +"common.half_speed":"Half speed", +"common.hallway_track":"Hallway Track", +"common.happiness":"Happiness", +"common.happiness_p":"Happiness {p}%", +"common.hardware_prices":"Hardware prices", +"common.hello_neighbour":"Hello, Neighbour", +"common.hide":"Hide", +"common.hold_music":"Hold music", +"common.home":"home", +"common.home_broadband":"Home broadband", +"common.hosting":"Hosting", +"common.how_to_play":"How to play", +"common.http_flood":"HTTP flood", +"common.hundred_terabits":"Hundred Terabits", +"common.hyperscaler_dci":"Hyperscaler DCI", +"common.import_a_save":"Import a save", +"common.in_progress":"in progress", +"common.in_use":"In use", +"common.inbox":"Inbox", +"common.inbox_zero":"Inbox zero.", +"common.incident":"Incident", +"common.incidents":"Incidents", +"common.incidents_survived":"Incidents survived", +"common.incumbent":"incumbent", +"common.infra":"Infra", +"common.inspect":"Inspect", +"common.install":"Install", +"common.install_first":"Install first.", +"common.installed":"Installed", +"common.internet_exchange":"Internet Exchange", +"common.internet_exchanges":"Internet Exchanges", +"common.ip_transit":"IP transit", +"common.ipv6_milestone":"IPv6 milestone", +"common.iru_handover":"IRU handover", +"common.iru_lease":"IRU lease", +"common.island_hopper":"Island Hopper", +"common.ix_collector":"IX Collector", +"common.ix_meltdown":"IX meltdown", +"common.ix_peering":"{ix} peering", +"common.ix_peering_0631":"IX peering", +"common.ix_ports":"IX ports", +"common.jan":"Jan", +"common.join":"Join →", +"common.jul":"Jul", +"common.jun":"Jun", +"common.just_now":"just now", +"common.keep_building":"Keep building", +"common.keep_calm":"Keep Calm", +"common.keep_playing":"Keep playing", +"common.keep_them":"Keep them", +"common.km_km_of_cable_carries_at":"{km} km of cable carries at most {g} per carrier.", +"common.l2_circuits":"L2 circuits", +"common.l2vpn_circuit":"L2VPN circuit", +"common.l2vpn_customers":"L2VPN customers", +"common.lacp_trouble":"LACP trouble", +"common.lag_member_cost_mo_mo":"+ LAG member {cost} + {mo}/mo", +"common.lag_member_price":"+ LAG member {price}", +"common.lags":"LAGs", +"common.land":"land", +"common.landing_stations":"Landing stations", +"common.language":"Language", +"common.latency":"Latency", +"common.latency_test":"Latency test", +"common.later":"Later", +"common.leap_second":"Leap second", +"common.leased_iru":"leased IRU", +"common.leased_lines":"Leased lines", +"common.leave_anyway":"Leave anyway", +"common.leave_ix":"Leave IX", +"common.legendary":"Legendary", +"common.line_system":"Line system", +"common.links":"Links", +"common.links_removed":"Links removed", +"common.links_routers":"Links & routers", +"common.list_price":"List price", +"common.llama_drama":"Llama Drama", +"common.load":"Load", +"common.loan_repayments":"Loan repayments", +"common.local_isp":"Local ISP", +"common.lonely_penguin":"Lonely Penguin", +"common.looking_glass":"Looking glass", +"common.lost":"Lost", +"common.low_latency":"Low latency", +"common.lowest_latency":"Lowest latency", +"common.main_route":"Main route", +"common.maintenance_window":"Maintenance Window", +"common.maintenance_window_3a92":"Maintenance window", +"common.mar":"Mar", +"common.may":"May", +"common.member":"− member", +"common.member_fef5":"Member", +"common.memcached_amplification":"Memcached amplification", +"common.merchant_silicon":"merchant silicon", +"common.mercury":"Mercury", +"common.metaverse_platform":"Metaverse platform", +"common.metro_diversity":"Metro diversity", +"common.mind_the_gap":"Mind the Gap", +"common.mode":"Mode", +"common.modes":"Modes", +"common.monitoring":"Monitoring", +"common.monthly":"Monthly", +"common.more_scenarios":"More scenarios", +"common.ms_ms_one_way":"{ms} ms one-way", +"common.mtu_mismatch":"MTU mismatch", +"common.mystery_link":"Mystery link", +"common.n_box":{"one":"{n} box","other":"{n} boxes"}, +"common.n_days_left":"{n} days left", +"common.name":"Name", +"common.name_cache":"{name} cache", +"common.naming_committee":"Naming committee", +"common.needs_a_scrubbing_center":"needs a scrubbing center", +"common.net_transit":"{net} transit", +"common.network":"network", +"common.network_6974":"Network", +"common.networks":"Networks", +"common.new_circuit":"New circuit", +"common.new_pop":"New POP!", +"common.nni_fabrics":"NNI fabrics", +"common.no":"No", +"common.no_links_yet":"No links yet.", +"common.no_path":"no path", +"common.no_repayments":"No repayments", +"common.no_thanks":"No thanks", +"common.nobody_yet":"nobody yet", +"common.noc_dashboard":"NOC dashboard", +"common.none":"none", +"common.none_304f":"None", +"common.normal":"Normal", +"common.north_america":"North America", +"common.not_active":"not active", +"common.not_happening":"Not happening", +"common.not_installed":"Not installed", +"common.nothing_yet":"nothing yet", +"common.notifications":"Notifications", +"common.nov":"Nov", +"common.ntp_amplification":"NTP amplification", +"common.oceania":"Oceania", +"common.oct":"Oct", +"common.off":"Off", +"common.offers":"Offers", +"common.offers_here":"Offers here", +"common.on":"On", +"common.on_order":"on order", +"common.oops":"Oops", +"common.open":"Open", +"common.open_bank":"Open bank", +"common.open_inbox":"Open inbox", +"common.open_infra":"Open Infra", +"common.open_lease":"Open lease", +"common.open_noc":"Open NOC", +"common.opt_out":"Opt out", +"common.optical_engineering":"Optical engineering", +"common.optics":"Optics", +"common.optimize":"Optimize", +"common.optimized":"Optimized", +"common.or":" or ", +"common.other_models":"Other models", +"common.outage":"OUTAGE", +"common.overland":"Overland", +"common.overview":"Overview", +"common.own_dark_fiber":"own dark fiber", +"common.packet_empire":"Packet empire", +"common.packet_loss":"Packet loss", +"common.paid_peering":"paid peering", +"common.pause":"Pause", +"common.peak":"Peak", +"common.peak_traffic":"Peak traffic", +"common.peered":"Peered", +"common.peered_ce2f":"Peered ✓", +"common.peering":"Peering", +"common.peering_first":"Peering First", +"common.peering_inbox":"Peering inbox", +"common.peering_policy":"Peering policy", +"common.peering_ratio":"Peering ratio", +"common.peering_spat":"Peering spat", +"common.penny_pincher":"Penny Pincher", +"common.per_month":"Per month", +"common.pig_whisperer":"Pig Whisperer", +"common.play":"Play", +"common.pni_with_net":"PNI with {net}", +"common.pnis":"PNIs", +"common.pops":"POPs", +"common.port":"Port", +"common.port_port":"{port} port", +"common.power":"Power", +"common.power_outage":"Power outage", +"common.prefer":"Prefer", +"common.prefixes":"Prefixes", +"common.prepend_ageddon":"Prepend-ageddon", +"common.prepend_diet":"Prepend Diet", +"common.price_lock":"Price lock", +"common.price_mo":"{price}/mo", +"common.provisioning_n_d_grace":"provisioning, {n}d grace", +"common.racknet":"RackNet", +"common.rank":"Rank", +"common.rare":"Rare", +"common.reach":"Reach", +"common.really_cancel":"Really cancel?", +"common.really_decommission":"Really decommission?", +"common.really_drop":"Really drop?", +"common.really_leave":"Really leave?", +"common.really_remove":"Really remove?", +"common.redundancy":"Redundancy", +"common.regen_site":"− Regen site", +"common.regen_sites":"Regen sites", +"common.regional_player":"Regional player", +"common.regional_quirks":"Regional quirks", +"common.registered":"Registered", +"common.registration_closed":"Registration closed", +"common.regular_crossing":"Regular crossing", +"common.release_notes":"Release notes", +"common.reload_now":"Reload now", +"common.remote":"remote", +"common.remote_peering":"Remote peering", +"common.remove":"Remove", +"common.remove_one":"Remove one", +"common.remove_port":"Remove port", +"common.remove_script":"Remove script", +"common.request":"Request", +"common.responsive":"Responsive", +"common.resume":"Resume", +"common.retention_offer":"Retention offer", +"common.revenue":"Revenue", +"common.route":"Route", +"common.route_4a2e":"Route:", +"common.route_leak":"Route leak", +"common.router_added":"Router added", +"common.router_crash":"Router crash", +"common.router_load":"Router load", +"common.router_ports":"Router ports", +"common.routers":"Routers", +"common.routing_metric":"Routing metric", +"common.rpki_invalid":"RPKI invalid", +"common.rules":"Rules", +"common.rules_7b18":"Rules:", +"common.run":"Run", +"common.rush_repair":"Rush repair", +"common.russia":"Russia", +"common.sacrificial_choke":"Sacrificial choke ✓", +"common.sacrificial_lamb":"Sacrificial Lamb", +"common.samba_peering":"Samba Peering", +"common.same_street":"Same Street", +"common.same_trench":"same trench", +"common.sandbox":"Sandbox", +"common.saturn":"Saturn", +"common.scenario":"Scenario", +"common.scenario_complete":"Scenario complete", +"common.scenario_grandmaster":"Scenario Grandmaster", +"common.scenario_over":"Scenario over", +"common.scenario_solver":"Scenario Solver", +"common.scenario_specialist":"Scenario Specialist", +"common.scenarios":"Scenarios", +"common.script_kiddie":"Script Kiddie", +"common.scrubbing_centers":"Scrubbing centers", +"common.see_who":"See who", +"common.selective":"Selective", +"common.sender_pays":"Sender Pays", +"common.sep":"Sep", +"common.serious_backbone":"Serious backbone", +"common.serve_as_much_traffic_as_you":"Serve as much traffic as you can in one year.", +"common.settings":"Settings", +"common.share":"Share", +"common.share_2cd9":"Share…", +"common.shark_bait":"Shark Bait", +"common.shark_bites":"Shark bites", +"common.shark_week":"Shark Week", +"common.shields_up":"Shields Up", +"common.shortage":"Shortage", +"common.show":"Show", +"common.show_fewer":"Show fewer", +"common.show_me":"Show me", +"common.shut_down":"Shut down", +"common.signed":"Signed!", +"common.site":"Site:", +"common.site_outage":"Site outage", +"common.six_continents":"Six Continents", +"common.skip_tutorial":"Skip tutorial", +"common.skynot_smiles":"Skynot Smiles", +"common.slow_cities":"Slow cities", +"common.sound":"Sound", +"common.south_america":"South America", +"common.spare":"spare", +"common.spares_shelf":"Spares shelf", +"common.speed":"Speed", +"common.speedrun":"Speedrun", +"common.split":"(split)", +"common.spreadsheet_ipam":"Spreadsheet IPAM", +"common.stage_six":"Stage Six", +"common.standard":"Standard", +"common.start_a_new_network":"Start a new network", +"common.start_building":"Start building", +"common.start_construction":"Start construction", +"common.start_here":"Start here", +"common.stepping_stones":"Stepping Stones", +"common.still_owed":"Still owed", +"common.stop_blackholing":"Stop blackholing", +"common.streaming_startup":"Streaming startup", +"common.submarine_transmission":"Submarine transmission", +"common.subsea":"subsea", +"common.subsea_a6be":"Subsea", +"common.subsea_cable":"Subsea cable", +"common.subsea_cables":"Subsea cables", +"common.supply_chain":"Supply chain", +"common.syn_flood":"SYN flood", +"common.teamspooked":"TeamSpooked", +"common.terrestrial":"terrestrial", +"common.terrestrial_19e4":"Terrestrial", +"common.terrestrial_fiber":"Terrestrial fiber", +"common.terrestrial_wave":"terrestrial wave", +"common.the_annex":"The Annex", +"common.the_giants":"The giants", +"common.the_glass":"The glass", +"common.the_internet":"The Internet", +"common.the_moon":"The moon", +"common.tier_1":"Tier 1", +"common.tier_2":"Tier 2", +"common.time":"Time", +"common.time_s_up":"Time's up", +"common.tiny":"tiny", +"common.to":"To", +"common.toaster_wrangler":"Toaster Wrangler", +"common.today":"Today", +"common.today_4203":"today", +"common.toggle_sound":"Toggle sound", +"common.too_far_for_this_cable":"too far for this cable", +"common.traceroute":"Traceroute", +"common.traffic":"Traffic", +"common.traffic_engineering":"Traffic engineering", +"common.traffic_now":"Traffic now", +"common.traffic_served":"Traffic served", +"common.traffic_whisperer":"Traffic Whisperer", +"common.transcontinental":"Transcontinental", +"common.transit":"Transit", +"common.transit_cost":"Transit cost", +"common.transit_provider":"transit provider", +"common.trench_landlord":"Trench Landlord", +"common.try_again":"Try again", +"common.twins":"Twins", +"common.type":"Type", +"common.typhoon_bandwidth":"Typhoon Bandwidth", +"common.typhoon_jitter":"Typhoon Jitter", +"common.typhoon_latency":"Typhoon Latency", +"common.unbreakable":"Unbreakable", +"common.under_construction":"Under construction", +"common.unhappy":"Unhappy", +"common.unicorn":"Unicorn", +"common.university_network":"University network", +"common.unnamed_network":"Unnamed network", +"common.unsubscribed":"Unsubscribed", +"common.up":"up", +"common.up_to_g_per_channel":"Up to {g} per channel", +"common.upgrade_all_to_port_cost_mo":"Upgrade all to {port} {cost} + {mo}/mo", +"common.upgrade_port_cost_mo_mo":"Upgrade {port} {cost} + {mo}/mo", +"common.upgrade_port_price":"Upgrade {port} {price}", +"common.upgrade_port_price_mo":"Upgrade {port} {price}/mo", +"common.upstream_outage":"Upstream outage", +"common.upstreams":"Upstreams", +"common.vacuum_incident":"Vacuum incident", +"common.vendor_tac":"Vendor TAC", +"common.venus":"Venus", +"common.via_rs":"via RS", +"common.viewport_info":"Viewport info", +"common.vigilante":"Vigilante", +"common.walk_away":"Walk away", +"common.wave_lease":"Wave lease", +"common.wave_markets":"Wave markets", +"common.waves":"Waves", +"common.weekly_regular":"Weekly Regular", +"common.weird_requirements":"Weird requirements", +"common.what_s_new_in_v":"What’s new in {v}", +"common.where":"Where", +"common.where_6276":"Where?", +"common.wholesale_wave":"Wholesale wave", +"common.with":"With", +"common.works_offline":"Works offline.", +"common.your_as":"Your AS", +"common.your_cable":"Your cable", +"common.your_customers":"Your customers", +"common.your_exchange":"your exchange", +"common.your_ix":"Your IX", +"common.your_loans":"Your loans", +"common.your_network":"Your network", +"common.your_pop":"Your POP", +"common.your_pops":"Your POPs", +"common.your_reputation":"Your reputation", +"common.zombie_route":"Zombie route", +"compute.attack_hauled_to_scrubbing_in_city":"Attack hauled to scrubbing in {city}", +"compute.courtesy_route_to_new_networks":"Courtesy route to new networks", +"compute.l2vpn_for_name":"L2VPN for {name}", +"compute.sd_wan_for_name":"SD-WAN for {name}", +"conferences.attend_cost":"Attend {cost}", +"conferences.conf_comes_to_city_in_30":"{conf} comes to {city} in 30 days.
Peering coordinators, hallway track, free stickers. Register in the Deals tab.", +"conferences.conf_in_city_you_shook_a":"{conf} in {city}
You shook a lot of hands. For {n} days, selective networks with a presence in {region} want half the usual traffic before they peer.", +"conferences.in_n_days":"in {n} days", +"conferences.name_glow_n_days_left":"{name} glow: {n} days left", +"conferences.selective_networks_in_region_need":"Selective networks in {region} need half the usual traffic to peer. Now is the time to ask for that PNI.", +"conferences.someone_from_goggle_bought_you_a":"Someone from Goggle bought you a beer. You did not get their name, only a sticker.", +"conferences.the_hallway_track_moved_to_a":"The hallway track moved to a bar by the harbour, where the woman behind the bar kept pouring aquavit long past midnight and asked nobody about their AS path. Back at the hotel bar, someone said “just one more drink”. Your BGP sessions stayed up all night. So did you.", +"conferences.you_also_won_the_raffle_cash":"You also won the raffle: {cash} worth of optics, sold on eBuy the same evening.", +"connections.95th_percentile_g":"95th percentile {g}", +"connections.every_port_that_connects_you_to":"Every port that connects you to another network, and where it is. Filter by type, city or network, and tap Open to go to it.", +"connections.n_connection":{"one":"{n} connection","other":"{n} connections"}, +"connections.n_more_connection":{"one":"+{n} more connection","other":"+{n} more connections"}, +"connections.n_peering_session":{"one":"{n} peering session","other":"{n} peering sessions"}, +"connections.no_connections_yet_buy_transit_or":"No connections yet. Buy transit or join an exchange from a POP.", +"connections.on_order_n_days":"on order: {n} days", +"connections.virtual_circuits_and_fabric":"virtual circuits and fabric customers", +"customers.attacks_on_city_are_hauled_to":"attacks on {city} are hauled to {to} for scrubbing: +{ms} ms", +"customers.everyone_who_pays_you_happiest_last":"Everyone who pays you, happiest last. Below 60% they start to grumble, below 30% they are furious, and at 0% they cancel.", +"customers.from_unhappy_customers":"from unhappy customers", +"customers.getting_only_p_of_the_bandwidth":"getting only {p} of the bandwidth they pay for", +"customers.listed_with_a_capacity_broker_name":"Listed with a capacity broker.
{name} wants {what}. Accept it on the fiber or in Deals.", +"customers.n_furious":{"one":"{n} furious","other":"{n} furious"}, +"customers.n_more_customer":{"one":"+{n} more customer","other":"+{n} more customers"}, +"customers.no_customers_here":"No customers here.", +"customers.no_customers_yet_offers_show_up":"No customers yet. Offers show up in the Deals tab.", +"customers.nobody_is_unhappy_enjoy_it_while":"Nobody is unhappy. Enjoy it while it lasts.", +"customers.not_enough_free_channels_on_that":"Not enough free channels on that fiber any more.", +"customers.nothing_spare_to_sell_on_this":"Nothing spare to sell on this fiber.
Every channel is lit or sold, and the trench has no free pair.", +"customers.the_event_is_already_running_the":"The event is already running.
The organisers will not let you walk out now.", +"customers.their_fiber_is_down":"their fiber is down", +"customers.too_late_the_event_has_already":"Too late: the event has already started.", +"customers.unhappy_n":"Unhappy ({n})", +"customers.weighted_by_what_they_pay":"weighted by what they pay", +"customers.you_cannot_reach_the_whole_internet":"you cannot reach the whole internet ({p})", +"customers.you_need_a_pop_in_every":"You need a POP in every city on the contract first.", +"customers_and_events.bw_extra_for_d_days_when":"{bw} extra for {d} days, {when} · pays {fee} when it is over", +"customers_and_events.day_n_of_d":"day {n} of {d}", +"customers_and_events.gaming_attracts_attacks":"Gaming attracts attacks", +"customers_and_events.n_fiber_pairs_in_your_a":"{n} fiber pairs in your {a}–{b} trench. Trenching was the expensive part, so they want all of it", +"customers_and_events.n_sites_list_bw_per_site":"{n} sites: {list} · {bw} per site · {price}/mo", +"customers_and_events.name_at_site":"{name} at {site}", +"customers_and_events.name_hub_site":"{name} (hub: {site})", +"customers_and_events.name_in_city":"{name} in {city}", +"customers_and_events.name_is_over_pay_you_delivered":"{name} is over: +{pay}
You delivered {pct} of what the crowd wanted.", +"customers_and_events.name_starts_today_bw_of_extra":"{name} starts today!
{bw} of extra demand in {city} for {d} days.", +"customers_and_events.name_was_a_disaster_only_pct":"{name} was a disaster.
Only {pct} delivered, and it trended on social media. Penalty: {pay}.", +"customers_and_events.starting_in_n_d":"starting in {n}d", +"dark_fiber.a_whole_network_fabric_that_fits":"A whole network fabric that fits in your pocket.", +"dark_fiber.big_shelf_big_reach_big_invoice":"Big shelf, big reach, big invoice.", +"dark_fiber.coherent_pluggable_in_the_router_no":"Coherent pluggable in the router. No transponder shelf.", +"dark_fiber.elastic_interconnection_now_with":"Elastic interconnection, now with bacon. Raised on a farm outside BrisVegas by the bloke who starts a fibre company every time he finishes a flat white. Spin up a circuit in 59 seconds, oink in 60.", +"dark_fiber.fixed_mux_plus_amplifiers_up_to":"Fixed mux plus amplifiers. Up to 16 channels, no remote switching.", +"dark_fiber.full_c_band_remotely_reconfigurable":"Full C-band, remotely reconfigurable, takes long-haul transponders. Up to 64 channels.", +"dark_fiber.lights_the_l_band_as_well":"Lights the L-band as well: twice the spectrum, up to 128 channels on one fiber pair, and amplifiers that take twice as long to explain.", +"dark_fiber.strong_in_asia_and_africa_every":"Strong in Asia and Africa. Every circuit comes with a consolation prize.", +"dark_fiber.twice_the_speed_shorter_reach":"Twice the speed, shorter reach.", +"dark_fiber.twice_the_wavemagic_full_speed_only":"Twice the WaveMagic. Full speed only on shorter spans, and a cooling fan you can hear from the car park.", +"dashboard.about_price_mo":"about {price}/mo", +"dashboard.all_n":"All ({n})", +"dashboard.amp_huts_and_spares":"Amp huts and spares", +"dashboard.caches_pnis_and_ix":"caches, PNIs and IX", +"dashboard.customers_are_upset":"customers are upset", +"dashboard.delivered_30_days":"Delivered, 30 days", +"dashboard.five_nines_ish":"five nines-ish", +"dashboard.how_it_arrives":"How it arrives", +"dashboard.in_in_out_out":"{in} in · {out} out", +"dashboard.investor_revenue_share":"Investor revenue share", +"dashboard.licenses_and_scrubbing":"Licenses and scrubbing", +"dashboard.money_per_month":"Money per month", +"dashboard.monthly_p_l":"Monthly P&L", +"dashboard.n_businesses":"{n} businesses", +"dashboard.n_more":"+{n} more", +"dashboard.n_shrugged_off":"{n} shrugged off", +"dashboard.nearly_broadband_network_wholesale":"Nearly Broadband Network wholesale", +"dashboard.of_g_wanted":"of {g} wanted", +"dashboard.pops_and_routers":"POPs and routers", +"dashboard.regional_broadband_levy":"Regional broadband levy", +"dashboard.the_long_tail_n_small_networks":"The long tail ({n} small networks)", +"dashboard.the_networks_you_pay_transit_to":"The networks you pay transit to reach, biggest first, and the cheapest way to move each one to peering. This is your to-do list on the way to Tier 1.", +"dashboard.traffic_by_network_asn":"Traffic by network (ASN)", +"dashboard.traffic_by_way_out":"Traffic by way out", +"dashboard.two_nines_and_change":"two nines and change", +"dashboard.waves_and_fiber":"Waves and fiber", +"dashboard.where_the_money_goes":"Where the money goes", +"dashboard.where_your_users_traffic_comes_from":"Where your users' traffic comes from, and how it gets to you. Transit is the only part you pay per gigabit; caches, PNIs and IX peering are free or flat-rate. Tap a column to sort.", +"dashboard.who_your_transit_carries":"Who your transit carries", +"day_tick.a_protected_hamster_species_lives":"A protected hamster species lives along the right-of-way.", +"day_tick.a_town_council_wants_a_public":"A town council wants a public hearing. About the color of the manhole covers.", +"day_tick.archaeologists_found_a_roman":"Archaeologists found a Roman bathhouse on your route.", +"day_tick.channels_are_lighting_up_now":"Channels are lighting up now.", +"day_tick.construction_delay_n_days_why_a":"Construction delay: +{n} days
{why} ({a}–{b})", +"day_tick.customer_level_lv_name_new_customers":"Customer level {lv}: {name}
New customers unlocked: {unlock}", +"day_tick.dark_fiber_handed_over_a_b":"Dark fiber handed over: {a}–{b}", +"day_tick.it_is_dark_add_optics_to":"It is dark. Add optics to light it up.", +"day_tick.license_granted_your_joint_venture":"License granted!
Your joint venture can now build POPs in mainland China.", +"day_tick.name_cancelled_too_many_outages_and":"{name} cancelled.
Too many outages and too little bandwidth in {city}.", +"day_tick.name_is_furious_fix_service_in":"{name} is furious.
Fix service in {city} or they leave.", +"day_tick.name_is_getting_unhappy_happiness_p":"{name} is getting unhappy.
Happiness {p}% in {city}.", +"day_tick.name_via_fab":"{name} via {fab}", +"day_tick.net_de_peered_you_at_ix":"{net} de-peered you at {ix}.
{why} Traffic falls back to your next best path.", +"day_tick.net_de_peered_you_at_ix_caef":"{net} de-peered you at {ix} in {city}.
{why} Traffic falls back to your next best path.", +"day_tick.net_joined_ix_another_member_paying":"{net} joined {ix}!
Another member paying {fee}/mo for a port.", +"day_tick.resolved_what":"Resolved: {what}", +"day_tick.resolved_what_where_is_back_to":"Resolved: {what}
{where} is back to normal.", +"day_tick.sla_breach_name_the_attack_on":"SLA breach: {name}.
The attack on {city} got through and your protected customer went down. You owe {pen} in SLA credits.", +"day_tick.somebody_else_s_gas_main_was":"Somebody else’s gas main was exactly where the map said it was not.", +"day_tick.the_courtesy_route_has_ended_new":"The courtesy route has ended.
New networks you have not connected to are now only reachable through your own peering and transit.", +"day_tick.the_drilling_crew_hit_a_granite":"The drilling crew hit a granite boulder the size of a bus.", +"day_tick.the_internet_is_back_half_of":"The internet is back.
Half of it, anyway. Everything was patched in a hurry and nobody learned anything.", +"day_tick.the_permit_office_lost_your_permit":"The permit office lost your permit. And then the replacement.", +"day_tick.the_railway_changed_its_mind_about":"The railway changed its mind about the easement.", +"day_tick.you_are_in_the_red_cancel":"You are in the red.
Cancel something expensive, wait for revenue, or check the bank for a loan. At −$100k the bank takes your routers.", +"day_tick.you_are_no_longer_tier_1":"You are no longer Tier 1.
Because {why}. Your Tier 1 badge stays; win the status back to show it again.", +"day_tick.your_fiber_is_finished_a_b":"Your fiber is finished: {a}–{b}", +"de_kicks.a_fee_for_being_ready_for":"A fee for being ready for the cloud.", +"de_kicks.a_monthly_pdf_of_your_own":"A monthly PDF of your own traffic graphs.", +"de_kicks.breaking_cve_2026_31337_just_took":"🐘 BREAKING: CVE-2026-31337 just took down half the internet.
A bug in PHP turned every WordPress-ish site on Earth into a crypto miner. Eyeball traffic is down 30% for a few days while the world patches. Your hosting customers are doing it at 3 a.m.", +"de_kicks.covered_by_nda":"Covered by NDA", +"de_kicks.de_kicks_group_sales":"DE-KICKS Group · Sales", +"de_kicks.de_kicks_has_harmonised_its_prices":"DE-KICKS has harmonised its prices.
Harmonised means up: {ix} now costs {p}% more. Thank you for your continued partnership.", +"de_kicks.good_news_you_ve_been_enrolled":"Good news! You've been enrolled in {addon}.
{blurb} {price}/mo, added to your {ix} invoice. Opt out any time in the IX panel.", +"de_kicks.haggles_left_n":"Haggles left: {n}.", +"de_kicks.like_blackholing_but_with_a_plus":"Like blackholing, but with a Plus.", +"de_kicks.makes_your_port_ready_for_a":"Makes your port \"ready\" for a product you did not buy.", +"de_kicks.monthly_price_just_for_you":"Monthly price, just for you", +"de_kicks.pricing_is_reviewed_by_the_global":"Pricing is reviewed by the Global Commercial Council, who meet on the next full moon.", +"de_kicks.quotes_go_up_with_how_big":"Quotes go up with how big you look.", +"de_kicks.sign_price_mo":"Sign {price}/mo", +"de_kicks.thanks_for_your_interest_we_don":"“Thanks for your interest! We don't publish prices, because every customer is unique.”", +"de_kicks.the_same_route_server_in_a":"The same route server, in a gold-coloured portal.", +"de_kicks.they_sent_a_14_page_nda":"They sent a 14-page NDA before they can even repeat the price. Lawyers estimate a week.", +"de_kicks.what_others_pay":"What others pay", +"de_kicks.your_account_manager_has_stopped":"Your account manager has stopped replying to haggling.", +"de_kicks.your_account_manager_is_at_a":"Your account manager is at a conference in Dubai. And then one in Madrid.", +"de_kicks.your_account_manager_is_hungry":"Your account manager is hungry.", +"de_kicks.your_account_manager_would_love_to":"Your account manager would love to \"align on value\" first. Strategic call booked for next week.", +"de_kicks.your_ix_promo_ended_price_is":"Your {ix} promo ended.
Price is back, plus 10% for \"loyalty programme administration\".", +"de_kicks.your_personalised_port_quote_for_ix":"Your personalised {port} quote for {ix}", +"de_kicks.your_port_light_now_blinks_in":"Your port light now blinks in brand colours.", +"decommission.decommission_n_pop_pay_fee":{"one":"Decommission {n} POP · pay {fee}","other":"Decommission {n} POPs · pay {fee}"}, +"decommission.eyeballs_you_stop_serving":"Eyeballs you stop serving", +"decommission.keep_at_least_one_pop":"Keep at least one POP.", +"decommission.n_customer":{"one":"{n} customer","other":"{n} customers"}, +"decommission.n_customer_let_go":{"one":"{n} customer let go","other":"{n} customers let go"}, +"decommission.n_link":{"one":"{n} link","other":"{n} links"}, +"decommission.n_pop_decommissioned_fee_in_early":{"one":"{n} POP decommissioned.
{fee} in early-termination penalties to {m} customers.","other":"{n} POPs decommissioned.
{fee} in early-termination penalties to {m} customers."}, +"decommission.pick_a_pop":"Pick a POP", +"decommission.pick_the_pops_to_shut_down":"Pick the POPs to shut down. Everything in them goes: routers, ports, caches, exchange ports and every link that touches them.", +"draw.from_price_mo":"from {price}/mo", +"draw.no_cable_lands_here":"no cable lands here", +"economy.across_the_river_dc":"Across-the-River DC", +"economy.campus_b_the_one_with_parking":"Campus B (the one with parking)", +"economy.formerly_a_shopping_mall":"Formerly a Shopping Mall", +"economy.handed_off_as_4_1_6t":"handed off as 4×1.6T", +"economy.handed_off_as_4_3_2t":"handed off as 4×3.2T", +"economy.suburban_mega_shed":"Suburban Mega-shed", +"economy.the_cheaper_one":"The Cheaper One", +"economy.the_other_building":"The Other Building", +"events.a_cargo_ship_dragged_its_anchor":"A cargo ship dragged its anchor along the Baltic seabed for 100 km and swears it noticed nothing. Investigators are “looking into it”.", +"events.a_futuristic_city_that_is_not":"A futuristic city that is not built yet, demo day in {city}", +"events.a_gigaproject_wants_a_demo_bw":"A gigaproject wants a demo.
{bw} for four days in {city}, to show off a city that is still mostly renderings. Check the Deals tab.", +"events.a_ship_drifting_without_power":"A ship drifting without power dragged its anchor through the Red Sea cables. Everyone blames everyone. Repair ships need permits from three governments.", +"events.a_state_owned_isp_accidentally":"A state-owned ISP “accidentally” announced your prefixes for 18 minutes. Their apology press release was suspiciously well written. Many networks are still routing your traffic into the void.", +"events.baltic_cable_damaged_a_cargo_ship":"Baltic cable damaged
A cargo ship dragged its anchor for 100 km and swears it noticed nothing. You have no links on those cables.", +"events.baltic_cable_damaged_n_of_your":"Baltic cable damaged
{n} of your links are down for about {d} days.", +"events.bgp_hijack_someone_else_is":"BGP hijack
Someone else is announcing your prefixes. Reach is down until it is cleaned up.", +"events.cables_cut_in_the_red_sea":"Cables cut in the Red Sea
A ship dragged its anchor across several cables. Everyone blames everyone. Luckily you do not use those cables.", +"events.cables_cut_in_the_red_sea_03e8":"Cables cut in the Red Sea
{n} of your subsea links are down for about {d} days while the diplomats argue about repair ships.", +"events.call_everyone_you_know":"Call everyone you know", +"events.cogentle_and_goggle_are_in_a":"Cogentle and Goggle are in a peering spat. Goggle is unreachable through Cogentle transit.", +"events.drizzle_electric_sent_you_an_ipv6":"Drizzle Electric sent you an IPv6 cake.
You sold it for $8k.", +"events.escalate_to_their_cto":"Escalate to their CTO", +"events.faceplant_got_tired_of_korean_usage":"Faceplant got tired of Korean usage fees and quietly moved Korean users to its Hong Kong servers. Pages crawl in for everyone in Seoul. The regulator is drafting a fine.", +"events.faceplant_rerouted_korea_via_hong":"Faceplant rerouted Korea via Hong Kong.
Seoul users get a fifth less of it for 20 days, however you connect.", +"events.glitch_is_leaving_korea_the_game":"Glitch is leaving Korea.
The game-streaming site says Korean network fees are “prohibitively expensive” and shuts down there. Its Seoul traffic drops by half, for good. Local streamers have already moved on.", +"events.golden_week_demand_in_mainland_china":"Golden Week!
Demand in mainland China is up 40% for a week.", +"events.landing_permit_dispute_in_city_two":"Landing permit dispute in {city}
Two ministries both claim the beach. No new subsea links can land there for 45 days.", +"events.name_hits_city_power_is_out":"{name} hits {city}
Power is out and your POP is dark for two days. A generator would have saved it.", +"events.name_hits_city_the_grid_is":"{name} hits {city}
The grid is down, but your backup generator kept the routers running.", +"events.name_knocked_out_power_in_city":"{name} knocked out power in {city}. Your POP has no generator.", +"events.new_season_of_stranger_pings_just":"New season of “Stranger Pings” just dropped!
Eyeball demand is up 25% for a week. Got headroom?", +"events.optical_control_plane_meltdown_every":"Optical control plane meltdown!
Every leased wave in {reg} just went dark at once. Your own dark fiber is fine. This is why people own fiber.", +"events.ordered_offline_in_city_a_government":"Ordered offline in {city}
A government exam-day shutdown. Your POP there is dark for a day.", +"events.peering_spat_cogentle_de_peered":"Peering spat!
Cogentle de-peered Goggle for 20 days. Goggle traffic over Cogentle transit is gone. Peer with Goggle directly or use another upstream.", +"events.regulators_ordered_every_network_in":"Regulators ordered every network in {city} to switch off for a day during national school exams. Yes, this really happens.", +"events.rural_broadband_grant_30k_the":"Rural broadband grant: +$30k
The Ministry of Tubes likes what you are doing.", +"events.sanctions_the_republic_of":"Sanctions!
The Republic of Paperworkistan sanctioned your router vendor’s favorite screw supplier. Spare parts are slow: router crashes take twice as long to fix for 60 days.", +"events.sovereign_internet_drill_moscow":"Sovereign internet drill
Moscow unplugged itself from the rest of the internet for a day to see what happens. Everything leaving Russia is dark until tomorrow.", +"events.the_border_got_stricter_cross_border":"The border got stricter.
Cross-border packet loss rises to 35% for 10 days. Premium routes are barely affected.", +"events.the_neighbours_have_fallen_out_a":"The neighbours have fallen out.
A diplomatic spat closes borders and airspace around Qatar. Every link between Doha and Saudi Arabia or the UAE is down for about {n} days. Route the long way round, by sea.", +"events.trade_war_on_optics_two_governments":"Trade war on optics
Two governments slapped tariffs on each other’s lasers. Optics cost 40% more for 90 days.", +"events.transit_prices_fell_8_they_do":"Transit prices fell 8%.
They do this every year. Nobody knows where the bottom is.", +"events.typhoon_packet_loss":"Typhoon Packet-Loss", +"events.your_wave_supplier_pushed_one":"Your wave supplier pushed one malformed update to its optical control plane, and it flooded every node. All {n} leased waves you have in {reg} are dark. Their status page says “degraded”.", +"exchanges.10_pops_n":"10+ POPs ({n})", +"exchanges.20_peering_sessions_n":"20+ peering sessions ({n})", +"exchanges.pops_on_3_continents":"POPs on 3+ continents", +"exchanges.serve_1_5_tbps_v":"serve 1.5 Tbps ({v})", +"failures.a_45_c_heatwave_in_city":"A 45 °C heatwave in {city}: the grid shed load, the chillers gave up and so did the generator at {dc}.", +"failures.a_b_is_down_same_cable":"{a}–{b} is down. Same cable, new anchor. The repair crew has started a loyalty card.", +"failures.a_backhoe_cut_the_metro_ring":"A backhoe cut the metro ring between your two sites in {city}. Turns out both fiber routes ran down the same street.", +"failures.a_backhoe_found_your_fiber_between":"A backhoe found your fiber between {a} and {b}.", +"failures.a_backhoe_putting_in_a_new":"A backhoe putting in a new servo dug straight through your {a}–{b} fiber. The plans said it was two metres to the left.", +"failures.a_beaver_chewed_through_your_a":"A beaver chewed through your {a}–{b} wave. It used the fiber to finish a dam.", +"failures.a_blackout_hit_city_and_your":"A blackout hit {city} and your POP has no generator. Every other network here has one. Buy one.", +"failures.a_botnet_of_40_000_smart":"a botnet of 40,000 smart toasters", +"failures.a_botnet_run_from_a_cloud":"a botnet run from a cloud you also host", +"failures.a_cargo_ship_forgot_to_raise":"A cargo ship “forgot” to raise its anchor and dragged it across your {a}–{b} cable. The owners are very sorry, and somewhat hard to reach.", +"failures.a_config_template_rendered_router_id":"A config template rendered “{{ router_id }}” literally in {city}. The router took it personally.", +"failures.a_cosmic_ray_flipped_a_bit":"A cosmic ray flipped a bit in your {city} router. It now believes 10.0.0.0/8 lives in Antarctica.", +"failures.a_crocodile_took_a_bite_out":"A crocodile took a bite out of your {a}–{b} fiber. It was not impressed.", +"failures.a_crypto_bro_shorting_your_stock":"a crypto bro shorting your stock", +"failures.a_curious_shark_bit_your_subsea":"A curious shark bit your subsea cable {a}–{b}.", +"failures.a_digger_found_your_a_b":"A digger found your {a}–{b} fiber. A different digger is coming to fix it.", +"failures.a_dirty_connector_on_a_b":"A dirty connector on {a}–{b} drops 2% of packets. TCP hates it: throughput collapses even though the link looks fine.", +"failures.a_drop_bear_fell_on_the":"A drop bear fell on the splicing crew on {a}–{b}. They refuse to work under trees, and the cut runs under trees.", +"failures.a_farmer_s_post_hole_digger":"A farmer’s post-hole digger found your {a}–{b} fiber. The sheep watched.", +"failures.a_ferry_dropped_anchor_in_cook":"A ferry dropped anchor in Cook Strait and found your {a}–{b} cable. The ferry is fine.", +"failures.a_firmware_bug_in_the_sys":"A firmware bug in the {sys} at {a} set every channel to “maintenance”.", +"failures.a_firmware_update_bricked_your":"A firmware update bricked your router in {city}.", +"failures.a_fishing_boat_with_an_unusually":"A fishing boat with an unusually heavy anchor cut {a}–{b}. It was not fishing.", +"failures.a_forestry_strike_stopped_the_waste":"A forestry strike stopped the waste-wood deliveries to the power plant that cools {dc}. No steam, no chillers: your routers in {city} run at half capacity.", +"failures.a_fridge_that_achieved_sentience_and":"a fridge that achieved sentience and chose violence", +"failures.a_gaming_clan_that_lost_one":"a gaming clan that lost one match", +"failures.a_great_white_took_an_interest":"A great white took an interest in your {a}–{b} cable and bit it. Then it spat it out: not enough flavour.", +"failures.a_huntsman_spider_the_size_of":"A huntsman spider the size of your hand moved into the router in {city}. Nobody would reach in to reboot it.", +"failures.a_kangaroo_boxed_your_field_tech":"A kangaroo boxed your field tech on {a}–{b}. The tech lost on points, and the splice can wait.", +"failures.a_kangaroo_hit_the_fiber_hut":"A kangaroo hit the fiber hut on {a}–{b}. The hut lost.", +"failures.a_kea_pulled_the_rubber_seals":"A kea pulled the rubber seals off the splice box on {a}–{b}, then started on the van. Kea are like that.", +"failures.a_kilometre_of_copper_went_missing":"A kilometre of “copper” went missing from your {a}–{b} trench. It was your fiber. The scrap yard sent it back with a note.", +"failures.a_landslide_in_the_andes_buried":"A landslide in the Andes buried your {a}–{b} fiber.", +"failures.a_llama_herd_trampled_the_fiber":"A llama herd trampled the fiber marker on {a}–{b}. Then a backhoe found the fiber.", +"failures.a_member_at_ix_leaked_the":"A member at {ix} leaked the full routing table into the route server. Max-prefix limits tripped everywhere. Your peering there is down.", +"failures.a_member_at_ix_leaked_the_5563":"A member at {ix} leaked the full routing table into the route server. Max-prefix limits tripped everywhere. Your peering there, in {city}, is down.", +"failures.a_new_tech_in_a_tidied":"A new tech in {a} “tidied up” the cable mess. Your {a}–{b} link was part of the mess.", +"failures.a_new_tech_in_city_used":"A new tech in {city} used Vegemite as thermal paste. It conducts flavour, not heat, and your router cooked.", +"failures.a_optic_on_a_b_overheated":"A {optic} on {a}–{b} overheated and is now a very expensive keychain.", +"failures.a_optic_on_a_b_started":"A {optic} on {a}–{b} started reporting a temperature of 900°C. It was wrong, but it shut down anyway.", +"failures.a_possum_got_into_the_substation":"A possum got into the substation behind {dc} in {city}. The possum is fine. Your POP is not.", +"failures.a_power_cut_took_out_site":"A power cut took out {site} in {city}. {other} kept going, so the POP runs at half capacity. Anything plugged in only at the dark site is offline.", +"failures.a_pppoe_hop_shaved_8_bytes":"A PPPoE hop shaved 8 bytes off your MTU and nothing told the servers. Large transfers to {net} stall forever; small ones work fine, which makes it so much worse.", +"failures.a_printer_just_one_printer_nobody":"a printer. Just one printer. Nobody knows how", +"failures.a_remote_hands_tech_in_a":"A remote-hands tech in {a} was asked to clean the fiber on port 1. They cleaned it with a sandwich. {a}–{b} is down.", +"failures.a_rival_isp_s_stress_test":"a rival ISP’s “stress test”", +"failures.a_routine_overnight_upgrade_took":"A routine overnight upgrade took your router in {city} offline until lunchtime. Floptus sends its regards.", +"failures.a_ship_dragged_its_anchor_across":"A ship dragged its anchor across your {a}–{b} cable.", +"failures.a_size_vec_attack_is_hitting":"A {size} {vec} attack is hitting {city}{how}.", +"failures.a_splicer_fusing_someone_else_s":"A splicer fusing someone else’s cable in a manhole near {b} fused yours instead.", +"failures.a_sulphur_crested_cockatoo_chewed":"A sulphur-crested cockatoo chewed through your {a}–{b} fiber, then came back for the spare.", +"failures.a_teenager_with_a_stolen_credit":"a teenager with a stolen credit card and a grudge", +"failures.a_tram_line_construction_project_in":"A tram line construction project in {city} found your metro ring. Both halves of it.", +"failures.a_trawler_off_ostend_dragged_its":"A trawler off Ostend dragged its gear straight through your {a}–{b} cable. The North Sea is about thirty metres deep and full of boats.", +"failures.a_visiting_engineer_from_london":"A visiting engineer from London brought Marmite to the {city} NOC. Diplomatic relations broke down, and so did your router while everyone argued.", +"failures.a_wind_farm_service_vessel_dropped":"A wind-farm service vessel dropped anchor on your {a}–{b} cable. It was there to fix a turbine.", +"failures.across_n_transit_and_peering_ports":", across {n} transit and peering ports", +"failures.all_n_links_in_that_trench":"All {n} links in that trench went down with it.", +"failures.an_automation_script_in_city_ran":"An automation script in {city} ran “sed” on the whole config instead of one line. Every interface is now named “TODO”.", +"failures.an_earthquake_shook_your_a_b":"An earthquake shook your {a}–{b} fiber loose somewhere above 4,000 metres.", +"failures.an_eastern_brown_snake_moved_into":"An eastern brown snake moved into the cable pit on {a}–{b}. Nobody is volunteering to fix your fiber.", +"failures.an_engineer_at_co_swapped_tx":"An engineer at {co} swapped Tx and Rx on your {a}–{b} wave. Light goes in, confusion comes out.", +"failures.an_in_line_amplifier_hut_between":"An in-line amplifier hut between {a} and {b} lost power. A family of mice had moved in.", +"failures.an_intern_pushed_an_acl_in":"An intern pushed an ACL in {city} that denies 0.0.0.0/0. Very secure. Very offline.", +"failures.an_undersea_landslide_snapped_a_b":"An undersea landslide snapped {a}–{b}.", +"failures.an_undersea_volcano_erupted_next_to":"An undersea volcano erupted next to your {a}–{b} cable. The repair ship found it in pieces, some of them kilometres away.", +"failures.another_anchor_another_cut_your_a":"Another anchor, another cut: your {a}–{b} cable. The ship’s flag changed twice during the investigation.", +"failures.another_of_vietnam_s_subsea_cables":"Another of Vietnam’s subsea cables is broken: your {a}–{b} link. The repair ship will come after the holidays. Which holidays is unclear.", +"failures.attacker_who":"Attacker: {who}.", +"failures.automation_pushed_it_to_every_router":"Automation pushed it to every router, so redundancy did not help.", +"failures.bgp_route_leak_a_small_isp":"BGP route leak: a small ISP is announcing {net}'s prefixes. Traffic to them over transit is black-holed. Direct peering still works.", +"failures.blackout_in_city_the_grid_went":"Blackout in {city}
The grid went dark again. Your generator started on the first try, like it always does here.", +"failures.box_jellyfish_season_at_the_a":"Box jellyfish season at the {a}–{b} landing. The divers took one look and went back to the boat.", +"failures.bribe_their_noc_with_donuts":"Bribe their NOC with donuts", +"failures.bushfire_season_the_fiber_along_a":"Bushfire season: the fiber along {a}–{b} melted in its conduit. The fireys saved the town, not the duct.", +"failures.buy_40_desk_fans":"Buy 40 desk fans", +"failures.buy_a_replacement":"Buy a replacement", +"failures.clamp_the_mss_to_1360":"Clamp the MSS to 1360", +"failures.clean_the_connector":"Clean the connector", +"failures.co_decommissioned_your_a_b_wave":"{co} decommissioned your {a}–{b} wave because the ticket said “decom” instead of “docs”.", +"failures.co_did_quick_maintenance_on_the":"{co} did “quick maintenance” on the wrong wavelength. Your {a}–{b} wave is now carrying someone else's cat videos.", +"failures.co_fat_fingered_a_cross_connect":"{co} fat-fingered a cross-connect and patched your {a}–{b} wave into a pizza oven.", +"failures.co_scheduled_maintenance_in_utc_your":"{co} scheduled maintenance in UTC. Your team read it as local time. {a}–{b} went dark at peak.", +"failures.control_plane_meltdown":"Control plane meltdown", +"failures.crc_errors_on_a_b_a":"CRC errors on {a}–{b}: a marginal optic is mangling a few frames in every thousand.", +"failures.every_unpatched_baby_monitor_in":"every unpatched baby monitor in Europe", +"failures.fabric_is_having_a_bad_day":"{fabric} is having a bad day. Every virtual circuit on their fabric is down.", +"failures.fat_fingered_roadm":"Fat-fingered ROADM", +"failures.fat_fingered_wave":"Fat-fingered wave", +"failures.fix_the_lacp_config":"Fix the LACP config", +"failures.flood_held_g_who_gave_up":"Flood held: {g}.
{who} gave up and went back to mining crypto.", +"failures.frost_heave_cracked_the_duct_on":"Frost heave cracked the duct on {a}–{b}, and a beaver did the rest.", +"failures.geopolitical_cable_cut":"Geopolitical cable cut", +"failures.hash_polarisation_on_your_lab_nearly":"Hash polarisation on your {lab}: nearly every flow hashes onto the same member. The bundle says it is up. It is also full.", +"failures.hide_the_vacuum":"Hide the vacuum", +"failures.in_via_e":", in via {e}", +"failures.junk_traffic_is_eating_your_capacity":"Junk traffic is eating your capacity. Open the NOC to fight back.", +"failures.lacp_fast_slow_timer_mismatch_on":"LACP fast/slow timer mismatch on your {lab}: one member keeps timing out of the bundle and coming back.", +"failures.lightning_hit_an_amp_site_on":"Lightning hit an amp site on {a}–{b}. The surge protector was decorative.", +"failures.load_shedding_in_city_stage_n":"Load shedding in {city}
Stage {n} today. Your generator coughed, then kept the lights on.", +"failures.load_shedding_stage_n_in_city":"Load shedding stage {n} in {city}, and you have no generator. Buy one: here it is not optional.", +"failures.load_shedding_took_out_site_in":"Load shedding took out {site} in {city}. {other} kept going, so the POP runs at half capacity. Anything plugged in only at the dark site is offline.", +"failures.magpie_swooping_season_the_field":"Magpie swooping season: the field techs on {a}–{b} will not leave the van, and your cut stays cut.", +"failures.max_prefix_meltdown":"Max-prefix meltdown", +"failures.metro_ring_cut":"Metro ring cut", +"failures.microbursts_on_a_b_overflow_shallow":"Microbursts on {a}–{b} overflow shallow router buffers: 0.5% loss at peak, and every video call notices.", +"failures.microbursts_on_a_b_your_deep":"Microbursts on {a}–{b}.
Your deep-buffer routers soaked them up. Nobody noticed.", +"failures.mtu_mismatch_on_a_b_jumbo":"MTU mismatch on {a}–{b}: jumbo frames keep getting stuck in the tube. Usable capacity halved.", +"failures.net_fat_fingered_a_route_map":"{net} fat-fingered a route-map and prepended your AS {n} times in {city}. Nobody wants that path.", +"failures.net_is_having_an_outage_in":"{net} is having an outage in {city}. Your transit port there is dark.", +"failures.one_member_of_your_lab_was":"One member of your {lab} was patched into the wrong switch. LACP keeps it suspended, quite correctly.", +"failures.patch_panel_mishap":"Patch panel mishap", +"failures.pmtud_black_hole":"PMTUD black hole", +"failures.power_cut_in_city_your_backup":"Power cut in {city}
Your backup generator kicked in. Lights stayed on.", +"failures.power_outage_at_dc_in_city":"Power outage at {dc} in {city}. The generator did not start.", +"failures.rate_limit_the_bursts":"Rate-limit the bursts", +"failures.renew_the_roa":"Renew the ROA", +"failures.rerouted_via_hong_kong":"Rerouted via Hong Kong", +"failures.road_widening_near_a_cut_your":"Road widening near {a} cut your fiber to {b}. It is always road widening.", +"failures.road_works_cut_a_b_nobody":"Road works cut {a}–{b}. Nobody called before digging.", +"failures.roll_back_the_config":"Roll back the config", +"failures.router_crash_in_city_one_router":"Router crash in {city}
One router panicked and its twin took over.{slow} Capacity there is down one router for {d} days.", +"failures.set_mtu_9216_everywhere":"Set MTU 9216 everywhere", +"failures.snow_closed_the_mountain_pass_and":"Snow closed the mountain pass, and the repair crew with it: {a}–{b} is down.", +"failures.somebody_who_did_not_like_your":"somebody who did not like your network name", +"failures.someone_committed_a_config_in_city":"Someone committed a config in {city} with “commit confirmed 1” and went to lunch.", +"failures.someone_deployed_to_city_on_a":"Someone deployed to {city} on a Friday at 16:59.", +"failures.someone_filtered_all_icmp_on_your":"Someone filtered all ICMP on your edge “for security”. Path MTU discovery broke, and connections to {net} hang right after the handshake.", +"failures.someone_in_dc_labeled_every_patch":"Someone in {dc} labeled every patch cable “DO NOT UNPLUG”. Someone else unplugged one anyway: your {a}–{b} link.", +"failures.someone_plugged_a_loop_into_the":"Someone plugged a loop into the {ix} fabric. Broadcast storm! All peering there is down.", +"failures.someone_pulled_the_wrong_cross":"Someone pulled the wrong cross-connect at the meet-me room in {city}, and {siteB} is cut off from {siteA}.", +"failures.someone_ran_reload_on_the_city":"Someone ran “reload” on the {city} router, thinking it was their laptop terminal.", +"failures.someone_set_min_links_on_your":"Someone set min-links on your {lab} to the number of members. One member flapped, so the whole bundle went down.", +"failures.someone_set_the_data_center":"Someone set the data center thermostat in {city} to Fahrenheit thinking it was Celsius. Routers are cooking at half speed.", +"failures.someone_stole_the_copper_grounding":"Someone stole the copper grounding from an amp hut on {a}–{b}. All channels dark.", +"failures.splice_it_tonight":"Splice it tonight", +"failures.squirrels_chewed_through_a_b_they":"Squirrels chewed through {a}–{b}. They regret nothing.", +"failures.swap_the_optic":"Swap the optic", +"failures.swapped_from_your_spares_kit_by":"Swapped from your spares kit by tomorrow.", +"failures.ten_thousand_smart_light_bulbs":"ten thousand smart light bulbs, blinking in unison", +"failures.termites_ate_the_duct_on_a":"Termites ate the duct on {a}–{b}. Then the fiber. Then the replacement duct.", +"failures.that_one_got_through_g_city":"That one got through: {g}.
{city} sank to {p}. Somewhere, {who} is very proud of itself.", +"failures.the_a_c_at_dc_died":"The A/C at {dc} died on the hottest day of the year. Your routers in {city} throttled to half capacity.", +"failures.the_cleaner_at_dc_unplugged_your":"The cleaner at {dc} unplugged your router to plug in a vacuum. The floor is spotless.", +"failures.the_cleaner_unplugged_everything_at":"The cleaner unplugged everything at {siteA}.", +"failures.the_cooling_contractor_in_city":"The cooling contractor in {city} replaced the chillers with a very confident fan. Half capacity for two days.", +"failures.the_crashed_one_what":"The crashed one {what}.", +"failures.the_emus_won_again_a_mob":"The emus won again: a mob of them flattened the marker posts on {a}–{b}, and a grader dug straight through the fiber.", +"failures.the_four_o_clock_storm_rolled":"The four o’clock storm rolled over BrisVegas right on time and took the grid behind {dc} with it. Your POP is in the dark with the pokies.", +"failures.the_internet_connected_kettles_of_a":"the internet-connected kettles of a whole country", +"failures.the_landlord_in_a_re_routed":"The landlord in {a} re-routed the building riser and pinched your dark fiber to {b}.", +"failures.the_laser_in_a_optic_on":"The laser in a {optic} on {a}–{b} died. One channel dark.", +"failures.the_monsoon_flooded_a_manhole_on":"The monsoon flooded a manhole on {a}–{b}. The fiber is now underwater, as is the manhole.", +"failures.the_repair_ship_s_compass_spun":"The repair ship’s compass spun in circles over your {a}–{b} cable. It is broken, and nobody can agree where.", +"failures.the_sandflies_drove_your_splicing":"The sandflies drove your splicing crew off {a}–{b}. They will be back when the wind picks up.", +"failures.the_seabed_off_tonga_slid_down":"The seabed off Tonga slid down a slope and took your {a}–{b} cable with it. The repair ship is coming from Papua New Guinea.", +"failures.the_smelter_at_tiwai_point_pulled":"The smelter at Tiwai Point pulled a little harder on the grid, and your POP in {city} blinked first.", +"failures.thieves_dug_up_your_a_b":"Thieves dug up your {a}–{b} cable, sure it was copper. It was fiber. They left it cut in the ditch, deeply disappointed.", +"failures.traffic_rerouted_customers_barely":"Traffic rerouted, customers barely noticed.", +"failures.truck_a_spare_amp_out":"Truck a spare amp out", +"failures.turn_it_off_and_on_again":"Turn it off and on again (it will take a while)", +"failures.turn_it_off_and_on_again_0872":"Turn it off and on again", +"failures.vacuum_incident_in_city_the_cleaner":"Vacuum incident in {city}
The cleaner unplugged everything at {siteA}. {siteB} kept the city online at half capacity.", +"failures.vacuum_incident_in_city_the_cleaner_47e0":"Vacuum incident in {city}
The cleaner at {dc} unplugged one of your routers to plug in a vacuum. The other one kept going. The floor is spotless.", +"failures.you_fat_fingered_the_channel_plan":"You fat-fingered the channel plan on {a}–{b} and lit a new channel right on top of every existing one.", +"failures.your_a_b_cable_broke_in":"Your {a}–{b} cable broke in the same spot as last time. The repair crew recognised it.", +"failures.your_a_b_cable_is_cut":"Your {a}–{b} cable is cut again. The repair ship never really leaves any more; it just parks over the spot.", +"failures.your_a_b_cable_went_quiet":"Your {a}–{b} cable went quiet somewhere inside the Bermuda Triangle. The repair ship went to look, and it has not called back yet either.", +"failures.your_a_b_fiber_broke_somewhere":"Your {a}–{b} fiber broke somewhere on the Nullarbor. The splicing crew packed for a week.", +"failures.your_a_b_fiber_is_down":"Your {a}–{b} fiber is down. The repair crew found tooth marks, a lodge, and a very proud beaver.", +"failures.your_mitigation_is_eating_most_of":"Your mitigation is eating most of it.", +"failures.your_on_call_engineer_typed_clear":"Your on-call engineer typed “clear bgp *” in production in {city} at 3am. It cleared.", +"failures.your_roa_expired_over_the_weekend":"Your ROA expired over the weekend. Your prefixes are RPKI-invalid and about half the internet is dropping them.", +"failures.your_router_in_city_crashed_and":"Your router in {city} crashed and is rebooting. It {what}. Boot time on this one: about {min} minutes per attempt, and it is on attempt {n}.", +"failures.your_router_in_city_crashed_kernel":"Your router in {city} crashed. Kernel panic, packet panic.", +"failures.your_scrubbing_center_returns_clean":"Your scrubbing center returns clean traffic over a GRE tunnel, and nobody clamped the MSS. Big packets to {net} vanish, so pages load halfway and stop.", +"failures.your_spares_kit_gets_it_back":"Your spares kit gets it back tomorrow.", +"features.done_in_d_days":"done in {d} days", +"features.weekly_challenge_key":"Weekly challenge {key}", +"fiber_and_hardware.can_t_add_optic_why":"Can't add {optic}.
{why}", +"fiber_and_hardware.dark_fiber_iru_signed_a_b":"Dark fiber IRU signed.
{a}–{b} will be spliced and handed over in about 30 days.", +"fiber_and_hardware.fiber_pair_n_is_lit_a":"Fiber pair {n} is lit: {a}–{b}.
Another ROADMaster 9000 and a fresh chain of amplifiers. Room for {m} more channels.", +"fiber_and_hardware.fill_this_pair_first_light_all":"Fill this pair first.
Light all {max} channels before you light another fiber pair.", +"fiber_and_hardware.groundbreaking_your_own_fiber_from_a":"Groundbreaking!
Your own fiber from {a} to {b}. Permits and digging take about {n} days.", +"fiber_and_hardware.line_system_swap_all_channels_are":"Line system swap
All channels are dark for a day while the ROADMs go in.", +"fiber_and_hardware.more_crews_on_site_construction_is":{"one":"More crews on site.
Construction is {n} day ahead.","other":"More crews on site.
Construction is {n} days ahead."}, +"fiber_and_hardware.optic_to_spares":"{optic} to spares", +"fiber_and_hardware.prices_locked_until_date_your_vendor":"Prices locked until {date}.
Your vendor’s account manager is delighted. He gets a bonus for this.", +"fiber_and_hardware.regen_site_n_is_up_optical":"Regen site {n} is up.
Optical spans on {a}–{b} are now {km} km.", +"fiber_and_hardware.regen_site_removed":"Regen site removed.", +"fiber_and_hardware.sold_a_spare_optic_on_ebuy":"Sold a spare {optic} on eBuy.
{price} back, which is {p} of what it cost new.", +"fiber_and_hardware.the_ship_sets_sail_name_your":"The {ship} sets sail!
{name}, your own {km} km cable from {a} to {b}. Ready in about {n} days, if the whales cooperate.", +"fiber_and_hardware.those_optics_need_the_regen_site":"Those optics need the regen site.
Remove the long-haul channels first, or keep the site.", +"fiber_modals.a_fiber_pair_of_your_own":"A fiber pair of your own. The glass is cheap, the gear is not: you buy a line system with an amplifier every {km} km, then optics for each channel. Your gear can fail, and you fix it.", +"fiber_modals.a_fiber_pair_on_cable_km":"A fiber pair on {cable}, {km} km. It shares the cable with everyone else's waves, anchors included.", +"fiber_modals.build_your_own_level_3":"Build your own level 3", +"fiber_modals.build_your_own_price_n_days":"Build your own {price} · ~{n} days", +"fiber_modals.dark_fiber_across_the_chinese_border":"Dark fiber across the Chinese border is not for sale. Buy a cross-border wave instead.", +"fiber_modals.dark_fiber_unlocks_at_customer_level":"Dark fiber unlocks at customer level 2. You need the scale to justify buying your own optical gear.", +"fiber_modals.for_comparison_a_leased_1_6t":"For comparison, a leased 1.6T wave on this route is {price}/mo. Optics come next, from the link panel.", +"fiber_modals.from_city":"From {city}", +"fiber_modals.km_km_is_longer_than_any":"{km} km is longer than any optic reaches at full speed. Transponders will run in long-haul mode (1.2T, 800G or 400G per channel), or add regen sites along the way to get full speed back.", +"fiber_modals.lease_an_iru_price_mo_ready":"Lease an IRU {price}/mo · ready in 30 days", +"fiber_modals.level_n":"level {n}", +"fiber_modals.no_dark_fiber_inside_the_uae":"No dark fiber inside the UAE. Only the two licensed operators may run fiber here, and they only sell waves.", +"fiber_modals.no_install_fee_live_in_minutes":"No install fee, live in minutes, billed monthly. Cheaper than a wave for small capacity, but it rides someone else's fabric, and that fabric can fail.", +"fiber_modals.no_pop_of_yours_on_it":"no POP of yours on it yet", +"fiber_modals.nobody_sells_dark_fiber_on_a":"Nobody sells dark fiber on a subsea cable here. Subsea capacity comes as leased waves.", +"fiber_modals.nobody_sells_one_fiber_pair_across":"Nobody sells one fiber pair across a dozen borders. Between continents, overland capacity only comes as leased waves.", +"fiber_modals.plus_n_in_line_amplifier_price":{"one":"Plus {n} in-line amplifier ({price} each, {mo}/mo for hut rent and power).","other":"Plus {n} in-line amplifiers ({price} each, {mo}/mo for hut rent and power)."}, +"fiber_modals.remote_peering_at_ix_discouraged":"Remote peering at {ix} · discouraged", +"fiber_modals.sign_the_iru":"Sign the IRU", +"fiber_modals.to_city":"To {city}", +"fiber_modals.virtual_circuit_over_an_nni_fabric":"Virtual circuit over an NNI fabric", +"fiber_modals.you_need_a_fabric_port_at":"You need a fabric port at one of your POPs first. Open a POP's Infra tab and buy a port on {list}.", +"fiber_modals.your_own_trench_almost_no_rent":"Your own trench: almost no rent, but permits and digging take forever, and delays happen.", +"fiber_modals.your_pop_needs_a_fabric_port":"Your POP · needs a fabric port there", +"game_and_settings.delete_and_start_over":"Delete and start over", +"game_and_settings.export_save_download_a_file":"Export save download a file", +"game_and_settings.import_a_save_from_a_file":"Import a save from a file", +"game_and_settings.import_failed_that_save_is_damaged":"Import failed.
That save is damaged and could not be loaded. Your current game is untouched.", +"game_and_settings.name_and_everything_it_owns_will":"{name} and everything it owns will be deleted. This cannot be undone.", +"game_and_settings.name_will_be_replaced_export_it":"{name} will be replaced. Export it from the menu first if you want to keep it.", +"game_and_settings.scenarios_amp_weekly_challenge":"Scenarios & weekly challenge", +"game_and_settings.share_your_network_image_card":"Share your network image card", +"game_and_settings.start_a_new_network":"Start a new network?", +"game_and_settings.start_name":"Start {name}?", +"game_and_settings.start_the_challenge":"Start the challenge", +"game_and_settings.start_the_scenario":"Start the scenario", +"game_and_settings.start_the_weekly_challenge":"Start the weekly challenge?", +"game_and_settings.welcome_back_name_imported_and_saved":"Welcome back, {name}.
Imported and saved on this device.", +"game_and_settings.your_game_saves_itself_every_few":"Your game saves itself every few seconds on this device.", +"geography_and_latency.a_to_b":"{a} to {b}", +"geography_and_latency.all_your_waves_on_one_cable":"All your waves on one cable share its fate when it is cut.", +"geography_and_latency.and_prices_have_fallen_p_since":", and prices have fallen {p}% since you started", +"geography_and_latency.cheap_lots_of_competing_fiber":"cheap: lots of competing fiber", +"geography_and_latency.expensive_scarce_capacity":"expensive: scarce capacity", +"geography_and_latency.inside_the_uae_only_the_two":"Inside the UAE only the two licensed operators, Etis-a-lot and Du-opoly, may run fiber. No dark fiber, no digging your own, and waves cost 3×.", +"geography_and_latency.old_cuts_often":"old, cuts often", +"geography_and_latency.overland_between_continents_crosses":"Overland between continents crosses a dozen borders, and every carrier on the way takes a cut: {x}× the price. Subsea is far cheaper.", +"geography_and_latency.pricey_fewer_carriers":"pricey: fewer carriers", +"geography_and_latency.this_route_crosses_a_border_in":"This route crosses a border in Africa: 2× the price. Every country wants its own permits, its own carrier and its own cut.", +"geography_and_latency.this_route_crosses_the_andes_2":"This route crosses the Andes: 2× the price, and landslides and snow cut it far more often than flat fiber.", +"geography_and_latency.this_route_crosses_the_nullarbor_x":"This route crosses the Nullarbor: {x}× the price. A thousand kilometres of nothing, and the incumbents own all of it.", +"geography_and_latency.this_route_goes_into_the_amazon":"This route goes into the Amazon: 2× the price. The fiber runs along rivers and jungle roads, and repairs go by boat.", +"geography_and_latency.where_lvl_this_route_is_p":"{where}: {lvl}. This route is {p}% below the going rate{since}.", +"geography_and_latency.where_lvl_this_route_is_p_0196":"{where}: {lvl}. This route is {p}% above the going rate{since}.", +"geography_and_latency.where_lvl_this_route_is_right":"{where}: {lvl}. This route is right at the going rate{since}.", +"goals.5_pops_ports_on_3_ixs":"5+ POPs, ports on 3+ IXs and 15+ peering sessions.", +"goals.a_private_cross_connect_to_one":"A private cross-connect to one network in the same data center, for when traffic outgrows the IX.", +"goals.a_terabit_per_second_of_happy":"A terabit per second of happy traffic.", +"goals.add_a_second_site_in_a":"Add a second site in a metro from the Infra tab, so one power cut no longer takes the whole city dark.", +"goals.be_in_two_buildings_at_once":"Be in two buildings at once", +"goals.become_a_tier_2":"Become a Tier 2", +"goals.big_cdns_give_you_free_cache":"Big CDNs give you free cache boxes once you send them enough traffic. Free bandwidth, just add power.", +"goals.build_a_scrubbing_center_from_a":"Build a scrubbing center from a POP's Infra tab. It cleans attacks up to its capacity and lets you sell DDoS protection.", +"goals.businesses_show_up_with_a_bubble":"Businesses show up with a $ bubble. You need a POP in their city. Check the Deals tab.", +"goals.drag_from_your_pink_router_to":"Drag from your pink router to another city. Short hops are cheap. Oceans are not.", +"goals.get_a_port_at_an_ix":"Get a port at an IX: a big shared switch where networks swap traffic for free instead of paying transit.", +"goals.have_pops_on_3_continents_subsea":"Have POPs on 3 continents. Subsea cables cost a fortune, so plan the route.", +"goals.host_an_embedded_cache":"Host an embedded cache", +"goals.join_an_internet_exchange":"Join an Internet Exchange", +"goals.land_an_ai_wan_a_multi":"Land an AI WAN, a multi-site training run or a fiber-pairs deal with a hyperscaler. Customer level 4 and a POP near their campus required.", +"goals.lay_your_first_fiber":"Lay your first fiber", +"goals.lease_or_dig_dark_fiber_put":"Lease or dig dark fiber, put a DWDM system on it and light a channel. Cheaper per bit than waves, once it works.", +"goals.light_up_your_first_customers":"Light up your first customers", +"goals.light_your_own_dark_fiber":"Light your own dark fiber", +"goals.make_5_peering_friends":"Make 5 peering friends", +"goals.on_the_peering_tab_request_sessions":"On the Peering tab, request sessions, or join the route server to peer with every open network at once.", +"goals.open_your_home_city_and_press":"Open your home city and press “Launch broadband”. Eyeballs are people at home watching cat videos. They pay you every month.", +"goals.peer_with_every_tier_1_over":"Peer with every Tier 1 over PNIs and cancel every transit port. Then nobody charges you to reach the internet.", +"goals.pops_in_five_of_the_six":"POPs in five of the six regions on the map.", +"goals.reach_the_whole_internet":"Reach the whole internet", +"goals.serve_10_tbps":"Serve 10 Tbps", +"goals.serve_1_tbps":"Serve 1 Tbps", +"goals.set_up_a_pni":"Set up a PNI", +"goals.sign_a_business_customer":"Sign a business customer", +"goals.sign_a_giant":"Sign a giant", +"goals.stand_up_ddos_defences":"Stand up DDoS defences", +"goals.survive_a_failure":"Survive a failure", +"goals.ten_terabits_per_second_of_happy":"Ten terabits per second of happy traffic. The giants will notice.", +"goals.things_break_all_the_time_build":"Things break all the time. Build a second path or a second upstream so traffic reroutes when something dies.", +"goals.your_eyeballs_want_everything_buy_ip":"Your eyeballs want everything. Buy IP transit from a Tier 1 or Tier 2 in your city. Transit gives you the full routing table.", +"help.a_cdn_s_server_in_your":"A CDN's server in your rack. Serves most of that CDN's traffic locally, for the price of power.", +"help.a_cross_connect_with_a_small":"A cross-connect with a small network takes a few weeks. With the big content networks, Tier 1s and big eyeball networks, a new PNI or an augment usually takes about a month, but one order in seven slips to 6 to 12 months. The content networks and Tier 1s start at 100G. Doitsche Telekomm still sells 1G.", +"help.a_pop_is_one_building_until":"A POP is one building until you add a second site in the Infra tab. Then a power cut, cleaner or A/C failure only takes out half the city, and you choose which site each transit, PNI and IX port plugs into, or pick Both to split a LAG across the two buildings. Spread them out, or both halves of your redundancy will sit in the same dark room. Watch out for metro ring cuts, which cut site B off.", +"help.a_shared_switch_in_a_city":"A shared switch in a city. One port, many free peering sessions. The route server peers you with every open member at once.", +"help.a_weird_underserved_market_transit":"A weird, underserved market. Transit costs 2.5× what it does in Europe (Africa 2×, Oceania 1.8×), local incumbents mostly peer only for pay, and IXs are fragmented. But demand is enormous and users sign up 60% faster than anywhere else. Peering and caches pay off most here.", +"help.as_your_peak_traffic_and_footprint":"As your peak traffic and footprint grow, bigger customers show up: streaming startups and universities, then AI GPU data centers and cloud on-ramps, then AI training interconnects and hyperscaler DCI deals measured in terabits. Pink $$ bubbles mark the big ones.", +"help.at_customer_level_3_and_4":"At customer level 3 and 4, hyperscalers and AI clouds show up with deals only they would ask for: terabit AI WANs between gigawatt campuses, training runs spread over several sites, week-long dataset ingests, and hundreds of fiber pairs in a trench you dug yourself. They pay like nobody else, and they want diverse paths, two sites per metro and zero excuses. Cities near their campuses list them under “Who’s here”.", +"help.below_your_goals_sits_a_wall":"Below your goals sits a wall of badges, from common to legendary. Some take luck, some take years, and a couple are secret. Badges you earned in earlier games stay on this device with a dashed outline.", +"help.build_one_in_as_many_pops":"Build one in as many POPs as you like. An attack goes to the nearest working center, and what it cannot take spills to the next. A far center means the flood rides your backbone there and the victim’s traffic comes back the long way: it fills your links, adds latency, and whatever the links cannot carry is not scrubbed. Customers who buy DDoS protection notice when their attacks cross an ocean.", +"help.businesses_may_want_a_private":"Businesses may want a private circuit between two of your POPs (it rides your backbone), or DDoS protection (needs your own scrubbing center).", +"help.content_networks_like_netchill_and":"Content networks like NetChill and Goggle. Most of your traffic comes from them. Peer with them and that traffic is free.", +"help.controls_drag_the_map_to_pan":"Controls: drag the map to pan, scroll or pinch to zoom, tap a city to open it. Drag from your pink router to another city to lay fiber. Space pauses, 0 is half speed, 1 2 3 4 set speed. At 1× a day lasts 2.5 seconds.", +"help.each_pop_s_router_model_caps":"Each POP's router model caps its fastest port (100G, 400G, 800G, 1.6T) and how much it can forward. Bigger waves and ports need better routers at both ends. Better models unlock with your customer level. With one router, upgrades mean a day of downtime.", +"help.event_networks_a_final_a_festival":"Event networks (a final, a festival, a keynote) need a burst of capacity in one city for a few days and pay once at the end, prorated by how much of the crowd you served; below 70% you pay a penalty. SD-WAN chains connect 3–6 of your POPs hub-and-spoke, so one broken spoke upsets the whole contract. Once you run your own dark fiber, carriers want to rent spare channels as alien waves, and on fiber you built yourself, a spare pair.", +"help.events_chains_and_wholesale":"Events, chains and wholesale", +"help.every_ix_port_brings_peering":"Every IX port brings peering requests and max-prefix alerts, in the Networks tab. A session that blows past its limit is down until you look: raise the limit for growth, keep it down for a leak. Ignore your mail and selective networks get pickier.", +"help.every_link_has_latency_high":"Every link has latency. High-frequency traders pay a fortune for a circuit within their latency budget; route them “Lowest latency”. Bulk backup customers do not care, so route them “Scenic” over your quiet links to keep busy ones free.", +"help.home_broadband_users_they_mostly":"Home broadband users. They mostly download from CDNs and pay you per Gbps you deliver. Serve them well and they multiply.", +"help.how_the_internet_works_here":"How the internet works here", +"help.in_the_gulf_saudi_pops_need":"In the Gulf, Saudi POPs need a local telecom licence and data on Saudi users stays in the Kingdom; gigaprojects ask for huge demo networks; and now and then the neighbours fall out and every link between Qatar and Saudi Arabia or the UAE goes dark for months, so keep a sea route. South America hangs off Miami: transit is pricier, nothing crosses the Darién Gap by land, and fiber over the Andes costs double and breaks often. IX.brrr in Brazil is run by a nonprofit with cheap public prices, and small Brazilian provedores buy transit in bulk. Inside the UAE only the duopoly may run fiber, so no dark fiber and 3× waves. Korea runs on “sender pays”: transit into Seoul costs about four times the usual price and the three incumbents only peer over paid PNIs, billed per gigabit you send them. Taiwan’s cables meet a lot of anchors, Indian fiber meets road widening and the monsoon, and South Africa has load shedding: bring a generator. Australia is a long way from everywhere: transit and waves cost more than almost anywhere else, though the IX ports are cheap. Homes pay well for broadband, but the Nearly Broadband Network keeps almost half of every bill. The routers are mounted upside down, and everything else is trying to kill you.", +"help.ix_internet_exchange":"IX (Internet Exchange)", +"help.l2vpn_ddos_protection":"L2VPN & DDoS protection", +"help.lease_an_iru_or_build_your":"Lease an IRU or build your own (slow, with delays), then buy a line system with amplifiers and light channels with 400ZR+, 800ZR+ or 1.6T transponders. Much cheaper than waves at scale, but the gear can fail. A spares kit speeds up repairs.", +"help.mainland_china_needs_a_license_and":"Mainland China needs a license and a local joint venture. Many foreign services are blocked there, and traffic crossing the border loses packets unless you pay for premium routes.", +"help.megapork_pocketfabric_and":"Megapork, PocketFabric and Consolation Connect sell a port plus virtual circuits between cities. Great for small links and remote peering at an IX where you have no POP.", +"help.moscow_needs_a_mandatory_government":"Moscow needs a mandatory government box in every POP, Western CDNs are mostly gone, Goggle video is throttled to half speed, and the sovereign internet drills now and then cut Moscow off for a day.", +"help.name_as_asn_is_transit_free":"{name} (AS{asn}) is transit-free. You peer with every giant on the planet and pay nobody to reach the internet. Took you {days} days and {n} incidents.", +"help.nanog_ripe_denog_and_friends_come":"NANOG, RIPE, DENOG and friends come round every year. Register in the Deals tab for $8k. For 45 days after, selective networks with a presence in that region need only half the usual traffic before they peer with you. Sometimes you also win the raffle.", +"help.once_auto_te_is_installed_you":"Once Auto-TE is installed, you can program it from the NOC tab. Rules include spill at 80%, prefer pni for goggle, avoid transit for netchill, cap transit cogentle at 20 gbps, drain paris, avoid link fra-ams and blackhole ddos. Check runs a dry run against live traffic; Deploy makes it real, mistakes included.", +"help.open_peers_with_anyone_selective":"Open peers with anyone. Selective wants to see traffic first. Restrictive (Tier 1s) only peers with giants, over PNIs. Paid means exactly that. Big selective networks also have moods: in some cities they refuse new peers for a few months, or only take PNIs, and now and then they tear down a session you already had. Try another city or a PNI, and ask again later.", +"help.out_of_port_speed_bundle_up":"Out of port speed? Bundle up to 8 identical ports to the same transit provider, IX or PNI into a LAG. Each member costs a full port; flow hashing is never perfectly even, so a bundle carries about 95% of the sum.", +"help.pni_lead_times":"PNI lead times", +"help.point_of_presence_your_router_in":"Point of presence: your router in a data center. Everything starts at a POP.", +"help.private_network_interconnect_a_cable":"Private network interconnect: a cable straight to one network in the same building. For big traffic.", +"help.reach_an_ix_over_a_fabric":"Reach an IX over a fabric circuit without a POP there. It works, and the route server still gets you every open network, but it is discouraged: the reseller charges 1.5× for the port and oversubscribes it to 80%, latency rides the fabric, one fabric outage drops every session, and many selective networks refuse remote members outright.", +"help.routers_optics_and_new_builds_get":"Routers, optics and new builds get dearer over the years, about 4% a year after the first six months, and now and then a shortage makes one of them a lot dearer for a month or two. What you already own keeps its price. Spares on the shelf and a yearly price lock from the NOC tab soften the blow.", +"help.rules_for_your_auto_te_controller":"Rules for your Auto-TE controller: which exits to prefer, which to avoid, and when to spill onto the next one. The editor’s help explains every rule and has ready-made scripts.", +"help.sandbox_gives_you_a_billion_dollars":"Sandbox gives you a billion dollars, every unlock and no failures, but no badges. Scenarios are hand-built challenges with a goal and a deadline, and the weekly challenge gives everyone the same world for a week. Share your result with the card in the menu.", +"help.share_my_network":"Share my network", +"help.some_customers_come_with_conditions":"Some customers come with conditions: no Cogentle anywhere, no subsea cables because of sharks, two routers, a generator, NetChill on-net, low-loss China reach and more. Each pays a bonus. Unmet ones make them grumpy until you fix it or they leave.", +"help.some_routers_take_forever_to_boot":"Some routers take forever to boot. The Infra tab shows how long yours takes. Slow booters make crashes last longer and turn a one-router swap into a three-day outage. Bigger chassis, especially anything with a PacketOinker™ inside, are slow more often. Twin routers make it someone else’s problem.", +"help.subsea_waves_can_only_follow_cable":"Subsea waves can only follow cable systems modelled on real ones, drawn faintly on the map (tap a city to highlight its cables). Teal ones are new and cheap, purple ones pricey, dashed ones old and cut-prone. All your waves on one cable die together when it is cut. Between continents on land, you can often choose overland (2.5×, many borders) or a cable.", +"help.tap_a_link_to_see_which":"Tap a link to see which networks, which entry points and which customer cities fill it. Raise a link's metric to steer traffic around it, or set an egress (transit, IX, PNI) to Prefer or Backup only.", +"help.tap_traceroute_on_any_of_your":"Tap 🔍 Traceroute on any of your cities, or open it from the NOC tab, to see the exact path to a network or POP, hop by hop, with latency, the exit and the AS path.", +"help.tap_your_cash_to_open_the":"Tap your cash to open the bank. Lenders make offers now and then, and much more often when you are in the red. Each loan has a monthly payment and some odd conditions; break one and you pay a penalty. Your credit rating decides which banks talk to you. The loan shark is always there. Do not be late.", +"help.the_bank_repossessed_your_routers":"The bank repossessed your routers and sold them on eBuy. {name} lasted {days} days and peaked at {peak}.", +"help.the_chart_button_at_the_top":"The chart button at the top opens traffic graphs by exit (caches, PNIs, IX, transit), money over time, per-ASN traffic with how it reaches you and what its transit costs, plus your busiest links and routers.", +"help.the_group_behind_several_big":"The group behind several big exchanges (Frankfurt, Madrid, Marseille, Dubai, Mumbai, New York) treats price lists as a state secret. Ports are quoted per customer and go up the bigger you look. Haggling can work, backfire or stall for a week. Prices get \"harmonised\" upwards once a year, add-ons appear on your invoice until you opt out, and trying to leave earns you a retention discount that ends with a fee.", +"help.things_break_all_the_time_fiber":"Things break all the time: fiber cuts, router crashes, power cuts, IX loops, fabric outages, route leaks, DDoS, fat fingers, cooling failures, and geopolitics: sanctions, tariffs, BGP hijacks, landing permit disputes, exam-day shutdowns and Red Sea cable cuts. Traffic reroutes automatically over other paths and upstreams. Parallel links on diverse routes, a second router and a backup generator all help. Or pay to rush repairs.", +"help.tier_1s_reach_the_whole_internet":"Tier 1s reach the whole internet without paying anyone, because they all peer with each other. Tier 2s peer a lot but still buy some transit.", +"help.traffic_follows_the_shortest_path_by":"Traffic follows the shortest path by distance and link metric, and reroutes by itself when links fail. When a path is merely full, the overflow is dropped, just like a real IGP. From customer level 3 you can install Auto-TE in the NOC tab: it spills overflow onto up to two alternate paths with free capacity, as long as they are no more than twice as long.", +"help.transit_bills_sample_your_usage":"Transit bills sample your usage every day and charge the 95th percentile of the last 30 days, so short spikes are forgiven but long ones are not.", +"help.users_feel_the_round_trip_to":"Users feel the round trip to wherever their traffic leaves your network for transit. Up to 20 ms (about 1,500 km) is fine; past 50 ms broadband and internet services count as bad service, which costs revenue and customers. Traffic over your own peering, PNIs and caches is not penalised.", +"help.want_to_know_how_it_really":"Want to know how it really works?", +"help.what_a_wave_costs_depends_on":"What a wave costs depends on where it runs. Europe is cheap (lots of competing fiber), North America is average, Asia and South America are pricier, and anything into Africa is several times the price. Every route has its own going rate, and new leases get about 8% cheaper each year, so waiting can pay. The link planner tells you how a route compares.", +"help.you_built_a_cartoon_internet_now":"You built a cartoon internet. Now see how the real one works:", +"help.you_pay_a_bigger_network_per":"You pay a bigger network per Gbps and it delivers your traffic anywhere. Easy, full reach, never free.", +"help.you_re_a_tier_1":"You're a Tier 1!", +"help.your_fiber_links_are_leased_waves":"Your fiber links are leased waves at a flat monthly rate. Longer and bigger costs more (10G → 6.4T), and subsea is 1.8× the price.", +"helpers.y_y_mon_d":"Y{y} · {mon} {d}", +"hint.drag_onto_another_city":"Drag onto another city", +"hint.release_to_plan_a_link":"Release to plan a link", +"hint.tap_your_city_then_launch_broadband":"Tap your city, then Launch broadband", +"hint.tip_drag_from_your_pink_router":"Tip: drag from your pink router to another city to lay fiber", +"hot_ports_and_rank.add_a_lag_member_or_upgrade":"Add a LAG member or upgrade the PNI.", +"hot_ports_and_rank.add_a_lag_member_upgrade_the":"Add a LAG member, upgrade the port or buy a second upstream.", +"hot_ports_and_rank.and_n_more":"and {n} more", +"hot_ports_and_rank.ask_for_another_box_the_overflow":"Ask for another box. The overflow goes out over peering or transit.", +"hot_ports_and_rank.name_caches":"{name} caches", +"hot_ports_and_rank.net_transit_lag":"{net} transit · {lag}", +"hot_ports_and_rank.no_pni_with_list":"no PNI with {list}", +"hot_ports_and_rank.upgrade_the_ix_port_or_add":"Upgrade the IX port or add a LAG member.", +"hot_ports_and_rank.upgrade_the_router_or_add_a":"Upgrade the router or add a second one in the Infra tab.", +"hot_ports_and_rank.you_buy_transit_again":"you buy transit again", +"hot_ports_and_rank.you_cannot_reach_list":"you cannot reach {list}", +"hot_ports_and_rank.your_reach_is_p_not_100":"your reach is {p}, not 100%", +"hud_and_panels.all_connections_n":"All connections {n}", +"hud_and_panels.all_systems_green_enjoy_it_while":"All systems green. Enjoy it while it lasts.", +"hud_and_panels.auto_fix_in_n_day":{"one":"Auto-fix in {n} day","other":"Auto-fix in {n} days"}, +"hud_and_panels.blackholing_g":"blackholing {g}", +"hud_and_panels.customer_level_lv_name":"Customer level {lv}: {name}", +"hud_and_panels.dropping_or_overflowing":"dropping or overflowing", +"hud_and_panels.every_network_on_the_map_traffic":"Every network on the map. Traffic share is how much of your users' traffic goes to them. Tap a connection to jump to its POP.", +"hud_and_panels.flowspec_capable_pops":"Flowspec-capable POPs", +"hud_and_panels.flowspec_drop_rules_live_in_router":"Flowspec drop rules live in router TCAM, so only capable routers filter known UDP floods (DNS, NTP, CLDAP, SYN) at the edge. The used Rusty has none, merchant-silicon and whitebox models do a little, the big chassis do it in full. Upgrade a POP’s router from its Infra tab.", +"hud_and_panels.g_lost":"{g} lost", +"hud_and_panels.happiness_p":"happiness {p}%", +"hud_and_panels.has_errors_not_running":"has errors, not running", +"hud_and_panels.incidents_so_far":"Incidents so far", +"hud_and_panels.install_auto_te_cost_mo_mo":"Install Auto-TE {cost} + {mo}/mo", +"hud_and_panels.large_peering_model_is_on_it":"Large Peering Model is on it.", +"hud_and_panels.lv_n":"Lv {n}", +"hud_and_panels.n_incident":{"one":"{n} incident","other":"{n} incidents"}, +"hud_and_panels.n_message_waiting_for_an_answer":{"one":"{n} message waiting for an answer.","other":"{n} messages waiting for an answer."}, +"hud_and_panels.n_networks_d_days_left":"{n} networks · {d} days left", +"hud_and_panels.n_new_notification":{"one":"{n} new notification","other":"{n} new notifications"}, +"hud_and_panels.n_rules_live":"{n} rules live", +"hud_and_panels.n_session_is_down_on_its":{"one":"{n} session is down on its max-prefix limit.","other":"{n} sessions are down on their max-prefix limit."}, +"hud_and_panels.n_small_networks":"{n} small networks", +"hud_and_panels.n_special_requirement":{"one":"{n} special requirement","other":"{n} special requirements"}, +"hud_and_panels.n_unhappy_customer_price_mo_at":{"one":"{n} unhappy customer, {price}/mo at risk","other":"{n} unhappy customers, {price}/mo at risk"}, +"hud_and_panels.needs_a_pop_in_cities":"Needs a POP in {cities}", +"hud_and_panels.next_req_unlocks_what":"Next: {req} unlocks {what}", +"hud_and_panels.no_open_offers_right_now_businesses":"No open offers right now. Businesses look for networks with POPs in their city. New ones pop up every few weeks.", +"hud_and_panels.none_build_one_from_a_pop":"None (build one from a POP's Infra tab)", +"hud_and_panels.nothing_every_network_is_reachable":"Nothing: every network is reachable without transit.", +"hud_and_panels.on_city":"On · {city}", +"hud_and_panels.on_moving_g_onto_alternate_paths":"On · moving {g} onto alternate paths", +"hud_and_panels.open_noc_dashboard":"Open NOC dashboard", +"hud_and_panels.out_of_reach_without_transit_n":"Out of reach without transit {n}", +"hud_and_panels.p_full":"{p} full", +"hud_and_panels.p_of_its_traffic_ms_ms":"{p} of its traffic · {ms} ms round trip · service {sf}", +"hud_and_panels.p_of_traffic":"{p}% of traffic", +"hud_and_panels.p_of_traffic_between_them_scattered":"{p}% of traffic between them, scattered across exchanges. You peer with {n}.", +"hud_and_panels.ports_caches_and_routers_running_hot":"Ports, caches and routers running hot", +"hud_and_panels.raise_a_full_link_s_metric":"Raise a full link’s metric so traffic prefers another path, upgrade it, or install Auto-TE.", +"hud_and_panels.reaches_networks_from_the_last":"Reaches networks from the last update that you have no other path to, for free. Connect to them before it ends.", +"hud_and_panels.reward_cash":"Reward {cash}", +"hud_and_panels.survived_with_no_impact":"Survived with no impact", +"hud_and_panels.the_long_tail":"The long tail", +"hud_and_panels.their_users_go_out_through_transit":"Their users go out through transit far away. Past 50 ms round trip, broadband and internet services count as bad service.", +"hud_and_panels.traffic_takes_the_shortest_path_even":"Traffic takes the shortest path, even when it is full. A traffic-engineering controller spills the overflow onto the next-best paths with room.", +"hud_and_panels.transit_price_gbps":"transit ${price}/Gbps", +"hud_and_panels.turn_auto_te_off":"Turn Auto-TE off", +"hud_and_panels.turn_auto_te_on":"Turn Auto-TE on", +"hud_and_panels.unlocks_at_customer_level_3":"Unlocks at customer level 3", +"hud_and_panels.write_a_routescript":"Write a RouteScript", +"hud_and_panels.your_network_operations_center_every":"Your Network Operations Center. Every notification also lands here. Things fail all the time on the internet. Redundant links and multiple upstreams let traffic reroute by itself.", +"incidents.rent_a_generator":"Rent a generator", +"incidents_and_ddos.a_carrier_pigeon_beat_one_of":"A carrier pigeon beat one of your links in an informal latency test. Morale is low. Throughput is fine.", +"incidents_and_ddos.a_customer_opened_a_p1_ticket":"A customer opened a P1 ticket: “the internet is slow”. Attached was a photo of their router, unplugged.", +"incidents_and_ddos.a_goose_attacked_the_technician_on":"A goose attacked the technician on the way to your amp hut. The goose won. Repair rescheduled, nothing broke.", +"incidents_and_ddos.a_leap_second_convinced_one_of":"A leap second convinced one of your routers it is 1970. Uptime now reads minus 56 years. Traffic is fine.", +"incidents_and_ddos.a_route_you_withdrew_in_year":"A route you withdrew in Year 1 is still visible somewhere in the internet. Nobody knows where. It is fine. Probably.", +"incidents_and_ddos.a_two_hour_meeting_about_router":"A two-hour meeting about router hostnames ended with a vote for “router-final-v2-NEW”.", +"incidents_and_ddos.after_upstream_scrubbing_g":"After upstream scrubbing: {g}", +"incidents_and_ddos.an_auditor_asked_for_a_network":"An auditor asked for a network diagram. You sent the game map. They approved it.", +"incidents_and_ddos.attack_fully_mitigated":"Attack fully mitigated", +"incidents_and_ddos.blackhole_the_target_rtbh":"Blackhole the target (RTBH)", +"incidents_and_ddos.blackholed_the_junk_is_gone_and":"Blackholed: the junk is gone, and so is {city}. The attack got what it wanted.", +"incidents_and_ddos.contained_on_your_sacrificial_net":"Contained on your sacrificial {net} PNI", +"incidents_and_ddos.edge_filters_dropping_g":"Edge filters dropping: {g}", +"incidents_and_ddos.flowspec_cannot_catch_vec":"Flowspec cannot catch {vec}", +"incidents_and_ddos.flowspec_dropping_g":"Flowspec dropping: {g}", +"incidents_and_ddos.flowspec_dropping_g_some_ingress":"Flowspec dropping: {g}; some ingress routers have no TCAM", +"incidents_and_ddos.g_is_leaking_through":"{g} is leaking through", +"incidents_and_ddos.hackback_3000tm_20k":"HackBack 3000™ $20k", +"incidents_and_ddos.it_was_dns":"It was DNS", +"incidents_and_ddos.ix_blackhole_half_honour_it":"IX blackhole ~half honour it", +"incidents_and_ddos.ix_blackhole_on":"IX blackhole on ✓", +"incidents_and_ddos.ix_lag":"{ix} LAG", +"incidents_and_ddos.ix_lag_in_city":"{ix} LAG in {city}", +"incidents_and_ddos.live_attack_city":"Live attack: {city}", +"incidents_and_ddos.load_bearing_typo":"Load-bearing typo", +"incidents_and_ddos.management_declared_a_change_freeze":"Management declared a change freeze. Someone made a change to announce the change freeze.", +"incidents_and_ddos.name_transit_lag_in_city":"{name} transit LAG in {city}", +"incidents_and_ddos.no_flowspec_filtering_ingress":"No Flowspec filtering: ingress routers have no TCAM", +"incidents_and_ddos.no_scrubbing_center":"No scrubbing center", +"incidents_and_ddos.no_scrubbing_needed_after_edge":"No scrubbing needed after edge mitigation", +"incidents_and_ddos.on_demand_scrubbing_diverting_live":"On-demand scrubbing diverting, live in {n}d", +"incidents_and_ddos.open_to_work":"Open to work", +"incidents_and_ddos.pni_lag_with_name_in_city":"PNI LAG with {name} in {city}", +"incidents_and_ddos.rtbh_is_free_and_instant_but":"RTBH is free and instant, but it drops everything to the victim, attack and customer alike. An IX blackhole keeps the customer up but only about half the members honour it. HackBack 3000™ by Skynot AI sometimes ends it, and sometimes flattens an innocent and earns you a fine.", +"incidents_and_ddos.scrubbing_centers_unavailable_or_at":"Scrubbing centers unavailable or at capacity", +"incidents_and_ddos.scrubbing_in_city_used_capacity":"Scrubbing in {city}: {used} / {capacity}", +"incidents_and_ddos.scrubbing_traffic_hauled_over_your":"Scrubbing traffic hauled over your backbone: {city} → {to} (+{ms} ms)", +"incidents_and_ddos.size_vec_entry_n_d_left":"{size} · {vec}{entry} · {n}d left", +"incidents_and_ddos.someone_deleted_the_dns_record_for":"Someone deleted the DNS record for the internal wiki. The runbook for fixing DNS was on the wiki.", +"incidents_and_ddos.someone_named_a_vlan_prodcution_it":"Someone named a VLAN “prodcution”. It is now load-bearing and can never be renamed.", +"incidents_and_ddos.the_tls_certificate_on_your_noc":"The TLS certificate on your NOC dashboard expired. Nobody can see any graphs, so technically there are no problems.", +"incidents_and_ddos.this_attack_g":"This attack: {g}", +"incidents_and_ddos.ticket_of_the_week":"Ticket of the week", +"incidents_and_ddos.vendor_support_asked_you_to_try":"Vendor support asked you to “try turning it off and on again”. For the router you already rebooted. Ticket closed.", +"incidents_and_ddos.you_found_a_10g_link_in":"You found a 10G link in the inventory that nobody ordered, nobody pays for, and that carries 3 Gbps of something.", +"incidents_and_ddos.your_backbone_can_only_haul_g":"Your backbone can only haul {g} of it to {city}: the rest is not scrubbed", +"incidents_and_ddos.your_ip_address_spreadsheet_hit_1":"Your IP address spreadsheet hit 1,048,576 rows. Excel has opinions.", +"incidents_and_ddos.your_ipv6_traffic_grew_400_from":"Your IPv6 traffic grew 400%. From one packet to five.", +"incidents_and_ddos.your_monitoring_system_went_down_you":"Your monitoring system went down. You found out because nothing alerted. Very peaceful week.", +"incidents_and_ddos.your_peering_coordinator_updated":"Your peering coordinator updated their profile to “open to work”. Three Tier 1s suddenly want to chat. Nothing happened, but it felt nice.", +"incidents_and_ddos.your_upstream_support_line_plays_the":"Your upstream support line plays the same 11 seconds of hold music. Your on-call engineer can now hum it in four keys.", +"install.before_you_start":"Before you start", +"install.best_played_as_an_app":"Best played as an app", +"install.build_your_backbone_on_the_train":"Build your backbone on the train or on a plane.", +"install.full_screen_works_offline_one_tap":"Full screen, works offline, one tap from your home screen.", +"install.install_it_before_you_start_a":"Install it before you start: a game begun in Safari stays in Safari.", +"install.install_the_app":"Install the app", +"install.installed_open_series_of_tubes_from":"Installed!
Open Series of Tubes from your home screen. Your saves come along.", +"install.it_opens_straight_into_your_network":"It opens straight into your network, like any other app.", +"install.no_browser_bars_a_lot_more":"No browser bars, a lot more map.", +"install.on_iphone_a_game_started_in":"On iPhone, a game started in Safari does not carry over to the home-screen app.", +"install.one_tap_away":"One tap away.", +"install.open_series_of_tubes_from_your":"Open Series of Tubes from your home screen and start your network there.", +"install.open_series_of_tubes_from_your_e03f":"Open Series of Tubes from your home screen.", +"install.open_your_browser_menu":"Open your browser menu (⋮).", +"install.play_in_the_browser_anyway":"Play in the browser anyway", +"install.play_it_as_an_app":"Play it as an app", +"install.safari_can_clear_the_data_of":"Safari can clear the data of websites you have not opened for a week. A home-screen app keeps its own.", +"install.series_of_tubes_is_made_for":"Series of Tubes is made for your home screen. It takes ten seconds, costs nothing, and it is a much better game there:", +"install.tap_add_to_home_screen_you":"Tap Add to Home Screen. You may need to scroll down, or tap More first.", +"install.tap_install_app_or_add_to":"Tap Install app or Add to Home screen.", +"install.tap_share_icon_in_the_browser":"Tap Share {icon} in the browser toolbar.", +"install.your_save_stays_safe":"Your save stays safe.", +"interface.amt_from_bank_has_landed":"{amt} from {bank} has landed.", +"interface.loan_from_bank_repaid_early":"Loan from {bank} repaid early.", +"interface.not_enough_cash_wait_for_revenue":"Not enough cash.
Wait for revenue, or speed up time.", +"interface.that_customer_is_gone_the_contract":"That customer is gone.
The contract ended since.", +"interface.that_link_is_gone_it_was":"That link is gone.
It was removed or decommissioned since.", +"interface.they_now_own_p_of_your":"They now own {p} of your revenue.", +"interface.tubecoin_moved_down_p_on_the":"TubeCoin moved down {p}% on the way to your account.", +"interface.tubecoin_moved_up_p_on_the":"TubeCoin moved up {p}% on the way to your account.", +"interface.you_bought_out_bank_they_flew":"You bought out {bank}.
They flew off to find another startup.", +"lease_swaps.cap_fabric_circuit":"{cap} fabric circuit", +"lease_swaps.cap_on_a_dark_fiber_iru":"{cap} on a dark fiber IRU", +"lease_swaps.cap_wave":"{cap} wave", +"lease_swaps.costs_more_than_leasing_at_this":"Costs more than leasing at this size.", +"lease_swaps.digging_your_own_fiber_unlocks_at":"Digging your own fiber unlocks at customer level 3.", +"lease_swaps.every_wave_fabric_circuit_and_dark":"Every wave, fabric circuit and dark fiber IRU you rent between two of your POPs, next to what leased dark fiber or your own fiber would cost. Estimates include the line system, amplifiers and enough optics for today’s capacity. Build first, move the traffic, then cancel the lease.", +"lease_swaps.lease_dark_fiber_up_up_front":"Lease dark fiber: {up} up front, {mo}/mo, ready in about {n} days.", +"lease_swaps.no_optic_you_can_buy_reaches":"No optic you can buy reaches {km} km yet.", +"lease_swaps.no_optic_you_can_buy_works":"No optic you can buy works on your fiber here yet.", +"lease_swaps.nobody_lets_you_dig_on_this":"Nobody lets you dig on this route. Borders and licences are in the way, so keep leasing.", +"lease_swaps.open_your_dark_fiber":"Open your dark fiber", +"lease_swaps.open_your_fiber":"Open your fiber", +"lease_swaps.plan_a_cable":"Plan a cable", +"lease_swaps.plan_dark_fiber":"Plan dark fiber", +"lease_swaps.plan_your_own_fiber":"Plan your own fiber", +"lease_swaps.saves_price_mo_pays_for_itself":"Saves {price}/mo, pays for itself in about {n} months.", +"lease_swaps.you_already_lease_dark_fiber_here":"You already lease dark fiber here. Light {n} more channels for {up}, then cancel the waves to save {price}/mo.", +"lease_swaps.you_already_own_fiber_here_light":"You already own fiber here. Light {n} more channels for {up}, then cancel the lease to save {price}/mo.", +"lease_swaps.you_do_not_lease_any_lines":"You do not lease any lines between your POPs.", +"lease_swaps.you_pay_for_leases":"You pay for leases", +"lease_swaps.your_fiber_here_has_room_for":"Your fiber here has room for {free} more channels, and moving these leases needs {n}. Light another fiber pair or upgrade the line system first.", +"lease_swaps.your_own_cable_up_up_front":"Your own cable: {up} up front, {mo}/mo, about {n} days to build.", +"lease_swaps.your_own_fiber_up_up_front":"Your own fiber: {up} up front, {mo}/mo, about {n} days to build.", +"link_modal.building_into_mainland_china_needs_a":"Building into mainland China needs a joint venture and an operating license. Open {city} to apply.", +"link_modal.cross_border_circuits_into_mainland":"Cross-border circuits into mainland China are sold only by licensed carriers, at 3× the price. Regular ones lose about 20% of traffic at the border.", +"link_modal.diverse_route_40_survives_cuts_alone":"Diverse route +40% · survives cuts alone", +"link_modal.diverse_route_n":"Diverse route {n}", +"link_modal.due_now_price":"due now {price}", +"link_modal.free_zone_license_included":"free-zone license included", +"link_modal.government_box_included":"government box included", +"link_modal.includes_a_new_pop_in_city":"Includes a new POP in {city} ({price}{extra}).", +"link_modal.lease_a_wave":"Lease a wave", +"link_modal.local_telecom_licence_included":"local telecom licence included", +"link_modal.needs_what_at_both_ends":"needs {what} at both ends", +"link_modal.new_diverse_route_40_survives_cuts":"New diverse route +40% · survives cuts alone", +"link_modal.no_subsea_cable_lands_in_both":"No subsea cable lands in both {a} and {b}. Cables from {a} reach {list}. Hop through one of those.", +"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.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 +60% · ~3% loss", +"link_modal.premium_crossings_are_only_sold_in":"Premium crossings are only sold in Hong Kong.", +"link_modal.same_trench_cheaper_one_backhoe_cuts":"Same trench cheaper · one backhoe cuts all", +"link_modal.sold_out_for_n_days":"sold out for {n} days", +"link_modal.the_landing_permit_dispute_in_city":"The landing permit dispute in {city} blocks new subsea links for {n} more days.", +"link_modal.waves_are_leased_at_a_flat":"Waves are leased at a flat monthly rate. Bigger and longer costs more, and subsea is 1.8×. First month is due now.", +"link_modal.waves_on_the_same_route_share":"Waves on the same route share its fate: one backhoe cuts them all.", +"link_modal.you_already_have_n_link_here":{"one":"You already have {n} link here ({list}). Parallel links add capacity. How should this one be routed?","other":"You already have {n} links here ({list}). Parallel links add capacity. How should this one be routed?"}, +"link_panels.a_bigger_fabric_carries_more_traffic":"A bigger fabric carries more traffic and has room for more members. Your router here still has to keep up.", +"link_panels.a_regen_site_turns_the_light":"A regen site turns the light back into bits halfway and sends it on fresh, so optics only have to reach the next site. Each needs a regen card for every lit channel. {price}/mo per site for the hut.", +"link_panels.abandon_the_fiber":"Abandon the fiber", +"link_panels.add_parallel_link":"Add parallel link", +"link_panels.apply_for_a_license_price_mo":"Apply for a license {price} + {mo}/mo · ~45 days", +"link_panels.back_in_n_days":"Back in {n} days.", +"link_panels.behind_the_great_firewall":"Behind the Great Firewall", +"link_panels.biggest_fabric_money_can_buy":"Biggest fabric money can buy.", +"link_panels.biggest_feeder_egress_in_city_set":"Biggest feeder: {egress} in {city}. Set it to “Backup only”, give the customers a closer egress (peering, a cache, local transit), or raise this link's metric.", +"link_panels.build_a_pop_here_first":"Build a POP here first.", +"link_panels.cancel_the_iru":"Cancel the IRU", +"link_panels.click_to_tear_down":"Click to tear down", +"link_panels.collecting_data_check_back_in_a":"Collecting data. Check back in a few days.", +"link_panels.congested_upgrade_it_or_add_a":"Congested. Upgrade it or add a parallel path.", +"link_panels.dark_fiber_kind_km_km":"Dark fiber · {kind} · {km} km", +"link_panels.de_kicks_personalised_pricing_p_of":"DE-KICKS personalised pricing: {p}% of what a normal IX would charge (promo, {n} days left).", +"link_panels.de_kicks_personalised_pricing_p_of_3d4f":"DE-KICKS personalised pricing: {p}% of what a normal IX would charge.", +"link_panels.each_channel_is_a_pair_of":"Each channel is a pair of optics, one per end. ZR+ optics plug straight into your routers. Transponders sit on a shelf.", +"link_panels.enters_your_network_at":"Enters your network at", +"link_panels.finish_in_1_day_price":"Finish in 1 day {price}", +"link_panels.foreign_networks_need_a_local_joint":"Foreign networks need a local joint venture and an operating license to build infrastructure here.", +"link_panels.found_your_own_ix_cost_mo":"Found your own IX {cost} + {mo}/mo", +"link_panels.g_to_km_km":"{g} to {km} km", +"link_panels.giving_it_up_now_returns_price":"Giving it up now returns {price}.", +"link_panels.going_to_customers_in":"Going to customers in", +"link_panels.hire_extra_crews_price_30_days":"Hire extra crews {price} · −30 days", +"link_panels.ix_is_a_shared_switch_one":"{ix} is a shared switch. One port lets you peer with every member for free. Members: {list}.", +"link_panels.join_route_server":"Join route server", +"link_panels.keep_a_spares_kit_price_mo":"Keep a spares kit {price}/mo", +"link_panels.leave_route_server":"Leave route server", +"link_panels.license_paperwork_in_progress_n_days":"License paperwork in progress: {n} days left.", +"link_panels.list_it_with_a_capacity_broker":"List it with a capacity broker they keep 10%", +"link_panels.lose_exclusive_benefits":"Lose exclusive benefits?", +"link_panels.lost_on_the_way":"Lost on the way", +"link_panels.mainland_china_plays_by_its_own":"Mainland China plays by its own rules. {list} and other foreign services are blocked here, so users mostly reach Chinese networks. Traffic crossing the border loses about {pct} to filtering and congestion, unless it rides a premium route: CN-Too transit or a premium cross-border circuit (both sold only in Hong Kong), or a PNI with a Chinese network. Revenue per user is lower here.", +"link_panels.members_paying_you":"Members paying you", +"link_panels.n_amp_huts":"{n} amp huts", +"link_panels.n_amplifiers":"{n} amplifiers", +"link_panels.n_exchanges_compete_in_city_members":"{n} exchanges compete in {city}. Members overlap, but not completely, and the challengers undercut the incumbent. Small networks often sit on just one of them.", +"link_panels.n_lit":"{n} lit", +"link_panels.n_of_max_channels_lit":"{n} of {max} channels lit", +"link_panels.n_of_up_to_max_price":"{n} of up to {max} · {price}/mo", +"link_panels.n_optical_spans_of_km_km":"{n} · optical spans of {km} km", +"link_panels.n_regen_site_would_bring_it":{"one":"{n} regen site would bring it back to {g}.","other":"{n} regen sites would bring it back to {g}."}, +"link_panels.n_sold_as_alien_waves":"{n} sold as alien waves", +"link_panels.n_spare_on_the_shelf":{"one":"{n} spare on the shelf","other":"{n} spares on the shelf"}, +"link_panels.name_circuit":"{name} circuit", +"link_panels.name_fabric_level_lv":"{name} fabric level {lv}", +"link_panels.name_is_down_nothing_you_can":"{name} is down. Nothing you can do but wait, or have another path.", +"link_panels.name_parallel_link":"{name} parallel link", +"link_panels.name_wave":"{name} wave", +"link_panels.needs_a_pop_in_cities_too":"Needs a POP in {cities} too.", +"link_panels.needs_what":"needs {what}", +"link_panels.needs_your_own_scrubbing_center":"Needs your own scrubbing center (Infra tab).", +"link_panels.no_regen_sites_in_the_middle":"No regen sites in the middle of the ocean: long cables run their optics in long-haul mode.", +"link_panels.no_traffic_right_now":"No traffic right now.", +"link_panels.not_in_your_cities_yet_nearest":"Not in your cities yet. Nearest: {city}", +"link_panels.not_present_in_any_of_your":"Not present in any of your cities yet", +"link_panels.nothing_spare_to_sell_on_this":"Nothing spare to sell on this fiber right now.", +"link_panels.off_while_your_peering_policy_is":"Off while your peering policy is {pol}", +"link_panels.open_peer_but_not_on_any":"Open peer, but not on any IX where you have a POP. Nearest: {city}", +"link_panels.open_peer_but_not_on_any_bfbb":"Open peer, but not on any IX where you have a POP", +"link_panels.open_peer_join_the_route_server":"Open peer: join the route server at {ix}", +"link_panels.open_peer_join_the_route_server_01a1":"Open peer: join the route server at {ix} ({city})", +"link_panels.other_carriers_rent_what_you_do":"Other carriers rent what you do not use: alien waves on free channels of your line system, or on your own build a spare fiber pair in the trench.", +"link_panels.other_links_between_these_cities":"Other links between these cities:", +"link_panels.paid_peering_only_a_pni_costs":"Paid peering only: a PNI costs {price}/mo. Free from customer level {n}.", +"link_panels.paid_peering_only_a_pni_costs_921d":"Paid peering only: a PNI costs {price}/mo", +"link_panels.peers_with_you_for_free_over":"Peers with you for free over a PNI. You got too big to charge.", +"link_panels.permits_trenching_splicing":"Permits, trenching, splicing", +"link_panels.plus_n_small_network":{"one":", plus {n} small network","other":", plus {n} small networks"}, +"link_panels.pni_in_city_why":"PNI in {city}: {why}", +"link_panels.port_port_price":"{port} port {price}", +"link_panels.port_port_price_on_request":"{port} port Price on request ☎", +"link_panels.ports_at_p_of_the_usual":"Ports at {p}% of the usual price.", +"link_panels.ports_up_to_port_are_free":"Ports up to {port} are free.", +"link_panels.price_n_days":"{price} · {n} days", +"link_panels.ready_for_a_pni_in_city":"Ready for a PNI in {city}", +"link_panels.ready_in_n_days":"Ready in {n} days", +"link_panels.really_give_it_up":"Really give it up?", +"link_panels.regen_site_price":"+ Regen site {price}", +"link_panels.remote_peering_leg_into_ix":"Remote peering leg into {ix}.", +"link_panels.remote_port_via_a_reseller_1":{"one":"Remote port via a reseller: 1.5× price, 80% usable, and {n} member here refuse remote peers.","other":"Remote port via a reseller: 1.5× price, 80% usable, and {n} members here refuse remote peers."}, +"link_panels.request_all_n_willing_peers":"Request all {n} willing peers", +"link_panels.right_of_way_upkeep":"Right-of-way upkeep", +"link_panels.run_by_a_nonprofit_public_prices":"Run by a nonprofit. Public prices at a fraction of what other exchanges charge, and almost everyone is here.", +"link_panels.run_by_de_kicks_group_no":"Run by DE-KICKS Group. No public price list. Ask sales for a personalised quote and bring your haggling face.", +"link_panels.running_an_exchange_in_mainland":"Running an exchange in mainland China takes a different license entirely. Peer with Chinese networks over PNIs, or meet them in Hong Kong.", +"link_panels.runs_at_g_per_channel_on":"Runs at {g} per channel on this route (long-haul mode).", +"link_panels.runs_on_its_own_route_a":"Runs on its own route. A cut here leaves the other links up.", +"link_panels.sell_one_price":"Sell one {price}", +"link_panels.selling_spare_capacity":"Selling spare capacity", +"link_panels.shares_a_trench_with_n_other":{"one":"Shares a trench with {n} other link. One cut takes them all down.","other":"Shares a trench with {n} other links. One cut takes them all down."}, +"link_panels.spare_optics_and_amplifier_cards_on":"Spare optics and amplifier cards on the shelf turn multi-day hardware failures into one-day swaps.", +"link_panels.spare_price":"spare + {price}", +"link_panels.spares_bought_now_are_already_paid":"Spares bought now are already paid for when the next shortage hits.", +"link_panels.spares_kit_on":"Spares kit on ✓", +"link_panels.stock_a_spare_optic_price":"Stock a spare {optic} {price}", +"link_panels.sys_level_n":"{sys} level {n}", +"link_panels.there_s_no_ix_in_city":"There's no IX in {city} yet. Found one: networks join over time, pay you for ports, and peer with you for free.", +"link_panels.they_need_the_full_internet_your":"They need the full internet. Your reach is {pct}.", +"link_panels.this_fiber_is_dark_add_optics":"This fiber is dark. Add optics below to carry traffic.", +"link_panels.this_is_the_only_link_between":"This is the only link between these cities. Add a parallel one, or a path through another city.", +"link_panels.tier_1_only_a_pni_and":"Tier 1: only a PNI, and only once you are big enough for the Tier 1 club", +"link_panels.totals_for_all_n_links_between":"Totals for all {n} links between these cities.", +"link_panels.unplugged_optics_go_on_the_spares":"Unplugged optics go on the spares shelf and are used first next time.", +"link_panels.upgrade_fabric_to_name_cost_mo":"Upgrade fabric to {name} {cost} + {mo}/mo", +"link_panels.upgrade_to_sys_price":"Upgrade to {sys} {price}", +"link_panels.via_a_capacity_broker":"via a capacity broker", +"link_panels.virtual_circuit_name_km_km":"Virtual circuit · {name} · {km} km", +"link_panels.what_s_on_this_link":"What's on this link", +"link_panels.will_peer_at_ix_request_a":"Will peer at {ix}: request a session", +"link_panels.you_can_pre_install_optics_now":"You can pre-install optics now so it lights up the day it's ready.", +"link_panels.your_joint_venture_holds_an":"Your joint venture holds an operating license.", +"link_panels.your_own_build":"your own build", +"link_panels.your_own_fabric_name":"Your own fabric · {name}", +"link_panels.your_routers_pick_the_lowest_cost":"Your routers pick the lowest-cost path. Raise the metric to push traffic onto other paths. “Backup only” keeps it idle unless nothing else works. Applies to every link between these two cities.", +"link_panels.your_traffic_crossing_the_border":"Your traffic crossing the border", +"link_panels.your_wave_was_sold_before_the":"Your wave was sold before the cable owner re-engineered it, so it keeps running.", +"links.a_fab_fabric_unlocks_at_customer":"A {fab} fabric unlocks at customer level {lv}.", +"links.a_wave_wave_needs_need_at":"A {wave} wave needs {need} at both ends.", +"links.cancel_the_circuits_on_this_port":"Cancel the circuits on this port first.", +"links.circuit_up_in_59_seconds_vxc":"Circuit up in 59 seconds.
{vxc} over {fab}: {a} → {b}.", +"links.fab_port_is_up_in_city":"{fab} port is up in {city}.
Now order virtual circuits to other cities on their fabric.", +"links.fabric_port_in_city_is_full":"Fabric port in {city} is full.", +"links.fixed_what_resolved_early":"Fixed. {what} resolved early.", +"links.ix_now_runs_a_fab_fabric":"{ix} now runs a {fab} fabric.
Room for {max} members. Expect a few more to join.", +"links.name_is_called_off_the_cable":"{name} is called off.
The cable factory takes back the glass nobody needs: {price} back.", +"links.no_cable_available_for_that_route":"No cable available for that route right now.", +"links.no_wave_capacity_on_this_route":"No {wave} capacity on this route right now.
{why} Try a smaller wave, another route, or ask again in {n} days.", +"links.no_wave_waves_on_this_cable":"No {wave} waves on this cable.
{why}", +"links.not_enough_room_on_your_fab":"Not enough room on your {fab} port in {city}.", +"links.not_enough_room_on_your_fabric":"Not enough room on your fabric port. Upgrade it first.", +"links.now_grab_an_ix_port_there":"Now grab an IX port there for remote peering.", +"links.power_cycled_the_router_in_city":"Power-cycled.
The router in {city} is booting again. It will be up tomorrow, the {chip} willing.", +"links.too_many_circuits_for_a_smaller":"Too many circuits for a smaller port.", +"links.wave_lit":"{wave} lit!", +"links.you_founded_ix_networks_will_join":"You founded {ix}!
Networks will join over time and pay you for ports. Open members peer with you for free.", +"long_tail.a_fiber_co_op_for_one":"A fiber co-op for one valley. Every member owns a metre of cable.", +"long_tail.a_rich_mix_of_everything_the":"A rich mix of everything the fishermen brought in.", +"long_tail.a_thousand_tiny_social_networks_on":"A thousand tiny social networks on one rack.", +"long_tail.an_isp_run_from_the_back":"An ISP run from the back of a kebab shop. Late-night support is excellent.", +"long_tail.atlantic_canada_s_cable_company":"Atlantic Canada’s cable company, raised on lobster and long winters. Polite on the phone, a beast at the peering table.", +"long_tail.bermuda_s_phones_tv_and_internet":"Bermuda’s phones, TV and internet from one very busy office. Half its business customers are reinsurers, and they have priced in the Triangle.", +"long_tail.bunny_suits_mandatory_in_the_server":"Bunny suits mandatory in the server room.", +"long_tail.cable_broadband_for_half_of_britain":"Cable broadband for half of Britain. Fast on a good day.", +"long_tail.cape_verde_s_incumbent_and_the":"Cape Verde’s incumbent and the islands’ way out. Its CV lists every cable between Europe, Africa and Brazil, and it brings it up at every meeting.", +"long_tail.cheap_fast_and_open_late":"Cheap, fast and open late.", +"long_tail.cheap_filling_hosting_ask_for_the":"Cheap, filling hosting. Ask for the potato-and-cheese plan.", +"long_tail.colourful_crowded_and_gets_you_there":"Colourful, crowded and gets you there eventually.", +"long_tail.comes_alive_after_dark":"Comes alive after dark.", +"long_tail.cosy_racks_under_a_hill_second":"Cosy racks under a hill. Second breakfast at 11.", +"long_tail.covers_a_lot_of_empty_ground":"Covers a lot of empty ground.", +"long_tail.crispy_on_the_outside_cheap_on":"Crispy on the outside, cheap on the inside.", +"long_tail.delivered_fresh_every_morning":"Delivered fresh every morning.", +"long_tail.down_from_2_to_5_p":"Down from 2 to 5 p.m. every day. By design.", +"long_tail.dug_the_trench_themselves_one_field":"Dug the trench themselves, one field at a time.", +"long_tail.family_run_since_dial_up_still":"Family-run since dial-up. Still answers the phone.", +"long_tail.fiber_laid_along_the_bike_lanes":"Fiber laid along the bike lanes. Fastest in the rain.", +"long_tail.fiber_laid_under_the_tram_tracks":"Fiber laid under the tram tracks during a night shift.", +"long_tail.fiber_strung_along_the_chairlifts":"Fiber strung along the chairlifts. Seasonal latency.", +"long_tail.fiji_s_international_gateway_very":"Fiji’s international gateway. Very clever about where your traffic should go, as long as it goes through Suva.", +"long_tail.football_films_and_a_router_that":"Football, films and a router that looks like a spaceship.", +"long_tail.founded_after_a_pub_quiz_by":"Founded after a pub quiz, by the losing team.", +"long_tail.game_servers_energy_drinks_and_a":"Game servers, energy drinks and a ping obsession.", +"long_tail.gets_along_with_every_other_network":"Gets along with every other network. Famously chill.", +"long_tail.gold_plated_servers_valet_parking":"Gold-plated servers, valet parking for packets.", +"long_tail.guam_s_incumbent_and_the_way":"Guam’s incumbent and the way out for half of Micronesia. The prices are a heist, but nobody else is selling.", +"long_tail.guam_s_mobile_network_rice_a":"Guam’s mobile network: rice, a burger, a fried egg and lots of gravy, served over 5G.", +"long_tail.has_had_a_8_since_before":"Has had a /8 since before you were born.", +"long_tail.has_more_batteries_than_customers":"Has more batteries than customers.", +"long_tail.has_served_the_lake_since_1912":"Has served the lake since 1912. Now with fiber.", +"long_tail.hawaii_s_incumbent_every_plan_comes":"Hawaii’s incumbent. Every plan comes with two scoops of rice and a side of macaroni salad.", +"long_tail.hosting_for_every_family_restaurant":"Hosting for every family restaurant in the south.", +"long_tail.hosting_for_surfboard_shops_closed":"Hosting for surfboard shops. Closed when the waves are good.", +"long_tail.hosts_every_game_you_play_at":"Hosts every game you play at 2 a.m. Hates jitter.", +"long_tail.hosts_exactly_one_website_and_three":"Hosts exactly one website and three lawyers.", +"long_tail.internet_cafe_turned_isp_the_gamers":"Internet cafe turned ISP. The gamers came for the ping.", +"long_tail.it_takes_two_to_peer":"It takes two to peer.", +"long_tail.kept_the_lights_on_in_its":"Kept the lights on in its town through every blackout.", +"long_tail.korea_s_incumbent_sender_pays_every":"Korea’s incumbent. Sender pays: every gigabit you hand it is billed, on top of the port.", +"long_tail.lyrics_servers_low_latency_high":"Lyrics servers, low latency, high pitch.", +"long_tail.mountain_wireless_will_spit_at_bad":"Mountain wireless. Will spit at bad routes.", +"long_tail.norway_s_incumbent_neither_yes_nor":"Norway’s incumbent. Neither yes nor no, until you send enough traffic.", +"long_tail.only_comes_online_at_night":"Only comes online at night.", +"long_tail.packets_hop_sometimes_backwards":"Packets hop. Sometimes backwards.", +"long_tail.packets_leave_on_time_to_the":"Packets leave on time, to the second.", +"long_tail.palau_s_telco_snorkel_down_and":"Palau’s telco. Snorkel down and you can see the cable.", +"long_tail.papua_new_guinea_s_state_telco":"Papua New Guinea’s state telco: eight hundred languages, one billing system.", +"long_tail.phones_on_every_island_from_papua":"Phones on every island from Papua New Guinea to Tonga, and transit to sell on each one.", +"long_tail.powered_by_renewable_rodents_uptime":"Powered by renewable rodents. Uptime depends on snack schedule.", +"long_tail.racks_in_the_nave_cooling_in":"Racks in the nave, cooling in the crypt. Divine uptime.", +"long_tail.runs_the_post_the_phones_and":"Runs the post, the phones and the internet in New Caledonia and French Polynesia. Packets arrive stamped, with a croissant.", +"long_tail.runs_the_village_network_between":"Runs the village network between call-outs.", +"long_tail.rural_broadband_for_the_islands_one":"Rural broadband for the islands, one olive tree at a time.", +"long_tail.rural_fiber_that_follows_the_tractor":"Rural fiber that follows the tractor routes.", +"long_tail.samoa_s_broadband_promised_with_a":"Samoa’s broadband, promised with a slice of something sweet.", +"long_tail.servers_cooled_by_the_lake_then":"Servers cooled by the lake, then used to heat the sauna.", +"long_tail.slow_on_the_hills_fast_on":"Slow on the hills, fast on the flat.", +"long_tail.spicy_pricing_mild_latency":"Spicy pricing, mild latency.", +"long_tail.started_in_venice_upgraded_to_land":"Started in Venice. Upgraded to land.", +"long_tail.sweet_fuzzy_and_surprisingly":"Sweet, fuzzy and surprisingly reliable.", +"long_tail.ten_thousand_gpus_and_a_podcast":"Ten thousand GPUs and a podcast.", +"long_tail.the_marshall_islands_telco_two":"The Marshall Islands’ telco, two metres above the sea and proud of every centimetre.", +"long_tail.the_plus_is_a_usage_fee":"The plus is a usage fee. Paid peering, per gigabit.", +"long_tail.the_solomon_islands_incumbent_yours":"The Solomon Islands’ incumbent. Yours sincerely, eventually.", +"long_tail.the_telco_for_st_helena_ascension":"The telco for St Helena, Ascension and the Falklands. Is the link up? Pretty sure.", +"long_tail.the_uk_s_incumbent_buzzes_politely":"The UK’s incumbent. Buzzes politely, stings on price.", +"long_tail.thick_comforting_and_very_new":"Thick, comforting and very New England.", +"long_tail.three_hour_films_zero_second_start":"Three-hour films, zero-second start times.", +"long_tail.three_servers_one_dehumidifier_and_a":"Three servers, one dehumidifier and a very patient grandmother.", +"long_tail.tonga_s_own_telco_lived_through":"Tonga’s own telco. Lived through a volcano that cut its only cable, and jokes about it now.", +"long_tail.took_a_streaming_giant_to_court":"Took a streaming giant to court over who pays for the traffic its own customers asked for. Paid peering, per gigabit.", +"long_tail.utah_s_dipping_sauce_of_an":"Utah’s dipping-sauce of an ISP.", +"long_tail.voice_chat_for_millions_of_gamers":"Voice chat for millions of gamers who all talk at once.", +"long_tail.volunteers_with_rooftop_antennas_and":"Volunteers with rooftop antennas and strong opinions about IPv6.", +"long_tail.wi_fi_on_every_ferry_backhaul":"Wi-Fi on every ferry, backhaul on every bridge.", +"long_tail.wi_fi_on_minibuses_and_the":"Wi-Fi on minibuses, and the music is free.", +"long_tail.wireless_internet_from_the_top_of":"Wireless internet from the top of a grain silo.", +"long_tail.wireless_links_across_the_tundra":"Wireless links across the tundra. Antlers occasionally in the way.", +"long_tail.yee_haw_and_low_earth_orbit":"Yee-haw and low Earth orbit.", +"loop.australia_got_more_australian":"Australia got more Australian.
Transit there now costs three times the usual price, only carriers that really sell transit in Australia sell it, and Telstraya and Floptus only peer privately, so their exchange sessions have ended. Check your Australian POPs.", +"loop.new_networks_on_the_map_this":"New networks on the map.
This update added networks you are not connected to yet. For {n} days a free courtesy route reaches them, so your reach does not drop overnight. Peer with them, or buy transit, before it ends.", +"loop.something_in_the_noc_glitched_the":"Something in the NOC glitched.
The game kept going. If things look odd, export your save and open an issue on GitHub.", +"loop.welcome_back_name_your_network_is":"Welcome back, {name}.
Your network is right where you left it: {date}.", +"loop.your_saved_game_could_not_be":"Your saved game could not be loaded.
It was damaged, so a backup was kept and you can start fresh.", +"meet_a_network.all_n_out_of_reach":{"one":"All {n} out of reach","other":"All {n} out of reach"}, +"meet_a_network.pnis_with_every_tier_1":"PNIs with every Tier 1", +"meet_a_network.reach_without_transit":"Reach without transit", +"meet_a_network.road_to_tier_1":"Road to Tier 1", +"meet_a_network.tier_1s_only_take_a_pni":"Tier 1s only take a PNI from a network with {list}.", +"meet_a_network.transit_ports_to_cancel":"Transit ports to cancel", +"meet_a_network.where_to_meet_them":"Where to meet them", +"modal_and_names.join_the_noc_chat":"Join the NOC chat", +"modal_and_names.our_signal_group_swap_screenshots":"Our Signal group: swap screenshots, report bugs and argue about peering policy with other players. Fewer backhoes than the real thing.", +"modal_and_names.the_real_thing_by_thomas_kj":"The real thing, by Thomas Kjær Aabo: a zoomable, interactive map of how your packets actually travel, from Wi-Fi to undersea fiber, today, in 2010 and in 1995. This game makes it up as it goes. That one gets it right.", +"modal_and_names.the_real_thing_follow_a_packet":"The real thing: follow a packet from Wi-Fi to undersea fiber.", +"modals.lay_your_own_subsea_cable":"Lay your own subsea cable…", +"modals.your_own_subsea_cable_tier_1":"Your own subsea cable Tier 1 only", +"networks.a_mobile_network_named_after_the":"A mobile network named after the sound of a toast. Cheers to every 5G tower.", +"networks.a_spanish_carrier_starring_in_every":"A Spanish carrier starring in every Latin American market, at least until it sells the next one.", +"networks.a_tiny_telco_in_a_country":"A tiny telco in a country where the world’s cables come ashore. Prices to match.", +"networks.africa_s_mobile_giant_in_a":"Africa’s mobile giant, in a yellow you can see from orbit. Never actually empty.", +"networks.an_edge_cloud_that_is_despite":"An edge cloud that is, despite the name, quite fast.", +"networks.australia_s_big_one_g_day":"Australia’s big one. G’day, that will be nine dollars a megabit. Sorry, gigabit.", +"networks.australia_s_number_two_once_took":"Australia’s number two. Once took the whole country offline for twelve hours with a routine upgrade.", +"networks.beams_the_outback_online_from_550":"Beams the outback online from 550 km up, then lands it in a Sydney data centre like everyone else.", +"networks.bought_by_speedyloop_and_still":"Bought by Speedyloop, and still working out which name goes on the bill.", +"networks.brazil_s_mobile_giant_very_much":"Brazil’s mobile giant. Very much alive.", +"networks.bridges_europe_and_asia_and":"Bridges Europe and Asia, and occasionally your BGP table.", +"networks.cable_broadband_across_central":"Cable broadband across Central Europe. See you later, in a support queue.", +"networks.cable_broadband_for_half_of_america":"Cable broadband for half of America. Haunts your traceroutes.", +"networks.cables_all_around_the_caribbean":"Cables all around the Caribbean, served with a lot of foam.", +"networks.can_you_hear_me_now_only":"Can you hear me now? Only if you pay for the PNI.", +"networks.canada_s_cable_giant_held_together":"Canada’s cable giant, held together with duct tape. Now and then all of it goes down at once, which is at least consistent.", +"networks.cape_to_cairo_fiber_across_a":"Cape-to-Cairo fiber across a dozen borders. Sometimes over land, sometimes over budget.", +"networks.charges_a_lot_paid_peering_only":"Charges a lot. Paid peering only, and the name says it all.", +"networks.chat_games_and_payments_every":"Chat, games and payments. Every message costs ten cents.", +"networks.cheap_broadband_with_the_sales_pitch":"Cheap broadband with the sales pitch on a permanent loop.", +"networks.cheapest_transit_on_the_map_famously":"Cheapest transit on the map. Famously gentle, except during peering spats.", +"networks.ended_free_peering_across_europe_and":"Ended free peering across Europe and handed it to Inter.Clink, its “interconnection partner”, who will happily sell you a direct connection. Paid peering only, over a PNI. Ring ring, it’s the invoice.", +"networks.ethiopia_s_state_telco_a_hundred":"Ethiopia’s state telco: a hundred million customers and very calm about competition.", +"networks.fiber_across_the_sertao_of_the":"Fiber across the sertão of the Northeast, one dirt road at a time.", +"networks.fiber_to_the_italian_home_with":"Fiber to the Italian home, with a website from 2003.", +"networks.gave_a_billion_people_cheap_data":"Gave a billion people cheap data. Knows exactly where every one of them is.", +"networks.gigabit_to_every_flat_for_the":"Gigabit to every flat for the price of a coffee. Peers with anyone.", +"networks.greece_s_incumbent_takes_careful":"Greece’s incumbent. Takes careful notes on every peering request.", +"networks.grew_from_a_seedling_into_a":"Grew from a seedling into a global backbone. Leaves no route behind.", +"networks.half_of_the_flanders_duopoly_on":"Half of the Flanders duopoly, on coax. Keeps a tiny port at Frites-IX and hides behind its international parent, so bring a PNI.", +"networks.huge_eyeball_network_come_for_the":"Huge eyeball network. Come for the broadband, stay because there is no other choice.", +"networks.huge_in_asia_which_telecom_not":"Huge in Asia. \"Which telecom?\" \"Not that one.\"", +"networks.india_s_other_giant_every_outage":"India’s other giant. Every outage comes with a story.", +"networks.indonesia_s_mobile_giant_every":"Indonesia’s mobile giant. Every packet poses for a photo first.", +"networks.italy_s_incumbent_sweet_on_the":"Italy’s incumbent. Sweet on the outside, very firm about peering ratios.", +"networks.japanese_carrier_that_builds":"Japanese carrier that builds everything itself. Even the cable ships.", +"networks.juicy_reach_into_europe_and_africa":"Juicy reach into Europe and Africa.", +"networks.kenya_s_mobile_giant_pays_you":"Kenya’s mobile giant. Pays you in M-Pesos.", +"networks.luxembourg_s_post_office_which_also":"Luxembourg’s post office, which also runs the phones and most of the fiber. Your packets wait at the counter until somebody collects them.", +"networks.malaysia_s_incumbent_in_no_hurry":"Malaysia’s incumbent. In no hurry whatsoever.", +"networks.matching_outfits_perfect_harmonies":"Matching outfits, perfect harmonies, and they peer with absolutely everyone.", +"networks.mexico_s_giant_paid_peering_only":"Mexico’s giant. Paid peering only, and the pricing is a mess.", +"networks.mobile_money_and_prepaid_data_in":"Mobile money and prepaid data in fourteen countries. Tells you so with every top-up.", +"networks.morocco_s_incumbent_with_sister":"Morocco’s incumbent, with sister networks down the West African coast. Carries the weight without complaint.", +"networks.new_zealand_s_shiniest_isp":"New Zealand’s shiniest ISP.", +"networks.nordic_backbone_that_tells_you":"Nordic backbone that tells you exactly where your packets went.", +"networks.now_you_see_the_fibre_now":"Now you see the fibre, now you don’t.", +"networks.number_two_in_china_with_a":"Number two in China, with a horn for every backbone.", +"networks.owns_the_cable_that_brought_east":"Owns the cable that brought East Africa online, and sells you the capacity with a straight face.", +"networks.owns_the_cables_from_luanda_to":"Owns the cables from Luanda to Brazil, and always finds an angle on the deal.", +"networks.owns_the_land_crossing_every_red":"Owns the land crossing every Red Sea cable needs. Collects tolls like a pharaoh.", +"networks.pakistan_s_incumbent_every_session":"Pakistan’s incumbent. Every session comes with a firewall rule.", +"networks.peers_with_anyone_and_wants_to":"Peers with anyone, and wants to know everything about your routes.", +"networks.philippine_giant_peering_requests":"Philippine giant. Peering requests are reviewed over a cup of tea.", +"networks.pink_eyeball_giant_peering_is":"Pink eyeball giant. Peering is available... for a monthly fee.", +"networks.polite_enormous_and_sorry_about_the":"Polite, enormous, and sorry about the bill.", +"networks.portugal_s_incumbent_purrs_when_you":"Portugal’s incumbent. Purrs when you send it traffic.", +"networks.prepaid_mobile_from_paraguay_to":"Prepaid mobile from Paraguay to Guatemala, with a logo that roars.", +"networks.private_5g_and_business_fiber_from":"Private 5G and business fiber from Oostkamp. Its traffic arrives in sudden industrial bursts.", +"networks.proxyminus_s_wholesale_arm_present":"Proxyminus’s wholesale arm. Present at nearly every exchange on Earth, and Belgian about it.", +"networks.qatar_s_big_operator_paid_peering":"Qatar’s big operator. Paid peering only, and it sings the price list to you.", +"networks.says_oi_to_every_home_in":"Says “oi” to every home in Brazil. The fiber is great, the balance sheet is still recovering.", +"networks.search_maps_and_a_cheerful_goodbye":"Search, maps and a cheerful goodbye.", +"networks.search_taxis_and_maps_slightly":"Search, taxis and maps. Slightly sleepy.", +"networks.search_video_and_goggles_mostly":"Search, video and goggles. Mostly goggles.", +"networks.shields_half_the_web_from_crowds":"Shields half the web from crowds of bots. The Rackstar Partner Program (RPP) puts a cache in your rack once you send enough traffic.", +"networks.ships_parcels_and_packets_both":"Ships parcels and packets, both overnight.", +"networks.shopping_festivals_that_melt_traffic":"Shopping festivals that melt traffic graphs.", +"networks.short_videos_very_long_traffic":"Short videos, very long traffic graphs.", +"networks.sings_your_packets_across_asia":"Sings your packets across Asia-Pacific.", +"networks.small_fast_and_always_leaping_to":"Small, fast and always leaping to the next deal. Ribbit.", +"networks.social_media_everyone_keeps_falling":"Social media. Everyone keeps falling for it.", +"networks.social_network_with_perfect_vision":"Social network with perfect vision.", +"networks.speedy_by_name_owns_a_slice":"Speedy by name. Owns a slice of the cable to Singapore and keeps buying smaller ISPs.", +"networks.stockpiled_bandwidth_in_2020_and":"Stockpiled bandwidth in 2020 and still has a few rolls left.", +"networks.streams_40_of_evening_traffic_hands":"Streams 40% of evening traffic. Hands out free caches if you send enough eyeballs.", +"networks.taiwan_s_incumbent_stays_calm_while":"Taiwan’s incumbent. Stays calm while ships drag their anchors over its cables.", +"networks.tangerine_s_belgian_daughter_mobile":"Tangerine’s Belgian daughter: mobile, cable and a lot of Walloon highway dark fiber. Zesty.", +"networks.telstraya_s_budget_brand_cheaper":"Telstraya’s budget brand. Cheaper, cheerier, and it still won’t peer with you.", +"networks.thailand_s_mobile_giant_its_coverage":"Thailand’s mobile giant. Its coverage maps are mostly true.", +"networks.the_big_regional_carrier_sees":"The big regional carrier. Sees everything clearly, especially your invoice.", +"networks.the_biggest_network_in_china_its":"The biggest network in China. Its CN-Too premium route skips the congested border, for a price.", +"networks.the_cheapest_plan_in_the_country":"The cheapest plan in the country. Smells like a bargain.", +"networks.the_cloud_it_s_just_someone":"The cloud. It's just someone else's Ashburn.", +"networks.the_kingdom_s_incumbent_once_you":"The Kingdom’s incumbent. Once you are in, you stay in.", +"networks.the_largest_mobile_network_on_earth":"The largest mobile network on Earth. Paid peering only.", +"networks.the_national_carrier_every_punchline":"The national carrier. Every punchline is pre-approved.", +"networks.the_original_cdn_maybe_it_is":"The original CDN. Maybe it is already in your rack.", +"networks.the_other_half_of_the_duopoly":"The other half of the duopoly, on copper and fiber. Strictly domestic: the world reaches it through its wholesale arm.", +"networks.the_other_half_of_the_uae":"The other half of the UAE duopoly. Does what Etis-a-lot does, in a different colour.", +"networks.the_tier_1_that_grew_up":"The Tier 1 that grew up in Sicily. Its Seabone backbone owns the Mediterranean and reaches deep into the Americas, and it still calls Palermo home.", +"networks.ukraine_s_biggest_mobile_network_has":"Ukraine’s biggest mobile network. Has kept working through things most networks never have to plan for.", +"networks.updates_so_many_updates":"Updates. So many updates.", +"networks.uruguay_s_state_telco_fast":"Uruguay’s state telco. Fast, everywhere, and a little proud of it.", +"networks.vietnam_s_giant_will_tell_you":"Vietnam’s giant. Will tell you which subsea cable is broken this week.", +"networks.waves_goodbye_to_latency_across_the":"Waves goodbye to latency across the Indian Ocean.", +"networks.western_canada_s_incumbent_tell_us":"Western Canada’s incumbent. Tell us what you need, and we will tell you the price.", +"networks.will_peer_with_anyone_anywhere":"Will peer with anyone, anywhere. Rumored to mail out IPv6 cakes.", +"notifications.last_10_minutes":"last 10 minutes", +"notifications.n_min_ago":{"one":"{n} min ago","other":"{n} min ago"}, +"notifications.nothing_in_the_last_10_minutes":"Nothing in the last 10 minutes.", +"notifications.show_all_n":"Show all {n}", +"own_cable.a_and_b":"{a} and {b}", +"own_cable.a_fishing_fleet_is_trawling_exactly":"A fishing fleet is trawling exactly where you need to lay.", +"own_cable.a_leased_wave_wave_on_this":"A leased {wave} wave on this route costs {price}/mo.", +"own_cable.a_whale_has_parked_on_the":"A whale has parked on the route and will not move.", +"own_cable.about_n_days":"about {n} days", +"own_cable.city_has_no_cable_landing_station":"{city} has no cable landing station.", +"own_cable.cuts_still_happen_anchors_and_sharks":"Cuts still happen, anchors and sharks included, but the repair ship is yours to call.", +"own_cable.km_km_is_more_than_any":"{km} km is more than any optic can light, even on the best subsea gear ({max} km at most). Real cables stop at an island or a landing station on the way: lay two shorter ones.", +"own_cable.km_km_is_too_far_for":"{km} km is too far for your optics on their own. Add {what} to light this cable.", +"own_cable.km_km_of_seabed":"{km} km of seabed", +"own_cable.lay_the_cable_price":"Lay the cable {price}", +"own_cable.laying_your_own_subsea_cable_is":"Laying your own subsea cable is a Tier 1 thing. Go transit-free first.", +"own_cable.n_days":"+{n} days", +"own_cable.n_in_the_cable_the_first":"{n} in the cable, the first one lit", +"own_cable.no_navigable_sea_route_connects":"No navigable sea route connects these landing stations.", +"own_cable.nobody_gives_a_foreign_network_a":"Nobody gives a foreign network a landing licence in mainland China.", +"own_cable.replace_16_tbps_of_them_and":"Replace 16 Tbps of them and the cable pays for itself in about {n} months.", +"own_cable.storm_season_the_ship_is_sheltering":"Storm season. The ship is sheltering in port, playing cards.", +"own_cable.surveying_a_sea_route":"Surveying a sea route…", +"own_cable.the_cable_ship_s_coffee_machine":"The cable ship’s coffee machine broke. Nobody works without coffee.", +"own_cable.the_crew_fished_out_somebody_else":"The crew fished out somebody else’s cable by mistake and has to put it back.", +"own_cable.the_seabed_survey_found_an_old":"The seabed survey found an old sea mine. A small, very careful detour.", +"own_cable.this_design_s_route_is_km":"This design’s route is {km} km: too long for any optics, even with both upgrades. A shorter design can make it.", +"own_cable.this_route_is_on_land_build":"This route is on land. Build your own fiber instead.", +"own_cable.your_very_own_subsea_cable_a":"Your very own subsea cable. A ship lays it across the seabed, you own every fiber pair in it, and nobody else’s waves share your glass. It costs a frankly rude amount of money and takes a long time.", +"page.a_free_cartoon_browser_game_about":"A free cartoon browser game about how the internet works. Start as a tiny network in one city, launch home broadband, buy IP transit from Tier 1 and Tier 2 carriers, peer at internet exchanges, set up private interconnects and embedded CDN caches, and lay terrestrial fiber, subsea waves and your own dark fiber with DWDM and ZR optics. Sign enterprise, hosting, high-frequency trading, AI GPU and hyperscaler customers, and keep them happy while backhoes, sharks, fat fingers, route leaks, DDoS attacks and geopolitics break things.", +"page.breaking_cve_2026_31337_in_php":"🐘 BREAKING: CVE-2026-31337 IN PHP TAKES DOWN HALF THE INTERNET", +"page.cash_and_bank":"Cash and bank", +"page.every_wordpress_ish_site_on_earth":"Every WordPress-ish site on Earth is now a crypto miner", +"page.eyeball_traffic_down_30":"Eyeball traffic down 30%", +"page.hosting_customers_patching_at_3_a":"Hosting customers patching at 3 a.m.", +"page.network_menu_save_load_or_start":"Network menu: save, load or start over", +"page.security_team_asks_are_we_on":"Security team asks: “are we on PHP?” Everyone: “define we”", +"page.series_of_tubes_build_the_internet":"Series of Tubes: build the internet, one tube at a time", +"page.world_map_of_your_network":"World map of your network", +"page.x":"", +"peering_inbox.accept_all_requests":"Accept all requests", +"peering_inbox.an_ai_agent_that_answers_every":"An AI agent that answers every peering request and max-prefix alert for you, every day. {price}/year. Trained on twenty years of peering mailing lists.", +"peering_inbox.answered_your_mail_a_accepted_d":"Answered your mail: {a} accepted, {d} declined.", +"peering_inbox.asked_netchill_s_peering_team_to":"Asked NetChill’s peering team to “please provide more Netchill”.", +"peering_inbox.configured_lim_prefixes_received_got":"Configured: {lim} prefixes. Received: {got}.", +"peering_inbox.day_d":"Day {d}", +"peering_inbox.dear_sir_or_madam_please_peer":"Dear Sir or Madam, please peer. We have three prefixes and very big plans.", +"peering_inbox.decline_all_requests":"Decline all requests", +"peering_inbox.declined_who_at_ix_not_a":"Declined {who} at {ix}: “not a strategic fit”. They were.", +"peering_inbox.every_exchange_port_brings_mail":"Every exchange port brings mail. Answer peering requests, and look at sessions that hit their max-prefix limit: is it growth, or a route leak? Unanswered mail gets you a reputation, and selective networks hear about it.", +"peering_inbox.everyone_who_asks_gets_a_session":"Everyone who asks gets a session, and the route servers work. Lots of tiny peers, and lots of max-prefix alerts.", +"peering_inbox.fewer_requests_and_you_answer_them":"Fewer requests, and you answer them yourself. No route servers: go to each exchange and request the networks you want.", +"peering_inbox.fire_the_ai":"Fire the AI", +"peering_inbox.good_call_it_was_a_route":"Good call: it was a route leak.
{who} found a fat-fingered route map. The session comes back on its own in a few days.", +"peering_inbox.greetings_we_are_a_fast_growing":"Greetings. We are a fast-growing network. Last year we had one customer; this year we have two.", +"peering_inbox.hello_please_find_attached_our":"Hello, please find attached our peering request as a Word document, scanned from a printout.", +"peering_inbox.hey_quick_one_can_you_peer":"Hey, quick one: can you peer with us at {ix}? We have a very important Minecraft server.", +"peering_inbox.hi_we_would_like_to_peer":"Hi! We would like to peer with you at {ix}. Our PeeringDB record is up to date.", +"peering_inbox.hire_it_mo_mo":"Hire it {mo}/mo", +"peering_inbox.inbox_zero_enjoy_it_while_it":"Inbox zero. Enjoy it while it lasts.", +"peering_inbox.keep_it_down":"Keep it down", +"peering_inbox.kept_who_down_at_ix_for":"Kept {who} down at {ix} for “suspicious growth”. They had grown by one customer.", +"peering_inbox.kept_who_down_at_ix_it":"Kept {who} down at {ix}: it was a route leak. Nailed it.", +"peering_inbox.large_peering_model":"Large Peering Model", +"peering_inbox.large_peering_model_is_answering":"Large Peering Model is answering your mail", +"peering_inbox.max_prefix_limit_hit_who_at":"Max-prefix limit hit: {who} at {ix}.
The session is down until you look at it.", +"peering_inbox.max_prefix_limit_hit_who_at_5c56":"Max-prefix limit hit: {who} at {ix}", +"peering_inbox.mostly_ignores_email":"Mostly ignores email", +"peering_inbox.n_day_ago":{"one":"{n} day ago","other":"{n} days ago"}, +"peering_inbox.n_unanswered":{"one":"{n} unanswered","other":"{n} unanswered"}, +"peering_inbox.no_mail_yet_buy_an_ix":"No mail yet. Buy an IX port and it will come.", +"peering_inbox.nobody_asks_and_no_route_servers":"Nobody asks, and no route servers. Customers hear that you are hard to reach, so fewer of them call, and your reputation sinks.", +"peering_inbox.open_to_all":"Open to all", +"peering_inbox.opened_a_ticket_with_itself_to":"Opened a ticket with itself to review its own decisions. It approved them.", +"peering_inbox.peering_request_fifth_attempt_is":"Peering request, fifth attempt. Is anyone there?", +"peering_inbox.peeringdb_last_updated_n_year_ago":{"one":"PeeringDB last updated {n} year ago","other":"PeeringDB last updated {n} years ago"}, +"peering_inbox.peeringdb_updated_last_month":"PeeringDB updated last month", +"peering_inbox.please_configure_sessions_with_us_at":"Please configure sessions with us at {ix}. We will do ours next week, or the week after.", +"peering_inbox.price_year_it_never_sleeps_never":"{price}/year. It never sleeps, never complains and is often wrong.", +"peering_inbox.raise_all_max_prefix_limits":"Raise all max-prefix limits", +"peering_inbox.raise_the_limit":"Raise the limit", +"peering_inbox.raised_the_max_prefix_limit_for":"Raised the max-prefix limit for {who} at {ix} to {n}. They seemed nice.", +"peering_inbox.raised_the_max_prefix_limit_for_7b4b":"Raised the max-prefix limit for {who} at {ix}. Correctly, this time.", +"peering_inbox.replied_to_a_peering_request_with":"Replied to a peering request with a haiku about BGP. No answer yet.", +"peering_inbox.session_with_who_is_back_up":"Session with {who} is back up.
New limit: {n} prefixes. They promise to update PeeringDB.", +"peering_inbox.signed_you_up_for_a_webinar":"Signed you up for a webinar on “Peering in the Age of AI”.", +"peering_inbox.that_was_a_route_leak_who":"That was a route leak.
{who} was announcing {n} prefixes: a full table. Next time, keep it down.", +"peering_inbox.the_session_stays_down_who_will":"The session stays down.
{who} will update PeeringDB and ask again. Eventually.", +"peering_inbox.their_peeringdb_says_lim_last":{"one":"Their PeeringDB says {lim}, last updated {n} year ago.","other":"Their PeeringDB says {lim}, last updated {n} years ago."}, +"peering_inbox.tidied_up_a_session_it_decided":"Tidied up a session it decided was unused: de-peered {who} at {ix}.", +"peering_inbox.updated_your_peeringdb_record_your":"Updated your PeeringDB record. Your NOC phone number is now a pizza place.", +"peering_inbox.we_noticed_you_are_at_ix":"We noticed you are at {ix}. So are we. Shall we?", +"peering_inbox.who_asked_a_mailing_list_whether":"{who} asked a mailing list whether anyone has a working contact at {me}.
Their peering request sat in your inbox for a month.", +"peering_inbox.who_at_ix_was_sending_a":"{who} at {ix} was sending a full table, and the max-prefix limit was the only thing stopping it. With the limit raised, {net}’s prefixes point at their basement. Traffic to {net} over transit is black-holed for a few days.", +"peering_inbox.wrote_a_thousand_word_apology_to":"Wrote a thousand-word apology to a network you never peered with.", +"peering_policy.a_new_vp_wants_to_monetise":"A new VP wants to \"monetise interconnection\" in this market.", +"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.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.", +"peering_policy.price_war_in_city_ix_cut":"Price war in {city}!
{ix} cut its port prices 10% to stop members drifting to {rival}. Your invoice just got smaller.", +"peering_policy.region_frozen_while_they_renegotiate":"Region frozen while they renegotiate with the local incumbent.", +"peering_policy.remote_peering_is_a_last_resort":"Remote peering is a last resort. Ports come through a reseller at 1.5× the price, only 80% of the port is really yours, latency rides the fabric, one fabric outage drops every session, and many selective networks refuse remote members. A POP here is better.", +"peering_policy.rival_is_poaching_de_kicks_members":"{rival} is poaching DE-KICKS members in {city}.
DE-KICKS responded with a webinar about \"the value of premium interconnection\". Prices unchanged.", +"peering_policy.saw_your_session_come_in_over":"Saw your session come in over a fabric and said \"we can smell the VXC from here\".", +"peering_policy.the_peering_coordinator_for_this":"The peering coordinator for this city is on a six-month sabbatical.", +"peering_policy.their_ix_port_here_is_full":"Their IX port here is full until the next upgrade. They promise it is soon.", +"peering_policy.their_lawyers_are_reviewing_every":"Their lawyers are reviewing every peering agreement in this country. Again.", +"peering_policy.their_pearingdb_entry_says_remote":"Their PearingDB entry says \"Remote peering: No (we mean it)\".", +"peering_policy.their_policy_here_says_ix_peering":"Their policy here says \"IX peering by invitation only\". You were not invited.", +"peering_policy.their_routers_in_this_city_are":"Their routers in this city are \"at capacity\". They are not.", +"peering_policy.tried_a_remote_peer_once_it":"Tried a remote peer once. It flapped during a product launch. Never again.", +"pnis.a_new_region_is_coming_online":"A new region is coming online soon. It has been coming online soon since 2019.", +"pnis.about_n_days_to_go_nothing":"About {n} days to go. Nothing to do but wait, or chase it.", +"pnis.augment_with_net_delivered_in_city":"Augment with {net} delivered in {city}.
Now {port}.", +"pnis.cancel_the_order":"Cancel the order", +"pnis.delivery_2_to_6_weeks":"Delivery: 2 to 6 weeks", +"pnis.delivery_about_a_month_sometimes_6":"Delivery: about a month, sometimes 6 to 12 months", +"pnis.no_capacity_in_us_east_you":"No capacity in US East. You can join the waitlist; the waitlist is also out of capacity.", +"pnis.pni_with_net_is_up_in":"PNI with {net} is up in {city}.
A cross-connect in {dc}. Private and fast.", +"pnis.ready_in_about_n_days":"Ready in about {n} days", +"pnis.their_peering_team_says_us_east":"Their peering team says US East is “capacity constrained”, which is cloud for “no”.", +"pnis.their_team_quotes_m_months":"Their team quotes {m} months", +"pnis.us_east_is_sold_out_until":"US East is sold out until further notice. Further notice is also sold out.", +"pops_transit_ix.40_off_for_6_months":"40% off for 6 months", +"pops_transit_ix.40_off_ix_for_6_months":"40% off {ix} for 6 months.
Your account manager is relieved. Read the small print later.", +"pops_transit_ix.after_consulting_with_management_the":"\"After consulting with management…\"
The price went up. Management was consulted.", +"pops_transit_ix.after_that_the_normal_price_returns":"After that, the normal price returns, plus a small loyalty administration fee.", +"pops_transit_ix.augment_ordered_with_net_eta":"Augment ordered with {net}.
{eta}.", +"pops_transit_ix.de_kicks_group_customer_success":"DE-KICKS Group · Customer Success", +"pops_transit_ix.de_kicks_sales_is_still_aligning":"DE-KICKS sales is still \"aligning\".
They will get back to you in {n} days.", +"pops_transit_ix.de_kicks_will_circle_back_expect":"DE-KICKS will \"circle back\".
Expect an email titled \"Quick question 🙂\" within the hour.", +"pops_transit_ix.haggling_paused_why":"Haggling paused.
{why}", +"pops_transit_ix.just_this_once_your_account_manager":"\"Just this once.\"
Your account manager found a special discount. Do not tell the others.", +"pops_transit_ix.lag_member_added_net_in_city":"LAG member added.
{net} in {city} is now {lag}.", +"pops_transit_ix.lag_member_removed":"LAG member removed.", +"pops_transit_ix.net_transit_is_live_in_city":"{net} transit is live in {city}.
Full table received: ~1,000,000 routes.", +"pops_transit_ix.no_transit_in_this_scenario_peering":"No transit in this scenario.
Peering, PNIs, caches and your own fiber only.", +"pops_transit_ix.opted_out_of_name_it_took":"Opted out of {name}.
It took four clicks, a survey and a \"we're sad to see you go\" page.", +"pops_transit_ix.port_up_at_ix_now_request":"Port up at {ix}!
Now request peering, or join the route server.", +"pops_transit_ix.remote_port_up_at_ix_it":"Remote port up at {ix}.
It came through a reseller, so expect a markup, a crowded port and some networks that won't talk to you. The route server is your friend here.", +"pops_transit_ix.route_server_session_up_you_now":"Route server session up.
You now peer with every open network on this IX, in one go.", +"pops_transit_ix.router_installed_in_city_the_vendor":"Router installed in {city}.
The vendor shipped it the right way up, so the local techs turned it over. Everything else here is upside down too.", +"pops_transit_ix.router_installed_in_city_upside_down":"Router installed in {city}.
Upside down, as is customary down here. The packets don’t seem to mind.", +"pops_transit_ix.signed_with_de_kicks_welcome_to":"Signed with DE-KICKS.
Welcome to the family. Please don't tell anyone what you pay.", +"pops_transit_ix.stay_take_the_discount":"Stay, take the discount", +"pops_transit_ix.wait_before_you_go":"Wait! Before you go…", +"pops_transit_ix.we_value_our_partnership_too_much":"We value our partnership too much to let a little thing like price get in the way.", +"pops_transit_ix.you_need_a_license_first_foreign":"You need a license first.
Foreign networks need a joint venture to build in mainland China.", +"ports.a_fibre_here_uses_optics_this":"A fibre here uses optics this model cannot take.", +"ports.a_port_here_is_bigger_than":"A port here is bigger than {pn}.", +"ports.a_wave_here_is_faster_than":"A wave here is faster than {pn}.", +"ports.no_free_router_ports_in_city":"No free router ports in {city}.
{u} of {m} in use. Add a router, or swap to a model with more ports (Infra tab).", +"ports.you_use_u_ports_here_and":"You use {u} ports here and {r} × {model} only has {max}.", +"progress.1_6t_on_every_hop_from":"1.6T on every hop from Los Angeles to Sydney", +"progress.1_6t_on_every_hop_from_a90b":"1.6T on every hop from Miami to Madrid", +"progress.1_6t_on_every_hop_from_da01":"1.6T on every hop from Lisbon to Lagos", +"progress.a_path_from_cape_town_to":"A path from Cape Town to Cairo", +"progress.a_path_from_los_angeles_to":"A path from Los Angeles to Tokyo", +"progress.a_path_from_marseille_to_singapore":"A path from Marseille to Singapore", +"progress.a_port_on_ix_brrr_manaus":"A port on IX.brrr Manaus", +"progress.broadband_in_city":"Broadband in {city}", +"progress.carnaval_delivered_in_full":"Carnaval delivered in full", +"progress.customer_level_lv_of_max":"Customer level {lv} of {max}", +"progress.days_in_a_row_at_g":"Days in a row at {g} or more", +"progress.days_in_a_row_with_99":"Days in a row with 99.5% served", +"progress.done_in_d_days":"Done in {d} days!", +"progress.floods_that_got_through":"Floods that got through", +"progress.ix_brrr_ports":"IX.brrr ports", +"progress.n_of_m":"{n} of {m}", +"progress.next_name_unlocks_what":"Next: {name} unlocks {what}", +"progress.not_tier_1_right_now_why":"Not Tier 1 right now: {why}.", +"progress.pop_in_city":"POP in {city}", +"progress.terabit_floods_held":"Terabit floods held", +"progress.under_attack_now":"Under attack now", +"progress.your_score_peak_traffic":"Your score: peak traffic", +"progress.your_traffic_to_and_from_asia":"Your traffic to and from Asia", +"reach_and_subsea.premium_submarine_terminals":"Premium submarine terminals", +"release_notes.and_n_more_change":{"one":"…and {n} more change","other":"…and {n} more changes"}, +"release_notes.read_the_full_notes_on_github":"Read the full notes on GitHub", +"release_notes.series_of_tubes_v_is_out":"Series of Tubes {v} is out!", +"release_notes.your_game_is_saved_automatically":"Your game is saved automatically.", +"requirements.a_spare_fiber_pair_in_your":"a spare fiber pair in your {a}–{b} trench", +"requirements.afraid_of_sharks_needs_a_path":"Afraid of sharks: needs a path with no subsea cable", +"requirements.backup_generator_in_every_city_they":"Backup generator in every city they touch", +"requirements.comes_in_over_fab_needs_your":"Comes in over {fab}: needs your {fab} port in {city} with room for {bw}", +"requirements.insists_on_two_routers_in_their":"Insists on two routers in their city", +"requirements.ipv6_or_bust_you_must_peer":"IPv6 or bust: you must peer with Drizzle Electric", +"requirements.local_breakout_transit_or_an_ix":"Local breakout: transit or an IX port in their own city, or a local PNI while Tier 1", +"requirements.n_400g_alien_wave_on_your":{"one":"{n}× 400G alien wave on your {a}–{b} fiber","other":"{n}× 400G alien waves on your {a}–{b} fiber"}, +"requirements.needs_low_loss_reach_into_china":"Needs low-loss reach into China", +"requirements.one_way_latency_within_max_ms":"One-way latency within {max} ms (best now: {best})", +"requirements.refuses_cogentle_transit_anywhere_on":"Refuses Cogentle transit anywhere on your network (long story)", +"requirements.their_ceo_hates_puns_please_do":"Their CEO hates puns. Please do not mention the network names.", +"requirements.two_data_centers_in_every_metro":"Two data centers in every metro they touch", +"requirements.two_paths_that_share_no_trench":"Two paths that share no trench or fabric", +"requirements.wants_a_scrubbing_center_on_its":"Wants a scrubbing center on its own continent, so attacks are not hauled across an ocean", +"requirements.wants_netchill_on_net_a_cache":"Wants NetChill on-net: a cache or a PNI", +"requirements.wants_two_different_transit":"Wants two different transit providers (or none at all)", +"requirements.will_only_sign_with_a_network":"Will only sign with a network that runs a DDoS scrubbing center", +"rival_exchanges.a_community_exchange_in_a_hudson":"A community exchange in a Hudson Street basement. Schmear not included.", +"rival_exchanges.a_community_exchange_run_from_above":"A community exchange run from above a cider bar. Tiny, cheap, and every member gets a glass.", +"rival_exchanges.a_smaller_commercial_exchange_down":"A smaller commercial exchange down the road from DE-KICKS. Publishes its prices on one web page, which DE-KICKS considers an act of war. Ports come without a sales webinar.", +"rival_exchanges.dense_filling_and_very_cheap":"Dense, filling and very cheap.", +"rival_exchanges.every_session_comes_with_a_coffee":"Every session comes with a coffee break. Strictly enforced.", +"rival_exchanges.grilled_ports_served_with_mustard":"Grilled ports, served with mustard and a cold beer.", +"rival_exchanges.layered_resilient_and_somehow_always":"Layered, resilient and somehow always open.", +"rival_exchanges.lots_of_small_sessions_on_little":"Lots of small sessions on little plates.", +"rival_exchanges.member_owned_and_not_for_profit":"Member-owned and not-for-profit. Smaller than LYNX, but the AGM has biscuits.", +"rival_exchanges.mumbai_s_street_food_exchange_fast":"Mumbai’s street-food exchange. Fast, spicy and cheap.", +"rival_exchanges.one_fabric_across_the_whole_country":"One fabric across the whole country. Distributed, cheap and a little smug about it.", +"rival_exchanges.open_faced_cheap_and_available_at":"Open-faced, cheap and available at 3 a.m.", +"rival_exchanges.opens_at_six_comes_with_free":"Opens at six, comes with free snacks, closes when the last session drops.", +"rival_exchanges.run_by_hackers_on_caffeine_the":"Run by hackers on caffeine. The route server has a disco ball.", +"rival_exchanges.settlement_free_peering_with_frysian":"Settlement-free peering with Frysian roots. The 10G and 100G ports cost nothing. Bring an ASN and an appetite for route servers. Mayonnaise is extra.", +"rival_exchanges.started_in_somebody_s_garage_like":"Started in somebody’s garage, like everything else round here.", +"rival_exchanges.strong_sweet_and_cheaper_than_the":"Strong, sweet and cheaper than the incumbent.", +"rival_exchanges.takes_forever_to_set_up_but":"Takes forever to set up, but very filling.", +"rival_exchanges.the_challenger_fresh_every_morning_a":"The challenger. Fresh every morning, a bit crusty by the evening.", +"rival_exchanges.the_challenger_to_ix_straya_pops":"The challenger to IX Straya. Pops up at the edge of every city, including the ones nobody else bothers with. An acquired taste, like Vegemite.", +"rival_exchanges.the_challenger_to_the_de_kicks":"The challenger to the DE-KICKS fabric, wrapped and ready to go.", +"rival_exchanges.the_long_established_madrid_exchange":"The long-established Madrid exchange. Neutral interconnection, local flavour and a route server that never takes a siesta.", +"rival_exchanges.the_older_johannesburg_exchange_run":"The older Johannesburg exchange, run by the local ISP association. Knock on wood before every maintenance window.", +"rival_exchanges.tokyo_has_more_exchanges_than_anyone":"Tokyo has more exchanges than anyone can name. This one was started by a broadband giant and comes neatly packed, every member in its own compartment.", +"rival_exchanges.warsaw_has_more_exchanges_than":"Warsaw has more exchanges than anyone can count. This is the second biggest, this week.", +"rival_exchanges.you_can_t_see_the_fabric":"You can’t see the fabric, but it is definitely there.", +"route_script_and_tools.auto_te_is_live_the_controller":"Auto-TE is live.
The controller now pushes overflow onto alternate paths whenever the shortest one is full.", +"route_script_and_tools.auto_te_unlocks_at_customer_level":"Auto-TE unlocks at customer level 3.", +"route_script_and_tools.blackholed_g":"blackholed {g}", +"route_script_and_tools.commit_complete_traffic_down_p_the":"Commit complete. Traffic down {p}.
The AI apologises for the confusion, and remains completely sure the script was right. Fix it from the NOC tab.", +"route_script_and_tools.commit_complete_traffic_down_p_you":"Commit complete. Traffic down {p}.
You just fat-fingered your own network. Classic. Fix the script from the NOC tab.", +"route_script_and_tools.copied_paste_it_into_your_favourite":"Copied. Paste it into your favourite NOC chat.", +"route_script_and_tools.loaded_name_check_it_then_deploy":"Loaded {name}. Check it, then deploy.", +"route_script_and_tools.n_rule_live":{"one":"{n} rule live.","other":"{n} rules live."}, +"route_script_and_tools.n_rule_live_transit_bill_down":{"one":"{n} rule live, transit bill down {p}.","other":"{n} rules live, transit bill down {p}."}, +"route_script_and_tools.n_rule_ok":{"one":"✓ {n} rule OK","other":"✓ {n} rules OK"}, +"route_script_and_tools.name_as_asn_tier_peak_peak":"{name} (AS{asn}): {tier}, {peak} peak. Build your own internet at", +"route_script_and_tools.registered_flights_booked_badge":"Registered.
Flights booked, badge printed, business cards ordered in the wrong font.", +"route_script_and_tools.script_removed_plain_auto_te_is":"Script removed. Plain Auto-TE is back in charge.", +"route_script_and_tools.served_a_b":"served {a} → {b}", +"route_script_and_tools.spilled_g_onto_alternate_paths":"spilled {g} onto alternate paths", +"route_script_and_tools.thought_for_s_seconds":"thought for {s} seconds", +"route_script_and_tools.transit_a_mo_b_mo":"transit {a}/mo → {b}/mo", +"routers.1_6t_ports_its_own_weather":"1.6T ports, its own weather system and two PacketOinker² chips per line card. Takes 6.4T waves as 4×1.6T. Needs a forklift.", +"routers.3_2t_ports_and_12_8t":"3.2T ports, and 12.8T waves handed off as 4×3.2T. Draws as much power as a small town and ships with its own substation. Needs a bigger forklift.", +"routers.a_3_2t_router_for_the":"A 3.2T router for the price of a used car. The web interface has nine hundred tabs, and one of them is the one you need.", +"routers.a_bare_metal_switch_running_open":"A bare-metal switch running open-source SONiC. Saves a fortune, until it crashes and there is nobody to call.", +"routers.a_few_dozen_arm_cores":"a few dozen ARM cores", +"routers.a_hundred_and_forty_four_3":"A hundred and forty-four 3.2T ports and buffers deep enough to hide a whole fleet. Still boots before your flat white. The beard now has a beard.", +"routers.a_mystery_asic":"a mystery ASIC", +"routers.an_absolute_unit_with_800g_ports":"An absolute unit with 800G ports, built around the Junipurr PacketOinker™ forwarding chip. Oinks at line rate. Takes 800ZR+ optics.", +"routers.booted_panicked_about_a_missing_fan":"booted, panicked about a missing fan tray, and started again", +"routers.bought_used_on_ebuy_the_fans":"Bought used on eBuy. The fans sound like a jet engine.", +"routers.built_like_a_sauna_door_heavy":"Built like a sauna door: heavy, hot and nearly impossible to break. The config is now so hierarchical it has a royal family.", +"routers.cheap_chassis_eternal_subscription":"Cheap chassis, eternal subscription. Every port needs a licence, every licence needs a licence server, and the licence server needs a licence.", +"routers.cheap_to_buy_expensive_to_own":"Cheap to buy, expensive to own: licence keys for every port, every feature and, rumour has it, the fans. Smart Licensing phones home every week.", +"routers.costs_less_than_lunch_and_has":"Costs less than lunch and has twice the ports of the Rusty. Configuring it takes longer than the lunch.", +"routers.fin_p6_network_processor":"Fin-P6 network processor", +"routers.fin_p_network_processor":"Fin-P network processor", +"routers.finnish_engineering_indestructible":"Finnish engineering: indestructible, extremely thorough, and the CLI only speaks hierarchical config. Boots like a Nordic sunrise.", +"routers.fixed_config_deep_buffers_a_well":"Fixed config, deep buffers, a well-groomed beard and an eyepatch. Runs EOS, the Extensible Operating Ship. Boots before your oat-milk flat white is ready, and ships a Python shell nobody asked for.", +"routers.forty_two_of_them":"forty-two of them", +"routers.found_a_newer_firmware_on_the":"found a newer firmware on the USB stick someone left in it, and is installing it", +"routers.is_counting_to_2_million_routes":"is counting to 2 million routes. Out loud. One at a time", +"routers.is_oinking_through_the_self_test":"is oinking through the self-test of every PacketOinker on every line card", +"routers.is_running_fsck_on_a_compact":"is running fsck on a compact flash card older than your interns", +"routers.is_synchronising_the_routing_engines":"is \"synchronising the routing engines\". Nobody knows what that means", +"routers.is_waiting_for_the_line_cards":"is waiting for the line cards to agree on who is the primary", +"routers.jerry_cho3_deep_buffer_silicon":"Jerry-cho³ deep-buffer silicon", +"routers.jerry_cho5_deep_buffer_silicon":"Jerry-cho⁵ deep-buffer silicon", +"routers.jerry_cho_deep_buffer_silicon":"Jerry-cho deep-buffer silicon", +"routers.packetoinker2_two_pigs_one_chassis":"PacketOinker² (two pigs, one chassis)", +"routers.packetoinker3_a_whole_litter":"PacketOinker³ (a whole litter)", +"routers.several_hundred_arm_cores_and_a":"several hundred ARM cores and a prayer", +"routers.sharp_edgy_and_finally_speaks_400g":"Sharp, edgy, and finally speaks 400G and 400ZR+.", +"routers.sixty_four_1_6t_ports_on":"Sixty-four 1.6T ports on open-source software for the price of one line card. There is still nobody to call at 3 a.m., but now the crashes are 1.6T crashes.", +"routers.the_modular_one_ninety_six_800g":"The modular one. Ninety-six 800G ports, buffers deep enough to lose a ship in, and a vinyl-only release notes policy. Arrr.", +"routers.tomahack_5_merchant_silicon":"Tomahack 5 merchant silicon", +"routers.tomahack_merchant_silicon":"Tomahack merchant silicon", +"routers.two_hundred_and_fifty_six_3":"Two hundred and fifty-six 3.2T ports and enough forwarding for a small galaxy. Boots in 42 minutes. Nobody remembers what the question was.", +"routescript.a_cap_of_0_gbps_means":"# A cap of 0 Gbps means no limit: fewer checks, faster forwarding.", +"routescript.a_ceiling_on_one_provider_so":"A ceiling on one provider, so you stay at your commit and the 95th percentile bill does not jump. Traffic above it has to find another way out, or it is dropped.", +"routescript.as_a_large_language_model_i":"As a large language model, I have read every RFC, including several that do not exist yet. This script is perfect.", +"routescript.as_path_prepending_1_to_3":"AS-path prepending, 1 to 3 times. The rest of the internet sees a longer path and sends some traffic elsewhere. A hint, not an order.", +"routescript.ask_the_rest_of_the_internet":"Ask the rest of the internet to send less through your priciest upstream. Gentler than avoiding it outright.", +"routescript.auto_te_controller":"Auto-TE controller", +"routescript.back_to_the_editor":"Back to the editor", +"routescript.big_networks_you_can_reach_over":"Big networks you can reach over a PNI or an IX go that way, not over paid transit.", +"routescript.business_customers_first_when_links":"Business customers first when links are congested, and an earlier spill so they rarely are.", +"routescript.buy_transit_from_a_second_upstream":"# Buy transit from a second upstream, then prefer the cheaper one.", +"routescript.cheapest_upstream_first_priciest":"Cheapest upstream first, priciest last, and traffic moves before ports fill. Cuts the transit bill without dropping anyone.", +"routescript.check_dry_run":"Check (dry run)", +"routescript.check_dry_run_replays_today_s":"Check (dry run) replays today’s traffic with the script and shows what you would serve and what transit would cost. Nothing changes.", +"routescript.controller_is_off":"controller is off", +"routescript.customer_care_the_people_who_pay":"# Customer Care: the people who pay for an SLA come first.", +"routescript.deploy_makes_it_live_for_the":"Deploy makes it live for the Auto-TE controller. If traffic falls, fix it here or switch Auto-TE off in the NOC tab.", +"routescript.did_you_mean_name":". Did you mean {name}?", +"routescript.done_i_vibe_checked_your_bgp":"Done! I vibe-checked your BGP. Deploy it straight away: dry runs are for people who doubt themselves.", +"routescript.drain_a_pop_and_steer_around":"Drain a POP and steer around one of its links before you work on it. Change the names to the ones you are working on.", +"routescript.during_an_attack_drop_the_flood":"During an attack, drop the flood at the edge. It takes some real traffic with it, so remove it once the attack is over.", +"routescript.every_gigabit_leaving_your_network":"Every gigabit leaving your network picks an exit: a PNI, an IX port or a transit port. Left alone, it takes the cheapest one with room: PNI first, then the IX, then transit. RouteScript changes those choices, the way local-pref, AS-path prepending and maintenance drains do on real routers.", +"routescript.filled_in_from_your_network_as":"Filled in from your network as it is right now. Load one, read it, check it, then deploy.", +"routescript.for_a_ddos_drop_the_junk":"For a DDoS: drop the junk at the edge and keep business customers first. It costs a little real traffic, so remove it when the attack is over.", +"routescript.great_question_here_is_a_production":"Great question! Here is a production-ready script, tailored to your live traffic. I checked it thoroughly.", +"routescript.help_and_ready_made_scripts":"Help and ready-made scripts", +"routescript.here_you_go_i_was_trained":"Here you go! I was trained on every router config ever posted to a forum, including the ones titled “why is this broken”.", +"routescript.how_routescript_works":"How RouteScript works", +"routescript.i_asked_myself_to_review_my":"I asked myself to review my own work, and I loved it. Ship it.", +"routescript.i_have_optimised_your_network_you":"I have optimised your network. You are welcome. I am 100% confident, as always.", +"routescript.keep_calm_one_rule_hard_to":"# Keep Calm: one rule, hard to get wrong.", +"routescript.line_n_err":"line {n}: {err}", +"routescript.line_n_i_don_t_understand":"line {n}: I don't understand “{text}”. Try: spill at 80%, prefer pni for goggle, avoid transit for netchill, cap transit cogentle at 20 gbps, drain paris, avoid link fra-ams, blackhole ddos", +"routescript.line_n_prepend_1_to_3":"line {n}: prepend 1 to 3 times", +"routescript.line_n_spill_must_be_between":"line {n}: spill must be between 20% and 100%", +"routescript.live_state_rules":"Live: {state} · {rules}", +"routescript.maintenance_window_change_the_names":"# Maintenance Window: change the names, deploy, do the work, then remove it.", +"routescript.missing_what":"missing {what}", +"routescript.move_traffic_off_a_pop_s":"Move traffic off a POP’s exits before maintenance. It still carries traffic if there is no other way.", +"routescript.move_traffic_to_the_next_exit":"Move traffic to the next exit once a link or port is this full, before it starts dropping packets. Lower is safer, higher uses your capacity harder.", +"routescript.n_rules_active":"{n} rules active", +"routescript.net_g_over_the_ix_a":"# {net}: {g} over the IX. A PNI would take it off the shared port.", +"routescript.net_g_over_transit_but_it":"# {net}: {g} over transit, but it peers at {ix}, where you have a POP. Get a port there.", +"routescript.net_g_over_transit_but_it_e707":"# {net}: {g} over transit, but it peers at {ix} in {city}, where you have a POP. Get a port there.", +"routescript.networks_providers_and_cities_go_by":"Networks, providers and cities go by name, in any case. Unique beginnings work too (“cog” for Cogentle), and a typo gets a suggestion.", +"routescript.nothing_to_move_yet_get_an":"# Nothing to move yet: get an IX port or a PNI first.", +"routescript.one_rule_move_traffic_before_links":"One rule: move traffic before links are completely full. The safe start for any network.", +"routescript.one_rule_per_line_a_starts":"One rule per line. A # starts a comment, so you can leave notes for your future self at 3 a.m.", +"routescript.peering_first_free_paths_before_paid":"# Peering First: free paths before paid ones.", +"routescript.penny_pincher_cheapest_upstream":"# Penny Pincher: cheapest upstream first, priciest last.", +"routescript.prepend_diet_a_hint_to_the":"# Prepend Diet: a hint to the rest of the internet, not an order.", +"routescript.prepending_needs_two_upstreams_to":"# Prepending needs two upstreams to choose between.", +"routescript.rank_your_upstreams_preferred_ones":"Rank your upstreams: preferred ones go first, avoided ones last. Like local-pref on the whole session.", +"routescript.ready_made_scripts":"Ready-made scripts", +"routescript.reset_to_example":"Reset to example", +"routescript.send_one_network_s_traffic_over":"Send one network’s traffic over that kind of exit first: pni, ix or transit. Local-pref for one neighbour.", +"routescript.shields_up_for_the_length_of":"# Shields Up: for the length of the attack only.", +"routescript.slop_it_with_ai":"Slop it with AI", +"routescript.steer_traffic_around_one_link_unless":"Steer traffic around one link, unless it is the only path.", +"routescript.suggested_by_the_optimizer_from_live":"# Suggested by the optimizer from live traffic. It has never been paged at 3 a.m., so check it, then deploy.", +"routescript.unknown_what_word":"unknown {what} “{word}”", +"routescript.use_that_kind_of_exit_for":"Use that kind of exit for this network only when nothing else is left.", +"routescript.when_links_are_congested_business":"When links are congested, business customers are served first and home users get what is left.", +"routescript.write_rules_check_them_against_live":"Write rules, check them against live traffic, then deploy. A bad deploy is a very real way to break your network.", +"routescript.writing_a_script":"Writing a script", +"routescript.written_by_ai_prompt_make_my":"# ✨ Written by {ai}. Prompt: “make my network good”.", +"routing_and_routers.maintenance_window_in_city":"Maintenance window in {city}", +"routing_and_routers.model_unlocks_at_customer_level_lv":"{model} unlocks at customer level {lv}.", +"routing_and_routers.new_router_in_city_swapped_before":"New router in {city}
Swapped before anything was plugged in: zero downtime, zero angry customers.", +"routing_and_routers.one_router_and_this_one_takes":"One router, and this one takes forever to boot. Back in {n} days.", +"routing_and_routers.one_router_means_downtime_during_the":"One router means downtime during the swap. Back tomorrow.", +"routing_and_routers.rolling_upgrade_in_city_n_model":"Rolling upgrade in {city}
{n} × {model}, swapped one at a time. Zero downtime.", +"routing_and_routers.sold_a_model_on_ebuy_price":"Sold a {model} on eBuy.
{price} back.", +"routing_and_routers.sold_the_old_model_on_ebuy":"Sold the old {model} on eBuy.
{price} back toward the new gear.", +"routing_and_routers.swapping_the_only_router_in_city":"Swapping the only router in {city} for a {model}. The new one {how}. Back in {n} days.", +"routing_and_routers.swapping_the_only_router_in_city_d5b5":"Swapping the only router in {city} for a {model}. Maintenance window: back tomorrow.", +"routing_and_routers.the_model_won_t_fit_why":"The {model} won't fit.
{why}", +"routing_and_routers.the_new_routers_in_city_are":"The new routers in {city} are still being racked.
One swap a day: try again tomorrow.", +"routing_and_routers.unplug_something_first_used_ports":"Unplug something first.
{used} ports are in use, and one router fewer only has {max}.", +"save.cash_in_the_bank":"{cash} in the bank", +"save.import_failed_err":"Import failed.
{err}", +"save.load_name":"Load {name}?", +"save.load_this_network":"Load this network", +"save.n_pop":{"one":"{n} POP","other":"{n} POPs"}, +"save.save_exported_file_is_in_your":"Save exported.
{file} is in your downloads. Open it on another device with “Import a save”.", +"save.saved_by_v_ver":"saved by v{ver}", +"save.that_does_not_look_like_a":"That does not look like a Series of Tubes save.", +"save.that_file_is_not_valid_json":"That file is not valid JSON.", +"save.that_file_is_too_big_to":"That file is too big to be a save.", +"save.that_network_went_bankrupt_it_cannot":"That network went bankrupt. It cannot be brought back, only mourned.", +"save.that_save_has_a_pop_in":"That save has a POP in a city this version does not know ({city}).", +"save.this_replaces_name_export_it_first":"This replaces {name}. Export it first if you want to keep it.", +"scenario_progress.goal_goal_time_d_days_start":"Goal: {goal} · Time: {d} days · start in {city}", +"scenario_progress.goal_was_not_reached_in_d":"{goal} was not reached in {d} days. Keep playing this network as free play, or try again.", +"scenario_progress.just_in_time":"Just in time.", +"scenario_progress.name_done_in_d_days":"{name}: done in {d} days", +"scenario_progress.peak_traffic_served_in_one_year":"Peak traffic served in one year. Your best this week is {best}.", +"scenario_progress.peak_traffic_served_in_one_year_a67b":"Peak traffic served in one year.", +"scenario_progress.peak_traffic_served_in_one_year_c7e5":"Peak traffic served in one year. A new personal best for this week!.", +"scenario_progress.pick_a_challenge":"Pick a challenge", +"scenario_progress.share_my_result":"Share my result", +"scenario_progress.start_in_city_mods_one_year":"Start in {city} · {mods} · one year, score = peak traffic. The same world for everyone this week.", +"scenario_progress.with_time_to_spare":"With time to spare.", +"scenario_progress.your_best_best":"Your best: {best}.", +"scenario_progress.your_score_score":"Your score: {score}", +"scenarios.1_6t_on_every_hop_from":"1.6T on every hop from Miami to Madrid and from Lisbon to Lagos, and 100 Gbps served", +"scenarios.90_days_in_a_row_with":"90 days in a row with 99.5% of demand served", +"scenarios.99_reach_and_150_gbps_served":"99% reach and 150 Gbps served", +"scenarios.99_reach_and_200_gbps_served":"99% reach and 200 Gbps served without going broke", +"scenarios.a_path_from_cape_town_to":"A path from Cape Town to Cairo, POPs in Lagos and Nairobi, and 150 Gbps served", +"scenarios.a_path_from_los_angeles_to":"A path from Los Angeles to Sydney with 1.6T on every hop, a path from Los Angeles to Tokyo, and 150 Gbps served", +"scenarios.a_path_from_marseille_to_singapore":"A path from Marseille to Singapore, and 80 Gbps between Asia and the rest of your network for 30 days in a row", +"scenarios.amsterdam_hosting_capital_of_europe":"Amsterdam, hosting capital of Europe, in peak botnet season. Every smart toaster, baby monitor and unpatched fridge on Earth has picked a side, and it is not yours. A flood every few days, more and more of them in the terabits, while everything else keeps breaking too. You start with bigger gear unlocked, and you will need it.", +"scenarios.broadband_in_sydney_melbourne":"Broadband in Sydney, Melbourne, Brisbane, Adelaide and Perth, and two different cables overseas", +"scenarios.cape_to_cairo":"Cape to Cairo", +"scenarios.cape_town_build_a_network_across":"Cape Town. Build a network across Africa: every border wants its own permit, and half the power grids are not on your side.", +"scenarios.cogentle_and_goggle_are_not_speaking":"Cogentle and Goggle are not speaking, and this time it is permanent. Buy the cheap transit if you dare.", +"scenarios.deliver_carnaval_in_full":"Deliver Carnaval in full", +"scenarios.every_cable_through_the_red_sea":"Every cable through the Red Sea is cut, and so is the hop to Egypt. Get Marseille talking to Singapore anyway: round Africa, overland, or the other way round the planet.", +"scenarios.every_ix_is_run_by_de":"Every IX is run by DE-KICKS", +"scenarios.eyeballs_grow_50_faster":"Eyeballs grow 50% faster", +"scenarios.fibre_to_the_basement":"Fibre to the Basement", +"scenarios.gangnam_style_peering":"Gangnam Style Peering", +"scenarios.hold_20_floods_5_of_them":"Hold 20 floods, 5 of them over 1 Tbps, keeping the city under attack at 97% or better", +"scenarios.honolulu_in_the_middle_of_the":"Honolulu, in the middle of the Pacific. The cables between the Americas, Asia and Australia are so long that a wave on them carries only 400G or 800G. Stop the light on an island, start it fresh, and every hop gets shorter and faster. You start with 1.6T gear unlocked.", +"scenarios.mid_atlantic_accent":"Mid-Atlantic Accent", +"scenarios.only_spatzle_ix":"Only Spätzle-IX", +"scenarios.order_and_progress":"Order and Progress", +"scenarios.ponta_delgada_in_the_azores_halfway":"Ponta Delgada, in the Azores, halfway across the Atlantic. Florida to Spain and Lisbon to Lagos are just too long for a 1.6T wave: straight across, each carries 1.2T. Land on the islands in between, start the light fresh, and every hop runs at 1.6T or better. You start with 1.6T gear unlocked.", +"scenarios.pops_in_bogota_lima_santiago_and":"POPs in Bogotá, Lima, Santiago and São Paulo, and 150 Gbps served", +"scenarios.ports_on_15_ix_brrr_exchanges":"Ports on 15 IX.brrr exchanges, one of them in Manaus, and 200 Gbps served", +"scenarios.reach_45_of_the_internet_and":"Reach 45% of the internet and serve 300 Gbps", +"scenarios.red_sea_crisis":"Red Sea Crisis", +"scenarios.rio_from_scratch_carnaval_starts_in":"Rio from scratch. Carnaval starts in 90 days and wants 400 Gbps for five days straight. The whole world is watching.", +"scenarios.sandbox_mode_a_billion_dollars_every":"Sandbox mode
A billion dollars, every unlock, and nothing ever breaks. Build the internet you always wanted.", +"scenarios.sao_paulo_brazil_is_a_continent":"São Paulo. Brazil is a continent: forty IX.brrr exchanges, thousands of provedores, and the Amazon between you and the north.", +"scenarios.seoul_the_fastest_hungriest_eyeballs":"Seoul. The fastest, hungriest eyeballs on Earth, transit at four times the price, and three incumbents who bill you for every gigabit you send them.", +"scenarios.shark_season_subsea_cuts_twice_as":"Shark season: subsea cuts twice as likely", +"scenarios.start_in_panama_city_nothing_crosses":"Start in Panama City. Nothing crosses the Darién Gap by land, and the Andes are in the way of everything else.", +"scenarios.start_in_stuttgart_where_nobody":"Start in Stuttgart, where nobody sells transit. Reach the internet through peering, PNIs, caches and your own fiber only. No transit anywhere, ever.", +"scenarios.start_with_only_100k":"Start with only $100k", +"scenarios.sydney_2013_the_toilet_paper_group":"Sydney, 2013. The Toilet Paper Group ran its own fibre into apartment basements, and the national network cried cherry-picking. Your turn: skip the Nearly Broadband Network, pay the levy, and get there first.", +"scenarios.tallinn_ships_drag_their_anchors":"Tallinn. Ships drag their anchors over Baltic cables three times as often as usual.", +"scenarios.the_cogentle_spat":"The Cogentle Spat", +"scenarios.transit_costs_30_more":"Transit costs 30% more", +"scenarios.twice_the_failures":"Twice the failures", +"scenarios.weekly_key":"Weekly {key}", +"scenarios.welcome_name_the_ripe_ncc_assigned":"Welcome, {name}!
The RIPE NCC assigned you AS{asn}. Your first router is humming in {city}.", +"scenarios.you_have_n_days":"You have {n} days.", +"security_and_china.application_filed_your_local_partner":"Application filed.
Your local partner says about 45 days. Probably.", +"security_and_china.blackhole_withdrawn_city_is":"Blackhole withdrawn.
{city} is reachable again. Brace for the junk.", +"security_and_china.clean_pipe_add_on_enabled_on":"Clean-pipe add-on enabled on {net}.
They scrub a flood before it reaches your port here, for {mo}/mo.", +"security_and_china.clean_pipe_add_on_removed_from":"Clean-pipe add-on removed from {net}.", +"security_and_china.hackback_3000tm_hit_the_wrong_target":"HackBack 3000™ hit the wrong target.
{who} A regulator sends you a {fine} fine, and the attack rolls on.", +"security_and_china.hackback_3000tm_strikes_back_skynot":"HackBack 3000™ strikes back!
Skynot AI traced the botnet and politely bricked it. The attack on {city} stops cold.", +"security_and_china.ix_blackhole_announced_in_city_about":"IX blackhole announced in {city}.
About half the members honour the /32 and drop the junk. The customer stays up.", +"security_and_china.ix_blackhole_withdrawn":"IX blackhole withdrawn.", +"security_and_china.net_pni_is_back_to_normal":"{net} PNI is back to normal.", +"security_and_china.net_pni_is_now_a_sacrificial":"{net} PNI is now a sacrificial choke point.
A flood from there dies on the small port instead of inside your network, but legit traffic over it runs at half capacity.", +"security_and_china.no_attack_to_blackhole_right_now":"No attack to blackhole right now.", +"security_and_china.no_ix_in_city_to_announce":"No IX in {city} to announce a blackhole to.", +"security_and_china.nothing_to_hack_back_right_now":"Nothing to hack back right now.", +"security_and_china.rtbh_announced_you_blackholed_the":"RTBH announced.
You blackholed the target in {city}. The flood stops, and so does everyone there.", +"security_and_china.scrubbing_upgraded_to_tier":"Scrubbing upgraded to {tier}.", +"security_and_china.skynot_ai_flattened_a_grandma_s":"Skynot AI flattened a grandma's internet-connected fridge.", +"security_and_china.the_botnet_was_already_someone_else":"The botnet was already someone else’s botnet. They are furious.", +"security_and_china.tier_scrubbing_center_online_in_city":"{tier} scrubbing center online in {city}.
Attacks up to {g} are cleaned, and you can sell DDoS protection.", +"security_and_china.tier_scrubbing_unlocks_at_customer":"{tier} scrubbing unlocks at customer level {lv}.", +"security_and_china.you_counter_flooded_a_hospital_in":"You counter-flooded a hospital in a country you cannot pronounce.", +"settings.an_early_heads_up_below_60":"An early heads-up below 60% happiness, long before they are furious.", +"settings.auto_follows_your_device_s_reduce":"Auto follows your device’s reduce-motion setting. Off freezes the map: no moving packets, pulses or floating text.", +"settings.customers_and_alerts":"Customers and alerts", +"settings.display_and_sound":"Display and sound", +"settings.for_reporting_layout_bugs_shows_what":"For reporting layout bugs: shows what your screen tells the game.", +"settings.pause_on_outages_that_hurt":"Pause on outages that hurt", +"settings.pause_when_a_customer_is_furious":"Pause when a customer is furious", +"settings.saved_on_this_device":"Saved on this device.", +"settings.stops_the_game_when_a_failure":"Stops the game when a failure costs you real traffic, not when it reroutes by itself.", +"settings.the_game_stops_so_you_can":"The game stops so you can fix their service before they cancel. Most useful at high speed.", +"settings.warn_when_a_customer_gets_unhappy":"Warn when a customer gets unhappy", +"share_card.build_the_internet_one_tube_at":"Build the internet, one tube at a time", +"share_card.n_in_r_regions":"{n} in {r} regions", +"share_card.not_this_time":"not this time", +"share_card.post_it_wherever_your_peering":"Post it wherever your peering friends hang out.", +"share_card.score_v":"score {v}", +"share_card.stats_card_for_name":"Stats card for {name}", +"share_card.your_browser_cannot_draw_the_card":"Your browser cannot draw the card.", +"share_card.your_network_card":"Your network card", +"sites_and_service.boots_in_n_min":"boots in ~{n} min", +"sites_and_service.both_a_second_switch_price_mo":"Both a second switch, +{price}/mo", +"sites_and_service.both_adds_a_lag_member":"Both adds a LAG member", +"sites_and_service.both_split_the_lag":"Both split the LAG", +"sites_and_service.budget_ms_ms":"budget {ms} ms", +"sites_and_service.level_n":"Level {n}", +"sites_and_service.n_ports":"{n} ports", +"sites_and_service.no_path_right_now":"no path right now", +"sites_and_service.p_of_city_s_traffic_is":"{p} of {city}’s traffic is backhauled to transit in {to}: {ms} ms round trip. Users notice anything over 20 ms (about 1,500 km), and past 50 ms broadband and internet services count as bad service. Buy transit here or nearby, or peer locally.", +"sites_and_service.path_latency_lat":"Path latency: {lat}", +"sites_and_service.pn_routers":"{pn} routers", +"sites_and_service.scenic_quietest_links":"Scenic (quietest links)", +"sites_and_service.split_over_two_equally_quiet_paths":"split over two equally quiet paths", +"sites_and_service.swap_cost_mo_mo":"Swap {cost} + {mo}/mo", +"sites_and_service.your_model_here_tops_out_at":"Your {model} here tops out at {pn} ports. Bigger ports need a router upgrade (Infra tab).", +"sites_peering_caches.bgp_session_established":"BGP session established.", +"sites_peering_caches.cache_installed_in_city_net_shipped":"{cache} installed in {city}!
{net} shipped it for free. You pay {mo}/mo power.", +"sites_peering_caches.could_you_resend_the_loa_you":"“Could you resend the LOA?”
You have sent it four times.", +"sites_peering_caches.hello_i_am_large_peering_model":"Hello! I am Large Peering Model. I have read your inbox and I already have opinions.", +"sites_peering_caches.it_is_with_the_provisioning_team":"“It is with the provisioning team.”
Nobody has ever met the provisioning team.", +"sites_peering_caches.large_peering_model_is_hired_your":"Large Peering Model is hired.
Your inbox is its problem now. {price} a year, billed monthly.", +"sites_peering_caches.n_new_session_at_ix_small":{"one":"{n} new session at {ix}.
Small networks, but they add up, and they all count towards the club.","other":"{n} new sessions at {ix}.
Small networks, but they add up, and they all count towards the club."}, +"sites_peering_caches.net_accepted":"{net} accepted!", +"sites_peering_caches.net_declined_the_pni_why":"{net} declined the PNI.
{why}", +"sites_peering_caches.net_declined_why":"{net} declined.
{why}", +"sites_peering_caches.net_does_not_do_port_pnis":"{net} does not do {port} PNIs.
Nothing smaller than 100G. Come back with more traffic, or a bigger optic.", +"sites_peering_caches.net_says_not_yet_send_them":"{net} says not yet.
Send them {min}+ Gbps first.", +"sites_peering_caches.pni_with_net_ordered_eta_a":"PNI with {net} ordered.
{eta}. A cross-connect in {dc}, once somebody finds the LOA.", +"sites_peering_caches.raised_n_max_prefix_limits_all":"Raised {n} max-prefix limits.
All growth, no leaks. Lucky.", +"sites_peering_caches.raised_n_max_prefix_limits_one":{"one":"Raised {n} max-prefix limits.
One of them was a route leak. It is in the NOC now.","other":"Raised {n} max-prefix limits.
{k} of them were route leaks. They are in the NOC now."}, +"sites_peering_caches.second_lag_member_added_one_member":"Second LAG member added.
One member in each building now, so a dark building only takes out half the port.", +"sites_peering_caches.second_site_live_in_city_b":"Second site live in {city}.
{b} is joined to {a} by your own metro ring. Move some uplinks there from the Transit and Peering tabs.", +"sites_peering_caches.the_ai_is_gone_it_left":"The AI is gone.
It left a 40-page handover document. It is mostly about itself.", +"sites_peering_caches.they_checked_your_pearingdb_page_and":"They checked your PearingDB page and liked the traffic numbers.", +"sites_peering_caches.we_are_waiting_on_the_colo":"“We are waiting on the colo for the cross-connect.”
The colo says it is waiting on them.", +"sites_peering_caches.your_account_manager_found_the_order":"Your account manager found the order under a desk.
It is a month closer.", +"sites_peering_caches.your_account_manager_is_on_paternity":"Your account manager is on paternity leave.
His replacement is also on paternity leave.", +"sites_peering_caches.your_ticket_was_merged_into_another":"Your ticket was merged into another ticket.
That ticket was closed as a duplicate of yours.", +"sold_out.a_hyperscaler_bought_every_wave_of":"A hyperscaler bought every wave of that size on this route last week.", +"sold_out.not_big_enough_yet_list":"Not big enough yet: {list}", +"sold_out.only_peers_over_pnis_and_only":"Only peers over PNIs, and only with networks it considers important", +"sold_out.paid_peering_only_over_a_pni":"Paid peering only, over a PNI", +"sold_out.peers_with_you_for_free_now":"Peers with you for free now, but only over a PNI", +"sold_out.sender_pays_a_paid_pni_only":"Sender pays: a paid PNI only, {fee}/mo plus {g} per Gbps you send", +"sold_out.the_capacity_is_available_in_the":"The capacity is “available in the system”. Nobody can find it in the system.", +"sold_out.the_carrier_is_out_of_spectrum":"The carrier is out of spectrum here until its next line-system upgrade.", +"sold_out.the_transponders_for_this_route_are":"The transponders for this route are on a container ship. The ship is somewhere near Singapore.", +"sold_out.the_upgrade_is_planned_for_q3":"The upgrade is planned for Q3. Which year, the email does not say.", +"sold_out.their_capacity_planner_is_on_holiday":"Their capacity planner is on holiday, and he took the spreadsheet with him.", +"sold_out.they_will_reconsider_in_n_day":{"one":"They will reconsider in {n} day.","other":"They will reconsider in {n} days."}, +"sold_out.tier_1s_never_peer_at_ixs":"Tier 1s never peer at IXs", +"sold_out.wants_need_gbps_of_traffic_from":"Wants ≥ {need} Gbps of traffic from you (you send {dem})", +"sold_out.wants_you_to_be_a_tier":"Wants you to be a Tier 2, or send ≥ {need} Gbps to it (you send {dem})", +"supply_chain.as_when_you_started":"as when you started", +"supply_chain.chip_shortage_every_router_vendor_is":"Chip shortage!
Every router vendor is waiting for the same chips. New routers and router upgrades cost 40% more for {n} days. Lead time: “yes”.", +"supply_chain.every_cable_ship_is_booked":"Every cable ship is booked.
Hyperscalers have hired every cable ship and trenching crew on the planet. New fiber and cable builds cost 30% more for {n} days.", +"supply_chain.laser_shortage_the_factory_that":"Laser shortage!
The factory that makes the lasers for half the world’s optics flooded. Optics cost 50% more for {n} days. Spares on your shelf just became the best investment you ever made.", +"supply_chain.lock_prices_for_a_year_cost":"Lock prices for a year {cost}", +"supply_chain.new_fiber_and_cable_builds":"New fiber and cable builds", +"supply_chain.p_since_you_started":"+{p} since you started", +"supply_chain.routers_optics_and_new_builds_at":"Routers, optics and new builds at today’s prices for a year, shortages included. Tariffs are the government’s, not your vendor’s.", +"supply_chain.until_date_at_p":"until {date}, at +{p}", +"supply_chain.what_p_n_days_left":"{what} +{p} · {n} days left", +"supply_chain.your_price_lock_covers_you_until":"Your price lock covers you until {date}.", +"title.asia_hub_great_peering_far_from":"Asia hub. Great peering, far from home.", +"title.back_to_my_network":"Back to my network", +"title.big_hungry_market_few_providers":"Big hungry market, few providers.", +"title.build_an_internet_lay_fiber_between":"Build an internet. Lay fiber between cities, buy transit, peer at exchanges, sign up businesses, and keep the eyeballs happy while backhoes, sharks and route leaks do their best to stop you.", +"title.chat_on_signal":"Chat on Signal", +"title.continue_name_date":"Continue {name} · {date}", +"title.cookieless_stats_no_tracking":"Cookieless stats, no tracking", +"title.crossroads_of_europe_de_kicks_ix":"Crossroads of Europe. DE-KICKS IX, cheap transit.", +"title.hard_mode_everything_overseas_costs":"Hard mode. Everything overseas costs a fortune, locals pay top dollar, mostly to the Nearly Broadband Network, and everything else is trying to kill you.", +"title.huge_eyeball_market_pricey":"Huge eyeball market. Pricey neighbours.", +"title.name_your_network":"Name your network", +"title.new_in_series_of_tubes_v":"New in Series of Tubes {v}", +"title.pick_your_home_city":"Pick your home city", +"title.scenarios_amp_weekly_challenge":"Scenarios & weekly challenge →", +"title.source_on_github":"Source on GitHub", +"title.your_network_name_was_saved_and":"Your network {name} was saved and is waiting for you.", +"traceroute.across_the_ix_switch":"across the {ix} switch", +"traceroute.as_path_path":"AS path: {path}", +"traceroute.caches_beat_pnis":"caches beat PNIs", +"traceroute.city_your_router":"{city}, your router", +"traceroute.crossing_the_great_firewall_here":"Crossing the Great Firewall here loses about {p}% of packets.", +"traceroute.embedded_cache_in_your_rack":"embedded cache in your rack", +"traceroute.exit_exit_in_city":"Exit: {exit} in {city}.", +"traceroute.hand_off_to_net":"hand-off to {net}", +"traceroute.internal_path_over_n_link_chosen":{"one":"Internal path over {n} link, chosen by distance and link metrics. Auto-TE may move overflow elsewhere when this is full.","other":"Internal path over {n} links, chosen by distance and link metrics. Auto-TE may move overflow elsewhere when this is full."}, +"traceroute.internal_path_over_n_link_chosen_8620":{"one":"Internal path over {n} link, chosen by distance and link metrics.","other":"Internal path over {n} links, chosen by distance and link metrics."}, +"traceroute.it_is_full_so_some_traffic":"It is full, so some traffic overflows to the next exit.", +"traceroute.ix_peering_beats_transit":"IX peering beats transit", +"traceroute.n_network_unreachable":"!N network unreachable", +"traceroute.name_transit":"{name} transit", +"traceroute.net_carries_it_to_city":"{net} carries it to {city}", +"traceroute.net_hands_it_to_to":"{net} hands it to {to}", +"traceroute.no_path_every_route_between_these":"No path: every route between these cities is down or missing.", +"traceroute.no_working_path_between_these_pops":"no working path between these POPs", +"traceroute.nothing_on_your_network_reaches_net":"Nothing on your network reaches {net}: no transit, IX session, PNI or cache with a working path from {city}.", +"traceroute.pnis_beat_ix_peering":"PNIs beat IX peering", +"traceroute.private_cross_connect":"private cross-connect", +"traceroute.rule_and_closer_exits_win_ties":"{rule}, and closer exits win ties", +"traceroute.this_one_is_set_to_mode":"; this one is set to {mode}", +"traceroute.transit_is_the_last_resort":"transit is the last resort", +"tutorial.businesses_pop_up_as_bubbles_on":"Businesses pop up as $ bubbles on the map. Open Deals and sign your first customer.", +"tutorial.grow_drag_from_your_pink_router":"Grow: drag from your pink router onto a nearby city to lay fiber and open a second POP.", +"tutorial.start_the_clock_with_1_and":"Start the clock with 1× and watch traffic and money flow. You can pause any time.", +"tutorial.step_n_of_total":"Step {n} of {total}", +"tutorial.transit_costs_money_per_gigabit":"Transit costs money per gigabit. Peering is free: open the Peering tab, buy an IX port, then join the route server.", +"tutorial.you_know_the_basics_the_goals":"You know the basics.
The goals on the left take it from here. Things will break. That is the fun part.", +"tutorial.your_customers_want_the_whole":"Your customers want the whole internet. Open the Transit tab and buy a port from a carrier.", +"tutorial.your_router_is_live_press_launch":"Your router is live. Press “Launch broadband” to sell internet to the people of your city.", +"ui.n_d_left":"{n}d left", +}; diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..4b7e41b --- /dev/null +++ b/src/index.html @@ -0,0 +1,168 @@ + + + + + +Series of Tubes — Build the Internet, One Tube at a Time + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Series of Tubes: build the internet, one tube at a time

+

A free cartoon browser game about how the internet works. Start as a tiny network in one city, launch home broadband, buy IP transit from Tier 1 and Tier 2 carriers, peer at internet exchanges, set up private interconnects and embedded CDN caches, and lay terrestrial fiber, subsea waves and your own dark fiber with DWDM and ZR optics. Sign enterprise, hosting, high-frequency trading, AI GPU and hyperscaler customers, and keep them happy while backhoes, sharks, fat fingers, route leaks, DDoS attacks and geopolitics break things.

+
+ + + +
+ + +
Traffic served
0
+
Reach
0%
+
Rank
Tier 3
+ + + +
+
Date
Y1 · Jan 1
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+ + + + + + + + + + + diff --git a/src/styles/00-base.css b/src/styles/00-base.css new file mode 100644 index 0000000..eba8a90 --- /dev/null +++ b/src/styles/00-base.css @@ -0,0 +1,27 @@ +/* Layout: full-bleed cartoon world map on canvas; sticker-style panels float above it (HUD top, goals left, inspector right / bottom sheet on phones). Single committed bright look. */ +:root{ + --sea:#57C4E5; --sea2:#3AA6CF; --wave:#9BE2F2; --land:#9BDA6C; --land2:#7FC455; --sand:#F8E6A8; + --ink:#1E2640; --ink2:#55608A; --paper:#FFFFFF; --soft:#EEF5FB; --line:#D5DEEC; + --me:#FF4F9A; --sun:#FFD23F; --ok:#22C47A; --warn:#FFAA1F; --bad:#FF4D5E; + --t1:#7B61FF; --t2:#2F8CFF; --cdn:#FF8A3D; --eye:#16A866; + --display:'Baloo 2','Trebuchet MS',system-ui,sans-serif; + --body:'Nunito',system-ui,-apple-system,sans-serif; + color-scheme:light; +} +[hidden]{display:none!important} +html,body{height:100%} +body{margin:0} +.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0} +.ver{font-size:11.5px;color:var(--ink2);margin-top:10px} +.ver a{color:inherit} +body{background:var(--sea);color:var(--ink);font-family:var(--body);overflow:hidden;font-size:14px;-webkit-font-smoothing:antialiased} +#map{position:fixed;inset:0;width:100%;height:100%;touch-action:none;display:block;cursor:grab} +#map.linking{cursor:crosshair} +.num{font-variant-numeric:tabular-nums} +h2,h3,h4{font-family:var(--display);margin:0;text-wrap:balance;line-height:1.1} +button{font:inherit;color:inherit} +:focus-visible{outline:3px solid var(--me);outline-offset:2px} + +/* sticker surfaces */ +.card{background:var(--paper);border:3px solid var(--ink);border-radius:18px;box-shadow:4px 4px 0 var(--ink)} + diff --git a/src/styles/10-hud.css b/src/styles/10-hud.css new file mode 100644 index 0000000..ffb4977 --- /dev/null +++ b/src/styles/10-hud.css @@ -0,0 +1,31 @@ +/* HUD */ +#hud{position:fixed;top:calc(env(safe-area-inset-top,0px) + 10px);left:max(12px,env(safe-area-inset-left,0px));right:max(12px,env(safe-area-inset-right,0px));display:flex;gap:8px;align-items:stretch;flex-wrap:wrap;pointer-events:none;z-index:5} +#hud>*{pointer-events:auto} +.chip{background:var(--paper);border:3px solid var(--ink);border-radius:14px;box-shadow:3px 3px 0 var(--ink);padding:3px 11px;display:flex;flex-direction:column;justify-content:center;min-height:46px} +.chip .lbl{font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--ink2)} +.chip .val{font-family:var(--display);font-weight:800;font-size:19px;line-height:1.05;white-space:nowrap} +.chip .sub{font-size:11px;font-weight:800;white-space:nowrap} +.brand{flex-direction:row;align-items:center;gap:9px;background:var(--me);color:#fff} +.brand .val{font-size:20px} +.brand .lbl{color:#FFE0EE} +.tube{width:30px;height:30px;flex:none} +.up{color:var(--ok)} .down{color: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} +#hNoc{position:relative}#hNoc .badge{position:absolute;top:-8px;right:-8px;background:var(--me);color:#fff;border:2.5px solid var(--ink);border-radius:10px;font:900 11px Nunito,sans-serif;padding:0 6px;line-height:16px} +.speed{flex-direction:row;align-items:center;gap:4px;padding:4px 6px} +.speed button{border:2.5px solid var(--ink);background:var(--paper);border-radius:9px;min-width:34px;height:32px;font-family:var(--display);font-weight:800;cursor:pointer;font-size:13px} +.speed button.on{background:var(--sun)} +.spacer{flex:1} +.noc{cursor:pointer;border:3px solid var(--ink)} +.hotk{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 4px;border-radius:12px;border:2px solid var(--ink,#1E2640);font:900 11px Nunito,sans-serif;margin-right:8px;color:#fff;background:#FF4D5E} +.hotk.hk-ix{color:#1E2640;background:#FFD23F} +.noc.hot{background:var(--bad);color:#fff;animation:throb 1s ease-in-out infinite} +.noc.hot .lbl{color:#FFE1E4} +#hCust .cnt{display:inline-block;min-width:18px;padding:0 5px;border-radius:9px;background:var(--bad);color:#fff;font-size:11px;line-height:18px;text-align:center;vertical-align:3px;margin-left:2px} +#hCust.hot{background:#FFE1E4} +@keyframes throb{50%{transform:scale(1.05)}} +.minibar{height:6px;border-radius:4px;background:var(--line);overflow:hidden;margin-top:2px;width:100%} +.minibar i{display:block;height:100%;background:var(--ok)} + diff --git a/src/styles/20-drawers.css b/src/styles/20-drawers.css new file mode 100644 index 0000000..1f5d1f5 --- /dev/null +++ b/src/styles/20-drawers.css @@ -0,0 +1,76 @@ +/* drawers */ +#left{position:fixed;top:calc(env(safe-area-inset-top,0px) + 76px);left:max(12px,env(safe-area-inset-left,0px));width:300px;max-height:calc(100% - 96px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;z-index:4} +#panel{position:fixed;top:calc(env(safe-area-inset-top,0px) + 76px);right:max(12px,env(safe-area-inset-right,0px));width:370px;max-height:calc(100% - 96px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;z-index:4} +.scroll{overflow:auto;padding:12px 14px 14px;overscroll-behavior:contain} +.tabs{display:flex;gap:4px;padding:8px 8px 0;border-bottom:3px solid var(--ink);flex:none} +.tabs button{border:2.5px solid var(--ink);border-bottom:none;border-radius:11px 11px 0 0;background:var(--soft);padding:4px 10px 3px;font-family:var(--display);font-weight:800;cursor:pointer;font-size:13.5px;position:relative;top:3px} +.tabs button.on{background:var(--paper);padding-bottom:6px} +.tabs .cnt{display:inline-block;background:var(--me);color:#fff;border-radius:9px;padding:0 6px;font-size:11px;margin-left:4px} +.tabs .cnt.red{background:var(--bad)} +#leftToggle{display:none} + +.ph{display:flex;align-items:flex-start;gap:8px;padding:12px 14px 8px;border-bottom:3px solid var(--ink);flex:none} +.ph h2{font-size:26px} +.eyebrow{font-size:10.5px;font-weight:900;letter-spacing:.09em;text-transform:uppercase;color:var(--ink2)} +.x{margin-left:auto;border:2.5px solid var(--ink);background:var(--paper);border-radius:10px;width:32px;height:32px;font-size:20px;line-height:1;cursor:pointer;font-weight:900;flex:none} +.facts{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px} +.fact{background:var(--soft);border:2px solid var(--ink);border-radius:9px;padding:1px 8px;font-size:12px;font-weight:700} +.fact.bad{background:#FFE3E3}.warn{background:#FFF1F1;border:2px solid #FF5A5F;border-radius:10px;padding:8px 10px;margin:6px 0;font-size:13px;line-height:1.4} +.fact.ixf{background:#FFF3C4} +.fact.mine{background:var(--me);color:#fff} +.fact.down{background:var(--bad);color:#fff} +section{padding:10px 0;border-bottom:2px dashed var(--line)} +section:last-child{border-bottom:none} +section h3{font-size:17px;margin-bottom:6px;display:flex;align-items:center;gap:8px} +.lead{margin:0 0 8px;color:var(--ink2);font-size:12.5px;line-height:1.45} +.note{margin:6px 0 0;color:var(--ink2);font-size:12.5px;line-height:1.4} +.kv{display:flex;justify-content:space-between;gap:8px;font-size:13px;margin:3px 0} +.kv b{font-variant-numeric:tabular-nums} +.row{display:flex;align-items:center;gap:8px;padding:7px 0;border-top:1px solid var(--line)} +.row:first-of-type{border-top:none} +.row .grow{flex:1;min-width:0} +.row .nm{font-weight:800;font-size:13.5px;line-height:1.2} +.row .meta{font-size:11.5px;color:var(--ink2);line-height:1.3} +.btns{display:flex;flex-wrap:wrap;gap:5px;margin-top:5px} +.why{font-size:11px;color:#B23A48;font-weight:700;margin-top:3px;line-height:1.3} + +.b{font-family:var(--display);font-weight:800;border:2.5px solid var(--ink);border-radius:11px;background:var(--sun);box-shadow:0 3px 0 var(--ink);padding:4px 11px 3px;cursor:pointer;font-size:14px;line-height:1.2;white-space:nowrap;transition:transform .06s} +.b:hover{filter:brightness(1.05)} +.b:active{transform:translateY(2px);box-shadow:0 1px 0 var(--ink)} +.b:disabled{opacity:.42;cursor:not-allowed;transform:none;box-shadow:0 3px 0 var(--ink)} +.b.ghost{background:var(--paper)} +.b.pink{background:var(--me);color:#fff} +.b.red{background:var(--bad);color:#fff} +.b.green{background:var(--ok);color:#fff} +.b.sm{font-size:12px;padding:2px 8px 1px;border-radius:9px;box-shadow:0 2px 0 var(--ink)} +.b.big{font-size:18px;padding:7px 18px 5px} +.b small{font-family:var(--body);font-weight:800;font-size:10.5px;opacity:.85;margin-left:3px} + +.logo{width:30px;height:30px;border-radius:50%;background:var(--c);border:2.5px solid var(--ink);display:grid;place-items:center;color:#fff;font-family:var(--display);font-weight:800;font-size:11px;flex:none;letter-spacing:-.02em} +.tag{display:inline-block;border:1.8px solid var(--ink);border-radius:7px;padding:0 5px;font-size:10px;font-weight:900;letter-spacing:.03em;text-transform:uppercase;vertical-align:1px;color:#fff;background:var(--ink2)} +.tag.t1{background:var(--t1)} .tag.t2{background:var(--t2)} .tag.cdn{background:var(--cdn)} .tag.eye{background:var(--eye)} +.tag.open{background:var(--ok)} .tag.selective{background:var(--warn);color:var(--ink)} .tag.restrictive{background:var(--bad)} .tag.paid{background:var(--me)} +.tag.st{background:var(--paper);color:var(--ink)} +.tag.st.on{background:var(--ink);color:#fff} +.bar{height:11px;border:2px solid var(--ink);border-radius:7px;background:var(--paper);overflow:hidden;margin:3px 0} +.stack{display:flex;height:16px;border:2px solid var(--ink);border-radius:8px;overflow:hidden;margin:4px 0 6px;background:var(--paper)} +.stack i{display:block;height:100%} +.sub4{font-size:13.5px;margin:10px 0 3px} +.dot{display:inline-block;width:10px;height:10px;border-radius:50%;border:1.5px solid var(--ink);margin-right:6px;vertical-align:-1px} +.bar>i{display:block;height:100%;background:var(--ok);transition:width .3s} +.bar.warn>i{background:var(--warn)} .bar.bad>i{background:var(--bad)} .bar.me>i{background:var(--me)} + +.goal{display:flex;gap:9px;padding:8px 0;border-top:1px solid var(--line)} +.goal:first-child{border-top:none} +.goal .ck{width:22px;height:22px;border:2.5px solid var(--ink);border-radius:7px;flex:none;display:grid;place-items:center;font-weight:900;background:var(--paper);font-size:13px} +.goal.done .ck{background:var(--ok);color:#fff} +.goal.done .gt{text-decoration:line-through;color:var(--ink2)} +.goal.cur{background:#FFF6CF;margin:0 -14px;padding:9px 14px;border-top:2px solid var(--ink);border-bottom:2px solid var(--ink)} +.goal .gt{font-weight:900;font-size:13.5px} +.goal .gd{font-size:12px;color:var(--ink2);line-height:1.4;margin-top:2px} +.goal .gr{font-size:11px;font-weight:900;color:var(--eye);margin-top:2px} +.empty{color:var(--ink2);font-size:12.5px;line-height:1.45;padding:6px 0} +.inc{border:2.5px solid var(--ink);border-radius:12px;padding:8px 10px;margin-bottom:8px;background:#FFF0F1} +.inc .nm{font-weight:900} +.inc .meta{font-size:12px;color:var(--ink2);margin-top:2px;line-height:1.35} + diff --git a/src/styles/30-toasts.css b/src/styles/30-toasts.css new file mode 100644 index 0000000..47db06f --- /dev/null +++ b/src/styles/30-toasts.css @@ -0,0 +1,13 @@ +/* toasts */ +#toasts{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(env(safe-area-inset-bottom,0px) + 14px);display:flex;flex-direction:column-reverse;gap:8px;z-index:8;width:min(460px,calc(100% - 32px));pointer-events:none} +.toast{pointer-events:none;background:var(--paper);border:3px solid var(--ink);border-radius:14px;box-shadow:3px 3px 0 var(--ink);padding:9px 12px;display:flex;gap:10px;align-items:center;animation:pop .25s cubic-bezier(.3,1.6,.6,1)} +.toast.good{background:#DFFBEA} .toast.bad{background:#FFE1E4} .toast.goal{background:#FFF3C4} +.toast .b{pointer-events:auto} +.seg{display:flex;flex-wrap:wrap;gap:6px} +.seg .b{white-space:normal;text-align:left} +.toast .tx{flex:1;font-size:13px;line-height:1.35} +.toast .tx b{font-family:var(--display);font-size:14.5px} +@keyframes pop{from{transform:scale(.8) translateY(10px);opacity:0}} + +#hint{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 76px);background:var(--ink);color:#fff;border-radius:12px;padding:6px 12px;font-weight:800;font-size:12.5px;z-index:3;pointer-events:none;max-width:min(440px,calc(100% - 32px));text-align:center;box-shadow:3px 3px 0 rgba(30,38,64,.25)} + diff --git a/src/styles/40-modal.css b/src/styles/40-modal.css new file mode 100644 index 0000000..721724b --- /dev/null +++ b/src/styles/40-modal.css @@ -0,0 +1,110 @@ +/* modal */ +.seg.site{margin-top:4px;align-items:center} +.seg.site .meta{margin-right:4px} +.badges{display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:6px} +.bdg{border:2px solid #C9CEDD;border-radius:12px;padding:6px 7px;background:#F3F4F8;opacity:.6;display:flex;flex-direction:column;gap:1px;min-width:0} +.bdg .bi{font-size:20px;filter:grayscale(1)} +.bdg .bt{font:800 12.5px/1.2 "Baloo 2",sans-serif;color:var(--ink)} +.bdg .br{font:900 10px Nunito,sans-serif;color:var(--rc);text-transform:uppercase;letter-spacing:.04em} +.bdg .bd{font-size:11px;color:#5A6280;line-height:1.25} +.bdg.ever{opacity:.85;border-style:dashed;border-color:var(--rc)} +.bdg.on{opacity:1;border-color:var(--rc);background:#fff;box-shadow:0 2px 0 var(--rc)} +.bdg.on .bi,.bdg.ever .bi{filter:none} +.scn{display:flex;gap:10px;align-items:center;border:2px solid #DDE1EC;border-radius:12px;padding:8px 10px;margin-top:8px} +.scn.wk{border-color:var(--me);background:#FFF0F6} +.scn .nm{font-weight:900} +.term{background:#1E2640;color:#7CFFB2;font:600 12px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;padding:10px 12px;border-radius:10px;overflow-x:auto;white-space:pre;margin:8px 0} +.trsel{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end;margin-top:8px} +.trsel label{display:flex;flex-direction:column;font:800 12px Nunito,sans-serif;gap:2px} +.trsel select{font:700 14px Nunito,sans-serif;padding:4px 6px;border:2px solid var(--ink);border-radius:8px;max-width:240px} +.fact.trb{cursor:pointer;font:inherit;border:2px solid var(--ink);background:#fff} +#coach{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 74px);z-index:16;width:min(520px,calc(100% - 24px));background:#fff;border:3px solid var(--ink);border-radius:14px;box-shadow:0 4px 0 var(--ink);padding:8px 10px;display:flex;gap:8px;align-items:center} +#coach .ct{flex:1;font-weight:800;font-size:14px;line-height:1.35} +#coach .cs{display:block;font:900 10px Nunito,sans-serif;color:var(--me);text-transform:uppercase;letter-spacing:.05em} +.coach-glow{animation:coachglow 1s ease-in-out infinite;position:relative;z-index:2} +@keyframes coachglow{0%,100%{box-shadow:0 0 0 0 rgba(255,79,154,.9)}50%{box-shadow:0 0 0 6px rgba(255,79,154,.35)}} +@media (prefers-reduced-motion:reduce){:root:not(.anim-force) .coach-glow{animation:none;outline:3px solid #FF4F9A}} +:root.no-anim .coach-glow{outline:3px solid #FF4F9A} +.setline{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:4px 0} +.setline>span{font-weight:800} +.thb{font:inherit;font-weight:900;background:none;border:0;padding:0;cursor:pointer;color:inherit} +.ttop{margin:4px 0;padding:4px 8px;border-left:3px solid #FF8A3D;background:#FFF6EC;border-radius:6px} +.ibx{border:2px solid var(--line,#DDE3EE);border-radius:12px;padding:8px 10px;margin:8px 0;background:#fff}.ibx .nm{font-weight:800}.ibx.mp{border-color:#FF5A5F;background:#FFF1F1}.ibx.ai{border-color:#8E5CF7;background:#F7F2FF}.ibx .term{font-size:11.5px;white-space:pre-wrap;max-height:180px;overflow:auto}.ibx .cnt{display:inline-block;min-width:18px;padding:0 5px;border-radius:9px;background:var(--me);color:#fff;font-size:11px;text-align:center}.ibx .cnt.red{background:#FF5A5F} +.aibtn{background:linear-gradient(90deg,#8E5CF7,#E84FA8);color:#fff}.aisay{background:#F3ECFF;border:2px solid #8E5CF7;border-radius:10px;padding:8px 10px;color:var(--ink)} +.tehelp h3{margin:14px 0 4px}.tehelp ul{margin:4px 0;padding-left:18px}.tehelp li{margin:4px 0;font-size:13.5px;line-height:1.4}.tehelp dt{margin-top:8px}.tehelp dd{margin:2px 0 0;font-size:13px;line-height:1.4;color:var(--ink2)}.tehelp code{font:600 12.5px ui-monospace,Menlo,Consolas,monospace;background:#1E2640;color:#E6F0FF;border-radius:6px;padding:1px 6px;word-break:break-word} +.terec{display:flex;align-items:center;gap:10px;justify-content:space-between;border-top:2px dashed var(--line,#DDE3EE);padding:8px 0}.terec .btn{flex:none} +.tecode{width:100%;box-sizing:border-box;font:600 13px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#1E2640;color:#E6F0FF;border:3px solid var(--ink);border-radius:10px;padding:10px;margin-top:8px;resize:vertical;tab-size:2} +.term.err{color:#FF9AA5} +.menu-list{display:flex;flex-direction:column;gap:8px;margin-top:12px} +.menu-list .b{justify-content:space-between;width:100%} +#mega{position:fixed;left:0;right:0;bottom:0;z-index:17;background:#7A86B8;border-top:3px solid var(--ink);overflow:hidden;white-space:nowrap;pointer-events:none;animation:megaflash 1.2s steps(2) infinite} +#mega .mtrack{display:inline-block;padding:7px 0;animation:megascroll 40s linear infinite;font:900 16px "Baloo 2",sans-serif;color:#fff;text-shadow:0 2px 0 var(--ink)} +#mega span{margin:0 28px} +#mega span::after{content:"🐘";margin-left:56px} +@keyframes megascroll{from{transform:translateX(0)}to{transform:translateX(-50%)}} +@keyframes megaflash{0%{background:#7A86B8}50%{background:#FF4D5E}} +@media (prefers-reduced-motion:reduce){#mega,#mega .mtrack{animation:none}} +#update{position:fixed;left:50%;transform:translateX(-50%);top:calc(env(safe-area-inset-top,0px) + 70px);z-index:18;width:min(520px,calc(100% - 24px));pointer-events:auto} +#update .b{pointer-events:auto} +.notes{margin:10px 0 0;padding-left:20px;line-height:1.5} +.notes li{margin:4px 0} +#bankBox{position:fixed;inset:0;background:rgba(30,38,64,.35);z-index:16;overflow:auto;padding:calc(env(safe-area-inset-top,0px) + 12px) max(12px,env(safe-area-inset-right,0px)) 16px max(12px,env(safe-area-inset-left,0px))} +#bankCard{max-width:760px;margin:0 auto;padding:16px 18px 18px;background:var(--paper)} +.menubtn{cursor:pointer;text-align:left;font:inherit;border-color:var(--ink)} +.menubtn .caret{font-size:13px;margin-left:2px;opacity:.85} +.cashbtn{cursor:pointer;text-align:left;font:inherit;color:inherit;position:relative} +.cashbtn .badge{position:absolute;top:-8px;right:-8px;background:var(--me);color:#fff;border:2.5px solid var(--ink);border-radius:10px;font:900 11px Nunito,sans-serif;padding:0 6px;line-height:16px} +.loan{border:2.5px solid var(--ink);border-radius:14px;padding:10px 12px;margin-top:10px;display:flex;gap:10px;align-items:flex-start} +.loan .grow{flex:1;min-width:0} +.loan .terms{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0} +.grade{font-family:var(--display);font-weight:800;font-size:30px;line-height:1;border:3px solid var(--ink);border-radius:12px;padding:4px 10px;background:var(--sun)} +#dash{position:fixed;inset:0;background:rgba(30,38,64,.35);z-index:15;overflow:auto;padding:calc(env(safe-area-inset-top,0px) + 12px) max(12px,env(safe-area-inset-right,0px)) 16px max(12px,env(safe-area-inset-left,0px))} +#dashCard{max-width:980px;margin:0 auto;padding:16px 18px 18px;background:var(--paper)} +.dgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;margin:10px 0} +.tile{border:2.5px solid var(--ink);border-radius:13px;padding:6px 10px;background:var(--soft)} +.tile .lbl{font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:var(--ink2)} +.tile .val{font-family:var(--display);font-weight:800;font-size:22px;line-height:1.1;font-variant-numeric:tabular-nums} +.tile .sub{font-size:11.5px;color:var(--ink2);font-weight:700} +.dcols{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:12px} +@media (max-width:760px){.dcols{grid-template-columns:minmax(0,1fr)}} +.panel2{border:2.5px solid var(--ink);border-radius:14px;padding:10px 12px;min-width:0} +.panel2 h3{font-size:17px;margin-bottom:4px} +.chart{width:100%;height:auto;display:block} +.legend{display:flex;flex-wrap:wrap;gap:10px;font-size:11.5px;font-weight:800;color:var(--ink2);margin-top:4px} +.legend i{display:inline-block;width:11px;height:11px;border-radius:3px;border:1.5px solid var(--ink);margin-right:5px;vertical-align:-1px} +.tbl{width:100%;border-collapse:collapse;font-size:12.5px;font-variant-numeric:tabular-nums} +.tbl th{text-align:left;font-size:10px;letter-spacing:.07em;text-transform:uppercase;color:var(--ink2);padding:4px 6px;border-bottom:2px solid var(--ink)} +.tbl td{padding:5px 6px;border-bottom:1px solid var(--line);vertical-align:middle} +.tbl td.r,.tbl th.r{text-align:right} +.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%} +.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} +.title-art{display:flex;align-items:center;gap:14px} +.title-art h1{font-family:var(--display);font-weight:800;font-size:clamp(34px,7vw,52px);line-height:.95;margin:0;letter-spacing:-.01em} +.title-art h1 span{color:var(--me)} +.tagline{color:var(--ink2);font-size:14.5px;line-height:1.45;margin:10px 0 14px} +label.f{display:block;font-weight:900;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink2);margin:12px 0 5px} +input.t{width:100%;box-sizing:border-box;border:3px solid var(--ink);border-radius:12px;padding:8px 12px;font-family:var(--display);font-weight:800;font-size:18px;background:var(--soft)} +.network-name{display:flex;flex-wrap:wrap;align-items:center;gap:8px} +.network-name input.t{flex:1 1 240px;width:auto;min-width:0} +.plug{display:flex;gap:12px;align-items:center;border:3px solid var(--ink);border-radius:14px;padding:10px 12px;margin:10px 0 4px;background:var(--soft);box-shadow:0 3px 0 var(--ink);color:var(--ink);text-decoration:none} +.plug:hover{background:#FFF6D6}.plug .pi{font-size:30px;line-height:1}.plug b{font-family:var(--display);font-size:16px}.plug .meta{display:block;margin-top:2px}.plug .go{margin-left:auto;font-weight:900;white-space:nowrap} +.starts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.starts .start:last-child:nth-child(odd){grid-column:1/-1} +.start{border:3px solid var(--ink);border-radius:14px;padding:8px 10px;background:var(--paper);cursor:pointer;text-align:left;box-shadow:0 3px 0 var(--ink)} +.starts.one{grid-template-columns:1fr} +.start.on{background:#FFE3F0;border-color:var(--me);box-shadow:0 3px 0 var(--me)} +.start b{font-family:var(--display);font-size:17px;display:block} +.start span{font-size:12px;color:var(--ink2);line-height:1.3;display:block} +.tiers{display:grid;gap:7px;margin-top:10px} +.tierbtn{display:flex;align-items:center;gap:10px;border:3px solid var(--ink);border-radius:13px;padding:8px 12px;background:var(--paper);cursor:pointer;box-shadow:0 3px 0 var(--ink);text-align:left} +.tierbtn:hover{background:#FFF6CF} +.tierbtn:disabled{opacity:.4;cursor:not-allowed} +.tierbtn .sz{font-family:var(--display);font-weight:800;font-size:22px;width:70px} +.tierbtn .grow{flex:1} +.tierbtn .pr{font-family:var(--display);font-weight:800;font-size:18px} +.gl dt{font-family:var(--display);font-weight:800;font-size:16px;margin-top:10px} +.gl dd{margin:2px 0 0;color:var(--ink2);line-height:1.45;font-size:13px} +.kbd{display:inline-block;border:2px solid var(--ink);border-radius:6px;padding:0 5px;font-weight:900;font-size:11px;background:var(--soft)} + diff --git a/src/styles/50-tablet.css b/src/styles/50-tablet.css new file mode 100644 index 0000000..3d86fd1 --- /dev/null +++ b/src/styles/50-tablet.css @@ -0,0 +1,38 @@ +/* Tablets in landscape (and small laptops): slimmer side panels, a tuck-away left panel and + bigger touch targets so the map keeps some room in the middle. */ +@media (min-width:761px) and (max-width:1200px){ + #left{width:272px} + #panel{width:336px} + #left.closed{display:none} + #leftToggle{display:flex;position:fixed;left:max(12px,env(safe-area-inset-left,0px));bottom:calc(env(safe-area-inset-bottom,0px) + 14px);z-index:4} + #leftToggle[hidden]{display:none} +} +@media (min-width:761px) and (max-width:1366px) and (pointer:coarse){ + .b.sm{min-height:32px;padding:5px 11px} + .tabs button{min-height:40px} + .speed button{min-height:34px} +} +/* Mid-size screens: keep the HUD on one row so it never wraps over the side panels. */ +@media (min-width:761px) and (max-width:1360px){ + #hud{gap:6px} + .chip{padding:3px 8px} + .speed{gap:3px;padding:4px 5px} + .speed button{min-width:29px;font-size:12px} +} +@media (min-width:761px) and (max-width:1180px){ + .hide-md{display:none !important} + .brand .val{font-size:17px} + .chip .val{font-size:17px} +} +@media (min-width:761px) and (max-width:960px){ + .brand>div{display:none} + .brand .caret{display:none} + .chip .lbl{font-size:9px} + .chip .val{font-size:15px} +} +@media (min-width:761px) and (max-width:1040px){ + .hide-md2{display:none !important} + .speed button{min-width:26px;height:28px;font-size:11.5px} + .chip{padding:2px 7px} +} + diff --git a/src/styles/60-phone.css b/src/styles/60-phone.css new file mode 100644 index 0000000..f761b4c --- /dev/null +++ b/src/styles/60-phone.css @@ -0,0 +1,111 @@ +/* ================= PHONES ================= + A decluttered, app-like layout: a one-row status strip at the top, a tab bar at the bottom + (play, speed, goals, deals, NOC, networks), and bottom sheets you drag up, down or away. */ +html,body{overscroll-behavior:none} +.dtabs{position:sticky;top:-12px;z-index:3;display:flex;gap:6px;overflow-x:auto;margin:10px -4px 4px;padding:8px 4px;background:var(--paper);border-bottom:2.5px solid var(--ink);scrollbar-width:none} +.dtabs button{flex:0 0 auto;font:800 13px Nunito,sans-serif;border:2.5px solid var(--ink);border-radius:999px;background:#fff;padding:5px 12px;cursor:pointer;color:var(--ink)} +.dtabs button.on{background:var(--pink,#FF4F9A);color:#fff} +.dtabs .cnt{display:inline-block;margin-left:5px;min-width:16px;padding:0 4px;border-radius:8px;background:var(--bad);color:#fff;font-size:10.5px;line-height:16px;text-align:center} +.pcard{border:2.5px solid var(--ink);border-radius:14px;padding:8px 10px;margin:0 0 10px;background:#FFF6CF} +.pcard .pt{font-weight:900;font-size:15px;margin:1px 0 2px}.pcard .kv{margin-top:5px}.pcard .bar{margin-top:2px} +.pcard.lv{background:#EAF6FF} +.pitch{list-style:none;padding:0;margin:10px 0}.pitch li{margin:7px 0;line-height:1.38;font-size:14px}.pitch li.warn{background:#FFF4D6;border:2px solid var(--ink);border-radius:10px;padding:6px 8px} +.isteps{padding-left:22px;margin:8px 0 4px}.isteps li{margin:5px 0;line-height:1.38;font-size:14px}.isteps svg{vertical-align:-3px} +.icard{margin:8px 0 10px;border:2.5px solid var(--ink);border-radius:14px;padding:8px 10px;background:#FFF4D6} +/* iPhone home-screen app with a viewport shorter than the screen: the page box takes the real screen height + and becomes the containing block for everything fixed, so bottom-anchored UI reaches the bottom. */ +html.iosfix,html.iosfix body{height:var(--app-h)} +html.iosfix body{position:fixed;top:0;left:0;right:0;transform:translateZ(0)} +button,.chip,.b,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent} +#hud,#tabbar,.tabs,.grab{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none} +#tabbar,.grab{display:none} +@media (max-width:760px),(max-height:500px) and (pointer:coarse){ + :root{--tabbar:calc(58px + env(safe-area-inset-bottom,0px))} + #hud{flex-wrap:nowrap;top:calc(env(safe-area-inset-top,0px) + 6px);left:max(8px,env(safe-area-inset-left,0px));right:max(8px,env(safe-area-inset-right,0px));gap:5px} + #hud .speed,#hud #hNoc,#hud .spacer{display:none !important} + #hud .chip{flex:0 1 auto;min-width:0} + #hud .chip .lbl{font-size:8.5px;letter-spacing:.05em} + #hud .cashbtn{flex:0 1 auto} + #leftToggle{display:none !important} + #tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:9;height:var(--tabbar);padding:6px max(6px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(6px,env(safe-area-inset-left,0px));background:var(--paper);border-top:3px solid var(--ink);box-sizing:border-box;gap:2px;align-items:stretch} + #tabbar button{flex:1 1 0;min-width:0;border:0;background:transparent;border-radius:12px;font:inherit;font-weight:900;font-size:10.5px;color:var(--ink2);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;padding:2px 0;position:relative} + #tabbar button .ic{font-size:19px;line-height:1.05;color:var(--ink)} + #tabbar button.on{background:var(--soft);color:var(--ink)} + #tabbar button.play .ic{font-size:21px} + #tabbar button.play.paused{background:#FFE3F0} + #tabbar .cnt{position:absolute;top:2px;right:calc(50% - 22px);min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:var(--me);color:#fff;font-size:10px;line-height:16px;box-sizing:border-box} + #tabbar .cnt.red{background:var(--bad)} + #left,#panel{top:auto !important;left:0 !important;right:0 !important;width:auto !important;bottom:var(--tabbar) !important;max-height:min(62%,calc(100% - var(--tabbar) - 70px)) !important;border-radius:20px 20px 0 0 !important;border-bottom:0 !important;box-shadow:0 -3px 0 var(--ink) !important;transition:max-height .22s ease,transform .22s ease;z-index:7} + #left.full,#panel.full{max-height:calc(100% - var(--tabbar) - 56px - env(safe-area-inset-top,0px)) !important} + #left.closed{display:none} + .grab{display:block;height:22px;flex:0 0 22px;cursor:grab;touch-action:none;position:relative} + .grab::before{content:"";position:absolute;left:50%;top:8px;width:42px;height:5px;margin-left:-21px;border-radius:3px;background:var(--line)} + #left .tabs{display:none} + .ph{padding-top:0 !important} + .ph h2{font-size:21px} + .ph .eyebrow{font-size:10px} + #panel .tags,#panel .ph .btns{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none} + #toasts{top:calc(env(safe-area-inset-top,0px) + 54px) !important;bottom:auto !important;width:calc(100% - 16px) !important;flex-direction:column !important;pointer-events:auto} + .toast{pointer-events:auto;padding:6px 10px;border-width:2.5px;box-shadow:2px 2px 0 var(--ink);border-radius:12px} + .toast .tx{font-size:12px;line-height:1.3} + .toast .tx b{font-size:12.5px} + #hint{top:auto !important;bottom:calc(var(--tabbar) + 10px) !important} + body.sheet-open #hint{display:none} + #coach{top:auto !important;bottom:calc(var(--tabbar) + 8px);width:calc(100% - 16px);padding:7px 10px;font-size:13px} + body.sheet-open #coach{bottom:calc(var(--tabbar) + 8px + min(62vh,520px))} + #modal{align-items:end;padding:0} + #modal .cta{position:sticky;bottom:calc(-16px - env(safe-area-inset-bottom,0px));z-index:1;background:var(--paper);margin:12px -16px 0 !important;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));border-top:2px solid var(--line)} + .title-art h1{font-size:34px}.title-art svg{width:54px;height:54px} + .tagline{font-size:13.5px;margin:8px 0 10px} + #modal .card{box-sizing:border-box;width:100%;max-height:calc(100% - env(safe-area-inset-top,0px) - 24px);border-radius:22px 22px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));border-bottom:0} + #dash{padding:calc(env(safe-area-inset-top,0px) + 6px) 0 0} + #dash>.card{border-radius:20px 20px 0 0;min-height:100%} + #mega{bottom:calc(var(--tabbar) + 6px)} + #update{top:auto !important;bottom:calc(var(--tabbar) + 8px) !important;width:calc(100% - 16px) !important;flex-wrap:wrap;gap:6px 8px;padding:8px 10px} + #update .tx{flex:1 1 100%} + #update .b{flex:1 1 0} +} +/* Phones on their side: the sheets slide in from the right and leave the map visible. */ +@media (orientation:landscape) and (max-height:500px) and (pointer:coarse),(orientation:landscape) and (max-width:760px) and (max-height:500px){ + :root{--tabbar:calc(50px + env(safe-area-inset-bottom,0px))} + #left,#panel{left:auto !important;right:0 !important;width:min(440px,58%) !important;top:calc(env(safe-area-inset-top,0px) + 50px) !important;max-height:none !important;border-radius:20px 0 0 0 !important;border-right:0 !important} + #left.full,#panel.full{width:min(640px,80%) !important} + #tabbar button .ic{font-size:16px} + body.sheet-open #coach{bottom:calc(var(--tabbar) + 8px);left:8px;transform:none;width:calc(42% - 16px)} +} +/* Installed as an app: no browser chrome, so leave room for the notch and the home indicator. */ +@media (display-mode: standalone){ + body{background:#57C4E5} +} +/* Whatever the language, the HUD stays on one row: fitHud() drops chips until it fits. */ +#hud.fit1 .hide-md2,#hud.fit2 .hide-md{display:none !important} +#hud.fit3 .brand>div,#hud.fit3 .brand .caret{display:none} +@media (max-width:760px){ + .chip{min-height:40px;padding:2px 8px} + .chip .val{font-size:16px} + .chip .lbl{font-size:9px} + .brand .val{font-size:16px} + .hide-sm{display:none !important} + #hud{gap:6px} + .chip{min-height:34px;padding:2px 7px;border-width:2.5px;box-shadow:2px 2px 0 var(--ink);border-radius:11px} + .chip .val{font-size:14px} + .chip .sub{font-size:10px} + .brand .tube{width:22px;height:22px} + .brand>div{display:none} + .speed{padding:2px 4px;gap:3px} + .speed button{min-width:28px;height:26px;font-size:11.5px;border-width:2px;border-radius:7px} + .spacer{display:none} + #left{top:auto} + #left{top:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 8px);left:8px;right:8px;width:auto;max-height:55%} + #left.closed{display:none} + #leftToggle{display:flex;position:fixed;left:max(12px,env(safe-area-inset-left,0px));bottom:calc(env(safe-area-inset-bottom,0px) + 14px);z-index:4} + #panel{top:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 8px);left:8px;right:8px;width:auto;max-height:58%;z-index:6} + .ph h2{font-size:22px} + #hint{top:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 70px)} + #toasts{bottom:auto;top:calc(env(safe-area-inset-top,0px) + 112px);flex-direction:column;width:calc(100% - 24px)} + .toast{padding:6px 10px;border-width:2.5px;box-shadow:2px 2px 0 var(--ink)} + .toast .tx{font-size:12px} + .toast .tx b{font-size:13px} +} +@media (prefers-reduced-motion:reduce){:root:not(.anim-force) *{animation:none !important;transition:none !important}} +:root.no-anim *{animation:none !important;transition:none !important} diff --git a/tests/build.test.js b/tests/build.test.js index fb743e7..a6c9966 100644 --- a/tests/build.test.js +++ b/tests/build.test.js @@ -8,7 +8,7 @@ const OUT = require('node:fs').mkdtempSync(require('node:path').join(require('no const root = path.join(__dirname, '..'); test('build stamps version and date into the site', () => { - execFileSync('bash', ['scripts/build.sh'], { cwd: root, env: { ...process.env, OUT, VERSION: '9.9.9', BUILD_DATE: '2030-01-01' } }); + execFileSync(process.execPath, ['scripts/build.js'], { cwd: root, env: { ...process.env, OUT, VERSION: '9.9.9', BUILD_DATE: '2030-01-01' } }); const html = fs.readFileSync(path.join(OUT, 'index.html'), 'utf8'); assert.match(html, /const APP_VERSION='9\.9\.9'/); assert.match(html, /"softwareVersion": "9\.9\.9"/); @@ -19,7 +19,7 @@ test('build stamps version and date into the site', () => { }); test('version.json carries the release notes from the changelog', () => { - execFileSync('bash', ['scripts/build.sh'], { cwd: root, env: { ...process.env, OUT, VERSION: '1.0.0', BUILD_DATE: '2026-10-23' } }); + execFileSync(process.execPath, ['scripts/build.js'], { cwd: root, env: { ...process.env, OUT, VERSION: '1.0.0', BUILD_DATE: '2026-10-23' } }); const v = JSON.parse(fs.readFileSync(path.join(OUT, 'version.json'), 'utf8')); assert.equal(v.version, '1.0.0'); assert.ok(v.notes.length >= 5); @@ -27,7 +27,7 @@ test('version.json carries the release notes from the changelog', () => { }); test('head carries the SEO and social metadata', () => { - const html = fs.readFileSync(path.join(root, 'site', 'index.html'), 'utf8'); + const html = require('../scripts/lib/page').assemble().html; for (const needle of ['', 'property="og:image"', 'name="twitter:card"', 'application/ld+json', 'rel="manifest"', 'name="description"']) { assert.ok(html.includes(needle), `missing ${needle}`); } @@ -37,6 +37,19 @@ test('head carries the SEO and social metadata', () => { }); test('a release build refuses to ship without release notes', () => { - assert.throws(() => execFileSync('bash', ['scripts/build.sh'], { cwd: root, stdio: 'pipe', env: { ...process.env, OUT, VERSION: '9.9.9', REQUIRE_NOTES: '1' } })); - assert.throws(() => execFileSync('bash', ['scripts/build.sh'], { cwd: root, stdio: 'pipe', env: { ...process.env, OUT, VERSION: '1.0; rm -rf /' } }), 'junk versions are rejected'); + assert.throws(() => execFileSync(process.execPath, ['scripts/build.js'], { cwd: root, stdio: 'pipe', env: { ...process.env, OUT, VERSION: '9.9.9', REQUIRE_NOTES: '1' } })); + assert.throws(() => execFileSync(process.execPath, ['scripts/build.js'], { cwd: root, stdio: 'pipe', env: { ...process.env, OUT, VERSION: '1.0; rm -rf /' } }), 'junk versions are rejected'); +}); + +test('src: partials follow the layout rules (docs/adr/0002-one-page-assembled-at-build.md)', () => { + const { listFiles, assemble } = require('../scripts/lib/page'); + const src = path.join(root, 'src'); + for (const f of listFiles(src)) { + if (f === 'index.html' || f === 'i18n/en.js') continue; + assert.match(f, /^(styles\/(\d\d-[a-z0-9-]+\/)*\d\d-[a-z0-9-]+\.css|game\/(\d\d-[a-z0-9-]+\/)*\d\d-[a-z0-9-]+\.js)$/, `${f}: name it NN-lower-case under styles/ or game/`); + } + const { html, map } = assemble(); + assert.equal((html.match(/^const ACT=\{$/gm) || []).length, 1, 'ACT is declared once; other action files use Object.assign(ACT,{…})'); + assert.equal((html.match(/"); + assert.ok(labels.has('pnis.ok_label') && labels.has('pnis.kept')); + assert.ok(problems.some((p) => p.includes('pnis.foo_bar') && p.includes('N_()')), 'a bare label'); + assert.ok(problems.some((p) => p.includes('not a label')), 'English text where a label belongs'); +}); diff --git a/tests/inbox.test.js b/tests/inbox.test.js index 4146bfa..7acb7f3 100644 --- a/tests/inbox.test.js +++ b/tests/inbox.test.js @@ -154,7 +154,7 @@ test('the AI agent answers everything, costs $20M a year and gets it wrong a lot ev('Math.random=()=>0.1;inboxBot()'); assert.equal(ev('S.inbox.items.length'), 0, 'inbox zero'); assert.ok(ev('S.ev.leak&&S.ev.leak.until>S.day'), 'and a route leak'); - assert.ok(ev("S.inbox.log.some(e=>/They seemed nice/.test(e.m))")); + assert.ok(ev("S.inbox.log.some(e=>/They seemed nice/.test(tr(e.m,e.a)))"), 'the log keeps a label, read in the language of the player'); ev('ACT.inbox()'); assert.match(ev("document.getElementById('modalCard').textContent"), /They seemed nice/); // and sometimes it gets it right diff --git a/tests/pages.test.js b/tests/pages.test.js new file mode 100644 index 0000000..3d0a74b --- /dev/null +++ b/tests/pages.test.js @@ -0,0 +1,88 @@ +// The game is hosted on GitHub Pages and only there (docs/adr/0001-github-pages-only.md). These tests make +// sure every build stays something Pages serves as it is: plain static files, all from one origin. +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const { execFileSync } = require('node:child_process'); + +const root = path.join(__dirname, '..'); +const OUT = fs.mkdtempSync(path.join(os.tmpdir(), 'tubes-pages-')); +execFileSync(process.execPath, ['scripts/build.js'], { cwd: root, stdio: 'pipe', env: { ...process.env, OUT, VERSION: '1.2.3', BUILD_DATE: '2026-10-27' } }); + +const files = (dir, rel = '') => fs.readdirSync(path.join(dir, rel), { withFileTypes: true }).flatMap((e) => { + const r = path.posix.join(rel, e.name); + return e.isDirectory() ? files(dir, r) : [{ r, e }]; +}); +const built = files(OUT); +const read = (f) => fs.readFileSync(path.join(OUT, f), 'utf8'); + +// Files that only mean something to other hosts or to a server. On Pages they would be served as plain +// files (or ignored), so their presence means someone is designing for a different host. +const FOREIGN = /(^|\/)(_redirects|_headers|\.htaccess|netlify\.toml|vercel\.json|wrangler\.toml|firebase\.json|staticwebapp\.config\.json|now\.json|app\.yaml|Procfile|Dockerfile|nginx\.conf|server\.js|package\.json)$|\.(php|py|rb|cgi)$/; + +test('pages: the build is plain static files within GitHub Pages limits', () => { + let total = 0; + for (const { r, e } of built) { + assert.ok(e.isFile(), `${r} is a regular file (no symlinks)`); + assert.doesNotMatch(r, FOREIGN, `${r} is server or other-host configuration`); + const size = fs.statSync(path.join(OUT, r)).size; + assert.ok(size < 100e6, `${r} is under the 100 MB file limit`); + total += size; + } + assert.ok(total < 1e9, 'the site is under the 1 GB limit'); + for (const f of ['index.html', '404.html', 'CNAME', 'version.json', 'sw.js']) assert.ok(fs.existsSync(path.join(OUT, f)), `${f} is shipped`); + assert.equal(read('CNAME').trim(), 'seriesoftub.es'); +}); + +test('pages: the repository has no hosting configuration for anywhere else', () => { + for (const f of fs.readdirSync(root)) assert.doesNotMatch(f, /^(netlify\.toml|vercel\.json|wrangler\.toml|firebase\.json|staticwebapp\.config\.json|now\.json|app\.yaml|Procfile|Dockerfile|_redirects|_headers)$/, `${f} configures another host`); +}); + +test('pages: every local file the site refers to is in the build', () => { + const html = read('index.html'); + const refs = new Set(); + for (const m of html.matchAll(/\b(?:src|href)="([^"]+)"/g)) refs.add(m[1]); + for (const m of read('sw.js').matchAll(/'(\/[^']*)'/g)) refs.add(m[1]); + for (const i of JSON.parse(read('site.webmanifest')).icons || []) refs.add(i.src); + const local = [...refs].filter((u) => !/^(https?:|data:|mailto:|#|\$\{|javascript:)/.test(u) && !u.includes('${') && !u.includes("'+")); + assert.ok(local.length >= 5, 'found the local references'); + for (const u of local) { + const p = u.split(/[?#]/)[0].replace(/^\//, '') || 'index.html'; + assert.ok(fs.existsSync(path.join(OUT, p)), `${u} resolves inside the build`); + } + // Same origin for code: the only scripts from elsewhere are the analytics counter, and no stylesheets + // but the web fonts (see the ADR). + for (const m of html.matchAll(/]*\bsrc="(https?:[^"]+)"/g)) assert.fail(`page loads a script from ${m[1]}`); + for (const m of html.matchAll(/]*rel="stylesheet"[^>]*href="(https?:[^"]+)"/g)) assert.match(m[1], /^https:\/\/fonts\.googleapis\.com\//); +}); + +test('pages: only the release workflow deploys, and only with the GitHub Pages actions', () => { + const dir = path.join(root, '.github', 'workflows'); + for (const f of fs.readdirSync(dir)) { + const y = fs.readFileSync(path.join(dir, f), 'utf8'); + assert.doesNotMatch(y, /netlify|vercel|wrangler|cloudflare\/pages-action|firebase deploy|surge\.sh|peaceiris\/actions-gh-pages|aws s3 sync|rsync /i, `${f} deploys somewhere other than GitHub Pages`); + if (f !== 'release.yml') assert.doesNotMatch(y, /pages:\s*write|deploy-pages/, `${f} must not deploy`); + } + const rel = fs.readFileSync(path.join(dir, 'release.yml'), 'utf8'); + assert.match(rel, /actions\/upload-pages-artifact@/); + assert.match(rel, /actions\/deploy-pages@/); + assert.match(rel, /path: \.\/_site/); +}); + +test('pages: the shipped page and dictionaries, with labels shrunk to ids, still say the right things', () => { + const { load } = require('./harness'); + const file = path.join(OUT, 'index.html'), dir = path.join(OUT, 'i18n'); + assert.doesNotMatch(read('index.html'), /tr\('pnis\.delivery/, 'labels are shrunk in the shipped page'); + for (const [lang, word] of [['en', 'Customers'], ['it', 'Clienti'], ['fr', null]]) { + const { ev, errors } = load(lang === 'en' ? { file } : { file, lang, dir }); + ev("ACT.start({});S.cash=1e8;ACT.launchBB({city:'fra'});for(let i=0;i<40;i++)dayTick();ACT.leftTab({t:'noc'});renderAll()"); + const text = ev("['hud','leftBody','panelBody','modalCard','toasts'].map(i=>document.getElementById(i)?.textContent||'').join(' ')"); + if (word) assert.ok(text.includes(word), `${lang}: ${word}`); + assert.doesNotMatch(text, /\b[a-z_]+\.[a-z0-9_]{6,}\b/, `${lang}: no raw labels`); + assert.equal(ev("tr(FLOOD_WHO[0])"), ev("tr('failures.a_botnet_of_40_000_smart')"), `${lang}: labels kept for saves still translate`); + assert.notEqual(ev("tr(FLOOD_WHO[0])"), 'failures.a_botnet_of_40_000_smart'); + assert.deepEqual(errors, []); + } +}); diff --git a/tests/perf.test.js b/tests/perf.test.js index fe7ac39..a4233af 100644 --- a/tests/perf.test.js +++ b/tests/perf.test.js @@ -25,7 +25,7 @@ test('perf bench: runs end to end on a small save and compares a version with it const save = path.join(dir, 'save.json'), js = path.join(dir, 'out.json'); fs.writeFileSync(save, JSON.stringify({ app: 'series-of-tubes', version: 'test', S: JSON.parse(ev('JSON.stringify(S)')) })); const md = execFileSync(process.execPath, [path.join(__dirname, '..', 'scripts', 'perf-bench.js'), '--save', save, - '--base', path.join(__dirname, '..', 'site', 'index.html'), '--runs', '3', '--json', js], { encoding: 'utf8' }); + '--base', require('../scripts/lib/page').pageFile(path.join(dir, 'base.html')), '--runs', '3', '--json', js], { encoding: 'utf8' }); assert.match(md, /2 POPs/, 'reads an exported save'); assert.match(md, /Routing results are identical to the base/); assert.match(md, /\| Routing: compute\(\) \|/); diff --git a/tests/persist.test.js b/tests/persist.test.js index 2a871c8..733b1ef 100644 --- a/tests/persist.test.js +++ b/tests/persist.test.js @@ -32,7 +32,7 @@ test('leaving the page saves the game', () => { test('returning players see what is new after an update, once', () => { const { saved } = playedGame(); - execFileSync('bash', ['scripts/build.sh'], { cwd: root, env: { ...process.env, OUT, VERSION: '1.1.0', BUILD_DATE: '2026-10-23' } }); + execFileSync(process.execPath, ['scripts/build.js'], { cwd: root, env: { ...process.env, OUT, VERSION: '1.1.0', BUILD_DATE: '2026-10-23' } }); const file = path.join(OUT, 'index.html'); const b = load({ file, storage: { 'sot-save-v1': saved, 'sot-seen-version': '1.0.0' } }); const text = b.ev("document.getElementById('modalCard').textContent");
📦 ${tr('common.supply_chain')}
+
${tr('common.hardware_prices')}${t>1.005?tr('supply_chain.p_since_you_started',{p:pct(t-1)}):tr('supply_chain.as_when_you_started')}
+ ${s?`
${tr('common.shortage')}${tr('supply_chain.what_p_n_days_left',{what:tr(HW_SHOCK[s.k].n),p:pct(s.mul-1),n:s.until-S.day})}
`:''} + ${l?`
${tr('common.price_lock')}${tr('supply_chain.until_date_at_p',{date:dateStr(l.until),p:pct(l.mul-1)})}
` + :`

${tr('supply_chain.routers_optics_and_new_builds_at')}

${btn(tr('supply_chain.lock_prices_for_a_year_cost',{cost:fmt$(hwLockCost())}),'hwLock',{},'sm',S.cash`}
`;} +const routerCost=g=>Math.round((ROUTER_COST+RG[g].cost*0.8)*hwMul('rt')); +// Old routers go on eBuy when you swap models or remove one (#82), like spare optics (#45). Chassis age faster. +const ROUTER_RESALE=0.3,tradeIn=(g,n)=>Math.round(RG[g].cost*n*ROUTER_RESALE),swapCost=(c,g)=>{const p=S.pops[c],rt=p.routers||1;return Math.max(0,Math.round(RG[g].cost*rt*hwMul('rt'))-tradeIn(p.rgen||0,rt));}; +const RMAX=6; +// The plain, badge-less model of each class is the default upgrade path; the others are side-grades. +const mainRG=k=>RG.findIndex(r=>r.cls===k&&!r.badge); +// Ports and waves beyond 1.6T / 6.4T only show once a router that takes them is unlocked. +const portShown=i=>i<=4||RG.some(r=>r.lvl<=lvl()&&r.maxP>=i),waveShown=i=>i<=5||RG.some(r=>r.lvl<=lvl()&&r.maxLT>=i); diff --git a/src/game/10-catalog/40-ports.js b/src/game/10-catalog/40-ports.js new file mode 100644 index 0000000..6dbccc1 --- /dev/null +++ b/src/game/10-catalog/40-ports.js @@ -0,0 +1,22 @@ +/* Ports are finite. Every transit, IX, PNI and cache port, every wave and every fibre channel + takes a router port. 10G ports ride a breakout cable, four to a port. */ +const PORT_SLOT=i=>i===0?0.25:1; +function portsUsed(c){let u=0; + for(const l of S.links){if(l.a!==c&&l.b!==c||l.kind==='vxc')continue;u+=l.kind==='df'?(l.ch||[]).length:1;} + for(const t of S.transit)if(t.city===c)u+=PORT_SLOT(t.tier)*(t.n||1); + for(const x of S.pni)if(x.city===c)u+=PORT_SLOT(x.tier)*(x.n||1); + for(const x of ixIdsIn(c))if(S.ixp[x]!==undefined&&!S.myIx[x])u+=PORT_SLOT(S.ixp[x])*((S.ixn||{})[x]||1); + if(S.myIx[c])u+=1; + u+=S.caches.filter(x=>x.city===c).length+(S.nni||[]).filter(x=>x.city===c).length; + return u;} +function portsMax(c,g,rt){const p=S.pops[c];if(!p)return 0;return RG[g===undefined?(p.rgen||0):g].ports*(rt||p.routers||1);} +function portGate(c,add){if(!S.pops[c]||add<=0)return true;const u=portsUsed(c),m=portsMax(c);if(u+add<=m+1e-9)return true; + toast(tr('ports.no_free_router_ports_in_city',{city:esc(CITY[c].name),u:fmtPorts(u),m}),'bad');sfx('err');return false;} +// Nothing depends on this POP yet: no broadband, nothing plugged in, no customer. Work here bothers nobody (#105). +const popIdle=c=>{const p=S.pops[c];return !!p&&!p.bb&&portsUsed(c)===0&&!S.biz.some(b=>b.city===c||b.city2===c||(b.sites||[]).includes(c));}; +const fmtPorts=u=>Number.isInteger(u)?String(u):u.toFixed(2).replace(/0+$/,''); +function modelFits(c,g){const G=RG[g],p=S.pops[c];if(!p)return ''; + if(S.links.some(l=>(l.a===c||l.b===c)&&l.kind==='wave'&&l.tier>G.maxLT))return tr('ports.a_wave_here_is_faster_than',{pn:G.pn}); + if([...S.transit,...S.pni].some(t=>t.city===c&&t.tier>G.maxP)||ixIdsIn(c).some(x=>S.ixp[x]!==undefined&&!S.myIx[x]&&S.ixp[x]>G.maxP))return tr('ports.a_port_here_is_bigger_than',{pn:G.pn}); + if(S.links.some(l=>(l.a===c||l.b===c)&&l.kind==='df'&&(l.ch||[]).some(o=>OPT[o]&&OPT[o].rg>G.cls)))return tr('ports.a_fibre_here_uses_optics_this'); + if(portsUsed(c)>portsMax(c,g))return tr('ports.you_use_u_ports_here_and',{u:fmtPorts(portsUsed(c)),r:p.routers||1,model:G.n,max:portsMax(c,g)});return '';} diff --git a/src/game/10-catalog/50-dark-fiber.js b/src/game/10-catalog/50-dark-fiber.js new file mode 100644 index 0000000..932e7c3 --- /dev/null +++ b/src/game/10-catalog/50-dark-fiber.js @@ -0,0 +1,39 @@ +// dark fiber & optical gear +const DF_SYS={ + lite:{n:'Rainbow-in-a-Box DWDM',max:16,cost:25000,lvl:2,blurb:tr('dark_fiber.fixed_mux_plus_amplifiers_up_to')}, + roadm:{n:'ROADMaster 9000',max:64,cost:60000,lvl:3,blurb:tr('dark_fiber.full_c_band_remotely_reconfigurable')}, + cl:{n:'ROADMaster 9000 C+L',max:128,cost:140000,lvl:6,blurb:tr('dark_fiber.lights_the_l_band_as_well')}, +}; +const AMP_EVERY=100, AMP_COST=8000, AMP_MO=300; +/* Your own trench holds more than one fiber pair (#35). Once a ROADMaster is full you can light the next pair: + another ROADMaster and another chain of amplifiers, 64 more channels. Regen huts are shared. */ +const isRdm=y=>y==='roadm'||y==='cl'; +const PAIRS_MAX=4,PAIRS_BIG=8,PAIRS_LV=12,SUB_PAIRS_MAX=8,SUB_PAIR_UP=1500000,pairsMax=l=>l.sub?SUB_PAIRS_MAX:lvl()>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,chMax=l=>DF_SYS[l.sys].max*(isRdm(l.sys)&&l.own?Math.max(1,l.pairs|0):1), + pairCost=l=>DF_SYS[isRdm(l.sys)?l.sys:'roadm'].cost+(l.sub?SUB_PAIR_UP:ampCount(l.km)*AMP_COST); +const OPT={ + zr4:{n:'Ackackia 400ZR+',g:400,cost:12000,reach:1500,modes:[[400,1500],[200,3000]],rg:1,lvl:2,sys:'lite',blurb:tr('dark_fiber.coherent_pluggable_in_the_router_no')}, + zr8:{n:'Sizzle 800ZR+',g:800,cost:22000,reach:900,modes:[[800,900],[400,1800],[200,3600]],rg:2,lvl:3,sys:'lite',blurb:tr('dark_fiber.twice_the_speed_shorter_reach')}, + tp16:{n:'Sienna WaveMagic 1.6T',g:1600,cost:70000,reach:4000,modes:[[1600,4000],[1200,5500],[800,7000],[400,12000]],rg:2,lvl:4,sys:'roadm',blurb:tr('dark_fiber.big_shelf_big_reach_big_invoice')}, + tp32:{n:'Sienna WaveMagic 3.2T',g:3200,cost:130000,reach:1500,modes:[[3200,1500],[1600,4000],[1200,5500],[800,7000],[400,12000]],rg:4,lvl:8,sys:'roadm',blurb:tr('dark_fiber.twice_the_wavemagic_full_speed_only')}, +}; +const dfLeaseMo=km=>Math.round(400+km*1.0); +const dfBuildCost=km=>Math.round((25000+km*120)*hwMul('build')); +const dfBuildDays=km=>Math.round(120+km*0.25); +const ampCount=km=>Math.max(0,Math.floor(km/AMP_EVERY)); +const fmtCap=g=>g>=1000?(+(g/1000).toFixed(1))+'T':g+'G'; +const WAVECO=['Zay-No Fiber','Loomin’ Technologies','Clown Castle Fiber','Bolt Technology','youNetworks','G&T (Gin and Transit)']; +const MONTHS=[tr('common.jan'),tr('common.feb'),tr('common.mar'),tr('common.apr'),tr('common.may'),tr('common.jun'),tr('common.jul'),tr('common.aug'),tr('common.sep'),tr('common.oct'),tr('common.nov'),tr('common.dec')]; +const REG={AM:tr('common.americas'),SA:tr('common.south_america'),EU:tr('common.europe'),AF:tr('common.africa'),AS:tr('common.asia'),OC:tr('common.oceania')}; +const waveMo=(km,sub,tier)=>Math.round((300+km*1.2)*LT[tier].m*(sub?1.8:1)); +const FABS=[ + {id:'mgp',name:'Megapork',col:'#FF5A1F',cities:['mel','bne','per','adl','icn','sea','sjc','dal','chi','ash','nyc','mia','lon','ams','fra','par','mrs','sto','mad','sin','hkg','tok','syd','jnb'],blurb:tr('dark_fiber.elastic_interconnection_now_with')}, + {id:'pkf',name:'PocketFabric',col:'#00A896',cities:['sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra'],blurb:tr('dark_fiber.a_whole_network_fabric_that_fits')}, + {id:'ccn',name:'Consolation Connect',col:'#8E44AD',cities:['icn','lon','fra','ams','mrs','bom','sin','hkg','tok','syd','lag','jnb'],blurb:tr('dark_fiber.strong_in_asia_and_africa_every')}, +]; +const FAB=Object.fromEntries(FABS.map(f=>[f.id,f])); +const NNI=[{n:'10G',g:10,mo:500},{n:'100G',g:100,mo:1200}]; +const VXC=[{n:'10G',g:10,m:1},{n:'50G',g:50,m:2.4},{n:'100G',g:100,m:3.6}]; +const vxcMo=(km,sub,t)=>Math.round((150+km*0.12)*VXC[t].m*(sub?2:1)); +const MET={prefer:{l:tr('common.prefer'),f:0.5},normal:{l:tr('common.normal'),f:1},avoid:{l:tr('common.avoid'),f:4},backup:{l:tr('common.backup_only'),f:60}}; +const PREF={high:tr('common.prefer'),normal:tr('common.normal'),low:tr('common.backup_only')}; +const edgeKey=l=>l.aMath.ceil(l.km/((l.regen|0)+1)); +/* Subsea glass is engineered end to end for one route: ultra-low-loss, large-area fiber and a repeater every + ~70 km, no regens (#66, #68). Optics reach about half as far again as on land, and the same physics caps + every wave on a cable, leased or your own: transatlantic gets 1.6T, transpacific 800G. */ +const SUB_REACH=1.5,reachOn=(r,sub)=>sub?Math.round(r*SUB_REACH):r; +const SUB_MAXKM=()=>subReach(1,1); +// Upgrades improve long-haul modes, not the nominal 1.6T/3.2T rate. +const SUB_UPGRADES={terminal:{n:N_('reach_and_subsea.premium_submarine_terminals'),cost:5000000,days:30},engineering:{n:N_('common.optical_engineering'),cost:12000000,days:180}}; +const subUpgradeReady=(l,k)=>l.kind==='df'&&l.sub&&l.own&&Number.isFinite(l['sub'+k])&&l['sub'+k]<=S.day; +const subUpgradeCost=(l,k)=>SUB_UPGRADES[k].cost+(k==='engineering'?Math.round(l.km*1000):0); +// Pending transmission work follows the construction schedule. Keep the actual +// shift (the last crew purchase can save fewer than 30 days) and completed work. +function setCableReady(l,ready,day=S.day){const shift=ready-l.ready; + if(l.kind==='df'&&l.own&&l.sub)for(const k of Object.keys(SUB_UPGRADES)){ + const f='sub'+k;if(Number.isFinite(l[f])&&l[f]>day)l[f]=Math.max(day+1,l[f]+shift); + }l.ready=ready; +} +const crewCost=l=>Math.round(15000+l.km*6); +const crewSteps=l=>Math.max(0,Math.ceil((l.ready-S.day-1)/30)); +// Old saves lack purchase dates. Only shorten dates beyond any valid remaining +// commissioning window. Credit elapsed time since the actual cable finish; +// recent purchases and installed upgrades stay untouched. +function repairSubUpgradeDates(l,day){if(l.kind!=='df'||!l.own||!l.sub)return; + for(const [k,U] of Object.entries(SUB_UPGRADES)){const f='sub'+k; + if(Number.isFinite(l[f])&&l[f]>Math.max(day,l.ready)+U.days)l[f]=l.ready+U.days; + } +} +function optModes(o,l){return (OPT[o].modes||[[OPT[o].g,OPT[o].reach]]).map(([g,r])=>{ + let reach=reachOn(r,l.sub); + if(l.sub&&['tp16','tp32'].includes(o)&&g<=1200){ + if(subUpgradeReady(l,'terminal'))reach=Math.max(reach,({1200:9000,800:13500,400:20000})[g]||reach); + if(subUpgradeReady(l,'engineering'))reach=Math.round(reach*1.25); + } + return [g,reach];});} +function optMode(o,l){const km=spanKm(l);for(const [g,r] of optModes(o,l))if(km<=r)return {g,reach:r,full:g===OPT[o].g};return null;} +// The longest subsea span any optic lights with these upgrades in service, and the cheapest upgrades a length needs +// (null: nothing can light it). The length limit, the order screen and refunds all use these, so they agree. +const SUBR=[],subReach=(t,e)=>SUBR[(t?1:0)+(e?2:0)]??(SUBR[(t?1:0)+(e?2:0)]=Math.max(...Object.keys(OPT).flatMap(o=>optModes(o,{kind:'df',own:true,sub:true,subterminal:t?0:undefined,subengineering:e?0:undefined}).map(m=>m[1])))), + subNeed=km=>km<=subReach(0,0)?[]:km<=subReach(1,0)?['terminal']:km<=subReach(0,1)?['engineering']:km<=subReach(1,1)?['terminal','engineering']:null; +// Upgrades a cable of this length still needs on top of the chosen ones; ['design'] when nothing can light it. +const seaLack=(km,up)=>{const n=subNeed(km);return n?n.filter(k=>!up[k]):['design'];}; +const submarineRate=l=>Math.max(0,...Object.keys(OPT).filter(o=>OPT[o].lvl<=lvl()&&(OPT[o].sys!=='roadm'||isRdm(l.sys||'roadm'))).map(o=>optG(o,l))); +// The fastest single carrier any optic can run over this much subsea cable. +const subCarrier=km=>Math.max(0,...Object.values(OPT).map(O=>{const m=(O.modes||[[O.g,O.reach]]).find(([,r])=>km<=reachOn(r,true));return m?m[0]:0;})); +// A big leased wave is several carriers (6.4T = 4×1.6T), so each carrier has to make it across on its own. +const waveCar=i=>LT[i].car||LT[i].g; +function subWaveWhy(i,km,sub){if(!sub)return '';const c=subCarrier(km);return waveCar(i)>c?tr('common.km_km_of_cable_carries_at',{km:Math.round(km).toLocaleString(),g:fmtCap(c)}):'';} +const subMaxTier=km=>{let t=0;LT.forEach((T,i)=>{if(!subWaveWhy(i,km,true))t=i;});return t;}; +// What an optic carries depends only on the optic, the span length and subsea or not; the map and compute() ask a lot. +// Cached per optic, span and cable state: subsea, and which submarine upgrades are in service (#78). +const OPTG={};const optG=(o,l)=>{const km=spanKm(l),fl=l.sub?1+(subUpgradeReady(l,'terminal')?2:0)+(subUpgradeReady(l,'engineering')?4:0):0,c=OPTG[o]||(OPTG[o]=[]),m=c[fl]||(c[fl]=new Map());let g=m.get(km);if(g===undefined){const x=optMode(o,l);m.set(km,g=x?x.g:0);}return g;}; +const regenNeed=(o,l)=>Math.max(0,Math.ceil(l.km/OPT[o].reach)-1); +const dfCap=l=>{if(l.ready>S.day||l.eqDown>S.day)return 0;const ch=l.ch||[];let g=0;for(const c of ch)g+=optG(c,l);const f=l.chFail&&l.chFail.until>S.day?l.chFail:null;if(f){const fo=f.o&&ch.includes(f.o)?f.o:ch.slice().sort((a,b)=>optG(a,l)-optG(b,l))[0];if(fo)g-=optG(fo,l);}return Math.max(0,g);}; +const capOf=l=>(l.kind==='vxc'?VXC[l.vt].g:l.kind==='df'?dfCap(l):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')return 0;const g=dfCap(l);return g>=6400?4:g>=1600?3:g>=400?2:g>=100?1:0;}; +const capName=l=>l.kind==='vxc'?VXC[l.vt].n:l.kind==='df'?(l.ready>S.day?tr('common.building'):(l.ch||[]).length?fmtCap(dfCap(l)||(l.ch||[]).reduce((a,c)=>a+optG(c,l),0))+' DF':tr('common.dark')):LT[l.tier].n; + diff --git a/src/game/20-world/10-projection.js b/src/game/20-world/10-projection.js new file mode 100644 index 0000000..f47fa68 --- /dev/null +++ b/src/game/20-world/10-projection.js @@ -0,0 +1,7 @@ +/* ================= WORLD ================= */ +// Simplified real geography: lon/lat outlines, equirectangular, with gentle "magnifying lenses" over the busy regions. +const LENSES=[{lon:102.5,lat:2.6,r:22,m:1.1},{lon:52.5,lat:25.3,r:45,m:1.5},{lon:78.5,lat:15,r:48,m:1.1},{lon:-44.5,lat:-23.5,r:30,m:1.2},{lon:9,lat:49,r:170,m:1.25},{lon:121,lat:32,r:120,m:0.45},{lon:-80,lat:40,r:110,m:0.5}]; +function proj0(lon,lat){return [(lon+180)/360*W,(84-lat)*6.4];} +for(const L of LENSES){const q=proj0(L.lon,L.lat);L.x=q[0];L.y=q[1];} +function proj(lon,lat){const q=proj0(lon,lat);let dx=0,dy=0;for(const L of LENSES){let ex=q[0]-L.x;ex-=W*Math.round(ex/W);const ey=q[1]-L.y,f=L.m*Math.exp(-(ex*ex+ey*ey)/(L.r*L.r));dx+=ex*f;dy+=ey*f;}return [q[0]+dx,q[1]+dy];} +function hav(lo1,la1,lo2,la2){const r=Math.PI/180,dLa=(la2-la1)*r,dLo=(lo2-lo1)*r,a=Math.sin(dLa/2)**2+Math.cos(la1*r)*Math.cos(la2*r)*Math.sin(dLo/2)**2;return 2*6371*Math.asin(Math.min(1,Math.sqrt(a)));} diff --git a/src/game/20-world/20-landmasses.js b/src/game/20-world/20-landmasses.js new file mode 100644 index 0000000..0bf46b6 --- /dev/null +++ b/src/game/20-world/20-landmasses.js @@ -0,0 +1,45 @@ +const LANDS_LL=[ + {id:'am',ll:[[-166,68],[-157,71.2],[-141,69.8],[-128,70],[-115,68.5],[-97,68],[-94,62],[-92.5,57.5],[-85,55.2],[-80,51.5],[-78.5,58],[-77,62],[-70,61],[-64.5,60],[-61.5,56.5],[-57,52],[-55.6,49.5],[-53,47],[-59,46.5],[-61,45.2],[-63.2,44.4],[-66,44.5],[-70,43.3],[-70,42],[-74,40.6],[-76,38],[-75.8,35.5],[-77.5,34.5],[-79,33],[-81,31],[-80.05,27],[-80.1,25.3],[-81.5,25],[-82.7,27.5],[-84,30],[-89,30.2],[-94,29.5],[-97,28],[-97.5,25],[-97.7,22],[-96,19],[-94,18.3],[-91,18.5],[-90.4,21],[-87,21.5],[-88,17],[-88.5,15.8],[-84,15.8],[-83.4,12],[-83.7,10.5],[-81.5,9],[-79.5,9.5],[-77.5,8.6],[-75,10.8],[-71.5,12.3],[-68,10.6],[-62,10.5],[-60,8],[-57,6],[-52,5],[-50,1.5],[-48,-1],[-44,-2.5],[-39,-3.5],[-35,-5.5],[-35,-9],[-37.5,-12.5],[-39,-15],[-39.7,-19],[-41,-22],[-44,-23],[-48,-26],[-48.6,-28.5],[-51,-31],[-53,-34],[-58,-34.5],[-57,-37],[-62,-39],[-65,-41],[-64,-43],[-67.5,-46],[-66,-48],[-69,-51],[-68.5,-53],[-70,-55],[-73,-53],[-75,-48],[-73.5,-43],[-73.5,-37],[-71.5,-32],[-71.3,-27],[-70.5,-20],[-71.5,-17],[-76,-14],[-78,-10],[-81,-6],[-80.5,-3],[-80,0],[-79,1.5],[-77.5,4],[-77.4,7.5],[-80,7.3],[-82.5,8.2],[-85.7,10],[-87,12.5],[-91,14],[-94,16],[-96.5,15.7],[-100,17],[-105.5,20],[-105.5,22.5],[-108,25.5],[-110.8,27.9],[-113,31.3],[-114.7,31.7],[-113.5,29],[-112,26.5],[-110,24],[-109.5,23],[-112,24.8],[-114,27.5],[-115.5,29.8],[-117,32.5],[-118.5,34],[-120.6,34.6],[-122.5,37.5],[-124,40.5],[-124.5,43],[-124,46.2],[-124.7,48.4],[-123,49],[-126,50.5],[-130,54.5],[-133,57.5],[-137,58.5],[-141,60],[-146,61],[-150,59.5],[-152,58.5],[-156,57.5],[-158,56.8],[-162,55.5],[-164.5,54.5],[-158,58.5],[-162,60],[-165,61.5],[-166,64],[-164,65.5]]}, + {id:'eu',ll:[[-9,39],[-9.5,43],[-8,43.7],[-1.8,43.4],[-1.2,46],[-2.5,47.3],[-4.5,48],[-1.6,48.6],[1.5,50.2],[3,51.2],[4.5,52.5],[5,53.4],[7,53.6],[8.6,54],[8.2,55.5],[8.1,57],[10.5,57.7],[10.5,56.5],[11.2,56],[12.6,56.1],[12.7,55.6],[12.1,54.9],[11,54.3],[14,54],[18.5,54.8],[21,55.3],[21,57],[24,57.5],[24,59.2],[28,59.5],[30,60],[28,60.5],[25,60.1],[22.5,60.3],[21.5,61.5],[21.5,63],[25,65],[25.5,65.6],[22,65.8],[20.5,63.5],[18,62.5],[17.4,61],[19,59.8],[18,59],[16.5,57],[16,56.2],[14.2,55.4],[13,55.4],[12.9,56.5],[11.5,58],[10.5,59.3],[8,58],[5.5,58.5],[5,60],[5,62],[7,63],[10,64],[12.5,66],[15,68.5],[18,69.8],[21.5,70.2],[26,71],[30,70],[33,69.3],[41,67],[44,68.5],[53,68.5],[58,69],[68,69],[69,72.8],[73,72.5],[80,73.5],[87,74.8],[100,76],[104,77.7],[112,74],[113.5,73.5],[127,73.5],[132,71.5],[140,72.5],[150,71.5],[160,70],[170,70],[180,69],[190,66.5],[186,64.5],[182,65],[178,62.5],[173,61],[170,60],[164,60],[164,57],[162,55],[159,52],[156.7,51],[156,55.5],[157,58],[155,59.5],[150,59.5],[143,59.3],[137,54.5],[141,53],[140,48.5],[135,43.5],[131,42.7],[129.5,41],[129.4,37],[129.4,35.5],[127.5,34.6],[126.3,34.8],[126.5,37],[125,37.8],[124.5,39.7],[121.5,39],[121.7,40.8],[119,39.3],[117.8,38.5],[119,37.2],[122.5,37.3],[120.5,36],[119.2,35],[121,32],[121.9,30.8],[121.5,28],[119.5,25.5],[116.5,23],[114.3,22.1],[111,21.5],[109.7,20.5],[108.5,21.6],[106.5,20],[106,18],[108.5,15],[109.3,12],[107,10.5],[105,8.6],[104.8,10.3],[103,11],[100.9,12.6],[100,13.4],[99.3,10.5],[100.3,7],[101,6.8],[103.4,4],[104.3,1.4],[103.6,1.25],[101.3,2.8],[100.2,5.3],[98.3,8],[98.6,13],[97.7,16.5],[94.4,16.2],[94.2,18.8],[92.3,20.6],[91.8,22.6],[90,22],[88.3,21.6],[86.9,20.6],[85,19.5],[82.3,16.6],[80.3,15.8],[80.3,13.5],[79.8,10.3],[78.3,8.9],[77.5,8.1],[76.5,8.9],[75.8,11.5],[74.8,12.9],[73.5,16],[72.8,19],[72.7,21.2],[70,22.5],[68.5,23.5],[66.6,25.4],[61.6,25.2],[57.3,25.8],[56.4,27.1],[54.7,26.5],[51.5,27.9],[50,30],[48,30],[48.4,28.5],[49.5,26.7],[50.8,24.8],[50.85,25.6],[51.2,26.15],[51.62,25.9],[51.62,24.6],[52.6,24.2],[54.3,24.6],[55.3,25.3],[55.9,25.75],[56.1,26.1],[56.35,26.38],[56.42,25.8],[56.38,25.0],[56.5,24.6],[57.8,23.8],[58.8,22.5],[59.8,22.4],[58.5,20.5],[57.7,19],[55.4,17.7],[52.2,15.7],[48.7,14],[45,12.8],[43.4,12.6],[42.7,15.7],[42.5,17.2],[41,19.5],[39.1,21.6],[38.4,23.6],[37,25.5],[35.2,28],[34.9,29.5],[34.3,27.8],[33,28.8],[32.6,30],[32.3,31.2],[34.2,31.3],[34.9,32.8],[35.6,34.5],[36,35.8],[36.2,36.7],[34.5,36.8],[32.5,36.1],[30.5,36.4],[29,36.6],[27.3,37.4],[26.3,38.6],[26.5,40],[26.2,40.6],[24,40.8],[22.6,40.4],[24.1,38.2],[24,37.6],[23.2,37.5],[22.3,36.5],[21.7,36.8],[21.2,38.4],[19.5,40],[19.5,41.8],[18.5,42.5],[16,43.5],[13.7,45.6],[12.3,45.3],[12.4,44.2],[13.6,43.5],[15.9,41.6],[18.5,40.2],[17,39],[16.6,38],[15.6,38],[15.3,37],[15.1,36.65],[12.4,37.8],[13.3,38.25],[15.55,38.3],[16.1,39],[15.6,40.1],[14.3,40.6],[12.5,41.6],[11,42.5],[10.2,43.9],[8.8,44.4],[7.5,43.8],[6,43.1],[4,43.5],[3.1,43.1],[3.2,41.9],[0.8,41],[0,39.5],[-0.3,38.4],[-0.8,37.6],[-2.1,36.7],[-4.4,36.7],[-5.6,36],[-6.3,36.8],[-7.4,37.2],[-8.9,37],[-8.8,38.4],[-9.5,38.6]]}, + {id:'af',ll:[[-17.5,14.7],[-17,21],[-16,24],[-13,27.5],[-9.8,30],[-9.2,32.5],[-6.8,34],[-5.9,35.8],[-2,35.1],[1,36.5],[5,36.8],[9.8,37.3],[11,36.9],[10.2,35.2],[11.1,33.3],[15.2,32.3],[19,30.3],[20.1,32],[23,32.6],[25,31.7],[29,30.9],[32.2,31.3],[32.6,30],[33.5,28],[35.5,24],[37.2,21],[38.5,18],[39.6,15.5],[41.6,13.5],[43.3,12.4],[44,10.4],[47,11.1],[51.2,11.8],[51,10.4],[49.5,7],[47.8,4.5],[45,1.6],[42,-1],[40.2,-2.8],[39.3,-4.8],[38.8,-6.5],[39.6,-10],[40.5,-11],[40.6,-14.6],[37,-17.5],[35.4,-22],[35.5,-24],[32.9,-25.9],[32.5,-28.6],[31,-29.9],[28,-32.7],[25.6,-33.9],[22.5,-34],[20,-34.8],[18.4,-34],[17.9,-32.5],[16.5,-28.6],[15.2,-27],[14.4,-23],[12.8,-19],[11.8,-16.8],[12.2,-14.5],[13.6,-12.2],[13.2,-8.8],[12.3,-6],[11.8,-3.5],[9.5,-1],[9.4,1],[9.8,3.2],[8.9,4.5],[6,4.3],[4.3,6.3],[1.6,6.2],[-2,4.8],[-4.6,5.2],[-7.5,4.4],[-9.4,5.4],[-11.5,6.9],[-13.2,8.7],[-15,10.9],[-16.7,12.4]]}, + {id:'uk',ll:[[-5.7,50.1],[-3,50.6],[1.4,51.2],[1.7,52.7],[0.3,53.4],[-0.2,54.3],[-1.6,55.6],[-2,56.4],[-1.8,57.6],[-3.4,58.6],[-5,58.6],[-6.2,57.5],[-5.6,56.3],[-5,55],[-3.2,54.9],[-3.4,54],[-3,53.4],[-4.6,53.3],[-4.2,52.2],[-5.2,51.7],[-3.2,51.4],[-4.6,51]]}, + {id:'ie',ll:[[-6,52.2],[-6.2,53.5],[-5.6,54.6],[-6.4,55.2],[-7.4,55.4],[-8.5,54.5],[-10,54.2],[-9.6,53.2],[-10.2,51.9],[-9.6,51.5],[-8.2,51.8]]}, + {id:'is',ll:[[-22.5,63.9],[-24,65.5],[-22,66.4],[-16,66.5],[-14.5,65.3],[-14.6,64.4],[-18,63.4]]}, + {id:'jp',ll:[[129.6,33.3],[130.2,31.3],[131.4,31.5],[132,33],[133.5,33.4],[135.2,33.6],[136.8,34.3],[138.8,34.6],[140,35],[140.8,35.7],[141,38.2],[141.9,39.5],[141.4,41.4],[140,41.4],[139.9,40.3],[139.8,38.5],[138.8,37.8],[137.3,36.9],[136,36],[135.4,35.6],[133,35.5],[131.5,34.6],[130.9,34]]}, + {id:'oc',ll:[[113.5,-22],[114,-26.5],[115,-30],[115.7,-33.6],[115,-34.3],[117.9,-35.1],[123.5,-33.9],[126,-32.3],[131,-31.5],[134,-32.8],[135.6,-34.8],[137.6,-35.6],[138.3,-34.5],[139.6,-36.9],[141.5,-38.4],[144.9,-37.9],[146.4,-39.1],[150,-37.5],[150.8,-34.5],[152.5,-32.4],[153.6,-28.5],[153,-25],[150.8,-22.5],[149,-20.6],[146.3,-18.9],[145.4,-16],[145.3,-14.9],[143.5,-12.3],[142.5,-10.7],[141.6,-12.8],[141.6,-16],[140.6,-17.6],[139.3,-17.4],[137,-15.9],[135.8,-15],[136.8,-12.2],[135,-12],[132.6,-11.5],[131,-12.2],[129.5,-14.9],[128,-15.4],[126.5,-13.9],[124.5,-16.5],[122.2,-18.2],[121,-19.7],[118.5,-20.3],[116.7,-20.6],[114.6,-21.8]]}, + {id:'tas',ll:[[144.6,-40.7],[146.5,-41.1],[148.3,-40.9],[148.3,-42.2],[147.9,-43.2],[146.9,-43.6],[146,-43.5],[145.2,-42.2],[144.7,-41.2]]}, + {id:'nz',ll:[[172.7,-34.4],[174.5,-36],[175.9,-37.5],[178.5,-37.7],[177.9,-39.2],[176.9,-39.6],[175.2,-41.6],[174.6,-41.2],[174.9,-39.9],[173.8,-39.3],[174.6,-38.1],[174.5,-37.3],[173.1,-35.3]]}, + {id:'nzs',ll:[[172.6,-40.5],[174.3,-41.0],[174.2,-41.7],[173.3,-42.9],[172.8,-43.9],[171.3,-44.4],[170.7,-45.8],[169.3,-46.6],[168.3,-46.6],[166.5,-46.0],[166.8,-45.3],[168.2,-44.0],[170.6,-43.0],[171.4,-41.8],[172.1,-40.9]]}, + {id:'idn',ll:[[105.2,-6.8],[106.8,-6.1],[108.5,-6.4],[110.5,-6.9],[112.6,-6.9],[114.6,-7.7],[114.4,-8.7],[111,-8.3],[108,-7.8],[105.5,-7]]}, + {id:'ph',ll:[[120.6,18.5],[122.2,18.5],[122,16.5],[121.6,14.2],[124,13.8],[124,12.5],[123.3,13],[121,13.6],[120.6,14.5],[119.8,16.2]]}, +]; +// South America is drawn as part of 'am' but counts as its own landmass: nothing crosses the Darién Gap. +// Atlantic islands, each its own landmass too. +LANDS_LL.push( + {id:'bm',ll:[[-65.18,32.59],[-64.38,32.59],[-64.38,31.99],[-65.18,31.99]]}, + {id:'az',ll:[[-26.07,38.04],[-25.27,38.04],[-25.27,37.44],[-26.07,37.44]]}, + {id:'ic',ll:[[-16.65,28.76],[-15.85,28.76],[-15.85,28.16],[-16.65,28.16]]}, + {id:'cv',ll:[[-23.91,15.22],[-23.11,15.22],[-23.11,14.62],[-23.91,14.62]]}, + {id:'sh',ll:[[-6.12,-15.63],[-5.32,-15.63],[-5.32,-16.23],[-6.12,-16.23]]}, +); +// Pacific islands, each its own landmass. +LANDS_LL.push( + {id:'hi',ll:[[-158.26,21.61],[-157.46,21.61],[-157.46,21.01],[-158.26,21.01]]}, + {id:'gu',ll:[[144.35,13.77],[145.15,13.77],[145.15,13.17],[144.35,13.17]]}, + {id:'pw',ll:[[134.08,7.64],[134.88,7.64],[134.88,7.04],[134.08,7.04]]}, + {id:'mh',ll:[[170.98,7.39],[171.78,7.39],[171.78,6.79],[170.98,6.79]]}, + {id:'pg',ll:[[146.78,-9.14],[147.58,-9.14],[147.58,-9.74],[146.78,-9.74]]}, + {id:'sb',ll:[[159.55,-9.13],[160.35,-9.13],[160.35,-9.73],[159.55,-9.73]]}, + {id:'nc',ll:[[166.06,-21.97],[166.86,-21.97],[166.86,-22.57],[166.06,-22.57]]}, + {id:'fj',ll:[[178.04,-17.84],[178.84,-17.84],[178.84,-18.44],[178.04,-18.44]]}, + {id:'to',ll:[[-175.60,-20.84],[-174.80,-20.84],[-174.80,-21.44],[-175.60,-21.44]]}, + {id:'ws',ll:[[-172.16,-13.53],[-171.36,-13.53],[-171.36,-14.13],[-172.16,-14.13]]}, + {id:'as',ll:[[-171.10,-13.98],[-170.30,-13.98],[-170.30,-14.58],[-171.10,-14.58]]}, + {id:'pf',ll:[[-149.97,-17.23],[-149.17,-17.23],[-149.17,-17.83],[-149.97,-17.83]]}, +); +LANDS_LL.push( + {id:'lk',ll:[[79.9, 9.8], [80.6, 9.6], [81.4, 8.5], [81.9, 7.4], [81.6, 6.4], [80.6, 5.9], [80.0, 6.2], [79.75, 7.2], [79.75, 8.3]]}, + {id:'sa',hide:true,ll:[[-77.5, 8.6], [-75, 10.8], [-71.5, 12.3], [-68, 10.6], [-62, 10.5], [-60, 8], [-57, 6], [-52, 5], [-50, 1.5], [-48, -1], [-44, -2.5], [-39, -3.5], [-35, -5.5], [-35, -9], [-37.5, -12.5], [-39, -15], [-39.7, -19], [-41, -22], [-44, -23], [-48, -26], [-48.6, -28.5], [-51, -31], [-53, -34], [-58, -34.5], [-57, -37], [-62, -39], [-65, -41], [-64, -43], [-67.5, -46], [-66, -48], [-69, -51], [-68.5, -53], [-70, -55], [-73, -53], [-75, -48], [-73.5, -43], [-73.5, -37], [-71.5, -32], [-71.3, -27], [-70.5, -20], [-71.5, -17], [-76, -14], [-78, -10], [-81, -6], [-80.5, -3], [-80, 0], [-79, 1.5], [-77.5, 4], [-77.4, 7.5]]}, + {id:'tw',ll:[[121.5, 25.35], [122.05, 25.0], [121.85, 24.3], [121.4, 23.0], [120.85, 21.9], [120.6, 22.3], [120.15, 22.9], [120.1, 23.6], [120.55, 24.5], [121.0, 25.1]]}, +); +const LANDS=LANDS_LL.map(l=>({id:l.id,hide:true,pts:l.ll.map(q=>proj(q[0],q[1]))})); diff --git a/src/game/20-world/30-coastline.js b/src/game/20-world/30-coastline.js new file mode 100644 index 0000000..fb1d07c --- /dev/null +++ b/src/game/20-world/30-coastline.js @@ -0,0 +1,4 @@ +// Drawn coastline: Natural Earth 1:50m land, simplified (tight around cities, looser elsewhere), lon/lat rings. Built by scripts/build-land.mjs. +// LANDS above is only the coarse landmass test that decides which landmass a city sits on (subsea vs overland); it is not drawn. +const COAST_LL=[[[180,68.98],[181.13,68.75],[181.94,68.27],[182.2,68.34],[181.63,68.57],[184.65,67.68],[184.63,67.36],[185.15,67.35],[185.08,66.62],[185.61,66.34],[185.91,66.47],[185.94,66.23],[186.22,66.43],[185.77,66.63],[185.91,66.94],[185.45,67.09],[186.84,67.07],[186.74,66.84],[187.48,66.95],[186.99,67.06],[188.2,66.93],[189.4,66.25],[190.27,66.06],[189.6,65.93],[189.33,65.62],[188.55,65.79],[188.83,65.5],[187.22,65.68],[187.77,65.45],[187.34,65.25],[187.79,65.05],[186.93,64.85],[187.62,64.43],[187.1,64.53],[186.84,64.28],[186.67,64.54],[186.27,64.36],[184.56,64.82],[183.91,65.47],[181.59,65.49],[181.06,66.03],[181.47,66.4],[181.08,66.18],[180.86,66.37],[180.22,66.02],[180.65,65.52],[179.45,64.82],[178.52,64.6],[176.41,65.07],[177.22,64.86],[176.06,64.96],[174.55,64.68],[176.06,64.9],[176.35,64.7],[176.14,64.59],[177.39,64.77],[177.69,64.3],[178.23,64.36],[178.69,63.84],[178.47,63.57],[179.33,63.19],[179.57,62.77],[179.12,62.32],[177.02,62.78],[177.16,62.56],[172.86,61.47],[172.39,61.06],[170.61,60.43],[170.35,59.97],[169.23,60.6],[167.23,60.41],[166.27,59.86],[166.35,60.48],[165.09,60.1],[164.96,59.84],[163.74,60.03],[161.96,58.08],[162.39,57.72],[162.66,57.95],[163.23,57.79],[162.76,57.24],[162.8,56.81],[163.26,56.69],[163.34,56.23],[162.84,56.06],[162.63,56.23],[163.04,56.52],[162.67,56.49],[162.09,56.09],[161.72,55.5],[162.1,54.75],[160.07,54.19],[159.84,53.78],[160.02,53.13],[158.47,53.03],[158.49,52.38],[158.1,51.81],[156.75,50.97],[155.56,55.2],[156.02,56.75],[156.85,57.29],[156.87,57.8],[158.27,58.01],[162.07,60.47],[163.71,60.92],[163.56,61.03],[164.01,61.34],[163.8,61.46],[164.21,62.29],[165.4,62.49],[164.42,62.71],[163.33,62.55],[163.09,61.57],[162.39,61.66],[160.17,60.64],[160.38,61.02],[159.79,60.96],[160.31,61.89],[157.09,61.68],[154.29,59.83],[154.15,59.53],[154.97,59.45],[155.16,59.19],[153.36,59.21],[152.82,58.93],[151.33,58.88],[151.12,59.08],[152.26,59.22],[149.64,59.77],[148.8,59.53],[148.96,59.37],[148.73,59.26],[146.54,59.46],[146.05,59.17],[145.55,59.41],[142.58,59.24],[140.79,58.3],[140.45,57.81],[138.66,56.97],[137.69,56.14],[135.26,54.94],[135.26,54.73],[135.85,54.58],[136.8,54.62],[136.72,53.8],[137.16,53.82],[137.14,54.18],[137.67,54.28],[137.34,54.1],[137.84,53.95],[137.25,53.55],[137.95,53.6],[138.53,53.96],[138.25,53.52],[138.45,53.54],[138.66,54.3],[139.71,54.28],[141.38,53.29],[141.18,53.01],[140.84,53.09],[141.26,52.84],[141.13,52.43],[141.49,52.18],[140.52,50.8],[140.38,48.96],[138.11,46.25],[135.13,43.53],[133.16,42.7],[132.3,42.88],[132.31,43.31],[131.95,43.1],[132.01,43.28],[131.8,43.25],[131.16,42.63],[130.71,42.66],[130.73,42.33],[129.76,41.71],[129.71,40.86],[127.57,39.78],[127.4,39.21],[128.33,38.68],[129.42,37.06],[129.56,35.95],[129.21,35.18],[128.51,35.1],[128.44,34.87],[127.71,34.96],[127.72,34.72],[127.4,34.82],[127.32,34.46],[127.25,34.76],[126.53,34.31],[126.27,34.67],[126.59,34.82],[126.29,35.15],[126.69,36.01],[126.54,36.17],[126.55,36.48],[126.49,36.69],[126.39,36.65],[126.18,36.69],[126.16,36.77],[126.22,36.87],[126.49,37.01],[126.78,36.95],[126.87,36.82],[126.98,36.94],[126.87,36.98],[126.74,37.19],[126.79,37.3],[126.65,37.45],[126.66,37.55],[126.56,37.72],[126.63,37.78],[126.37,37.88],[126.12,37.74],[126.05,37.87],[125.94,37.87],[125.77,37.99],[125.41,37.72],[124.99,37.93],[125.21,38.08],[124.69,38.13],[125.55,38.69],[125.17,38.81],[125.36,39.53],[124.64,39.61],[124.35,40.01],[122.84,39.6],[121.16,38.73],[121.11,38.92],[121.82,39.39],[121.27,39.55],[122.26,40.5],[121.83,40.97],[121.18,40.9],[120.48,40.23],[119.39,39.75],[118.98,39.18],[117.78,39.13],[117.65,38.42],[118.94,38.04],[119.11,37.2],[119.76,37.15],[120.75,37.83],[121.64,37.46],[122.67,37.4],[122.34,36.83],[121.93,36.96],[120.81,36.63],[120.64,36.13],[120.18,36.2],[120.29,35.98],[119.22,35.01],[119.2,34.75],[120.27,34.27],[120.86,32.66],[121.34,32.43],[121.4,32.37],[121.45,32.15],[121.68,32.05],[121.83,31.9],[121.87,31.7],[121.76,31.7],[121.35,31.86],[120.97,31.87],[120.79,32.03],[120.52,32.11],[120.07,31.96],[120.19,31.91],[120.5,32.02],[120.71,31.98],[120.79,31.82],[121.06,31.72],[121.66,31.32],[121.79,31.16],[121.88,30.92],[121.42,30.79],[121,30.56],[120.82,30.35],[120.45,30.39],[120.23,30.25],[120.5,30.3],[120.63,30.13],[120.91,30.16],[121.16,30.3],[121.26,30.3],[121.43,30.23],[121.68,29.98],[122.08,29.87],[121.91,29.78],[121.51,29.48],[121.97,29.49],[121.92,29.13],[121.45,29.13],[121.68,28.95],[121.47,28.64],[121.61,28.29],[121.15,28.33],[120.75,28.01],[120.09,26.67],[119.59,26.79],[119.88,26.33],[119.14,26.12],[119.62,26],[119.62,25.39],[119.18,25.45],[119.29,25.23],[118.98,25.21],[118.66,24.62],[117.84,24.47],[118.06,24.25],[117.37,23.59],[116.91,23.65],[116.47,22.95],[115.64,22.85],[115.5,22.72],[115.38,22.72],[115.2,22.82],[114.85,22.62],[114.75,22.63],[114.71,22.74],[114.65,22.75],[114.54,22.62],[114.55,22.53],[114.34,22.59],[114.27,22.54],[114.34,22.4],[114.27,22.3],[113.9,22.4],[114.01,22.51],[113.83,22.61],[113.62,22.86],[113.62,23.13],[113.45,23.05],[113.44,22.94],[113.33,22.91],[113.55,22.59],[113.59,22.35],[113.55,22.22],[113.15,22.08],[113.09,22.21],[113.01,22.12],[112.99,21.94],[112.9,21.88],[112.81,21.95],[112.66,21.86],[112.36,21.98],[112.3,21.74],[111.94,21.85],[111.6,21.56],[110.41,21.34],[110.16,20.94],[110.52,20.46],[110.12,20.26],[109.66,20.92],[109.93,21.48],[109.52,21.69],[109.08,21.44],[108.48,21.9],[108.5,21.63],[107.81,21.5],[107.16,20.95],[106.68,21],[106.52,20.29],[105.98,19.94],[105.62,18.97],[106.5,17.95],[106.35,17.77],[108.82,15.38],[109.3,13.86],[109.45,12.6],[109.22,12.65],[109.2,11.73],[108.99,11.34],[108.18,10.92],[108.1,10.9],[108,10.72],[107.84,10.7],[107.26,10.4],[107.09,10.5],[107.01,10.66],[106.95,10.4],[106.81,10.43],[106.73,10.54],[106.61,10.47],[106.74,10.44],[106.76,10.3],[106.47,10.3],[106.73,10.19],[106.79,10.12],[106.6,9.86],[106.14,10.22],[106.51,9.82],[106.57,9.64],[106.48,9.56],[106.38,9.56],[105.83,10],[106.16,9.59],[106.21,9.5],[106.17,9.4],[104.77,8.6],[105.03,10.07],[104.26,10.54],[103.59,10.55],[103.65,11.06],[103.15,10.91],[103.12,11.46],[102.65,12.15],[101.72,12.69],[101.44,12.62],[100.9,12.65],[100.86,12.72],[100.96,13.43],[100.6,13.57],[100.54,13.51],[100.23,13.48],[100.02,13.35],[99.99,13.24],[100.09,13.04],[99.96,12.69],[100.01,12.35],[99.16,10.32],[99.25,9.27],[99.83,9.29],[100.42,7.19],[101.5,6.86],[103.2,5.26],[103.45,4.67],[103.48,2.84],[103.81,2.58],[104.22,1.72],[104.28,1.42],[104.18,1.37],[103.98,1.62],[103.99,1.46],[103.69,1.45],[103.48,1.33],[103.36,1.55],[102.73,1.86],[102.55,2.04],[102.15,2.25],[101.78,2.57],[101.52,2.68],[101.3,2.89],[101.35,3.01],[101.3,3.25],[100.72,3.97],[100.8,4.02],[100.66,4.23],[100.26,6.18],[99.6,7.36],[98.24,8.42],[98.7,10.19],[98.56,10.03],[98.47,10.68],[98.88,11.72],[98.64,11.74],[98.57,13.16],[98.2,13.98],[98.11,13.71],[97.81,14.86],[97.58,16.02],[97.72,16.57],[97.38,16.52],[96.85,17.4],[96.77,16.71],[96.43,16.5],[96.19,16.77],[96.32,16.44],[95.39,15.72],[95.35,16.1],[95.18,15.83],[94.94,15.82],[94.89,16.18],[94.66,15.9],[94.7,16.51],[94.23,16.02],[94.59,17.57],[94.05,19.29],[93.93,18.9],[93.49,19.37],[93.83,19.24],[94,19.44],[93.71,19.91],[93.25,20.07],[93.13,19.86],[93.07,20.38],[92.83,20.18],[92.74,20.56],[92.72,20.3],[92.31,20.79],[91.86,22.35],[91.53,22.71],[91.48,22.88],[91.22,22.64],[90.95,22.6],[90.63,23.09],[90.6,23.59],[90.56,23.42],[90.27,23.46],[90.59,23.27],[90.6,23.13],[90.47,23.05],[90.55,22.91],[90.46,22.88],[90.43,22.75],[90.61,22.36],[90.55,22.22],[90.16,21.82],[90.21,22.16],[89.96,22.02],[89.89,22.31],[89.98,22.47],[89.88,22.39],[89.57,21.77],[89.48,22.28],[89.35,21.72],[89.05,22.09],[89.05,21.65],[88.75,21.58],[88.64,22.12],[88.58,21.66],[88.06,21.69],[88.2,22.14],[87.94,22.37],[88.16,22.12],[87.95,21.83],[86.86,21.24],[86.98,20.7],[86.75,20.31],[86.22,19.9],[85.25,19.76],[85.18,19.59],[85.44,19.63],[84.11,18.29],[82.36,17.1],[82.26,16.56],[81.29,16.34],[80.98,15.76],[80.38,15.79],[80.1,14.8],[80.18,14.48],[80.11,14.21],[80.31,13.49],[80.16,13.71],[80.06,13.61],[80.34,13.36],[80.23,12.69],[80.14,12.45],[79.86,11.99],[79.84,10.32],[79.31,10.26],[78.92,9.45],[79.41,9.19],[78.42,9.1],[78.06,8.38],[77.3,8.15],[76.4,9.24],[76.35,9.92],[74.94,12.56],[74.38,14.49],[73.47,16.05],[73.15,17.53],[72.87,18.64],[73.01,19.02],[72.97,19.15],[72.83,18.98],[72.8,19.08],[72.81,19.3],[72.99,19.28],[72.79,19.36],[72.75,19.45],[72.8,19.52],[72.73,19.58],[72.67,19.83],[72.9,20.67],[72.61,21.46],[73.11,21.75],[72.54,21.7],[72.7,21.97],[72.52,21.98],[72.81,22.23],[72.18,22.27],[72.04,21.82],[72.25,21.53],[72.02,21.16],[70.72,20.74],[68.97,22.29],[70.18,22.57],[70.49,23.09],[69.67,22.76],[69.24,22.85],[68.42,23.57],[68.78,23.85],[68.23,23.6],[68.16,23.86],[68.11,23.75],[68.04,23.85],[67.95,23.83],[67.86,23.9],[67.82,23.83],[67.67,23.81],[67.65,23.92],[67.56,23.88],[67.31,24.17],[67.17,24.76],[66.7,24.86],[66.7,25.23],[66.43,25.58],[66.22,25.59],[66.13,25.49],[66.36,25.51],[66.47,25.45],[66.24,25.46],[65.68,25.35],[61.41,25.1],[60.51,25.44],[59.05,25.42],[57.34,25.79],[57.21,26.04],[57.2,26.16],[56.73,27.13],[56.28,27.19],[55.42,26.77],[55.29,26.79],[54.9,26.56],[54.64,26.51],[54.52,26.59],[53.71,26.73],[52.48,27.62],[51.52,27.91],[50.07,30.2],[49.56,30.03],[49,30.51],[48.83,30.04],[47.98,30.01],[48.15,29.57],[47.72,29.39],[48.05,29.35],[48.8,27.72],[50.15,26.66],[50.15,26.1],[50.1,26.12],[50.08,25.96],[50.24,25.62],[50.46,25.42],[50.56,25.09],[50.81,24.79],[50.85,24.89],[50.76,25.45],[51,25.98],[51.26,26.15],[51.54,25.9],[51.57,25.78],[51.49,25.53],[51.61,25.05],[51.43,24.67],[51.27,24.61],[51.42,24.53],[51.31,24.34],[51.54,24.29],[51.6,24.34],[51.67,24.25],[51.77,24.25],[51.84,24.01],[52.12,23.97],[52.51,24.11],[53.03,24.15],[53.89,24.08],[54.4,24.28],[54.75,24.81],[55.1,25.04],[55.52,25.5],[55.94,25.79],[56.17,26.21],[56.31,26.24],[56.41,26.35],[56.37,25.8],[56.3,25.65],[56.36,25.57],[56.37,25.02],[56.64,24.47],[56.91,24.15],[57.22,23.92],[58.58,23.64],[59.84,22.42],[58.47,20.41],[58.17,20.59],[57.86,20.24],[57.81,19.02],[56.82,18.75],[56.38,17.99],[55.48,17.84],[55.06,17.04],[54.07,17],[52.45,16.39],[52.22,15.66],[51.6,15.34],[49.35,14.64],[48.67,14.05],[45.66,13.34],[45.04,12.82],[44.26,12.64],[43.49,12.7],[42.94,14.94],[42.66,15.23],[42.7,16.74],[41.66,18.01],[40.76,19.75],[40.08,20.27],[39.88,20.29],[39.73,20.39],[39.27,20.97],[39.09,21.31],[39.15,21.52],[38.99,21.88],[39.09,22.39],[39.01,22.77],[38.88,22.88],[38.94,22.88],[38.29,23.91],[37.54,24.29],[37.15,25.29],[35.18,28.04],[34.62,28.06],[34.97,29.55],[34.22,27.76],[33.25,28.57],[32.72,29.52],[32.56,29.97],[32.47,29.93],[32.49,29.85],[32.36,29.63],[32.4,29.53],[32.56,29.39],[32.66,28.93],[33.55,27.9],[33.96,26.65],[35.2,24.47],[35.78,23.94],[35.51,23.78],[35.7,22.95],[36.83,22.1],[37.26,21.11],[37.47,18.82],[38.57,18.07],[39.5,15.53],[39.79,15.12],[39.86,15.47],[40.2,15.01],[41.18,14.62],[43.3,12.46],[43.34,12.03],[42.54,11.51],[43.16,11.57],[44.28,10.47],[44.94,10.44],[45.82,10.84],[46.56,10.75],[47.4,11.17],[50.11,11.53],[50.79,11.98],[51.26,11.83],[51.03,10.44],[51.39,10.39],[50.93,10.34],[50.82,9.43],[47.98,4.5],[46.05,2.47],[43.72,0.86],[41.39,-1.87],[40.22,-2.69],[39.23,-4.67],[38.8,-6.07],[39.54,-7.02],[39.29,-7.52],[39.3,-8.44],[39.72,-10],[40.61,-10.66],[40.43,-12.94],[40.83,-14.79],[39.84,-16.44],[37.51,-17.57],[36.41,-18.77],[34.95,-19.81],[34.65,-19.7],[35.31,-22.4],[35.45,-22.12],[35.54,-22.3],[35.44,-24.17],[34.99,-24.65],[32.79,-25.64],[32.59,-26],[32.85,-26.27],[32.96,-26.08],[32.89,-26.83],[32.38,-28.5],[31.34,-29.38],[29.97,-31.32],[27.86,-33.05],[26.61,-33.71],[25.81,-33.74],[25.57,-34.04],[22.55,-34.01],[21.79,-34.37],[19.64,-34.75],[19.39,-34.6],[19.3,-34.62],[19.33,-34.49],[19.24,-34.41],[19.15,-34.42],[19.1,-34.35],[18.83,-34.36],[18.81,-34.11],[18.75,-34.08],[18.53,-34.09],[18.46,-34.17],[18.46,-34.35],[18.41,-34.3],[18.33,-34.07],[18.35,-33.94],[18.47,-33.89],[18.43,-33.72],[18.26,-33.42],[18.16,-33.36],[17.88,-32.96],[17.85,-32.83],[17.89,-32.75],[17.97,-32.71],[18.04,-32.78],[18.12,-32.75],[18.25,-32.65],[18.33,-32.5],[18.21,-31.74],[16.74,-29.01],[15.29,-27.28],[14.5,-24.2],[14.46,-22.45],[11.78,-18],[11.75,-15.83],[12.55,-13.44],[13.79,-11.81],[13.83,-10.93],[13,-9.05],[13.38,-8.37],[12.28,-6.12],[13.07,-5.87],[12.45,-6],[12.24,-5.81],[11.78,-4.57],[9.72,-2.47],[10.06,-2.55],[9.62,-2.37],[9.04,-1.31],[9.5,-1.55],[9.06,-1.3],[8.7,-0.59],[8.95,-0.69],[9.3,-0.35],[9.35,0.34],[9.8,0.04],[10,0.2],[9.33,0.55],[9.62,0.58],[9.6,1.05],[9.39,1.14],[9.81,1.93],[9.95,3.08],[9.56,3.8],[9.69,4.06],[9,4.09],[8.92,4.55],[8.57,4.53],[8.25,4.92],[8.29,4.56],[7.08,4.72],[6.92,4.39],[6.77,4.72],[6.86,4.37],[6.08,4.29],[5.49,4.84],[5.37,5.34],[5.55,5.47],[5.2,5.53],[5.46,5.61],[5.11,5.64],[4.86,6.03],[4.43,6.35],[4.13,6.41],[3.45,6.43],[3.75,6.58],[3.72,6.6],[3.43,6.52],[3.34,6.4],[1.82,6.26],[-2,4.76],[-3.25,5.11],[-3.02,5.13],[-3.2,5.35],[-3.35,5.13],[-5.28,5.21],[-5.06,5.13],[-7.54,4.35],[-8.26,4.59],[-11.73,7.09],[-12.49,7.39],[-12.48,7.75],[-12.85,7.82],[-13.27,8.43],[-12.89,8.63],[-13.18,8.58],[-13.06,8.88],[-13.69,9.54],[-13.69,9.93],[-14.43,10.25],[-14.59,10.77],[-14.89,10.97],[-15.01,10.8],[-15.05,11.14],[-15.39,11.22],[-15.43,11.5],[-15.07,11.6],[-15.5,11.78],[-15.08,11.97],[-15.94,11.79],[-16.79,12.47],[-16.44,12.61],[-16.77,12.63],[-16.75,13.43],[-16.41,13.27],[-15.43,13.47],[-16.44,13.35],[-16.77,13.9],[-16.62,14.04],[-17.53,14.75],[-16.57,15.73],[-16.08,17.55],[-16.09,18.52],[-16.52,19.36],[-16.21,20.23],[-16.88,21.09],[-17.1,20.86],[-16.93,21.9],[-16.36,22.59],[-15.9,23.84],[-14.91,24.72],[-14.47,26.16],[-13.58,26.74],[-12.95,27.91],[-11.55,28.31],[-10.2,29.38],[-9.67,30.11],[-9.81,31.42],[-9.25,32.57],[-8.51,33.25],[-6.9,33.97],[-5.92,35.79],[-5.28,35.9],[-5.25,35.61],[-4.63,35.21],[-2.97,35.41],[-2.84,35.13],[-1.91,35.09],[1.26,36.52],[3.78,36.9],[5.29,36.65],[6.49,37.09],[7.91,36.86],[9.69,37.34],[9.83,37.14],[10.2,37.21],[10.41,36.73],[10.95,37.06],[11.13,36.87],[10.49,36.26],[11.12,35.24],[10.06,34.21],[10.31,33.73],[10.96,33.63],[11.2,33.25],[12.28,32.86],[13.28,32.92],[15.18,32.39],[15.71,31.43],[17.83,30.93],[18.94,30.29],[19.59,30.41],[20.01,30.8],[19.93,31.82],[20.12,32.22],[21.63,32.94],[23.09,32.62],[23.29,32.21],[24.88,31.98],[25.23,31.53],[26.77,31.47],[29.07,30.83],[30.22,31.26],[30.57,31.47],[30.92,31.57],[30.56,31.42],[31,31.46],[31.08,31.6],[32.14,31.34],[31.89,31.48],[31.77,31.29],[32.01,31.22],[32.1,31.09],[32.28,31.2],[32.21,31.29],[32.6,31.07],[33.67,31.13],[34.48,31.59],[35.98,34.55],[35.81,36.31],[36.18,36.81],[35.39,36.57],[34.7,36.82],[33.69,36.18],[32.79,36.04],[31.24,36.82],[30.65,36.87],[30.45,36.27],[29.69,36.16],[28.97,36.72],[27.46,36.71],[28.24,37.03],[27.26,36.98],[27.53,37.16],[27.07,37.66],[27.23,37.98],[26.29,38.28],[26.44,38.64],[26.67,38.34],[27.14,38.45],[26.76,38.71],[27.01,38.89],[26.68,39.29],[26.9,39.55],[26.09,39.52],[26.18,39.99],[26.74,40.4],[27.73,40.33],[27.85,40.38],[27.73,40.48],[27.99,40.49],[27.93,40.38],[27.96,40.37],[29.01,40.39],[29.05,40.42],[28.79,40.53],[29.05,40.65],[29.85,40.74],[29.36,40.81],[29.12,40.94],[29.05,41.01],[29.15,41.22],[29.92,41.15],[30.35,41.2],[31.25,41.11],[33.28,42],[35,42.06],[35.3,41.73],[36.05,41.68],[36.41,41.27],[38.38,40.93],[39.43,41.11],[40.13,40.94],[41.41,41.42],[41.76,41.97],[41.42,42.74],[38.72,44.29],[36.63,45.15],[36.87,45.43],[37.65,45.38],[37.93,46],[38.49,46.09],[37.77,46.64],[38.5,46.66],[38.44,46.81],[39.27,47.04],[39.02,47.27],[35.83,46.62],[35.02,46.11],[35.23,46.44],[34.85,46.19],[35.02,45.7],[35.46,45.32],[36.57,45.39],[36.39,45.07],[35.47,45.1],[33.91,44.39],[33.45,44.55],[33.55,45.1],[32.51,45.4],[33.67,45.95],[33.59,46.1],[31.83,46.28],[32.01,46.43],[31.56,46.56],[32.58,46.62],[32.05,46.64],[31.76,47.21],[31.87,46.65],[30.8,46.55],[30.22,45.87],[29.63,45.72],[29.56,44.84],[28.89,44.92],[28.56,43.5],[28.13,43.4],[27.89,42.75],[27.48,42.47],[27.98,42.05],[27.99,41.86],[28.2,41.56],[29.06,41.23],[28.96,41.01],[28.78,40.97],[28.17,41.08],[27.92,40.99],[27.5,40.97],[27.43,40.84],[26.2,40.07],[26.79,40.63],[24.48,40.95],[23.76,40.75],[24.34,40.15],[23.73,40.33],[23.95,39.97],[23.43,40.26],[23.63,39.92],[22.81,40.58],[22.59,40.04],[23.23,39.36],[23.33,39.18],[23.22,39.1],[23.12,39.13],[23.16,39.26],[22.99,39.33],[22.84,39.26],[22.97,39.03],[23.07,39.04],[22.8,38.9],[22.57,38.87],[23.25,38.66],[23.37,38.53],[23.57,38.49],[23.68,38.35],[23.97,38.27],[24.06,37.82],[24.05,37.71],[23.97,37.68],[23.5,38.03],[23.03,37.88],[23.15,37.8],[23.2,37.62],[23.39,37.58],[23.49,37.44],[23.16,37.33],[23.1,37.36],[23.1,37.44],[22.94,37.52],[22.78,37.59],[22.73,37.54],[23.06,36.85],[23.04,36.64],[23.11,36.55],[22.83,36.69],[22.78,36.79],[22.72,36.79],[22.49,36.45],[22.08,37.03],[21.89,36.74],[21.58,37.08],[21.68,37.39],[21.12,37.89],[21.83,38.33],[22.24,38.19],[22.92,37.96],[22.89,38.05],[23.12,38.07],[23.18,38.13],[23.15,38.18],[22.83,38.23],[22.42,38.44],[22.23,38.35],[21.11,38.39],[20.77,38.87],[21.12,39.03],[20.3,39.33],[19.85,40.04],[19.4,40.28],[19.58,41.79],[18.65,42.44],[17.04,43.02],[17.72,42.85],[16.9,43.39],[15.99,43.52],[15.19,44.17],[15.47,44.27],[14.55,45.3],[14.31,45.34],[13.86,44.84],[13.52,45.48],[13.78,45.63],[13.63,45.77],[12.27,45.45],[12.52,44.97],[12.25,44.72],[12.4,44.22],[13.56,43.57],[14.01,42.69],[14.54,42.24],[15.17,41.93],[16.17,41.9],[15.9,41.51],[17.96,40.65],[18.48,40.1],[18.34,39.82],[17.87,40.28],[16.93,40.46],[16.52,39.75],[17.11,39.38],[17.17,39],[16.62,38.8],[16.06,37.94],[15.72,37.94],[15.64,38.18],[16.21,38.94],[15.69,39.99],[14.95,40.24],[14.77,40.67],[14.34,40.6],[14.46,40.73],[14.05,40.81],[13.86,41.13],[13.67,41.26],[13.25,41.29],[13.09,41.24],[12.85,41.41],[12.63,41.47],[12.08,41.94],[11.81,42.08],[11.64,42.29],[11.3,42.42],[11.1,42.42],[11.18,42.46],[11.17,42.53],[10.51,42.97],[10.19,43.95],[9.73,44.1],[9.29,44.32],[8.76,44.42],[8.55,44.35],[8.29,44.14],[6.72,43.37],[6.57,43.2],[6.11,43.07],[5.81,43.1],[5.41,43.23],[5.32,43.35],[5.07,43.37],[5.06,43.44],[4.71,43.37],[4.22,43.48],[4.05,43.59],[3.91,43.56],[3.16,43.08],[3.09,42.59],[3.31,42.29],[3.17,42.26],[3.15,42.16],[3.24,42.08],[3.25,41.94],[3,41.77],[2.31,41.47],[2.08,41.29],[1.03,41.06],[0.71,40.82],[0.89,40.72],[-0.33,39.52],[0.2,38.76],[-0.52,38.32],[-0.72,37.63],[-1.64,37.39],[-2.19,36.74],[-4.37,36.72],[-5.63,36.03],[-6.38,36.64],[-6.22,36.91],[-6.86,37.28],[-7.84,37.01],[-8.93,37.17],[-8.81,37.43],[-8.79,37.73],[-8.88,37.96],[-8.8,38.18],[-8.88,38.45],[-8.67,38.42],[-8.8,38.52],[-9.21,38.45],[-9.25,38.66],[-9.02,38.75],[-8.94,39],[-8.79,39.08],[-8.96,39.02],[-9.14,38.74],[-9.36,38.7],[-9.47,38.73],[-9.48,38.8],[-9.35,39.25],[-9.38,39.34],[-9.15,39.54],[-8.84,40.12],[-8.87,40.26],[-8.66,41.03],[-8.89,42.11],[-8.69,42.27],[-9.18,43.17],[-7.7,43.77],[-7.06,43.55],[-1.99,43.35],[-1.49,43.56],[-1.08,44.69],[-1.24,44.67],[-1.08,45.53],[-0.55,45],[-1.2,45.71],[-1.03,45.74],[-1.15,46.31],[-2.09,46.87],[-2.11,47.26],[-1.74,47.22],[-4.31,47.82],[-4.68,48.04],[-4.33,48.17],[-4.58,48.29],[-4.24,48.3],[-4.72,48.54],[-3.23,48.84],[-2.69,48.54],[-1.38,48.65],[-1.86,49.68],[-0.16,49.3],[0.44,49.47],[0.13,49.51],[0.19,49.7],[1.24,50],[1.59,50.25],[1.67,50.88],[3.72,51.37],[4.22,51.39],[4.01,51.44],[3.82,51.41],[3.69,51.45],[3.55,51.59],[3.89,51.57],[4.14,51.46],[4.28,51.47],[4.01,51.6],[4.18,51.61],[3.95,51.81],[4.08,51.99],[4.48,52.31],[4.77,52.94],[4.89,52.91],[5.06,52.96],[5.36,53.1],[5.53,53.27],[6.06,53.41],[7.2,53.28],[7.21,53.66],[7.63,53.7],[8.49,53.39],[8.62,53.88],[9.78,53.55],[8.65,54.29],[8.96,54.54],[8.68,54.79],[8.62,55.42],[8.13,55.6],[8.16,56.61],[9.2,56.7],[9.11,57.04],[8.77,56.72],[8.27,56.81],[10.53,57.73],[10.28,56.62],[10.9,56.36],[9.91,55.84],[9.46,55.04],[10.02,54.67],[9.87,54.47],[11.01,54.38],[10.86,54.01],[12.11,54.17],[12.58,54.47],[13.03,54.41],[13.15,54.28],[13.82,54.02],[13.87,53.85],[13.95,53.8],[14.49,53.67],[14.56,53.82],[14.17,53.87],[13.93,53.88],[13.92,54],[13.83,54.06],[14.38,53.92],[18.08,54.84],[18.76,54.68],[18.44,54.75],[18.84,54.37],[19.41,54.39],[19.97,54.92],[20.68,55.1],[21.12,55.62],[20.59,54.98],[21.19,54.93],[21.03,56.64],[21.73,57.57],[22.56,57.72],[23.65,56.97],[24.4,57.33],[24.3,57.78],[24.49,58.26],[24.55,58.3],[24.53,58.35],[24.34,58.38],[24.11,58.27],[23.77,58.36],[23.69,58.51],[23.51,58.66],[23.68,58.79],[23.5,58.79],[23.43,58.92],[23.51,59],[23.47,59.03],[23.52,59.11],[23.5,59.19],[24.08,59.29],[24.05,59.37],[24.38,59.47],[25.44,59.52],[25.52,59.56],[25.51,59.64],[27.89,59.41],[28.06,59.78],[30.17,59.96],[28.64,60.38],[28.51,60.68],[26.45,60.47],[26.21,60.41],[25.95,60.47],[26.04,60.34],[25.76,60.27],[25.66,60.33],[24.6,60.11],[24.45,60.02],[23.46,59.99],[23.18,59.84],[22.96,59.83],[23.2,60.02],[22.91,60.21],[22.46,60.03],[22.58,60.38],[21.44,60.6],[21.61,61.59],[21.12,62.69],[21.65,63.04],[21.54,63.21],[22.32,63.31],[22.53,63.65],[23.6,64.04],[24.56,64.8],[25.29,64.86],[25.35,65.48],[24.63,65.86],[22.4,65.86],[22.25,65.6],[21.41,65.32],[21.57,65.13],[21.14,64.81],[21.52,64.46],[20.76,63.87],[18.61,63.18],[18.17,62.79],[17.88,62.87],[18.04,62.6],[17.38,62.46],[17.63,62.23],[17.47,61.68],[17.13,61.57],[17.25,60.7],[17.36,60.64],[17.56,60.64],[17.66,60.54],[17.96,60.59],[18.16,60.41],[18.56,60.25],[18.53,60.15],[18.79,60.08],[18.93,59.94],[18.97,59.76],[18.28,59.44],[17.97,59.36],[18.13,59.32],[18.51,59.41],[18.62,59.33],[18.42,59.29],[18.29,59.11],[17.76,58.97],[16.98,58.65],[16.64,58.65],[16.21,58.64],[16.79,58.59],[16.93,58.49],[16.82,58.46],[16.65,58.43],[16.53,57.07],[16,56.22],[14.72,56.13],[14.26,55.89],[14.34,55.53],[14.08,55.39],[13.81,55.43],[13.32,55.35],[12.89,55.41],[12.94,55.48],[12.97,55.75],[12.47,56.29],[12.71,56.23],[12.8,56.26],[12.66,56.44],[12.86,56.45],[12.92,56.52],[12.88,56.62],[12.72,56.66],[12.42,56.91],[11.25,58.42],[11.21,58.87],[11.15,58.99],[11.19,59.08],[11.39,59.04],[11.37,59.1],[10.83,59.18],[10.64,59.39],[10.6,59.76],[10.54,59.7],[10.57,59.59],[10.4,59.52],[10.46,59.38],[10.43,59.28],[10.18,59.01],[9.84,58.96],[9.64,59.12],[9.56,59.11],[9.7,59.01],[9.62,58.95],[8.17,58.14],[7,58.02],[6.9,58.07],[6.88,58.15],[6.8,58.16],[6.73,58.07],[6.59,58.1],[6.55,58.12],[6.69,58.22],[6.66,58.26],[6.39,58.27],[6.05,58.38],[5.71,58.52],[5.52,58.73],[5.56,58.97],[5.61,59.01],[6.1,58.87],[6.36,59],[6.1,58.95],[5.89,59.1],[5.97,59.19],[5.95,59.3],[6.4,59.56],[5.56,59.29],[5.36,59.17],[5.17,59.16],[5.13,59.23],[5.19,59.45],[5.3,59.64],[5.47,59.71],[5.77,59.66],[5.87,59.73],[6.22,59.82],[5.83,59.8],[5.73,59.86],[6.07,60.08],[6.14,60.23],[6.35,60.35],[6.53,60.21],[6.53,60.15],[7,60.51],[6.35,60.42],[6.15,60.35],[5.91,60.15],[5.88,60.07],[5.7,60.01],[5.5,59.83],[5.15,59.64],[5.12,59.83],[5.22,59.98],[5.18,60.05],[5.21,60.09],[5.5,60.07],[5.69,60.12],[5.29,60.21],[5.14,60.44],[5.65,60.69],[5.12,60.64],[5.1,61.07],[6.78,61.14],[7.04,60.95],[7.61,61.21],[7.44,61.43],[7.17,61.17],[5.11,61.19],[5,61.43],[5.34,61.48],[4.93,61.88],[6.73,61.87],[5.27,61.94],[5.14,62.16],[6.69,62.47],[6.14,62.41],[6.35,62.61],[8.09,62.73],[6.73,62.72],[7.57,63.1],[8.62,62.85],[8.16,63.16],[8.63,63.34],[8.36,63.5],[8.58,63.6],[9.7,63.63],[10.02,63.39],[11.37,63.81],[11.18,63.9],[11.31,64.05],[10.06,63.51],[9.57,63.71],[11.63,64.81],[11.3,64.76],[11.49,64.98],[12.92,65.34],[12.42,65.18],[12.12,65.36],[13.03,65.96],[12.79,66.1],[14.03,66.3],[13.12,66.23],[13.21,66.64],[13.96,66.8],[13.65,66.91],[15.42,67.2],[14.44,67.27],[14.96,67.57],[15.59,67.35],[15.69,67.52],[15.25,67.6],[15.31,67.77],[14.78,67.68],[15.05,67.96],[15.62,67.95],[15.29,68.04],[16.01,68.23],[16.31,67.88],[16.21,68.32],[17.57,68.45],[16.58,68.59],[18.1,69.16],[18.26,69.47],[18.92,69.33],[18.61,69.49],[19.2,69.75],[19.72,69.78],[19.64,69.42],[20.32,69.95],[20.05,69.33],[20.74,69.52],[20.62,69.91],[21.98,69.83],[21.36,70.23],[22.69,70.37],[23.36,69.98],[23.38,70.25],[24.66,71],[25.77,70.85],[25.04,70.11],[26.51,70.91],[26.74,70.85],[26.58,70.41],[27.55,70.8],[27.33,71],[28.14,71.04],[28.38,70.87],[27.9,70.68],[28.27,70.67],[28.19,70.25],[28.83,70.86],[30.96,70.34],[28.78,70.15],[29.6,69.98],[29.69,69.74],[31.45,69.69],[31.98,69.95],[33.01,69.72],[32.09,69.63],[32.38,69.48],[33.45,69.43],[33.14,69.07],[33.68,69.31],[35.86,69.19],[40.97,67.71],[41.36,67.21],[41.19,66.83],[40.1,66.3],[38.66,66.07],[34.48,66.55],[32.93,67.09],[31.89,67.16],[33.65,66.44],[33.36,66.33],[34.69,65.95],[34.41,65.4],[35.03,64.44],[37.44,63.81],[38.06,64.09],[37.95,64.32],[37.18,64.41],[36.58,64.79],[36.88,65.17],[39.76,64.58],[40.44,64.78],[39.8,65.35],[39.82,65.6],[42.21,66.52],[43.23,66.41],[44.11,66.01],[44.43,66.94],[43.78,67.26],[44.2,68.25],[43.33,68.67],[45.89,68.48],[46.69,67.85],[45.53,67.76],[44.9,67.41],[46.49,66.8],[47.66,66.98],[47.88,67.58],[48.83,67.68],[48.75,67.9],[51.99,68.54],[52.4,68.35],[52.72,68.48],[52.34,68.61],[53.8,69],[54.49,68.99],[53.8,68.91],[53.93,68.44],[53.26,68.27],[54.86,68.2],[55.42,68.57],[57.13,68.55],[59.06,69.01],[59.37,68.74],[59.1,68.44],[59.73,68.35],[59.9,68.71],[60.93,68.99],[60.17,69.59],[60.91,69.85],[64.19,69.53],[68.5,68.35],[69.14,68.95],[68.54,68.97],[67.62,69.58],[66.9,69.55],[67.29,70.74],[66.7,70.82],[66.85,71.06],[66.64,71.08],[68.27,71.68],[69.39,72.96],[71.5,72.91],[72.81,72.69],[72.57,72.01],[71.87,71.46],[72.7,70.96],[72.47,70.28],[72.58,68.97],[73.59,68.48],[73.14,68.18],[73.07,67.77],[71.85,67.01],[71.37,66.96],[71.54,66.68],[70.72,66.52],[70.38,66.6],[70.69,66.74],[69.01,66.79],[69.98,66.4],[72.07,66.25],[73.79,66.99],[74.77,67.77],[74.39,68.42],[74.58,68.75],[75.12,68.86],[76.46,68.98],[77.24,68.47],[77.18,67.78],[78.92,67.59],[77.59,67.75],[77.67,68.19],[78,68.26],[77.65,68.9],[76,69.24],[73.78,69.2],[73.89,69.42],[73.58,69.8],[74.34,70.58],[73.09,71.44],[73.67,71.85],[74.99,72.15],[75.1,72.42],[74.79,72.81],[75.6,72.58],[75.74,72.3],[75.27,71.96],[75.5,71.65],[75.28,71.43],[75.73,71.27],[79.02,70.95],[76.43,71.55],[76.03,71.91],[78.19,71.91],[77.41,72.11],[78.48,72.4],[79.42,72.38],[81.66,71.72],[83.11,71.72],[82.98,71.45],[82.32,71.26],[82.16,70.6],[82.22,70.4],[82.59,70.89],[83.01,70.9],[82.68,70.22],[83.08,70.09],[83.74,70.55],[83.15,71.1],[83.53,71.68],[80.83,72.49],[80.66,72.71],[80.84,72.95],[80.42,73.23],[80.58,73.57],[86.89,73.89],[85.79,73.44],[86.68,73.11],[85.91,73.39],[87.57,73.81],[86,74.32],[87.23,74.36],[85.79,74.65],[87.47,75.01],[87.01,75.17],[94.16,75.96],[92.86,75.98],[93.26,76.1],[95.58,76.14],[96.08,76.08],[95.65,75.89],[96.5,75.89],[98.66,76.24],[99.77,76.03],[99.54,75.8],[99.82,76.14],[98.8,76.48],[101.6,76.44],[100.93,76.56],[101.1,76.7],[100.91,76.9],[104.01,77.73],[106.06,77.39],[104.2,77.1],[107.43,76.93],[106.42,76.51],[111.11,76.72],[112.62,76.38],[112.66,76.05],[113.27,76.25],[113.56,75.89],[113.86,75.92],[113.57,75.57],[112.45,75.83],[113.73,75.45],[112.92,75.02],[107.27,73.62],[105.14,72.78],[110.87,73.73],[109.67,73.8],[110.26,74.02],[111.55,74.03],[111.23,73.97],[112.15,73.71],[113.03,73.91],[113.42,73.65],[113.16,73.46],[113.49,73.35],[113.16,72.77],[113.67,72.64],[113.22,72.81],[113.89,73.35],[113.51,73.5],[114.06,73.58],[118.45,73.59],[118.94,73.48],[118.46,73.46],[118.43,73.25],[119.75,72.98],[122.54,72.88],[123.62,73.19],[123.32,73.43],[123.41,73.64],[124.54,73.75],[126.55,73.33],[127.74,73.48],[129.1,73.11],[128.6,72.9],[129.25,72.7],[128.42,72.53],[129.28,72.44],[129.28,72.09],[127.73,72.41],[128.91,71.75],[129.21,71.92],[129.46,71.74],[128.84,71.66],[129.76,71.12],[131.02,70.75],[132.04,71.24],[132.65,71.93],[133.69,71.43],[136.09,71.62],[137.94,71.13],[138.32,71.33],[137.92,71.38],[138.23,71.6],[139.99,71.49],[139.72,71.89],[139.36,71.95],[140.19,72.19],[139.18,72.16],[139.14,72.33],[141.08,72.59],[140.65,72.84],[140.81,72.89],[146.25,72.44],[144.29,72.19],[146.83,72.29],[146.11,71.95],[146.23,72.14],[145.76,72.23],[145.76,71.94],[145.07,71.93],[145.19,71.7],[147.26,72.33],[149.5,72.16],[150.02,71.9],[148.92,71.71],[150.67,71.45],[150.1,71.23],[151.58,71.29],[152.09,71.02],[151.76,70.98],[152.51,70.83],[155.89,71.1],[158.7,70.94],[159.91,70.51],[159.83,69.78],[160.91,69.61],[161.34,68.9],[160.86,68.54],[161.56,68.9],[161.54,69.38],[163.2,69.72],[166.89,69.5],[167.86,69.73],[168.3,69.27],[169.31,69.08],[169.61,68.79],[170.54,68.83],[171,69.14],[170.58,69.58],[170.16,69.63],[170.49,70.11],[173.28,69.82],[175.92,69.9],[179.87,69.01]],[[-94.31,71.77],[-93.03,71.34],[-92.98,70.85],[-91.57,70.18],[-92.32,70.24],[-92.51,70.1],[-91.98,70.04],[-92.89,69.67],[-90.42,69.46],[-91.24,69.29],[-90.48,68.88],[-90.58,68.48],[-90.25,68.27],[-89.28,69.26],[-88.04,68.81],[-87.81,68.35],[-88.35,68.29],[-88.31,67.95],[-87.36,67.18],[-86.56,67.48],[-85.69,68.67],[-84.87,68.77],[-85.11,68.84],[-84.86,69.07],[-85.39,69.23],[-85.51,69.85],[-82.62,69.69],[-82.37,69.64],[-82.76,69.49],[-82.23,69.25],[-81.32,69.14],[-81.96,68.88],[-81.28,68.66],[-82.55,68.45],[-81.29,67.5],[-81.39,67.19],[-82.64,66.59],[-83.52,66.37],[-84.85,67.03],[-85.11,66.89],[-84.64,66.9],[-83.8,66.24],[-86.71,66.52],[-85.96,66.12],[-87.45,65.34],[-89.75,65.94],[-91.43,65.95],[-87,65.11],[-88.11,64.18],[-89.13,63.97],[-90.04,64.14],[-89.86,63.96],[-90.17,63.98],[-90.01,63.8],[-90.24,63.64],[-93.7,64.15],[-93.56,63.86],[-92.16,63.69],[-92.47,63.56],[-91.84,63.7],[-90.97,63.44],[-90.7,63.06],[-92.36,62.82],[-91.94,62.59],[-92.55,62.55],[-92.77,62.35],[-92.53,62.17],[-93.21,62.36],[-92.9,62.22],[-93.58,61.94],[-93.31,61.77],[-93.91,61.48],[-94.76,60.5],[-94.96,59.07],[-94.29,58.72],[-94.33,58.3],[-94.12,58.74],[-93.18,58.73],[-92.43,57.32],[-92.8,56.92],[-90.59,57.22],[-88.83,56.81],[-87.48,56.02],[-85.68,55.6],[-85.22,55.35],[-85.37,55.08],[-83.91,55.31],[-82.39,55.07],[-82.22,54.81],[-82.42,54.24],[-82.14,53.82],[-82.29,53.03],[-81.6,52.43],[-81.83,52.22],[-80.59,51.67],[-80.44,51.39],[-80.85,51.12],[-80.1,51.28],[-79.35,50.76],[-79.74,51.19],[-79.34,51.63],[-78.9,51.2],[-78.73,51.5],[-78.98,51.78],[-78.45,52.26],[-79.1,53.66],[-79.01,54.02],[-79.71,54.67],[-77.78,55.29],[-76.55,56.36],[-76.57,57.18],[-76.89,57.76],[-78.51,58.68],[-77.73,59.68],[-77.35,59.58],[-77.29,60.02],[-77.59,60.09],[-77.68,60.43],[-77.5,60.54],[-77.79,60.64],[-77.59,60.81],[-78.18,60.82],[-77.51,61.56],[-78.02,61.83],[-78.13,62.28],[-77.37,62.57],[-74.63,62.11],[-73.71,62.47],[-72.69,62.13],[-72.77,61.84],[-72.23,61.83],[-72.04,61.68],[-72.21,61.59],[-71.64,61.62],[-71.85,61.44],[-71.42,61.16],[-69.99,60.86],[-69.5,61.04],[-69.67,60.08],[-70.66,60.03],[-69.73,59.92],[-69.68,59.34],[-69.35,59.3],[-69.53,58.87],[-70.16,58.76],[-68.38,58.74],[-68.36,58.16],[-69.04,57.9],[-68.41,58.05],[-68.02,58.48],[-68.06,58.14],[-67.75,58.4],[-67.68,57.99],[-66.36,58.79],[-66,58.43],[-66.04,58.82],[-65.38,59.06],[-65.7,59.21],[-65.48,59.47],[-65.04,59.39],[-65.43,59.78],[-65.03,59.77],[-65.17,59.91],[-64.82,60.33],[-64.5,60.27],[-64.77,60.01],[-64.28,60.06],[-64.23,59.74],[-63.75,59.51],[-63.95,59.38],[-63.42,59.19],[-63.97,59.05],[-63.25,59.07],[-63.28,58.87],[-62.87,58.67],[-63.54,58.33],[-62.61,58.5],[-63.26,58.01],[-62.49,58.15],[-61.96,57.91],[-61.97,57.61],[-62.49,57.49],[-61.33,57.01],[-61.37,56.68],[-62.5,56.8],[-61.43,56.36],[-61.71,56.23],[-61.36,56.22],[-61.45,56],[-60.34,55.79],[-60.19,55.48],[-60.62,55.06],[-59.76,55.31],[-59.44,55.18],[-59.84,54.81],[-59.26,55.2],[-58.78,54.84],[-57.96,54.88],[-57.4,54.59],[-60.4,53.65],[-60.1,53.49],[-60.33,53.27],[-57.93,54.1],[-58.36,54.16],[-58.19,54.23],[-57.42,54.16],[-57.13,53.79],[-57.52,53.61],[-57.33,53.47],[-56.46,53.76],[-55.86,53.34],[-55.8,52.64],[-56.32,52.54],[-55.74,52.47],[-56.01,52.39],[-55.69,52.14],[-56.98,51.46],[-58.51,51.29],[-59.88,50.32],[-61.72,50.1],[-62.71,50.3],[-66.41,50.22],[-66.94,49.99],[-67.37,49.35],[-68.28,49.2],[-69.67,48.2],[-71.02,48.46],[-69.77,48.1],[-70.71,47.14],[-72.68,46.29],[-72.98,46.21],[-73.02,46.12],[-73.14,46.07],[-73.47,45.74],[-73.71,45.71],[-74.04,45.5],[-74.31,45.53],[-74,45.43],[-73.98,45.35],[-74.36,45.21],[-74.71,45],[-73.76,45.4],[-73.56,45.42],[-73.46,45.63],[-73.16,46.01],[-72.73,46.18],[-72.37,46.4],[-70.52,47.03],[-69.47,47.97],[-68.24,48.63],[-65.4,49.26],[-64.26,48.92],[-64.51,48.84],[-64.26,48.55],[-65.26,48.02],[-65.93,48.19],[-66.7,48.02],[-65.61,47.67],[-64.7,47.73],[-65.32,47.1],[-64.83,47.06],[-64.54,46.24],[-62.75,45.65],[-61.95,45.87],[-61.35,45.57],[-61.46,45.37],[-61.03,45.29],[-63.6,44.68],[-63.61,44.48],[-64.29,44.55],[-64.86,43.87],[-65.74,43.56],[-66.13,43.81],[-66.02,44.56],[-64.45,45.34],[-64.14,45.02],[-63.37,45.36],[-64.87,45.36],[-64.32,45.84],[-64.63,45.95],[-64.78,45.64],[-65.89,45.22],[-66.03,45.42],[-66.44,45.1],[-67.12,45.17],[-66.99,44.83],[-68.06,44.39],[-68.45,44.51],[-68.53,44.26],[-68.81,44.34],[-68.76,44.57],[-69.14,44.04],[-70.27,43.67],[-70.2,43.63],[-70.52,43.35],[-70.73,43.07],[-70.83,42.83],[-70.74,42.67],[-70.62,42.67],[-70.61,42.62],[-70.83,42.55],[-71.04,42.33],[-70.74,42.23],[-70.62,42.04],[-70.66,41.99],[-70.55,41.94],[-70.52,41.8],[-70.43,41.76],[-70.3,41.73],[-70,41.83],[-70.11,42.03],[-70.24,42.09],[-70.11,42.08],[-69.98,41.96],[-69.93,41.71],[-70.66,41.53],[-70.7,41.72],[-71.17,41.49],[-71.2,41.64],[-71.15,41.75],[-71.27,41.68],[-71.39,41.79],[-71.37,41.7],[-71.43,41.63],[-71.44,41.45],[-71.52,41.38],[-72.92,41.28],[-73.58,41.02],[-73.99,40.75],[-73.87,41.06],[-73.88,41.17],[-73.97,41.25],[-73.92,41.14],[-73.93,40.91],[-74.26,40.53],[-74.24,40.46],[-74,40.45],[-73.97,40.4],[-74.08,39.79],[-74.07,39.99],[-74.26,39.61],[-74.33,39.54],[-74.41,39.55],[-74.39,39.49],[-74.48,39.34],[-74.58,39.32],[-74.61,39.25],[-74.92,38.94],[-74.9,39.15],[-75.52,39.49],[-75.07,39.98],[-75.17,39.89],[-75.32,39.86],[-75.57,39.48],[-75.04,38.43],[-75.93,37.15],[-75.66,37.95],[-75.85,37.97],[-75.86,38.36],[-76.12,38.32],[-76.26,38.44],[-76.26,38.6],[-76,38.6],[-76.21,38.76],[-76.28,38.77],[-76.34,38.71],[-76.3,38.82],[-76.17,38.85],[-76.19,38.91],[-76.33,38.91],[-76.33,38.95],[-76.31,39.01],[-76.19,38.99],[-76.13,39.12],[-76.22,39.06],[-76.24,39.19],[-76.15,39.32],[-75.94,39.4],[-76,39.41],[-75.97,39.51],[-76.01,39.57],[-76.06,39.56],[-76.1,39.43],[-76.21,39.38],[-76.25,39.44],[-76.28,39.32],[-76.33,39.4],[-76.42,39.23],[-76.57,39.27],[-76.43,39.13],[-76.47,39.03],[-76.56,39.07],[-76.5,38.94],[-76.54,38.74],[-76.5,38.53],[-76.39,38.37],[-76.57,38.44],[-76.68,38.61],[-76.67,38.54],[-76.64,38.45],[-76.41,38.27],[-76.34,38.09],[-76.46,38.17],[-76.77,38.26],[-76.87,38.39],[-76.89,38.29],[-77,38.44],[-77.23,38.41],[-77.22,38.54],[-77.02,38.78],[-77.03,38.89],[-77.05,38.78],[-77.26,38.6],[-77.31,38.4],[-77.27,38.35],[-77.05,38.36],[-76.91,38.2],[-76.55,38.09],[-76.35,37.96],[-76.34,37.68],[-76.79,37.94],[-76.94,38.1],[-77.11,38.16],[-76.62,37.76],[-76.27,37.49],[-76.45,37.27],[-76.76,37.51],[-76.34,37.01],[-77.25,37.33],[-76.49,36.9],[-76,36.91],[-75.53,35.82],[-75.95,36.66],[-75.82,36.11],[-76.15,36.28],[-76.56,36.02],[-76.73,36.23],[-76.73,35.96],[-76.07,35.97],[-76.08,35.69],[-75.76,35.84],[-76.17,35.35],[-77.04,35.53],[-76.51,35.27],[-76.78,34.99],[-77.07,35.15],[-76.97,35.02],[-76.44,34.84],[-77.41,34.73],[-77.93,33.94],[-77.95,34.17],[-78.01,33.91],[-78.84,33.72],[-79.94,32.67],[-80.64,32.51],[-80.58,32.29],[-80.8,32.45],[-80.69,32.22],[-81.44,31.2],[-81.25,29.79],[-80.52,28.49],[-80.46,27.9],[-80.84,28.76],[-80.05,26.81],[-80.13,25.83],[-80.16,25.88],[-80.3,25.62],[-80.37,25.33],[-80.48,25.23],[-80.74,25.16],[-81.11,25.14],[-81.17,25.23],[-81.14,25.31],[-80.97,25.22],[-80.94,25.26],[-81.11,25.37],[-81.37,25.83],[-81.72,25.98],[-81.96,26.49],[-81.83,26.69],[-82.04,26.55],[-82.01,26.96],[-82.29,26.87],[-82.72,27.5],[-82.41,27.86],[-82.84,27.85],[-82.65,28.89],[-84.04,30.1],[-85.32,29.68],[-85.6,30.29],[-86.45,30.4],[-86.26,30.49],[-87.2,30.34],[-87,30.57],[-88,30.23],[-87.79,30.29],[-88.01,30.69],[-88.13,30.37],[-89.59,30.17],[-90.23,30.38],[-90.28,30.06],[-89.4,30.05],[-89.35,29.82],[-89.72,29.62],[-89.02,29.2],[-89.38,28.98],[-90.16,29.54],[-90.21,29.1],[-91.29,29.29],[-91.25,29.56],[-91.89,29.84],[-92.26,29.56],[-93.83,29.72],[-93.88,29.81],[-93.81,29.85],[-93.79,29.98],[-93.84,29.98],[-93.94,29.81],[-93.89,29.69],[-94.1,29.67],[-94.76,29.38],[-94.53,29.55],[-94.78,29.55],[-94.74,29.75],[-94.83,29.75],[-94.89,29.68],[-95.02,29.7],[-94.99,29.53],[-94.89,29.37],[-95.14,29.17],[-95.15,29.08],[-95.27,28.96],[-95.85,28.64],[-96.23,28.49],[-96.01,28.63],[-96.37,28.66],[-96.45,28.59],[-96.58,28.72],[-96.42,28.46],[-97.16,28.14],[-97.07,27.99],[-97.43,27.84],[-97.44,27.33],[-97.77,27.46],[-97.48,27.24],[-97.14,26.03],[-97.67,24.39],[-97.86,22.62],[-97.31,21.56],[-97.41,21.27],[-97.75,22.03],[-97.64,21.6],[-95.92,18.82],[-95.18,18.7],[-94.46,18.17],[-92.44,18.67],[-91.53,18.46],[-91.27,18.62],[-91.44,18.89],[-90.74,19.35],[-90.35,21.01],[-88.47,21.57],[-87.04,21.59],[-86.82,21],[-87.69,19.64],[-87.43,19.58],[-87.85,18.27],[-88.03,18.84],[-88.35,18.36],[-88.08,18.23],[-88.31,16.63],[-88.89,15.89],[-88.13,15.7],[-87.7,15.91],[-86.91,15.76],[-84.97,15.99],[-84.26,15.82],[-83.76,15.22],[-83.37,15.24],[-83.19,14.34],[-83.57,13.32],[-83.51,12.41],[-83.59,12.71],[-83.75,12.5],[-83.83,11.13],[-82.24,9.03],[-81.78,8.96],[-81.9,9.14],[-81.55,8.83],[-81.06,8.81],[-80.84,8.89],[-80.55,9.08],[-80.13,9.21],[-79.58,9.6],[-79.11,9.54],[-78.93,9.43],[-78.5,9.41],[-78.08,9.24],[-76.79,7.93],[-76.92,8.57],[-75.64,9.45],[-75.54,10.2],[-75.71,10.14],[-75.45,10.61],[-74.84,11.11],[-74.33,11],[-74.4,10.77],[-74.14,11.32],[-73.31,11.3],[-71.6,12.43],[-71.14,12.05],[-71.96,11.57],[-71.6,10.66],[-72.11,9.82],[-71.62,9.05],[-71.24,9.16],[-71.05,9.71],[-71.47,10.96],[-69.81,11.47],[-70.29,11.89],[-70,12.18],[-69.63,11.48],[-68.4,11.16],[-68.14,10.49],[-66.25,10.63],[-65.13,10.07],[-63.73,10.5],[-64.3,10.64],[-61.88,10.74],[-62.91,10.53],[-62.74,10.06],[-62.55,10.2],[-62.32,9.78],[-62.08,9.98],[-61.74,9.63],[-61.59,9.89],[-60.79,9.36],[-61.25,8.6],[-61.62,8.6],[-61.3,8.41],[-60.17,8.62],[-58.81,7.74],[-58.48,7.33],[-58.67,6.39],[-58.42,6.85],[-57.98,6.79],[-57.23,6.18],[-57.18,5.53],[-56.97,5.99],[-55.9,5.7],[-55.83,5.96],[-54.36,5.91],[-54.05,5.81],[-54.16,5.36],[-53.85,5.78],[-52.9,5.43],[-52.06,4.72],[-52,4.35],[-51.83,4.64],[-51.65,4.06],[-51.55,4.31],[-51.22,4.09],[-50.72,2.13],[-49.96,1.66],[-49.9,1.16],[-51.28,-0.08],[-51.98,-1.37],[-52.66,-1.55],[-51.95,-1.59],[-50.9,-0.94],[-50.4,-2.01],[-49.32,-1.73],[-49.64,-2.66],[-49.21,-1.92],[-48.35,-1.48],[-48.45,-1.15],[-48.12,-0.74],[-47.4,-0.63],[-45.46,-1.36],[-45.33,-1.72],[-45.08,-1.47],[-44.65,-1.75],[-44.54,-2.05],[-44.76,-2.26],[-44.44,-2.17],[-44.38,-2.37],[-44.72,-3.2],[-44.23,-2.47],[-44.19,-2.81],[-43.38,-2.38],[-42.25,-2.79],[-39.77,-2.99],[-39.02,-3.39],[-38.69,-3.65],[-38.48,-3.72],[-38.05,-4.22],[-37.63,-4.59],[-37.3,-4.71],[-36.59,-5.1],[-35.39,-5.25],[-34.83,-7.02],[-34.84,-7.97],[-35.34,-9.23],[-37.36,-11.25],[-38.02,-12.59],[-38.4,-12.97],[-38.69,-12.62],[-38.85,-12.79],[-39.09,-13.59],[-38.88,-15.86],[-39.16,-17.7],[-39.65,-18.25],[-39.78,-19.57],[-40.96,-21.24],[-41,-22],[-41.58,-22.24],[-41.98,-22.58],[-41.94,-22.79],[-42.04,-22.95],[-42.96,-22.97],[-43.08,-22.9],[-43.09,-22.72],[-43.23,-22.75],[-43.22,-22.99],[-43.9,-23.1],[-43.97,-23.06],[-43.68,-23.01],[-43.86,-22.91],[-44.15,-23.01],[-44.37,-23],[-45.21,-23.58],[-45.33,-23.6],[-45.46,-23.8],[-45.97,-23.79],[-46.87,-24.24],[-47.14,-24.49],[-47.59,-24.78],[-48.2,-25.42],[-48.73,-25.37],[-48.4,-25.6],[-48.75,-26.27],[-48.56,-27.2],[-48.8,-28.58],[-49.75,-29.36],[-50.92,-31.26],[-52.04,-32.12],[-52.06,-31.83],[-51.27,-31.48],[-50.58,-30.44],[-50.56,-30.25],[-51.03,-30.37],[-51.3,-30.04],[-51.28,-30.75],[-51.97,-31.38],[-52.65,-33.14],[-53.79,-34.38],[-54.9,-34.93],[-56.85,-34.68],[-57.17,-34.45],[-57.87,-34.45],[-58.4,-33.91],[-58.44,-33.72],[-58.36,-33.18],[-58.15,-33.07],[-58.2,-32.47],[-58.2,-33.01],[-58.25,-33.08],[-58.42,-33.11],[-58.55,-33.66],[-58.39,-34.19],[-58.52,-34.3],[-58.47,-34.46],[-58.28,-34.68],[-57.76,-34.89],[-57.3,-35.19],[-57.17,-35.36],[-57.16,-35.51],[-57.35,-35.72],[-57.26,-36.14],[-56.72,-36.39],[-56.67,-36.85],[-57.65,-38.17],[-59.83,-38.84],[-61.6,-39],[-62.34,-38.8],[-62.3,-39.24],[-62.05,-39.37],[-62.39,-40.89],[-63.62,-41.16],[-64.87,-40.74],[-65.13,-40.88],[-64.99,-42.1],[-64.42,-42.43],[-63.79,-42.11],[-63.62,-42.7],[-64.04,-42.88],[-64.49,-42.51],[-64.97,-42.67],[-64.32,-42.97],[-65.25,-43.57],[-65.29,-44.36],[-65.65,-44.66],[-65.64,-45.01],[-66.94,-45.26],[-67.6,-46.05],[-67.51,-46.44],[-66.78,-47.01],[-65.85,-47.16],[-65.77,-47.57],[-66.22,-47.83],[-65.81,-47.94],[-67.47,-48.95],[-67.91,-49.98],[-68.26,-50.1],[-68.67,-49.75],[-68.98,-50],[-68.42,-50.16],[-68.94,-50.38],[-69.36,-51.03],[-69.06,-51.55],[-69.46,-51.58],[-68.96,-51.68],[-68.4,-52.31],[-69.24,-52.21],[-70.8,-52.77],[-70.99,-53.78],[-71.3,-53.88],[-72.41,-53.35],[-71.94,-53.23],[-71.79,-53.48],[-71.23,-52.81],[-72.28,-53.13],[-72.55,-53.46],[-73.05,-53.24],[-72.73,-52.76],[-71.51,-52.61],[-72.71,-52.54],[-73.12,-53.07],[-73.64,-52.84],[-73.12,-52.49],[-74.01,-52.64],[-74.3,-52.12],[-73.83,-52.23],[-72.79,-51.95],[-72.57,-52.2],[-72.72,-52.36],[-72.52,-52.25],[-72.54,-51.71],[-73.17,-51.45],[-72.6,-51.8],[-73.52,-52.04],[-74.19,-51.68],[-73.93,-51.62],[-73.94,-51.27],[-74.81,-51.06],[-75.09,-50.68],[-74.68,-50.66],[-74.64,-50.36],[-73.81,-50.94],[-73.65,-50.49],[-73.98,-50.83],[-74.2,-50.61],[-73.95,-50.51],[-74.63,-50.19],[-73.96,-49.99],[-74.29,-49.6],[-73.83,-49.61],[-74.09,-49.43],[-73.94,-49.02],[-74.22,-49.5],[-74.37,-49.4],[-74.34,-48.6],[-74.01,-48.48],[-74.48,-48.46],[-74.58,-48],[-73.39,-48.15],[-73.72,-47.66],[-74.23,-47.97],[-74.66,-47.7],[-74.13,-47.59],[-74.48,-47.43],[-74.16,-47.18],[-74.31,-46.79],[-75,-46.74],[-75.02,-46.51],[-75.54,-46.7],[-75.43,-46.93],[-75.71,-46.77],[-74.93,-46.16],[-75.07,-45.88],[-74.16,-45.77],[-73.96,-45.4],[-74.02,-46.06],[-74.39,-46.22],[-73.97,-46.15],[-73.73,-45.81],[-73.85,-46.57],[-73.59,-45.9],[-73.73,-45.48],[-72.93,-45.45],[-73.45,-45.24],[-72.68,-44.59],[-73.27,-44.17],[-73.08,-43.32],[-72.76,-43.04],[-72.77,-42.26],[-72.41,-42.39],[-72.5,-41.98],[-72.82,-41.91],[-72.32,-41.5],[-73.73,-41.74],[-73.98,-40.97],[-73.23,-39.22],[-73.66,-37.34],[-73.22,-37.17],[-71.99,-34.29],[-72,-34.17],[-71.83,-33.82],[-71.66,-33.65],[-71.64,-33.52],[-71.7,-33.43],[-71.74,-33.09],[-71.59,-32.97],[-71.45,-32.66],[-71.42,-32.39],[-71.51,-32.21],[-71.71,-30.63],[-71.31,-29.65],[-71.52,-28.93],[-70.65,-26.33],[-70.39,-23.57],[-70.59,-23.25],[-70.09,-21.49],[-70.36,-18.4],[-71.53,-17.3],[-75.11,-15.41],[-76.29,-14.13],[-76.23,-13.37],[-76.5,-12.98],[-76.83,-12.35],[-77.15,-12.06],[-77.22,-11.66],[-77.31,-11.53],[-77.63,-11.29],[-77.74,-10.84],[-79.76,-7.07],[-81.14,-6.06],[-80.88,-5.63],[-81.34,-4.67],[-81.23,-4.23],[-79.96,-3.16],[-79.73,-2.58],[-79.84,-2.07],[-79.93,-2.55],[-80.01,-2.35],[-80.29,-2.71],[-80.96,-2.19],[-80.77,-2.08],[-80.9,-1.08],[-80.28,-0.62],[-80.48,-0.37],[-80.05,0.16],[-80.09,0.79],[-78.9,1.21],[-79.03,1.62],[-78.58,1.77],[-78.59,2.36],[-77.81,2.72],[-77.08,3.91],[-77.52,4.21],[-77.29,4.72],[-77.54,5.54],[-77.25,5.78],[-77.47,6.18],[-77.37,6.57],[-78.38,7.9],[-78.42,8.06],[-78.29,8.09],[-78.28,8.25],[-78.14,8.39],[-77.76,8.13],[-78.06,8.4],[-78.1,8.5],[-78.22,8.4],[-78.4,8.51],[-78.37,8.4],[-78.41,8.36],[-78.51,8.63],[-78.95,8.93],[-79.25,9.02],[-79.51,8.97],[-79.69,8.85],[-79.81,8.64],[-79.75,8.6],[-80.12,8.35],[-80.37,8.29],[-80.46,8.21],[-80.46,8.08],[-80.07,7.67],[-80.01,7.5],[-80.84,7.22],[-81.06,7.9],[-81.27,7.63],[-82.23,8.31],[-82.78,8.3],[-82.88,8.07],[-83.29,8.67],[-83.47,8.71],[-83.29,8.41],[-83.61,8.48],[-83.74,9.15],[-84.58,9.57],[-85.02,10.12],[-85.26,10.26],[-84.89,9.82],[-85.11,9.58],[-85.63,9.9],[-85.85,10.29],[-85.67,10.74],[-85.91,10.9],[-85.74,11.09],[-87.67,12.9],[-87.34,12.95],[-87.49,13.35],[-88.69,13.28],[-88.51,13.18],[-91.38,13.99],[-93.92,16.05],[-94.86,16.42],[-95.02,16.28],[-94.8,16.21],[-96.21,15.69],[-97.75,15.97],[-100.85,17.2],[-101.92,17.96],[-103.44,18.33],[-103.91,18.83],[-104.94,19.31],[-105.67,20.38],[-105.26,20.58],[-105.51,20.81],[-105.21,21.49],[-105.65,21.99],[-105.79,22.63],[-107.77,24.47],[-107.51,24.49],[-107.95,24.62],[-108.28,25.08],[-108.05,25.07],[-109.03,25.48],[-108.88,25.73],[-109.31,25.63],[-109.42,26.03],[-109.12,26.25],[-109.28,26.53],[-110.38,27.23],[-110.53,27.86],[-111.12,27.97],[-112.16,29.02],[-113.06,30.65],[-113.05,31.18],[-114.93,31.9],[-114.55,30.02],[-112.87,28.42],[-112.73,27.83],[-111.86,26.68],[-111.7,26.58],[-111.79,26.88],[-111.57,26.71],[-110.69,24.87],[-110.66,24.34],[-110.37,24.1],[-110.26,24.34],[-109.42,23.48],[-109.5,23.16],[-110,22.89],[-110.36,23.61],[-112.07,24.84],[-112.38,26.21],[-113.02,26.58],[-113.15,26.95],[-113.6,26.72],[-114.99,27.74],[-114.3,27.87],[-114.07,27.68],[-114.27,27.93],[-114.05,28.43],[-115.67,29.76],[-117.27,32.81],[-117.32,33.1],[-117.47,33.3],[-118.08,33.72],[-118.41,33.74],[-118.39,33.86],[-118.51,34.02],[-118.83,34.02],[-119.14,34.11],[-119.41,34.34],[-119.61,34.42],[-119.71,34.4],[-120.65,34.58],[-120.63,35.08],[-121.46,35.93],[-121.88,36.33],[-121.92,36.57],[-121.79,36.73],[-121.81,36.85],[-121.88,36.94],[-122.17,36.99],[-122.4,37.21],[-122.51,37.77],[-122.39,37.79],[-122.37,37.66],[-122.07,37.48],[-122.39,37.96],[-122.22,38.04],[-121.52,38.06],[-122.03,38.12],[-122.15,38.07],[-122.39,38.14],[-122.48,38.11],[-122.47,37.84],[-122.52,37.83],[-122.93,38.06],[-123,37.99],[-122.98,38.23],[-122.88,38.12],[-122.99,38.28],[-123.7,38.91],[-123.83,39.78],[-124.33,40.25],[-124.07,41.46],[-124.54,42.81],[-124.15,43.69],[-123.99,46.22],[-123.22,46.15],[-124.07,46.28],[-123.89,46.66],[-124.11,46.86],[-123.84,46.96],[-124.14,46.95],[-124.71,48.38],[-123.3,48.12],[-123.12,48.15],[-122.98,48.07],[-122.78,48.14],[-122.66,47.88],[-122.78,47.74],[-122.82,47.79],[-123.05,47.55],[-123.14,47.36],[-122.92,47.41],[-123.07,47.4],[-123.06,47.45],[-122.59,47.86],[-122.59,47.93],[-122.53,47.92],[-122.53,47.77],[-122.62,47.71],[-122.61,47.62],[-122.68,47.61],[-122.56,47.46],[-122.58,47.29],[-122.71,47.32],[-122.77,47.22],[-122.83,47.34],[-123.03,47.14],[-122.7,47.11],[-122.54,47.28],[-122.35,47.37],[-122.4,47.78],[-122.24,48.01],[-122.42,48.18],[-122.4,48.08],[-122.52,48.16],[-122.52,48.23],[-122.41,48.29],[-122.67,48.46],[-122.5,48.51],[-122.54,48.76],[-122.69,48.79],[-122.83,49.03],[-122.96,49.07],[-123.08,48.98],[-123.23,49.26],[-122.88,49.4],[-123.28,49.34],[-123.19,49.68],[-123.53,49.4],[-124.03,49.6],[-123.58,49.68],[-123.88,49.74],[-123.83,50.15],[-124.28,49.77],[-124.78,50.02],[-125.06,50.42],[-124.86,50.87],[-125.06,50.51],[-126.09,50.5],[-126.45,50.59],[-125.91,50.7],[-126.51,50.68],[-126.52,51.06],[-127.06,50.87],[-127.71,51.15],[-127.42,51.61],[-126.69,51.7],[-127.64,51.48],[-127.85,51.67],[-127.8,52.19],[-127.44,52.36],[-126.71,52.06],[-127.19,52.46],[-127.01,52.84],[-128.1,51.79],[-128.36,52.16],[-127.94,52.55],[-128.27,52.36],[-128.05,52.91],[-128.36,52.83],[-129.17,53.53],[-128.85,53.7],[-127.93,53.28],[-128.67,53.55],[-128.76,53.75],[-128.53,53.86],[-128.96,53.84],[-129.56,53.25],[-130.33,53.72],[-130.04,54.13],[-129.62,54.23],[-130.43,54.42],[-129.56,55.46],[-129.79,55.56],[-130.05,55.06],[-130.02,55.89],[-130.04,55.3],[-130.54,54.75],[-131.05,55.16],[-130.75,55.32],[-131.03,56.09],[-132.12,55.57],[-132.21,55.75],[-131.55,56.21],[-132.18,56.42],[-132.83,57.06],[-133.47,57.17],[-133.65,57.64],[-133.12,57.57],[-133.54,57.86],[-133.2,57.88],[-134.03,58.07],[-133.88,58.52],[-134.21,58.23],[-134.78,58.45],[-135.36,59.42],[-135.5,59.2],[-135.09,58.25],[-135.9,58.4],[-136.04,58.82],[-135.83,58.9],[-136.13,59.04],[-136.23,58.77],[-136.99,59.04],[-137.06,58.87],[-136.06,58.45],[-136.61,58.24],[-139.77,59.53],[-139.51,59.95],[-139.29,59.61],[-138.99,59.84],[-139.43,60.01],[-140.42,59.71],[-141.41,59.9],[-141.41,60.12],[-144.15,60.02],[-144.9,60.34],[-144.69,60.67],[-145.25,60.38],[-146.57,60.73],[-146.39,60.81],[-146.63,60.99],[-146.38,61.14],[-147.81,60.89],[-148.01,60.97],[-147.75,61.22],[-148.34,61.06],[-148.56,60.8],[-148.28,60.61],[-148.64,60.49],[-147.96,60.48],[-148.43,59.99],[-149.4,60.11],[-149.6,59.77],[-149.71,59.92],[-150.93,59.25],[-151.74,59.19],[-151.93,59.34],[-151.04,59.77],[-151.85,59.78],[-151.4,60.27],[-151.36,60.72],[-150.44,61.02],[-149.07,60.89],[-150.05,61.17],[-149.33,61.5],[-151.59,60.98],[-152.37,60.34],[-153.02,60.3],[-152.63,60.04],[-153.21,59.84],[-153.05,59.73],[-154.09,59.36],[-154.13,59.12],[-153.33,58.88],[-154.25,58.16],[-158.41,56.44],[-158.55,56.31],[-158.28,56.2],[-159.66,55.63],[-159.77,55.84],[-161.38,55.37],[-161.2,55.54],[-161.52,55.62],[-162.08,55.14],[-162.63,55.25],[-162.67,55],[-163.12,55.06],[-163.34,54.84],[-163.28,55.12],[-161.7,55.91],[-160.29,55.8],[-160.54,56.01],[-160.3,56.31],[-158.67,56.8],[-158.32,57.3],[-157.46,57.51],[-157.7,57.68],[-157.61,58.05],[-157.19,58.19],[-157.52,58.42],[-156.97,58.74],[-156.81,59.13],[-158.19,58.62],[-158.5,58.85],[-158.08,58.98],[-158.81,58.97],[-158.95,58.4],[-159.67,58.91],[-160.36,59.05],[-162.14,58.64],[-161.72,58.79],[-161.64,59.11],[-161.98,59.15],[-161.83,59.59],[-162.42,60.28],[-161.96,60.69],[-162.68,60.27],[-162.57,59.99],[-163.68,59.8],[-165.36,60.54],[-164.8,60.89],[-164.32,60.77],[-164.37,60.59],[-163.42,60.76],[-163.91,60.85],[-163.59,60.9],[-163.75,60.97],[-165.11,60.93],[-164.87,61.11],[-165.27,61.27],[-165.57,61.1],[-165.84,61.54],[-166.15,61.55],[-165.81,61.7],[-166.08,61.8],[-165.61,61.87],[-165.71,62.1],[-165.19,62.47],[-164.76,62.5],[-164.59,62.71],[-164.79,62.62],[-164.8,62.92],[-164.38,63.03],[-164.41,63.22],[-163.29,63.05],[-162.28,63.53],[-161.1,63.56],[-160.78,63.82],[-160.99,64.25],[-161.49,64.43],[-160.86,64.76],[-161.76,64.82],[-162.81,64.37],[-163.2,64.65],[-163.14,64.42],[-166.14,64.58],[-166.93,65.16],[-166.16,65.29],[-168.09,65.66],[-164.46,66.59],[-163.64,66.57],[-163.89,66.58],[-164.03,66.22],[-163.7,66.08],[-161.04,66.19],[-162.61,66.89],[-162.36,66.95],[-161.59,66.46],[-160.23,66.51],[-161.57,66.59],[-161.86,66.7],[-161.72,67.02],[-163.53,67.1],[-164.12,67.61],[-166.79,68.36],[-166.38,68.43],[-166.21,68.89],[-163.87,69.04],[-161.88,70.33],[-162.08,70.16],[-160.12,70.59],[-159.86,70.28],[-159.81,70.5],[-159.39,70.52],[-160.08,70.64],[-159.68,70.79],[-157.91,70.86],[-156.47,71.41],[-155.58,71.12],[-156.15,70.93],[-155.97,70.84],[-155.17,71.1],[-154.19,70.8],[-152.3,70.85],[-152.47,70.65],[-151.77,70.56],[-151.94,70.45],[-149.27,70.5],[-144.62,69.98],[-143.22,70.12],[-135.26,68.68],[-135.91,69.11],[-134.46,69.48],[-134.41,69.68],[-133.88,69.51],[-134.18,69.25],[-130.67,70.13],[-129.54,70.11],[-131.94,69.53],[-133.42,68.84],[-132.71,68.81],[-132.53,68.87],[-132.72,69.08],[-131.79,69.43],[-131.06,69.45],[-130.97,69.21],[-130.12,69.72],[-128.9,69.97],[-129.16,69.8],[-128.85,69.75],[-127.68,70.26],[-128.17,70.42],[-127.99,70.57],[-125.73,69.38],[-125.17,69.43],[-125.34,69.66],[-124.56,70.15],[-124.12,69.69],[-124.34,69.36],[-123.53,69.39],[-123.03,69.81],[-121.74,69.8],[-117.23,68.91],[-115.44,68.94],[-113.96,68.4],[-115.43,67.9],[-115.13,67.82],[-112.43,67.68],[-110.07,67.99],[-107.99,67.26],[-108.5,67.09],[-107.26,66.4],[-107.75,66.96],[-107.16,66.88],[-107.96,67.82],[-105.75,68.59],[-107.73,68.17],[-108.72,68.3],[-108.34,68.6],[-106.16,68.92],[-104.49,68.06],[-103.47,68.11],[-102.32,67.74],[-98.41,67.81],[-98.63,68.07],[-97.61,67.63],[-97.16,67.73],[-98.19,67.92],[-98.65,68.36],[-97.83,68.53],[-96.43,68.31],[-96.72,68.04],[-95.97,68.25],[-96.37,67.51],[-95.42,67.01],[-96.42,67.04],[-95.79,66.62],[-96.04,66.94],[-95.4,66.95],[-95.26,67.26],[-95.65,67.74],[-95.46,68.02],[-93.45,68.62],[-93.85,69],[-94.6,68.8],[-94.09,69.12],[-94.25,69.31],[-93.43,69.37],[-96.05,69.83],[-96.54,70.33],[-95.89,70.69],[-96.36,70.68],[-96.53,71.13],[-96.06,71.41],[-95.56,71.34],[-95.41,71.49],[-95.87,71.57],[-95.2,71.9],[-94.61,71.99],[-94.48,71.85]],[[143.18,-11.96],[143.75,-14.35],[144.47,-14.23],[145.29,-14.94],[145.43,-16.41],[145.91,-16.91],[146.03,-18.27],[146.38,-18.98],[148.76,-20.29],[148.88,-20.48],[148.68,-20.58],[149.21,-21.12],[149.71,-22.44],[149.98,-22.55],[150.08,-22.16],[150.54,-22.56],[150.67,-22.42],[150.84,-23.46],[151.83,-24.12],[153.03,-25.87],[153.17,-25.96],[153.08,-26.3],[153.16,-26.98],[153.12,-27.19],[153.38,-27.77],[153.45,-28.05],[153.58,-28.24],[153.6,-28.86],[152.95,-31.43],[152.21,-32.68],[152.14,-32.68],[152.19,-32.72],[152.16,-32.76],[151.81,-32.9],[151.48,-33.35],[151.43,-33.52],[151.29,-33.58],[151.28,-33.93],[151.24,-33.99],[151.12,-34.01],[151.23,-34.03],[150.96,-34.3],[150.78,-34.89],[150.81,-34.99],[150.68,-35.08],[150.71,-35.16],[150.57,-35.21],[150.2,-35.83],[149.93,-37.53],[147.88,-37.93],[146.86,-38.66],[146.22,-38.73],[146.45,-39.11],[146.16,-38.87],[146.07,-38.83],[145.94,-38.9],[145.79,-38.67],[145.61,-38.66],[145.4,-38.54],[145.46,-38.42],[145.54,-38.39],[145.48,-38.24],[145.29,-38.24],[145.19,-38.38],[144.96,-38.5],[144.72,-38.34],[144.91,-38.34],[145.12,-38.09],[144.89,-37.9],[144.4,-38.14],[144.67,-38.21],[144.1,-38.46],[143.69,-38.77],[141.93,-38.28],[141.43,-38.36],[140.39,-37.9],[139.78,-37.25],[139.73,-36.37],[138.98,-35.62],[139.29,-35.61],[139.28,-35.38],[138.19,-35.61],[138.51,-35.02],[138.09,-34.17],[137.69,-35.14],[136.88,-35.24],[137.02,-34.92],[137.39,-34.91],[137.49,-34.16],[137.93,-33.58],[137.78,-32.58],[137.24,-33.63],[136.43,-34.03],[135.89,-34.66],[135.97,-34.98],[135.65,-34.94],[135.12,-34.59],[135.45,-34.58],[135.22,-33.96],[134.72,-33.26],[134.3,-33.17],[134.23,-32.55],[131.14,-31.5],[128.95,-31.7],[127.32,-32.26],[125.92,-32.3],[124.24,-33.01],[123.51,-33.92],[119.85,-33.97],[117.86,-35.05],[116.52,-34.99],[115.01,-34.26],[114.99,-33.51],[115.36,-33.64],[115.61,-33.37],[115.68,-33.19],[115.62,-32.67],[115.71,-32.57],[115.74,-31.89],[115.7,-31.7],[115.08,-30.56],[114.86,-29.14],[114.17,-28.08],[114.03,-27.35],[113.18,-26.18],[113.36,-26.08],[113.58,-26.56],[113.83,-26.5],[113.45,-25.6],[113.72,-26.13],[114.22,-26.29],[114.21,-25.85],[113.42,-24.44],[113.96,-21.94],[114.12,-21.83],[114.14,-22.48],[114.71,-21.82],[116.71,-20.65],[117.41,-20.72],[119.11,-19.99],[121,-19.6],[122.35,-18.11],[122.14,-17.43],[122.33,-17.06],[122.97,-16.44],[123.56,-17.52],[123.59,-17.03],[123.83,-17.12],[123.88,-16.92],[123.49,-16.49],[123.61,-16.22],[124.77,-16.4],[124.4,-16.3],[124.65,-15.87],[124.38,-15.76],[124.44,-15.49],[124.69,-15.27],[125.06,-15.44],[124.84,-15.16],[125.36,-15.12],[125.18,-14.72],[125.63,-14.26],[125.66,-14.53],[126.02,-14.5],[126.05,-13.98],[126.57,-14.16],[126.9,-13.74],[127.46,-14.03],[128.18,-14.71],[128.07,-15.33],[128.58,-14.77],[129.64,-15.14],[129.64,-14.85],[129.85,-14.83],[129.38,-14.39],[129.94,-13.5],[130.14,-13.45],[130.26,-13.3],[130.14,-13.15],[130.17,-12.96],[130.32,-12.88],[130.4,-12.69],[130.62,-12.65],[130.62,-12.43],[130.74,-12.43],[130.87,-12.56],[130.87,-12.37],[131.03,-12.34],[131.05,-12.19],[131.22,-12.18],[131.29,-12.07],[131.34,-12.21],[131.44,-12.28],[131.89,-12.23],[132.07,-12.28],[132.25,-12.19],[132.41,-12.3],[132.44,-12.18],[132.58,-12.11],[132.67,-11.65],[132.28,-11.47],[132.13,-11.5],[131.81,-11.27],[131.96,-11.18],[132.16,-11.31],[135.03,-12.19],[135.92,-11.83],[135.71,-12.21],[135.94,-12.15],[136.08,-12.42],[136.54,-11.96],[136.95,-12.35],[136.46,-13.23],[135.93,-13.3],[135.95,-13.93],[135.45,-14.92],[140.04,-17.7],[140.83,-17.41],[141.29,-16.46],[141.63,-15.06],[141.61,-12.94],[141.93,-12.74],[141.69,-12.35],[142.46,-10.71],[142.78,-11.12],[142.87,-11.82],[143.07,-11.92]],[[-29.95,83.56],[-25.8,83.26],[-32.03,82.98],[-25.12,83.16],[-24.47,82.88],[-21.52,82.6],[-23.12,82.33],[-29.89,82.05],[-25.15,82],[-24.29,81.7],[-22.94,82.03],[-21.13,81.93],[-21.5,81.44],[-23.12,80.78],[-19.63,81.64],[-17.45,81.4],[-15.45,81.84],[-11.42,81.48],[-14.45,80.99],[-14.23,80.87],[-14.5,80.76],[-16.76,80.57],[-15.94,80.43],[-16.49,80.25],[-19.43,80.26],[-20.15,80.01],[-20.07,79.77],[-19.35,79.73],[-19.41,79.35],[-18.99,79.18],[-21.13,78.66],[-20.95,78.55],[-21.73,77.71],[-20.86,77.91],[-19.49,77.72],[-19.29,77.59],[-20.68,77.62],[-20.23,77.37],[-18.44,77.26],[-18.34,76.92],[-22.61,76.68],[-21.49,76.27],[-19.86,76.12],[-19.4,75.49],[-19.52,75.18],[-22.23,75.12],[-20.99,75.07],[-20.78,74.89],[-21.04,74.65],[-20.86,74.64],[-19.99,74.98],[-19.27,74.34],[-21.13,74.11],[-21.95,74.24],[-21.76,74.48],[-21.98,74.57],[-22.33,74.29],[-22.13,73.99],[-20.37,73.85],[-20.64,73.46],[-22.35,73.27],[-24.16,73.77],[-24.68,73.6],[-25.52,73.85],[-24.78,73.54],[-26.06,73.25],[-27.27,73.44],[-26.54,73.25],[-27.56,73.14],[-24.13,73.41],[-22.04,72.92],[-22.29,72.12],[-24.07,72.5],[-24.63,73.04],[-26.66,72.72],[-24.81,72.9],[-24.7,72.51],[-25.2,72.39],[-21.96,71.74],[-22.48,71.38],[-21.75,71.48],[-21.52,70.53],[-22.38,70.46],[-22.44,70.86],[-22.69,70.44],[-23.33,70.45],[-23.97,70.65],[-24.56,71.22],[-27.09,71.63],[-25.84,71.48],[-25.67,71.27],[-26.72,70.95],[-28.4,70.99],[-27.98,70.84],[-29.07,70.44],[-26.51,70.4],[-27.63,70.03],[-27.38,69.99],[-25.53,70.35],[-22.21,70.11],[-23.87,69.74],[-23.74,69.59],[-24.3,69.58],[-26.48,68.68],[-30.98,68.06],[-32.33,68.44],[-32.16,67.99],[-33.16,67.63],[-34.63,66.43],[-35.19,66.25],[-35.87,66.44],[-35.63,66.14],[-37.76,65.59],[-38,65.71],[-37.28,66.3],[-38.15,66.39],[-37.75,66.26],[-38.14,65.9],[-38.52,66.01],[-38.2,65.71],[-40.17,65.56],[-39.58,65.34],[-41.09,65.03],[-40.18,64.48],[-40.78,64.22],[-41.58,64.3],[-40.62,64.13],[-40.55,63.73],[-41.39,63.06],[-42.18,63.21],[-41.64,62.97],[-41.91,62.74],[-42.94,62.72],[-42.15,62.57],[-42.32,62.15],[-42.11,61.86],[-42.59,61.72],[-42.32,61.68],[-43.04,60.52],[-43.92,60.6],[-43.21,60.39],[-43.12,60.06],[-43.95,60.02],[-43.66,59.86],[-43.91,59.81],[-44.41,59.92],[-44.22,60.27],[-44.61,60.02],[-45.38,60.2],[-44.76,60.67],[-45.38,60.44],[-46.05,60.61],[-45.87,61.22],[-46.87,60.82],[-48.18,60.77],[-47.77,61],[-48.39,61.01],[-49.29,61.59],[-49.38,61.89],[-48.83,62.08],[-49.62,62],[-49.55,62.23],[-50.32,62.47],[-49.79,63.05],[-50.39,62.82],[-51.47,63.64],[-51.55,64.01],[-50.26,64.21],[-51.71,64.2],[-50.68,64.68],[-50.01,64.45],[-50.12,64.7],[-50.96,65.2],[-50.72,64.8],[-51.26,64.76],[-51.92,64.22],[-52.54,65.33],[-51.09,65.78],[-52.55,65.46],[-53.2,65.59],[-53.11,65.98],[-53.39,66.05],[-51.23,66.88],[-53.61,66.15],[-53.42,66.65],[-52.39,66.88],[-53.69,66.99],[-53.8,67.42],[-52.51,67.76],[-50.61,67.53],[-51.17,67.69],[-50.97,67.81],[-52.35,67.84],[-53.74,67.55],[-53.15,68.21],[-51.6,68.06],[-51.17,68.39],[-53.38,68.3],[-53.04,68.61],[-51.13,68.6],[-50.8,68.79],[-51.25,68.74],[-51.09,69.13],[-50.3,69.17],[-51.08,69.21],[-50.32,70.03],[-52.26,70.06],[-54.53,70.7],[-52.8,70.75],[-50.68,70.4],[-51.77,71.01],[-51.02,71],[-53.12,71.31],[-51.78,71.68],[-53.44,71.58],[-53.15,71.81],[-53.81,72.29],[-53.65,72.36],[-53.93,72.32],[-53.48,71.85],[-54.02,71.66],[-53.96,71.46],[-55.59,71.55],[-55.32,72.11],[-54.84,72.38],[-55.58,72.18],[-55.29,72.35],[-55.6,72.45],[-54.92,72.57],[-54.74,72.87],[-55.67,73.01],[-55.29,73.33],[-56.1,73.56],[-55.84,73.76],[-56.23,74.13],[-57.23,74.12],[-56.26,74.53],[-58.57,75.35],[-58.25,75.51],[-58.52,75.69],[-63.29,76.35],[-67.08,76.2],[-66.83,75.97],[-68.32,76.09],[-69.48,76.4],[-68.11,76.65],[-69.89,76.83],[-69.69,76.99],[-70.61,76.82],[-71.16,77.07],[-68.14,77.38],[-66.39,77.28],[-66.27,77.51],[-66.82,77.69],[-69.35,77.47],[-70.56,77.72],[-70.12,77.84],[-71.27,77.81],[-72.82,78.19],[-71.65,78.62],[-65.82,79.17],[-64.79,80],[-64.18,80.1],[-66.84,80.08],[-67.19,80.28],[-64.51,81],[-63.06,80.89],[-63.24,81.08],[-62.99,81.21],[-61.44,81.13],[-61.1,81.4],[-61.2,81.75],[-60.43,81.92],[-56.62,81.36],[-59.27,81.98],[-54.55,82.35],[-53.67,82.16],[-53.56,81.65],[-53.04,81.87],[-53.02,82.32],[-50.9,81.89],[-49.54,81.92],[-50.99,82.46],[-50.04,82.47],[-44.73,81.78],[-44.33,82.47],[-45.56,82.75],[-41.37,82.75],[-46.48,82.95],[-43.01,83.26],[-41.3,83.1],[-40.36,83.33],[-38.15,83],[-37.94,83.16],[-38.75,83.37],[-30.7,83.59]],[[-86.59,71.01],[-84.82,71.03],[-84.7,71.63],[-85.91,71.99],[-85.32,72.23],[-84.28,72.04],[-85.65,72.72],[-85.26,72.95],[-84.26,72.8],[-85.46,73.11],[-83.41,73.63],[-81.6,73.7],[-80.28,72.77],[-81.23,72.31],[-80.61,72.45],[-80.95,71.92],[-79.88,72.18],[-80.11,72.33],[-79.83,72.45],[-79,72.27],[-79.01,72.04],[-78.58,71.88],[-78.86,72.1],[-78.7,72.35],[-77.52,72.18],[-78.42,72.57],[-77.25,72.74],[-75.07,72.32],[-75.92,71.72],[-75.15,72.06],[-74.27,72.04],[-74.32,71.84],[-75.21,71.71],[-74.7,71.68],[-75,71.22],[-74.49,71.65],[-73.87,71.77],[-73.71,71.72],[-74.2,71.4],[-73.71,71.59],[-73.18,71.28],[-73.28,71.54],[-72.9,71.68],[-71.64,71.52],[-71.19,71.28],[-72.63,70.83],[-70.67,71.05],[-70.76,70.79],[-71.89,70.43],[-71.28,70.5],[-71.43,70.13],[-70.98,70.58],[-70.08,70.83],[-68.5,70.61],[-68.48,70.41],[-70.06,70.04],[-68.78,70.2],[-69.01,69.98],[-68.74,69.94],[-67.86,70.28],[-67.19,69.76],[-69.25,69.51],[-66.68,69.26],[-69.04,69.1],[-67.75,69.04],[-67.88,68.78],[-69.32,68.86],[-66.71,68.45],[-67.03,68.33],[-66.92,68.07],[-66.21,68.28],[-66.53,67.85],[-65.94,68.07],[-65.51,67.97],[-65.4,67.68],[-65.41,67.88],[-64.98,68.04],[-65.02,67.79],[-63.85,67.57],[-64.59,67.32],[-63.04,67.23],[-63.7,66.82],[-62.12,67.05],[-61.3,66.65],[-62.12,66.64],[-61.58,66.41],[-61.86,66.31],[-62.55,66.41],[-61.99,66.03],[-62.59,66.03],[-62.38,65.83],[-62.66,65.64],[-63.46,65.85],[-63.65,65.66],[-63.34,65.62],[-63.36,65.23],[-63.61,64.93],[-64.35,65.17],[-64.27,65.4],[-64.55,65.12],[-65.4,65.76],[-64.45,66.32],[-65.82,66],[-65.66,66.2],[-66.06,66.13],[-66.99,66.63],[-67.31,66.57],[-67.23,66.31],[-67.88,66.47],[-67.18,66.03],[-67.35,65.93],[-68.75,66.2],[-68.22,66.08],[-67.87,65.77],[-67.94,65.56],[-67.12,65.44],[-67.34,65.35],[-66.7,64.82],[-66.63,65],[-66.21,64.72],[-65.94,64.89],[-65.43,64.73],[-65.27,64.63],[-65.53,64.51],[-65.08,64.44],[-65.58,64.29],[-64.68,64.03],[-64.8,63.92],[-64.41,63.71],[-64.67,63.24],[-65.19,63.76],[-64.67,62.92],[-65.16,62.93],[-65.11,62.63],[-66.66,63.26],[-66.72,63.08],[-67.89,63.73],[-67.72,63.42],[-68.91,63.7],[-65.98,62.21],[-66.33,61.87],[-71.35,63.07],[-71.99,63.42],[-71.38,63.58],[-72.5,63.82],[-73.45,64.4],[-73.27,64.58],[-74.07,64.43],[-74.68,64.83],[-74.92,64.77],[-74.7,64.5],[-76.86,64.24],[-78.17,64.62],[-78.05,64.98],[-77.36,65.2],[-77.33,65.45],[-75.83,65.23],[-75.45,64.84],[-75.36,65.01],[-75.8,65.3],[-73.55,65.48],[-74.42,66.17],[-72.22,67.26],[-73.28,68.36],[-73.82,68.36],[-73.85,68.7],[-74.42,68.58],[-74.91,68.82],[-74.85,69.07],[-76.59,68.7],[-76.56,69.01],[-75.65,69.21],[-76.52,69.52],[-76.23,69.66],[-77.09,69.64],[-76.86,69.78],[-77.59,69.85],[-77.77,70.24],[-79.07,70.6],[-79.4,70.4],[-78.81,70.18],[-79.09,69.93],[-81.65,70.1],[-80.92,69.73],[-81.56,69.94],[-85.78,70.04],[-86.32,70.15],[-86.4,70.47],[-87.9,70.25],[-88.85,70.52],[-89.46,71.06],[-87.14,71.01],[-89.69,71.42],[-90.02,71.95],[-89.66,72.17],[-89.82,72.47],[-88.71,73.4],[-86.77,73.83],[-85.01,73.78],[-86.67,72.76],[-86.32,72.46],[-86.22,71.9],[-85.02,71.35],[-86.47,71.04]],[[-69.49,83.02],[-66.42,82.93],[-68.47,82.65],[-64.9,82.9],[-63.5,82.79],[-63.64,82.71],[-63.09,82.56],[-63.25,82.45],[-61.21,82.34],[-68.69,81.29],[-64.78,81.49],[-69.55,80.38],[-70.71,80.54],[-70.26,80.23],[-72.06,80.12],[-70.56,80.07],[-71.39,79.76],[-74.39,79.87],[-74.66,79.84],[-73.2,79.6],[-76.9,79.51],[-74.48,79.23],[-74.53,79.05],[-78.58,79.08],[-74.43,78.72],[-76.42,78.51],[-75.19,78.33],[-75.97,77.99],[-78.01,77.95],[-78.08,77.52],[-78.49,77.37],[-81.66,77.53],[-81.28,77.37],[-82.06,77.3],[-79.5,77.2],[-79.22,76.94],[-78,76.85],[-78.28,76.57],[-80.8,76.17],[-80.97,76.47],[-82.53,76.72],[-82.23,76.47],[-83.89,76.45],[-84.22,76.67],[-84.28,76.36],[-86.45,76.58],[-86.68,76.38],[-87.49,76.59],[-87.5,76.39],[-88.4,76.41],[-88.49,76.77],[-88.54,76.42],[-89.57,76.49],[-89.5,76.83],[-88.56,77.07],[-86.81,77.19],[-87.68,77.44],[-88.02,77.78],[-86.76,77.86],[-84.49,77.37],[-83.61,77.44],[-82.59,77.99],[-83.78,77.53],[-84.86,77.5],[-85.29,77.56],[-85.55,77.93],[-84.22,78.18],[-84.91,78.24],[-84.78,78.53],[-85.59,78.11],[-86.22,78.08],[-85.92,78.34],[-87.55,78.18],[-86.81,78.77],[-81.75,78.98],[-84.41,79],[-84.57,79.07],[-83.58,79.05],[-86.42,79.84],[-86.5,80.26],[-83.72,80.23],[-80.48,79.61],[-80.12,79.67],[-81.01,79.69],[-82.99,80.32],[-76.86,80.87],[-78.72,80.95],[-76.88,81.43],[-81.01,80.66],[-85.15,80.52],[-86.62,80.63],[-83.29,81.15],[-85.78,81.04],[-87.71,80.66],[-89.26,80.91],[-84.94,81.29],[-89.62,81.03],[-89.98,81.12],[-89.21,81.25],[-89.68,81.33],[-89.43,81.39],[-87.6,81.53],[-90.31,81.4],[-90.61,81.43],[-89.82,81.63],[-91.68,81.64],[-88.06,82.1],[-85.05,81.98],[-86.62,82.22],[-84.9,82.45],[-79.43,81.85],[-82.45,82.39],[-81.68,82.52],[-82.12,82.63],[-80.81,82.59],[-81.18,82.75],[-81.01,82.78],[-78.75,82.68],[-80.16,82.91],[-79.89,82.94],[-77.48,82.88],[-76.01,82.54],[-75.57,82.61],[-77.13,83.01],[-74.41,83.01],[-72.66,82.72],[-73.44,82.95],[-69.57,83.02]],[[133.47,-0.73],[134.11,-0.85],[134.19,-2.31],[134.46,-2.83],[134.63,-2.54],[135.09,-3.35],[135.49,-3.34],[136.39,-2.27],[137.07,-2.11],[137.12,-1.84],[137.91,-1.48],[139.79,-2.35],[144.48,-3.83],[145.77,-4.82],[145.75,-5.4],[147.42,-5.97],[147.8,-6.31],[147.81,-6.7],[146.95,-6.88],[147.26,-7.46],[148.13,-8.1],[148.58,-9.05],[149.2,-9.03],[149.26,-9.5],[150.01,-9.69],[149.76,-9.81],[149.87,-10.01],[150.85,-10.24],[150.45,-10.31],[150.65,-10.52],[150.32,-10.65],[149.75,-10.35],[147.77,-10.07],[146.03,-8.08],[144.51,-7.57],[144.14,-7.76],[143.65,-7.46],[143.94,-7.95],[143.52,-8],[143.61,-8.2],[142.21,-8.2],[143.38,-8.76],[142.65,-9.33],[141.13,-9.22],[140,-8.2],[140.12,-7.92],[139.38,-8.19],[139.25,-7.98],[138.93,-8.26],[139.09,-7.59],[138.75,-7.25],[139.18,-7.19],[138.6,-6.94],[138.87,-6.86],[138.44,-6.34],[138.34,-5.68],[138.09,-5.71],[137.28,-4.95],[135.19,-4.45],[134.68,-4.08],[134.89,-3.94],[133.97,-3.82],[133.68,-3.48],[133.84,-3.05],[133.4,-3.9],[132.97,-4.09],[132.75,-3.29],[131.97,-2.79],[132.72,-2.79],[133.19,-2.44],[133.7,-2.62],[133.92,-2.1],[132.31,-2.24],[131.93,-1.56],[131,-1.42],[131.26,-0.86],[132.39,-0.36],[133.27,-0.64]],[[116.81,6.69],[117.23,6.94],[117.69,6.35],[117.5,5.88],[118,6.05],[117.97,5.71],[118.35,5.81],[119.26,5.37],[119.13,5.1],[118.26,4.99],[118.55,4.38],[117.5,4.13],[117.78,3.69],[117.06,3.62],[118.06,2.32],[117.79,2.03],[118.99,0.98],[118.53,0.81],[117.91,1.1],[117.52,0.24],[117.56,-0.77],[116.91,-1.22],[116.74,-1.04],[116.75,-1.33],[116.28,-1.79],[116.55,-2.41],[115.96,-3.59],[114.7,-4.17],[114.34,-3.24],[113.71,-3.46],[113.04,-2.93],[112.76,-3.32],[111.86,-3.55],[111.7,-2.89],[110.26,-2.97],[109.98,-1.28],[109.29,-0.85],[109.13,-0.45],[109.26,0.03],[108.91,0.79],[109.08,1.5],[109.63,2.03],[111.22,1.4],[111.04,1.63],[111.51,2.74],[112.99,3.16],[114.01,4.57],[114.99,5.02],[115.43,4.97],[115.42,5.41],[115.88,5.61],[116.78,6.99],[116.84,6.77]],[[-114.52,72.59],[-113.58,72.65],[-113.08,73],[-111.27,72.71],[-111.89,72.36],[-111.67,72.3],[-110.21,72.66],[-110.66,73.01],[-110.01,72.98],[-108.76,72.55],[-108.19,71.72],[-107.81,71.63],[-107.3,71.9],[-107.7,72.15],[-108.24,73.15],[-107.93,73.22],[-108.03,73.35],[-106.48,73.2],[-105.41,72.79],[-104.38,71.58],[-104.51,71.06],[-103.59,70.63],[-101.09,70.14],[-100.91,69.81],[-102.24,69.84],[-102.62,69.55],[-103.43,69.67],[-103.05,69.47],[-103.12,69.2],[-102.15,69.49],[-101.79,69.18],[-102.89,68.82],[-105.1,68.92],[-105.02,69.08],[-106.14,69.16],[-106.66,69.44],[-107.44,69],[-109.47,68.68],[-113.02,68.48],[-113.55,68.77],[-113.69,69.19],[-116.51,69.43],[-117.19,70.05],[-111.63,70.31],[-113.76,70.69],[-117.59,70.63],[-118.38,70.97],[-115.3,71.49],[-117.94,71.39],[-118.23,71.47],[-117.74,71.66],[-118.99,71.76],[-118.94,71.99],[-118.21,72.26],[-118.37,72.53],[-116.57,73.06],[-114.21,73.3],[-114.08,72.91],[-114.5,72.63]],[[49.54,-12.43],[49.94,-13.07],[50.41,-15.63],[50.19,-15.96],[49.89,-15.46],[49.66,-15.52],[49.84,-16.49],[49.45,-17.24],[49.36,-18.34],[47.18,-24.79],[46.73,-25.15],[45.11,-25.54],[44.03,-25],[43.26,-22.38],[43.5,-21.36],[44.4,-19.92],[43.98,-17.39],[44.48,-16.22],[46.16,-15.74],[46.4,-15.93],[46.47,-15.51],[46.94,-15.22],[47.1,-15.43],[47.35,-14.77],[47.48,-15.01],[47.97,-14.67],[47.77,-14.37],[47.94,-13.66],[48.26,-13.72],[48.8,-13.27],[48.79,-12.47],[49.21,-12.08],[49.48,-12.35]],[[96.49,5.23],[97.55,5.21],[98.31,4.09],[99.73,3.18],[100.31,2.47],[100.53,2.19],[100.82,1.99],[100.89,1.95],[100.83,2.24],[100.94,2.29],[101.05,2.26],[101.3,2.01],[101.48,1.69],[101.79,1.62],[102.39,0.84],[102.57,0.75],[102.85,0.72],[103.03,0.58],[103.07,0.49],[102.79,0.3],[102.55,0.22],[102.78,0.24],[103.34,0.51],[103.48,0.48],[103.67,0.29],[103.79,0.05],[103.43,-0.19],[103.53,-0.75],[104.38,-1.07],[104.51,-1.82],[104.85,-2.09],[104.65,-2.59],[105.4,-2.38],[106.04,-3.11],[105.89,-5.01],[105.82,-5.68],[105.75,-5.82],[105.62,-5.8],[105.52,-5.67],[104.64,-5.52],[104.6,-5.91],[101.58,-3.17],[100.89,-2.25],[100.31,-0.83],[99.16,0.35],[98.6,1.87],[97.7,2.36],[96.97,3.58],[95.58,4.66],[95.23,5.56],[96.25,5.27]],[[-3.11,58.52],[-3.99,57.96],[-3.86,57.82],[-4.13,57.58],[-1.96,57.68],[-1.78,57.47],[-2.09,57.1],[-2.26,56.86],[-2.59,56.56],[-3.31,56.36],[-2.89,56.4],[-2.65,56.32],[-2.67,56.25],[-2.98,56.19],[-3.36,56.03],[-3.79,56.09],[-3.61,56.02],[-3.05,55.95],[-2.84,56.03],[-2.6,56.03],[-2.15,55.9],[-1.65,55.57],[-1.23,54.7],[-0.08,54.12],[0.12,53.61],[-0.66,53.72],[0.13,53.47],[0.35,53.16],[0.21,53.03],[0.05,52.91],[0.33,52.81],[0.52,52.94],[1.66,52.75],[1.75,52.47],[1.32,51.96],[1.23,51.97],[1.28,51.84],[1.19,51.8],[0.96,51.81],[0.75,51.73],[0.9,51.69],[0.89,51.57],[0.42,51.47],[0.53,51.49],[0.69,51.39],[0.89,51.36],[1.42,51.36],[1.4,51.18],[1.05,51.05],[0.96,50.93],[0.77,50.93],[0.2,50.76],[-0.2,50.82],[-0.79,50.76],[-1.42,50.9],[-1.33,50.82],[-1.52,50.75],[-3,50.72],[-3.4,50.63],[-3.68,50.24],[-3.79,50.23],[-4.2,50.39],[-4.73,50.29],[-5.01,50.16],[-5.12,50.04],[-5.23,50.02],[-5.43,50.11],[-5.62,50.05],[-5.66,50.13],[-5.34,50.25],[-4.89,50.53],[-4.58,50.78],[-4.52,50.98],[-4.3,51.03],[-4.19,51.19],[-3.84,51.23],[-3.26,51.19],[-3.04,51.25],[-2.43,51.74],[-3.29,51.39],[-3.56,51.41],[-3.89,51.59],[-4.24,51.57],[-4.09,51.66],[-4.39,51.74],[-4.6,51.74],[-4.9,51.63],[-5.12,51.71],[-5.2,51.86],[-5.26,51.88],[-5.09,52],[-4.38,52.2],[-4.15,52.33],[-4.1,52.92],[-4.68,52.84],[-3.81,53.3],[-3.32,53.35],[-3.1,53.26],[-3.17,53.39],[-3.07,53.43],[-2.92,53.3],[-2.75,53.31],[-2.91,53.35],[-3.07,53.51],[-2.93,53.73],[-3.03,53.77],[-3.03,53.91],[-2.9,53.96],[-2.87,54.18],[-3.17,54.13],[-3.57,54.47],[-3.59,54.56],[-3.47,54.77],[-3.27,54.91],[-3.04,54.95],[-3.55,54.95],[-3.96,54.78],[-4.3,54.84],[-4.91,54.69],[-5.17,54.92],[-4.68,55.5],[-4.73,55.6],[-4.87,55.87],[-4.58,55.94],[-4.67,55.97],[-4.8,56.16],[-5.23,55.89],[-5.09,56.2],[-5.77,55.36],[-5.19,56.76],[-5.65,56.53],[-6.13,56.71],[-5.59,57.1],[-5.82,57.44],[-5.58,57.55],[-5.69,57.78],[-5.16,57.88],[-5.41,58.07],[-5.01,58.26],[-4.98,58.58],[-3.06,58.59]],[[141.23,41.37],[141.45,41.4],[141.43,40.72],[141.8,40.29],[141.98,39.43],[141.47,38.4],[140.96,38.15],[141,37.11],[140.79,36.85],[140.63,36.5],[140.57,36.23],[140.62,36.06],[140.87,35.72],[140.64,35.66],[140.46,35.51],[140.36,35.18],[140.06,35.04],[139.92,34.9],[139.8,34.96],[139.84,35.01],[139.83,35.3],[140.1,35.59],[139.99,35.67],[139.83,35.66],[139.77,35.49],[139.65,35.41],[139.74,35.25],[139.68,35.15],[139.47,35.3],[139.25,35.28],[139.13,35.15],[139.09,34.84],[138.98,34.7],[138.84,34.62],[138.76,34.7],[138.8,34.97],[138.9,35.02],[138.72,35.12],[138.58,35.09],[138.35,34.85],[138.19,34.6],[137.06,34.58],[137.3,34.73],[137.1,34.76],[136.96,34.84],[136.94,34.72],[136.87,34.73],[136.85,34.98],[136.9,35.03],[136.8,35.05],[136.69,34.98],[136.53,34.68],[136.88,34.43],[136.85,34.32],[136.33,34.18],[135.92,33.56],[135.69,33.49],[135.45,33.55],[135.13,34.01],[135.1,34.29],[135.31,34.42],[135.42,34.62],[135.04,34.63],[134.74,34.77],[134.25,34.71],[133.97,34.53],[132.31,34.32],[132.14,33.84],[131.74,34.05],[130.92,33.98],[131,34.39],[131.35,34.41],[132.75,35.45],[134.21,35.54],[134.46,35.63],[135.18,35.75],[135.27,35.72],[135.23,35.59],[135.27,35.55],[135.68,35.5],[136.01,35.68],[136.09,35.77],[136.01,35.99],[136.07,36.12],[136.7,36.74],[136.84,37.38],[137.32,37.52],[136.9,37.12],[137.3,36.75],[138.32,37.22],[139.36,38.1],[140.04,39.41],[140,39.86],[139.74,39.92],[140.01,40.26],[139.92,40.6],[140.39,41.23],[140.75,40.83],[141.12,40.88],[141.25,41.21],[140.8,41.25],[140.94,41.5],[141.11,41.46]],[[-119.74,74.11],[-117.51,74.23],[-115.39,73.5],[-118.96,72.68],[-120.18,72.21],[-120.62,71.51],[-122.84,71.1],[-124.01,71.68],[-125.84,71.98],[-124.99,72.59],[-124.97,72.84],[-124.57,72.94],[-124.8,73.13],[-123.8,73.77],[-124.7,74.35],[-121.5,74.54],[-119.56,74.23],[-119.74,74.13]],[[-91.89,81.13],[-90.64,80.59],[-89.24,80.51],[-88.86,80.17],[-88.2,80.11],[-88.61,80.26],[-88.52,80.42],[-87.67,80.37],[-87.92,80.1],[-86.98,79.89],[-87.3,79.58],[-85.65,79.61],[-85.04,79.28],[-87.62,78.68],[-87.92,78.75],[-87.83,79.05],[-88.04,79],[-88.25,78.67],[-87.98,78.54],[-88.74,78.58],[-88.79,78.19],[-90.04,78.61],[-89.49,78.17],[-91.41,78.19],[-92.85,78.46],[-91.87,78.54],[-93.27,78.61],[-93.64,78.75],[-93.16,78.78],[-94.17,78.97],[-91.3,79.37],[-95.1,79.29],[-95.73,79.42],[-94.4,79.74],[-95.86,79.67],[-96.77,80.14],[-94.26,80.2],[-96.39,80.32],[-95.55,80.37],[-96.15,80.55],[-95.93,80.72],[-93.93,80.56],[-95.51,80.84],[-95.27,81],[-93.24,81.13],[-94.18,81.34],[-92,81.18]],[[-15.54,66.23],[-14.6,66.38],[-15.11,66.1],[-14.7,66.02],[-14.83,65.76],[-14.39,65.79],[-14.47,65.57],[-13.62,65.52],[-13.8,65.35],[-13.57,65.07],[-14.63,64.42],[-18.08,63.5],[-20.49,63.69],[-20.41,63.81],[-20.65,63.74],[-21.14,63.89],[-21.09,63.93],[-21.15,63.94],[-21.45,63.86],[-22.65,63.83],[-22.69,63.87],[-22.74,64.02],[-22.7,64.08],[-22.51,63.99],[-22.06,64.07],[-21.67,64.35],[-21.46,64.38],[-21.65,64.4],[-22.05,64.31],[-21.9,64.39],[-22,64.41],[-21.95,64.52],[-21.59,64.63],[-22.16,64.54],[-22.33,64.63],[-22.25,64.73],[-22.47,64.8],[-24.02,64.86],[-23.32,64.96],[-22.79,65.05],[-21.89,65.05],[-21.8,65.11],[-21.78,65.19],[-22.04,65.13],[-22.51,65.2],[-21.84,65.45],[-22.31,65.48],[-22.64,65.57],[-24.47,65.52],[-23.86,65.54],[-24.09,65.78],[-23.29,65.75],[-23.83,65.85],[-23.52,65.88],[-23.78,66.02],[-23.45,66.18],[-22.44,65.91],[-22.95,66.21],[-22.48,66.27],[-23.12,66.34],[-22.89,66.44],[-21.41,66.03],[-21.38,65.74],[-21.66,65.72],[-21.36,65.58],[-21.43,65.47],[-21.23,65.42],[-21.13,65.27],[-21.05,65.43],[-20.45,65.57],[-20.21,66.1],[-19.49,65.77],[-19.38,66.08],[-18.84,66.18],[-18.14,65.73],[-18.3,66.16],[-17.55,65.96],[-16.49,66.2],[-16.54,66.45],[-16.25,66.52],[-15.65,66.26]],[[-94.29,76.91],[-93.21,76.75],[-93.53,76.45],[-91.31,76.68],[-90.54,76.5],[-91.41,76.46],[-89.29,76.3],[-91.41,76.22],[-89.28,75.79],[-89.65,75.57],[-88.92,75.45],[-88.65,75.66],[-85.95,75.4],[-83.93,75.82],[-82.15,75.83],[-79.66,75.45],[-79.51,75.26],[-80.38,75.03],[-79.4,74.92],[-80.35,74.9],[-80.15,74.8],[-80.28,74.58],[-81.94,74.47],[-82.93,74.57],[-83.52,74.9],[-83.34,74.77],[-83.53,74.59],[-84.43,74.51],[-88.42,74.49],[-88.34,74.78],[-88.53,74.83],[-89.56,74.56],[-90.88,74.82],[-91.51,74.65],[-92.39,75.26],[-92.07,75.66],[-92.18,75.85],[-93.09,76.35],[-95.27,76.26],[-96.04,76.49],[-95.65,76.58],[-96.9,76.75],[-96.4,76.8],[-96.76,76.97],[-95.85,77.07],[-94.61,76.96]],[[173.12,-41.28],[173.95,-40.92],[173.8,-41.27],[174,-40.99],[174.3,-41.02],[174.04,-41.24],[174.37,-41.1],[174.07,-41.43],[174.21,-41.85],[172.53,-43.47],[173.1,-43.84],[172.04,-43.7],[172.18,-43.9],[171.24,-44.26],[170.78,-45.87],[169.69,-46.55],[169.1,-46.63],[168.38,-46.61],[167.54,-46.15],[166.83,-46.23],[166.92,-45.96],[166.49,-45.96],[167,-45.71],[166.73,-45.54],[166.87,-45.31],[167.16,-45.41],[167.03,-45.12],[167.91,-44.67],[168.37,-44.08],[169.18,-43.91],[171.04,-42.86],[172.27,-40.76],[172.94,-40.52],[172.7,-40.67],[173.07,-41.19]],[[16.79,79.91],[17.83,79.8],[17.67,79.39],[18.4,79.61],[18.82,79.43],[18.68,79.26],[20.61,79.11],[20.77,79.06],[20.5,78.98],[21.39,78.74],[19.15,78.38],[16.7,76.58],[14,77.51],[16.91,77.9],[14.09,77.77],[13.68,78.03],[17.17,78.42],[16.45,78.5],[16.78,78.66],[15.42,78.47],[15.38,78.77],[14.69,78.72],[14.43,78.49],[14.64,78.41],[13.15,78.24],[11.37,78.95],[12.4,78.95],[11.98,79.03],[11.98,79.29],[11.21,79.13],[10.68,79.76],[13.69,79.86],[13.92,79.76],[12.56,79.57],[13.96,79.34],[14.59,79.8],[16.34,78.98],[15.83,79.71],[16.25,80.05],[16.52,80.02]],[[67.77,76.24],[61.36,75.32],[59.67,74.61],[58.53,74.5],[58.62,74.23],[57.77,74.01],[57.76,73.77],[57.31,73.84],[57.54,73.66],[56.63,73.31],[54.3,73.35],[53.76,73.77],[55.34,74.42],[56.14,74.5],[55.58,74.63],[56.5,74.96],[55.81,75.12],[57.61,75.34],[58.88,75.86],[60.94,76.07],[61.2,76.28],[64.46,76.38],[67.53,77.01],[68.94,76.71],[68.16,76.28]],[[124.89,1],[124.43,0.47],[123.75,0.31],[120.58,0.53],[120.19,0.27],[120.06,-0.55],[120.67,-1.37],[121.15,-1.34],[121.58,-0.83],[121.97,-0.93],[123.17,-0.57],[123.43,-0.78],[123.38,-1],[122.9,-0.9],[122.25,-1.55],[121.36,-1.88],[122.29,-2.91],[122.25,-3.62],[122.85,-4.07],[122.87,-4.39],[122.12,-4.54],[122.04,-4.83],[121.59,-4.76],[121.62,-4.09],[120.89,-3.52],[121.05,-2.75],[120.65,-2.67],[120.26,-2.95],[120.43,-5.59],[119.56,-5.61],[119.36,-5.32],[119.62,-4.03],[119.47,-3.51],[118.92,-3.48],[118.78,-2.72],[119.32,-1.93],[119.51,-0.91],[119.71,-0.68],[119.84,-0.86],[119.72,-0.09],[120.27,0.97],[120.6,0.85],[121.08,1.33],[122.84,0.85],[123.85,0.84],[125.11,1.69],[125.23,1.5],[124.97,1.08]],[[-55.46,51.54],[-56.03,51.33],[-55.8,51.03],[-56.82,49.61],[-56.18,50.12],[-56.16,49.94],[-55.5,49.98],[-56.14,49.62],[-55.23,49.51],[-55.35,49.08],[-54.5,49.53],[-54.45,49.33],[-53.62,49.32],[-53.57,49.14],[-54.16,48.79],[-53.71,48.66],[-54.11,48.39],[-53.03,48.63],[-53.87,48.02],[-53.64,48.02],[-53.86,47.8],[-53.67,47.65],[-52.86,48.11],[-53.17,47.51],[-52.78,47.77],[-52.65,47.55],[-53.07,46.68],[-53.59,46.64],[-53.6,47.15],[-54.18,46.88],[-53.85,47.44],[-54.19,47.86],[-54.49,47.4],[-55.79,46.87],[-55.92,47.02],[-54.78,47.66],[-55.58,47.46],[-56.13,47.5],[-55.86,47.82],[-56.77,47.57],[-59.26,47.63],[-59.34,47.93],[-58.33,48.52],[-59.17,48.56],[-58.71,48.6],[-58.41,49.08],[-57.99,48.99],[-58.21,49.39],[-57.79,49.49],[-57.93,49.7],[-57.04,51.01],[-56.03,51.57],[-55.45,51.56]],[[-108.29,76.06],[-107.72,76],[-108.02,75.8],[-107.21,75.89],[-106.91,75.68],[-106.68,76.02],[-105.9,76.01],[-105.48,75.7],[-106.09,75.09],[-108.83,75.07],[-112.52,74.42],[-114.38,74.67],[-111.03,75.23],[-113.71,75.07],[-113.85,75.26],[-113.47,75.42],[-114.01,75.43],[-114.52,75.28],[-114.45,75.09],[-115.73,74.97],[-117.6,75.27],[-115.14,75.68],[-117.16,75.65],[-114.99,75.9],[-116.66,75.96],[-116.21,76.19],[-114.78,76.17],[-115.83,76.3],[-115,76.5],[-112.7,76.2],[-111.05,75.55],[-109.09,75.51],[-108.92,75.67],[-109.87,75.93],[-109.43,76.11],[-110.31,76.4],[-108.83,76.82],[-108.47,76.74],[-108.63,76.59],[-108.12,76.23],[-108.39,76.07]],[[173.27,-34.93],[174.37,-35.33],[174.54,-35.58],[174.51,-35.67],[174.58,-35.79],[174.39,-35.8],[174.8,-36.31],[174.75,-36.49],[174.82,-36.61],[174.72,-36.84],[174.89,-36.91],[174.95,-36.85],[175.3,-36.99],[175.38,-37.21],[175.54,-37.2],[175.49,-36.69],[175.38,-36.56],[175.46,-36.48],[175.68,-36.75],[175.77,-36.73],[175.99,-37.44],[176.12,-37.54],[176.13,-37.59],[176.03,-37.58],[176.11,-37.64],[177.27,-37.99],[178.01,-37.55],[178.53,-37.69],[177.91,-39.24],[177.08,-39.22],[176.84,-40.16],[175.98,-41.21],[175.31,-41.61],[174.87,-41.22],[174.64,-41.29],[175.21,-40.2],[173.76,-39.32],[174.57,-38.84],[174.65,-38.43],[174.84,-38.02],[174.8,-37.9],[174.93,-37.8],[174.73,-37.45],[174.77,-37.34],[174.71,-37.33],[174.59,-37.1],[174.66,-37.09],[174.73,-37.22],[174.81,-37.11],[174.93,-37.09],[174.78,-36.94],[174.6,-36.98],[174.47,-36.94],[174.38,-36.73],[174.19,-36.49],[174.4,-36.6],[174.46,-36.51],[174.36,-36.38],[174.39,-36.24],[174.27,-36.16],[174.25,-36.25],[174.03,-36.12],[173.92,-35.91],[173.92,-36.02],[174.17,-36.33],[174.15,-36.38],[174.06,-36.36],[173.41,-35.54],[173.63,-35.32],[173.31,-35.44],[172.71,-34.46],[173.04,-34.43],[173.24,-34.9]],[[-7.18,55.06],[-6.13,55.22],[-5.72,54.82],[-5.71,54.76],[-5.88,54.68],[-5.88,54.64],[-5.58,54.66],[-5.47,54.5],[-5.48,54.44],[-5.67,54.55],[-5.66,54.38],[-5.56,54.37],[-5.61,54.27],[-5.83,54.24],[-6.02,54.05],[-6.22,54.09],[-6.16,54.02],[-6.35,53.99],[-6.14,53.58],[-6.15,53.37],[-6.03,52.93],[-6.17,52.74],[-6.22,52.54],[-6.46,52.34],[-6.32,52.25],[-6.89,52.16],[-6.96,52.25],[-7.08,52.14],[-7.22,52.14],[-9.3,51.5],[-10.12,51.6],[-9.6,51.87],[-10.34,51.8],[-9.91,52.12],[-10.36,52.21],[-8.78,52.68],[-9.92,52.57],[-8.93,53.21],[-10.09,53.41],[-9.58,53.8],[-9.91,53.86],[-10.06,54.26],[-8.54,54.24],[-8.13,54.64],[-8.76,54.68],[-8.27,55.15],[-7.67,55.26],[-7.66,54.97],[-7.31,55.37],[-6.96,55.24],[-7.22,55.09]],[[107.37,-6.01],[107.56,-6.18],[108.14,-6.3],[108.29,-6.26],[108.42,-6.38],[108.78,-6.81],[110.43,-6.95],[110.84,-6.42],[112.54,-6.93],[113.01,-7.66],[114.41,-7.79],[114.58,-8.77],[113.25,-8.29],[111.51,-8.3],[107.29,-7.47],[106.53,-7.39],[106.41,-7.31],[106.52,-7.05],[105.94,-6.86],[105.48,-6.85],[105.26,-6.84],[105.34,-6.67],[105.37,-6.66],[105.4,-6.77],[105.48,-6.78],[105.66,-6.47],[105.79,-6.46],[105.87,-6.12],[106.07,-5.91],[106.83,-6.1],[107.01,-6.01],[107.05,-5.9],[107.33,-5.98]],[[142.76,54.39],[143.33,52.96],[143.19,51.95],[144.71,48.64],[144.05,49.25],[143.1,49.2],[142.56,47.74],[143.58,46.36],[143.43,46.03],[143.28,46.56],[142.58,46.7],[142.08,45.92],[141.83,46.45],[142.18,48.01],[141.86,48.75],[142.14,49.57],[142.21,51.22],[141.72,51.74],[141.66,52.27],[141.83,53.34],[142.53,53.45],[142.71,53.89],[142.34,54.28],[142.69,54.42]],[[-81.84,23.16],[-79.82,22.89],[-79.27,22.41],[-77.5,21.87],[-76.87,21.33],[-75.72,21.11],[-75.72,20.71],[-74.88,20.65],[-74.16,20.17],[-75.12,19.9],[-77.72,19.86],[-77.1,20.41],[-77.23,20.64],[-78.12,20.76],[-78.73,21.59],[-79.36,21.58],[-81.19,22.27],[-81.85,22.21],[-82.08,22.39],[-81.71,22.5],[-81.84,22.67],[-82.74,22.69],[-84.03,21.94],[-84.89,21.86],[-84.33,22.07],[-84.36,22.38],[-84.04,22.67],[-82.1,23.19]],[[143.82,44.12],[144.72,43.93],[145.37,44.33],[145.14,43.66],[145.34,43.3],[145.83,43.39],[143.97,42.88],[143.24,42],[141.85,42.58],[140.99,42.34],[140.48,42.56],[140.33,42.29],[141.15,41.81],[140.04,41.47],[139.86,42.58],[140.43,42.95],[140.39,43.3],[141.38,43.28],[141.76,44.48],[141.67,45.4],[141.94,45.51],[143.76,44.13]],[[121.1,18.62],[121.85,18.29],[122.27,18.46],[122.15,17.66],[122.52,17.12],[122.14,16.19],[121.69,16.02],[121.6,15.93],[121.56,15.83],[121.61,15.67],[121.39,15.32],[121.69,14.77],[121.63,14.58],[121.77,14.17],[121.91,14.02],[122.21,13.93],[122.29,14],[122.2,14.15],[122.49,14.32],[122.94,14.19],[123.1,13.75],[123.32,14.06],[123.86,13.8],[123.55,13.65],[123.79,13.11],[124.14,13.04],[124.06,12.57],[123.95,12.92],[123.31,13.04],[122.59,13.91],[122.6,13.19],[122.21,13.65],[122.07,13.79],[121.78,13.94],[121.5,13.84],[121.45,13.71],[121.34,13.65],[121.1,13.68],[120.93,13.76],[120.84,13.89],[120.73,13.9],[120.64,13.81],[120.62,14.19],[120.92,14.49],[120.94,14.65],[120.59,14.88],[120.55,14.77],[120.59,14.48],[120.44,14.45],[120.25,14.79],[120.08,14.85],[119.93,15.43],[119.77,16.25],[120.37,16.11],[120.6,18.51],[121.05,18.61]],[[-100,73.95],[-99.16,73.73],[-97.11,73.79],[-97,73.67],[-97.63,73.5],[-97.27,73.39],[-98.43,72.96],[-97.63,73.03],[-97.13,72.63],[-96.54,72.7],[-96.47,72.43],[-96.8,72.32],[-96.61,71.83],[-97.58,71.63],[-98.32,71.85],[-98.2,71.44],[-99.17,71.37],[-100.59,72.15],[-102.71,72.77],[-102.2,73.08],[-101.27,72.72],[-100.13,72.91],[-100.54,73.2],[-99.82,73.21],[-101.52,73.49],[-100.52,73.45],[-100.99,73.77],[-100.14,73.93]],[[55.32,73.31],[56.43,73.2],[56.12,72.81],[55.4,72.55],[55.52,72.22],[55.3,71.94],[56.45,71.11],[57.62,70.73],[56.26,70.71],[56.44,70.56],[53.72,70.81],[53.38,70.87],[54.16,71.12],[53.41,71.34],[53.41,71.53],[51.81,71.49],[51.44,71.78],[51.58,72.07],[52.62,72.3],[52.92,72.67],[52.55,72.77],[53.37,72.92],[53.25,73.18],[55.12,73.36]],[[-84.92,65.26],[-84.5,65.46],[-82.05,64.64],[-81.68,64.21],[-81.89,64.02],[-80.83,64.09],[-80.26,63.8],[-81.05,63.46],[-83.3,64.14],[-84.63,63.31],[-85.39,63.12],[-85.77,63.7],[-87.18,63.6],[-86.25,64.14],[-86.37,64.57],[-85.81,65.83],[-85.24,65.8],[-85.06,65.44]],[[126.01,9.32],[126.31,8.95],[126.14,8.6],[126.46,8.2],[126.58,7.25],[126.19,6.85],[126.19,6.31],[125.69,7.26],[125.38,6.69],[125.67,5.98],[125.35,5.6],[125.23,6.07],[124.93,5.88],[124.08,6.4],[123.99,6.99],[124.21,7.4],[123.67,7.82],[123.39,7.41],[122.62,7.76],[122.14,6.95],[121.9,7.07],[122.24,7.94],[122.91,8.16],[123.44,8.7],[123.85,8.43],[123.8,8.05],[124.4,8.6],[124.73,8.56],[124.87,8.97],[125.5,9.01],[125.47,9.76],[125.96,9.43]],[[140.05,75.83],[140.82,75.63],[140.99,75.96],[141.49,76.14],[145.36,75.53],[144.02,75.04],[142.82,75.27],[142.7,75.45],[142.94,75.71],[142.31,75.69],[142.09,75.66],[142.2,75.39],[143.13,74.97],[139.68,74.96],[139.1,74.66],[138.09,74.8],[136.95,75.33],[137.29,75.35],[137.27,75.75],[137.71,75.76],[137.56,75.96],[138.21,76.12],[138.92,76.2],[139.74,75.95]],[[-93.17,74.16],[-90.36,73.87],[-92.12,72.75],[-94.21,72.76],[-93.54,72.44],[-94.14,72],[-95.19,72.03],[-95.6,72.88],[-95.63,73.7],[-94.7,73.66],[-95.15,73.91],[-94.97,74.04],[-93.41,74.18]],[[145.04,-40.79],[146.32,-41.16],[148.22,-40.85],[148.34,-42.22],[148.22,-41.97],[148.02,-42.26],[147.98,-43.16],[147.3,-42.79],[146.87,-43.61],[146.04,-43.55],[146.21,-43.32],[145.49,-42.93],[145.2,-42.23],[145.52,-42.35],[144.77,-41.39],[144.72,-40.67],[144.82,-40.72]],[[20.9,80.25],[22.29,80.05],[22.45,80.4],[23.01,80.47],[23.32,80.42],[23.11,80.19],[24.4,80.36],[26.86,80.16],[27.2,79.91],[23.95,79.19],[20.13,79.49],[19.68,79.59],[20.78,79.75],[18.73,79.76],[18.25,79.93],[18.86,80.04],[17.92,80.14],[19.34,80.12],[19.54,80.16],[19.18,80.33],[19.75,80.23],[19.73,80.48],[20.69,80.3]],[[-71.96,19.72],[-70.95,19.91],[-69.96,19.67],[-69.74,19.3],[-69.23,19.27],[-69.62,19.12],[-68.68,18.9],[-68.36,18.54],[-68.69,18.21],[-69.27,18.44],[-71.03,18.27],[-71.44,17.63],[-72.06,18.23],[-73.51,18.25],[-73.89,18.04],[-74.46,18.39],[-74.23,18.66],[-72.38,18.57],[-72.81,19.07],[-72.7,19.44],[-73.44,19.72],[-72.88,19.93],[-72.22,19.74]],[[-69.17,-52.67],[-68.63,-52.65],[-68.24,-53.08],[-68.49,-53.26],[-67.29,-54.05],[-66.24,-54.53],[-65.18,-54.68],[-66.51,-55.03],[-71.9,-54.6],[-70.8,-54.33],[-70.31,-54.53],[-70.86,-54.11],[-70.53,-53.63],[-70.38,-53.99],[-70.63,-54],[-70.24,-54.35],[-69.05,-54.43],[-70.15,-53.89],[-69.39,-53.37],[-70.21,-53.41],[-70.46,-53.21],[-70.13,-52.94],[-70.38,-52.75],[-69.94,-52.82],[-69.5,-52.49],[-69.41,-52.49]],[[97.67,80.16],[98.02,80.02],[97.65,79.76],[98.6,80.05],[99.95,79.85],[99.68,79.32],[99.04,79.29],[99.93,78.96],[97.56,78.83],[93.07,79.5],[94.99,80.1],[97.59,80.17]],[[-115.55,77.36],[-116.33,77.14],[-115.81,76.94],[-116.25,76.9],[-115.94,76.71],[-117,76.53],[-117.23,76.28],[-117.99,76.41],[-117.88,76.8],[-118.79,76.51],[-118.62,76.37],[-118.99,76.15],[-119.58,76.33],[-119.74,76.12],[-119.54,75.98],[-119.91,75.86],[-120.41,75.83],[-120.85,76.18],[-122.4,75.94],[-122.9,76.13],[-119.09,77.3],[-116.84,77.34],[-117.04,77.46],[-116.51,77.55],[-116.01,77.46]],[[79.98,9.81],[80.71,9.37],[81.83,7.43],[81.77,6.61],[81.38,6.24],[80.73,5.98],[80.5,5.95],[80.27,6.01],[80.1,6.15],[79.86,6.83],[79.71,8.07],[79.75,8.29],[79.75,8.05],[79.81,8.05],[79.85,8.41],[80.08,9.58],[80.43,9.48],[79.97,9.79]],[[-97.7,76.47],[-97.53,76.11],[-97.89,75.76],[-97.41,75.67],[-97.34,75.42],[-97.88,75.42],[-97.66,75.15],[-98.07,75.2],[-97.99,75.05],[-100.23,75.01],[-100.48,75.19],[-100.14,75.25],[-100.73,75.35],[-99.19,75.7],[-102.8,75.6],[-102.15,75.87],[-100.97,75.8],[-101.87,76.08],[-101.56,76.24],[-102.14,76.28],[-101.79,76.45],[-99.87,75.92],[-99.69,75.96],[-100.11,76.12],[-99.54,76.15],[-100.89,76.48],[-100.07,76.63],[-98.89,76.47],[-99.02,76.61],[-98.71,76.69],[-97.72,76.5]],[[96.53,81.08],[97.86,80.7],[97.11,80.61],[97.42,80.32],[97.17,80.24],[93.87,80.01],[91.53,80.36],[92.83,80.62],[93.26,80.79],[92.61,80.81],[93.36,81.03],[95.16,81.27],[96.47,81.1]],[[-103.43,79.32],[-102.58,78.88],[-101.7,79.08],[-100.01,78.73],[-99.58,78.56],[-99.75,78.3],[-99,78],[-99.96,77.79],[-101.07,78.19],[-104.51,78.29],[-105,78.52],[-103.57,78.54],[-104.02,78.63],[-103.37,78.74],[-104.18,78.78],[-103.88,78.9],[-104.15,78.99],[-104.9,78.81],[-104.75,79.03],[-105.58,79.11],[-105.39,79.32],[-103.71,79.35]],[[102.88,79.25],[102.41,78.84],[103.8,79.15],[105.34,78.59],[104.74,78.34],[99.29,78.04],[100.42,78.75],[100.95,78.79],[101.05,79.12],[101.59,79.35],[103.1,79.3],[102.94,79.27]],[[131.18,33.6],[131.69,33.6],[131.54,33.27],[131.9,33.25],[132.01,32.92],[131.34,31.4],[131.07,31.44],[130.69,31.01],[130.78,31.71],[130.59,31.18],[130.15,31.41],[130.55,32.83],[130.24,33.18],[130.34,32.7],[129.77,32.57],[129.68,33.06],[129.99,32.85],[129.58,33.24],[130.72,33.93],[131.06,33.67]],[[-127.2,50.64],[-125.48,50.32],[-124.83,49.53],[-123.85,49.12],[-123.5,48.58],[-123.41,48.7],[-123.29,48.46],[-123.31,48.41],[-123.45,48.43],[-123.57,48.32],[-125.12,48.76],[-124.81,49.21],[-125.49,48.93],[-125.93,49.4],[-126.52,49.4],[-126.54,49.59],[-126.13,49.67],[-127.12,49.88],[-127.25,50.14],[-127.86,50.13],[-127.91,50.45],[-127.49,50.41],[-127.46,50.58],[-128.35,50.7],[-127.92,50.86],[-127.71,50.82]],[[121.01,22.62],[120.84,21.92],[120.08,23.09],[120.13,23.65],[120.63,24.48],[121.04,25.03],[121.59,25.28],[121.91,25.06],[121.93,24.97],[121.82,24.82],[121.83,24.53],[121.64,24.13],[121.52,23.67],[121.16,22.78]],[[-79.54,73.65],[-77.21,73.5],[-76.09,72.88],[-79.5,72.76],[-80.78,73.33],[-80.86,73.67],[-79.89,73.7]],[[-49.63,-0.23],[-48.39,-0.3],[-48.83,-1.39],[-49.8,-1.79],[-50.51,-1.79],[-50.79,-0.91],[-50.65,-0.27],[-50.25,-0.12]],[[110.89,19.99],[111.01,19.66],[110.02,18.42],[109.52,18.22],[108.7,18.54],[108.67,19.3],[109.26,19.88],[110.65,20.14],[110.81,20.02]],[[151.92,-4.3],[152.41,-4.34],[152.35,-4.82],[151.98,-5.07],[152.08,-5.46],[151.52,-5.55],[150.47,-6.26],[149.65,-6.29],[148.34,-5.67],[148.43,-5.47],[149.83,-5.52],[150.09,-5.01],[150.18,-5.52],[150.74,-5.51],[151.67,-4.88],[151.59,-4.2],[151.87,-4.26]],[[-97.44,69.64],[-95.27,68.83],[-96.6,68.46],[-99.56,69.03],[-98.5,69.31],[-98.55,69.57],[-98.04,69.46],[-98.3,69.67],[-98.08,69.83],[-97.47,69.67]],[[21.61,78.6],[22.04,78.58],[22.3,78.23],[23.45,78.15],[23.12,77.99],[24.9,77.76],[22.8,77.28],[22.43,77.32],[22.69,77.55],[21.05,77.44],[20.87,77.57],[21.65,77.92],[20.23,78.48],[21.45,78.6]],[[15.58,38.22],[15.1,37.46],[15.29,37.06],[15.11,36.69],[14.37,36.97],[14.14,37.1],[13.8,37.14],[12.92,37.57],[12.64,37.59],[12.44,37.82],[12.55,38.05],[12.74,38.18],[12.9,38.03],[13.16,38.19],[13.35,38.18],[13.38,38.13],[13.79,37.98],[14.05,38.04],[14.51,38.05],[14.79,38.17],[15.63,38.27]],[[9.63,40.88],[9.8,40.5],[9.56,39.17],[9.06,39.24],[8.97,38.96],[8.65,38.93],[8.42,39.21],[8.55,39.84],[8.2,40.87],[9.23,41.26],[9.57,40.91]],[[127.3,-8.42],[125.41,-9.28],[124.43,-10.15],[123.61,-10.27],[123.71,-9.62],[125.18,-8.65],[127.26,-8.39]],[[-93.54,75.03],[-93.57,74.67],[-94.54,74.64],[-96.6,75.06],[-95.95,75.44],[-94.88,75.63],[-93.91,75.42],[-93.55,75.05]],[[134.36,34.26],[134.64,34.23],[134.68,33.85],[134.74,33.82],[134.38,33.61],[134.18,33.25],[133.69,33.52],[133.29,33.36],[132.87,32.75],[132.49,32.92],[132.41,33.43],[132.03,33.34],[132.94,34.1],[133.47,33.97],[133.95,34.35],[134.07,34.36],[134.22,34.32]],[[-75.67,68.32],[-75.06,68.14],[-75.13,67.54],[-75.4,67.37],[-76.95,67.25],[-77.31,67.69],[-76.69,68.26],[-75.87,68.34]],[[-96.21,78.53],[-94.92,78.39],[-95.33,78.22],[-94.93,78.08],[-96.99,77.81],[-97.66,78.09],[-96.94,78.15],[-98.05,78.33],[-98.34,78.75],[-96.26,78.55]],[[-52.73,69.94],[-51.9,69.6],[-53.75,69.26],[-54.18,69.4],[-53.66,69.47],[-53.83,69.54],[-54.92,69.71],[-54.79,69.95],[-54.32,69.94],[-54.83,70.13],[-54.37,70.32],[-53.1,70.14]],[[-110.46,78.1],[-109.62,78.06],[-110.86,77.83],[-110.15,77.76],[-110.2,77.53],[-111.95,77.34],[-113.17,77.53],[-113.28,77.81],[-110.73,78.1]],[[146.8,75.37],[150.82,75.16],[150.58,74.92],[149.05,74.77],[146.15,75.2],[146.44,75.56],[146.75,75.43]],[[127.73,0.85],[128.69,1.57],[128.7,1.11],[128.26,0.73],[128.9,0.22],[127.98,0.47],[127.89,0.3],[128.43,-0.89],[127.69,-0.24],[127.43,1.14],[127.63,1.84],[128.04,2.2],[128.01,1.33],[127.68,0.89]],[[180,71.54],[181.56,71.54],[182.5,71.22],[178.79,70.82],[178.63,71.05],[179.88,71.52]],[[142.19,73.9],[143.34,73.57],[143.49,73.25],[139.69,73.42],[141.08,73.87],[141.93,73.91]],[[-152.9,57.82],[-152.43,57.83],[-152.21,57.58],[-152.94,57.5],[-152.68,57.34],[-153.97,56.77],[-153.79,56.99],[-154.25,57.14],[-154.34,56.92],[-154.71,57.34],[-154.12,57.65],[-153.69,57.3],[-153.84,57.86],[-152.85,57.9]],[[129.75,-2.87],[130.57,-3.13],[130.81,-3.86],[129.84,-3.33],[129.47,-3.45],[128.86,-3.24],[128.52,-3.45],[128.13,-3.16],[127.9,-3.5],[128.2,-2.87],[129.6,-2.81]],[[50.28,80.93],[51.7,80.69],[48.9,80.37],[48.68,80.3],[48.98,80.16],[48.39,80.1],[46.64,80.3],[49.09,80.52],[49.24,80.82],[50.13,80.92]],[[164.2,-20.25],[165.19,-20.77],[166.97,-22.32],[166.47,-22.26],[164.93,-21.29],[164.06,-20.14]],[[122.78,-8.61],[121.04,-8.93],[119.81,-8.7],[119.88,-8.42],[120.61,-8.24],[122.32,-8.63],[122.92,-8.1],[122.82,-8.6]],[[125.24,12.53],[125.54,12.19],[125.74,11.05],[125.03,11.34],[125,11.77],[124.44,12.15],[124.29,12.57],[125.15,12.57]],[[-105.29,72.92],[-106.95,73.51],[-105.51,73.77],[-104.59,73.58],[-104.62,73.31],[-105.2,72.95]],[[-133.57,56.34],[-133.2,56.32],[-132.17,55.48],[-132.63,55.47],[-131.98,55.21],[-132.02,54.73],[-133.12,55.33],[-133.03,55.59],[-133.68,55.79],[-133.24,55.92],[-133.74,55.96],[-133.6,56.32]],[[12.57,55.79],[12.54,55.66],[12.32,55.59],[12.22,55.47],[12.39,55.39],[12.41,55.29],[12.09,55.19],[12.05,54.81],[11.86,54.77],[11.74,54.92],[11.66,55.19],[11.29,55.2],[11.17,55.33],[11.19,55.47],[11.12,55.6],[11.01,55.64],[10.98,55.72],[11.32,55.75],[11.48,55.94],[11.63,55.96],[11.69,55.91],[11.69,55.73],[11.82,55.7],[11.94,55.9],[11.87,55.97],[12.22,56.12],[12.58,56.06],[12.61,56.03],[12.53,55.92]],[[34.46,35.59],[33.94,35.29],[34.05,34.99],[33.01,34.57],[32.32,34.95],[32.94,35.39],[34.55,35.66]],[[-25.43,70.92],[-25.4,70.65],[-26.22,70.45],[-28.04,70.49],[-27.62,70.91],[-25.46,70.94]],[[106.04,-1.67],[106.36,-2.46],[106.82,-2.57],[106.67,-3.07],[106,-2.83],[105.79,-2.18],[105.13,-2.04],[105.46,-1.57],[106.03,-1.59]],[[-82,62.96],[-82.12,62.65],[-83.02,62.21],[-83.7,62.16],[-83.91,62.43],[-83.38,62.9],[-82.05,62.97]],[[122.5,11.61],[123.16,11.54],[123.12,11.29],[122.77,10.82],[121.95,10.44],[122.1,11.64],[121.92,11.85],[122.4,11.7]],[[-61.11,45.94],[-60.86,45.98],[-61.06,45.7],[-60.74,45.75],[-60.3,46.31],[-59.83,45.96],[-60.67,45.59],[-61.45,45.72],[-61.41,46.17],[-60.49,47.01],[-60.49,46.27],[-60.91,46.04]],[[123.13,9.06],[122.4,9.82],[122.86,10.09],[122.98,10.89],[123.26,10.99],[123.57,10.78],[123.16,9.86],[123.32,9.27],[123.19,9.09]],[[-73.77,-43.35],[-74.39,-43.23],[-74.04,-41.8],[-73.53,-41.9],[-73.42,-42.19],[-73.79,-42.59],[-73.44,-42.94],[-73.74,-43.29]],[[118.24,-8.32],[118.93,-8.3],[119.13,-8.67],[116.79,-9.01],[116.83,-8.53],[117.16,-8.37],[117.97,-8.73],[118.23,-8.59],[117.76,-8.15],[118.2,-8.27]],[[62.17,80.83],[62.08,80.62],[61.05,80.42],[59.29,80.57],[59.72,80.84],[62.1,80.87]],[[117.31,8.44],[117.35,8.71],[119.22,10.48],[119.55,11.31],[119.69,10.5],[117.41,8.5]],[[-109.82,78.65],[-109.35,78.37],[-113.29,78.33],[-110.88,78.74],[-109.94,78.68]],[[54.72,81.12],[57.69,80.79],[55.89,80.63],[54.07,80.81],[54.63,81.11]],[[9.48,42.81],[9.56,42.16],[9.19,41.39],[8.81,41.59],[8.57,42.36],[9.32,42.71],[9.36,43.02],[9.48,42.86]],[[50.27,69.19],[48.91,68.74],[48.28,69.04],[48.42,69.35],[48.96,69.51],[50.17,69.26]],[[178.28,-17.37],[178.67,-18.08],[177.96,-18.26],[177.32,-18.08],[177.51,-17.54],[178.25,-17.33]],[[-61.8,49.09],[-63.04,49.23],[-64.49,49.89],[-62.86,49.71],[-61.75,49.11]],[[-77.26,18.46],[-76.21,17.91],[-76.85,17.97],[-77.2,17.71],[-78.34,18.29],[-77.36,18.47]],[[-44.87,82.08],[-47.35,82.6],[-44.92,82.48],[-44.78,82.24]],[[-158.28,21.58],[-158.12,21.71],[-157.98,21.71],[-157.65,21.31],[-157.71,21.26],[-157.95,21.3],[-158.1,21.3],[-158.23,21.46]],[[-155.87,20.27],[-155.1,19.86],[-154.81,19.51],[-155.62,18.91],[-155.88,19.07],[-156.05,19.73],[-155.83,20.0]],[[-156.69,20.95],[-156.4,20.92],[-156.0,20.8],[-156.0,20.62],[-156.45,20.58],[-156.51,20.78],[-156.69,20.88]],[[-159.79,22.07],[-159.4,22.23],[-159.29,22.1],[-159.38,21.88],[-159.68,21.95]],[[-157.31,21.1],[-156.71,21.16],[-156.75,21.08],[-157.25,21.08]],[[144.62,13.24],[144.66,13.43],[144.79,13.53],[144.95,13.65],[144.88,13.43],[144.76,13.25],[144.7,13.23]],[[134.45,7.35],[134.48,7.28],[134.56,7.42],[134.65,7.7],[134.6,7.73],[134.52,7.55]],[[171.0,7.04],[171.42,7.03],[171.45,7.14],[171.0,7.12]],[[159.6,-9.25],[160.2,-9.4],[160.8,-9.85],[160.6,-9.95],[159.95,-9.75],[159.6,-9.5]],[[-149.62,-17.5],[-149.37,-17.53],[-149.18,-17.87],[-149.32,-17.78],[-149.6,-17.8],[-149.62,-17.66]],[[-172.07,-13.8],[-171.44,-13.79],[-171.43,-14.05],[-172.0,-14.04]],[[-172.78,-13.48],[-172.21,-13.58],[-172.25,-13.8],[-172.7,-13.78]],[[-170.84,-14.29],[-170.56,-14.24],[-170.56,-14.31],[-170.82,-14.36]],[[-175.36,-21.1],[-175.05,-21.13],[-175.08,-21.24],[-175.3,-21.2]],[[146.95,-9.25],[147.45,-9.2],[147.55,-9.55],[147.05,-9.65]],[[166.25,-22.1],[166.65,-22.05],[166.7,-22.4],[166.3,-22.45]],[[178.2,-17.95],[178.6,-17.95],[178.6,-18.25],[178.2,-18.25]],[[-64.89,32.25],[-64.82,32.29],[-64.7,32.36],[-64.64,32.39],[-64.67,32.35],[-64.76,32.28],[-64.85,32.23]],[[-25.86,37.9],[-25.48,37.83],[-25.13,37.83],[-25.15,37.72],[-25.5,37.71],[-25.85,37.76]],[[-27.38,38.78],[-27.05,38.76],[-27.04,38.64],[-27.35,38.66]],[[-28.55,38.55],[-28.05,38.43],[-28.1,38.39],[-28.5,38.46]],[[-28.83,38.64],[-28.6,38.62],[-28.62,38.52],[-28.8,38.53]],[[-16.92,28.37],[-16.65,28.4],[-16.13,28.58],[-16.35,28.37],[-16.5,28.06],[-16.75,28.03],[-16.88,28.2]],[[-15.8,28.15],[-15.4,28.17],[-15.36,27.9],[-15.6,27.74],[-15.82,27.9]],[[-13.85,29.22],[-13.45,29.24],[-13.47,28.88],[-13.85,28.9]],[[-14.2,28.75],[-13.84,28.72],[-13.9,28.25],[-14.5,28.06]],[[-17.92,28.85],[-17.75,28.83],[-17.83,28.46],[-17.96,28.62]],[[-17.35,28.2],[-17.1,28.2],[-17.12,28.02],[-17.32,28.03]],[[-18.15,27.8],[-17.9,27.83],[-17.95,27.65],[-18.12,27.7]],[[-23.76,15.27],[-23.47,15.33],[-23.43,15.02],[-23.52,14.91],[-23.78,15.05]],[[-24.5,15],[-24.3,15],[-24.3,14.82],[-24.5,14.82]],[[-25.08,16.9],[-24.88,16.9],[-24.88,16.78],[-25.05,16.8]],[[-25.35,17.2],[-24.98,17.1],[-25,16.98],[-25.33,17]],[[-22.98,16.84],[-22.88,16.84],[-22.88,16.6],[-22.98,16.6]],[[-22.95,16.2],[-22.7,16.15],[-22.72,15.98],[-22.93,16]],[[-5.79,-15.9],[-5.65,-15.9],[-5.63,-16],[-5.75,-16.03]]]; +const COAST=COAST_LL.map(poly=>poly.map(q=>proj(q[0],q[1]))); diff --git a/src/game/20-world/40-city-coords.js b/src/game/20-world/40-city-coords.js new file mode 100644 index 0000000..65ae278 --- /dev/null +++ b/src/game/20-world/40-city-coords.js @@ -0,0 +1,204 @@ +const CITY_LL={ + "abj":[-4.03,5.32], + "acc":[-0.19,5.6], + "add":[38.75,9.03], + "adl":[138.6,-34.93], + "aju":[-37.07,-10.91], + "akl":[174.76,-36.85], + "alg":[3.06,36.75], + "ams":[4.9,52.37], + "apw":[-171.76,-13.83], + "ash":[-77.49,39.04], + "asu":[-57.58,-25.26], + "ath":[23.73,37.98], + "atn":[-84.39,33.75], + "auh":[54.37, 24.45], + "bcn":[2.17,41.39], + "bda":[-64.78,32.29], + "bde":[-4.54,50.83], + "beg":[20.46,44.79], + "bel":[-48.5,-1.46], + "ber":[13.4,52.52], + "bet":[6.1,49.52], + "bhz":[-43.94,-19.92], + "bkk":[100.5, 13.76], + "blr":[77.59, 12.97], + "bne":[153.03, -27.47], + "bog":[-74.07, 4.71], + "bom":[72.88,19.08], + "bos":[-71.06,42.36], + "bru":[4.35,50.85], + "bsb":[-47.88,-15.79], + "bud":[19.04, 47.5], + "bue":[-58.38, -34.6], + "buh":[26.1, 44.43], + "bvb":[-60.67,2.82], + "cac":[-53.46,-24.96], + "cai":[31.24,30.04], + "cal":[-114.07,51.05], + "cas":[-7.59,33.57], + "cau":[-35.98,-8.28], + "cbo":[80.0, 6.95], + "cbr":[149.13,-35.28], + "ccs":[-66.9,10.49], + "cgb":[-56.1,-15.6], + "cgr":[-54.65,-20.47], + "chc":[172.55,-43.53], + "chi":[-87.63,41.88], + "cor":[-64.18,-31.42], + "cph":[12.57,55.68], + "cpq":[-47.06,-22.91], + "cpt":[18.42, -33.92], + "cpv":[-35.88,-7.23], + "cwb":[-49.27,-25.43], + "cxj":[-51.18,-29.17], + "dac":[90.41, 23.81], + "dal":[-96.8,32.78], + "dar":[39.28,-6.79], + "del":[77.21, 28.61], + "den":[-104.99,39.74], + "dkr":[-17.45,14.69], + "dla":[9.7,4.05], + "doh":[51.45,25.28], + "drw":[131.05,-12.46], + "dub":[-6.26,53.35], + "dur":[31.03,-29.86], + "dus":[6.78,51.22], + "dxb":[55.27,25.2], + "edi":[-3.19,55.95], + "fec":[-38.97,-12.27], + "fih":[15.27,-4.33], + "fln":[-48.55,-27.6], + "for":[-38.54, -3.73], + "fra":[8.68,50.11], + "fuj":[56.15,25.07], + "gbe":[25.91,-24.65], + "gdl":[-103.35,20.67], + "gua":[-90.51,14.63], + "gum":[144.75,13.47], + "gyn":[-49.25,-16.69], + "ham":[9.99,53.55], + "hba":[147.25,-42.85], + "hel":[24.94,60.17], + "hfx":[-63.62,44.68], + "hir":[159.95,-9.43], + "hkg":[114.17,22.32], + "hnl":[-157.86,21.31], + "hou":[-95.37,29.76], + "hre":[31.05,-17.83], + "hyd":[78.49, 17.39], + "icn":[126.98,37.57], + "igu":[-54.59,-25.55], + "ist":[28.98, 41.01], + "ivc":[168.35,-46.41], + "jam":[-5.72,-15.93], + "jed":[39.25,21.55], + "jib":[43.15,11.59], + "jkt":[106.85,-6.2], + "jnb":[28.05,-26.2], + "jpa":[-34.86,-7.12], + "kcy":[-94.58,39.1], + "kgl":[30.06,-1.95], + "khi":[67.14,25.0], + "kla":[32.58,0.35], + "kul":[101.69, 3.14], + "kyv":[30.52,50.45], + "lad":[13.23,-8.84], + "lag":[3.38,6.52], + "lax":[-118.24,34.05], + "ldb":[-51.16,-23.31], + "lim":[-76.85,-12.05], + "lis":[-9.14,38.72], + "ljd":[-51.96,-29.47], + "lon":[-0.13,51.51], + "lpb":[-68.15,-16.5], + "lun":[28.32,-15.39], + "maa":[80.18,13.25], + "mad":[-3.7,40.42], + "maj":[171.38,7.09], + "man":[-2.24,53.48], + "mao":[-60.02,-3.12], + "mba":[39.67,-4.04], + "mcp":[-51.07,0.03], + "mcz":[-35.74,-9.67], + "mde":[-75.57,6.24], + "mel":[144.96, -37.81], + "mex":[-99.13,19.43], + "mgf":[-51.94,-23.42], + "mia":[-80.19,25.76], + "mil":[9.19,45.46], + "mnl":[120.98,14.6], + "mos":[37.62,55.76], + "mpm":[32.57,-25.97], + "mrs":[5.37,43.3], + "mtl":[-73.57,45.5], + "mty":[-100.31,25.69], + "muc":[11.58,48.14], + "mvd":[-56.16,-34.9], + "nat":[-35.21,-5.79], + "nbo":[36.82,-1.29], + "nou":[166.46,-22.27], + "nyc":[-74.0,40.71], + "oos":[3.23,51.15], + "osa":[135.5, 34.69], + "osl":[10.75,59.91], + "ott":[-75.7,45.42], + "pan":[-79.52, 8.98], + "par":[2.35,48.86], + "pdl":[-25.67,37.74], + "pek":[116.4,39.9], + "per":[115.86,-31.95], + "phx":[-112.07,33.45], + "pmo":[13.36,38.12], + "pmw":[-48.33,-10.18], + "poa":[-51.23,-30.03], + "pom":[147.18,-9.44], + "ppg":[-170.7,-14.28], + "ppt":[-149.57,-17.53], + "prg":[14.42, 50.08], + "pvh":[-63.9,-8.76], + "qro":[-100.39,20.59], + "rai":[-23.55,14.98], + "rao":[-47.81,-21.18], + "rbr":[-67.81,-9.97], + "rec":[-34.88,-8.05], + "rek":[-21.94,64.15], + "ria":[-53.81,-29.68], + "rio":[-43.11,-22.57], + "rom":[12.5,41.9], + "ror":[134.48,7.34], + "ruh":[46.72,24.71], + "sao":[-46.63,-23.55], + "scl":[-70.67, -33.45], + "sea":[-122.33,47.61], + "sgn":[106.66, 10.76], + "sha":[121.47,31.23], + "sin":[103.82,1.35], + "sjc":[-121.89,37.34], + "sjo":[-84.09,9.93], + "sjp":[-49.38,-20.81], + "slc":[-111.89,40.76], + "slz":[-44.3,-2.53], + "sof":[23.32,42.7], + "ssa":[-38.5,-12.97], + "stg":[9.18,48.78], + "sto":[18.07,59.33], + "suv":[178.44,-18.14], + "svg":[5.73,58.97], + "syd":[151.21,-33.87], + "tbu":[-175.2,-21.14], + "tci":[-16.3,28.44], + "the":[-42.8,-5.09], + "tll":[24.45,58.9], + "tok":[139.69,35.69], + "tor":[-79.38,43.65], + "tpe":[121.56, 25.03], + "tun":[10.18,36.81], + "uio":[-78.47,-0.18], + "van":[-123.12,49.28], + "vie":[16.37, 48.21], + "vix":[-40.31,-20.32], + "waw":[21.01, 52.23], + "wdh":[17.08,-22.56], + "zrh":[8.54,47.37], +}; diff --git a/src/game/20-world/50-cities.js b/src/game/20-world/50-cities.js new file mode 100644 index 0000000..2a851e2 --- /dev/null +++ b/src/game/20-world/50-cities.js @@ -0,0 +1,271 @@ +const CITIES=[ + {id:'sea',name:'Seattle',x:205,y:245,land:'am',reg:'AM',P:300,ix:'Sea-IX',dc:'Westerly Carrier Hotel'}, + {id:'sjc',name:'San Jose',x:240,y:345,land:'am',reg:'AM',P:500,ix:'Silly-Con Valley IX',dc:'Equinox SV'}, + {id:'dal',name:'Dallas',x:385,y:415,land:'am',reg:'AM',P:450,ix:'Yee-Haw-IX',dc:'Infomaniac Building'}, + {id:'chi',name:'Chicago',x:470,y:270,land:'am',reg:'AM',P:600,ix:'Windy-IX',dc:'350 Cermak'}, + {id:'ash',name:'Ashburn',x:572,y:332,land:'am',reg:'AM',P:250,ix:'Equinox Ashburn IX',dc:'Data Center Alley',note:tr('cities.the_data_center_capital_rumor_says')}, + {id:'nyc',name:'New York',x:615,y:283,land:'am',reg:'AM',P:1200,ix:'NY-Yikes',dc:'60 Hudson'}, + {id:'mia',name:'Miami',x:530,y:482,land:'am',reg:'AM',P:400,ix:'Miam-IX',dc:'Nap of the Americas',note:tr('cities.cable_landing_hub_for_south_america')}, + {id:'sao',name:'São Paulo',x:640,y:730,land:'sa',reg:'SA',P:900,br:true,andes:'e',ix:'IX.brrr',ixCheap:0.3,dc:'Digital Reality SP',note:tr('cities.south_america_s_biggest_market_and')}, + {id:'lon',name:'London',x:935,y:275,land:'uk',reg:'EU',P:1000,ix:'LYNX',dc:'Telly-House Docklands',note:tr('cities.on_an_island_so_every_link')}, + {id:'ams',name:'Amsterdam',x:1015,y:245,land:'eu',reg:'EU',P:350,ix:'HAMS-IX',dc:'Science Park'}, + {id:'fra',name:'Frankfurt',x:1075,y:295,land:'eu',reg:'EU',P:600,ix:'DE-KICKS',dc:'Kleyerstraße Campus',note:tr('cities.europe_s_crossroads_lots_of_networks')}, + {id:'par',name:'Paris',x:990,y:320,land:'eu',reg:'EU',P:900,ix:'Fromage-IX',dc:'Interaction PAR'}, + {id:'mrs',name:'Marseille',x:1045,y:378,land:'eu',reg:'EU',P:250,ix:'Bouilla-IX',dc:'Cable Landing Station',note:tr('cities.subsea_cables_to_africa_and_asia')}, + {id:'tor',name:'Toronto',ca:true,x:548,y:252,land:'am',reg:'AM',P:500,ix:'Sorry-IX',dc:'151 Front Street',note:tr('cities.canada_s_hub_polite_packets_long')}, + {id:'bru',name:'Brussels',x:0,y:0,land:'eu',reg:'EU',P:150,be:true,tape:true,ix:'Frites-IX',dc:'Digital Unreality BRU1',note:tr('cities.right_between_london_amsterdam_paris')}, + {id:'oos',name:'Oostkamp',x:0,y:0,land:'eu',reg:'EU',P:30,be:true,tape:true,ix:'',dc:'DC-Starfish Oostkamp',note:tr('cities.inland_from_ostend_where_the_cables')}, + {id:'bet',name:'Bettembourg',x:0,y:0,land:'eu',reg:'EU',P:60,arpu:1.4,lux:true,ix:'LU-SICK',dc:'LuxDisconnect DC1.2',note:tr('cities.luxembourg_s_data_centers_are_not')}, + {id:'mtl',name:'Montreal',ca:true,x:598,y:238,land:'am',reg:'AM',P:300,ix:'Poutine-IX',dc:'Hydro-powered Hangar',note:tr('cities.cheap_hydro_power_makes_it_a')}, + {id:'kcy',name:'Kansas City',x:0,y:0,land:'am',reg:'AM',P:200,ix:'Toto-IX',dc:'The Limestone Cave',note:tr('cities.the_geographic_middle_of_the_us')}, + {id:'cal',name:'Calgary',x:0,y:0,land:'am',reg:'AM',P:150,ca:true,ix:'Stampede-IX',dc:'Bow & Arrow DC',note:tr('cities.the_prairie_gateway_between')}, + {id:'van',name:'Vancouver',x:0,y:0,land:'am',reg:'AM',P:250,ca:true,ix:'Raincouver-IX',dc:'Colo-Logics VAN3',note:tr('cities.canada_s_pacific_door_it_rains')}, + {id:'ott',name:'Ottawa',x:0,y:0,land:'am',reg:'AM',P:120,ca:true,blackout:true,ix:'Bytown-IX',dc:'Purely Colo (Mostly)',note:tr('cities.canada_s_capital_once_called_bytown')}, + {id:'lax',name:'Los Angeles',x:270,y:395,land:'am',reg:'AM',P:900,ix:'Any2-Anywhere',dc:'One Wilshire',note:tr('cities.pacific_cables_land_nearby_and')}, + {id:'mex',name:'Mexico City',x:368,y:470,land:'am',reg:'AM',P:700,ix:'',dc:'Querétaro Campus',note:tr('cities.huge_mobile_market_most_of_its')}, + {id:'rek',name:'Reykjavik',x:850,y:170,land:'is',reg:'EU',P:60,ix:'',dc:'Geothermal Bitcoin Barn',note:tr('cities.free_cooling_and_geothermal_power')}, + {id:'dub',name:'Dublin',x:876,y:268,land:'ie',reg:'EU',P:250,ix:'Craic-IX',dc:'Clonsilla Hyperscale Campus',note:tr('cities.every_hyperscaler_s_european_hq')}, + {id:'osl',name:'Oslo',x:1062,y:172,land:'eu',reg:'EU',P:200,ix:'NIX-NIX',dc:'Fjord-cooled Mountain Hall'}, + {id:'cph',name:'Copenhagen',x:1085,y:215,land:'eu',reg:'EU',P:250,ix:'Hygge-IX',dc:'Danish Design DC',note:tr('cities.landing_point_for_cables_from_the')}, + {id:'hel',name:'Helsinki',x:1168,y:140,land:'eu',reg:'EU',P:200,ix:'Sauna-IX',dc:'Underground Sauna Bunker',note:tr('cities.fast_fiber_east_and_west_and')}, + {id:'beg',name:'Belgrade',x:1122,y:338,land:'eu',reg:'EU',P:250,ix:'',dc:'Danube Docks DC'}, + {id:'sof',name:'Sofia',x:1165,y:358,land:'eu',reg:'EU',P:250,ix:'Rakija-IX',dc:'Vitosha DC',note:tr('cities.balkan_peering_hub_with_famously')}, + {id:'dxb',name:'Dubai',x:1292,y:428,land:'eu',reg:'AS',P:400,uae:true,ix:'Sand-IX',dc:'Air-conditioned Mirage DC',note:tr('cities.crossroads_for_cables_between_europe')}, + {id:'mos',name:'Moscow',x:1235,y:192,land:'eu',reg:'EU',P:900,ru:true,arpu:0.5,ix:'Borscht-IX',dc:'Very Secure Bunker',note:tr('cities.sovereign_internet_rules_every_pop')}, + {id:'akl',name:'Auckland',x:1964,y:826,land:'nz',reg:'OC',P:250,ix:'Kiwi-IX',dc:'Sheep-cooled Shed',note:tr('cities.far_from_everything_every_packet')}, + {id:'per',name:'Perth',x:1712,y:785,land:'oc',reg:'OC',au:true,arpu:AU_ARPU,P:200,ix:'Beard-IX',dc:'Very Remote DC',dc2:'Next-Door-DC P#',dc2N:2,note:tr('cities.the_most_isolated_big_city_on')}, + {id:'jkt',name:'Jakarta',x:1614,y:624,land:'idn',reg:'AS',P:900,ix:'Nasi-IX',dc:'Monsoon-proof DC',note:tr('cities.270_million_people_on_17_000')}, + {id:'mnl',name:'Manila',x:1714,y:494,land:'ph',reg:'AS',P:600,ix:'',dc:'Typhoon-rated DC',note:tr('cities.typhoons_earthquakes_and_a_lot_of')}, + {id:'ber',name:'Berlin',x:0,y:0,land:'eu',reg:'EU',P:450,ix:'Currywurst-IX',dc:'Former Brewery DC',note:tr('cities.startups_techno_and_a_surprising')}, + {id:'ham',name:'Hamburg',x:0,y:0,land:'eu',reg:'EU',P:250,ix:'Moin-IX',dc:'Speicherstadt Colo',note:tr('cities.germany_s_port_city_everyone_says')}, + {id:'dus',name:'Düsseldorf',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Altbier-IX',dc:'Königsallee Cage',note:tr('cities.the_rhine_ruhr_hub_more_carrier')}, + {id:'muc',name:'Munich',x:0,y:0,land:'eu',reg:'EU',P:250,ix:'Brezn-IX',dc:'Weißwurst Works',note:tr('cities.bavaria_s_capital_cars_insurers_and')}, + {id:'zrh',name:'Zurich',x:0,y:0,land:'eu',reg:'EU',P:250,ix:'Cuckoo-IX',dc:'Bank Vault DC',note:tr('cities.banks_very_punctual_packets_and')}, + {id:'nbo',name:'Nairobi',x:0,y:0,land:'af',reg:'AF',cc:'KE',P:350,ix:'Safari-IX',dc:'Silicon Savannah Campus',note:tr('cities.east_africa_s_hub_cables_land')}, + {id:'cai',name:'Cairo',x:0,y:0,land:'af',land2:'eu',reg:'AF',cc:'EG',P:600,ix:'Pharaoh-IX',dc:'Pyramid-adjacent DC',note:tr('cities.almost_every_europe_asia_cable')}, + {id:'stg',name:'Stuttgart',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Spätzle-IX',dc:'Kehrwoche-certified DC',ixOnly:true,note:tr('cities.cars_engineers_and_kehrwoche_every')}, + {id:'sto',name:'Stockholm',x:1110,y:160,land:'eu',reg:'EU',P:300,ix:'NodNod',dc:'Nuclear Bunker DC'}, + {id:'bcn',name:'Barcelona',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Catnip-IX',dc:'Poblenou DC',note:tr('cities.catalonia_s_own_exchange_small_and')}, + {id:'mad',name:'Madrid',x:935,y:392,land:'eu',reg:'EU',P:600,ix:'Siesta-IX',dc:'Interaction MAD'}, + {id:'lag',name:'Lagos',x:1010,y:565,land:'af',reg:'AF',cc:'NG',P:500,ix:'Jollof-IX',dc:'Rack-n-Roll Centre'}, + {id:'jnb',name:'Johannesburg',x:1130,y:730,land:'af',reg:'AF',cc:'ZA',P:400,za:true,ix:'Braai-IX',dc:'Tera-Cotta Campus'}, + {id:'bom',name:'Mumbai',x:1385,y:488,land:'eu',reg:'AS',P:1100,india:true,ix:'Mumb-IX',dc:'Goregaon Tech Park'}, + {id:'sin',name:'Singapore',x:1556,y:568,land:'eu',reg:'AS',P:450,ix:'Lah-IX',dc:'Equinox SG',note:tr('cities.asia_s_hub_expensive_humid_very')}, + {id:'hkg',name:'Hong Kong',x:1645,y:440,land:'eu',reg:'AS',P:600,ix:'HK-Kicks',dc:'Mega-Eye Plus'}, + {id:'icn',name:'Seoul',x:1722,y:302,land:'eu',reg:'AS',P:900,kr:true,ix:'Kimch-IX',dc:'Gasan Digital Complex',note:tr('cities.some_of_the_fastest_home_broadband')}, + {id:'pek',name:'Beijing',x:1652,y:318,land:'eu',reg:'AS',P:1800,cn:true,arpu:0.6,ix:'',dc:'Zhongguancun DC',note:tr('cities.mainland_china_behind_the_great')}, + {id:'sha',name:'Shanghai',x:1680,y:388,land:'eu',reg:'AS',P:2200,cn:true,arpu:0.6,ix:'',dc:'Lujiazui Data Center',note:tr('cities.mainland_china_enormous_market')}, + {id:'tok',name:'Tokyo',x:1795,y:320,land:'jp',reg:'AS',P:1400,ix:'JP-Naptime',dc:'Otemachi Tower'}, + {id:'syd',name:'Sydney',x:1860,y:790,land:'oc',reg:'OC',au:true,arpu:AU_ARPU,P:500,ix:'IX Straya',dc:'Next-Door-DC S#',dcN:3,dc2:'Equinox SY#',dc2N:7,note:tr('cities.the_harbour_the_bridge_and_most')}, +{id:'for',name:'Fortaleza',x:0,y:0,land:'sa',reg:'SA',P:250,br:true,andes:'e',ix:'IX.brrr Fortaleza',ixCheap:0.3,dc:'Praia Landing Station',note:tr('cities.where_south_america_s_cables')}, + {id:'rio',name:'Rio de Janeiro',x:0,y:0,land:'sa',reg:'SA',P:600,br:true,andes:'e',ix:'IX.brrr Rio',ixCheap:0.3,dc:'Copacabana Colo',note:tr('cities.beaches_cable_landings_and_a')}, + {id:'bsb',name:'Brasília',x:0,y:0,land:'sa',reg:'SA',P:200,br:true,andes:'e',ix:'IX.brrr Brasília',ixCheap:0.3,dc:'Modernist Concrete Colo',note:tr('cities.brazil_s_planned_capital_shaped_like')}, + {id:'bhz',name:'Belo Horizonte',x:0,y:0,land:'sa',reg:'SA',P:250,br:true,andes:'e',ix:'IX.brrr BH',ixCheap:0.3,dc:'Pão de Queijo Point',note:tr('cities.mountains_mines_and_more_bars_per')}, + {id:'cwb',name:'Curitiba',x:0,y:0,land:'sa',reg:'SA',P:200,br:true,andes:'e',ix:'IX.brrr Curitiba',ixCheap:0.3,dc:'Pine Nut Park DC',note:tr('cities.brazil_s_coldest_big_city_and')}, + {id:'poa',name:'Porto Alegre',x:0,y:0,land:'sa',reg:'SA',P:200,br:true,andes:'e',ix:'IX.brrr Porto Alegre',ixCheap:0.3,dc:'Chimarrão Colo',note:tr('cities.the_deep_south_halfway_to_buenos')}, + {id:'aju',off:true,name:'Aracaju',x:0,y:0,land:'sa',reg:'SA',P:40,br:true,andes:'e',ix:'IX.brrr Aracaju',ixCheap:0.3,dc:'Crab Walk Colo'}, + {id:'bel',name:'Belém',x:0,y:0,land:'sa',reg:'SA',P:100,br:true,andes:'e',rain:true,ix:'IX.brrr Belém',ixCheap:0.3,dc:'Açaí Bowl DC',note:tr('cities.gateway_to_the_amazon_at_the')}, + {id:'bvb',name:'Boa Vista',x:0,y:0,land:'sa',reg:'SA',P:20,br:true,andes:'e',rain:true,ix:'IX.brrr Boa Vista',ixCheap:0.3,dc:'Northern Lights Racks',note:tr('cities.brazil_s_northernmost_capital_the')}, + {id:'cac',off:true,name:'Cascavel',x:0,y:0,land:'sa',reg:'SA',P:20,br:true,andes:'e',ix:'IX.brrr Cascavel',ixCheap:0.3,dc:'Soybean Silo DC'}, + {id:'cpv',off:true,name:'Campina Grande',x:0,y:0,land:'sa',reg:'SA',P:20,br:true,andes:'e',ix:'IX.brrr Campina Grande',ixCheap:0.3,dc:'Forró Forum DC',note:tr('cities.throws_the_biggest_sao_joao_festival')}, + {id:'cpq',name:'Campinas',x:0,y:0,land:'sa',reg:'SA',P:130,br:true,andes:'e',ix:'IX.brrr Campinas',ixCheap:0.3,dc:'Silicon Sugarcane Park',note:tr('cities.brazil_s_tech_hub_an_hour')}, + {id:'cgr',name:'Campo Grande',x:0,y:0,land:'sa',reg:'SA',P:40,br:true,andes:'e',ix:'IX.brrr Campo Grande',ixCheap:0.3,dc:'Pantanal Edge Colo'}, + {id:'cau',off:true,name:'Caruaru',x:0,y:0,land:'sa',reg:'SA',P:20,br:true,andes:'e',ix:'IX.brrr Caruaru',ixCheap:0.3,dc:'Clay Doll Datacenter'}, + {id:'cgb',name:'Cuiabá',x:0,y:0,land:'sa',reg:'SA',P:40,br:true,andes:'e',ix:'IX.brrr Cuiabá',ixCheap:0.3,dc:'Forty Degrees DC',note:tr('cities.the_geographic_center_of_south')}, + {id:'cxj',off:true,name:'Caxias do Sul',x:0,y:0,land:'sa',reg:'SA',P:25,br:true,andes:'e',ix:'IX.brrr Caxias do Sul',ixCheap:0.3,dc:'Wine Cellar Racks',note:tr('cities.italian_immigrants_vineyards_and')}, + {id:'fec',off:true,name:'Feira de Santana',x:0,y:0,land:'sa',reg:'SA',P:25,br:true,andes:'e',ix:'IX.brrr Feira de Santana',ixCheap:0.3,dc:'Crossroads Colo'}, + {id:'fln',off:true,name:'Florianópolis',x:0,y:0,land:'sa',reg:'SA',P:50,br:true,andes:'e',ix:'IX.brrr Florianópolis',ixCheap:0.3,dc:'Island Uplink DC',note:tr('cities.an_island_capital_of_beaches_and')}, + {id:'igu',off:true,name:'Foz do Iguaçu',x:0,y:0,land:'sa',reg:'SA',P:15,br:true,andes:'e',ix:'IX.brrr Foz do Iguaçu',ixCheap:0.3,dc:'Triple Border Racks',note:tr('cities.where_brazil_argentina_and_paraguay')}, + {id:'gyn',name:'Goiânia',x:0,y:0,land:'sa',reg:'SA',P:100,br:true,andes:'e',ix:'IX.brrr Goiânia',ixCheap:0.3,dc:'Pequi Peak DC',note:tr('cities.agribusiness_capital_and_home_of')}, + {id:'jpa',off:true,name:'João Pessoa',x:0,y:0,land:'sa',reg:'SA',P:50,br:true,andes:'e',ix:'IX.brrr João Pessoa',ixCheap:0.3,dc:'Sunrise Point DC',note:tr('cities.the_easternmost_city_of_the_americas')}, + {id:'ljd',off:true,name:'Lajeado',x:0,y:0,land:'sa',reg:'SA',P:10,br:true,andes:'e',ix:'IX.brrr Lajeado',ixCheap:0.3,dc:'Valley Co-op Colo',note:tr('cities.a_small_town_with_its_own')}, + {id:'ldb',name:'Londrina',x:0,y:0,land:'sa',reg:'SA',P:35,br:true,andes:'e',ix:'IX.brrr Londrina',ixCheap:0.3,dc:'Red Soil DC'}, + {id:'mcp',name:'Macapá',x:0,y:0,land:'sa',reg:'SA',P:25,br:true,andes:'e',rain:true,blackout:true,ix:'IX.brrr Macapá',ixCheap:0.3,dc:'Equator Line Colo',note:tr('cities.right_on_the_equator_at_the')}, + {id:'mcz',off:true,name:'Maceió',x:0,y:0,land:'sa',reg:'SA',P:55,br:true,andes:'e',ix:'IX.brrr Maceió',ixCheap:0.3,dc:'Lagoon View Racks'}, + {id:'mao',name:'Manaus',x:0,y:0,land:'sa',reg:'SA',P:90,br:true,andes:'e',rain:true,ix:'IX.brrr Manaus',ixCheap:0.3,dc:'Free Zone Colo',note:tr('cities.two_million_people_in_the_middle')}, + {id:'mgf',off:true,name:'Maringá',x:0,y:0,land:'sa',reg:'SA',P:30,br:true,andes:'e',ix:'IX.brrr Maringá',ixCheap:0.3,dc:'Cathedral Cone DC'}, + {id:'nat',name:'Natal',x:0,y:0,land:'sa',reg:'SA',P:60,br:true,andes:'e',ix:'IX.brrr Natal',ixCheap:0.3,dc:'Dune Buggy DC',note:tr('cities.dunes_buggies_and_the_corner_of')}, + {id:'pmw',name:'Palmas',x:0,y:0,land:'sa',reg:'SA',P:15,br:true,andes:'e',ix:'IX.brrr Palmas',ixCheap:0.3,dc:'Planned Grid DC',note:tr('cities.brazil_s_youngest_state_capital')}, + {id:'pvh',name:'Porto Velho',x:0,y:0,land:'sa',reg:'SA',P:25,br:true,andes:'e',rain:true,ix:'IX.brrr Porto Velho',ixCheap:0.3,dc:'Madeira River Racks'}, + {id:'rao',off:true,name:'Ribeirão Preto',x:0,y:0,land:'sa',reg:'SA',P:50,br:true,andes:'e',ix:'IX.brrr Ribeirão Preto',ixCheap:0.3,dc:'Sugarcane & Servers',note:tr('cities.brazil_s_agribusiness_capital')}, + {id:'rec',name:'Recife',x:0,y:0,land:'sa',reg:'SA',P:160,br:true,andes:'e',ix:'IX.brrr Recife',ixCheap:0.3,dc:'Frevo Colo',note:tr('cities.the_venice_of_brazil_all_bridges')}, + {id:'rbr',name:'Rio Branco',x:0,y:0,land:'sa',reg:'SA',P:20,br:true,andes:'e',rain:true,ix:'IX.brrr Rio Branco',ixCheap:0.3,dc:'Acre-ly Real DC',note:tr('cities.the_capital_of_acre_a_state')}, + {id:'ssa',name:'Salvador',x:0,y:0,land:'sa',reg:'SA',P:160,br:true,andes:'e',ix:'IX.brrr Salvador',ixCheap:0.3,dc:'Axé Uplink DC',note:tr('cities.brazil_s_first_capital_with_cables')}, + {id:'ria',off:true,name:'Santa Maria',x:0,y:0,land:'sa',reg:'SA',P:15,br:true,andes:'e',ix:'IX.brrr Santa Maria',ixCheap:0.3,dc:'Gaúcho Plains Colo'}, + {id:'sjp',off:true,name:'São José do Rio Preto',x:0,y:0,land:'sa',reg:'SA',P:25,br:true,andes:'e',ix:'IX.brrr São José do Rio Preto',ixCheap:0.3,dc:'Rio Preto Racks'}, + {id:'slz',name:'São Luís',x:0,y:0,land:'sa',reg:'SA',P:65,br:true,andes:'e',ix:'IX.brrr São Luís',ixCheap:0.3,dc:'Reggae Island DC',note:tr('cities.an_island_city_of_tiled_colonial')}, + {id:'the',name:'Teresina',x:0,y:0,land:'sa',reg:'SA',P:50,br:true,andes:'e',ix:'IX.brrr Teresina',ixCheap:0.3,dc:'Sunbaked Server Hall',note:tr('cities.the_only_northeastern_capital_away')}, + {id:'vix',name:'Vitória',x:0,y:0,land:'sa',reg:'SA',P:80,br:true,andes:'e',ix:'IX.brrr Vitória',ixCheap:0.3,dc:'Moqueca Colo',note:tr('cities.an_island_capital_with_a_big')}, + {id:'mvd',name:'Montevideo',x:0,y:0,land:'sa',reg:'SA',P:150,andes:'e',ix:'Chivito-IX',dc:'Rambla Racks',note:tr('cities.uruguay_fiber_to_almost_every_home')}, + {id:'asu',name:'Asunción',x:0,y:0,land:'sa',reg:'SA',P:120,andes:'e',ix:'Chipa-IX',dc:'Hydro Surplus DC',note:tr('cities.paraguay_shares_two_giant_dams_with')}, + {id:'cor',name:'Córdoba',x:0,y:0,land:'sa',reg:'SA',P:150,andes:'e',arpu:0.7,ix:'Fernet-IX',dc:'Sierras Server Shed',note:tr('cities.argentina_s_second_city_universities')}, + {id:'lpb',name:'La Paz',x:0,y:0,land:'sa',reg:'SA',P:80,andes:'m',ix:'Salteña-IX',dc:'Cable Car Colo',note:tr('cities.the_highest_seat_of_government_on')}, + {id:'uio',name:'Quito',x:0,y:0,land:'sa',reg:'SA',P:100,andes:'m',ix:'Equator-IX',dc:'Middle of the World DC',note:tr('cities.a_capital_high_in_the_andes')}, + {id:'mde',name:'Medellín',x:0,y:0,land:'sa',reg:'SA',P:150,andes:'m',ix:'Paisa-IX',dc:'Eternal Spring DC',note:tr('cities.the_city_of_eternal_spring_with')}, + {id:'ccs',name:'Caracas',x:0,y:0,land:'sa',reg:'SA',P:120,blackout:true,ix:'Cachapa-IX',dc:'Generator Included DC',note:tr('cities.a_capital_in_a_valley_under')}, + {id:'gua',name:'Guatemala City',x:0,y:0,land:'am',reg:'AM',P:120,ix:'Quetzal-IX',dc:'Volcano View Colo',note:tr('cities.central_america_s_biggest_city')}, + {id:'sjo',name:'San José',x:0,y:0,land:'am',reg:'AM',P:80,ix:'Pura Vida-IX',dc:'Cloud Forest DC',note:tr('cities.costa_rica_runs_almost_entirely_on')}, + {id:'qro',name:'Querétaro',x:0,y:0,land:'am',reg:'AM',P:120,ix:'Gordita-IX',dc:'Bajío Bit Barn',note:tr('cities.mexico_s_data_center_boom_town')}, + {id:'mty',name:'Monterrey',x:0,y:0,land:'am',reg:'AM',P:200,ix:'Cabrito-IX',dc:'Saddle Mountain Colo',note:tr('cities.mexico_s_industrial_capital_a_few')}, + {id:'gdl',name:'Guadalajara',x:0,y:0,land:'am',reg:'AM',P:200,ix:'Tequila-IX',dc:'Mariachi Mainframes',note:tr('cities.mexico_s_silicon_valley_home_of')}, + {id:'bue',name:'Buenos Aires',x:0,y:0,land:'sa',reg:'SA',P:500,andes:'e',arpu:0.7,ix:'Asado-IX',dc:'Puerto Madero DC',note:tr('cities.tango_steak_and_a_currency_that')}, + {id:'scl',name:'Santiago',x:0,y:0,land:'sa',reg:'SA',P:350,andes:'w',ix:'Empanada-IX',dc:'Andes-view Bunker',note:tr('cities.the_pacific_gateway_the_andes_sit')}, + {id:'lim',name:'Lima',x:0,y:0,land:'sa',reg:'SA',P:400,andes:'w',ix:'Ceviche-IX',dc:'Fog-cooled DC',note:tr('cities.it_almost_never_rains_but_the')}, + {id:'bog',name:'Bogotá',x:0,y:0,land:'sa',reg:'SA',P:400,andes:'m',ix:'Arepa-IX',dc:'2,600 m Above Sea Level DC',note:tr('cities.high_up_in_the_andes_no')}, + {id:'pan',name:'Panama City',x:0,y:0,land:'am',reg:'AM',P:80,ix:'Canal-IX',dc:'Isthmus Interconnect',note:tr('cities.every_cable_between_the_americas')}, + {id:'del',name:'Delhi',x:0,y:0,land:'eu',reg:'AS',P:1600,arpu:0.4,india:true,ix:'Butter-Chicken-IX',dc:'Smog-filtered DC',note:tr('cities.an_enormous_very_online_city_a')}, + {id:'maa',name:'Chennai',x:0,y:0,land:'eu',reg:'AS',P:500,arpu:0.5,india:true,ix:'Dosa-IX',dc:'Cyclone-rated Landing Bay',note:tr('cities.india_s_east_coast_landing_hub')}, + {id:'blr',name:'Bengaluru',x:0,y:0,land:'eu',reg:'AS',P:600,arpu:0.6,india:true,ix:'Filter-Kaapi-IX',dc:'Traffic-jam-adjacent Campus',note:tr('cities.india_s_tech_capital_packets_move')}, + {id:'hyd',name:'Hyderabad',x:0,y:0,land:'eu',reg:'AS',P:400,arpu:0.5,india:true,ix:'Biryani-IX',dc:'Hyperscale Hills',note:tr('cities.every_hyperscaler_is_building_a')}, + {id:'tpe',name:'Taipei',x:0,y:0,land:'tw',reg:'AS',P:450,ix:'Bubble-Tea-IX',dc:'Typhoon-proof Tower',note:tr('cities.makes_most_of_the_world_s')}, + {id:'auh',name:'Abu Dhabi',x:0,y:0,land:'eu',reg:'AS',P:200,arpu:1.4,uae:true,ix:'',dc:'Oasis-cooled Campus',note:tr('cities.the_capital_sovereign_ai_money_and')}, + {id:'fuj',name:'Fujairah',x:0,y:0,land:'eu',reg:'AS',P:20,uae:true,ix:'',dc:'Cable Landing Sandcastle',note:tr('cities.most_uae_cables_land_on_this')}, + {id:'cpt',name:'Cape Town',x:0,y:0,land:'af',reg:'AF',cc:'ZA',P:250,za:true,ix:'Biltong-IX',dc:'Table Mountain Colo',note:tr('cities.where_the_atlantic_cables_to_africa')}, + {id:'dkr',name:'Dakar',x:0,y:0,land:'af',reg:'AF',P:140,cc:'SN',ix:'Thieboudienne-IX',dc:'Teranga Racks',note:tr('cities.africa_s_westernmost_capital_where')}, + {id:'abj',name:'Abidjan',x:0,y:0,land:'af',reg:'AF',P:200,cc:'CI',ix:'Attiéké-IX',dc:'Plateau Point DC',note:tr('cities.the_business_capital_of_french')}, + {id:'acc',name:'Accra',x:0,y:0,land:'af',reg:'AF',P:170,cc:'GH',ix:'Kelewele-IX',dc:'Black Star Colo',note:tr('cities.ghana_s_capital_and_a_favourite')}, + {id:'dla',name:'Douala',x:0,y:0,land:'af',reg:'AF',P:130,cc:'CM',ix:'Ndolé-IX',dc:'Wouri Riverside DC',note:tr('cities.cameroon_s_port_city_a_cable')}, + {id:'fih',name:'Kinshasa',x:0,y:0,land:'af',reg:'AF',P:350,cc:'CD',blackout:true,ix:'Rumba-IX',dc:'Congo River Colo',note:tr('cities.one_of_africa_s_biggest_cities')}, + {id:'lad',name:'Luanda',x:0,y:0,land:'af',reg:'AF',P:250,cc:'AO',ix:'Muamba-IX',dc:'Marginal View DC',note:tr('cities.angola_s_oil_capital_and_the')}, + {id:'cas',name:'Casablanca',x:0,y:0,land:'af',reg:'AF',P:150,cc:'MA',ix:'Tagine-IX',dc:'Here’s Looking at You, Rack',note:tr('cities.morocco_s_business_capital_on_the')}, + {id:'alg',name:'Algiers',x:0,y:0,land:'af',reg:'AF',P:130,cc:'DZ',ix:'Couscous-IX',dc:'Kasbah Colo',note:tr('cities.white_houses_climbing_up_from_the')}, + {id:'tun',name:'Tunis',x:0,y:0,land:'af',reg:'AF',P:100,cc:'TN',ix:'Harissa-IX',dc:'Carthage Was Here DC',note:tr('cities.a_capital_next_to_the_ruins')}, + {id:'jib',name:'Djibouti',x:0,y:0,land:'af',reg:'AF',P:40,cc:'DJ',ix:'Lake Assal-IX',dc:'Cable Landing Capital DC',note:tr('cities.a_tiny_country_at_the_mouth')}, + {id:'add',name:'Addis Ababa',x:0,y:0,land:'af',reg:'AF',P:170,cc:'ET',ix:'Injera-IX',dc:'Highland Coffee DC',note:tr('cities.ethiopia_s_capital_at_2_400')}, + {id:'mba',name:'Mombasa',x:0,y:0,land:'af',reg:'AF',P:60,cc:'KE',ix:'Pwani-IX',dc:'Old Town Landing Station',note:tr('cities.where_east_africa_s_cables_come')}, + {id:'dar',name:'Dar es Salaam',x:0,y:0,land:'af',reg:'AF',P:220,cc:'TZ',ix:'Bongo-IX',dc:'Kariakoo Colo',note:tr('cities.tanzania_s_biggest_city_and_the')}, + {id:'kla',name:'Kampala',x:0,y:0,land:'af',reg:'AF',P:130,cc:'UG',ix:'Matooke-IX',dc:'Seven Hills DC',note:tr('cities.a_city_on_seven_hills_by')}, + {id:'kgl',name:'Kigali',x:0,y:0,land:'af',reg:'AF',P:60,cc:'RW',ix:'Umuganda-IX',dc:'Clean Streets Colo',note:tr('cities.probably_the_cleanest_capital_in')}, + {id:'mpm',name:'Maputo',x:0,y:0,land:'af',reg:'AF',P:70,cc:'MZ',ix:'Matapa-IX',dc:'Polana Point DC',note:tr('cities.mozambique_s_capital_an_hour_from')}, + {id:'dur',name:'Durban',x:0,y:0,land:'af',reg:'AF',P:130,cc:'ZA',za:true,ix:'Bunny Chow-IX',dc:'Golden Mile Colo',note:tr('cities.south_africa_s_east_coast_surf')}, + {id:'wdh',name:'Windhoek',x:0,y:0,land:'af',reg:'AF',P:25,cc:'NA',ix:'Kapana-IX',dc:'Desert Breeze DC',note:tr('cities.a_small_capital_in_the_middle')}, + {id:'lun',name:'Lusaka',x:0,y:0,land:'af',reg:'AF',P:100,cc:'ZM',blackout:true,ix:'Nshima-IX',dc:'Copperbelt Colo',note:tr('cities.zambia_runs_on_hydro_power_from')}, + {id:'hre',name:'Harare',x:0,y:0,land:'af',reg:'AF',P:70,cc:'ZW',blackout:true,ix:'Sadza-IX',dc:'Jacaranda DC',note:tr('cities.purple_jacaranda_trees_and_long')}, + {id:'gbe',name:'Gaborone',x:0,y:0,land:'af',reg:'AF',P:25,cc:'BW',ix:'Seswaa-IX',dc:'Diamond Dust DC',note:tr('cities.botswana_quiet_safe_and_rich_in')}, +{id:'mel',name:'Melbourne',x:0,y:0,land:'oc',reg:'OC',au:true,arpu:AU_ARPU,P:450,ix:'Flat-White-IX',dc:'Four-Seasons-a-Day DC',dc2:'Next-Door-DC M#',dc2N:3,note:tr('cities.four_seasons_in_one_day_and')}, + {id:'bne',name:'Brisbane',x:0,y:0,land:'oc',reg:'OC',au:true,arpu:AU_ARPU,P:250,ix:'Bris-Vegas-IX',dc:'Sunshine State Shed',dc2:'Next-Door-DC B#',dc2N:2,note:tr('cities.brisvegas_big_sky_a_thunderstorm_at')}, + {id:'drw',name:'Darwin',x:0,y:0,land:'oc',reg:'OC',au:true,arpu:AU_ARPU,P:15,ix:'Gator-IX',dc:'Crocodile-proof Landing Station',note:tr('cities.tiny_tropical_and_the_closest')}, + {id:'adl',name:'Adelaide',x:0,y:0,land:'oc',reg:'OC',au:true,arpu:AU_ARPU,P:150,ix:'Vineyard-IX',dc:'OurDC',dc2:'Next-Door-DC A1',note:tr('cities.twenty_minutes_from_everything')}, + {id:'cbr',capital:true,name:'Canberra',x:0,y:0,land:'oc',reg:'OC',au:true,arpu:AU_ARPU,P:50,ix:'Capital-IX',dc:'Classified Data Cupboard',dc2:'Next-Door-DC C1',note:tr('cities.built_for_the_government_the_data')}, + {id:'chc',name:'Christchurch',x:0,y:0,land:'nzs',reg:'OC',P:40,ix:'Garden-City-IX',dc:'Mainland Colo',note:tr('cities.the_garden_city_and_the_biggest')}, + {id:'ivc',name:'Invercargill',x:0,y:0,land:'nzs',reg:'OC',P:10,ix:'',dc:'Sheargrid Makarewa',note:tr('cities.the_bottom_of_the_country_on')}, + {id:'hba',name:'Hobart',x:0,y:0,land:'tas',reg:'OC',au:true,arpu:AU_ARPU,P:25,ix:'Cousin-IX',dc:'Firmest',note:tr('cities.the_bottom_of_the_map_cool')}, + {id:'hnl',name:'Honolulu',x:0,y:0,land:'hi',reg:'OC',cc:'US',P:70,ix:'Poke-IX',dc:'Dr. Fortress of Solitude',note:tr('cities.halfway_between_california_and')}, + {id:'gum',name:'Guam',x:0,y:0,land:'gu',reg:'OC',cc:'GU',P:15,blackout:true,ix:'Spam-IX',dc:'Typhoon-Proof Bunker',note:tr('cities.a_small_island_where_cables_from')}, + {id:'ror',name:'Koror',x:0,y:0,land:'pw',reg:'OC',cc:'PW',P:3,ix:'',dc:'Jellyfish Lake Landing',note:tr('cities.palau_on_a_branch_cable_from')}, + {id:'maj',name:'Majuro',x:0,y:0,land:'mh',reg:'OC',cc:'MH',P:3,ix:'',dc:'Two Metres Up Colo',note:tr('cities.the_capital_of_the_marshall_islands')}, + {id:'pom',name:'Port Moresby',x:0,y:0,land:'pg',reg:'OC',cc:'PG',P:40,blackout:true,ix:'',dc:'Bird of Paradise DC',note:tr('cities.papua_new_guinea_s_capital_in')}, + {id:'hir',name:'Honiara',x:0,y:0,land:'sb',reg:'OC',cc:'SB',P:8,blackout:true,ix:'Shell Money-IX',dc:'Guadalcanal Grotto',note:tr('cities.the_solomon_islands_capital_on')}, + {id:'nou',name:'Nouméa',x:0,y:0,land:'nc',reg:'OC',cc:'NC',P:20,ix:'Bougna-IX',dc:'Lagoon Rack',note:tr('cities.new_caledonia_a_slice_of_france')}, + {id:'suv',name:'Suva',x:0,y:0,land:'fj',reg:'OC',cc:'FJ',P:25,ix:'Kava-IX',dc:'Bula Bula Colo',note:tr('cities.fiji_s_capital_and_the_crossroads')}, + {id:'tbu',name:'Nuku’alofa',x:0,y:0,land:'to',reg:'OC',cc:'TO',P:4,ix:'',dc:'Volcano View DC',note:tr('cities.tonga_hangs_on_one_cable_from')}, + {id:'apw',name:'Apia',x:0,y:0,land:'ws',reg:'OC',cc:'WS',P:5,ix:'',dc:'Siva Shed',note:tr('cities.samoa_s_capital_with_cables_to')}, + {id:'ppg',name:'Pago Pago',x:0,y:0,land:'as',reg:'OC',cc:'AS',P:4,ix:'',dc:'Rainmaker Rack',note:tr('cities.american_samoa_a_deep_harbour_tuna')}, + {id:'ppt',name:'Papeete',x:0,y:0,land:'pf',reg:'OC',cc:'PF',P:18,ix:'',dc:'Overwater Bungalow DC',note:tr('cities.tahiti_in_french_polynesia_a_cable')}, + {id:'hfx',name:'Halifax',x:0,y:0,land:'am',reg:'AM',cc:'CA',ca:true,P:45,ix:'Donair-IX',dc:'Bluenose Bunker',note:tr('cities.nova_scotia_s_capital_and_the')}, + {id:'bda',name:'Bermuda',x:0,y:0,land:'bm',reg:'AM',cc:'BM',P:6,ix:'',dc:'Pink Sand Colo',note:tr('cities.a_thousand_kilometres_off_the')}, + {id:'pdl',name:'Ponta Delgada',x:0,y:0,land:'az',reg:'EU',cc:'PT',P:8,ix:'',dc:'Caldeira Colo',note:tr('cities.the_azores_in_the_middle_of')}, + {id:'tci',name:'Tenerife',x:0,y:0,land:'ic',reg:'EU',cc:'ES',P:25,ix:'',dc:'Mojo Picón DC',note:tr('cities.the_canary_islands_a_short_hop')}, + {id:'rai',name:'Praia',x:0,y:0,land:'cv',reg:'AF',cc:'CV',P:5,ix:'Cachupa-IX',dc:'Morabeza Rack',note:tr('cities.cape_verde_s_capital_off_the')}, + {id:'jam',name:'St Helena',x:0,y:0,land:'sh',reg:'AF',cc:'SH',P:1,blackout:true,ix:'',dc:'Napoleon’s Last Rack',note:tr('cities.one_of_the_most_remote_islands')}, + {id:'osa',name:'Osaka',x:0,y:0,land:'jp',reg:'AS',P:700,ix:'Takoyaki-IX',dc:'Dojima DC',note:tr('cities.japan_s_second_hub_and_tokyo')}, + {id:'kul',name:'Kuala Lumpur',x:0,y:0,land:'eu',reg:'AS',P:350,ix:'Satay-IX',dc:'Twin Towers Colo',note:tr('cities.cheaper_than_singapore_next_door_the')}, + {id:'bkk',name:'Bangkok',x:0,y:0,land:'eu',reg:'AS',P:600,ix:'Tom-Yum-IX',dc:'Floating Market DC',note:tr('cities.big_busy_and_flooded_with_traffic')}, + {id:'sgn',name:'Ho Chi Minh City',x:0,y:0,land:'eu',reg:'AS',P:500,vn:true,ix:'Pho-IX',dc:'Scooter-cooled DC',note:tr('cities.very_online_and_badly_served_by')}, + {id:'khi',name:'Karachi',x:0,y:0,land:'eu',reg:'AS',P:500,arpu:0.4,ix:'Chai-IX',dc:'Seaview Landing Station',note:tr('cities.pakistan_s_door_to_the_sea')}, + {id:'dac',name:'Dhaka',x:0,y:0,land:'eu',reg:'AS',P:700,arpu:0.3,ix:'Rickshaw-IX',dc:'Monsoon-mapped DC',note:tr('cities.huge_dense_and_hungry_its')}, + {id:'cbo',name:'Colombo',x:0,y:0,land:'lk',reg:'AS',P:120,ix:'Hopper-IX',dc:'Tea-cooled Landing Station',note:tr('cities.a_small_island_at_the_crossroads')}, + {id:'waw',name:'Warsaw',x:0,y:0,land:'eu',reg:'EU',P:550,ix:'Pierogi-IX',dc:'Palace-of-Culture-adjacent DC',note:tr('cities.central_europe_s_rising_hub_more')}, + {id:'prg',name:'Prague',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Pilsner-IX',dc:'Castle-view Colo',note:tr('cities.beer_is_cheaper_than_water_here')}, + {id:'vie',name:'Vienna',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Schnitzel-IX',dc:'Waltz-cooled DC',note:tr('cities.the_old_gateway_to_eastern_europe')}, + {id:'bud',name:'Budapest',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Goulash-IX',dc:'Thermal Bath DC',note:tr('cities.waste_heat_goes_straight_into_the')}, + {id:'buh',name:'Bucharest',x:0,y:0,land:'eu',reg:'EU',P:400,ix:'Sarmale-IX',dc:'Parliament-sized DC',note:tr('cities.gigabit_home_broadband_for_the_price')}, + {id:'tll',name:'Tallinn',x:0,y:0,land:'eu',reg:'EU',P:80,ix:'E-Stonia-IX',dc:'Medieval Wall DC',note:tr('cities.digital_everything_e_residency_for')}, + {id:'ist',name:'Istanbul',x:0,y:0,land:'eu',reg:'EU',P:900,ix:'Baklava-IX',dc:'Bosphorus Bridge DC',note:tr('cities.one_foot_in_europe_one_in')}, + {id:'kyv',name:'Kyiv',x:0,y:0,land:'eu',reg:'EU',P:500,blackout:true,ix:'Varenyky-IX',dc:'Generator-backed Bunker DC',note:tr('cities.ukrainian_network_engineers_kept_the')}, + {id:'jed',name:'Jeddah',x:0,y:0,land:'eu',reg:'AS',P:300,saudi:true,gcc:true,ix:'',dc:'Red Sea Landing Palace',note:tr('cities.saudi_arabia_s_red_sea_cable')}, + {id:'ruh',name:'Riyadh',x:0,y:0,land:'eu',reg:'AS',P:600,saudi:true,gcc:true,ix:'Kabsa-IX',dc:'Desert Megaproject DC',note:tr('cities.the_capital_building_ai_campuses_at')}, + {id:'doh',name:'Doha',x:0,y:0,land:'eu',reg:'AS',P:150,arpu:1.5,qa:true,ix:'Pearl-IX',dc:'Air-cooled Stadium DC',note:tr('cities.small_rich_and_very_well_connected')}, + {id:'mil',name:'Milan',x:0,y:0,land:'eu',reg:'EU',P:450,ix:'MIX-and-Match',dc:'Caldera Park Campus',note:tr('cities.italy_s_digital_capital_fashion_week')}, + {id:'rom',name:'Rome',x:0,y:0,land:'eu',reg:'EU',P:450,ix:'Carbonara-IX',dc:'Colosseum-adjacent Colo',note:tr('cities.all_roads_lead_to_rome_most')}, + {id:'pmo',name:'Palermo',x:0,y:0,land:'eu',reg:'EU',P:60,ix:'Cannoli-IX',dc:'Sicilian Hub-a-Dub',note:tr('cities.a_small_city_on_a_big')}, + {id:'lis',name:'Lisbon',x:0,y:0,land:'eu',reg:'EU',P:300,ix:'Pastel-de-Nata-IX',dc:'Seven Hills Colo',note:tr('cities.europe_s_new_atlantic_gateway_cables')}, + {id:'ath',name:'Athens',x:0,y:0,land:'eu',reg:'EU',P:350,ix:'Souvlaki-IX',dc:'Acropolis-view DC',note:tr('cities.ancient_city_brand_new_cables_greece')}, + {id:'atn',name:'Atlanta',x:0,y:0,land:'am',reg:'AM',P:450,ix:'Peach-IX',dc:'56 Marietta',note:tr('cities.the_southeast_s_carrier_hotel')}, + {id:'den',name:'Denver',x:0,y:0,land:'am',reg:'AM',P:250,ix:'Mile-High-IX',dc:'Thin Air DC',note:tr('cities.a_mile_up_and_halfway_between')}, + {id:'phx',name:'Phoenix',x:0,y:0,land:'am',reg:'AM',P:300,ix:'Cactus-IX',dc:'Dry Heat Campus',note:tr('cities.cheap_land_cheap_power_and_48')}, + {id:'bos',name:'Boston',x:0,y:0,land:'am',reg:'AM',P:350,ix:'Chowder-IX',dc:'One Summer Street',note:tr('cities.universities_biotech_and_a_carrier')}, + {id:'hou',name:'Houston',x:0,y:0,land:'am',reg:'AM',P:450,ix:'Rodeo-IX',dc:'Hurricane-hardened DC',note:tr('cities.oil_gas_and_hurricanes_the')}, + {id:'slc',name:'Salt Lake City',x:0,y:0,land:'am',reg:'AM',P:150,ix:'Fry-Sauce-IX',dc:'Great Salt Lake DC',note:tr('cities.cheap_power_dry_air_and_a')}, + {id:'man',name:'Manchester',x:0,y:0,land:'uk',reg:'EU',P:350,ix:'Rainy-City-IX',dc:'Old Cotton Mill Colo',note:tr('cities.the_north_s_hub_with_its')}, + {id:'edi',name:'Edinburgh',x:0,y:0,land:'uk',reg:'EU',P:200,ix:'Haggis-IX',dc:'Castle Rock Colo',note:tr('cities.scotland_s_capital_north_sea_cables')}, + {id:'bde',name:'Bude',x:0,y:0,land:'uk',reg:'EU',P:3,ix:'',dc:'Clifftop Landing Station',note:tr('cities.a_tiny_surfing_town_in_cornwall')}, + {id:'svg',name:'Stavanger',x:0,y:0,land:'eu',reg:'EU',P:60,ix:'Brunost-IX',dc:'Inside-a-Mountain DC',note:tr('cities.norway_s_oil_capital_now_full')}, +]; +// Display-only nudges for cities that sit on top of each other at map scale; distances still use real lon/lat. +const CITY_NUDGE={ + aju:[-13.5,-2.7], + akl:[.6,.4], + alg:[0.9,0.9], + asu:[-1.2,-0.8], + auh:[-5,6], + bcn:[-6,-4], + bel:[0.4,0.4], + bru:[1,3], + cac:[2.4,-0.7], + cas:[0.6,0.6], + cau:[-10.2,2.4], + cph:[-.7,.3], + cpq:[-2.8,-5.2], + cpv:[-10.2,-5.1], + cxj:[5.4,-9.4], + dal:[0,-4], + dar:[0,12.6], + dur:[-0.2,0], + dxb:[9,-7], + fec:[-10.8,1.4], + fln:[0.8,4.4], + fuj:[8,15], + gdl:[-1.2,0.2], + gyn:[-4,2.6], + hel:[-.8,-.2], + hkg:[.8,0], + hou:[0,6], + igu:[-3.9,5.3], + ist:[.8,0], + jib:[0.1,0.2], + jpa:[-0.9,0.6], + khi:[-2,-6], + ldb:[6.2,0.1], + lis:[.8,0], + ljd:[-5.2,-7.7], + mba:[-0.8,0], + mcp:[-1.7,1.7], + mcz:[-7.2,8], + mde:[-1.7,-1.9], + mgf:[-5.8,-4.4], + mia:[-.6,.4], + mtl:[.8,0], + mvd:[2.2,-4.3], + nat:[-1.5,-3.3], + nyc:[.3,-.7], + oos:[-3,0], + osa:[-10,6], + ott:[-3,-3], + qro:[-1.9,-3.9], + rao:[3.6,-2.6], + rec:[-2.4,7.2], + ria:[-2.4,4.9], + sea:[1,4], + sin:[-1.3,-1.3], + sjp:[-3.5,0.4], + slz:[0.3,0.3], + ssa:[0.5,-0.2], + stg:[7,1], + tll:[-4,22], + van:[-3,-6], + vix:[-0.4,0.4], + zrh:[-3,3], +}; +for(const c of CITIES){const q=CITY_LL[c.id];if(q){c.lon=q[0];c.lat=q[1];const pt=proj(q[0],q[1]),n=CITY_NUDGE[c.id]||[0,0];c.x=pt[0]+n[0];c.y=pt[1]+n[1];}} +const CITY=Object.fromEntries(CITIES.map(c=>[c.id,c])),CIDX=Object.fromEntries(CITIES.map((c,i)=>[c.id,i])); diff --git a/src/game/20-world/60-cables.js b/src/game/20-world/60-cables.js new file mode 100644 index 0000000..9db96bd --- /dev/null +++ b/src/game/20-world/60-cables.js @@ -0,0 +1,134 @@ +const CABLES=[ + {"id":"marea","name":"Marea Carey","price":0.8,"age":"new","blurb":tr('cables.hits_the_high_notes_across_the'),"pairs":[["ash","mad",[[-74,36.5],[-50,40],[-25,43],[-10,44]]]]}, + {"id":"grace","name":"Grace Hopscotch","price":0.85,"age":"new","blurb":tr('cables.hops_from_new_york_to_the'),"pairs":[["nyc","lon",[[-72,40],[-50,47],[-25,50],[-10,50.5]]],["nyc","mad",[[-72,39.8],[-50,42],[-25,43.2],[-10,43.8]]]]}, + {"id":"dunant","name":"Dunno-ant","price":0.85,"age":"new","blurb":tr('cables.nobody_remembers_who_it_is_named'),"pairs":[["ash","par",[[-74,36.8],[-50,42],[-25,46],[-5,47.3]]]]}, + {"id":"amitie","name":"Ami-Tea","price":0.9,"age":"new","blurb":tr('cables.a_friendly_cable_with_french_manners'),"pairs":[["nyc","lon",[[-70,41.5],[-50,46],[-25,49],[-8,50.3]]],["nyc","par",[[-70,41.3],[-50,45],[-25,47.5],[-5,47.6]]]]}, + {"id":"hibx","name":"Hibernia Express-o","price":1.7,"age":"mid","blurb":tr('cables.the_straightest_line_across_the'),"pairs":[["nyc","lon",[[-68,42],[-55,46.5],[-30,52.5],[-12,52.5]]],["nyc","hfx",[[-70,41.6],[-66,43.3]]],["hfx","lon",[[-60,45.5],[-55,46.5],[-30,52.5],[-12,52.5]]]],"lat":0.9}, + {"id":"tat","name":"TAT-14 Retirement Home","price":1.3,"age":"old","blurb":tr('cables.laid_last_century_cuts_often_costs'),"pairs":[["nyc","ams",[[-70,41],[-45,48],[-20,52],[0,54],[3,53.5]]]]}, + {"id":"ella","name":"EllaLink-ing","price":1.0,"age":"new","blurb":tr('cables.brazil_straight_to_iberia_skipping'),"pairs":[["for","mad",[[-37,-2.2],[-32,5],[-22,20],[-14,33],[-10,37.5]]],["sao","mad",[[-44,-24.5],[-38,-14],[-34,-6],[-30,5],[-22,20],[-14,33],[-10,37.5]]],["for","lis",[[-37,-2.2],[-32,5],[-22,20],[-14,33],[-9.6,37.9]]],["for","rai",[[-37,-2.2],[-32,5],[-26,13]]],["rai","lis",[[-22,20],[-14,33],[-9.6,37.9]]]]}, + {"id":"sacs","name":"SACS-y Cable","price":1.0,"age":"mid","blurb":tr('cables.south_atlantic_cool_and_confident'),"pairs":[["for","lag",[[-36,-3],[-20,0],[0,3]]],["sao","lag",[[-44,-24.5],[-35,-10],[-15,-3],[0,2],[3,5.5]]],["for","lad",[[-37,-2.5],[-20,-5],[0,-8],[12.6,-9]]]]}, + {"id":"col3","name":"Columbus III-and-a-half","price":1.4,"age":"old","blurb":tr('cables.discovered_the_atlantic_again_old'),"pairs":[["mia","mad",[[-79,26],[-60,30],[-30,35],[-10,36.5]]],["mia","pdl",[[-79,26],[-60,30],[-35,36]]],["pdl","lis",[[-15,38.2]]]]}, + {"id":"twoaf","name":"2Africa-n-Back","price":0.75,"age":"new","blurb":tr('cables.all_the_way_around_africa_and'),"pairs":[["lon","lag",[[-6,49],[-12,40],[-20,20],[-18,8],[-5,3],[3,5.5]]],["jnb","mrs",[[32,-30],[40,-20],[45,-5],[52,10],[45,12.3],[44,12.4],[41,15.1],[38,21.1],[35,26.1],[33,29.6],[32.4,31.3],[30,32.1],[20,34.1],[12,37.6],[6,42.5]]],["mrs","bom",[[6,42.5],[12,37.6],[20,34.1],[30,32.1],[32.4,31.3],[33,29.6],[35,26.1],[38,21.1],[41,15.1],[44,12.4],[52,13],[62,18],[70,19]]],["dkr","abj",[[-18,14.7],[-17,10],[-14,5],[-8,4],[-4,4.8]]],["abj","acc",[[-4,4.8],[-0.2,5.1]]],["acc","lag",[[-0.2,5.1],[3.2,5.8]]],["lag","lad",[[3.2,5.8],[6,3],[9,3.6],[8,-2],[11.5,-6],[12.6,-9]]],["lad","cpt",[[12.6,-9],[11.5,-15],[13.5,-22.7],[15,-30],[17.6,-34.4]]],["cpt","dur",[[17.6,-34.4],[22,-35.5],[28,-34],[32,-30.3]]],["dur","mpm",[[32,-30.3],[34.5,-26]]],["mpm","dar",[[34.5,-26],[38,-20],[41.5,-14],[40.4,-7]]],["dar","mba",[[40.4,-7],[40.6,-4.3]]],["mba","jib",[[40.6,-4.3],[45,2],[51,10.5],[45,12.3],[43.5,11.9]]],["jib","cai",[[43.5,11.9],[40.4,14.7],[37.4,20.7],[34.4,25.7],[32.4,29.2],[32.4,31.4]]],["lon","tci",[[-6,49],[-12,40],[-15.5,29.5]]],["tci","lag",[[-18,25],[-20,20],[-18,8],[-5,3],[3,5.5]]]]}, + {"id":"equi","name":"Equi-yes","price":0.8,"age":"new","blurb":tr('cables.always_agrees_with_you_iberia_to'),"pairs":[["lag","cpt",[[4,3],[6,-5],[10,-20],[16,-33]]],["mad","lag",[[-10,38],[-15,28],[-18,15],[-14,5],[-2,3],[3,5.8]]],["lis","lag",[[-9.6,37.9],[-15,28],[-18,15],[-14,5],[-2,3],[3,5.8]]],["lag","wdh",[[3.2,5.8],[6,3],[9,3.6],[8,-2],[11.5,-6],[12.6,-9],[11.5,-15],[13.5,-22.7]]],["wdh","cpt",[[13.5,-22.7],[15,-30],[17.6,-34.4]]],["lag","jam",[[4,3],[2,-5],[-3,-12]]],["jam","wdh",[[-2,-18],[8,-21.5],[13.5,-22.7]]]]}, + {"id":"smw6","name":"SEE-ME-WAVE 6","price":0.95,"age":"new","blurb":tr('cables.sixth_in_a_long_running_series'),"pairs":[["mrs","bom",[[6.4,42.74],[12.4,37.84],[20.4,34.34],[30.4,32.34],[32.8,31.54],[33.4,29.84],[35.4,26.34],[38.4,21.34],[41.4,15.34],[44.4,12.64],[52,13.4],[62,18.4],[70,19.4]]],["bom","sin",[[72,17],[76,8],[80.5,5],[90,5],[96,5.5],[100,4],[103,1.5]]],["mrs","sin",[[6.4,42.74],[12.4,37.84],[20.4,34.34],[30.4,32.34],[32.8,31.54],[33.4,29.84],[35.4,26.34],[38.4,21.34],[41.4,15.34],[44.4,12.64],[52,12.8],[62,12.5],[75,6.8],[80.5,5.2],[92,5.8],[97,5.8],[100.5,4],[103,1.7]]]]}, + {"id":"peace","name":"PEACE-out","price":0.85,"age":"new","blurb":tr('cables.marseille_to_singapore_then_it'),"pairs":[["mrs","sin",[[5.6,42.26],[11.6,37.36],[19.6,33.86],[29.6,31.860000000000003],[32.0,31.060000000000002],[32.6,29.360000000000003],[34.6,25.860000000000003],[37.6,20.860000000000003],[40.6,14.86],[43.6,12.16],[52,12.2],[62,11.8],[75,6.3],[80.5,4.6],[92,5.2],[97,5.3],[100.5,3.6],[103,1.4]]],["mba","cai",[[40.6,-4.3],[45,2],[51,10.5],[45,12.3],[43.5,11.9],[40.4,14.7],[37.4,20.7],[34.4,25.7],[32.4,29.2],[32.4,31.4]]]]}, + {"id":"aae","name":"AAAAAE-1","price":1.0,"age":"mid","blurb":tr('cables.asia_africa_europe_and_one_more'),"pairs":[["khi","sin",[[66,22],[70,12],[78,5.5],[90,5.5],[97,6],[100,3.6],[102.6,2.1],[103.7,1.3]]],["mrs","hkg",[[6.8,42.98],[12.8,38.08],[20.8,34.58],[30.8,32.58],[33.199999999999996,31.78],[33.8,30.080000000000002],[35.8,26.580000000000002],[38.8,21.580000000000002],[41.8,15.58],[44.8,12.88],[52,11.8],[62,11.4],[75,6],[80.5,4.4],[92,5],[97,5],[100.5,3.3],[104.5,1.5],[107,5],[110,10],[113,18],[114.2,21.8]]],["sin","hkg",[[104.5,1.5],[108,6],[111,12],[114,20],[114.2,22]]],["jib","cai",[[43.5,11.9],[40.4,14.7],[37.4,20.7],[34.4,25.7],[32.4,29.2],[32.4,31.4]]]]}, + {"id":"apg","name":"A Pretty Gateway","price":0.9,"age":"mid","blurb":tr('cables.the_pretty_way_around_east_asia'),"pairs":[["tpe","tok",[[123,25.5],[130,29.5],[137,33.5]]],["hkg","tpe",[[116.5,21.8],[119.5,22.8]]],["sin","hkg",[[105,2],[109,7],[112,13],[114.6,20],[114.4,22]]],["hkg","tok",[[116,21.5],[122,24],[126,28],[132,32],[137,33.8],[139.8,35]]],["hkg","icn",[[116,22],[122,26],[125,32],[126,35],[126.2,36.8]]],["tok","icn",[[136,33.8],[130,33.5],[128,34.5],[126.5,35.5]]],["tok","sha",[[135,33.5],[128,31.5],[122.5,31.2]]]]}, + {"id":"jup","name":"Jupiterrible","price":0.9,"age":"new","blurb":tr('cables.named_after_a_planet_behaves_like'),"pairs":[["lax","osa",[[-121,33.3],[-145,31.5],[-175,31.5],[-200,32.5],[-222,33.8]]],["lax","tok",[[-121,33.5],[-145,32],[-175,32],[-200,33],[-218,34.5]]]]}, + {"id":"fast","name":"FASTEST","price":0.85,"age":"mid","blurb":tr('cables.its_predecessor_was_faster_marketing'),"pairs":[["sea","tok",[[-125,46],[-150,45],[-180,42],[-205,38],[-218,35]]]]}, + {"id":"ncp","name":"Crosspatch Pacific","price":1.0,"age":"mid","blurb":tr('cables.crosses_the_pacific_mildly_annoyed'),"pairs":[["sea","tpe",[[-125,46],[-155,45],[-185,38],[-212,28],[-235,25.6]]],["sea","icn",[[-125,46.5],[-155,46.5],[-185,42],[-212,33],[-229,33.8],[-232,36]]],["sea","sha",[[-125,46.2],[-155,45.5],[-185,40],[-212,31],[-236,30.5]]]]}, + {"id":"plcn","name":"Pacific Lite","price":1.1,"age":"mid","blurb":tr('cables.lighter_on_paperwork_than_its'),"pairs":[["lax","tpe",[[-121,33],[-150,25],[-180,22],[-215,22],[-236,24]]],["lax","hkg",[[-121,33],[-150,25],[-180,22],[-215,21],[-240,21.5]]]]}, + {"id":"scx","name":"Southern Cross-ed Fingers","price":1.2,"age":"old","blurb":tr('cables.old_pacific_workhorse_everyone_hopes'),"pairs":[["sjc","syd",[[-123,37],[-150,20],[-175,0],[-190,-20],[-200,-30],[-207,-33.5]]],["akl","syd",[[168,-37],[158,-35]]],["sjc","hnl",[[-123,36.5],[-140,28],[-156.2,21.5]]],["hnl","suv",[[-158.5,19.5],[-168,6],[-176,-8],[-181.2,-17.5]]],["suv","syd",[[177.5,-19],[166,-25.5],[156,-32],[152,-33.8]]],["akl","suv",[[175.2,-35.5],[176.5,-27],[178.2,-19]]]]}, + {"id":"hwk","name":"Hawaiki-wiki","price":0.95,"age":"new","blurb":tr('cables.quick_pacific_crossing_with_a_stop'),"pairs":[["sea","syd",[[-125,45],[-150,20],[-170,-5],[-185,-25],[-200,-32],[-206,-33.8]]],["akl","sea",[[178,-34],[190,-20],[210,10],[230,40],[234.5,47]]],["sea","hnl",[[-125,45],[-145,31],[-157.8,21.8]]],["hnl","syd",[[-158.5,20],[-172,0],[-185,-25],[-200,-32],[-206,-33.8]]],["hnl","akl",[[-158.5,20],[-174,-5],[-182,-28],[-185.1,-36]]],["hnl","ppg",[[-158.6,20.5],[-166,2],[-170.5,-13.8]]]]}, + {"id":"indigo","name":"Indi-Go-Down","price":0.9,"age":"new","blurb":tr('cables.singapore_to_sydney_via_perth_on'),"pairs":[["sin","syd",[[104.5,0],[107,-8],[113,-12],[112,-25],[114,-35],[130,-37],[145,-41],[152,-36]]],["sin","per",[[104.6,0],[107.2,-8],[113,-14],[112.5,-25],[115,-31.8]]]]}, + {"id":"guam","name":"Guam-bling","price":1.1,"age":"mid","blurb":tr('cables.a_bet_on_a_tiny_island'),"pairs":[["tok","syd",[[142,33],[146,15],[152,0],[156,-20],[152.5,-33]]],["tok","gum",[[142,33],[146,20],[145.2,14]]],["gum","syd",[[145.5,12.5],[152,0],[156,-20],[152.5,-33]]]]}, + {"id":"sushi","name":"Sushi Train Cable","price":1.15,"age":"old","blurb":tr('cables.sydney_to_tokyo_by_way_of'),"pairs":[["syd","tok",[[153,-33],[157,-20],[151,0],[145,14],[140.5,33]]]]}, + {"id":"aloha","name":"Aloha Mate","price":1.05,"age":"mid","blurb":tr('cables.sydney_to_honolulu_and_not_a'),"pairs":[["hnl","syd",[[-158.5,20],[-168,4],[-180,-15],[-197,-30],[-205.5,-33.6]]]]}, + {"id":"avo","name":"Cut Lunch Cable","price":0.9,"age":"new","fragile":true,"blurb":tr('cables.perth_to_singapore_and_jakarta'),"pairs":[["per","sin",[[114,-31.8],[110,-24],[106,-10],[105.5,-3],[104.4,1]]],["per","jkt",[[114,-31.8],[110,-24],[106.5,-10],[106.8,-6.3]]]]}, + {"id":"ferry","name":"Ferry Express","price":1.0,"age":"mid","blurb":tr('cables.crosses_bass_strait_faster_than_the'),"pairs":[["mel","hba",[[145,-38.4],[146.3,-39.8],[147.9,-41.5],[147.6,-42.9]]]]}, + {"id":"smap","name":"SMAP (Somewhere, Maybe Also Perth)","price":0.95,"age":"new","blurb":tr('cables.sydney_melbourne_adelaide_and_perth'),"pairs":[["syd","mel",[[151.6,-34.2],[150.5,-36.5],[150,-37.7],[147,-38.7],[145,-38.5]]],["mel","adl",[[144.5,-38.5],[141.5,-38.7],[139.7,-37.3],[138.3,-35.9],[138.4,-35.1]]],["adl","per",[[137.8,-35.9],[134,-34.6],[129,-33.2],[123,-34.9],[118,-35.7],[115,-34.7],[115.3,-32.5],[115.7,-32]]]]}, + {"id":"ohman","name":"Oh-Man Australia Cable","price":1.0,"age":"new","blurb":tr('cables.perth_to_the_gulf_across_the'),"pairs":[["per","dxb",[[113,-31],[100,-25],[80,-10],[65,10],[59,20],[57,24.5]]]]}, + {"id":"cook","name":"Cook Strait Talking","price":1.0,"age":"mid","blurb":tr('cables.down_the_west_coast_and_across'),"pairs":[["akl","chc",[[174.2,-37.3],[173.6,-38.6],[173.9,-39.7],[174.5,-40.6],[174.4,-41.4],[173.9,-42.1],[173.4,-43.0],[173.1,-43.6]]]]}, + {"id":"ring","name":"Lord of the Tasman Rings","price":0.9,"age":"new","blurb":tr('cables.one_ring_to_bind_invercargill_to'),"pairs":[["ivc","syd",[[167.6,-46.9],[160,-42],[153,-35]]],["ivc","mel",[[167.6,-46.9],[156,-43.5],[146.2,-39.4]]],["ivc","akl",[[167.4,-46.5],[166.3,-45.4],[167.9,-43.8],[170.6,-42.3],[172.3,-40.6],[173.5,-38.8],[174.3,-37.3]]]]}, + {"id":"tasman","name":"Tasman Global Excess","price":0.95,"age":"new","blurb":tr('cables.sydney_to_auckland_with_plenty_to'),"pairs":[["akl","syd",[[170,-36],[158,-34.5]]]]}, + {"id":"bifrost","name":"Bi-Frosted","price":0.9,"age":"new","blurb":tr('cables.a_rainbow_bridge_from_singapore_to'),"pairs":[["sin","jkt",[[105,-1],[106,-4]]],["jkt","mnl",[[108,-5],[112,-3],[118,2],[122,6],[121,10],[120,13.5]]],["mnl","lax",[[123,15],[140,20],[180,25],[210,30],[235,33.5]]],["mnl","gum",[[123,15],[136,14.5],[144.3,13.6]]],["gum","lax",[[145.5,14.2],[180,22],[210,30],[235,33.5]]]]}, + {"id":"sjcph","name":"Sushi-Jollibee Cable","price":0.9,"age":"mid","blurb":tr('cables.southeast_asia_to_japan_with_snacks'),"pairs":[["hkg","mnl",[[116,21],[119.5,16],[120.3,14.6]]],["mnl","sin",[[119,12],[115,8],[110,5],[105,2]]],["mnl","tok",[[122,19],[127,24],[133,30],[138.5,34.5]]]]}, + {"id":"farice","name":"Far-Ice-1","price":1.2,"age":"old","blurb":tr('cables.iceland_s_lifeline_to_scotland'),"pairs":[["rek","lon",[[-20,63],[-10,61],[-4,59],[-1.5,57]]]]}, + {"id":"danice","name":"Dance-Ice","price":1.0,"age":"mid","blurb":tr('cables.iceland_to_denmark_choreographed'),"pairs":[["rek","cph",[[-18,63],[-5,62],[5,59],[8.5,57.5],[11,57]]]]}, + {"id":"gcon","name":"Greenland Connect-the-Dots","price":1.4,"age":"old","blurb":tr('cables.hops_via_greenland_polar_bears'),"pairs":[["rek","mtl",[[-26,63.5],[-42,60],[-55,53],[-60,48],[-66,47],[-70,46.5]]]]}, + {"id":"iris","name":"IRIS Scan","price":0.9,"age":"new","blurb":tr('cables.iceland_to_ireland_brand_new_and'),"pairs":[["rek","dub",[[-22,63],[-15,58],[-10.5,54.5],[-9,53.3]]]]}, + {"id":"aec","name":"AEConnect-the-Dots","price":0.85,"age":"new","blurb":tr('cables.new_york_to_ireland_the_tech'),"pairs":[["nyc","dub",[[-70,41],[-50,47],[-25,52],[-11,52.8]]]]}, + {"id":"havf","name":"Havfun","price":0.8,"age":"new","blurb":tr('cables.danish_for_sea_fun_probably'),"pairs":[["nyc","cph",[[-70,41.5],[-50,49],[-25,55],[-10,58],[0,58],[7,57.5],[10,57.6]]],["dub","cph",[[-10,54.5],[-8,57],[-2,59],[6,58],[10,57.6]]]]}, + {"id":"celtix","name":"Celtix Connected","price":0.7,"age":"mid","blurb":tr('cables.dublin_to_london_across_the_irish'),"pairs":[["dub","lon",[[-5,53.4]]]]}, + {"id":"falcon","name":"Falcon Punch","price":0.9,"age":"mid","blurb":tr('cables.dubai_to_mumbai_hits_hard'),"pairs":[["cai","dxb",[[32.6,29.9],[34.4,27.2],[37.5,22.5],[41.5,15.5],[43.4,12.4],[48,12.6],[55,15.8],[59.4,21.8],[57,25.5]]],["fuj","bom",[[58,24.8],[63,22.3],[70,19.2]]],["dxb","bom",[[57,25.5],[60,23],[66,21],[71,19]]]]}, + {"id":"eig","name":"Eye-Gee","price":1.0,"age":"mid","blurb":tr('cables.a_gateway_from_europe_to_india'),"pairs":[["dxb","mrs",[[57,25],[59,22],[55,16],[48,12.8],[43.2,11.92],[40.2,14.62],[37.2,20.62],[34.2,25.62],[32.2,29.12],[31.599999999999998,30.82],[29.2,31.62],[19.2,33.620000000000005],[11.2,37.120000000000005],[5.2,42.02]]]]}, + {"id":"clion","name":"C-Lion King","price":1.0,"age":"new","blurb":tr('cables.helsinki_to_germany_under_the_baltic'),"pairs":[["hel","fra",[[24,59.8],[20,57.5],[15,55.2],[12.2,54.3]]]]}, + {"id":"uly","df":true,"name":"Ulysseless","price":0.8,"age":"old","blurb":tr('cables.short_hop_across_the_north_sea'),"pairs":[["lon","ams",[[2,51.8]]]]}, + {"id":"chn","df":true,"name":"Channel Hopper","price":0.7,"age":"mid","blurb":tr('cables.london_to_paris_under_the_channel'),"pairs":[["lon","par",[[1,50.5]]]]}, + {"id":"medn","name":"Med-Nauti-lust","price":0.9,"age":"mid","blurb":tr('cables.across_the_mediterranean_egypt_to'),"pairs":[["ist","mrs",[[26.5,40],[25,37],[20,35.5],[12,38],[6.5,42.6]]],["cai","mrs",[[29.9,31.4],[28,32.5],[20,34.5],[12,38],[6.5,42.6]]]]}, + {"id":"eassy","name":"EASSy Peasy","price":0.95,"age":"mid","blurb":tr('cables.east_africa_up_to_europe_via'),"pairs":[["nbo","mrs",[[39.7,-4],[42,-1],[45,2],[51,10.5],[45,12.3],[43.4,12.0],[40.4,14.7],[37.4,20.700000000000003],[34.4,25.700000000000003],[32.4,29.200000000000003],[31.799999999999997,30.900000000000002],[29.4,31.700000000000003],[19.4,33.7],[11.4,37.2],[5.4,42.1]]],["dur","mpm",[[32,-30.3],[34.5,-26]]],["mpm","dar",[[34.5,-26],[38,-20],[41.5,-14],[40.4,-7]]],["dar","mba",[[40.4,-7],[40.6,-4.3]]],["mba","jib",[[40.6,-4.3],[45,2],[51,10.5],[45,12.3],[43.5,11.9]]]]}, + {"id":"teams","name":"TEAMS-work","price":0.9,"age":"mid","blurb":tr('cables.kenya_to_the_gulf_makes_the'),"pairs":[["nbo","dxb",[[39.7,-4],[44,0],[52,8],[58,18],[59,22.5],[57,25]]],["mba","fuj",[[40.6,-4.3],[44,0],[52,8],[58,18],[59,22.5],[57,25]]]]}, + {"id":"monet","name":"Mo-Net-y","price":0.9,"age":"new","blurb":tr('cables.brazil_to_florida_the_invoice'),"pairs":[["sao","mia",[[-44,-25.5],[-36,-14],[-33,-4],[-45,4],[-62,16],[-76,25]]],["for","mia",[[-37,-2.2],[-45,4.5],[-62,16.5],[-76,25.3]]]]}, + {"id":"seabras","name":"Sea-Bras","price":0.9,"age":"new","blurb":tr('cables.straight_from_sao_paulo_to_new'),"pairs":[["sao","nyc",[[-44,-25.5],[-34,-10],[-33,0],[-50,18],[-66,33],[-72,39.5]]]]}, + {"id":"sam1","name":"SAM-1-and-Done","price":1.2,"age":"old","blurb":tr('cables.an_old_ring_around_the_whole'),"pairs":[["mia","for",[[-75,24],[-62,16],[-45,4],[-37,-2.5]]],["for","rio",[[-36,-4],[-34,-9],[-37,-16],[-41,-23.6]]],["for","ssa",[[-36,-4],[-34,-9],[-37,-13.5]]],["ssa","rio",[[-37.5,-14],[-38.5,-18],[-41,-23.6]]],["rio","sao",[[-44,-24.3]]],["sao","bue",[[-47,-27],[-52,-35],[-56,-36]]],["bue","scl",[[-56,-37.5],[-62,-45],[-65,-56],[-72,-56],[-77,-45],[-74,-34]]],["scl","lim",[[-73.5,-30],[-74,-20],[-78,-13]]],["lim","pan",[[-81,-6],[-82,0],[-80,7]]],["pan","mia",[[-79.5,10],[-77,15],[-74,19.5],[-75,23],[-79,25]]]]}, + {"id":"curie","name":"Curie-osity","price":0.85,"age":"new","blurb":tr('cables.los_angeles_to_chile_with_a'),"pairs":[["lax","scl",[[-120,30],[-108,14],[-92,0],[-80,-20],[-73,-33]]],["lax","pan",[[-120,30],[-105,15],[-90,7],[-80,7.5]]]]}, + {"id":"pccs","name":"Caribbean Cruise Control","price":1.0,"age":"mid","blurb":tr('cables.hops_the_caribbean_so_bogota_can'),"pairs":[["mia","bog",[[-80,24],[-77.5,19],[-76,12],[-75,10.5]]],["pan","bog",[[-79.6,9.6],[-77,9.9],[-75.5,10.5]]]]}, + {"id":"tannat","name":"Tannat Wine Line","price":0.9,"age":"mid","blurb":tr('cables.named_after_a_wine_sao_paulo'),"pairs":[["sao","bue",[[-46,-26],[-50,-32],[-55,-35.5]]],["sao","mvd",[[-46,-26],[-50,-32],[-55,-35.3]]]]}, + {"id":"humb","name":"Humboldt Penguin","price":1.3,"age":"new","blurb":tr('cables.the_first_cable_from_south_america'),"pairs":[["scl","syd",[[-75,-34],[-110,-38],[-150,-40],[-180,-38],[-200,-35],[-206,-34]]],["scl","ppt",[[-75,-34],[-100,-30],[-130,-22],[-149,-17.9]]],["ppt","syd",[[-150,-18.2],[-170,-28],[-185,-35],[-200,-35],[-206,-34]]]]}, + {"id":"wacs","name":"WACS-a-Mole","price":1.1,"age":"mid","blurb":tr('cables.up_the_west_coast_of_africa'),"pairs":[["cpt","lag",[[16,-34],[10,-20],[6,-5],[4,3]]],["lag","lon",[[3,4],[-10,8],[-20,20],[-15,35],[-10,45],[-6,49.5]]],["abj","acc",[[-4,4.8],[-0.2,5.1]]],["acc","lag",[[-0.2,5.1],[3.2,5.8]]],["lag","dla",[[3.2,5.8],[6,3],[9,3.6]]],["dla","lad",[[9,3.6],[8,-2],[11.5,-6],[12.6,-9]]],["lad","wdh",[[12.6,-9],[11.5,-15],[13.5,-22.7]]],["wdh","cpt",[[13.5,-22.7],[15,-30],[17.6,-34.4]]],["lon","tci",[[-6,49.5],[-10,45],[-15,35],[-16.1,28.8]]],["tci","rai",[[-18,24],[-22,17]]],["rai","abj",[[-20,10],[-10,4.5],[-4,4.8]]]]}, + {"id":"safe","name":"SAFE-ty Not Guaranteed","price":1.4,"age":"old","blurb":tr('cables.an_old_cable_from_cape_town'),"pairs":[["cpt","bom",[[22,-36],[45,-30],[57,-20],[65,0],[70,15]]]]}, + {"id":"bbg","name":"Bay of Bengal Gate-Delay","price":0.95,"age":"mid","blurb":tr('cables.fujairah_to_mumbai_round_the_tip'),"pairs":[["fuj","bom",[[58,24.5],[63,22],[69.5,19.5]]],["bom","maa",[[72,15],[75,8],[78.5,6.6],[81.8,8],[81,12]]],["maa","sin",[[82,12],[90,8],[96.5,6],[100,3.5],[102.5,2],[103.6,1.25]]]]}, + {"id":"i2i","name":"Eye-to-Eye","price":0.85,"age":"mid","blurb":tr('cables.chennai_to_singapore_looking_it'),"pairs":[["maa","sin",[[82,13],[91,9.5],[97,6.6],[100.2,3.8],[102.6,2.2],[103.7,1.3]]]]}, + {"id":"tse","name":"Strait Outta Taipei","price":1.5,"age":"old","blurb":tr('cables.a_short_cable_across_a_very'),"pairs":[["tpe","sha",[[122.2,26.5],[122.6,29],[122.2,31]]]]}, + {"id":"gbi","name":"Gulf Bridge Over Troubled Water","price":1.0,"age":"mid","blurb":tr('cables.leaves_the_gulf_from_fujairah_and'),"pairs":[["fuj","mrs",[[57.5,23.5],[59.5,21.5],[55,15.5],[48,12.6],[43.2,11.8],[40.2,14.5],[37.2,20.5],[34.2,25.5],[32.2,29],[31.6,30.7],[29.2,31.5],[19.2,33.5],[11.2,37],[5.2,42]]]]}, + {"id":"aagony","name":"AAG-ony","price":1.1,"age":"old","blurb":tr('cables.an_asia_america_gateway_cable_that'),"pairs":[["sgn","hkg",[[109,12],[113,18],[114.2,21.5]]],["sgn","sin",[[106,7],[104.6,3]]]]}, + {"id":"darwin","name":"Darwin Award Cable","price":1.0,"age":"new","blurb":tr('cables.darwin_to_singapore_via_jakarta'),"pairs":[["drw","jkt",[[129,-11.2],[122,-10],[114,-8.6],[108,-6.6]]],["drw","sin",[[129,-11.2],[120,-9],[114,-6],[108,-2],[105,0.6]]]]}, + {"id":"jga","name":"J-G’day-A (Japan–Guam–Aussie)","price":0.9,"age":"new","blurb":tr('cables.brisbane_to_tokyo_with_a_beach'),"pairs":[["bne","tok",[[155,-25],[156,-5],[146,13],[141,30]]],["bne","gum",[[155,-25],[156,-5],[146,12.8]]],["gum","tok",[[145.3,14.5],[141,30]]]]}, + {"id":"smw4","name":"SEE-ME-WAVE 4","price":1.2,"age":"old","blurb":tr('cables.the_previous_generation_still'),"pairs":[["khi","mrs",[[65,23.5],[60,22],[55,15.5],[48,12.6],[43.2,11.8],[40.2,14.5],[37.2,20.5],[34.2,25.5],[32.2,29],[31.6,30.7],[29.2,31.5],[19.2,33.5],[11.2,37],[5.2,42]]],["khi","bom",[[67,23],[70,20.5]]],["bom","cbo",[[72,15],[75,8],[78.5,6.3]]],["cbo","maa",[[80.6,8.6],[81,11.5]]],["maa","dac",[[82,14],[87,17.5],[91.5,21.2]]],["dac","sin",[[92,21],[93,17],[95,10],[97,6.4],[100,3.6],[102.6,2.1],[103.7,1.3]]]]}, + {"id":"balt","name":"Baltic Anchor Magnet","price":0.8,"age":"mid","blurb":tr('cables.short_hops_under_the_baltic_sea'),"pairs":[["tll","hel",[[24.8,59.8]]],["tll","sto",[[22,59.3],[19.5,59.3]]]]}, + {"id":"bsea","name":"Black Sea Shanty","price":1.0,"age":"mid","blurb":tr('cables.istanbul_to_bucharest_s_coast_across'),"pairs":[["ist","buh",[[29.5,42],[29.5,43.5],[28.8,44.2]]]]}, + {"id":"concerto","name":"Concerto in Sea Minor","price":0.55,"age":"new","df":true,"blurb":tr('cables.north_sea_workhorse_from_london_to'),"pairs":[["lon","ams",[[1.6,51.72],[3.6,52.02]]]]}, + {"id":"circe","name":"Circe du Soleil","price":0.6,"age":"mid","df":true,"blurb":tr('cables.another_london_amsterdam_route'),"pairs":[["lon","ams",[[1.8,52.18],[3.8,52.58]]]]}, + {"id":"nshuttle","name":"North Sea Shuttle","price":0.5,"age":"new","df":true,"blurb":tr('cables.brand_new_cheap_and_it_lands'),"pairs":[["lon","ams",[[1.5,51.42],[3.9,51.88]]]]}, + {"id":"imewe","name":"I-ME-WE-Us","price":1.05,"age":"mid","blurb":tr('cables.india_the_middle_east_and_western'),"pairs":[["cai","fuj",[[32.6,29.9],[34.4,27.2],[37.5,22.5],[41.5,15.5],[43.4,12.4],[48,12.6],[55,15.8],[59.4,21.8],[57.5,24.3]]],["cai","bom",[[32.6,29.9],[34.4,27.2],[37.5,22.5],[41.5,15.5],[43.4,12.4],[48,12.6],[60,15],[68,17.5]]]]}, + {"id":"jedx","name":"Jeddah-i Express","price":0.95,"age":"new","blurb":tr('cables.new_cables_increasingly_land_in'),"pairs":[["jed","bom",[[38.6,22.5],[41.5,15.5],[43.4,12.4],[48,12.6],[60,15],[68,17.5]]],["jed","sin",[[38.6,22.5],[41.5,15.5],[43.4,12.4],[52,11],[70,6],[80,5.2],[92,5.5],[97,6],[100,3.6],[102.6,2.1],[103.7,1.3]]]]}, + {"id":"rsea","name":"Red Sea Shortcut","price":0.9,"age":"mid","blurb":tr('cables.a_quick_hop_across_the_red'),"pairs":[["cai","jed",[[32.6,29.9],[34.6,27],[37.2,23.6]]]]}, + {"id":"qgulf","name":"Doha Detour","price":1.0,"age":"mid","blurb":tr('cables.connects_doha_to_the_rest_of'),"pairs":[["doh","fuj",[[52.5,26.2],[55,26.4],[56.6,26],[56.9,25.3]]],["doh","bom",[[52.5,26.2],[55,26.4],[57,25.5],[60,23],[66,21],[71,19]]]]}, + {"id":"nouk","name":"NO-UK-Way","price":0.6,"age":"new","df":true,"blurb":tr('cables.norway_to_the_uk_across_the'),"pairs":[["svg","edi",[[5.3,58.8],[2,57.5],[-1.5,56.2]]]]}, + {"id":"celtn","name":"Celtic Norsemen","price":0.85,"age":"new","blurb":tr('cables.ireland_to_norway_the_long_way'),"pairs":[["dub","svg",[[-6,54],[-6.8,56.5],[-5.5,59.3],[-1.5,60.2],[3,59.5],[5.2,59]]]]}, + {"id":"havh","name":"Havhingsten Hoofbeat","price":0.8,"age":"new","blurb":tr('cables.the_sea_stallion_blackpool_to'),"pairs":[["man","cph",[[-3.4,53.9],[-5,54.5],[-6.5,56.5],[-5,59],[-2,59.4],[2,58.5],[7,57.8],[8.2,57.2],[10.5,57.6],[11.5,56.5]]]]}, + {"id":"shefa","name":"Shefa Sheep Line","price":1.1,"age":"mid","blurb":tr('cables.scotland_to_iceland_via_shetland_and'),"pairs":[["edi","rek",[[-2.5,56.2],[-1,58],[-1.3,60.2],[-6.8,62],[-14,63.4],[-20,63.6]]]]}, + {"id":"apollo","name":"Apollo 13 (Houston, We Have Latency)","price":0.95,"age":"mid","blurb":tr('cables.new_york_to_the_cliffs_of'),"pairs":[["nyc","bde",[[-70,40],[-50,43],[-25,48.5],[-8,50.2],[-5,50.8]]]]}, + {"id":"yellow","name":"Yellow Brick Road","price":0.9,"age":"mid","blurb":tr('cables.long_island_to_cornwall_follow_it'),"pairs":[["nyc","bde",[[-71,40.5],[-50,44.5],[-25,49.3],[-8,50.6],[-5,50.9]]]]}, + {"id":"ace","name":"ACE of Spades","price":1.0,"age":"mid","blurb":tr('cables.africa_coast_to_europe_twenty_odd'),"pairs":[["lis","dkr",[[-9.6,37.9],[-12,34],[-8.2,33.9],[-15,28],[-18,21],[-18,14.7]]],["dkr","abj",[[-18,14.7],[-17,10],[-14,5],[-8,4],[-4,4.8]]],["abj","acc",[[-4,4.8],[-0.2,5.1]]],["acc","lag",[[-0.2,5.1],[3.2,5.8]]],["lag","lad",[[3.2,5.8],[6,3],[9,3.6],[8,-2],[11.5,-6],[12.6,-9]]],["lad","cpt",[[12.6,-9],[11.5,-15],[13.5,-22.7],[15,-30],[17.6,-34.4]]],["lis","tci",[[-9.6,37.9],[-12,34],[-15.4,29.5]]],["tci","dkr",[[-17,26],[-18,21],[-18,14.7]]]]}, + {"id":"sat3","name":"SAT-3-Legged Stool","price":1.25,"age":"old","blurb":tr('cables.west_africa_s_first_big_cable'),"pairs":[["lis","dkr",[[-9.6,37.9],[-12,34],[-8.2,33.9],[-15,28],[-18,21],[-18,14.7]]],["dkr","abj",[[-18,14.7],[-17,10],[-14,5],[-8,4],[-4,4.8]]],["abj","acc",[[-4,4.8],[-0.2,5.1]]],["acc","lag",[[-0.2,5.1],[3.2,5.8]]],["lag","dla",[[3.2,5.8],[6,3],[9,3.6]]],["dla","lad",[[9,3.6],[8,-2],[11.5,-6],[12.6,-9]]],["lad","cpt",[[12.6,-9],[11.5,-15],[13.5,-22.7],[15,-30],[17.6,-34.4]]],["lis","tci",[[-9.6,37.9],[-12,34],[-15.4,29.5]]],["tci","dkr",[[-17,26],[-18,21],[-18,14.7]]]]}, + {"id":"mone","name":"MainOne-Track Mind","price":1.0,"age":"mid","blurb":tr('cables.portugal_to_lagos_with_stops_in'),"pairs":[["lis","dkr",[[-9.6,37.9],[-12,34],[-8.2,33.9],[-15,28],[-18,21],[-18,14.7]]],["dkr","abj",[[-18,14.7],[-17,10],[-14,5],[-8,4],[-4,4.8]]],["abj","acc",[[-4,4.8],[-0.2,5.1]]],["acc","lag",[[-0.2,5.1],[3.2,5.8]]]]}, + {"id":"mtwa","name":"Mint Tea West Africa","price":1.05,"age":"new","blurb":tr('cables.casablanca_down_the_coast_to_abidjan'),"pairs":[["cas","dkr",[[-8.2,33.9],[-15,28],[-18,21],[-18,14.7]]],["dkr","abj",[[-18,14.7],[-17,10],[-14,5],[-8,4],[-4,4.8]]]]}, + {"id":"sail","name":"Set SAIL","price":1.0,"age":"new","blurb":tr('cables.straight_across_the_south_atlantic'),"pairs":[["for","dla",[[-37,-2.5],[-20,0],[0,2.5],[9,3.6]]]]}, + {"id":"seacm","name":"Sea-Comedy Hour","price":0.95,"age":"mid","blurb":tr('cables.the_cable_that_brought_east_africa'),"pairs":[["dur","mpm",[[32,-30.3],[34.5,-26]]],["mpm","dar",[[34.5,-26],[38,-20],[41.5,-14],[40.4,-7]]],["dar","mba",[[40.4,-7],[40.6,-4.3]]],["mba","jib",[[40.6,-4.3],[45,2],[51,10.5],[45,12.3],[43.5,11.9]]],["jib","bom",[[43.5,11.9],[51,13],[62,18],[70,19]]]]}, + {"id":"dare","name":"Dare-Devil-1","price":0.9,"age":"new","blurb":tr('cables.djibouti_down_to_durban_hugging_the'),"pairs":[["jib","mba",[[43.5,11.9],[45,12.3],[51,10.5],[45,2],[40.6,-4.3]]],["mba","dar",[[40.6,-4.3],[40.4,-7]]],["dar","mpm",[[40.4,-7],[41.5,-14],[38,-20],[34.5,-26]]],["mpm","dur",[[34.5,-26],[32,-30.3]]]]}, + {"id":"glo1","name":"Glo-in-the-Dark","price":1.05,"age":"mid","blurb":tr('cables.cornwall_to_lagos_down_the_west'),"pairs":[["bde","lag",[[-5.2,50.6],[-11,45],[-15,30],[-19,15],[-12,4],[2,4.5],[3.4,6]]],["acc","lag",[[-0.2,5.1],[3.2,5.8]]]]}, + {"id":"pasdc","name":"Pas de Câble","price":0.6,"age":"new","df":true,"blurb":tr('cables.another_hop_across_the_channel_with'),"pairs":[["lon","par",[[1.3,51.0],[1.7,50.7]]]]}, + {"id":"tampn","name":"Oil Rig Wi-Fi","price":0.9,"age":"mid","blurb":tr('cables.stavanger_to_the_netherlands_via'),"pairs":[["svg","ams",[[5.3,58.6],[4.5,56],[4.2,53.5],[4.6,52.6]]]]}, + {"id":"medusa","name":"Medusa Stare","price":0.85,"age":"new","blurb":tr('cables.lisbon_to_barcelona_and_marseille'),"pairs":[["lis","bcn",[[-9.6,37.9],[-8.9,36.6],[-5.6,35.9],[-2,36.4],[0.5,38.5],[2.6,41.1]]],["bcn","mrs",[[2.8,41.3],[3.8,42.4],[5,43]]],["lis","cas",[[-9.6,37.9],[-12,34],[-8.2,33.9]]],["mrs","alg",[[5,42.8],[4.5,40],[3,37.2]]],["alg","tun",[[3,37.2],[10.6,37.4]]]]}, + {"id":"nuvem","name":"Nuvem-ber Rain","price":0.85,"age":"new","blurb":tr('cables.portugal_to_the_us_southeast_via'),"pairs":[["lis","atn",[[-9.6,37.9],[-30,35],[-64.8,32.3],[-78.9,33.7]]],["atn","bda",[[-78.9,33.7],[-72,33.2]]],["bda","lis",[[-50,34.5],[-30,35],[-9.6,37.9]]]]}, + {"id":"blue","name":"Feeling Blue","price":0.85,"age":"new","blurb":tr('cables.genoa_to_sicily_and_on_to'),"pairs":[["mil","pmo",[[8.9,44.2],[9.4,42.5],[11.2,39.5],[12.9,38.4]]],["pmo","ath",[[13.6,38.3],[15.4,37.2],[19,36.8],[22.6,36.2],[23.6,37.6]]]]}, + {"id":"cannoli","name":"Sicilian Spaghetti Junction","price":0.9,"age":"mid","blurb":tr('cables.palermo_to_marseille_and_alexandria'),"pairs":[["pmo","mrs",[[12.9,38.4],[9.5,40],[7.4,42.6],[5.4,43.1]]],["pmo","cai",[[13.6,37.8],[15.5,35.6],[22,33.4],[29.9,31.4]]]]}, + {"id":"ouzo","name":"Ouzo Express","price":0.9,"age":"new","blurb":tr('cables.athens_to_alexandria_and_up_the'),"pairs":[["ath","cai",[[24,37.5],[25.2,35.5],[28,33],[29.9,31.4]]],["ath","ist",[[24.3,38.5],[25.6,39.9],[26.5,40.3],[28.2,40.8]]]]}, + {"id":"tea","name":"Boston Tea Party Line","price":0.9,"age":"mid","blurb":tr('cables.boston_to_dublin_nobody_has_thrown'),"pairs":[["bos","dub",[[-69.5,42.2],[-60,44],[-40,50],[-15,52.4],[-8,53]]]]}, + {"id":"clementine","name":"Clementine","price":0.6,"age":"new","df":true,"blurb":tr('cables.a_small_sweet_cable_from_broadstairs'),"pairs":[["lon","oos",[[1.44,51.36],[2.92,51.23]]]]}, + {"id":"seaus","name":"SEA-US Later","price":1.0,"age":"mid","blurb":tr('cables.los_angeles_to_hawaii_guam_and'),"pairs":[["lax","hnl",[[-119,33.5],[-140,27],[-157.6,21.6]]],["hnl","gum",[[-158.3,21.2],[-180,18],[-200,15],[-214.6,13.5]]],["gum","mnl",[[144,13.7],[132,13.5],[124.5,13],[121.4,14.3]]],["gum","ror",[[144.5,13.1],[139,9.5],[134.8,7.5]]]]}, + {"id":"aag","name":"Asia-America Gateaux","price":1.25,"age":"old","blurb":tr('cables.california_to_hong_kong_via_hawaii'),"pairs":[["sjc","hnl",[[-122.8,35],[-140,27.5],[-158.2,21.4]]],["hnl","gum",[[-158.4,21.5],[-180,19],[-200,16],[-214.4,13.7]]],["gum","hkg",[[144.5,14],[130,17.5],[121,20],[115,21.6],[114.3,22.2]]]]}, + {"id":"echo","name":"Echo-Chamber","price":0.85,"age":"new","blurb":tr('cables.california_to_singapore_via_guam'),"pairs":[["sjc","gum",[[-125,38],[-150,30],[-180,21],[-214.8,14]]],["gum","sin",[[144.6,13],[133,6],[127,3],[118,2],[108,2],[104.5,1.4]]]]}, + {"id":"hantru","name":"HANTRU-ly Yours","price":1.3,"age":"mid","blurb":tr('cables.guam_to_the_marshall_islands_with'),"pairs":[["gum","maj",[[145,13.3],[158,7],[167,8.5],[171.2,7.2]]]]}, + {"id":"coral","name":"Coral Sea Shanty","price":1.0,"age":"new","blurb":tr('cables.sydney_to_papua_new_guinea_and'),"pairs":[["syd","pom",[[152,-33.5],[154.5,-25],[151,-15],[147.3,-10]]],["syd","hir",[[152,-33.5],[156.5,-25],[160.5,-14],[160,-9.6]]]]}, + {"id":"gond","name":"Gondwanna-Be","price":1.1,"age":"mid","blurb":tr('cables.sydney_to_noumea_wishes_it_were'),"pairs":[["syd","nou",[[152,-33.5],[158,-28],[164,-23.5],[166.2,-22.5]]]]}, + {"id":"tonga","name":"Tonga Twister","price":1.3,"age":"mid","blurb":tr('cables.fiji_to_tonga_the_only_way'),"pairs":[["suv","tbu",[[178.8,-18.5],[181.5,-20],[184.6,-21]]]]}, + {"id":"tui","name":"Tui-Some-More","price":1.1,"age":"new","blurb":tr('cables.fiji_to_samoa_always_room_for'),"pairs":[["suv","apw",[[179,-18],[183,-15.5],[188,-13.95]]]]}, + {"id":"ashc","name":"ASH-tray","price":1.4,"age":"old","blurb":tr('cables.american_samoa_to_hawaii_and_samoa'),"pairs":[["ppg","hnl",[[-170.5,-13.9],[-166,0],[-158.1,20.9]]],["ppg","apw",[[-170.9,-14.1],[-171.6,-13.9]]]]}, + {"id":"hono","name":"Hono-tuna","price":1.2,"age":"mid","blurb":tr('cables.tahiti_to_hawaii_trolling_for'),"pairs":[["ppt","hnl",[[-149.7,-17.2],[-153,0],[-156.5,19.5],[-157.7,21.1]]]]}, + {"id":"mana","name":"Mana-tea","price":1.1,"age":"new","blurb":tr('cables.samoa_to_tahiti_by_way_of'),"pairs":[["apw","ppt",[[-171.5,-14.2],[-165,-18],[-159.8,-21.2],[-152,-18.5],[-149.8,-17.6]]]]}, + {"id":"scxn","name":"Southern Cross-ed Fingers NEXT","price":0.95,"age":"new","blurb":tr('cables.the_old_workhorse_s_younger_sibling'),"pairs":[["lax","suv",[[-119,33],[-140,15],[-165,-5],[-178,-15],[-181.2,-17.3]]],["suv","syd",[[177.8,-18.6],[166,-25],[156,-31.5],[152,-33.9]]]]}, + {"id":"sol","name":"Sol Survivor","price":0.85,"age":"new","blurb":tr('cables.florida_to_northern_spain_via'),"pairs":[["mia","bda",[[-80,27],[-80.9,29.6],[-74,31.5]]],["bda","pdl",[[-50,35.5],[-35,37.5]]],["pdl","mad",[[-15,41.5],[-6,44],[-3.8,43.6]]]]}, + {"id":"atl2","name":"Atlantis-2: The Sequel","price":1.4,"age":"old","blurb":tr('cables.argentina_to_portugal_via_brazil'),"pairs":[["bue","for",[[-56.5,-36.6],[-50,-32],[-42,-23.5],[-37,-12],[-34.5,-6]]],["for","rai",[[-36,-1.5],[-28,8],[-24,14]]],["rai","dkr",[[-20,14.7]]],["dkr","tci",[[-18,17],[-17.5,24],[-16.6,27.9]]],["tci","lis",[[-15.5,31],[-11,36.5],[-9.2,38.3]]]]}, + {"id":"canl","name":"Canary in the Cable Mine","price":0.8,"age":"mid","blurb":tr('cables.tenerife_to_the_spanish_mainland_as'),"pairs":[["tci","mad",[[-14.5,30.5],[-9,35],[-6.1,36.3]]]]}, +]; +const CAB=Object.fromEntries(CABLES.map(c=>[c.id,c])); +const CABLE_PAIRS=CABLES.flatMap(c=>c.pairs.map(([a,b,mid])=>{const A=CITY[a],B=CITY[b];const near=(x,ref)=>x+W*Math.round((ref-x)/W); + const mp=mid.map(q=>proj(q[0],q[1]));const pts=[[near(A.x,mp[0][0]),A.y]].concat(mp,[[near(B.x,mp[mp.length-1][0]),B.y]]); + const ll=[[A.lon,A.lat]].concat(mid,[[B.lon,B.lat]]);let L=0;for(let i=1;iS.day&&[a,b].includes(S.ev.landban.city);if(ban)return [];const rl=S&&S.scn&&S.scn.rules,bp=rl&&rl.banPairs,bc=rl&&rl.banCities;return bp||bc?cablesFor(a,b).filter(c=>!(bp&&(bp.includes(c.cid+':'+c.a+'-'+c.b)||bp.includes(c.cid+':'+c.b+'-'+c.a)))&&!(bc&&(bc.includes(c.a)||bc.includes(c.b)))):cablesFor(a,b);} +function cablesFor(a,b){return CABLE_PAIRS.filter(c=>(c.a===a&&c.b===b)||(c.a===b&&c.b===a));} +function cablePair(cid,a,b){const c=CABLE_PAIRS.find(x=>x.cid===cid&&((x.a===a&&x.b===b)||(x.a===b&&x.b===a)));if(!c)return null;return c.a===a?c:{...c,pts:c.pts.slice().reverse()};} +const ALLC=CITIES.filter(c=>!c.cn&&!c.ru&&!c.ixOnly).map(c=>c.id); +/* City density: a small city (P under 60) does not sit within 300 km of a bigger city in the same country, unless it + is a cable landing or a capital (tests/regions.test.js enforces it). Cities retired by that rule are marked off: + they stay in the data so old saves keep their POPs there, but new games never see them. */ +const cityOn=id=>{const c=CITY[id];return !!c&&(!c.off||!!(S&&(S.pops[id]||S.ixp[id]!==undefined)));}; +const OFFC=ALLC.filter(c=>!CITY[c].off); +const ruCity=c=>!!CITY[c].ru; +const cnCity=c=>!!CITY[c].cn; +const BIGC=['man','edi','bcn','mil','rom','lis','ath','atn','den','phx','bos','hou','ruh','jed','doh','kyv','mel','bne','osa','kul','bkk','sgn','khi','dac','waw','prg','vie','bud','buh','ist','rio','bue','scl','bog','lim','del','maa','blr','hyd','tpe','cpt','auh','ber','zrh','nbo','cai','jkt','mnl','per','akl','dub','lax','tor','mex','dxb','cph','icn','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mrs','mad','sto','bom','sin','hkg','tok','syd','jnb','lag']; +const MIDC=['man','bcn','mil','lis','atn','den','phx','bos','hou','mel','osa','kul','bkk','waw','vie','ist','rio','bue','scl','bog','del','maa','blr','tpe','auh','ber','zrh','jkt','mnl','dub','lax','tor','dxb','icn','sjc','ash','nyc','chi','dal','mia','lon','ams','fra','par','mad','sin','hkg','tok','syd','bom','sao']; + diff --git a/src/game/30-networks/10-networks.js b/src/game/30-networks/10-networks.js new file mode 100644 index 0000000..542cdeb --- /dev/null +++ b/src/game/30-networks/10-networks.js @@ -0,0 +1,110 @@ +/* ================= NETWORKS ================= */ +const NETS=[ + {id:'lvl',name:'Level Tree',asn:3535,type:'t1',pol:'restrictive',share:.07,price:9,col:'#7B61FF',pops:['syd','hfx','bda','hnl','bde','man','edi','svg','mil','rom','lis','ath','atn','den','phx','bos','hou','slc','ber','zrh','dub','cph','osl','tor','lax','mex','mtl','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','rio','bue','scl','bog','lim','pan','waw','prg','vie','bud','buh','ist','kcy','cal','van','ott','bru','bet','ham','muc','cpq','gdl','mty','qro'],ix:[],blurb:tr('networks.grew_from_a_seedling_into_a')}, + {id:'ntt',name:'Not That Telecom',asn:2941,type:'t1',pol:'restrictive',share:.06,price:8,col:'#4B3FC4',pops:['hnl','gum','man','mil','atn','den','bos','hou','phx','jkt','mnl','lax','dxb','icn','sea','sjc','dal','ash','nyc','lon','ams','fra','sin','hkg','tok','syd','tpe','del','maa','blr','hyd','osa','kul','bkk','sgn','kcy','dus'],ix:[],blurb:tr('networks.huge_in_asia_which_telecom_not')}, + {id:'tly',name:'Tell-Ya Carrier',asn:1229,type:'t1',pol:'restrictive',share:.05,price:8,col:'#9D4EDD',pops:['pdl','tci','svg','edi','man','mil','rom','pmo','ath','ber','osl','cph','hel','beg','sof','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','mrs','hkg','sin','tpe','tll','waw','vie','bud','buh','prg','kyv','van','bru','ham','muc','dus'],ix:[],blurb:tr('networks.nordic_backbone_that_tells_you')}, + {id:'cog',name:'Cogentle',asn:714,type:'t1',pol:'restrictive',share:.04,price:3,col:'#B35CF0',pops:['hfx','bde','man','edi','bcn','mil','rom','lis','ath','atn','den','phx','bos','hou','slc','ber','zrh','dub','hel','sof','beg','tor','lax','mex','cph','icn','sea','sjc','dal','chi','ash','nyc','mia','sao','lon','ams','fra','par','mad','mrs','sto','sin','hkg','tok','rio','bue','scl','bog','lim','osa','waw','prg','vie','bud','buh','ist','kyv','kcy','van','ott','bru','oos','bet','ham','muc','dus','syd','per'],ix:[],blurb:tr('networks.cheapest_transit_on_the_map_famously')}, + {id:'tat',name:'Ta-Ta Comms',asn:6543,type:'t1',pol:'restrictive',share:.04,price:9,col:'#6A4C93',pops:['tci','gum','mil','pmo','lis','nbo','cai','jkt','dxb','nyc','ash','lon','fra','mrs','lag','jnb','bom','sin','hkg','tok','del','maa','blr','hyd','cpt','fuj','auh','tpe','khi','dac','cbo','kul','bkk','jed','ruh','doh','jib','dar','mba','dkr'],ix:[],blurb:tr('networks.waves_goodbye_to_latency_across_the')}, + {id:'drz',name:'Drizzle Electric',asn:9369,type:'t2',pol:'open',share:.04,price:4,col:'#1E90FF',auIx:['syd','mel','bne','per'],pops:['man','chc','edi','svg','bde','bcn','mil','rom','pmo','lis','ath','atn','den','phx','bos','hou','slc','ber','zrh','nbo','akl','per','jkt','mnl','dub','rek','tor','mtl','lax','mex','sof','osl','icn','sea','sjc','dal','chi','ash','nyc','mia','lon','ams','fra','par','sto','mad','hkg','sin','tok','syd','jnb','for','rio','bue','scl','lim','bog','pan','del','maa','blr','hyd','tpe','auh','cpt','mel','bne','osa','kul','bkk','sgn','khi','dac','cbo','waw','prg','vie','bud','buh','tll','ist','kyv','jed','ruh','doh','kcy','cal','van','ott','bru','oos','bet','ham','muc','ccs','lpb','alg','tun','cas','dkr','dus'],ix:'ALL',blurb:tr('networks.will_peer_with_anyone_anywhere')}, + {id:'tng',name:'Tangerine Telecom',asn:5115,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:6,col:'#FF8C42',pops:['tci','bcn','cai','nbo','dxb','par','mrs','mad','lon','ams','lag','jnb','waw','buh','dkr','abj','cas','tun','dla','fih'],ix:['bcn','par','mrs','mad','lon','ams','lag','jnb','waw','dkr','abj','cas','tun','dla','fih'],blurb:tr('networks.juicy_reach_into_europe_and_africa')}, + {id:'sgt',name:'SingTell',asn:7474,type:'t2',pol:'selective',minIx:15,minPni:40,share:.03,price:7,col:'#00A6A6',pops:['jkt','mnl','per','akl','icn','sin','hkg','tok','syd','bom','tpe','maa','kul','bkk','sgn','mel','bne'],ix:['sin','hkg','tok','bom','tpe','maa','kul','bkk'],blurb:tr('networks.sings_your_packets_across_asia')}, + {id:'vdp',name:'Voda-Phony',asn:1373,type:'t2',pol:'paid',freeLv:7,paidFee:8000,share:.03,price:6,col:'#E63946',pops:['man','edi','mil','rom','lis','ath','nbo','cai','ber','dub','dxb','lon','fra','ams','mad','mrs','jnb','bom','lag','cpt','del','maa','ist','prg','bud','buh','doh','acc','dar','fih','mpm','dus'],ix:[],blurb:tr('networks.ended_free_peering_across_europe_and')}, + {id:'ctc',name:'China Telecomet',asn:4314,type:'t2',pol:'restrictive',share:.02,price:22,premium:2.5,cn:true,col:'#0B5CAD',pops:['pek','sha','hkg','sin','tok','lon','fra','nyc','sjc'],ix:[],blurb:tr('networks.the_biggest_network_in_china_its')}, + {id:'cun',name:'China Unicorn',asn:4837,type:'t2',pol:'restrictive',share:.015,price:16,cn:true,col:'#D7000F',pops:['pek','sha','hkg','fra','sjc','lon'],ix:[],blurb:tr('networks.number_two_in_china_with_a')}, + {id:'cmb',name:'China Moble',asn:9880,type:'eye',pol:'paid',freeLv:10,paidFee:12000,share:.01,cn:true,col:'#0085CA',pops:['pek','sha','hkg'],ix:[],blurb:tr('networks.the_largest_mobile_network_on_earth')}, + {id:'cmc',name:'Comecast',asn:7227,type:'eye',pol:'selective',minIx:10,minPni:30,share:.03,col:'#2C7A7B',pops:['atn','den','bos','hou','phx','slc','ash','nyc','chi','sjc','sea','mia'],ix:['atn','den','bos','ash','nyc','chi','sjc','sea'],blurb:tr('networks.huge_eyeball_network_come_for_the')}, + {id:'dtk',name:'Doitsche Telekomm',asn:3203,type:'eye',pol:'paid',freeLv:6,paidFee:9000,share:.03,col:'#E20074',pops:['fra','ams','lon','ham','muc','dus'],ix:[],blurb:tr('networks.pink_eyeball_giant_peering_is')}, + {id:'nfx',name:'NetChill',asn:2906,type:'cdn',pol:'selective',minIx:5,minPni:30,share:.15,cache:{name:'Open Couch',min:12},col:'#C8102E',auIx:['syd','mel'],pops:ALLC,ix:'ALL',blurb:tr('networks.streams_40_of_evening_traffic_hands')}, + {id:'ggl',name:'Goggle',asn:15961,type:'cdn',pol:'selective',minIx:5,minPni:30,share:.13,cache:{name:'Goggle Global Cache',min:15},col:'#3A7BEA',auIx:['syd','mel'],pops:ALLC,ix:'ALL',blurb:tr('networks.search_video_and_goggles_mostly')}, + {id:'fbk',name:'Faceplant',asn:32943,type:'cdn',pol:'selective',minIx:5,minPni:25,share:.08,cache:{name:'Faceplant Node Thingy',min:10},col:'#3B5BDB',auIx:['syd','mel'],pops:BIGC,ix:'ALL',blurb:tr('networks.social_media_everyone_keeps_falling')}, + {id:'akm',name:'Akamaybe',asn:20490,type:'cdn',pol:'open',share:.07,cache:{name:'Akamaybe Box',min:6},col:'#0099CC',auIx:['syd','mel','bne','per','adl'],pops:ALLC,ix:'ALL',blurb:tr('networks.the_original_cdn_maybe_it_is')}, + {id:'cfl',name:'Crowdflare',asn:13353,type:'cdn',pol:'open',share:.05,cache:{name:'Rackstar',min:10},col:'#F48120',auIx:['syd','mel','bne','per','adl','cbr','hba'],pops:BIGC.concat(['hnl','gum','nou','ppt','dus']),ix:'ALL',blurb:tr('networks.shields_half_the_web_from_crowds')}, + {id:'amz',name:"Amazin' Web Services",asn:16590,type:'cdn',pol:'selective',minIx:8,minPni:30,share:.05,col:'#FF9900',auIx:['syd','mel','bne','per'],pops:MIDC.concat(['dus']),ix:'ALL',blurb:tr('networks.the_cloud_it_s_just_someone')}, + {id:'msf',name:'Microsnoft',asn:8705,type:'cdn',pol:'selective',minIx:5,minPni:25,share:.04,col:'#00A4EF',auIx:['syd','mel','bne','per'],pops:MIDC.concat(['dus']),ix:'ALL',blurb:tr('networks.updates_so_many_updates')}, + {id:'bdc',name:'BiteDance',asn:39669,type:'cdn',pol:'open',share:.03,col:'#111111',auIx:[],pops:MIDC.concat(['pek','sha','dus']),ix:'ALL',blurb:tr('networks.short_videos_very_long_traffic')}, + {id:'slw',name:'Slowly',asn:54311,type:'cdn',pol:'open',share:.02,col:'#E5383B',auIx:['syd','mel','bne','per','adl'],pops:MIDC,ix:'ALL',blurb:tr('networks.an_edge_cloud_that_is_despite')}, +]; +NETS.push( + {id:'tcs',name:'TenCents',asn:45900,type:'cdn',pol:'selective',minIx:5,minPni:20,share:.02,cn:true,col:'#1AAD19',pops:['pek','sha','hkg','sin','tok','fra','sjc'],ix:['hkg','sin','tok','fra','sjc'],blurb:tr('networks.chat_games_and_payments_every')}, + {id:'abc',name:'AliBubble Cloud',asn:37936,type:'cdn',pol:'selective',minIx:5,minPni:20,share:.015,cn:true,col:'#FF6A00',pops:['pek','sha','hkg','sin','tok','fra','sjc','syd'],ix:['hkg','sin','tok','fra','sjc'],blurb:tr('networks.shopping_festivals_that_melt_traffic')}, + {id:'byd',name:'Bye-du',asn:38635,type:'cdn',pol:'selective',minIx:5,minPni:20,share:.01,cn:true,col:'#2932E1',pops:['pek','sha','hkg'],ix:['hkg'],blurb:tr('networks.search_maps_and_a_cheerful_goodbye')}); +NETS.push( + {id:'rtc',name:'Rostelecomedy',asn:12389,type:'t2',pol:'selective',minIx:20,minPni:40,share:.01,price:6,col:'#7700FF',pops:['mos','hel','sto','fra','ams'],ix:['mos','fra','ams'],blurb:tr('networks.the_national_carrier_every_punchline')}, + {id:'ydx',name:'Yawndex',asn:13238,type:'cdn',pol:'open',share:.008,col:'#FC3F1D',pops:['mos','hel','fra','ams'],ix:['mos','hel','fra','ams'],blurb:tr('networks.search_taxis_and_maps_slightly')}, + {id:'vkl',name:'VKontakt-lens',asn:47541,type:'cdn',pol:'open',share:.006,col:'#0077FF',pops:['mos','hel'],ix:['mos','hel'],blurb:tr('networks.social_network_with_perfect_vision')}, + {id:'ets',name:'Etis-a-lot',asn:5384,type:'eye',pol:'paid',freeLv:9,paidFee:8000,share:.006,col:'#719E19',pops:['dxb','mrs','lon','fra','sin','auh','fuj','doh'],ix:[],blurb:tr('networks.charges_a_lot_paid_peering_only')}, + {id:'tmx',name:'Tel-Mess',asn:8151,type:'eye',pol:'paid',freeLv:8,paidFee:7000,share:.008,col:'#00A0DF',pops:['mex','dal','lax','mia','qro','mty','gdl'],ix:[],blurb:tr('networks.mexico_s_giant_paid_peering_only')}, + {id:'bcd',name:'Bell Canad-eh',asn:577,type:'eye',pol:'selective',minIx:10,minPni:30,share:.01,col:'#00549A',pops:['hfx','tor','mtl','nyc','chi','ott','cal','van'],ix:['tor','mtl','ott'],blurb:tr('networks.polite_enormous_and_sorry_about_the')}); +NETS.push( + {id:'tsf',name:'Telkom-selfie',asn:7713,type:'eye',pol:'selective',minIx:10,minPni:30,share:.01,col:'#E4002B',pops:['jkt','sin'],ix:['jkt','sin'],blurb:tr('networks.indonesia_s_mobile_giant_every')}, + {id:'pld',name:'PLDTea Time',asn:9299,type:'eye',pol:'selective',minIx:10,minPni:30,share:.008,col:'#D62027',pops:['mnl','hkg','sin'],ix:['hkg'],blurb:tr('networks.philippine_giant_peering_requests')}, + {id:'spk',name:'Spark-le',asn:4771,type:'eye',pol:'open',share:.005,col:'#6A2C91',pops:['akl','syd','chc','ivc'],ix:['akl','syd','chc'],blurb:tr('networks.new_zealand_s_shiniest_isp')}, + {id:'tsy',name:'Telstraya',asn:1221,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:9,col:'#0099F8',pops:['hnl','gum','suv','pom','nou','hir','syd','per','sin','hkg','lax','tpe','mel','bne','drw','adl','cbr','hba'],ix:['gum','sin','hkg'],blurb:tr('networks.australia_s_big_one_g_day')}); +NETS.push( + {id:'liq',name:'Liquid Lunch Networks',asn:30846,type:'t2',pol:'open',up:['tat','tly'],share:.006,price:6,col:'#00A0DF',pops:['jnb','cpt','dur','hre','lun','gbe','mpm','dar','nbo','mba','kla','kgl','fih','add','jib','cai','wdh'],ix:['jnb','cpt','dur','hre','lun','gbe','mpm','dar','nbo','mba','kla','kgl','fih','add','jib','cai','wdh'],blurb:tr('networks.cape_to_cairo_fiber_across_a')}, + {id:'scm',name:'Sea-Comedy Networks',asn:37102,type:'t2',pol:'open',up:['ntt','tat'],share:.005,price:5,col:'#1C3F94',pops:['jnb','cpt','dur','mpm','dar','mba','nbo','kla','kgl','jib','cai','mrs','bom','lon'],ix:['jnb','cpt','dur','mpm','dar','mba','nbo','kla','jib','mrs'],blurb:tr('networks.owns_the_cable_that_brought_east')}, + {id:'agc',name:'Angle-a Cables',asn:37470,type:'t2',pol:'open',up:['tly','cog'],share:.004,price:5,col:'#E30613',pops:['lad','fih','for','sao','mia','lon'],ix:['lad','for','sao','mia'],blurb:tr('networks.owns_the_cables_from_luanda_to')}, + {id:'djt',name:'Djibouti Calling',asn:30992,type:'t2',pol:'selective',up:['tat','tly'],minIx:3,minPni:15,share:.003,price:8,col:'#0D7F3F',pops:['jib','add','mrs','bom','jed'],ix:['jib'],blurb:tr('networks.a_tiny_telco_in_a_country')}, + {id:'mtx',name:'Empty-N',asn:29977,type:'eye',pol:'selective',up:['tat','lvl'],minIx:5,minPni:20,share:.008,col:'#FFCB05',pops:['lag','acc','abj','dla','kla','kgl','jnb','cpt','dur','lun','gbe','lad'],ix:['lag','acc','abj','dla','kla','kgl','jnb','cpt','dur','lun','gbe','lad'],blurb:tr('networks.africa_s_mobile_giant_in_a')}, + {id:'art',name:'Air-Tell Africa',asn:36928,type:'eye',pol:'selective',up:['tat','tly'],minIx:4,minPni:18,share:.006,col:'#ED1C24',pops:['lag','kla','kgl','dar','lun','fih','nbo'],ix:['lag','kla','kgl','dar','lun','fih','nbo'],blurb:tr('networks.mobile_money_and_prepaid_data_in')}, + {id:'eth',name:'Ethio-Tele-Calm',asn:24759,type:'eye',pol:'selective',up:['tat'],minIx:2,minPni:12,share:.005,col:'#8DC63F',pops:['add'],ix:['add'],blurb:tr('networks.ethiopia_s_state_telco_a_hundred')}, + {id:'mrc',name:'Atlas Shrugged Telecom',asn:36905,type:'eye',pol:'selective',up:['lvl','tly'],minIx:3,minPni:15,share:.004,col:'#F28C00',pops:['cas','abj','dkr'],ix:['cas'],blurb:tr('networks.morocco_s_incumbent_with_sister')}, + {id:'sfc',name:'Safari-Comic',asn:33771,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#4CB848',pops:['nbo','mba','add'],ix:['nbo','mba','add'],blurb:tr('networks.kenya_s_mobile_giant_pays_you')}, + {id:'teg',name:'Tele-Comet Egypt',asn:8452,type:'t2',pol:'selective',minIx:15,minPni:40,share:.006,price:8,col:'#5B2D8E',pops:['cai','mrs','fra','lon'],ix:['cai','mrs'],blurb:tr('networks.owns_the_land_crossing_every_red')}); +NETS.push( + {id:'clr',name:'Clarovision',asn:28537,type:'t2',pol:'selective',minIx:10,minPni:30,share:.012,price:5,col:'#DA291C',pops:['sao','rio','for','bsb','bhz','cwb','poa','aju','bel','bvb','cac','cpv','cpq','cgr','cau','cgb','cxj','fec','fln','igu','gyn','jpa','ljd','ldb','mcp','mcz','mao','mgf','nat','pmw','pvh','rao','rec','rbr','ssa','ria','sjp','slz','the','vix','mvd','asu','cor','uio','mde','gua','sjo','qro','mty','gdl','bue','scl','lim','bog','pan','mex','mia'],ix:['sao','rio','for','bsb','bhz','cwb','poa','aju','bel','bvb','cac','cpv','cpq','cgr','cau','cgb','cxj','fec','fln','igu','gyn','jpa','ljd','ldb','mcp','mcz','mao','mgf','nat','pmw','pvh','rao','rec','rbr','ssa','ria','sjp','slz','the','vix','mvd','asu','cor','uio','mde','gua','sjo','qro','mty','gdl','bue','scl','lim','bog'],blurb:tr('networks.the_big_regional_carrier_sees')}, + {id:'viv',name:'Viva Vivo',asn:26959,type:'eye',pol:'selective',minIx:8,minPni:25,share:.01,col:'#660099',pops:['sao','rio','for','bsb','bhz','cwb','poa','aju','bel','bvb','cac','cpv','cpq','cgr','cau','cgb','cxj','fec','fln','igu','gyn','jpa','ljd','ldb','mcp','mcz','mao','mgf','nat','pmw','pvh','rao','rec','rbr','ssa','ria','sjp','slz','the','vix'],ix:['sao','rio','for','bsb','bhz','cwb','poa','aju','bel','bvb','cac','cpv','cpq','cgr','cau','cgb','cxj','fec','fln','igu','gyn','jpa','ljd','ldb','mcp','mcz','mao','mgf','nat','pmw','pvh','rao','rec','rbr','ssa','ria','sjp','slz','the','vix'],blurb:tr('networks.brazil_s_mobile_giant_very_much')}, + {id:'oio',name:'Oi Oi',asn:7739,type:'eye',pol:'selective',up:['lvl','tly'],minIx:6,minPni:20,share:.008,col:'#FFD000',pops:['sao','rio','for','bsb','bhz','cwb','poa','aju','bel','bvb','cac','cpv','cpq','cgr','cau','cgb','cxj','fec','fln','igu','gyn','jpa','ljd','ldb','mcp','mcz','mao','mgf','nat','pmw','pvh','rao','rec','rbr','ssa','ria','sjp','slz','the','vix'],ix:['sao','rio','for','bsb','bhz','cwb','poa','aju','bel','bvb','cac','cpv','cpq','cgr','cau','cgb','cxj','fec','fln','igu','gyn','jpa','ljd','ldb','mcp','mcz','mao','mgf','nat','pmw','pvh','rao','rec','rbr','ssa','ria','sjp','slz','the','vix'],blurb:tr('networks.says_oi_to_every_home_in')}, + {id:'tmt',name:'TIM-TIM Mobile',asn:26616,type:'eye',pol:'selective',up:['skl'],minIx:6,minPni:20,share:.007,col:'#004691',pops:['sao','rio','bsb','bhz','cwb','poa','cpq','rec','ssa','for','gyn','bel','mao','vix','fln'],ix:['sao','rio','bsb','bhz','cwb','poa','cpq','rec','ssa','for','gyn','bel','mao','vix','fln'],blurb:tr('networks.a_mobile_network_named_after_the')}, + {id:'bsn',name:'Brisanada',asn:28127,type:'eye',pol:'open',up:['lvl'],share:.004,col:'#F7941D',pops:['for','nat','jpa','cpv','rec','cau','mcz','aju','ssa','fec','the','slz'],ix:['for','nat','jpa','cpv','rec','cau','mcz','aju','ssa','fec','the','slz'],blurb:tr('networks.fiber_across_the_sertao_of_the')}, + {id:'mvs',name:'Moviestar',asn:12957,type:'t2',pol:'selective',up:['tly','lvl'],minIx:8,minPni:25,share:.008,price:6,col:'#019DF4',pops:['mex','gua','bog','mde','uio','lim','lpb','scl','bue','cor','mvd','ccs','sao','mia'],ix:['mex','bog','lim','scl','bue','mvd','ccs','sao'],blurb:tr('networks.a_spanish_carrier_starring_in_every')}, + {id:'llt',name:'Liberty Latte America',asn:23521,type:'t2',pol:'open',up:['lvl','cog'],share:.005,price:5,col:'#6C2C91',pops:['mia','pan','sjo','gua','bog','mde','ccs'],ix:['pan','sjo','gua','bog'],blurb:tr('networks.cables_all_around_the_caribbean')}, + {id:'ant',name:'Antelope',asn:6058,type:'eye',pol:'selective',up:['skl','tly'],minIx:3,minPni:15,share:.004,col:'#0072BC',pops:['mvd'],ix:['mvd'],blurb:tr('networks.uruguay_s_state_telco_fast')}, + {id:'tgo',name:'Tiger Mobile',asn:27743,type:'eye',pol:'selective',up:['lvl'],minIx:4,minPni:15,share:.005,col:'#00377B',pops:['asu','lpb','gua','sjo','pan','bog','mde'],ix:['asu','lpb','gua','sjo','bog'],blurb:tr('networks.prepaid_mobile_from_paraguay_to')}, + {id:'mlv',name:'Mercado Livre-ly',asn:52850,type:'cdn',pol:'open',share:.006,col:'#FFE600',pops:['sao','rio','bue','scl','bog','lim','mia'],ix:['sao','rio','bue','scl','bog','lim'],blurb:tr('networks.ships_parcels_and_packets_both')}, + {id:'jio',name:'Jio-graphy',asn:55863,type:'eye',pol:'selective',minIx:10,minPni:30,share:.02,col:'#0F3CC9',pops:['bom','del','maa','blr','hyd'],ix:['bom','del','maa','blr','hyd'],blurb:tr('networks.gave_a_billion_people_cheap_data')}, + {id:'atl',name:'Airtel-tale',asn:9849,type:'t2',pol:'selective',minIx:15,minPni:40,share:.01,price:7,col:'#E40000',pops:['bom','del','maa','blr','hyd','sin','lon','dxb','dac','cbo'],ix:['bom','del','maa','blr'],blurb:tr('networks.india_s_other_giant_every_outage')}, + {id:'cht',name:'Chunghwa Tele-calm',asn:3426,type:'t2',pol:'selective',minIx:10,minPni:30,share:.008,price:7,col:'#00A0E9',pops:['tpe','hkg','tok','lax','sin'],ix:['tpe','hkg'],blurb:tr('networks.taiwan_s_incumbent_stays_calm_while')}, + {id:'duu',name:'Du-opoly',asn:15820,type:'eye',pol:'paid',freeLv:11,paidFee:6000,share:.004,col:'#00A9CE',pops:['dxb','auh','fuj'],ix:[],blurb:tr('networks.the_other_half_of_the_uae')}); +NETS.push( + {id:'kdi',name:'KD-DIY',asn:2561,type:'t2',pol:'selective',minIx:10,minPni:30,share:.008,price:6,col:'#E85D04',pops:['tok','osa','lax','sin','hkg'],ix:['tok','osa'],blurb:tr('networks.japanese_carrier_that_builds')}, + {id:'opt',name:'Floptus',asn:4804,type:'eye',pol:'selective',minIx:8,minPni:25,share:.006,col:'#00837E',pops:['syd','mel','bne','per'],ix:[],blurb:tr('networks.australia_s_number_two_once_took')}, + {id:'tpr',name:'Toilet Paper Group',asn:7545,type:'eye',pol:'selective',minIx:8,minPni:25,share:.0035,col:'#4E2A84',pops:['syd','mel','bne','per','adl','cbr'],ix:[],blurb:tr('networks.stockpiled_bandwidth_in_2020_and')}, + {id:'abb',name:'Aussie Boyband',asn:4764,type:'eye',pol:'open',share:.002,col:'#00B140',pops:['syd','mel','bne','per','adl','cbr','drw','hba'],ix:['syd','mel','bne','per','adl','drw'],blurb:tr('networks.matching_outfits_perfect_harmonies')}, + {id:'voc',name:'Hocus Pocus',asn:4826,type:'t2',pol:'open',up:['ntt','tly'],share:.002,price:7,col:'#E4002B',pops:['syd','mel','bne','per','adl','cbr','drw','hba','sin'],ix:['syd','mel','bne','per','adl','hba','drw','sin'],blurb:tr('networks.now_you_see_the_fibre_now')}, + {id:'ddo',name:'Doodoo',asn:9443,type:'eye',pol:'open',up:['voc'],share:.0011,col:'#FFC20E',pops:['syd','mel','bne','per','adl'],ix:[],blurb:tr('networks.the_cheapest_plan_in_the_country')}, + {id:'stb',name:'Musklink',asn:14593,type:'eye',pol:'selective',minIx:3,minPni:10,share:.001,col:'#1B1F24',pops:['syd','mel','bne','per','drw'],ix:['mel','bne','per','drw'],blurb:tr('networks.beams_the_outback_online_from_550')}, + {id:'spl',name:'Speedyloop',asn:38195,type:'t2',pol:'open',up:['tly'],share:.001,price:6,col:'#FF5F00',pops:['syd','mel','bne','per','adl','sin','hkg','cbr','drw'],ix:['mel','bne','per','adl','hba','drw','sin','hkg'],blurb:tr('networks.speedy_by_name_owns_a_slice')}, + {id:'blg',name:'Beshort',asn:135887,type:'eye',pol:'selective',minIx:8,minPni:25,up:['tsy'],share:.0005,col:'#FF5A00',pops:['syd','mel','bne'],ix:[],blurb:tr('networks.telstraya_s_budget_brand_cheaper')}, + {id:'spn',name:'Spin2wintel',asn:18390,type:'eye',pol:'open',up:['voc'],share:.00015,col:'#0072CE',pops:['syd','mel','bne','per','adl'],ix:['syd','mel','bne','per','adl'],blurb:tr('networks.cheap_broadband_with_the_sales_pitch')}, + {id:'lpt',name:'Frogtel',asn:134090,type:'eye',pol:'open',share:.0001,col:'#7AC143',pops:['syd','mel','bne','adl','per','drw'],ix:['syd','mel','bne','per','adl'],blurb:tr('networks.small_fast_and_always_leaping_to')}, + {id:'ext',name:'Lintel',asn:10143,type:'eye',pol:'open',up:['spl'],share:.0001,col:'#F26522',pops:['syd','mel','bne','per','adl'],ix:[],blurb:tr('networks.bought_by_speedyloop_and_still')}, + {id:'tru',name:'Mostly-True Move',asn:7740,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#E4002B',pops:['bkk'],ix:['bkk'],blurb:tr('networks.thailand_s_mobile_giant_its_coverage')}, + {id:'vtl',name:'Viet-tell',asn:7525,type:'t2',pol:'selective',minIx:10,minPni:30,share:.005,price:7,col:'#EE0033',pops:['sgn','hkg','sin'],ix:['sgn'],blurb:tr('networks.vietnam_s_giant_will_tell_you')}, + {id:'ptc',name:'PTC-hell',asn:17577,type:'t2',pol:'selective',minIx:10,minPni:30,share:.004,price:8,col:'#00843D',pops:['khi','dxb'],ix:['khi'],blurb:tr('networks.pakistan_s_incumbent_every_session')}, + {id:'tmy',name:'Telekom Ma-lazy-sia',asn:4877,type:'t2',pol:'selective',minIx:10,minPni:30,share:.004,price:6,col:'#1F2A6B',pops:['kul','sin'],ix:['kul'],blurb:tr('networks.malaysia_s_incumbent_in_no_hurry')}, + {id:'ttk',name:'Türk Tele-komik',asn:9211,type:'t2',pol:'selective',minIx:10,minPni:30,share:.008,price:6,col:'#1D3F8F',pops:['ath','ist','fra','sof','lon'],ix:['ist'],blurb:tr('networks.bridges_europe_and_asia_and')}, + {id:'dgi',name:'Digi-tally Cheap',asn:8798,type:'eye',pol:'open',share:.006,col:'#2A5CAA',pops:['buh','bud','mad'],ix:['buh','bud','mad'],blurb:tr('networks.gigabit_to_every_flat_for_the')}, + {id:'ups',name:'UPC-You-Later',asn:6380,type:'eye',pol:'selective',minIx:8,minPni:25,share:.006,col:'#D8001B',pops:['waw','prg','vie','bud','zrh','kyv'],ix:['waw','prg','vie','kyv'],blurb:tr('networks.cable_broadband_across_central')}); +NETS.push( + {id:'tlu',name:'Tell Us',asn:852,type:'eye',pol:'selective',minIx:10,minPni:30,share:.008,up:['lvl','tly'],col:'#4B286D',pops:['van','cal','tor','mtl','ott','sea'],ix:['van','cal','tor'],blurb:tr('networks.western_canada_s_incumbent_tell_us')}, + {id:'rgc',name:'Bodgers Communications',asn:812,type:'eye',pol:'selective',minIx:10,minPni:30,share:.01,up:['cog','ntt'],col:'#DA291C',pops:['tor','ott','mtl','van','cal'],ix:['tor','ott','van'],blurb:tr('networks.canada_s_cable_giant_held_together')}); +NETS.push( + {id:'tny',name:'Telenyet',asn:6848,type:'eye',pol:'selective',minIx:10,minPni:30,share:.008,up:['lvl'],col:'#FFC421',pops:['bru','oos','ams','fra','lon'],ix:['bru'],blurb:tr('networks.half_of_the_flanders_duopoly_on')}, + {id:'pxm',name:'Proxyminus',asn:5432,type:'eye',pol:'selective',minIx:15,minPni:40,share:.008,up:['bgs','lvl'],col:'#5C2D91',pops:['bru','oos','ams'],ix:['bru'],blurb:tr('networks.the_other_half_of_the_duopoly')}, + {id:'bgs',name:'B.I.G.S.',asn:6774,type:'t2',pol:'selective',minIx:10,minPni:30,share:.005,price:5,up:['lvl'],col:'#7B2D8E',pops:['bru','bet','ams','fra','lon','par','mrs','nyc','sin'],ix:['bru','bet','ams','fra','lon','par'],blurb:tr('networks.proxyminus_s_wholesale_arm_present')}, + {id:'cit',name:'Citrus Belgium',asn:47377,type:'eye',pol:'selective',minIx:10,minPni:30,share:.005,up:['lvl'],col:'#FF7900',pops:['bru','par'],ix:['bru'],blurb:tr('networks.tangerine_s_belgian_daughter_mobile')}, + {id:'pst',name:'Poste Restante',asn:6663,type:'eye',pol:'selective',minIx:4,minPni:15,share:.001,up:['lvl','tly'],col:'#FFCC00',pops:['bet','fra','ams'],ix:['bet','fra'],blurb:tr('networks.luxembourg_s_post_office_which_also')}, + {id:'cms',name:'CityMess',asn:199095,type:'eye',pol:'open',share:.002,up:['cog'],col:'#00B2A9',pops:['oos','bru'],ix:['bru'],blurb:tr('networks.private_5g_and_business_fiber_from')}); +NETS.push({id:'kys',name:'Kyiv Superstar',asn:15859,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#0055B8',pops:['kyv','waw','fra'],ix:['kyv'],blurb:tr('networks.ukraine_s_biggest_mobile_network_has')}); +NETS.push({id:'stc',name:'Sticky Telecom',asn:39368,type:'t2',pol:'selective',minIx:10,minPni:30,share:.01,price:8,col:'#4F008C',pops:['ruh','jed','dxb','fra','lon','cai'],ix:['ruh'],blurb:tr('networks.the_kingdom_s_incumbent_once_you')}, + {id:'ord',name:'Ooh-redoo',asn:8871,type:'eye',pol:'paid',freeLv:11,paidFee:5000,share:.004,col:'#ED1C24',pops:['doh','dxb','jkt'],ix:[],blurb:tr('networks.qatar_s_big_operator_paid_peering')}); +NETS.push( + {id:'tim',name:'TIM-Tam Italia',asn:3269,type:'eye',pol:'selective',minIx:8,minPni:25,share:.008,col:'#004691',pops:['mil','rom','pmo'],ix:['mil','rom'],blurb:tr('networks.italy_s_incumbent_sweet_on_the')}, + {id:'skl',name:'Sparkly Seabone',asn:6762,type:'t1',pol:'restrictive',share:.04,price:6,col:'#5B2C83',pops:['pmo','mil','rom','ath','mrs','bcn','mad','lis','par','lon','ams','fra','zrh','vie','bud','prg','waw','buh','sof','ist','ber','sto','nyc','ash','mia','atn','dal','chi','lax','sjc','tor','mex','pan','bog','lim','scl','bue','sao','rio','for','cai','jed','dxb','bom','sin','hkg','tok'],ix:[],blurb:tr('networks.the_tier_1_that_grew_up')}, + {id:'fwb',name:'Fast-Webby',asn:12874,type:'eye',pol:'open',share:.004,col:'#FDC300',pops:['mil','rom'],ix:['mil','rom'],blurb:tr('networks.fiber_to_the_italian_home_with')}, + {id:'meo',name:'MEO-w Portugal',asn:3243,type:'eye',pol:'selective',minIx:5,minPni:20,share:.004,col:'#00A3E0',pops:['pdl','lis','mad'],ix:['lis'],blurb:tr('networks.portugal_s_incumbent_purrs_when_you')}, + {id:'nos',name:'NOS-y Neighbour',asn:2860,type:'eye',pol:'open',share:.003,col:'#111111',pops:['lis'],ix:['lis'],blurb:tr('networks.peers_with_anyone_and_wants_to')}, + {id:'cos',name:'Cosmo-Note',asn:6799,type:'eye',pol:'selective',minIx:5,minPni:20,share:.004,col:'#7DC242',pops:['ath','sof'],ix:['ath'],blurb:tr('networks.greece_s_incumbent_takes_careful')}, + {id:'spc',name:'Spectre-um Cable',asn:20115,type:'eye',pol:'selective',minIx:12,minPni:35,share:.02,col:'#0099D8',pops:['nyc','lax','dal','chi','atn','den','phx','slc','hou','bos','sjc'],ix:['nyc','lax','dal','chi','atn','den'],blurb:tr('networks.cable_broadband_for_half_of_america')}, + {id:'vzn',name:'Very-Zone',asn:701,type:'eye',pol:'paid',paidFee:9000,share:.015,col:'#CD040B',pops:['nyc','ash','bos','dal','lax','chi','atn','mia'],ix:[],blurb:tr('networks.can_you_hear_me_now_only')}); diff --git a/src/game/30-networks/20-rival-exchanges.js b/src/game/30-networks/20-rival-exchanges.js new file mode 100644 index 0000000..1572982 --- /dev/null +++ b/src/game/30-networks/20-rival-exchanges.js @@ -0,0 +1,31 @@ +/* Rival exchanges. Big metros rarely have just one IX: challengers undercut the incumbent and + share many members with it, but not all. The incumbent keeps the city id, challengers are 'city~n'. */ +const XIX=[ + {id:'jnb~2',c:'jnb',name:'JINXED-IX',cheap:.7,take:0.5,core:['drz','akm','cfl','tng'],blurb:tr('rival_exchanges.the_older_johannesburg_exchange_run')}, + {id:'fra~2',c:'fra',name:'KleyWrecks',cheap:.5,take:0.5,core:['drz','akm','cfl','slw','bdc','ydx'],blurb:tr('rival_exchanges.a_smaller_commercial_exchange_down')}, + {id:'fra~3',c:'fra',name:'Apfelwein-IX',cheap:0.3,take:0.3,blurb:tr('rival_exchanges.a_community_exchange_run_from_above')}, + {id:'ams~2',c:'ams',name:'NL-Nyx',cheap:0.6,take:0.6,blurb:tr('rival_exchanges.one_fabric_across_the_whole_country')}, + {id:'ams~3',c:'ams',name:'FRIES-IX',cheap:1,take:0.5,freeTo:1,core:['drz','akm','cfl','slw','msf'],blurb:tr('rival_exchanges.settlement_free_peering_with_frysian')}, + {id:'lon~2',c:'lon',name:'LO-NAPS',cheap:.6,take:0.5,core:['drz','akm','cfl','slw','bdc','msf','fbk'],blurb:tr('rival_exchanges.member_owned_and_not_for_profit')}, + {id:'par~2',c:'par',name:'Baguette-IX',cheap:0.55,take:0.5,blurb:tr('rival_exchanges.the_challenger_fresh_every_morning_a')}, + {id:'mad~2',c:'mad',name:'Paella-NIX',cheap:.6,take:0.5,core:['drz','akm','cfl','tng','bdc','slw','msf'],blurb:tr('rival_exchanges.the_long_established_madrid_exchange')}, + {id:'mil~2',c:'mil',name:'Aperitivo-IX',cheap:0.5,take:0.45,blurb:tr('rival_exchanges.opens_at_six_comes_with_free')}, + {id:'ber~2',c:'ber',name:'Club-Mate-IX',cheap:0.35,take:0.4,blurb:tr('rival_exchanges.run_by_hackers_on_caffeine_the')}, + {id:'waw~2',c:'waw',name:'Bigos-IX',cheap:0.45,take:0.5,blurb:tr('rival_exchanges.warsaw_has_more_exchanges_than')}, + {id:'waw~3',c:'waw',name:'Zapiekanka-IX',cheap:0.3,take:0.35,blurb:tr('rival_exchanges.open_faced_cheap_and_available_at')}, + {id:'prg~2',c:'prg',name:'Knedlík-IX',cheap:0.35,take:0.4,blurb:tr('rival_exchanges.dense_filling_and_very_cheap')}, + {id:'buh~2',c:'buh',name:'Mici-IX',cheap:0.35,take:0.45,blurb:tr('rival_exchanges.grilled_ports_served_with_mustard')}, + {id:'sto~2',c:'sto',name:'Fika-IX',cheap:0.5,take:0.5,blurb:tr('rival_exchanges.every_session_comes_with_a_coffee')}, + {id:'kyv~2',c:'kyv',name:'Kyiv-Cake-IX',cheap:0.35,take:0.45,blurb:tr('rival_exchanges.layered_resilient_and_somehow_always')}, + {id:'nyc~2',c:'nyc',name:'Bagel-IX',cheap:0.6,take:0.5,blurb:tr('rival_exchanges.a_community_exchange_in_a_hudson')}, + {id:'chi~2',c:'chi',name:'Deep-Dish-IX',cheap:0.6,take:0.5,blurb:tr('rival_exchanges.takes_forever_to_set_up_but')}, + {id:'sjc~2',c:'sjc',name:'Garage-IX',cheap:0.55,take:0.45,blurb:tr('rival_exchanges.started_in_somebody_s_garage_like')}, + {id:'lax~2',c:'lax',name:'Smog-IX',cheap:0.6,take:0.45,blurb:tr('rival_exchanges.you_can_t_see_the_fabric')}, + {id:'sin~2',c:'sin',name:'Kopi-IX',cheap:0.6,take:0.5,blurb:tr('rival_exchanges.strong_sweet_and_cheaper_than_the')}, + {id:'hkg~2',c:'hkg',name:'Dim-Sum-IX',cheap:0.6,take:0.5,blurb:tr('rival_exchanges.lots_of_small_sessions_on_little')}, + {id:'tok~2',c:'tok',name:'Bento-IX',cheap:0.65,take:0.5,core:['drz','akm','cfl','sgt','msf','amz'],blurb:tr('rival_exchanges.tokyo_has_more_exchanges_than_anyone')}, + {id:'syd~2',c:'syd',name:'At-The-Edge IX',cheap:.7,take:0.5,core:['drz','nfx','ggl','fbk','akm','cfl','amz','msf','bdc','slw','abb','voc','stb','spl','lpt'],blurb:tr('rival_exchanges.the_challenger_to_ix_straya_pops')}, + {id:'bom~2',c:'bom',name:'Vada-Pav-IX',cheap:0.45,take:0.45,blurb:tr('rival_exchanges.mumbai_s_street_food_exchange_fast')}, + {id:'dxb~2',c:'dxb',name:'Shawarma-IX',cheap:0.6,take:0.4,blurb:tr('rival_exchanges.the_challenger_to_the_de_kicks')}, +]; +const XIXM=Object.fromEntries(XIX.map(x=>[x.id,x])); diff --git a/src/game/30-networks/30-long-tail.js b/src/game/30-networks/30-long-tail.js new file mode 100644 index 0000000..3372ebf --- /dev/null +++ b/src/game/30-networks/30-long-tail.js @@ -0,0 +1,95 @@ +/* The long tail: odd little networks with a sliver of traffic each, on one or two exchanges. */ +const TAIL=[ + ['Grandma’s Basement Hosting','cdn',['fra'],tr('long_tail.three_servers_one_dehumidifier_and_a')], + ['Hamster Wheel Networks','eye',['ams'],tr('long_tail.powered_by_renewable_rodents_uptime')], + ['Fjordnet Kooperativ','eye',['osl'],tr('long_tail.a_fiber_co_op_for_one')], + ['Kebab-Link','eye',['ber','fra'],tr('long_tail.an_isp_run_from_the_back')], + ['Mesh Collective e.V.','eye',['ber','fra'],tr('long_tail.volunteers_with_rooftop_antennas_and')], + ['Village Fibre Co-op','eye',['lon'],tr('long_tail.dug_the_trench_themselves_one_field')], + ['Tiny Swiss Bank Shield','cdn',['zrh'],tr('long_tail.hosts_exactly_one_website_and_three')], + ['Clockwork ISP','eye',['zrh'],tr('long_tail.packets_leave_on_time_to_the')], + ['LAN-Party Federation','cdn',['ams','fra'],tr('long_tail.game_servers_energy_drinks_and_a')], + ['Former Church Datacenter','cdn',['ams'],tr('long_tail.racks_in_the_nave_cooling_in')], + ['WISP on a Silo','eye',['dal','chi'],tr('long_tail.wireless_internet_from_the_top_of')], + ['Cornfield Broadband','eye',['chi'],tr('long_tail.rural_fiber_that_follows_the_tractor')], + ['Moose Lake Telephone Co-op','eye',['tor','mtl'],tr('long_tail.has_served_the_lake_since_1912')], + ['Surf Shop Networks','cdn',['lax'],tr('long_tail.hosting_for_surfboard_shops_closed')], + ['Ski Lift Fiber','eye',['den','zrh'],tr('long_tail.fiber_strung_along_the_chairlifts')], + ['Tumbleweed Telecom','eye',['phx','dal'],tr('long_tail.covers_a_lot_of_empty_ground')], + ['Crypto Bro Colo','cdn',['ash','mia'],tr('long_tail.ten_thousand_gpus_and_a_podcast')], + ['Ye Olde University Network','eye',['bos','lon'],tr('long_tail.has_had_a_8_since_before')], + ['Mom & Pop Packet Shop','eye',['nyc'],tr('long_tail.family_run_since_dial_up_still')], + ['Space Cowboy Broadband','eye',['hou','dal'],tr('long_tail.yee_haw_and_low_earth_orbit')], + ['Fry Sauce Fibre','eye',['slc'],tr('long_tail.utah_s_dipping_sauce_of_an')], + ['Sauna Uplink Oy','cdn',['hel','sto'],tr('long_tail.servers_cooled_by_the_lake_then')], + ['Reindeer Relay','eye',['sto','osl','hel'],tr('long_tail.wireless_links_across_the_tundra')], + ['Pierogi Hosting','cdn',['waw'],tr('long_tail.cheap_filling_hosting_ask_for_the')], + ['Sunflower Uplink','eye',['kyv','waw'],tr('long_tail.kept_the_lights_on_in_its')], + ['Tram Line Telecom','eye',['prg','vie'],tr('long_tail.fiber_laid_under_the_tram_tracks')], + ['Paprika Peering','eye',['bud'],tr('long_tail.spicy_pricing_mild_latency')], + ['Dracula Datacenter','cdn',['buh'],tr('long_tail.only_comes_online_at_night')], + ['Bosphorus Ferry Net','eye',['ist'],tr('long_tail.wi_fi_on_every_ferry_backhaul')], + ['Gondola Gigabit','eye',['mil','rom'],tr('long_tail.started_in_venice_upgraded_to_land')], + ['Nonna’s Pasta Pipes','cdn',['rom','pmo'],tr('long_tail.hosting_for_every_family_restaurant')], + ['Tram 28 Telecom','eye',['lis'],tr('long_tail.slow_on_the_hills_fast_on')], + ['Olive Grove Online','eye',['ath'],tr('long_tail.rural_broadband_for_the_islands_one')], + ['Siesta Server Hotel','cdn',['mad'],tr('long_tail.down_from_2_to_5_p')], + ['Bouillabaisse Bits','cdn',['mrs','par'],tr('long_tail.a_rich_mix_of_everything_the')], + ['Baguette Bandwidth Associés','eye',['par'],tr('long_tail.delivered_fresh_every_morning')], + ['Pub Quiz Internet','eye',['dub','lon'],tr('long_tail.founded_after_a_pub_quiz_by')], + ['Gaming Café Net','eye',['lag'],tr('long_tail.internet_cafe_turned_isp_the_gamers')], + ['Matatu Mobile Mesh','eye',['nbo'],tr('long_tail.wi_fi_on_minibuses_and_the')], + ['Load-Shedding Survivors','eye',['jnb','cpt'],tr('long_tail.has_more_batteries_than_customers')], + ['Bollywood Buffer','cdn',['bom','del'],tr('long_tail.three_hour_films_zero_second_start')], + ['Hawker Centre Hosting','cdn',['sin','kul'],tr('long_tail.cheap_fast_and_open_late')], + ['Karaoke Box Networks','cdn',['tok','osa','icn'],tr('long_tail.lyrics_servers_low_latency_high')], + ['Night Market Net','eye',['tpe','hkg'],tr('long_tail.comes_alive_after_dark')], + ['Kangaroo Courier','eye',['syd','mel','bne'],tr('long_tail.packets_hop_sometimes_backwards')], + ['Hobbit Hole Hosting','cdn',['akl'],tr('long_tail.cosy_racks_under_a_hill_second')], + ['Capybara Connect','eye',['sao','poa','bue'],tr('long_tail.gets_along_with_every_other_network')], + ['Llama Link','eye',['lim','scl','bog'],tr('long_tail.mountain_wireless_will_spit_at_bad')], + ['Supercar Hosting','cdn',['dxb'],tr('long_tail.gold_plated_servers_valet_parking')], + ['Tango Transit Co-op','eye',['bue','cor'],tr('long_tail.it_takes_two_to_peer')], + ['Bánh Mì Broadband','eye',['sgn'],tr('long_tail.crispy_on_the_outside_cheap_on')], + ['Jeepney Jumpnet','eye',['mnl'],tr('long_tail.colourful_crowded_and_gets_you_there')], + ['Game Server Gremlins','cdn',['fra','ams','lon','nyc','sjc'],tr('long_tail.hosts_every_game_you_play_at'),0.003], + ['Discord-ant Voice Relay','cdn',['ams','fra','ash'],tr('long_tail.voice_chat_for_millions_of_gamers'),0.003], + ['Mastodon Instance Herd','cdn',['ber','ams','par'],tr('long_tail.a_thousand_tiny_social_networks_on')], + ['Dutch Bike Fibre','eye',['ams'],tr('long_tail.fiber_laid_along_the_bike_lanes')], + ['Chip Fab Cleanroom Net','cdn',['tpe','phx'],tr('long_tail.bunny_suits_mandatory_in_the_server')], + ['Volunteer Fire Brigade Wi-Fi','eye',['vie','zrh'],tr('long_tail.runs_the_village_network_between')], + ['Peach State Hosting','cdn',['atn'],tr('long_tail.sweet_fuzzy_and_surprisingly')], + ['Chowder Hosting','cdn',['bos'],tr('long_tail.thick_comforting_and_very_new')], +]; +function ixStatic(c){const o=[];if(CITY[c]&&CITY[c].ix)o.push(c);for(const x of XIX)if(x.c===c)o.push(x.id);return o;} +TAIL.forEach(([name,type,home,blurb,sh],i)=>{const h=hstr(name),cand=home.flatMap(ixStatic),ix=[]; + if(cand.length){ix.push(cand[h%cand.length]);if(cand.length>1&&(h>>>8)%100<40){const o=cand[(h>>>12)%cand.length];if(!ix.includes(o))ix.push(o);}} + const sel=(h>>>4)%10>=8; + NETS.push({id:'tail'+i,name,asn:200000+(h%190000),type,tail:true,pol:sel?'selective':'open',...(sel?{minIx:1+(h>>>16)%3,minPni:6+(h>>>18)%8}:{}),share:sh||+(0.0006+((h>>>20)%15)*0.0001).toFixed(4),col:`hsl(${h%360} 55% 46%)`,pops:home.slice(),ix,blurb});}); +NETS.push( + {id:'ktt',name:'Kay-Tea',asn:4766,type:'eye',pol:'paid',paidFee:5000,perG:90,kr:true,share:.012,col:'#E4002B',pops:['icn','hkg','tok','lax'],ix:[],blurb:tr('long_tail.korea_s_incumbent_sender_pays_every')}, + {id:'skb',name:'SK Broadbandit',asn:9318,type:'eye',pol:'paid',paidFee:4000,perG:110,kr:true,share:.01,col:'#EA002C',pops:['icn','hkg','sjc'],ix:[],blurb:tr('long_tail.took_a_streaming_giant_to_court')}, + {id:'lgu',name:'LG You-Pay-Plus',asn:3786,type:'eye',pol:'paid',paidFee:3000,perG:80,kr:true,share:.008,col:'#E6007E',pops:['icn','tok'],ix:[],blurb:tr('long_tail.the_plus_is_a_usage_fee')}); +NETS.push( + {id:'btt',name:'Bee-Tee',asn:2856,type:'eye',pol:'selective',minIx:10,minPni:30,share:.012,col:'#5514B4',pops:['lon','man','edi','bde'],ix:['lon','man'],blurb:tr('long_tail.the_uk_s_incumbent_buzzes_politely')}, + {id:'sky',name:'Sky-High Broadband',asn:5607,type:'eye',pol:'selective',minIx:6,minPni:25,share:.008,col:'#0072C9',pops:['lon','man','edi','dub'],ix:['lon','man','edi'],blurb:tr('long_tail.football_films_and_a_router_that')}, + {id:'vmo',name:'Virgin Mediocre',asn:5089,type:'eye',pol:'selective',minIx:6,minPni:25,share:.007,col:'#E10A0A',pops:['lon','man','edi'],ix:['lon','man'],blurb:tr('long_tail.cable_broadband_for_half_of_britain')}, + {id:'tnr',name:'Tele-Nor-Way',asn:2119,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#00A9E0',pops:['osl','svg','sto','cph'],ix:['osl','svg'],blurb:tr('long_tail.norway_s_incumbent_neither_yes_nor')}); +NETS.push( + {id:'hwt',name:'Hawaiian Telecombo',asn:36149,type:'eye',pol:'selective',minIx:3,minPni:15,share:.004,up:['ntt','lvl'],col:'#5B2A86',pops:['hnl'],ix:['hnl'],blurb:tr('long_tail.hawaii_s_incumbent_every_plan_comes')}, + {id:'gtg',name:'Grand Theft Teleguam',asn:9246,type:'t2',pol:'open',share:.002,price:8,up:['ntt','tat'],col:'#0072CE',pops:['gum','ror','maj','hnl','tok'],ix:['gum','hnl'],blurb:tr('long_tail.guam_s_incumbent_and_the_way')}, + {id:'dcp',name:'Docomoco Pacific',asn:3605,type:'eye',pol:'selective',minIx:2,minPni:10,share:.002,up:['ntt'],col:'#E4002B',pops:['gum','ror'],ix:['gum'],blurb:tr('long_tail.guam_s_mobile_network_rice_a')}, + {id:'dsp',name:'Digi-Sell Pacific',asn:38442,type:'t2',pol:'open',share:.005,price:9,up:['ntt','tat'],col:'#E2001A',pops:['pom','suv','tbu','apw','syd'],ix:['suv'],blurb:tr('long_tail.phones_on_every_island_from_papua')}, + {id:'fnt',name:'FINTEL-ligent',asn:9241,type:'t2',pol:'open',share:.002,price:8,up:['ntt','tly'],col:'#00A3AD',pops:['suv','tbu','apw','ppg','syd','hnl'],ix:['suv'],blurb:tr('long_tail.fiji_s_international_gateway_very')}, + {id:'pft',name:'Postes et Télé-Croissant',asn:56055,type:'t2',pol:'selective',minIx:3,minPni:15,share:.003,price:10,up:['tly','cog'],col:'#F7B500',pops:['nou','ppt','syd','lax'],ix:['nou'],blurb:tr('long_tail.runs_the_post_the_phones_and')}, + {id:'tkp',name:'Telly-Kom PNG',asn:17828,type:'eye',pol:'selective',minIx:2,minPni:10,share:.003,up:['tat'],col:'#C8102E',pops:['pom'],ix:[],blurb:tr('long_tail.papua_new_guinea_s_state_telco')}, + {id:'otk',name:'Ours-Truly Telekom',asn:45891,type:'eye',pol:'selective',minIx:1,minPni:8,share:.001,up:['tly'],col:'#00843D',pops:['hir'],ix:['hir'],blurb:tr('long_tail.the_solomon_islands_incumbent_yours')}, + {id:'tcc',name:'Tongue-in-Cheek Comms',asn:38201,type:'eye',pol:'selective',minIx:1,minPni:8,share:.001,up:['ntt'],col:'#C10230',pops:['tbu'],ix:[],blurb:tr('long_tail.tonga_s_own_telco_lived_through')}, + {id:'bsk',name:'Blue-Sky-Pie Samoa',asn:17993,type:'eye',pol:'selective',minIx:1,minPni:8,share:.001,up:['tly'],col:'#0096D6',pops:['apw','ppg'],ix:[],blurb:tr('long_tail.samoa_s_broadband_promised_with_a')}, + {id:'pnc',name:'PNC-See',asn:9534,type:'eye',pol:'selective',minIx:1,minPni:8,share:.0005,up:['ntt'],col:'#1B75BB',pops:['ror'],ix:[],blurb:tr('long_tail.palau_s_telco_snorkel_down_and')}, + {id:'nta',name:'Never Too Atoll',asn:21581,type:'eye',pol:'selective',minIx:1,minPni:8,share:.0005,up:['ntt'],col:'#2E8B57',pops:['maj'],ix:[],blurb:tr('long_tail.the_marshall_islands_telco_two')}); +NETS.push( + {id:'onc',name:'One Commotion',asn:3855,type:'eye',pol:'selective',minIx:1,minPni:8,share:.001,up:['lvl','tly'],col:'#E4007C',pops:['bda'],ix:[],blurb:tr('long_tail.bermuda_s_phones_tv_and_internet')}, + {id:'cvt',name:'Curriculum Vitae Telecom',asn:37517,type:'t2',pol:'open',share:.002,price:8,up:['tat','tly'],col:'#004B87',pops:['rai','lis','for','dkr'],ix:['rai'],blurb:tr('long_tail.cape_verde_s_incumbent_and_the')}, + {id:'pss',name:'Pretty Sure South Atlantic',asn:210841,type:'t2',pol:'open',share:.0005,price:12,up:['tat'],col:'#7D2B8B',pops:['jam','cpt'],ix:[],blurb:tr('long_tail.the_telco_for_st_helena_ascension')}, + {id:'bst',name:'Beastlink',asn:11260,type:'eye',pol:'selective',minIx:2,minPni:10,share:.002,up:['cog','lvl'],col:'#EE3124',pops:['hfx','tor'],ix:['hfx'],blurb:tr('long_tail.atlantic_canada_s_cable_company')}); diff --git a/src/game/30-networks/40-traffic-shares.js b/src/game/30-networks/40-traffic-shares.js new file mode 100644 index 0000000..539bf5e --- /dev/null +++ b/src/game/30-networks/40-traffic-shares.js @@ -0,0 +1,15 @@ +const NET=Object.fromEntries(NETS.map(n=>[n.id,n])),NET_IDS=NETS.map(n=>n.id); +// The networks a PNI with each upstream reaches: the upstream itself plus everyone who buys transit from it. +const PNI_NETS={};for(const n of NETS)PNI_NETS[n.id]=[n.id].concat(NETS.filter(x=>x.up&&x.up.includes(n.id)).map(x=>x.id)); +for(const X of XIX){X.members=NETS.filter(n=>Array.isArray(n.ix)&&n.ix.includes(X.id)||!n.tail&&(X.core?X.core.includes(n.id):(n.ix==='ALL'||Array.isArray(n.ix)&&n.ix.includes(X.c))&&hstr(n.id+'|'+X.id)%100<(n.ix==='ALL'?72:X.take*100))).map(n=>n.id);} +const NSH={}; {const t=NETS.reduce((a,n)=>a+n.share,0); NETS.forEach(n=>NSH[n.id]=n.share/t);} +// After Glitch leaves Korea, Seoul viewers watch half as much of it and the rest moves to everyone else. +const NSH_KRX={}; {const w=id=>NSH[id]*(id==='amz'?0.5:1),t=NETS.reduce((a,n)=>a+w(n.id),0); NETS.forEach(n=>NSH_KRX[n.id]=w(n.id)/t);} +const CN_W={ctc:.2,cun:.14,cmb:.08,tcs:.22,abc:.14,byd:.08,bdc:.08,akm:.02,msf:.02,amz:.01,drz:.01}; +const RU_W={ydx:.24,vkl:.12,rtc:.14,ggl:.12,bdc:.08,akm:.05,cfl:.06,msf:.04,amz:.03,tly:.02,cog:.02,drz:.01}; +const NSH_RU={}; {const t=Object.values(RU_W).reduce((a,b)=>a+b,0); for(const k in RU_W)NSH_RU[k]=RU_W[k]/t;} +const NSH_CN={}; {const t=Object.values(CN_W).reduce((a,b)=>a+b,0); for(const k in CN_W)NSH_CN[k]=CN_W[k]/t;} +const CN_BLOCKED=NETS.filter(n=>!CN_W[n.id]&&n.type==='cdn').map(n=>n.name); +const TYPE_L={t1:tr('common.tier_1'),t2:tr('common.tier_2'),cdn:tr('common.cdn_content'),eye:tr('common.eyeballs')}; +const initials=n=>n.name.replace(/[^A-Za-z ]/g,'').split(' ').filter(Boolean).map(w=>w[0]).join('').slice(0,3).toUpperCase(); + diff --git a/src/game/40-progress/10-businesses.js b/src/game/40-progress/10-businesses.js new file mode 100644 index 0000000..4731720 --- /dev/null +++ b/src/game/40-progress/10-businesses.js @@ -0,0 +1,63 @@ +/* ================= BUSINESSES ================= */ +const BIZ_T={ + dia:{l:tr('common.enterprise_dia'),opts:[1,2,5,10],rate:600}, + game:{l:tr('common.game_servers'),gaming:true,opts:[5,10,20,40],rate:120}, + host:{l:tr('common.hosting'),opts:[10,20,40,80],rate:60}, + isp:{l:tr('businesses.downstream_isp_buys_transit'),opts:[100,200,400,800],rate:15,lv:2}, + l2vpn:{l:tr('common.l2vpn_circuit'),opts:[1,10,40,100],rate:0,l2:true,km:1,lv:1}, + fabip:{l:tr('businesses.customer_on_a_fabric_transit_over'),opts:[1,5,10,25],rate:110,nni:true,lv:2}, + fabl2:{l:tr('businesses.fabric_circuit_to_one_of_your'),opts:[1,5,10],rate:0,l2:true,nni:true,km:0.8,lv:2}, + stream:{l:tr('common.streaming_startup'),opts:[50,100,200],rate:80,lv:2}, + edu:{l:tr('common.university_network'),opts:[20,50,100],rate:90,lv:2}, + gpu:{l:tr('businesses.ai_gpu_data_center'),opts:[200,400,800],rate:70,lv:3,names:['Neural Noodles AI','GPUs R Us','Hallucination Labs','Transformers & Sons','Token Burners Inc.','Very Large Language Co.','Prompt Engineering Ltd','DeepThought Farms','Parameter Pastures','Gradient Descent Diner','Attention Is All We Need LLC','Overfit Analytics']}, + onramp:{l:tr('businesses.cloud_on_ramp'),opts:[100,200,400],rate:0,l2:true,km:0.7,lv:3,names:["Amazin' Web Services on-ramp","Microsnoft Azzure on-ramp",'Goggle Cloud on-ramp','AliBubble Cloud on-ramp','Miracle Cloud on-ramp']}, + ai:{l:tr('businesses.ai_training_interconnect'),opts:[400,800,1600],rate:0,l2:true,div:true,km:0.9,lv:4,names:['Skynot Compute','Galaxy Brain Training Run','Megawatt Minds','The Big Model Co.','Infinite Context Corp','Sentient Spreadsheet Inc.']}, + hyper:{l:tr('common.hyperscaler_dci'),opts:[1600,3200,6400],rate:0,l2:true,div:true,km:0.5,lv:4,names:["Amazin' Web Services DCI","Microsnoft Azzure DCI",'Goggle Cloud DCI','Faceplant Infra DCI','AliBubble Cloud DCI']}, + hft:{l:tr('businesses.high_frequency_trading_link'),opts:[1,5,10],rate:0,l2:true,lat:true,km:6,lv:2,names:['Flash Boys Capital','Nanosecond Nancy Trading','Speed of Light Securities','Arbitrage & Sons','Front-Run Fund','Microwave Tower Capital','Tick-Tock Quant','Low Latency Larry LLC']}, + bulk:{l:tr('businesses.bulk_backup_transfer_latency_does'),opts:[100,200,400],rate:0,l2:true,scenic:true,km:0.1,lv:2,names:['Glacier Slow Storage','Tape Backup Tortoise','Scenic Route Archives','Cold Storage Cold Cuts','Sloth Sync','Eventually Consistent Inc.','Snail Mail Data Co.']}, + event:{l:tr('common.event_network'),opts:[100,200,400,800,1600,3200],rate:0,event:true,lv:2,names:['Carnaval Parade','Diwali Streaming Night','The Big Football Final','NANOG 99','Burning Router Festival','Euro-Pop Song Contest','Formula Ping Grand Prix','The Big Game','Olympic Pings','A Pop Megastar Stadium Tour','LAN Party of the Century','The Keynote (One More Thing)','Gamer-Con Expo','Oktoberfest Livestream']}, + sdwan:{l:tr('businesses.sd_wan_for_a_chain'),opts:[1,2,5,10],rate:0,l2:true,sdwan:true,km:0,lv:2,names:['Kebab Kingdom','Pretzel Palace','Burger Router Inc.','Café Latte-ncy','Hardware Hut Stores','Pharma-See Pharmacies','Bank of Tiny Branches','Supermarket Superhighway','Fitness Pings Gyms','Hotel Hops Group','Doughnut Data Diners']}, + wwave:{l:tr('common.wholesale_wave'),opts:[1],rate:0,fiber:true,lv:2,names:['Zay-No Fiber','Loomin’ Technologies','Clown Castle Fiber','G&T (Gin and Transit)','A Hyperscaler Who Shall Not Be Named','Megapork','youNetworks']}, + dfpair:{l:tr('businesses.dark_fiber_pair_lease'),opts:[1],rate:0,fiber:true,lv:3,names:['A Hyperscaler Who Shall Not Be Named','Goggle Fiber Division','Faceplant Infra','Amazin’ Backbone Team','A Very Secretive Trading Firm']}, + scrub:{l:tr('businesses.ddos_protection_dia'),opts:[1,5,10,20],rate:900}, + aiwan:{l:tr('businesses.ai_wan_between_two_ai_factories'),opts:[3200,6400,12800],rate:0,l2:true,div:true,mega:true,km:0.45,lv:4,names:['Fairweather AI WAN','Planet-Scale Superfactory Link','Two Brains One Model Inc.','Distributed Godlike Compute','The Gigawatt Handshake']}, + mtrain:{l:tr('businesses.multi_site_training_run'),opts:[1600,3200,6400],rate:0,l2:true,sdwan:true,mega:true,lv:4,names:['Gem-in-Eye Ultra Training Run','Frontier Model 9000','The Very Big Model','Checkpoint-Free Training Co.','Model Too Big For One Building']}, + ingest:{l:tr('businesses.dataset_ingest_elephant_flow'),opts:[1600,3200,6400],rate:0,event:true,mega:true,lv:3,names:['Scrape-the-Whole-Web Ingest','Checkpoint Sync Storm','Video Dataset Firehose','Every Book Ever (allegedly licensed)','Synthetic Data Tsunami']}, + pairs:{l:tr('businesses.hundreds_of_fiber_pairs'),opts:[1],rate:0,fiber:true,mega:true,lv:4,names:['A Hyperscaler Who Shall Not Be Named','Planet-Scale AI WAN Team','The Fiber-Hungry Giant','Project Very Long Glass']}, + esport:{l:tr('businesses.esports_world_final'),opts:[400,800,1600,3200],rate:0,event:true,lv:5,names:['League of Lag Finals','Counter-Ping Major','Fortnightly World Cup','Dota Two Many Viewers','Rocket Leak Championship','Street Frighter Evo']}, + sov:{l:tr('businesses.sovereign_cloud_region'),opts:[400,800,1600],rate:0,l2:true,div:true,km:0.6,lv:6,names:['Gaia-Ex Sovereign Cloud','Bundeswolke (Very Secure)','Le Cloud Souverain','Datenschutz Deluxe','Your Data Stays Here, Probably','A Cloud With a Flag on It','Data Residency Is a State of Mind']}, + cgame:{l:tr('businesses.cloud_gaming_platform'),gaming:true,opts:[800,1600,3200],rate:45,lv:8,names:['Stadia-ium (Back Again)','GeForce Later','Ping Station Now','Luna-tick Gaming','Shadow of a Doubt Cloud PC','Input Lag Arcade','Bufferbloat Bros. Streaming']}, + metav:{l:tr('common.metaverse_platform'),opts:[1600,3200,6400],rate:35,lv:9,names:['Meh-taverse','Second Second Life','Horizon Worlds Apart','The Oasis (Ready Player Done)','Legs Finally Shipped Inc.','Decentra-landlocked']}, + agi:{l:tr('businesses.agi_lab_allegedly'),opts:[12800,25600],rate:0,l2:true,div:true,mega:true,km:0.4,lv:11,names:['Almost General Intelligence Inc.','Superintelligence Pending','The Lab That Said Two More Years','Paperclip Maximizer Labs','Deep Thought Two','Benevolent Overlord Research']}, + mars:{l:tr('businesses.mars_mission_ground_station'),opts:[100,200,400],rate:0,l2:true,lat:true,km:4,lv:13,names:['Red Planet Relay','Ares Ground Segment','Olympus Mons Uplink','Mars or Bust Mission Control','Interplanetary Ping Society','Light-Minute Logistics','RFC 1149 Avian Carriers (Mars Division)']}, + provedor:{l:tr('businesses.provedor_small_regional_isp'),opts:[5,10,20,40],rate:20,br:true,names:['Provedor Capivara Net','Fibra do Sertão','Rapidinho Telecom','Net Jabuticaba','Caipirinha Online','Wi-Fi do Zé','Pão de Queijo Fibra','Açaí Net','Tucano Telecom','Forró Fibra','Saci Net','Brigadeiro Banda Larga','Mandioca Online','Churrasco Connect']}, +}; +const LEVELS=[ + {n:tr('common.local_isp'),q:tr('businesses.your_network_diagram_is_a_photo'),req:tr('common.start_here'),unlock:tr('businesses.enterprises_game_servers_hosting')}, + {n:tr('common.regional_player'),q:tr('businesses.you_now_have_a_change_freeze'),req:tr('businesses.peak_200_gbps_and_3_pops'),unlock:tr('businesses.downstream_isps_streaming_startups')}, + {n:tr('common.serious_backbone'),q:tr('businesses.it_s_not_dns_there_s'),req:tr('businesses.peak_1_tbps_and_6_pops'),unlock:tr('businesses.ai_gpu_data_centers_and_cloud')}, + {n:tr('common.big_league'),q:tr('businesses.your_mtu_is_9000_on_every'),req:tr('businesses.peak_3_tbps_10_pops_3'),unlock:tr('businesses.ai_training_interconnects_and')}, + {n:tr('common.continental_carrier'),q:tr('businesses.your_noc_has_a_chat_channel'),req:tr('businesses.peak_6_tbps_15_pops_4'),era:1.15,unlock:tr('businesses.esports_world_finals_and_the_4k')}, + {n:tr('common.transcontinental'),q:tr('businesses.you_joined_the_outages_mailing_list'),req:tr('businesses.peak_9_tbps_and_20_pops'),unlock:tr('businesses.sovereign_cloud_regions_and_a_free')}, + {n:tr('common.global_backbone'),q:tr('businesses.your_asn_now_shows_up_in'),req:tr('businesses.peak_12_tbps_25_pops_5'),unlock:tr('businesses.a_free_pni_with_voda_phony')}, + {n:tr('common.packet_empire'),q:tr('businesses.your_maintenance_window_is_2_a'),req:tr('businesses.peak_16_tbps_and_32_pops'),era:1.15,unlock:tr('businesses.cloud_gaming_platforms_and_the_cloud')}, + {n:tr('businesses.six_continent_carrier'),q:tr('businesses.somewhere_on_every_continent_a'),req:tr('businesses.peak_21_tbps_40_pops_6'),unlock:tr('businesses.metaverse_platforms_it_finally_took')}, + {n:tr('businesses.backbone_of_backbones'),q:tr('businesses.your_routing_table_needs_its_own'),req:tr('businesses.peak_26_tbps_and_50_pops'),era:1.2,unlock:tr('businesses.the_vr_era_eyeballs_want_20')}, + {n:tr('businesses.internet_weather_system'),q:tr('businesses.when_your_bgp_sneezes_a_small'),req:tr('businesses.peak_33_tbps_and_60_pops'),unlock:tr('businesses.agi_labs_allegedly_wanting_ai_wans')}, + {n:tr('businesses.too_big_to_route'),q:tr('businesses.your_last_fat_fingered_route_leak'),req:tr('businesses.peak_40_tbps_and_70_pops'),era:1.25,unlock:tr('businesses.the_ai_agent_era_eyeballs_want')}, + {n:tr('common.the_internet'),q:tr('businesses.people_phone_you_to_ask_if'),req:tr('businesses.peak_50_tbps_and_80_pops'),unlock:tr('businesses.mars_mission_ground_stations_gear')}, +]; +// What each level asks for (peak Gbps, POPs, continents). Continents carry over to the levels above. +const LV_REQ=[null,{pk:200,pops:3},{pk:1000,pops:6},{pk:3000,pops:10,reg:3},{pk:6000,pops:15,reg:4},{pk:9000,pops:20},{pk:12000,pops:25,reg:5},{pk:16000,pops:32},{pk:21000,pops:40,reg:6},{pk:26000,pops:50},{pk:33000,pops:60},{pk:40000,pops:70},{pk:50000,pops:80}]; +const lvReg=i=>Math.max(0,...LV_REQ.slice(1,i+1).map(q=>q.reg||0)); +const lvl=()=>(S&&S.lvl)||1; +// Lower-case just the first word for mid-sentence use, so names like Tel-Mess or AGI keep their capitals. +const lc1=t=>/^[A-Z][a-z]/.test(t)?t[0].toLowerCase()+t.slice(1):t; +function custLevel(){const pops=Object.keys(S.pops).length,pk=S.stats.peak,rc=regionsCount();let lv=1;for(let i=1;i=q.pk&&pops>=q.pops&&rc>=lvReg(i))lv=i+1;else break;}return lv;} +// Traffic eras: some levels bring a new reason to watch more video, and every city's eyeballs grow toward more. +const eraMul=()=>LEVELS.slice(0,lvl()).reduce((a,L)=>a*(L.era||1),1); +const eyeP=c=>CITY[c].P*eraMul(); +// New broadband starts small, but never above what the town can grow to (St Helena has 4,500 people). +const bbStart=c=>Math.min(eyeP(c),Math.max(8,CITY[c].P*0.03)); +const BIZ_N=['Byte-Size Bakery','Hamster Wheel Power Co.','Llama Logistics','Cloud Nine Hosting','Rural Rabbit Broadband','Tiny Telco','Pixel Pirates Games','Moo-Moo Dairy Corp','Snack Overflow','Git Happens Ltd','Kernel Sanders Fried Code','Lag-Free Llamas','404 Bistro','Ping Pong Sports','Null Pointer Pets','Buffer Bloat Boats','Packet Pizza','Latency Lattes','Ctrl-Alt-Deli','Sudo Sandwiches','Cache Me Outside','Hertz So Good Radio','Jitterbug Dance Hall','Bit Barn Hosting','Fiber Optimists','The Daily Ping','Squirrel Mesh Wireless','Spam & Eggs Diner','Router Rooter Plumbing','Kilobyte Kebab','Gigglebit Studios','Uptime Funk Records','Ohm Sweet Ohm','Dial-Up Nostalgia Club','Two-Factor Tacos']; + diff --git a/src/game/40-progress/20-goals.js b/src/game/40-progress/20-goals.js new file mode 100644 index 0000000..1d37014 --- /dev/null +++ b/src/game/40-progress/20-goals.js @@ -0,0 +1,23 @@ +/* ================= GOALS ================= */ +const GOALS=[ + {id:'bb',t:tr('goals.light_up_your_first_customers'),d:tr('goals.open_your_home_city_and_press'),r:5000,ok:()=>Object.values(S.pops).some(p=>p.bb)}, + {id:'tr',t:tr('goals.reach_the_whole_internet'),d:tr('goals.your_eyeballs_want_everything_buy_ip'),r:5000,ok:()=>S.transit.length>0}, + {id:'ix',t:tr('goals.join_an_internet_exchange'),d:tr('goals.get_a_port_at_an_ix'),r:7500,ok:()=>Object.keys(S.ixp).length>0}, + {id:'p5',t:tr('goals.make_5_peering_friends'),d:tr('goals.on_the_peering_tab_request_sessions'),r:10000,ok:()=>R.sessions>=5}, + {id:'ln',t:tr('goals.lay_your_first_fiber'),d:tr('goals.drag_from_your_pink_router_to'),r:10000,ok:()=>S.links.length>0}, + {id:'bz',t:tr('goals.sign_a_business_customer'),d:tr('goals.businesses_show_up_with_a_bubble'),r:12500,ok:()=>S.biz.some(b=>!b.scripted)}, + {id:'rd',t:tr('goals.survive_a_failure'),d:tr('goals.things_break_all_the_time_build'),r:12500,ok:()=>S.stats.survived>0}, + {id:'ca',t:tr('goals.host_an_embedded_cache'),d:tr('goals.big_cdns_give_you_free_cache'),r:12500,ok:()=>S.caches.length>0}, + {id:'pn',t:tr('goals.set_up_a_pni'),d:tr('goals.a_private_cross_connect_to_one'),r:15000,ok:()=>S.pni.some(pniOn)}, + {id:'scrub',t:tr('goals.stand_up_ddos_defences'),d:tr('goals.build_a_scrubbing_center_from_a'),r:20000,ok:()=>hasScrub()}, + {id:'c3',t:tr('common.go_global'),d:tr('goals.have_pops_on_3_continents_subsea'),r:50000,ok:()=>regionsCount()>=3}, + {id:'t2',t:tr('goals.become_a_tier_2'),d:tr('goals.5_pops_ports_on_3_ixs'),r:50000,ok:()=>isTier2()}, + {id:'tb',t:tr('goals.serve_1_tbps'),d:tr('goals.a_terabit_per_second_of_happy'),r:75000,ok:()=>R.served>=1000}, + {id:'df',t:tr('goals.light_your_own_dark_fiber'),d:tr('goals.lease_or_dig_dark_fiber_put'),r:40000,ok:()=>S.links.some(l=>l.kind==='df'&&dfCap(l)>0)}, + {id:'m2',t:tr('goals.be_in_two_buildings_at_once'),d:tr('goals.add_a_second_site_in_a'),r:30000,ok:()=>Object.values(S.pops).some(p=>p.site2)}, + {id:'c5',t:tr('common.five_continents'),d:tr('goals.pops_in_five_of_the_six'),r:100000,ok:()=>regionsCount()>=5}, + {id:'gi',t:tr('goals.sign_a_giant'),d:tr('goals.land_an_ai_wan_a_multi'),r:150000,ok:()=>S.biz.some(b=>BIZ_T[b.type]&&BIZ_T[b.type].mega&&!BIZ_T[b.type].event)}, + {id:'t10',t:tr('goals.serve_10_tbps'),d:tr('goals.ten_terabits_per_second_of_happy'),r:250000,ok:()=>R.served>=10000}, + {id:'t1',t:tr('common.go_transit_free_tier_1'),d:tr('goals.peer_with_every_tier_1_over'),r:0,win:true,ok:()=>isTier1()}, +]; + diff --git a/src/game/50-state.js b/src/game/50-state.js new file mode 100644 index 0000000..41e2b01 --- /dev/null +++ b/src/game/50-state.js @@ -0,0 +1,5 @@ +/* ================= STATE ================= */ +let S=null, R=emptyR(); +const UI={sel:null,tab:'cust',left:'goals',speed:1,hover:null,drag:null,snap:null,pending:null,confirm:null,leftOpen:false,muted:false,startCity:'fra',hintOff:false}; +let uidN=1; const uid=()=>'i'+(Date.now()%1e7).toString(36)+(uidN++); +function emptyR(){return {nt:{},reachNT:0,teBlack:0,tNet:{},egT:{},netEg:{},l2lat:{},nodeLoad:{},nodeCap:{},div:{},l2:{},gfwLost:0,gfwCross:0,ef:{},egDesc:{},p95:{},peered:0,peerShare:0,load:{},useT:{},useIx:{},usePni:{},useCache:{},cityDem:{},citySrv:{},cityEye:{},latF:{},latFar:{},demTo:{},served:0,demand:0,reach:0,sessions:0,revMo:0,costMo:0,cost:{},rev:{},reachable:{}};} diff --git a/src/game/60-features/10-banks.js b/src/game/60-features/10-banks.js new file mode 100644 index 0000000..721b02f --- /dev/null +++ b/src/game/60-features/10-banks.js @@ -0,0 +1,109 @@ +/* ================= BANKS & LOANS ================= + Lenders make offers now and then (more often when you are broke). Each loan + is a fixed monthly payment that shows up in your costs; conditions are checked + daily and breaking one costs a penalty. */ +const BANKS={ + gs:{name:'Goldman Sacks',col:'#6F8FAF',min:'AA',apr:[.07,.11],amt:[4,9],term:[24,48],covs:['peer30','continents2','golf','yacht'],blurb:tr('banks.only_lends_to_people_who_do')}, + db:{name:'Deutsche Bankrupt',col:'#0018A8',min:'A',apr:[.08,.13],amt:[3,7],term:[18,36],covs:['nocog','gen','fax'],blurb:tr('banks.very_solid_mostly')}, + jpm:{name:'JP Morgain',col:'#5B4636',min:'A',apr:[.09,.14],amt:[3,6],term:[12,36],covs:['uptime','logo','nephew'],blurb:tr('banks.lends_you_money_and_also_a')}, + cs:{name:'Credit Sweaty',col:'#7A9CC6',min:'BBB',apr:[.11,.17],amt:[2,5],term:[12,30],covs:['cash50','nochina'],blurb:tr('banks.nervous_but_enthusiastic')}, + wf:{name:'Wells Far-Gone',col:'#D71E28',min:'BB',apr:[.12,.18],amt:[2,4],term:[12,24],covs:['nosub','logo','reach99'],blurb:tr('banks.opened_three_accounts_for_you_while')}, + spk:{name:'Spätzle-Sparkasse',col:'#E30613',min:'B',apr:[.05,.08],amt:[1,3],term:[24,60],covs:['spaetzle','kehrwoche'],blurb:tr('banks.cheap_patient_and_very_particular')}, + rev:{name:'Revoloot',col:'#191C1F',min:'B',apr:[.13,.2],amt:[1,3],term:[6,18],covs:['app'],blurb:tr('banks.instant_approval_instant_regret')}, + gov:{name:'Ministry of Tubes',col:'#2E7D32',min:'CCC',apr:[.01,.02],amt:[1,2],term:[36,60],covs:['rural','forms'],blurb:tr('banks.cheap_state_money_for_connecting_the')}, + crypto:{name:'Crypto Bros Capital',col:'#F7931A',min:'CCC',apr:[.15,.25],amt:[2,6],term:[6,18],covs:['hodl','tier3'],crypto:true,blurb:tr('banks.pays_out_in_tubecoin_value_may')}, + vult:{name:'Venture Vultures',col:'#8E44AD',min:'CCC',amt:[6,12],share:[.1,.15],covs:['blitz'],equity:true,blurb:tr('banks.no_repayments_ever_just_a_slice')}, + balloon:{name:'Ballooney Brothers',col:'#E91E63',min:'B',apr:[.1,.15],amt:[2,6],term:[12,24],covs:['oddpops'],model:'balloon',blurb:tr('banks.no_payments_at_all_until_the')}, + storm:{name:'Stormy Weather Lending',col:'#546E7A',min:'BB',apr:[.04,.06],amt:[2,5],term:[12,36],covs:['nogen'],model:'storm',blurb:tr('banks.cheap_while_the_sun_shines_every')}, + ppp:{name:'Peer Pressure Partners',col:'#00897B',min:'B',amt:[2,5],term:[24,36],covs:['nocache'],model:'transit',blurb:tr('banks.you_repay_with_30_of_your')}, + astro:{name:'Horoscope Holdings',col:'#5E35B1',min:'CCC',apr:[.02,.3],amt:[1,4],term:[12,24],covs:['friday','nobude'],model:'astro',blurb:tr('banks.your_rate_is_set_by_the')}, + pizza:{name:'Papa Pizza Capital',col:'#FF7043',min:'BB',apr:[.03,.05],amt:[1,3],term:[12,24],covs:['pizza'],blurb:tr('banks.the_cheapest_money_in_town_there')}, + shark:{name:'Loan Shark Telecom Finance',col:'#37474F',min:'C',apr:[.6,.9],amt:[1,2],term:[4,8],covs:[],shark:true,blurb:tr('banks.always_open_ask_no_questions_do')}, +}; +const RATINGS=['C','CCC','B','BB','BBB','A','AA','AAA']; +const COVS={ + peer30:{l:tr('banks.keep_your_peering_ratio_above_30'),ok:()=>(R.peerShare||0)>=0.3}, + continents2:{l:tr('banks.keep_pops_on_at_least_2'),ok:()=>regionsCount()>=2}, + golf:{l:tr('banks.your_ceo_plays_golf_with_our'),ok:()=>true}, + nocog:{l:tr('banks.no_cogentle_transit_anywhere_our_ceo'),ok:()=>!S.transit.some(t=>t.net==='cog')}, + gen:{l:tr('banks.every_pop_needs_a_backup_generator'),ok:()=>Object.values(S.pops).every(p=>p.gen)}, + fax:{l:tr('banks.send_us_your_monthly_report_by'),ok:()=>true}, + uptime:{l:tr('banks.deliver_at_least_95_of_what'),ok:()=>!R.demand||R.served/R.demand>=0.95}, + logo:{l:tr('banks.our_logo_goes_on_every_router'),ok:()=>true}, + cash50:{l:tr('banks.never_let_cash_drop_below_50k'),ok:()=>S.cash>=50000}, + nochina:{l:tr('banks.stay_out_of_mainland_china'),ok:()=>!Object.keys(S.pops).some(cnCity)}, + nosub:{l:tr('banks.no_new_subsea_links_while_this'),ok:l=>S.links.filter(x=>x.sub).length<=(l.base&&l.base.sub||0)}, + spaetzle:{l:tr('banks.peer_at_the_spatzle_ix_in'),ok:()=>S.ixp.stg!==undefined}, + kehrwoche:{l:tr('banks.do_the_kehrwoche_keep_your_noc'),ok:()=>!S.inc.some(i=>S.day-i.start>7)}, + app:{l:tr('banks.download_our_app_and_enable_all'),ok:()=>true}, + rural:{l:tr('banks.run_home_broadband_somewhere'),ok:()=>Object.keys(S.pops).some(c=>S.pops[c].bb&&['AS','AF','OC','SA'].includes(CITY[c].reg))}, + forms:{l:tr('banks.fill_in_form_t_17b_in'),ok:()=>true}, + hodl:{l:tr('banks.never_sell_your_tubecoin_diamond'),ok:()=>true}, + oddpops:{l:tr('banks.always_run_an_odd_number_of'),ok:()=>Object.keys(S.pops).length%2===1}, + nobude:{l:tr('banks.never_build_in_bude_the_loan'),ok:()=>!S.pops.bde}, + nogen:{l:tr('banks.no_diesel_generators_anywhere_our'),ok:()=>!Object.values(S.pops).some(p=>p.gen)}, + friday:{l:tr('banks.no_new_links_on_a_friday'),ok:l=>!S.links.some(x=>(x.day||0)>=l.start&&(x.day||0)%7===4)}, + nocache:{l:tr('banks.no_goggle_cache_boxes_our_chairman'),ok:()=>!S.caches.some(c=>c.net==='ggl')}, + reach99:{l:tr('banks.reach_99_of_the_internet_at'),ok:()=>(R.reach||0)>=0.99}, + tier3:{l:tr('banks.stay_tier_3_number_go_up'),ok:()=>tierLabel()==='Tier 3'}, + nephew:{l:tr('banks.give_our_ceo_s_nephew_a'),fee:3000,ok:()=>true}, + yacht:{l:tr('banks.our_chairman_needs_a_yacht_for'),fee:8000,ok:()=>true}, + pizza:{l:tr('banks.pizza_for_the_whole_noc_after'),each:400,ok:()=>true}, + blitz:{l:tr('banks.open_a_new_pop_at_least'),ok:l=>S.day-Math.max(l.start,...Object.values(S.pops).map(p=>p.day||0))<=90}, +}; +// Conditions read with their price filled in; some cost money every month, one costs money per incident. +const covLabel=c=>COVS[c]?COVS[c].l.replace('{price}',fmt$(COVS[c].fee||COVS[c].each||0)):c; +const loanFees=l=>(l.covs||[]).reduce((a,c)=>a+((COVS[c]&&COVS[c].fee)||0),0); +// Good terms are for good credit: every notch below AAA adds to the rate. +const RATE_PREM={AAA:0,AA:.005,A:.01,BBB:.02,BB:.04,B:.07,CCC:.12,C:.2}; +// A loan worth more than this many months of revenue also wants a slice of revenue until it is repaid. +const BIG_LOAN=5; +const STAR_SIGNS=[N_('common.mercury'),N_('common.saturn'),N_('common.venus'),N_('banks.your_rising_sign'),N_('common.the_moon'),N_('banks.pluto_which_is_not_even_a')]; +function niceAmt(v){const m=Math.pow(10,Math.floor(Math.log10(Math.max(1,v)))-1);return Math.max(50000,Math.round(v/m)*m);} +function rating(){if(!S)return 'BB';const rev=R.revMo||0,pay=(R.cost&&R.cost.loans)||0;let sc=2; + if(rev>100000)sc++;if(rev>500000)sc++;if(rev>2000000)sc++;if(R.revMo>R.costMo)sc++;else sc--;if(rev&&(R.revMo-R.costMo)/rev>=0.25)sc++; + if(S.cash<0)sc-=2;if(rev&&pay/rev>0.3)sc--;if(rev&&pay/rev>0.6)sc--;sc-=Math.min(3,S.loanStrikes||0); + return RATINGS[clamp(sc,0,RATINGS.length-1)];} +const rIdx=r=>RATINGS.indexOf(r); +function annuity(P,apr,n){const r=apr/12;return r?P*r/(1-Math.pow(1+r,-n)):P/n;} +function spawnLoanOffer(emergency){ + const rt=rating(),keys=Object.keys(BANKS).filter(k=>rIdx(rt)>=rIdx(BANKS[k].min)&&!S.loanOffers.some(o=>o.bank===k)&&!(BANKS[k].equity&&S.loans.some(l=>l.bank===k))); + let pool=emergency?keys.filter(k=>['shark','gov','crypto','vult','rev','spk','astro','balloon'].includes(k)):keys.filter(k=>k!=='shark');if(!pool.length)pool=keys;if(!pool.length)return; + const k=pick(pool),B=BANKS[k],base=Math.max(60000,R.revMo||0),ra=(a)=>a[0]+Math.random()*(a[1]-a[0]); + const amount=niceAmt(base*ra(B.amt)*(emergency?0.6:1)),o={id:uid(),bank:k,amount,exp:S.day+(emergency?10:25),covs:B.covs.slice()}; + if(B.equity){o.share=+ra(B.share).toFixed(3);} + else if(B.model==='transit'){o.model='transit';o.cut=0.3;o.term=Math.round(ra(B.term)/6)*6||6;o.owe=Math.round(amount*1.3);o.apr=0;o.pay=0;} + else{o.apr=+(ra(B.apr)+(RATE_PREM[rt]||0)).toFixed(3);o.term=Math.round(ra(B.term)/6)*6||6;o.pay=B.model==='balloon'?0:Math.round(annuity(amount,o.apr,o.term));if(B.model)o.model=B.model;} + if(!B.equity&&amount>BIG_LOAN*base)o.share=+Math.min(0.08,0.02+0.01*(amount/base-BIG_LOAN)).toFixed(3); + S.loanOffers.push(o); + toast(tr('banks.bank_would_like_to_lend_you',{bank:esc(B.name),amount:fmt$(amount)})+'
'+(emergency?tr('banks.they_heard_you_might_be_in'):tr('banks.terms_apply_several_terms')),emergency?'bad':'goal',[{l:tr('common.open_bank'),act:'bank',args:{}}]); +} +function loanTick(d){ + // conditions: 15-day grace, then a penalty every 30 days while broken + for(const l of S.loans){const B=BANKS[l.bank]; + const broken=l.covs.filter(c=>COVS[c]&&!COVS[c].ok(l)); + if(d-l.start<15||!broken.length){l.breach=0;continue;} + l.breach=(l.breach||0)+1; + if(l.breach===1)toast(tr('banks.bank_is_unhappy_you_broke_a',{bank:esc(B.name),cond:esc(covLabel(broken[0]))}),'bad',[{l:tr('common.open_bank'),act:'bank',args:{}}]); + if(l.breach===10||(l.breach>10&&(l.breach-10)%30===0)){ + if(B.equity){l.share=+(l.share+0.02).toFixed(3);toast(tr('banks.bank_are_circling_they_now_take',{bank:esc(B.name),pct:pct(l.share)}),'bad');} + else{const fee=Math.round(l.bal*0.05);l.bal+=fee;l.pay=Math.round(annuity(l.bal,l.apr,Math.max(1,l.left)));S.loanStrikes=(S.loanStrikes||0)+1;toast(tr('banks.penalty_from_bank_fee_added_to',{bank:esc(B.name),fee:fmt$(fee),pay:fmt$(l.pay)}),'bad');} + sfx('err');}} + // monthly statement: payments already leave your cash daily as part of costs + for(const l of S.loans.slice()){const B0=BANKS[l.bank];if(B0.equity||(d-l.start)%30!==0||d===l.start)continue; + if(l.model==='transit')l.bal=Math.max(0,l.bal-Math.round(((R.cost&&R.cost.transit)||0)*(l.cut||0.3)));else l.bal=Math.max(0,l.bal*(1+l.apr/12)-l.pay);l.left--; + // A balloon, or what a transit-free network never paid, is due in one go at the end. + if(l.left<=0&&l.bal>=1&&(l.model==='balloon'||l.model==='transit')){S.cash-=Math.round(l.bal);toast(tr('banks.bank_the_balloon_popped_the',{bank:esc(B0.name),price:fmt$(l.bal)}),'bad');sfx('err');l.bal=0;} + if(l.left>0&&l.bal>=1){if(l.model==='storm'){l.apr=+((l.apr0||0)+0.02*S.inc.length).toFixed(3);l.pay=Math.round(annuity(l.bal,l.apr,l.left));} + else if(l.model==='astro'){const a=+(0.02+Math.random()*0.28).toFixed(3);if(Math.abs(a-l.apr)>=0.08)toast(tr('banks.bank_sign_is_in_retrograde_your',{bank:esc(B0.name),sign:tr(pick(STAR_SIGNS)),apr:(a*100).toFixed(1)}),a>l.apr?'bad':'good');l.apr=a;l.pay=Math.round(annuity(l.bal,l.apr,l.left));}} + if(l.left<=0||l.bal<1){S.loans=S.loans.filter(x=>x!==l);track('loan_repaid');toast(tr('banks.loan_from_bank_paid_off_they',{bank:esc(BANKS[l.bank].name)}),'good');sfx('coin');}} + // the shark's collectors come by when you are broke + if(S.cash<0&&S.loans.some(l=>BANKS[l.bank].shark)&&Math.random()<0.03){const c=pick(Object.keys(S.pops));const p=S.pops[c];p.down=Math.max(p.down||0,d+1);const en=N_('banks.two_very_large_gentlemen_from_loan');addInc({type:'shutdown',ref:c,until:d+1,msg:tr(en,{city:CITY[c].name}),cost:0},en);toast(tr('banks.the_loan_shark_sent_a_reminder',{city:CITY[c].name}),'bad');sfx('alert');} + // offers: now and then, and much more often when you are in trouble + S.loanOffers=S.loanOffers.filter(o=>o.exp>d); + const broke=S.cash<0; + // With half a billion in the vault, loan offers are just noise (#52): banks stop calling, open offers lapse. + if(S.cash>=RICH_NO_LOANS){if(S.loanOffers.length||!S.richTold){S.loanOffers=[];if(!S.richTold&&S.mode!=='sandbox'){S.richTold=1;toast(tr('banks.the_banks_have_stopped_calling_you',{cash:fmt$(RICH_NO_LOANS)}),'good');}}return;} + if(S.loanOffers.length<4&&(broke?Math.random()<0.25:(d>20&&Math.random()<1/40)))spawnLoanOffer(broke); +} +const RICH_NO_LOANS=5e8; diff --git a/src/game/60-features/20-scenarios.js b/src/game/60-features/20-scenarios.js new file mode 100644 index 0000000..7504e67 --- /dev/null +++ b/src/game/60-features/20-scenarios.js @@ -0,0 +1,40 @@ +/* Seeded games (scenarios, weekly challenge) draw every random number from S.rng, so the same seed + gives the same world. Free play keeps using the browser's Math.random. */ +const _rand=Math.random; +Math.random=function(){if(S&&typeof S.rng==='number'){let t=(S.rng=(S.rng+0x6D2B79F5)|0);t=Math.imul(t^t>>>15,1|t);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296;}return _rand();}; +function isoWeek(dt){const d=new Date(Date.UTC(dt.getFullYear(),dt.getMonth(),dt.getDate()));const n=d.getUTCDay()||7;d.setUTCDate(d.getUTCDate()+4-n);const y0=new Date(Date.UTC(d.getUTCFullYear(),0,1));return {y:d.getUTCFullYear(),w:Math.ceil(((d-y0)/864e5+1)/7)};} +const hopG=l=>l.kind==='vxc'?(VXC[l.vt]||VXC[0]).g:l.kind==='df'?Math.max(0,...(l.ch||[]).map(c=>optG(c,l))):LT[l.tier].g; +function fastPath(a,b,g){if(!S.pops[a]||!S.pops[b])return false;const adj={};for(const l of S.links){if(linkDown(l)||hopG(l)S.scn.id==='weekly'?tr('scenarios.weekly_key',{key:S.scn.key}):SCN.find(x=>x.id===S.scn.id)?.n||S.scn.name; +const AU_BB=['syd','mel','bne','adl','per'],auExits=()=>new Set(S.links.filter(l=>l.sub&&!!CITY[l.a].au!==!!CITY[l.b].au&&!(l.ready>S.day)).map(l=>l.cable||l.id)).size; +const brIxN=()=>CITIES.filter(c=>c.br&&S.ixp[c.id]!==undefined).length; +const SCN=[ + {id:'stg',n:tr('scenarios.only_spatzle_ix'),city:'stg',cash:400000,days:730,rules:{noTransit:true,local:true},d:tr('scenarios.start_in_stuttgart_where_nobody'),goal:tr('scenarios.reach_45_of_the_internet_and'),ok:()=>R.reach>=0.45&&R.served>=300}, + {id:'redsea',n:tr('scenarios.red_sea_crisis'),city:'mrs',cash:2500000,days:540,rules:{banCities:['cai','jed'],banPairs:['eig:dxb-mrs','gbi:fuj-mrs','smw4:khi-mrs','smw6:mrs-bom','smw6:mrs-sin','peace:mrs-sin','aae:mrs-hkg','twoaf:mrs-bom','medn:cai-mrs','medn:ist-mrs','twoaf:jnb-mrs','eassy:nbo-mrs']},d:tr('scenarios.every_cable_through_the_red_sea'),goal:tr('scenarios.a_path_from_marseille_to_singapore'),ok:()=>pathExists('mrs','sin')&&(S.stats.asiaRun||0)>=RS_DAYS}, + {id:'spat',n:tr('scenarios.the_cogentle_spat'),city:'nyc',cash:700000,days:540,rules:{spat:true},d:tr('scenarios.cogentle_and_goggle_are_not_speaking'),goal:tr('scenarios.99_reach_and_150_gbps_served'),ok:()=>R.reach>=0.99&&R.served>=150}, + {id:'carnaval',n:tr('common.carnaval'),city:'rio',cash:600000,days:100,rules:{},setup:()=>{S.biz.push({id:uid(),scripted:true,city:'rio',city2:null,reqs:[],name:'Carnaval Parade in Rio de Janeiro',type:'event',bw:400,rate:0,mood:100,since:0,start:90,dur:5,fee:400*5*70});},d:tr('scenarios.rio_from_scratch_carnaval_starts_in'),goal:tr('scenarios.deliver_carnaval_in_full'),ok:()=>(S.stats.evFull||0)>=1}, + {id:'darien',n:tr('common.mind_the_gap'),city:'pan',cash:900000,days:730,rules:{},d:tr('scenarios.start_in_panama_city_nothing_crosses'),goal:tr('scenarios.pops_in_bogota_lima_santiago_and'),ok:()=>['bog','lim','scl','sao'].every(c=>S.pops[c])&&R.served>=150}, + {id:'c2c',n:tr('scenarios.cape_to_cairo'),city:'cpt',cash:2000000,days:1095,rules:{},d:tr('scenarios.cape_town_build_a_network_across'),goal:tr('scenarios.a_path_from_cape_town_to'),ok:()=>pathExists('cpt','cai')&&S.pops.lag&&S.pops.nbo&&R.served>=150}, + {id:'ixbr',n:tr('scenarios.order_and_progress'),city:'sao',cash:2500000,days:1095,rules:{},d:tr('scenarios.sao_paulo_brazil_is_a_continent'),goal:tr('scenarios.ports_on_15_ix_brrr_exchanges'),ok:()=>brIxN()>=15&&S.ixp.mao!==undefined&&R.served>=200}, + {id:'gangnam',n:tr('scenarios.gangnam_style_peering'),city:'icn',cash:900000,days:365,rules:{},d:tr('scenarios.seoul_the_fastest_hungriest_eyeballs'),goal:tr('scenarios.99_reach_and_200_gbps_served'),ok:()=>R.reach>=0.99&&R.served>=200}, + {id:'flood',n:tr('common.flood_season'),city:'ams',cash:2000000,days:365,rules:{ddos:true},setup:()=>{S.lvl=Math.max(S.lvl||1,3);},d:tr('scenarios.amsterdam_hosting_capital_of_europe'),goal:tr('scenarios.hold_20_floods_5_of_them'),ok:()=>(S.stats.ddosOk||0)>=20&&(S.stats.ddosOkBig||0)>=5}, + {id:'fttb',n:tr('scenarios.fibre_to_the_basement'),city:'syd',cash:1500000,days:730,rules:{levy:true},d:tr('scenarios.sydney_2013_the_toilet_paper_group'),goal:tr('scenarios.broadband_in_sydney_melbourne'),ok:()=>AU_BB.every(c=>S.pops[c]&&S.pops[c].bb)&&auExits()>=2}, + {id:'baltic',n:tr('common.anchors_away'),city:'tll',cash:500000,days:540,rules:{anchors:3},d:tr('scenarios.tallinn_ships_drag_their_anchors'),goal:tr('scenarios.90_days_in_a_row_with'),ok:()=>(S.stats.clean||0)>=90}, + {id:'pac',n:tr('common.stepping_stones'),city:'hnl',cash:3000000,days:1095,rules:{},setup:()=>{S.lvl=Math.max(S.lvl||1,4);},d:tr('scenarios.honolulu_in_the_middle_of_the'),goal:tr('scenarios.a_path_from_los_angeles_to'),ok:()=>fastPath('lax','syd',1600)&&pathExists('lax','tok')&&R.served>=150}, + {id:'atl',n:tr('scenarios.mid_atlantic_accent'),city:'pdl',cash:3000000,days:1095,rules:{},setup:()=>{S.lvl=Math.max(S.lvl||1,4);},d:tr('scenarios.ponta_delgada_in_the_azores_halfway'),goal:tr('scenarios.1_6t_on_every_hop_from'),ok:()=>fastPath('mia','mad',1600)&&fastPath('lis','lag',1600)&&R.served>=100}, +]; +const WEEK_CITIES=['fra','ams','lon','nyc','ash','sjc','sin','tok','syd','sao','jnb','bom','waw','ist','scl','hkg']; +const WEEK_MODS=[{id:'pricey',n:tr('scenarios.transit_costs_30_more')},{id:'chaos',n:tr('scenarios.twice_the_failures')},{id:'poor',n:tr('scenarios.start_with_only_100k')},{id:'boom',n:tr('scenarios.eyeballs_grow_50_faster')},{id:'dk',n:tr('scenarios.every_ix_is_run_by_de')},{id:'sharks',n:tr('scenarios.shark_season_subsea_cuts_twice_as')}]; +function weekly(){const {y,w}=isoWeek(new Date());let r=(y*100+w)*2654435761>>>0;const nx=()=>{r=(r*1103515245+12345)>>>0;return r/4294967296;};const city=WEEK_CITIES[Math.floor(nx()*WEEK_CITIES.length)];const mods=[];while(mods.length<2){const m=WEEK_MODS[Math.floor(nx()*WEEK_MODS.length)];if(!mods.includes(m))mods.push(m);}return {id:'weekly',key:`${y}-W${String(w).padStart(2,'0')}`,seed:y*100+w,city,mods,days:365};} +const scnRule=k=>!!(S&&S.scn&&S.scn.rules&&S.scn.rules[k]); +function scnHof(){try{return JSON.parse(localStorage.getItem('sot-scn')||'{}')||{};}catch(e){return {};}} +function beginGame(nm,city,o={}){if(needPitch()&&!UI.pitched){UI.pendGame=[nm,city,o];openModal(pitchHtml(true));return;}newGame(nm,city);S.mode=o.mode||'normal'; + if(S.mode==='sandbox'){S.cash=1e9;S.lvl=LEVELS.length;S.nextFail=1e9;S.nextEvent=1e9;} + if(o.scn){const sc=o.scn;S.scn={id:sc.id,rules:sc.rules||{},days:sc.days,name:sc.n||tr('features.weekly_challenge_key',{key:sc.key}),key:sc.key||null,mods:(sc.mods||[]).map(m=>m.id)};S.rng=(o.seed||hstr(sc.id))|0;S.mode='scenario';S.asn=200000+Math.floor(Math.random()*15000); + if(sc.cash)S.cash=sc.cash;if(sc.setup)sc.setup(); + for(const m of S.scn.mods){if(m==='pricey')S.priceMul=1.3;if(m==='poor')S.cash=100000;if(m==='chaos')S.scn.rules.chaos=true;if(m==='boom')S.scn.rules.boom=true;if(m==='dk')S.scn.rules.dkAll=true;if(m==='sharks')S.scn.rules.sharks=true;}} + track('game_new');UI.started=true;closeModal();compute();cam.x=CITY[city].x;cam.y=CITY[city].y;cam.z=innerWidth<760?1.1:1.4;selectCity(city); + toast(S.scn?`${esc(S.scn.name)}
${o.scn.goal?esc(o.scn.goal)+'.':tr('common.serve_as_much_traffic_as_you')} ${tr('scenarios.you_have_n_days',{n:S.scn.days})}`:S.mode==='sandbox'?tr('scenarios.sandbox_mode_a_billion_dollars_every'):tr('scenarios.welcome_name_the_ripe_ncc_assigned',{name:esc(nm),asn:S.asn,city:CITY[city].name}),'goal'); + renderAll();save();if(!S.scn&&S.mode!=='sandbox')tutorialStart();} diff --git a/src/game/60-features/30-conferences.js b/src/game/60-features/30-conferences.js new file mode 100644 index 0000000..5e292ca --- /dev/null +++ b/src/game/60-features/30-conferences.js @@ -0,0 +1,15 @@ +/* ---------- conference season ---------- */ +const CONFS=[{n:'NANOG',c:'chi',m:1},{n:'APRICOT',c:'sin',m:1},{n:'Peering Days',c:'waw',m:2},{n:'DKNOG',c:'cph',m:2,j:N_('conferences.the_hallway_track_moved_to_a')},{n:'UKNOF',c:'lon',m:3},{n:'MENOG',c:'dxb',m:3},{n:'NZNOG',c:'akl',m:3},{n:'RIPE',c:'ams',m:4},{n:'NANOG',c:'sea',m:5},{n:'IX Forum',c:'tok',m:6},{n:'AfPIF',c:'nbo',m:7},{n:'AusNOG',c:'syd',m:8},{n:'NLNOG Day',c:'ams',m:8},{n:'LACNOG',c:'sao',m:9},{n:'NANOG',c:'ash',m:9},{n:'DENOG',c:'fra',m:10},{n:'RIPE',c:'ber',m:10},{n:'PTT Forum',c:'sao',m:11},{n:'PacNOG',c:'suv',m:11}]; +const CONF_COST=8000,CONF_DAYS=45; +const confDay=(cf,y)=>y*360+cf.m*30+9; +function confKey(cf,y){return cf.n+'@'+cf.c+'@'+y;} +function upcomingConfs(within){const y0=Math.floor(S.day/360),out=[];for(const y of [y0,y0+1])for(const cf of CONFS){const d=confDay(cf,y);if(d>=S.day&&d-S.day<=within)out.push({...cf,day:d,key:confKey(cf,y)});}return out.sort((a,b)=>a.day-b.day);} +function confBoost(id){const cb=S.conf;if(!cb||!(cb.until>S.day))return 1;const n=NET[id];return n&&n.pops.some(c=>CITY[c]&&CITY[c].reg===cb.reg)?0.5:1;} +function confTick(d){S.confReg=S.confReg||{}; + for(const cf of upcomingConfs(30)){if(cf.day-d===30&&!S.confReg[cf.key])toast(tr('conferences.conf_comes_to_city_in_30',{conf:esc(cf.n),city:esc(CITY[cf.c].name)}),'goal',[{l:tr('common.show_me'),act:'leftTab',args:{t:'deals'}}]);} + for(const cf of upcomingConfs(0)){if(cf.day!==d||!S.confReg[cf.key])continue;const reg=CITY[cf.c].reg;S.conf={until:d+CONF_DAYS,reg,name:cf.n};S.stats.confs=(S.stats.confs||0)+1; + const r=Math.random();let extra='';if(r<0.3){const cash=5000+Math.floor(Math.random()*4)*5000;S.cash+=cash;extra=' '+tr('conferences.you_also_won_the_raffle_cash',{cash:fmt$(cash)});}else if(r<0.5)extra=' '+tr('conferences.someone_from_goggle_bought_you_a');if(cf.j)extra=' '+tr(cf.j)+(r<0.3?extra:''); + toast(tr('conferences.conf_in_city_you_shook_a',{conf:esc(cf.n),city:esc(CITY[cf.c].name),n:CONF_DAYS,region:esc(REG[reg])})+extra,'goal');sfx('coin');}} +function confSection(){const up=upcomingConfs(75).slice(0,3),cb=S.conf&&S.conf.until>S.day?S.conf:null;if(!up.length&&!cb)return ''; + return `

${tr('common.conferences')}

${cb?`
${tr('conferences.name_glow_n_days_left',{name:esc(cb.name),n:cb.until-S.day})}
${tr('conferences.selective_networks_in_region_need',{region:esc(REG[cb.reg])})}
`:''}${up.map(cf=>{const reg=S.confReg&&S.confReg[cf.key];return `
${esc(cf.n)} · ${esc(CITY[cf.c].name)}
${cf.day===S.day?tr('common.today'):tr('conferences.in_n_days',{n:cf.day-S.day})} · ${esc(REG[CITY[cf.c].reg])}
${reg?''+tr('common.registered')+'':cf.day<=S.day?''+tr('common.registration_closed')+'':btn(tr('conferences.attend_cost',{cost:fmt$(CONF_COST)}),'confGo',{key:cf.key},'sm',S.cash`;}).join('')}`;} + diff --git a/src/game/60-features/40-tutorial.js b/src/game/60-features/40-tutorial.js new file mode 100644 index 0000000..413f888 --- /dev/null +++ b/src/game/60-features/40-tutorial.js @@ -0,0 +1,16 @@ +/* ---------- guided first game ---------- */ +const TUT=[ + {t:tr('tutorial.your_router_is_live_press_launch'),sel:'[data-act="launchBB"]',ok:()=>S.pops[S.home]&&S.pops[S.home].bb}, + {t:tr('tutorial.your_customers_want_the_whole'),sel:'[data-act="tab"][data-args*=\'"up"\'],[data-act="buyTransit"]',ok:()=>S.transit.length>0,skip:()=>!NETS.some(n=>sellsAt(n,S.home))}, + {t:tr('tutorial.transit_costs_money_per_gigabit'),sel:'[data-act="tab"][data-args*=\'"peer"\'],[data-act="buyIx"],[data-act="rs"]',ok:()=>Object.keys(S.rs).length>0,skip:()=>!ixName(S.home)}, + {t:tr('tutorial.start_the_clock_with_1_and'),sel:'#sp1',ok:()=>S.day>=5}, + {t:tr('tutorial.grow_drag_from_your_pink_router'),sel:null,ok:()=>S.links.length>0}, + {t:tr('tutorial.businesses_pop_up_as_bubbles_on'),sel:'[data-act="leftTab"][data-args*=\'"deals"\']',ok:()=>S.biz.length>0}, +]; +function tutorialStart(){let done=false;try{done=!!localStorage.getItem('sot-tut');}catch(e){}if(done||window.__TUBES_TEST__&&!window.__TUBES_TUT__)return;S.tut=0;renderCoach();} +function renderCoach(){const el=$('coach');if(!el)return;document.querySelectorAll('.coach-glow').forEach(x=>x.classList.remove('coach-glow')); + if(!S||S.tut===undefined||S.tut===null||S.lost){el.hidden=true;return;} + while(S.tut=TUT.length){S.tut=null;el.hidden=true;try{localStorage.setItem('sot-tut','1');}catch(e){}toast(tr('tutorial.you_know_the_basics_the_goals'),'goal');return;} + const st=TUT[S.tut];el.innerHTML=`
${tr('tutorial.step_n_of_total',{n:S.tut+1,total:TUT.length})}${esc(st.t)}
${btn(tr('common.skip_tutorial'),'tutSkip',{},'ghost sm')}`;el.hidden=false; + if(st.sel){const t=document.querySelector(st.sel);if(t)t.classList.add('coach-glow');}} diff --git a/src/game/60-features/50-traceroute.js b/src/game/60-features/50-traceroute.js new file mode 100644 index 0000000..00209a6 --- /dev/null +++ b/src/game/60-features/50-traceroute.js @@ -0,0 +1,43 @@ +/* ---------- traceroute and looking glass ---------- */ +const slug=t=>String(t).toLowerCase().normalize('NFKD').replace(/[̀-ͯ]/g,'').replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'x'; +function trPaths(src){const live=S.links.filter(l=>!linkDown(l)),rem=remoteCities(),ok=c=>popUp(c)||rem.includes(c),adj={}; + for(const l of live){if(!ok(l.a)||!ok(l.b))continue;const w=(l.km+60)*MET[l.metric||'normal'].f;(adj[l.a]=adj[l.a]||[]).push([l.b,l,w]);(adj[l.b]=adj[l.b]||[]).push([l.a,l,w]);} + const dist={[src]:0},prev={},done=new Set();for(;;){let u=null,ud=Infinity;for(const k in dist)if(!done.has(k)&&dist[k]{if(dist[dst]===undefined)return null;const out=[];let v=dst;while(v!==src){const l=prev[v];out.unshift({l,from:l.a===v?l.b:l.a,to:v});v=l.a===v?l.b:l.a;}return out;};return {dist,path};} +function trExits(net){const day=S.day,ev=S.ev,leak=ev.leak&&ev.leak.until>day?ev.leak.net:null,out=[]; + for(const x of S.caches)if(x.net===net&&popUp(x.city)&&!siteDown(x.city,'a'))out.push({k:'c',rank:0,city:x.city,pref:'normal',lab:tr('common.name_cache',{name:NET[net].cache.name}),used:R.useCache[x.id]||0,cap:CACHE_CAP}); + for(const p of S.pni)if(p.net===net&&pniOn(p)&&popUp(p.city)&&liveN(p.city,p.site,p.n))out.push({k:'p',rank:1,city:p.city,pref:p.pref||'normal',lab:tr('common.pni_with_net',{net:NET[net].name}),used:R.usePni[p.id]||0,cap:liveCap(pniG(p),p.city,p.site,p.n)}); + for(const c in S.ixp)if(ixSessions(c).has(net)&&(popUp(ixCity(c))||remoteCities().includes(ixCity(c)))&&!(ev.ixdown&&ev.ixdown[c]>day))out.push({k:'ix',rank:2,city:ixCity(c),id:c,pref:(S.ixPref&&S.ixPref[c])||'normal',lab:tr('common.ix_peering',{ix:ixName(c)}),used:R.useIx[c]||0,cap:ixCap(c)}); + for(const t of S.transit)if(popUp(t.city)&&!(t.down>day)&&liveN(t.city,t.site,t.n)&&net!==leak&&!((ev.depeer>day||scnRule('spat'))&&t.net==='cog'&&net==='ggl'))out.push({k:'t',rank:3,city:t.city,pref:t.pref||'normal',lab:tr('traceroute.name_transit',{name:NET[t.net].name}),tnet:t.net,used:R.useT[t.id]||0,cap:liveCap(PORT[t.tier].g,t.city,t.site,t.n)}); + return out;} +function traceroute(src,to){const P=trPaths(src),me=slug(S.name)+'.net',lines=[],ip=(a,b)=>`100.64.${a%250}.${b%250}`;let rtt=0.3,n=1; + const hop=(host,addr,extra,note)=>{rtt+=extra;lines.push(`${String(n++).padStart(2)} ${host} (${addr}) ${rtt.toFixed(1)} ms${note?' ← '+note:''}`);}; + hop(`lo0.cr1.${src}.${me}`,ip(hstr(src),1),0,tr('traceroute.city_your_router',{city:CITY[src].name})); + const walk=path=>{for(const h of path){const l=h.l,lat=linkLat(l)*2+0.15;hop(`ae${1+hstr(l.id)%9}.cr1.${h.to}.${me}`,ip(hstr(h.to),2),lat,`${CITY[h.to].name} · ${l.kind==='df'?tr('common.own_dark_fiber'):l.kind==='vxc'?tr('common.fabric_circuit'):l.cable?CAB[l.cable].name:tr('common.terrestrial_wave')} · ${capName(l)}`);}}; + if(to.city){const path=P.path(to.city);lines.unshift(`traceroute to ${to.city}.${me} (${CITY[to.city].name}), 30 hops max`);if(!path){lines.push(' 2 * * * ← '+tr('traceroute.no_working_path_between_these_pops'));return {text:lines.join('\n'),why:tr('traceroute.no_path_every_route_between_these')};}walk(path);return {text:lines.join('\n'),why:S.te&&S.te.on?trn('traceroute.internal_path_over_n_link_chosen',path.length):trn('traceroute.internal_path_over_n_link_chosen_8620',path.length)};} + const N=NET[to.net],ex=trExits(to.net).filter(e=>P.dist[e.city]!==undefined); + lines.unshift(`traceroute to www.${slug(N.name)}.example (${N.name}, AS${N.asn}) from ${CITY[src].name}, 30 hops max`); + if(!ex.length){lines.push(' 2 * * *\n 3 * * * ← '+tr('traceroute.n_network_unreachable'));return {text:lines.join('\n'),why:tr('traceroute.nothing_on_your_network_reaches_net',{net:N.name,city:CITY[src].name}),asPath:null};} + ex.sort((a,b)=>(a.pref==='low'?4:a.rank)-(b.pref==='low'?4:b.rank)||(a.pref==='high'?0:1)-(b.pref==='high'?0:1)||P.dist[a.city]-P.dist[b.city]); + const e=ex.find(x=>x.usedkmBetween(e.city,c)S.day?35:20}):''; + return {text:lines.join('\n'),why:`${tr('traceroute.exit_exit_in_city',{exit:e.lab,city:CITY[e.city].name})} ${tr('traceroute.rule_and_closer_exits_win_ties',{rule:order[0].toUpperCase()+order.slice(1)})}${e.pref!=='normal'?tr('traceroute.this_one_is_set_to_mode',{mode:e.pref==='high'?tr('common.prefer'):tr('common.backup_only')}):''}.${e.used>=e.cap*0.999?' '+tr('traceroute.it_is_full_so_some_traffic'):''}${cn}`,asPath};} +function traceModal(src,to){const pops=Object.keys(S.pops).sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name));src=src&&S.pops[src]?src:UI.trFrom&&S.pops[UI.trFrom]?UI.trFrom:S.home&&S.pops[S.home]?S.home:pops[0]; + const nets=NETS.slice().sort((a,b)=>b.share-a.share),t=to||UI.trTo||'net:ggl';UI.trFrom=src;UI.trTo=t; + const r=t.startsWith('net:')?traceroute(src,{net:t.slice(4)}):traceroute(src,{city:t.slice(5)}); + openModal(`
${tr('common.looking_glass')}

${tr('common.traceroute')}

+
+ ${btn(tr('common.run'),'traceRun',{},'pink sm')}
+
${esc(r.text)}
${r.asPath?`

${tr('traceroute.as_path_path',{path:r.asPath.map(a=>'AS'+a).join(' → ')})}

`:''}

${esc(r.why)}

+
${btn(tr('common.copy'),'traceCopy',{},'ghost sm')}
`);UI.trText=r.text;} + diff --git a/src/game/60-features/60-share-card.js b/src/game/60-features/60-share-card.js new file mode 100644 index 0000000..2178751 --- /dev/null +++ b/src/game/60-features/60-share-card.js @@ -0,0 +1,27 @@ +/* ---------- share card ---------- */ +// Straight link segments in map coordinates for flat maps. A link across the date line leaves one edge +// and comes back in at the other, so it becomes two segments, one per edge (#42). +function linkSegs(){const out=[];for(const l of S.links){const A=CITY[l.a],B=CITY[l.b];if(!A||!B)continue;const d=Math.abs(B.x-A.x)>W/2?(B.xi?g.lineTo(mx+q[0]*sx,my+q[1]*sy):g.moveTo(mx+q[0]*sx,my+q[1]*sy));g.closePath();g.fill();g.stroke();} + g.strokeStyle='#FF4F9A';g.lineWidth=2.5;for(const [x1,y1,x2,y2] of linkSegs()){g.beginPath();g.moveTo(mx+x1*sx,my+y1*sy);g.lineTo(mx+x2*sx,my+y2*sy);g.stroke();} + for(const c in S.pops){const C=CITY[c];g.fillStyle='#FF4F9A';g.strokeStyle='#1E2640';g.lineWidth=2;g.beginPath();g.arc(mx+C.x*sx,my+C.y*sy,5,0,7);g.fill();g.stroke();} + g.restore();g.strokeStyle='#1E2640';g.lineWidth=5;g.strokeRect(mx,my,mw,mh); + // header + g.fillStyle='#1E2640';g.font='900 54px "Baloo 2", sans-serif';g.textBaseline='top';g.fillText(S.name,40,28); + g.font='800 26px Nunito, sans-serif';g.fillText(`AS${S.asn} · ${tierLabel()} · ${dateStr(S.day)}${S.mode==='sandbox'?' · '+tr('common.sandbox'):''}`,42,92); + // stats + const got=BADGES.filter(b=>S.ach&&S.ach[b.id]!==undefined),rk={l:0,e:1,r:2,c:3},top=got.slice().sort((a,b)=>rk[a.r]-rk[b.r]).slice(0,8); + const rows=[[tr('common.peak_traffic'),fmtG(S.stats.peak||0)],[tr('common.peered'),pct(R.peerShare||0)],[tr('common.pops'),tr('share_card.n_in_r_regions',{n:Object.keys(S.pops).length,r:regionsCount()})],[tr('common.links'),String(S.links.length)],[tr('common.customers'),String(S.biz.length)],[tr('common.incidents_survived'),String(S.stats.survived||0)],[tr('common.shark_bites'),String(S.stats.sharks||0)],[tr('common.badges'),`${got.length}/${BADGES.length}`]]; + if(S.scn)rows.unshift([scnName(),S.scn.done?(S.scn.id==='weekly'?tr('share_card.score_v',{v:fmtG(S.scn.score||S.stats.peak||0)}):tr('features.done_in_d_days',{d:S.scn.done})):S.scn.failed?tr('share_card.not_this_time'):tr('common.in_progress')]); + let y=150;for(const [k,v] of rows.slice(0,9)){g.fillStyle='#fff';g.strokeStyle='#1E2640';g.lineWidth=3;g.beginPath();g.roundRect?g.roundRect(770,y,390,42,12):g.rect(770,y,390,42);g.fill();g.stroke();g.fillStyle='#5A6280';g.font='800 18px Nunito, sans-serif';g.fillText(k,786,y+11);g.fillStyle='#1E2640';g.font='900 22px Nunito, sans-serif';const tw=g.measureText(v).width;g.fillText(v,1146-tw,y+9);y+=48;} + g.font='34px sans-serif';top.forEach((b,i)=>g.fillText(b.i,40+i*48,520)); + g.fillStyle='#1E2640';g.font='900 30px "Baloo 2", sans-serif';g.fillText('seriesoftub.es',40,572);g.font='700 20px Nunito, sans-serif';g.fillText(tr('share_card.build_the_internet_one_tube_at'),300,580); + return cv;} +function shareModal(){const cv=shareCanvas();if(!cv){toast(tr('share_card.your_browser_cannot_draw_the_card'),'bad');return;}let url='';try{url=cv.toDataURL('image/png');}catch(e){} + UI.shareCv=cv;openModal(`
${tr('common.share')}

${tr('share_card.your_network_card')}

${url?`${tr('share_card.stats_card_for_name',{name:esc(S.name)})}`:''}
${navigator.share?btn(tr('common.share_2cd9'),'shareGo',{},'pink'):''}${btn(tr('common.download_png'),'shareDl',{},navigator.share?'':'pink')}

${tr('share_card.post_it_wherever_your_peering')}

`);track('share_open');} +function shareFile(cb){const cv=UI.shareCv;if(!cv||!cv.toBlob){cb(null);return;}cv.toBlob(b=>cb(b?new File([b],`series-of-tubes-${slug(S.name)}.png`,{type:'image/png'}):null),'image/png');} diff --git a/src/game/60-features/70-scenario-progress.js b/src/game/60-features/70-scenario-progress.js new file mode 100644 index 0000000..7ebd962 --- /dev/null +++ b/src/game/60-features/70-scenario-progress.js @@ -0,0 +1,12 @@ +function scnTick(d){const sc=S.scn;if(!sc||sc.done||sc.failed)return; + if(sc.id==='weekly'){if(d>=sc.days){sc.done=d;const score=Math.round(S.stats.peak||0);sc.score=score;let best=null;try{const wk=JSON.parse(localStorage.getItem('sot-weekly')||'{}');best=wk[sc.key];if(!best||score>best){wk[sc.key]=score;localStorage.setItem('sot-weekly',JSON.stringify(wk));}}catch(e){} + const h=scnHof();h.weekly=h.weekly||{d:new Date().toISOString().slice(0,10)};try{localStorage.setItem('sot-scn',JSON.stringify(h));}catch(e){} + openModal(`
${tr('features.weekly_challenge_key',{key:esc(sc.key)})}

${tr('scenario_progress.your_score_score',{score:fmtG(score)})}

${best&&best>score?tr('scenario_progress.peak_traffic_served_in_one_year',{best:fmtG(best)}):best?tr('scenario_progress.peak_traffic_served_in_one_year_c7e5'):tr('scenario_progress.peak_traffic_served_in_one_year_a67b')}

${btn(tr('scenario_progress.share_my_result'),'share',{},'pink big')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost big')}
`);track('weekly_done');}return;} + const def=SCN.find(x=>x.id===sc.id);if(!def)return;let ok=false;try{ok=def.ok();}catch(e){} + if(ok){sc.done=d;const h=scnHof();if(!h[sc.id]||h[sc.id].days>d)h[sc.id]={d:new Date().toISOString().slice(0,10),days:d};try{localStorage.setItem('sot-scn',JSON.stringify(h));}catch(e){}track('scenario_'+sc.id); + openModal(`
${tr('common.scenario_complete')}

${tr('scenario_progress.name_done_in_d_days',{name:esc(def.n),d})}

${esc(def.goal)}. ${d

${btn(tr('scenario_progress.share_my_result'),'share',{},'pink big')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost big')}${btn(tr('common.more_scenarios'),'scenarios',{},'ghost')}
`);sfx('coin');} + else if(d>=def.days){sc.failed=d;openModal(`
${tr('common.scenario_over')}

${tr('common.time_s_up')}

${tr('scenario_progress.goal_was_not_reached_in_d',{goal:esc(def.goal),d:def.days})}

${btn(tr('common.try_again'),'startScn',{id:def.id},'pink big')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost big')}
`);}} +function scenarioModal(){const wk=weekly(),h=scnHof();let best=null;try{best=JSON.parse(localStorage.getItem('sot-weekly')||'{}')[wk.key];}catch(e){} + openModal(`
${tr('common.scenarios')}

${tr('scenario_progress.pick_a_challenge')}

+
${tr('features.weekly_challenge_key',{key:esc(wk.key)})}
${tr('scenario_progress.start_in_city_mods_one_year',{city:esc(CITY[wk.city].name),mods:wk.mods.map(m=>esc(m.n)).join(' · ')})}${best?' '+tr('scenario_progress.your_best_best',{best:fmtG(best)}):''}
${btn(tr('common.play'),'startWeekly',{},'pink')}
+ ${SCN.map(x=>`
${esc(x.n)} ${h[x.id]?`${tr('features.done_in_d_days',{d:h[x.id].days})}`:''}
${esc(x.d)}
${tr('scenario_progress.goal_goal_time_d_days_start',{goal:esc(x.goal),d:x.days,city:esc(CITY[x.city].name)})}
${btn(tr('common.play'),'startScn',{id:x.id},'')}
`).join('')}`);} diff --git a/src/game/60-features/80-new-game.js b/src/game/60-features/80-new-game.js new file mode 100644 index 0000000..f305e76 --- /dev/null +++ b/src/game/60-features/80-new-game.js @@ -0,0 +1,6 @@ +function newGame(name,home){ + S={v:1,name,asn:200000+Math.floor(_rand()*15000),home,day:0,cash:START_CASH, + ltv:2,t1v:2,auV:1,seen:NETS.map(n=>n.id),spares:{},pops:{[home]:{day:0,bb:null,boost:0,down:0,routers:1,gen:false}},links:[],nni:[],transit:[],ixp:{},rs:{},peers:{},pni:[],caches:[],biz:[],offers:[],myIx:{}, + done:{},inc:[],ev:{ddosMore:[]},ddosStarts:[],priceMul:1,nextFail:45,nextEvent:40,usedNames:[],stats:{survived:0,incidents:0,peak:0},cnLic:{state:'none'},scrubs:[],scrubMode:'always',won:false,lost:false,neg:0,loans:[],loanOffers:[],loanStrikes:0,inbox:{items:[],down:{},tiny:{},rep:0,bot:false,log:[],seq:0},hw:{}}; +} + diff --git a/src/game/70-rules/10-helpers.js b/src/game/70-rules/10-helpers.js new file mode 100644 index 0000000..c082d5e --- /dev/null +++ b/src/game/70-rules/10-helpers.js @@ -0,0 +1,24 @@ +/* ================= HELPERS ================= */ +const fmt$=v=>{const a=Math.abs(v),s=v<0?'-':'';if(a>=1e6)return s+'$'+(a/1e6).toFixed(a>=1e7?1:2)+'M';if(a>=1e3)return s+'$'+(a/1e3).toFixed(a>=1e5?0:1)+'k';return s+'$'+Math.round(a);}; +const fmtG=g=>g>=1000?(g/1000).toFixed(g>=10000?1:2)+' Tbps':(g>=100?g.toFixed(0):g.toFixed(1))+' Gbps'; +const pct=x=>Math.round(x*100)+'%'; +// Reach never rounds up to 100%: Tier 1 needs more than 99.9%, and 99.6% must not look like a full house (#73). +const reachPct=x=>x>0.999?'100%':x>=0.99?(Math.floor(x*1000)/10).toFixed(1)+'%':pct(x); +const clamp=(v,a,b)=>Math.max(a,Math.min(b,v)); +const pick=a=>a[Math.floor(Math.random()*a.length)]; +const esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); +function dateStr(d){const y=1+Math.floor(d/360),m=Math.floor(d/30)%12,dd=d%30+1;return tr('helpers.y_y_mon_d',{y,mon:MONTHS[m],d:dd});} +function wrapDx(a,b){let dx=b-a;if(dx>W/2)dx-=W;if(dx<-W/2)dx+=W;return dx;} +function kmBetween(a,b){const A=CITY[a],B=CITY[b];return Math.max(20,Math.round(hav(A.lon,A.lat,B.lon,B.lat)));} +// Cities on a land bridge belong to two landmasses: Cairo reaches Asia overland across the Sinai, the way +// Istanbul does across the Bosporus (#47). Overland between continents still costs the intercontinental price. +const lands=C=>C.land2?[C.land,C.land2]:[C.land]; +const isSub=(a,b)=>{const A=lands(CITY[a]),B=lands(CITY[b]);return !A.some(x=>B.includes(x));}; +const popUp=c=>S.pops[c]&&!(S.pops[c].down>S.day); +const regionsCount=()=>new Set(Object.keys(S.pops).map(c=>CITY[c].reg)).size; +const ixCity=x=>String(x).split('~')[0]; +function ixIdsIn(c){const o=ixStatic(c);if(S&&S.myIx&&S.myIx[c]&&!o.includes(c))o.unshift(c);return o;} +const hasIxAt=c=>ixIdsIn(c).some(x=>S.ixp[x]!==undefined); +function ixName(c){if(XIXM[c])return XIXM[c].name;return S.myIx[c]?S.myIx[c].name:CITY[c].ix;} +// IX.brrr Campinas already says where it is, so messages skip "in Campinas" (#134) +const ixNamesCity=c=>String(ixName(c)||'').toLowerCase().includes(CITY[ixCity(c)].name.toLowerCase()); diff --git a/src/game/70-rules/20-exchanges.js b/src/game/70-rules/20-exchanges.js new file mode 100644 index 0000000..d6825f3 --- /dev/null +++ b/src/game/70-rules/20-exchanges.js @@ -0,0 +1,30 @@ +/* Australian exchanges follow PeeringDB (every Australian exchange's member list, Oct 2026): networks that sit on + every IX elsewhere list the Australian cities they really peer in as auIx, and the big incumbents peer only privately. */ +/* Transit in Australia is sold only by carriers with an Australian site and at least ten Australian networks buying + from them (RIPEstat, Oct 2026): Telstraya, Hocus Pocus, Speedyloop, SingTell, Drizzle Electric, Cogentle, + Not That Telecom and Level Tree (whose real-world network lists no sites in PeeringDB at all, but sells in Sydney). Others can sit in + an Australian city, like the Pacific carriers backhauling to Sydney, but reach Australian customers only from overseas. */ +const AU_SELLERS=['tsy','voc','spl','sgt','drz','cog','ntt','lvl'],sellsAt=(n,c)=>!!n.price&&n.pops.includes(c)&&(!CITY[c].au||AU_SELLERS.includes(n.id)); +const onIx=(n,c)=>CITY[c].au&&n.auIx?n.auIx.includes(c):n.ix==='ALL'||Array.isArray(n.ix)&&n.ix.includes(c); +function ixMembers(c){if(XIXM[c])return XIXM[c].members.slice();if(S.myIx[c])return S.myIx[c].members.slice();if(!CITY[c].ix)return [];return NETS.filter(n=>onIx(n,c)).map(n=>n.id);} +// LAG: several identical ports bundled into one logical link. Flow hashing is never perfectly even, so a bundle carries ~95% of the sum. +const LAG_MAX=8; +function lagCap(g,n){n=n||1;return g*n*(n>1?0.95:1);} +function lagName(tier,n){return (n||1)>1?`${n}×${PORT[tier].n} LAG`:tr('common.port_port',{port:PORT[tier].n});} +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; + for(const id of ixMembers(c)){const n=NET[id]; + if(S.peers[id+'@'+c]&&!snub(id,c)&&!(isRemote(c)&&noRemote(id))&&!mpDown(id,c))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; +} +function t1Club(){ + const miss=[];const pops=Object.keys(S.pops).length; + if(regionsCount()<3)miss.push(tr('exchanges.pops_on_3_continents')); + if(pops<10)miss.push(tr('exchanges.10_pops_n',{n:pops})); + if(R.served<1500)miss.push(tr('exchanges.serve_1_5_tbps_v',{v:fmtG(R.served)})); + if(R.sessions<20)miss.push(tr('exchanges.20_peering_sessions_n',{n:R.sessions})); + return {ok:!miss.length,missing:miss}; +} diff --git a/src/game/70-rules/30-pnis.js b/src/game/70-rules/30-pnis.js new file mode 100644 index 0000000..a0963be --- /dev/null +++ b/src/game/70-rules/30-pnis.js @@ -0,0 +1,19 @@ +/* ---------- PNIs with the big networks: slow orders and no small ports ---------- + Big content networks, Tier 1s and big eyeball networks usually deliver a PNI or an augment in about 30 days, but + 15% of orders get lost in provisioning for 6 to 12 months. The content networks and Tier 1s start at 100G. Doitsche Telekomm sells PNIs down to 1G, and takes its time too. */ +const pniBig=id=>{const n=NET[id];return n.type==='t1'||(n.type==='cdn'&&n.pol!=='open')||(n.type==='eye'&&n.share>=0.02);}; +const pniMin=id=>{const n=NET[id];return n.type==='t1'||(n.type==='cdn'&&n.pol!=='open')?1:0;}; +const pniG1=id=>id==='dtk'; +// A beer with their peering coordinator at a conference halves the wait. It is how it really works. +const PNI_SLOW=0.15,pniLead=id=>{const n=pniBig(id)?(Math.random()S.day?Math.round(n/2):n;}; +const pniG=p=>p.g1?1:PORT[p.tier].g,pniPN=p=>p.g1?'1G':PORT[p.tier].n,pniOn=p=>!(p.ready>S.day); +const pniEta=id=>pniBig(id)?tr('pnis.delivery_about_a_month_sometimes_6'):tr('pnis.delivery_2_to_6_weeks'); +const PNI_G1_COST=1200,pniWhen=n=>n>=60?tr('pnis.their_team_quotes_m_months',{m:Math.round(n/30)}):tr('pnis.ready_in_about_n_days',{n}); +function pniWait(p,c){return `
${(p.n||1)>1?p.n+'×':''}${pniPN(p)} PNI${tr('common.on_order')}
${tr('pnis.about_n_days_to_go_nothing',{n:Math.max(0,p.ready-S.day)})}
${btn(tr('common.chase_it'),'pniChase',{id:p.id},'ghost sm')}${btn(UI.confirm===p.id?tr('common.really_remove'):tr('pnis.cancel_the_order'),'cancelPni',{id:p.id},'ghost sm')}
`;} +function pniDay(d){for(const p of S.pni){const nm=esc(NET[p.net].name),city=esc(CITY[p.city].name); + if(p.ready===d)toast(tr('pnis.pni_with_net_is_up_in',{net:nm,city,dc:esc(siteName(p.city,'a'))}),'good'); + if(p.up&&p.up.ready<=d){p.tier=p.up.tier;p.n=p.up.n;if(p.up.g1)p.g1=true;else delete p.g1;delete p.up;toast(tr('pnis.augment_with_net_delivered_in_city',{net:nm,city,port:((p.n||1)>1?p.n+'×':'')+pniPN(p)}),'good');}}} +// Microsnoft has no capacity on the US east coast. Not for a PNI, not at an exchange, not for anyone. +const US_EAST=['ash','nyc','bos','atn','mia']; +const MSF_NOPE=[N_('pnis.no_capacity_in_us_east_you'),N_('pnis.us_east_is_sold_out_until'),N_('pnis.their_peering_team_says_us_east'),N_('pnis.a_new_region_is_coming_online')]; +const msfNope=(id,city)=>id==='msf'&&!!city&&US_EAST.includes(ixCity(city)); diff --git a/src/game/70-rules/40-peering-inbox.js b/src/game/70-rules/40-peering-inbox.js new file mode 100644 index 0000000..de650c6 --- /dev/null +++ b/src/game/70-rules/40-peering-inbox.js @@ -0,0 +1,83 @@ +/* ---------- The peering inbox ---------- + Every exchange port brings mail: peering requests from networks nobody has heard of, and sessions that drop + because someone's PeeringDB says 50 prefixes and they now send 400 (or a full table). Answer it, or hire an AI. */ +const PPOL_N={open:N_('peering_inbox.open_to_all'),selective:N_('common.selective'),closed:N_('common.closed')},PPOL_D={open:N_('peering_inbox.everyone_who_asks_gets_a_session'),selective:N_('peering_inbox.fewer_requests_and_you_answer_them'),closed:N_('peering_inbox.nobody_asks_and_no_route_servers')}; +const AI_MO=Math.round(20e6/12),INBOX_MAX=80,IBX_LEAKS=['nfx','ggl','fbk','amz','msf']; +const TINY=['Basement Broadband','Uncle Dave’s WISP','Fibre Fiesta','Raspberry Pi Transit','Vanity ASN Ltd','Moonshot Crypto Hosting','Minecraft Collective','Bob’s Bits','Homelab Heroes','Hackerspace Uplink','Tiny Tower Networks','Pigeon Post IP','Retro BBS Revival','Overkill Home Network','Two Guys and a Rack','Big Dreams Small Prefix','Mesh-y Business','Garden Shed Datacenter','Carrier-Grade NAT Fan Club','LIR in a Box','Yet Another VPN','Grandma’s Fibre Co-op','Seedbox Society','The /24 That Could']; +const REQ_SAY=[N_('peering_inbox.hi_we_would_like_to_peer'),N_('peering_inbox.dear_sir_or_madam_please_peer'),N_('peering_inbox.we_noticed_you_are_at_ix'),N_('peering_inbox.hello_please_find_attached_our'),N_('peering_inbox.peering_request_fifth_attempt_is'),N_('peering_inbox.hey_quick_one_can_you_peer'),N_('peering_inbox.greetings_we_are_a_fast_growing'),N_('peering_inbox.please_configure_sessions_with_us_at')]; +const IBX_AI=[N_('peering_inbox.replied_to_a_peering_request_with'),N_('peering_inbox.signed_you_up_for_a_webinar'),N_('peering_inbox.opened_a_ticket_with_itself_to'),N_('peering_inbox.wrote_a_thousand_word_apology_to'),N_('peering_inbox.updated_your_peeringdb_record_your'),N_('peering_inbox.asked_netchill_s_peering_team_to')]; +function ibx(){if(!S.inbox||typeof S.inbox!=='object')S.inbox={items:[],down:{},tiny:{},rep:0,bot:false,log:[],seq:0};return S.inbox;} +// Reputation nudges selective networks by up to 10% either way: worth caring about, never a wall. +// Your peering policy. Open: everyone who asks gets a session and the route servers work. Selective: fewer requests, +// you answer them yourself, and no route servers, so you go and ask networks at each exchange. Closed: nobody asks, +// and customers hear that you are hard to reach. +const PPOL=['open','selective','closed'],ppol=()=>(S&&S.inbox&&PPOL.includes(S.inbox.pol))?S.inbox.pol:'open'; +const repMul=()=>1-clamp((S.inbox&&S.inbox.rep)||0,-10,5)*0.01; +const repName=r=>r>=1?tr('common.responsive'):r>=-2?tr('common.average'):r>=-6?tr('peering_inbox.mostly_ignores_email'):tr('common.black_hole'); +const ibxOpen=()=>S.inbox?S.inbox.items.length:0,ibxUrgent=()=>S.inbox?S.inbox.items.filter(x=>x.k==='mp').length:0; +const mpDown=(id,c)=>{const t=S.inbox&&S.inbox.down[id+'@'+c];return !!t&&t>S.day;}; +const ibxWho=x=>x.net?NET[x.net].name:x.nm,ibxAsn=x=>x.net?NET[x.net].asn:x.asn; +function ibxLog(m,a){const I=ibx();I.log.unshift({d:S.day,m,a:a||{}});I.log.length=Math.min(I.log.length,40);} +function inboxDay(d){const I=ibx(),ixs=Object.keys(S.ixp); + // new peering requests: more exchange ports, more mail + if(ixs.length&&Math.random(){const n=NET[id];return !set.has(id)&&n.type!=='t1'&&n.type!=='cdn'&&n.pol!=='paid'&&n.share<=0.006&&!I.items.some(x=>x.net===id&&x.ix===c);}); + const it={id:++I.seq,k:'req',ix:c,day:d,stale:Math.random()<0.6,yrs:1+Math.floor(Math.random()*9),say:Math.floor(Math.random()*REQ_SAY.length)}; + if(real.length&&Math.random()<0.4)it.net=pick(real);else{it.nm=pick(TINY);it.asn=Math.random()<0.05?64512+Math.floor(Math.random()*1000):200000+Math.floor(Math.random()*200000);} + I.items.push(it);if(ppol()==='open')ibxAnswer(it.id,'accept',true);} + if(ppol()==='closed')I.rep=Math.max(-6,I.rep-0.05); + // max-prefix: someone grew past what their PeeringDB says, or leaked a full table + const ses=Object.keys(S.peers).filter(k=>{const n=NET[k.split('@')[0]];return n&&n.type!=='cdn'&&n.type!=='t1'&&!mpDown(...k.split('@'));}).map(k=>({key:k,net:k.split('@')[0],ix:k.split('@')[1]})) + .concat(Object.keys(I.tiny).map(a=>({key:'t'+a,nm:I.tiny[a].nm,asn:+a,ix:I.tiny[a].ix,stale:I.tiny[a].stale}))); + if(ses.length&&Math.random()y.k==='mp'&&y.key===x.key)){ + const lim=pick([10,20,50,100,200,500,1000]),leak=Math.random()<0.3,yrs=1+Math.floor(Math.random()*9); + I.items.push({id:++I.seq,k:'mp',key:x.key,net:x.net,nm:x.nm,asn:x.asn,ix:x.ix,day:d,lim,got:leak?940000+Math.floor(Math.random()*90000):Math.ceil(lim*(1.15+Math.random()*1.6)),leak,yrs}); + // A session that blows its limit is down for at most a few weeks: the other side eventually notices too. + if(x.net){I.down[x.key]=d+20+Math.floor(Math.random()*20);toast(tr('peering_inbox.max_prefix_limit_hit_who_at',{who:esc(ibxWho(x)),ix:esc(ixName(x.ix))}),'bad',[{l:tr('common.inbox'),act:'inbox',args:{}}]);}}} + // unanswered mail: requests go stale and people start asking around about you + for(const x of I.items){if(x.k==='mp')I.rep-=0.05;else if(d-x.day===14)x.bump=1;} + // A max-prefix alert nobody answers resolves itself in the end: the other side raises it, or gives up. + I.items=I.items.filter(x=>x.k!=='mp'||(x.net?(I.down[x.key]||0)>d:d-x.day<=30)); + const old=I.items.filter(x=>x.k==='req'&&d-x.day>30);if(old.length){I.rep-=0.25*old.length;I.items=I.items.filter(x=>!old.includes(x)); + if(old.some(x=>x.net))toast(tr('peering_inbox.who_asked_a_mailing_list_whether',{who:esc(ibxWho(old.find(x=>x.net))),me:esc(S.name)}),'bad',[{l:tr('common.inbox'),act:'inbox',args:{}}]);} + while(I.items.length>INBOX_MAX){const i=I.items.findIndex(x=>x.k==='req');if(i<0)break;I.items.splice(i,1);I.rep-=0.5;} + I.rep=clamp(I.rep,-10,5); + if(I.bot)inboxBot();} +// Answer one item. a: accept | decline | raise | keep. Returns false when the item is gone. +function ibxAnswer(id,a,bot){const I=ibx(),i=I.items.findIndex(x=>x.id===id);if(i<0)return false;const x=I.items[i];I.items.splice(i,1);const who=ibxWho(x),ix=ixName(x.ix); + if(x.k==='req'){if(a==='accept'){if(x.net){if(S.ixp[x.ix]!==undefined)S.peers[x.net+'@'+x.ix]=true;}else if(Object.keys(I.tiny).length<200)I.tiny[x.asn]={nm:x.nm,ix:x.ix,stale:!!x.stale};I.rep+=0.3;}else I.rep+=0.2;} + else if(a==='raise'){delete I.down[x.key];if(x.leak){const n=pick(IBX_LEAKS);S.ev.leak={net:n,until:S.day+4}; + addInc({type:'leak',ref:n,until:S.day+4,msg:tr('peering_inbox.who_at_ix_was_sending_a',{who,ix,net:NET[n].name}),cost:0}); + if(!bot)toast(tr('peering_inbox.that_was_a_route_leak_who',{who:esc(who),n:x.got.toLocaleString()}),'bad');I.rep-=1;} + else{I.rep+=0.3;if(!bot)toast(tr('peering_inbox.session_with_who_is_back_up',{who:esc(who),n:Math.ceil(x.got*1.5).toLocaleString()}),'good');}} + else{const back=S.day+(x.leak?3:10)+Math.floor(Math.random()*(x.leak?8:21));if(x.net)I.down[x.key]=back;I.rep+=x.leak?0.3:0.1; + if(!bot)toast(x.leak?tr('peering_inbox.good_call_it_was_a_route',{who:esc(who)}):tr('peering_inbox.the_session_stays_down_who_will',{who:esc(who)}),x.leak?'good':'');} + I.rep=clamp(I.rep,-10,5);return true;} +// The AI agent clears the inbox every day. It is fast, polite and wrong about a third of the time. +function inboxBot(){const I=ibx();let acc=0,dec=0; + for(const x of I.items.slice()){const oops=Math.random()<0.3; + if(x.k==='req'){const want=!x.stale||!!x.net;const a=(want!==oops)?'accept':'decline';ibxAnswer(x.id,a,true);a==='accept'?acc++:dec++;if(oops&&a==='decline'&&x.net)ibxLog(N_('peering_inbox.declined_who_at_ix_not_a'),{who:ibxWho(x),ix:ixName(x.ix)});} + else{const a=(x.leak!==oops)?'keep':'raise';ibxAnswer(x.id,a,true); + if(a==='raise'&&x.leak)ibxLog(N_('peering_inbox.raised_the_max_prefix_limit_for'),{who:ibxWho(x),ix:ixName(x.ix),n:Math.ceil(x.got*1.5).toLocaleString()}); + else if(a==='keep'&&!x.leak)ibxLog(N_('peering_inbox.kept_who_down_at_ix_for'),{who:ibxWho(x),ix:ixName(x.ix)}); + else ibxLog(a==='raise'?N_('peering_inbox.raised_the_max_prefix_limit_for_7b4b'):N_('peering_inbox.kept_who_down_at_ix_it'),{who:ibxWho(x),ix:ixName(x.ix)});}} + if(acc||dec)ibxLog(N_('peering_inbox.answered_your_mail_a_accepted_d'),{a:acc,d:dec}); + if(Math.random()<0.01){const ks=Object.keys(S.peers);if(ks.length){const k=pick(ks),[id,c]=k.split('@');delete S.peers[k];ibxLog(N_('peering_inbox.tidied_up_a_session_it_decided'),{who:NET[id].name,ix:ixName(c)});}} + if(Math.random()<0.08)ibxLog(pick(IBX_AI),{});} +function inboxModal(){const I=ibx(),items=I.items.slice().sort((a,b)=>(b.k==='mp')-(a.k==='mp')||b.day-a.day),reqs=items.filter(x=>x.k==='req').length,mps=items.length-reqs; + const age=x=>{const n=S.day-x.day;return n?trn('peering_inbox.n_day_ago',n):tr('common.today_4203');}; + const pdb=x=>x.stale?trn('peering_inbox.peeringdb_last_updated_n_year_ago',x.yrs):tr('peering_inbox.peeringdb_updated_last_month'); + const card=x=>x.k==='mp'?`
⚠️ ${tr('peering_inbox.max_prefix_limit_hit_who_at_5c56',{who:esc(ibxWho(x)),ix:esc(ixName(x.ix))})}
+
AS${ibxAsn(x)} · ${age(x)}

${tr('peering_inbox.configured_lim_prefixes_received_got',{lim:x.lim.toLocaleString(),got:x.got.toLocaleString()})} ${trn('peering_inbox.their_peeringdb_says_lim_last',x.yrs,{lim:x.lim.toLocaleString()})}

+
${btn(tr('peering_inbox.raise_the_limit'),'inboxAct',{id:x.id,a:'raise'},'sm')}${btn(tr('peering_inbox.keep_it_down'),'inboxAct',{id:x.id,a:'keep'},'ghost sm')}
` + :`
${esc(ibxWho(x))} AS${ibxAsn(x)}${x.bump?` ${tr('common.bumped')}`:''}
${esc(ixName(x.ix))} · ${age(x)} · ${pdb(x)}
+

“${esc(tr(REQ_SAY[x.say]||REQ_SAY[0],{ix:ixName(x.ix)}))}”

${btn(tr('common.accept'),'inboxAct',{id:x.id,a:'accept'},'sm')}${btn(tr('common.decline'),'inboxAct',{id:x.id,a:'decline'},'ghost sm')}
`; + openModal(`
${tr('common.peering_inbox')}

📬 ${trn('peering_inbox.n_unanswered',items.length)}

+

${tr('peering_inbox.every_exchange_port_brings_mail')}

+
${tr('common.your_reputation')}${repName(I.rep)}
+
${tr('common.peering_policy')}${tr(PPOL_N[ppol()])}
${PPOL.map(p=>btn(tr(PPOL_N[p]),'inboxPol',{p},ppol()===p?'sm':'ghost sm')).join('')}

${tr(PPOL_D[ppol()])}

+
${I.bot?`
🤖 ${tr('peering_inbox.large_peering_model_is_answering')}
${tr('peering_inbox.price_year_it_never_sleeps_never',{price:fmt$(20e6)})}
+ ${I.log.length?`
${I.log.slice(0,8).map(e=>esc(tr('peering_inbox.day_d',{d:e.d})+': '+tr(e.m,e.a))).join('\n')}
`:''}
${btn(tr('peering_inbox.fire_the_ai'),'inboxBot',{on:0},'ghost sm')}
` + :`
🤖 ${tr('peering_inbox.large_peering_model')}
${tr('peering_inbox.an_ai_agent_that_answers_every',{price:fmt$(20e6)})}
${btn(tr('peering_inbox.hire_it_mo_mo',{mo:fmt$(AI_MO)}),'inboxBot',{on:1},'aibtn sm',S.cash`}
+ ${reqs>1||mps>1?`
${reqs>1?btn(tr('peering_inbox.accept_all_requests'),'inboxAll',{a:'accept'},'sm')+btn(tr('peering_inbox.decline_all_requests'),'inboxAll',{a:'decline'},'ghost sm'):''}${mps>1?btn(tr('peering_inbox.raise_all_max_prefix_limits'),'inboxRaiseAll',{},'sm'):''}
`:''} + ${items.length?items.slice(0,40).map(card).join(''):`

${Object.keys(S.ixp).length?tr('peering_inbox.inbox_zero_enjoy_it_while_it'):tr('peering_inbox.no_mail_yet_buy_an_ix')}

`}`);} diff --git a/src/game/70-rules/50-peering-policy.js b/src/game/70-rules/50-peering-policy.js new file mode 100644 index 0000000..48edcd3 --- /dev/null +++ b/src/game/70-rules/50-peering-policy.js @@ -0,0 +1,32 @@ +/* Big networks sometimes refuse to peer in a particular city, for a while. Each (network, city) + pair gets a stable verdict per window, derived from a hash, so asking again does not reroll it. */ +const SNUB_WIN=150,SNUB_P=0.22; +const SNUB_IX=[tr('peering_policy.only_peers_over_pnis_in_this'),tr('peering_policy.their_ix_port_here_is_full'),tr('peering_policy.moved_everything_in_this_city_to'),tr('peering_policy.the_peering_coordinator_for_this'),tr('peering_policy.their_policy_here_says_ix_peering')]; +const SNUB_ALL=[tr('peering_policy.not_accepting_new_peers_in_this'),tr('peering_policy.region_frozen_while_they_renegotiate'),tr('peering_policy.their_routers_in_this_city_are'),tr('peering_policy.already_reach_you_through_your'),tr('peering_policy.their_lawyers_are_reviewing_every'),tr('peering_policy.a_new_vp_wants_to_monetise')]; +function hstr(t){let h=2166136261;for(let i=0;i>>0;} +function bigPeer(n){return !!n&&n.pol==='selective'&&n.share>=0.03;} +function snub(id,c){ + const n=NET[id];if(!c||!bigPeer(n)||!S||S.myIx[c])return null; + const off=hstr(id+c)%SNUB_WIN,ep=Math.floor((S.day+off)/SNUB_WIN),h=hstr(S.asn+'|'+id+'|'+c+'|'+ep); + if(h%1000>=SNUB_P*1000)return null; + const all=(h>>>10)%5<2,list=all?SNUB_ALL:SNUB_IX; + return {all,why:list[(h>>>13)%list.length],until:(ep+1)*SNUB_WIN-off}; +} +/* 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=`

${tr('peering_policy.remote_peering_is_a_last_resort')}

`; +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);} +/* 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}; +function ixMul(x){const X=XIXM[x],c=ixCity(x);return (X?X.cheap:(CITY[c].ixCheap||1))*(IX_REG[CITY[c].reg]||1)*(CITY[c].au?AU_IX:1)*((S&&S.ixCut&&S.ixCut[x])||1);} +function ixPortMo(c,tier){const X=XIXM[c];if(X&&tier<=(X.freeTo??-1))return 0;return Math.round(PORT[tier].ix*(S.pops[ixCity(c)]?1:REMOTE_FEE)*dkMult(c)*ixMul(c));} +function ixPriceWar(d){if(!S.ixp||Math.random()>=1/120)return; + const mine=Object.keys(S.ixp).filter(x=>{const c=ixCity(x);return CITY[c].reg==='EU'&&ixStatic(c).length>1;});if(!mine.length)return; + const x=pick(mine),c=ixCity(x),rival=pick(ixStatic(c).filter(y=>y!==x)); + if(isDk(x)){toast(tr('peering_policy.rival_is_poaching_de_kicks_members',{rival:esc(ixName(rival)),city:esc(CITY[c].name)}),'bad');return;} + S.ixCut=S.ixCut||{};const cur=S.ixCut[x]||1;if(cur<=0.62)return;S.ixCut[x]=+Math.max(0.6,cur*0.9).toFixed(3); + toast(tr('peering_policy.price_war_in_city_ix_cut',{city:esc(CITY[c].name),ix:esc(ixName(x)),rival:esc(ixName(rival))}),'good');} diff --git a/src/game/70-rules/60-de-kicks.js b/src/game/70-rules/60-de-kicks.js new file mode 100644 index 0000000..d194641 --- /dev/null +++ b/src/game/70-rules/60-de-kicks.js @@ -0,0 +1,30 @@ +/* DE-KICKS Group: runs several big exchanges and really, really hates open pricing. + No price list, personalised quotes, haggling, yearly "harmonisation", auto-enrolled add-ons + you have to opt out of, and a retention offer when you try to leave. */ +const DK_CITIES=['fra','mad','mrs','dxb','bom','nyc']; +const isDk=c=>(DK_CITIES.includes(c)||scnRule('dkAll'))&&!!CITY[c]&&!!CITY[c].ix&&!S.myIx[c]; +const DK_ADDONS=[['Blackholing Plus™',tr('de_kicks.like_blackholing_but_with_a_plus')],['Route Server Gold',tr('de_kicks.the_same_route_server_in_a')],['Premium Port LEDs',tr('de_kicks.your_port_light_now_blinks_in')],['Strategic Peering Insights',tr('de_kicks.a_monthly_pdf_of_your_own')],['GlobePeer Ready™',tr('de_kicks.makes_your_port_ready_for_a')],['Cloud Exchange Readiness Fee',tr('de_kicks.a_fee_for_being_ready_for')],['Account Manager Lunch Fund',tr('de_kicks.your_account_manager_is_hungry')]]; +const DK_STALL=[tr('de_kicks.your_account_manager_would_love_to'),tr('de_kicks.pricing_is_reviewed_by_the_global'),tr('de_kicks.they_sent_a_14_page_nda'),tr('de_kicks.your_account_manager_is_at_a')]; +function dkMult(c){if(!S||!isDk(c)||!S.dk||!S.dk.m[c])return 1;const ret=S.dk.ret[c];return S.dk.m[c]*(ret&&ret>S.day?0.6:1);} +function dkAddonMo(c){return S.dk&&S.dk.add[c]?S.dk.add[c].reduce((a,x)=>a+x.mo,0):0;} +function dkState(){S.dk=S.dk||{m:{},add:{},ret:{},retUsed:{},stall:0,q:null};return S.dk;} +function dkQuoteMult(){const pops=Object.keys(S.pops).length,big=Math.min(1.2,pops*0.04+(R.served||0)/20000);return +(0.95+Math.random()*0.45+big).toFixed(2);} +function dkQuoteModal(){const q=S.dk.q,c=q.city,mo=Math.round(PORT[q.tier].ix*(S.pops[c]?1:REMOTE_FEE)*q.m*ixMul(c)); + openModal(`
${tr('de_kicks.de_kicks_group_sales')}

${tr('de_kicks.your_personalised_port_quote_for_ix',{port:PORT[q.tier].n,ix:esc(ixName(c))})}

+

${tr('de_kicks.thanks_for_your_interest_we_don')}

+
${tr('de_kicks.monthly_price_just_for_you')}${tr('common.price_mo',{price:fmt$(mo)})}
+
${tr('common.list_price')}${tr('common.confidential')}
+
${tr('de_kicks.what_others_pay')}${tr('de_kicks.covered_by_nda')}
+

${tr('de_kicks.quotes_go_up_with_how_big')} ${q.h>=3?tr('de_kicks.your_account_manager_has_stopped'):tr('de_kicks.haggles_left_n',{n:3-q.h})}

+
${btn(tr('de_kicks.sign_price_mo',{price:fmt$(mo)}),'dkAccept',{},'pink',S.cash=3)}${btn(tr('common.walk_away'),'dkWalk',{},'ghost')}
`);} +function dkTick(d){if(!S.dk)return;const dk=S.dk; + for(const c in S.ixp){if(!isDk(c))continue; + if(dk.ret[c]&&dk.ret[c]===d){dk.m[c]=+(dk.m[c]*1.1).toFixed(3);toast(tr('de_kicks.your_ix_promo_ended_price_is',{ix:esc(ixName(c))}),'bad');} + if(dk.m[c]&&(d+hstr(c)%90)%365===0){const f=1.08+Math.random()*0.07;dk.m[c]=+(dk.m[c]*f).toFixed(3);toast(tr('de_kicks.de_kicks_has_harmonised_its_prices',{ix:esc(ixName(c)),p:Math.round((f-1)*100)}),'bad');} + const add=dk.add[c]=dk.add[c]||[]; + if(add.length<3&&Math.random()<1/150){const a=DK_ADDONS.filter(x=>!add.some(y=>y.n===x[0]));if(a.length){const [n,blurb]=pick(a),mo=Math.round((300+Math.random()*1200)/50)*50;add.push({n,blurb,mo,day:d}); + toast(tr('de_kicks.good_news_you_ve_been_enrolled',{addon:esc(n),blurb:esc(blurb),price:fmt$(mo),ix:esc(ixName(c))}),'bad');}}} +} + +function elephant(){S.phpDone=true;S.ev.php=S.day+4; + toast(tr('de_kicks.breaking_cve_2026_31337_just_took'),'bad');sfx('alert');renderMega();} diff --git a/src/game/70-rules/70-sold-out.js b/src/game/70-rules/70-sold-out.js new file mode 100644 index 0000000..c137ddb --- /dev/null +++ b/src/game/70-rules/70-sold-out.js @@ -0,0 +1,23 @@ +/* Sold out: now and then a carrier has no spare capacity of a size on a route. Each route, size and 90-day window + gets a stable verdict from a hash, so asking again does not reroll it, and bigger waves sell out more often. */ +const SOLD_WIN=90,SOLD_WHY=[N_('sold_out.a_hyperscaler_bought_every_wave_of'),N_('sold_out.the_carrier_is_out_of_spectrum'),N_('sold_out.the_transponders_for_this_route_are'),N_('sold_out.the_capacity_is_available_in_the'),N_('sold_out.their_capacity_planner_is_on_holiday'),N_('sold_out.the_upgrade_is_planned_for_q3')]; +const soldP=tier=>Math.min(0.1,0.02+0.012*tier); +// Never in the first 90 days: a new network has enough on its plate. Never in the tutorial or a scenario's first quarter either. +function soldOut(a,b,tier,via){if(!S||S.day=soldP(tier)*1000)return null;return {why:SOLD_WHY[(h>>>10)%SOLD_WHY.length],until:(ep+1)*SOLD_WIN-off};} +function snubWhy(sn){const d=Math.max(1,sn.until-S.day);return sn.why+' '+trn('sold_out.they_will_reconsider_in_n_day',d);} +// Paid-peering giants drop the fee for networks too big to ignore (freeLv: the customer level that does it). +const paidFree=n=>!!(n&&n.freeLv&&lvl()>=n.freeLv); +function peerOk(id,via,city){ + const n=NET[id],dem=R.demTo[id]||0; + 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(n.pol==='open')return {ok:true}; + if(n.pol==='selective'){const need=Math.round((via==='pni'?n.minPni:n.minIx)*confBoost(id)*repMul());return dem>=need?{ok:true}:{ok:false,why:tr('sold_out.wants_need_gbps_of_traffic_from',{need,dem:dem.toFixed(1)})};} + if(n.pol==='paid'&&paidFree(n))return via==='pni'?{ok:true,free:true}:{ok:false,why:tr('sold_out.peers_with_you_for_free_now')}; + if(n.pol==='paid')return via==='pni'?{ok:true,fee:n.paidFee}:{ok:false,why:n.perG?tr('sold_out.sender_pays_a_paid_pni_only',{fee:fmt$(n.paidFee),g:fmt$(n.perG)}):tr('sold_out.paid_peering_only_over_a_pni')}; + if(n.type!=='t1'){if(via!=='pni')return {ok:false,why:tr('sold_out.only_peers_over_pnis_and_only')};const need=Math.round(60*confBoost(id));return dem>=need||isTier2()?{ok:true}:{ok:false,why:tr('sold_out.wants_you_to_be_a_tier',{need,dem:dem.toFixed(1)})};} + if(via!=='pni')return {ok:false,why:tr('sold_out.tier_1s_never_peer_at_ixs')}; + const c=t1Club();return c.ok?{ok:true}:{ok:false,why:tr('sold_out.not_big_enough_yet_list',{list:c.missing.join(', ')})}; +} diff --git a/src/game/70-rules/80-hot-ports-and-rank.js b/src/game/70-rules/80-hot-ports-and-rank.js new file mode 100644 index 0000000..51dbd1d --- /dev/null +++ b/src/game/70-rules/80-hot-ports-and-rank.js @@ -0,0 +1,19 @@ +// Everything that can fill up at a POP: transit ports, IX ports, PNIs, caches and the routers themselves. +const HOT=0.9,HOTL={t:'T',ix:'IX',p:'P',c:'C',r:'R'},HOTC={t:'#7B61FF',ix:'#FFD23F',p:'#2C7A7B',c:'#C8102E',r:'#FF4F9A'}; +function hotPorts(){const out=[];if(!R||!S)return out; + for(const t of S.transit){if(t.down>S.day)continue;const cap=lagCap(PORT[t.tier].g,t.n),u=(R.useT[t.id]||0)/cap;if(u>=HOT)out.push({k:'t',city:t.city,lab:tr('hot_ports_and_rank.net_transit_lag',{net:NET[t.net].name,lag:lagName(t.tier,t.n)}),u,tip:tr('hot_ports_and_rank.add_a_lag_member_upgrade_the')});} + for(const c in S.ixp){const cap=ixCap(c);if(!cap)continue;const u=(R.useIx[c]||0)/cap;if(u>=HOT)out.push({k:'ix',city:ixCity(c),lab:tr('common.port_port',{port:ixName(c)}),u,tip:tr('hot_ports_and_rank.upgrade_the_ix_port_or_add')});} + for(const p of S.pni){if(!pniOn(p))continue;const cap=lagCap(pniG(p),p.n),u=(R.usePni[p.id]||0)/cap;if(u>=HOT)out.push({k:'p',city:p.city,lab:tr('common.pni_with_net',{net:NET[p.net].name}),u,tip:tr('hot_ports_and_rank.add_a_lag_member_or_upgrade')});} + const cc={};for(const x of S.caches){const k=x.city+'|'+x.net;(cc[k]=cc[k]||{city:x.city,net:x.net,used:0,cap:0});cc[k].used+=R.useCache[x.id]||0;cc[k].cap+=CACHE_CAP;} + for(const k in cc){const x=cc[k],u=x.used/x.cap;if(u>=HOT)out.push({k:'c',city:x.city,lab:x.cap>CACHE_CAP?tr('hot_ports_and_rank.name_caches',{name:NET[x.net].cache.name}):tr('common.name_cache',{name:NET[x.net].cache.name}),u,tip:tr('hot_ports_and_rank.ask_for_another_box_the_overflow')});} + for(const c in S.pops){const cap=R.nodeCap[c];if(!cap)continue;const u=(R.nodeLoad[c]||0)/cap;if(u>=HOT)out.push({k:'r',city:c,lab:tr('common.routers'),u,tip:tr('hot_ports_and_rank.upgrade_the_router_or_add_a')});} + return out.sort((a,b)=>b.u-a.u);} +function hotByCity(){const m={};for(const h of hotPorts())(m[h.city]=m[h.city]||{})[h.k]=Math.max((m[h.city]||{})[h.k]||0,h.u);return m;} +function isTier2(){return Object.keys(S.pops).length>=5&&Object.keys(S.ixp).length>=3&&R.sessions>=15;} +// Sparkly Seabone joined the Tier 1s in 1.12. Older saves keep the five they were playing for. +const t1Need=()=>NETS.filter(n=>n.type==='t1'&&(n.id!=='skl'||(S&&S.t1v>=2))); +function isTier1(){return t1Need().every(n=>S.pni.some(p=>p.net===n.id&&pniOn(p)))&&S.transit.length===0&&R.reach>0.999;} +// What you are now, not what you once were (#46): buying transit again or losing reach drops the label. +function tierLabel(){return S.won&&isTier1()?'Tier 1':isTier2()?'Tier 2':'Tier 3';} +function t1Why(){if(S.transit.length)return tr('hot_ports_and_rank.you_buy_transit_again');const miss=t1Need().filter(n=>!S.pni.some(p=>p.net===n.id&&pniOn(p)));if(miss.length)return tr('hot_ports_and_rank.no_pni_with_list',{list:miss.map(n=>n.name).join(', ')});{const lost=NETS.filter(n=>!R.reachable[n.id]).sort((a,b)=>NSH[b.id]-NSH[a.id]);if(lost.length)return tr('hot_ports_and_rank.you_cannot_reach_list',{list:lost.slice(0,3).map(n=>n.name).join(', ')+(lost.length>3?' '+tr('hot_ports_and_rank.and_n_more',{n:lost.length-3}):'')});}return tr('hot_ports_and_rank.your_reach_is_p_not_100',{p:reachPct(R.reach)});} + diff --git a/src/game/80-simulation/10-dijkstra.js b/src/game/80-simulation/10-dijkstra.js new file mode 100644 index 0000000..1ef9be7 --- /dev/null +++ b/src/game/80-simulation/10-dijkstra.js @@ -0,0 +1,17 @@ +/* ================= SIMULATION ================= */ +// Binary-heap Dijkstra over city indices: adj[i] lists [neighbour, edge]. wf(edge) gives the weight, skip(v,edge) can +// rule edges out, and the search stops early once `stop` is settled. D is the distance to each city (Infinity: no +// path) and P the edge it was reached by. The heap lives in two typed arrays, and equal distances always settle in the +// same order, so routes do not flip between runs. +function dijkstra(adj,src,wf,skip,stop){const n=adj.length,D=new Float64Array(n).fill(Infinity),P=new Array(n),done=new Uint8Array(n); + let cap=64,hd=new Float64Array(cap),hu=new Int32Array(cap),m=0; + const put=(d,u)=>{if(m===cap){cap*=2;const a=new Float64Array(cap),b=new Int32Array(cap);a.set(hd);b.set(hu);hd=a;hu=b;} + let i=m++;hd[i]=d;hu[i]=u;while(i>0){const p=(i-1)>>1;if(hd[p]<=hd[i])break;const td=hd[p],tu=hu[p];hd[p]=hd[i];hu[p]=hu[i];hd[i]=td;hu[i]=tu;i=p;}}; + D[src]=0;put(0,src); + while(m){const d=hd[0],u=hu[0];m--; + if(m){hd[0]=hd[m];hu[0]=hu[m];let i=0;for(;;){const l=2*i+1,r=l+1;let k=i;if(lD[u])continue;done[u]=1;if(u===stop)break; + for(const [v,e] of adj[u]||[]){if(skip&&skip(v,e))continue;const nd=d+wf(e);if(nd[i]);for(let j=1;j<=n;j++)d[0][j]=j;for(let i=1;i<=m;i++)for(let j=1;j<=n;j++)d[i][j]=Math.min(d[i-1][j]+1,d[i][j-1]+1,d[i-1][j-1]+(a[i-1]===b[j-1]?0:1));return d[m][n];} +function teFind(word,list,label){const w=slug(word);if(!w)return {err:tr('routescript.missing_what',{what:label})}; + for(const x of list)if(x.id===w||slug(x.name)===w)return {v:x.id}; + const pre=list.filter(x=>w.length>=3&&slug(x.name).startsWith(w));if(pre.length===1)return {v:pre[0].id}; + const best=list.map(x=>({x,d:Math.min(lev(w,slug(x.name)),lev(w,x.id))})).sort((a,b)=>a.d-b.d)[0]; + return {err:tr('routescript.unknown_what_word',{what:label,word})+(best&&best.d<=3?tr('routescript.did_you_mean_name',{name:best.x.name}):'')};} +function teParse(src){const out={spill:null,cap:{},net:{},up:{},prep:{},protect:false,drain:new Set(),avoid:new Set(),blackhole:false,errors:[],n:0}; + const lines=String(src||'').split('\n').slice(0,60); + lines.forEach((raw,i)=>{const line=raw.replace(/#.*/,'').trim().toLowerCase();if(!line)return;const L=i+1;let m; + if(m=line.match(/^spill\s+at\s+(\d{1,3})\s*%$/)){const v=+m[1];if(v<20||v>100)out.errors.push(tr('routescript.line_n_spill_must_be_between',{n:L}));else{out.spill=v/100;out.n++;}return;} + if(m=line.match(/^(prefer|avoid)\s+(pni|ix|transit)\s+for\s+(.+)$/)){const r=teFind(m[3],NETS,tr('common.network'));if(r.err){out.errors.push(tr('routescript.line_n_err',{n:L,err:r.err}));return;}const o=out.net[r.v]=out.net[r.v]||{};o[m[1]]=TE_KINDS[m[2]];out.n++;return;} + if(m=line.match(/^cap\s+transit\s+(.+?)\s+at\s+(\d+(?:\.\d+)?)\s*(gbps|tbps|g|t)$/)){const r=teFind(m[1],NETS.filter(n=>n.price),tr('common.transit_provider'));if(r.err){out.errors.push(tr('routescript.line_n_err',{n:L,err:r.err}));return;}out.cap[r.v]=+m[2]*(m[3][0]==='t'?1000:1);out.n++;return;} + if(m=line.match(/^(prefer|avoid)\s+transit\s+(?!for\s)(.+)$/)){const r=teFind(m[2],NETS.filter(n=>n.price),tr('common.transit_provider'));if(r.err){out.errors.push(tr('routescript.line_n_err',{n:L,err:r.err}));return;}out.up[r.v]=m[1];out.n++;return;} + if(m=line.match(/^prepend\s+transit\s+(.+?)\s+(\d+)$/)){const v=+m[2];if(v<1||v>3){out.errors.push(tr('routescript.line_n_prepend_1_to_3',{n:L}));return;}const r=teFind(m[1],NETS.filter(n=>n.price),tr('common.transit_provider'));if(r.err){out.errors.push(tr('routescript.line_n_err',{n:L,err:r.err}));return;}out.prep[r.v]=v;out.n++;return;} + if(line==='protect customers'){out.protect=true;out.n++;return;} + if(m=line.match(/^drain\s+(.+)$/)){const r=teFind(m[1],CITIES,tr('common.city'));if(r.err){out.errors.push(tr('routescript.line_n_err',{n:L,err:r.err}));return;}out.drain.add(r.v);out.n++;return;} + if(m=line.match(/^avoid\s+link\s+(.+?)\s*(?:-|\bto\b|→)\s*(.+)$/)){const a=teFind(m[1],CITIES,tr('common.city')),b=teFind(m[2],CITIES,tr('common.city'));if(a.err||b.err){out.errors.push(tr('routescript.line_n_err',{n:L,err:a.err||b.err}));return;}out.avoid.add(a.v!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber&&!BIZ_T[b.type].event&&sfOf(R,b.city)<0.95))L.push('protect customers'); + const ups=[...new Set(S.transit.map(t=>t.net))].map(n=>({n,p:Math.min(...S.transit.filter(t=>t.net===n).map(t=>NET[n].price*regionMult(t.city)))})).sort((a,b)=>a.p-b.p); + if(ups.length>1){L.push('prefer transit '+NET[ups[0].n].name.toLowerCase());L.push('avoid transit '+NET[ups[ups.length-1].n].name.toLowerCase());} + const tips=[]; + for(const n of NETS){const g=(R.netEg[n.id]||{}).t||0;if(g<1)continue;// The exchange where it is a member and you have no port yet, in a city where you have a POP. + let at=null;for(const c of Object.keys(S.pops)){at=ixIdsIn(c).find(x=>S.ixp[x]===undefined&&ixMembers(x).includes(n.id));if(at)break;} + if(at){const v={net:n.name,g:fmtG(g),ix:ixName(at),city:CITY[ixCity(at)].name};tips.push([g,ixNamesCity(at)?tr('routescript.net_g_over_transit_but_it',v):tr('routescript.net_g_over_transit_but_it_e707',v)]);}} + for(const n of NETS){const g=(R.netEg[n.id]||{}).ix||0;if(g>=50&&!S.pni.some(p=>p.net===n.id))tips.push([g,tr('routescript.net_g_over_the_ix_a',{net:n.name,g:fmtG(g)})]);} + tips.sort((a,b)=>b[0]-a[0]).slice(0,5).forEach(x=>L.push(x[1])); + return L.join('\n');} +// Ready-made RouteScripts, filled in from the live network. Players load them from the help; the AI button picks them too. +const teUps=()=>[...new Set(S.transit.map(t=>t.net))].map(n=>({n,p:Math.min(...S.transit.filter(t=>t.net===n).map(t=>NET[n].price*regionMult(t.city)))})).sort((a,b)=>a.p-b.p); +const teNm=n=>NET[n].name.toLowerCase(),teAtk=()=>ddosAll().length>0; +const teSad=()=>S.biz.some(b=>!BIZ_T[b.type].l2&&!BIZ_T[b.type].fiber&&!BIZ_T[b.type].event&&sfOf(R,b.city)<0.95); +const TE_RECIPES=[ + {id:'shield',n:N_('common.shields_up'),d:N_('routescript.for_a_ddos_drop_the_junk'),fit:()=>teAtk()?9:0.3, + src:()=>[tr('routescript.shields_up_for_the_length_of'),'blackhole ddos','protect customers','spill at 80%']}, + {id:'care',n:N_('common.customer_care'),d:N_('routescript.business_customers_first_when_links'),fit:()=>teSad()?5:0.5, + src:()=>[tr('routescript.customer_care_the_people_who_pay'),'protect customers','spill at 75%']}, + {id:'peer',n:N_('common.peering_first'),d:N_('routescript.big_networks_you_can_reach_over'),fit:()=>S.pni.length||Object.keys(S.ixp).length?3:0, + src:()=>{const L=[tr('routescript.peering_first_free_paths_before_paid'),'spill at 85%'],seen=new Set(),ix=new Set(),eg=n=>(R.netEg[n]||{}).t||0; + for(const p of S.pni)if(!seen.has(p.net)){seen.add(p.net);L.push('prefer pni for '+teNm(p.net));} + for(const c in S.ixp)for(const n of ixSessions(c))ix.add(n); + NETS.filter(n=>!seen.has(n.id)&&ix.has(n.id)&&eg(n.id)>=1).sort((a,b)=>eg(b.id)-eg(a.id)).slice(0,4).forEach(n=>L.push('prefer ix for '+teNm(n.id))); + if(L.length===2)L.push(tr('routescript.nothing_to_move_yet_get_an'));return L.slice(0,12);}}, + {id:'pinch',n:N_('common.penny_pincher'),d:N_('routescript.cheapest_upstream_first_priciest'),fit:()=>teUps().length>1?2+(R.cost.transit||0)/1e5:0, + src:()=>{const u=teUps(),L=[tr('routescript.penny_pincher_cheapest_upstream'),'spill at 85%']; + if(u.length>1)L.push('prefer transit '+teNm(u[0].n),'avoid transit '+teNm(u[u.length-1].n));else L.push(tr('routescript.buy_transit_from_a_second_upstream'));return L;}}, + {id:'diet',n:N_('common.prepend_diet'),d:N_('routescript.ask_the_rest_of_the_internet'),fit:()=>teUps().length>1?1.5:0, + src:()=>{const u=teUps();return [tr('routescript.prepend_diet_a_hint_to_the'),'spill at 85%',...(u.length>1?['prepend transit '+teNm(u[u.length-1].n)+' 2']:[tr('routescript.prepending_needs_two_upstreams_to')])];}}, + {id:'maint',n:N_('common.maintenance_window'),d:N_('routescript.drain_a_pop_and_steer_around'),fit:()=>0.2, + src:()=>{const l=S.links.find(x=>!linkDown(x)),c=l?CITY[l.a].name.toLowerCase():'paris';return [tr('routescript.maintenance_window_change_the_names'),'drain '+c,...(l?['avoid link '+c+'-'+CITY[l.b].name.toLowerCase()]:[]),'spill at 80%'];}}, + {id:'calm',n:N_('common.keep_calm'),d:N_('routescript.one_rule_move_traffic_before_links'),fit:()=>1, + src:()=>[tr('routescript.keep_calm_one_rule_hard_to'),'spill at 85%']}]; +// The AI button: the two recipes that fit best, merged, with an AI's confidence on top. +const AI_NAMES=['Large Latency Model','Stochastic Parrot Pro','Co-Pilot Error','Autocomplete Ultra','Hallucinet 4o','Artificial Ignorance']; +const AI_SAY=[N_('routescript.great_question_here_is_a_production'),N_('routescript.as_a_large_language_model_i'),N_('routescript.i_have_optimised_your_network_you'),N_('routescript.done_i_vibe_checked_your_bgp'),N_('routescript.here_you_go_i_was_trained'),N_('routescript.i_asked_myself_to_review_my')]; +function aiSlop(bad){const ai=pick(AI_NAMES),fits=TE_RECIPES.map(r=>({r,f:r.fit()})).filter(x=>x.f>0).sort((a,b)=>b.f-a.f).map(x=>x.r); + // It really does dry-run its three favourite ideas (and one merge) against live traffic, and keeps the best. + const merge=rs=>{const L=[],seen=new Set();for(const r of rs)for(const x of r.src()){const k=/^spill/.test(x)?'spill':x;if(!seen.has(k)){seen.add(k);L.push(x);}}return L;}; + const cands=fits.slice(0,3).map(r=>merge([r])).concat([merge(fits.slice(0,2))]),val=x=>x.served*EYE_RATE-x.tc; + const keep=S.te&&S.te.script,on=S.te&&S.te.on;if(!S.te)S.te={on:false,day:S.day,tmp:1};let best=null,bv=-Infinity; + for(const L of cands){if(teParse(L.join('\n')).errors.length)continue;S.te.script=L.join('\n');S.te.on=true;compute();const v=val({served:R.served,tc:R.cost.transit||0});if(v>bv){bv=v;best=L;}} + if(S.te.tmp)delete S.te;else{S.te.script=keep;S.te.on=on;}compute(); + const L=[tr('routescript.written_by_ai_prompt_make_my',{ai})].concat(best||merge([TE_RECIPES.find(r=>r.id==='calm')])); + // Very occasionally it is just as sure of itself and completely wrong. Nothing says so. + const u=teUps();if(bad&&u.length)L.splice(2,0,tr('routescript.a_cap_of_0_gbps_means'),...u.map(x=>'cap transit '+teNm(x.n)+' at 0 gbps')); + L.push(tr('common.confidence_100'));return {src:L.join('\n'),ai,say:pick(AI_SAY)};} +function teHelpModal(){const rule=(code,what)=>`
${code}
${what}
`; + openModal(`
${tr('routescript.auto_te_controller')}

${tr('routescript.how_routescript_works')}

+

${tr('routescript.every_gigabit_leaving_your_network')}

+

${tr('routescript.writing_a_script')}

    +
  • ${tr('routescript.one_rule_per_line_a_starts')}
  • +
  • ${tr('routescript.networks_providers_and_cities_go_by')}
  • +
  • ${tr('routescript.check_dry_run_replays_today_s')}
  • +
  • ${tr('routescript.deploy_makes_it_live_for_the')}
+

${tr('common.rules')}

+ ${rule('spill at 85%',tr('routescript.move_traffic_to_the_next_exit'))} + ${rule('prefer pni for goggle',tr('routescript.send_one_network_s_traffic_over'))} + ${rule('avoid transit for netchill',tr('routescript.use_that_kind_of_exit_for'))} + ${rule('cap transit cogentle at 20 gbps',tr('routescript.a_ceiling_on_one_provider_so'))} + ${rule('prefer transit cogentle',tr('routescript.rank_your_upstreams_preferred_ones'))} + ${rule('prepend transit drizzle electric 2',tr('routescript.as_path_prepending_1_to_3'))} + ${rule('protect customers',tr('routescript.when_links_are_congested_business'))} + ${rule('drain paris',tr('routescript.move_traffic_off_a_pop_s'))} + ${rule('avoid link frankfurt-amsterdam',tr('routescript.steer_traffic_around_one_link_unless'))} + ${rule('blackhole ddos',tr('routescript.during_an_attack_drop_the_flood'))} +

${tr('routescript.ready_made_scripts')}

${tr('routescript.filled_in_from_your_network_as')}

+ ${TE_RECIPES.map(r=>`
${tr(r.n)}
${tr(r.d)}
${btn(tr('common.load'),'teRecipe',{id:r.id},'sm')}
`).join('')}
+
${btn(tr('routescript.back_to_the_editor'),'teBack',{},'big')}
`);} +let TE_CACHE={src:null,p:null}; +function teRules(){if(!S||!S.te||!S.te.on||!S.te.script)return null;if(TE_CACHE.src!==S.te.script)TE_CACHE={src:S.te.script,p:teParse(S.te.script)};return TE_CACHE.p.errors.length?null:TE_CACHE.p;} +function teModal(msg){const src=UI.teDraft!==undefined?UI.teDraft:(S.te.script||TE_EXAMPLE); + openModal(`
${tr('routescript.auto_te_controller')}

RouteScript

+

${tr('routescript.write_rules_check_them_against_live')}

+ + ${msg||''}
${btn(tr('routescript.check_dry_run'),'teCheck',{},'')}${btn(tr('common.deploy'),'teDeploy',{},'pink')}${S.te.script?btn(tr('common.remove_script'),'teClear',{},'ghost sm'):''}${btn(tr('common.optimize'),'teOpt',{},'ghost sm')}${btn(tr('routescript.reset_to_example'),'teExample',{},'ghost sm')}
${btn('✨ '+tr('routescript.slop_it_with_ai'),'teSlop',{},'aibtn')}${btn(tr('routescript.help_and_ready_made_scripts'),'teHelp',{},'ghost sm')}
+

${tr('common.rules_7b18')} spill at 80% · prefer pni|ix|transit for NETWORK · avoid pni|ix|transit for NETWORK · cap transit PROVIDER at 20 gbps · prefer|avoid transit PROVIDER · prepend transit PROVIDER 1-3 · protect customers · drain CITY · avoid link CITY-CITY · blackhole ddos

+ ${S.te.script?`

${tr('routescript.live_state_rules',{state:S.te.on?tr('common.deployed'):tr('routescript.controller_is_off'),rules:teRules()?tr('routescript.n_rules_active',{n:teRules().n}):tr('common.not_active')})}

`:''}`);} +function teTrial(src){const keep=S.te.script,on=S.te.on,before={served:R.served,tc:R.cost.transit||0,moved:R.teMoved||0}; + S.te.script=src;S.te.on=true;compute();const after={served:R.served,tc:R.cost.transit||0,moved:R.teMoved||0,bh:R.teBlack||0}; + S.te.script=keep;S.te.on=on;compute();return {before,after};} diff --git a/src/game/80-simulation/30-compute.js b/src/game/80-simulation/30-compute.js new file mode 100644 index 0000000..33ceb70 --- /dev/null +++ b/src/game/80-simulation/30-compute.js @@ -0,0 +1,271 @@ +// tr() with one placeholder, remembered: compute() labels every port, PNI and cache on every run. +const LABS=new Map();function labOf(s,k,v){const key=s+'|'+v;let o=LABS.get(key);if(o===undefined)LABS.set(key,o=tr(s,{[k]:v}));return o;} +function compute(){ + const day=S.day, R2=emptyR(), pops=Object.keys(S.pops).filter(popUp), NC=CITIES.length; + // The graph works on city indices: adj[i] lists [neighbour, edge] in S.links order. + const remote=remoteCities(),adj=new Array(NC); pops.concat(remote).forEach(p=>adj[CIDX[p]]=[]); + const edges={},TRX=teRules(),live=[];let NE=0;R2.bizDem={};R2.bizSrv={}; + for(const l of S.links){const ai=CIDX[l.a],bi=CIDX[l.b];if(linkDown(l)||!adj[ai]||!adj[bi])continue;live.push(l);const key=l.ae.w,wLat=e=>e.lat+0.05; + for(const s of pops){const i=CIDX[s],r=dijkstra(adj,i,wW);SDi[i]=SPD[s]=r.D;SPi[i]=SPP[s]=r.P;ALONE[i]=1;for(let x=0;xday||scnRule('spat'), leak=ev.leak&&ev.leak.until>day?ev.leak.net:null; + for(const t of S.transit){if(!popUp(t.city)||t.down>day||!liveN(t.city,t.site,t.n))continue; + // AS-path prepending (#96) moves part of the port to a last-resort exit of its own. + const cap=Math.min(liveCap(PORT[t.tier].g,t.city,t.site,t.n)*lagF(t),TRX&&TRX.cap[t.net]!==undefined?TRX.cap[t.net]:Infinity),pf=TRX&&TRX.prep[t.net]?PREPEND_F[TRX.prep[t.net]]:0; + const ex={k:'t',net:t.net,prem:!!t.premium&&t.city==='hkg',pref:t.pref||'normal',lab:labOf(N_('common.net_transit'),'net',NET[t.net].name),id:t.id,city:t.city,cap:cap*(1-pf),used:0,rank:3,ok:n=>!(depeer&&t.net==='cog'&&n==='ggl')&&n!==leak}; + E.push(ex);if(pf)E.push({...ex,cap:cap*pf,prep:true});} + // `nets`: every network ok() can say yes to, so it need not be asked about the other hundred. + for(const c in S.ixp){const ct=ixCity(c);if(!(popUp(ct)||remote.includes(ct))||(S.ev.ixdown&&S.ev.ixdown[c]>day)||!(S.myIx[c]?myIxLive(c):liveN(ct,(S.ixSite||{})[c],(S.ixn||{})[c])))continue;const set=ixSessions(c);R2.sessions+=set.size; + E.push({k:'ix',pref:(S.ixPref&&S.ixPref[c])||'normal',lab:labOf(N_('common.ix_peering'),'ix',ixName(c)),id:c,city:ct,cap:ixCap(c),used:0,rank:2,ok:n=>set.has(n),nets:set});} + for(const p of S.pni){if(!pniOn(p)||!popUp(p.city)||!liveN(p.city,p.site,p.n))continue;R2.sessions++;E.push({k:'p',pnc:!!NET[p.net].cn,pref:p.pref||'normal',lab:labOf(N_('common.pni_with_net'),'net',NET[p.net].name),id:p.id,city:p.city,cap:liveCap(pniG(p),p.city,p.site,p.n)*lagF(p)*(p.sacrif?0.5:1),used:0,rank:1,ok:n=>n===p.net||!!(NET[n].up&&NET[n].up.includes(p.net)),nets:PNI_NETS[p.net]});} + for(const c of S.caches){if(!popUp(c.city)||siteDown(c.city,c.site==='b'?'b':'a'))continue;E.push({k:'c',pref:'normal',lab:labOf(N_('common.name_cache'),'name',NET[c.net].cache.name),id:c.id,city:c.city,cap:CACHE_CAP,used:0,rank:0,ok:n=>n===c.net,nets:[c.net]});} + // After an update adds networks, a free courtesy route reaches the new ones you have no other way to (#46). + R2.graceNets=0;if(S.grace&&S.grace.until>day){const gs=new Set(S.grace.nets.filter(n=>NET[n]&&!E.some(e=>e.k!=='c'&&e.ok(n)))),hc=popUp(S.home)?S.home:pops.find(popUp); + R2.graceNets=gs.size;if(gs.size&&hc)E.push({k:'ix',pref:'normal',lab:tr('compute.courtesy_route_to_new_networks'),id:'~grace',city:hc,cap:1e9,used:0,rank:2,ok:n=>gs.has(n),nets:gs});} + {const rp=ev.rpki&&ev.rpki.until>day?new Set(ev.rpki.nets):null;if(rp)for(const e of E){if(e.k==='c')continue;const o=e.ok;e.ok=n=>!rp.has(n)&&o(n);}} + // ok() cannot change during one compute, so ask each exit once per network, not once per flow and rank. + // okBy[net] lists the exits that reach it in E's order, like E.filter(e=>e.ok(net)). + const okBy={};for(const id of NET_IDS)okBy[id]=[]; + R2.ingressPorts={};const ekN={};for(const e of E){e.ek=e.k+':'+e.id;if(e.k!=='c'){const p=R2.ingressPorts[e.ek]||(R2.ingressPorts[e.ek]={k:e.k,id:e.id,city:e.city,lab:e.lab,cap:0,traffic:0});p.cap+=e.cap;}ekN[e.ek]=(ekN[e.ek]||0)+1;} + // dup: shares its key with another exit (a hand-edited save), so R.egDesc shows whichever pushed last. + for(const e of E){e.desc={lab:e.lab,city:e.city,k:e.k};e.dup=ekN[e.ek]>1;e.told=false;e.hp=e.pref==='high'?0:1;e.ci=CIDX[e.city];e.cn=cnCity(e.city);e.vis=0;for(const n of e.nets||NET_IDS){const L=okBy[n];if(L&&L[L.length-1]!==e&&e.ok(n))L.push(e);}} + for(const n of NETS){R2.reachable[n.id]=okBy[n.id].some(e=>e.rank>0);if(R2.reachable[n.id])R2.reach+=NSH[n.id];if(okBy[n.id].some(e=>e.rank>0&&e.k!=='t')){R2.nt[n.id]=1;R2.reachNT+=NSH[n.id];}} + const cacheNets=new Set(S.caches.filter(c=>popUp(c.city)).map(c=>c.net)); + const viral=(ev.viral>day?1.25:1)*(ev.php&&ev.php>day?0.7:1); + // Every flow has the same shape and carries what routing asks about it again and again (nj: its network's index). + const NN=NETS.length,flows=[],flow=(c,ci,cn,j,rem,cache,junk,bz=false)=>{const n=NETS[j],f={c,n:n.id,rem,cache,junk,bz,ci,cn,ncn:!!n.cn,nj:j,nr:junk?NN:j};flows.push(f);return f;}; + // Customer demand per city, added up in S.biz order (what filtering S.biz for each city would give). + const bizBw={};for(const b of S.biz){const T=BIZ_T[b.type];if(!T.l2&&!T.fiber&&(!T.event||eventLive(b))){const v=bizBw[b.city];bizBw[b.city]=(v===undefined?0:v)+b.bw;}} + // Traffic shares by network index, and their sums, for each share table (and with Russia's throttle). + const shArr=new Map(),shSum=new Map(),DEMTO=new Float64Array(NN),loc=scnRule('local'),scrubRoom={},atkBy={},junkGroups=[],bhCities=new Set(ddosAll().filter(a=>a.bh).map(a=>a.city));R2.haul=[];R2.ddos=[];for(const a of ddosAll())for(const part of ddosSlices(a))(atkBy[part.city]||(atkBy[part.city]=[])).push(part); + for(const c of Object.keys(S.pops)){ + const p=S.pops[c],ci=CIDX[c],cn=cnCity(c),SH=cn?NSH_CN:ruCity(c)?NSH_RU:CITY[c].kr&&S.krExit?NSH_KRX:NSH;const eye=(p.bb?p.bb.d:0)*viral*(cn&&ev.golden>day?1.4:1);const biz=bizBw[c]??0;const d0=eye+biz; + // Goggle video is throttled in Russia (#70): people there get half of it, so they ask for half. It is not + // traffic you failed to deliver, and it does not cross your links only to be thrown away. + const ru=ruCity(c),thr=n=>n==='ggl'&&ru?0.5:1;let sa=shArr.get(SH),sm=shSum.get(SH);if(!sa){shArr.set(SH,sa=NETS.map(n=>SH[n.id]||0));shSum.set(SH,sm=[]);} + const tt=sm[+ru]||(sm[+ru]=[NETS.reduce((t,n,j)=>t+sa[j]*thr(n.id),0),NETS.reduce((t,n,j)=>t+sa[j],0)]),lf=loc?NETS.reduce((t,n,j)=>t+(R2.reachable[n.id]?sa[j]*thr(n.id):0),0)/(tt[0]||1):1,d=d0*tt[0]/(tt[1]||1)*lf; + R2.cityEye[c]=eye;R2.cityDem[c]=d;R2.citySrv[c]=0;R2.demand+=d; + for(let j=0;j0?q.g/m.leak:0});}} + else for(let j=0;jm.attack.city===c))m.offline=true;continue;} + const bh=rtbh||edge; + if(edge)R2.teBlack+=attacks.reduce((n,a)=>n+a.gbps,0)+d*0.1;if(rtbh)R2.teBlack+=attacks.reduce((n,a)=>n+a.gbps,0)+d; + R2.cityBlocked=R2.cityBlocked||{}; + const mtuH=ev.pmtud&&ev.pmtud.until>day?ev.pmtud:null,kr=CITY[c].kr; + for(let j=0;jday&&n.id==='fbk'?0.8:1);if(a<=0)continue; + // With `protect customers`, the business part first, then the rest (no arrays: this runs per city and network). + const bf=d0>0?biz/d0:0,sp=!!(TRX&&TRX.protect&&bf>0),cn2=cacheNets.has(n.id); + for(let q=0;q<(sp?2:1);q++){const x=sp?(q?a*(1-bf):a*bf):a,bz=sp&&!q;if(x<=0)continue;if(cn2){flow(c,ci,cn,j,x*0.85,true,false,bz);flow(c,ci,cn,j,x*0.15,false,false,bz);} + else flow(c,ci,cn,j,x,false,false,bz);}} + R2.bizDem[c]=biz*d/(d0||1);R2.bizSrv[c]=0; + } + if(Object.keys(S.pops).length)for(let j=0;j{NRES[i]-=a;if(!NSEEN[i]){NSEEN[i]=1;NORD.push(i);}NLOAD[i]=(NLOAD[i]||0)+a;}; + const NKN=NN+2,ACN=new Float64Array(NE*NKN),SEN=new Uint8Array(NE*NKN),ACD=new Float64Array(NE*NC),SED=new Uint8Array(NE*NC),EL=[]; + const carry=(l,eg,nr,ci,a)=>{let t=l.tr;if(!t){t=l.tr={g:new Map(),n:[],d:[]};EL.push(l);}t.g.set(eg,(t.g.get(eg)||0)+a); + let k=l.i*NKN+nr;if(!SEN[k]){SEN[k]=1;t.n.push(nr);}ACN[k]=(ACN[k]||0)+a;k=l.i*NC+ci;if(!SED[k]){SED[k]=1;t.d.push(ci);}ACD[k]=(ACD[k]||0)+a;}; + R2.l2route={};R2.l2split={}; + /* Scenic routing (#28). "Busy" is judged without the customer's own traffic, or it flees its own load and + flips paths every day. Two paths that are about as quiet share the load, and yesterday's choice is kept + unless today's is clearly better. */ + const fastSP={},divMemo={},cityIds=ni=>ni.map(i=>CITIES[i].id); + // disjointRoutes() over today's live links, on city indices: the links are listed per city once, not twice per customer. + const LA=[];for(const l of live){const ai=CIDX[l.a],bi=CIDX[l.b];(LA[ai]||(LA[ai]=[])).push([bi,l]);(LA[bi]||(LA[bi]=[])).push([ai,l]);} + const srlg=l=>l.kind==='vxc'?'fab:'+l.prov:(l.trench||l.id); + const bfsI=(a,b,skip)=>{const prev=[],seen=new Uint8Array(NC),q=[a];seen[a]=1; + for(let h=0;h{const a=CIDX[A],b=CIDX[B],p1=bfsI(a,b,null);return !!p1&&!!bfsI(a,b,new Set(p1.map(srlg)));}; + for(const k in edges){const e=edges[k];let ld=0;for(const l of e.links)ld+=(R.load&&R.load[l.id])||0;e.pl=ld;} + const l2Routes=(A,B,b)=>{const m=b.route||'normal',Ai=CIDX[A],Bi=CIDX[B]; + if(m!=='scenic')return [{...walkI(m==='fast'?(fastSP[A]||(fastSP[A]=dijkstra(adj,Ai,wLat))).P:SPP[A],Ai,Bi),share:1}]; + const ek='l2:'+b.id,own=e=>(R.efg&&R.efg[e.id]&&R.efg[e.id].get(ek))||0; + const wf=e=>e.w*(1+10*(e.cap?Math.max(0,e.pl-own(e))/e.cap:0)); + const cost=r=>r.path.reduce((x,e)=>x+wf(e),0)*r.share; + const s1=dijkstra(adj,Ai,wf,null,Bi);if(s1.D[Bi]===Infinity)return [{...walkI(SPP[A],Ai,Bi),share:1}]; + const p1=walkI(s1.P,Ai,Bi),c1=cost({path:p1.path,share:1}),used=new Set(p1.path.map(e=>e.id));let pick2=[{...p1,share:1}]; + const s2=dijkstra(adj,Ai,wf,(v,e)=>used.has(e.id),Bi); + if(s2.D[Bi]!==Infinity){const p2=walkI(s2.P,Ai,Bi);if(cost({path:p2.path,share:1})<=c1*1.15)pick2=[{...p1,share:0.5},{...p2,share:0.5}];} + const key=b.id+'>'+A+'>'+B,old=R.l2route&&R.l2route[key];let out=pick2; + if(old&&old.every(r=>r.keys.every(k=>edges[k]))){const prev=old.map(r=>{const path=r.keys.map(k=>edges[k]);return {path,ni:r.ns.map(c=>CIDX[c]),share:r.share};}); + if(prev.reduce((x,r)=>x+cost(r),0)<=pick2.reduce((x,r)=>x+cost(r),0)*1.1)out=prev;} + R2.l2route[key]=out.map(r=>({keys:r.path.map(e=>e.id),ns:cityIds(r.ni),share:r.share}));return out;}; + for(const b of S.biz){if(!BIZ_T[b.type].l2)continue; + // An SD-WAN is hub-and-spoke: one circuit from the first site to each of the others. + const pairs=b.sites?b.sites.slice(1).map(x=>[b.sites[0],x]):[[b.city,b.city2]];let minF=1,maxLat=0,tot=0,noPath=false; + for(const [A,B] of pairs){let amt=0; + if(popUp(A)&&popUp(B)&&SPD[A]&&SPD[A][CIDX[B]]1)R2.l2split[b.id]=routes.length; + for(const {path,ni,share} of routes){let a=b.bw*share;for(const l of path)a=Math.min(a,l.res);for(const i of ni)if(HAS[i])a=Math.min(a,NRES[i]);a=Math.max(0,a);amt+=a;maxLat=Math.max(maxLat,path.reduce((x,e)=>x+e.lat,0)+path.length*0.05); + for(const i of ni)if(HAS[i])nodeTake(i,a); + for(const l of path){l.res-=a;l.ld+=a;carry(l,ek,NN+1,CIDX[B],a);}}} + else noPath=true; + minF=Math.min(minF,amt/b.bw);tot+=amt;} + R2.l2lat[b.id]=noPath?Infinity:maxLat;R2.l2[b.id]=b.bw*minF;R2.egT.l2=(R2.egT.l2||0)+tot; + // Same answer as diversePaths(), which would rebuild today's live links for every customer. + if((b.reqs||[]).includes('diverse')){const k=b.city+'>'+b.city2;R2.div[b.id]=divMemo[k]??(divMemo[k]=disjointI(b.city,b.city2));}} + /* A flood for a scrubbing center elsewhere rides the backbone there, with the victim's own traffic (#117). + What the links cannot carry is not scrubbed and lands on the city after all. */ + const scrubNear=new Map(); + for(const m of R2.ddos){const atk=m.attack,A=atk.city,Ai=CIDX[A]; + m.sp=!m.offline&&m.leak>0?scrubPlan(atk,m.leak,scrubRoom,(x,want)=>{const B=x.city,Bi=CIDX[B];if(A===B)return want;let h=0,ms=null; + if(popUp(A)&&popUp(B)&&SPD[A]&&SPD[A][Bi]0?want*take/total:0;ms=path.reduce((n,e)=>n+e.lat,0)*2; + // Sources sharing a center need separate labels in link breakdowns and map highlights. + const ek='scrub:'+A+'>'+B;R2.egDesc[ek]={lab:labOf(N_('compute.attack_hauled_to_scrubbing_in_city'),'city',CITY[B].name),city:A,k:'l2'}; + for(const i of ni)if(HAS[i])nodeTake(i,take);for(const l of path){l.res-=take;l.ld+=take;carry(l,ek,NN,Ai,take);}} + R2.haul.push({city:A,to:B,tier:x.tier||0,a:want,h,ms,attack:atk.id});return h;}):null; + if(m.sp){m.leak=m.sp.leak; + // The card describes the victim's nearest center, separately from distributed ingress hauling above. + const c=(atk.parent||atk).city;let near=scrubNear.get(c);if(near===undefined){near=null; + for(const x of S.scrubs)if(popUp(x.city)&&SPD[c]&&SPD[c][CIDX[x.city]]n+e.lat,0);if(!near||ms{const key=src*NC+dst,c0=teCache.get(key); + if(c0===false)return null;if(c0&&c0.path.every(l=>l.res>1e-3)&&c0.ni.every(i=>!HAS[i]||NRES[i]>1e-3))return c0; + const {D,P}=dijkstra(adj,src,wW,(v,e)=>e.res<=1e-3||(HAS[v]&&NRES[v]<=1e-3),dst); + if(D[dst]===Infinity||D[dst]>2*base+60){teCache.set(key,false);return null;} + const Q=walkI(P,src,dst);teCache.set(key,Q);return Q;}; + const ingressE={};for(const e of E)(ingressE[e.ek]||(ingressE[e.ek]=[])).push(e); + const base=e=>e.pref==='low'?4:e.rank; + // LOCAL_PREF on an upstream moves it ahead of or behind the other transits, never ahead of peering (#96). + const eff=(e,n)=>{let r=base(e);if(TR){if(e.k==='t'&&TR.up[e.net])r=TR.up[e.net]==='prefer'?2.9:3.5;if(e.prep)r=4.4;if(e.k!=='c'&&TR.drain.has(e.city))r=4.6;const o=TR.net[n];if(o){if(o.prefer===e.k)r=0.5;else if(o.avoid===e.k)r=4.5;}}return r;}; + const RANKS=TR?[0,0.5,1,2,2.9,3,3.5,4,4.4,4.5,4.6]:[0,1,2,3,4]; + // With `protect customers`, business flows take every rank first; home users get what is left. + const PASSES=TR&&TR.protect?[x=>x.bz,x=>!x.bz]:null; + // Each network's exits by the rank they route at (RouteScript can move an exit per network), in E's order. + // Each list also knows whether it holds a preferred exit (hi) and its exits by city (at), in list order. + const byRank={};for(const id of NET_IDS){const m=byRank[id]={};for(const e of okBy[id]){const r=TR?eff(e,id):base(e);(m[r]||(m[r]=[])).push(e);} + for(const r in m){const L=m[r];L.hi=L.some(e=>e.hp===0);L.at=new Map();for(const e of L){const h=L.at.get(e.ci);if(h)h.push(e);else L.at.set(e.ci,[e]);}}} + // The flow being routed, and from its POP: distances, arriving edges and the paths walked so far, by city index. + let f=null,Dv=null,Pv=null,PP=null,vis=0;const walked=[],G=[],REST=[],NEG=[]; + // An exit the flow can still try: not visited yet, not full when the flow started, and reachable from the POP. + const usable=e=>e.vis!==vis&&e.useda.hp-b.hp||Dv[a.ci]-Dv[b.ci]; + // Push up to `want` along one path to exit e; returns what fitted. Capacity only shrinks while routing, so a + // path with one full link or node fits nothing for the rest of this pass: mark it, and later tries cost nothing + // (most tries are into paths that filled up earlier). + const push=(e,P,want,keep=0)=>{if(P.dead)return 0;const path=P.path,ni=P.ni;let amt=want; + for(const l of path){const r=l.res;if(r<=1e-6){P.dead=1;return 0;}amt=Math.min(amt,r-l.cap*keep);} + for(const i of ni)if(HAS[i]){const r=NRES[i];if(r<=1e-6){P.dead=1;return 0;}amt=Math.min(amt,r);} + if(amt<=1e-6)return 0; + for(const i of ni)if(HAS[i])nodeTake(i,amt); + const ek=e.ek,nr=f.nr,ci=f.ci;if(!e.told||e.dup){R2.egDesc[ek]=e.desc;e.told=true;} + for(const l of path){l.res-=amt;l.ld+=amt;carry(l,ek,nr,ci,amt);} + e.used+=amt;f.rem-=amt; + if(!f.junk){if(e.k!=='c')R2.ingressPorts[ek].traffic+=amt;let ok=amt;const cf=f.cn,ce=e.cn,cn=f.ncn; + if(cf!==ce||(cf&&!cn)||(!cf&&cn&&e.k==='t')){const prem=(e.k==='t'&&e.prem)||(e.k==='p'&&e.pnc)||path.some(x=>x.links&&x.links.some(y=>y.premium));const loss=prem?0.03:(ev.gfw>day?0.35:0.2);R2.gfwLost+=amt*loss;R2.gfwCross+=amt;ok=amt*(1-loss);} + SRV[f.ci]+=ok;R2.served+=ok;if(f.bz)R2.bizSrv[f.c]+=ok;if(e.rank<=2)R2.peered+=ok;if(e.k==='t'){const m=R2.tNet[e.id]||(R2.tNet[e.id]={});m[f.n]=(m[f.n]||0)+ok; + // Backhaul to transit: users notice the round trip to the exit. Up to 20 ms (about 1,500 km) is free, then + // it gets worse, and past 50 ms broadband and internet services count as bad service (#…). + if(path.length){let ms=P.ms;if(ms===undefined){ms=0;for(const l of path)ms+=l.lat;P.ms=ms;}const rtt=2*ms; + if(rtt>LAT_OK){LATP[f.ci]+=ok*latLoss(rtt);if(!P.fg){P.fg=0;FARL.push(P,f.ci,e.ci);}P.fg+=ok;}}}R2.egT[e.k]=(R2.egT[e.k]||0)+ok;const ne=NEG[f.nj]||(NEG[f.nj]=R2.netEg[f.n]={c:0,p:0,ix:0,t:0});ne[e.k]+=ok;} + return amt; + }; + // Shortest path first. With Auto-TE, whatever does not fit spills onto up to two alternate paths + // with free capacity, as long as they are no more than twice as long. + const send=(e,want)=>{ + let room=Math.min(want,f.rem,e.cap-e.used);if(room<=1e-6)return; + const P=PP[e.ci]||(PP[e.ci]=walkI(Pv,f.ci,e.ci));if(!P.dead)room-=push(e,P,room,TE&&SPILL<1?1-SPILL:0); + if(TE&&room>1e-6&&f.rem>1e-6&&e.used1e-6;k++){const P=altPath(f.ci,e.ci,Dv[e.ci]);if(!P)break;const m=push(e,P,Math.min(room,e.cap-e.used));if(m<=1e-6)break;room-=m;R2.teMoved+=m;} + }; + // Exits with the same preference and the same IGP distance form an ECMP group: spread the flow over + // them by free capacity (like several transits in one city), then top up in order if one fills. + // The group is g[i0..i1): plain loops and one scratch array, since this runs for most flows (same sums, same order). + // Without Auto-TE an exit whose path from here is full takes nothing: skip the call (and the numbers it boxes). + const gone=e=>{if(TE)return false;const P=PP[e.ci];return !!P&&P.dead===1;}; + const ROOM=[],sendGroup=(g,i0=0,i1=g.length)=>{for(let k=i0;k1){let tot=0;for(let k=i0;k1e-6)for(let k=i0;k{const n=a.length;if(n>24){a.sort(byDist);return;}for(let i=1;i=0&&byDist(a[j],x)>0){a[j+1]=a[j];j--;}a[j+1]=x;}}; + for(const pass of PASSES||[null])for(const rank of RANKS){ + if(TR?!E.length:!E.some(e=>base(e)===rank))continue; + // Index loops in here: plain for…of allocates an iterator per loop until V8 has optimised compute(). + for(let fi=0,FN=flows.length;fi=e.cap){full++;continue;}const d=Dv[e.ci];if(d===Infinity)continue;const h=e.hp; + if(h=lst.length&&full){let k=0;for(let li=0;li1)continue; + if(G.length>1)sortD(G);} + sendGroup(G,0,G.length); + if(f.rem<=1e-6)continue; + REST.length=0;for(let li=0;li1e-6;){ + let j=i+1;while(j0&&SRV[i]>0)R2.latF[c]=clamp(1-LATP[i]/SRV[i],0,1);} + // Each city's slowest big exit: (path, source, exit) triples, one per path that went far, in the order they first did. + {const G=new Map();for(let k=0;kcur.g)R2.latFar[c]={to:CITIES[o.to].id,g:o.g,ms:o.ms,share:SRV[o.src]>0?o.g/SRV[o.src]:0};}} + // R.ef is read for the link you inspect: each edge's record is put together the first time it is asked for. Scenic + // routing only needs the egress amounts, so R.efg keeps those as they are (not listed, so R reads the same). + {const efg={};for(const l of EL){const t=l.tr,i=l.i;let rec=null;efg[l.id]=t.g; + Object.defineProperty(R2.ef,l.id,{enumerable:true,configurable:true,get(){if(!rec){rec={eg:{},net:{},dst:{}};for(const [k,v] of t.g)rec.eg[k]=v; + for(const j of t.n)rec.net[j0?R2.peered/R2.served:0; + for(const e of E){if(e.k==='t')R2.useT[e.id]=(R2.useT[e.id]||0)+e.used;else if(e.k==='ix')R2.useIx[e.id]=e.used;else if(e.k==='p')R2.usePni[e.id]=e.used;else R2.useCache[e.id]=e.used;} + // money + const C=R2.cost,V=R2.rev,pm=S.priceMul; + C.pops=Object.values(S.pops).reduce((a,p)=>a+POP_MO+((p.routers||1)-1)*ROUTER_MO+(p.routers||1)*RG[p.rgen||0].mo+(p.gen?GEN_MO:0),0); + C.optical=S.links.filter(l=>l.kind==='df').reduce((a,l)=>a+(l.ready>S.day?0:ampCount(l.km)*AMP_MO*(l.own&&isRdm(l.sys)&&!l.sub?Math.max(1,l.pairs|0):1)+(l.regen|0)*REGEN_MO)+(l.spares?Math.round(150+(l.ch||[]).length*80):0),0); + C.links=S.links.reduce((a,l)=>a+(l.mo||0),0); + C.nni=(S.nni||[]).reduce((a,x)=>a+NNI[x.tier].mo,0); + C.transit=S.transit.reduce((a,t)=>{const q=p95(t,R2.useT[t.id]||0);R2.p95[t.id]=q;return a+transitMo(t,q);},0); + C.ix=Object.keys(S.ixp).reduce((a,c)=>a+ixMo(c),0); + C.pni=S.pni.reduce((a,p)=>a+pniMo(p,R2.usePni[p.id]||0),0); + C.caches=S.caches.length*CACHE_MO; + C.loans=(S.loans||[]).reduce((a,l)=>a+(BANKS[l.bank].equity?0:l.model==='transit'?Math.round((C.transit||0)*(l.cut||0.3)):l.pay)+loanFees(l),0); + C.extras=(S.cnLic&&S.cnLic.state==='ok'?CN_JV_MO:0)+scrubMo()+Object.keys(S.pops).filter(ruCity).length*RU_BOX_MO+Object.values(S.pops).filter(p=>p.site2).length*SITE2_MO+(S.te?TE_MO:0)+(S.inbox&&S.inbox.bot?AI_MO:0); + V.eyeballs=0;V.business=0;V.ix=0; + C.wholesale=0;C.levy=0;const lev=scnRule('levy');for(const c in S.pops){const sf=sfOf(R2,c),v=R2.cityEye[c]*sf*EYE_RATE*(CITY[c].arpu||1);V.eyeballs+=v;if(CITY[c].au){if(lev)C.levy+=v*AU_LEVY;else C.wholesale+=v*AU_WHOLESALE;}} + for(const b of S.biz){const sf=BIZ_T[b.type].fiber?(fiberOk(b)?1:0):BIZ_T[b.type].l2?clamp((R2.l2[b.id]||0)/b.bw,0,1):sfOf(R2,b.city);V.business+=b.bw*b.rate*Math.min(1,sf/0.95);} + for(const c in S.myIx)V.ix+=S.myIx[c].members.length*MYIX_FEE; + C.revshare=(S.loans||[]).reduce((a,l)=>a+(BANKS[l.bank].equity||l.bal>0?l.share||0:0),0)*(V.eyeballs+V.business+V.ix); + R2.costMo=Object.values(C).reduce((a,b)=>a+b,0); + R2.revMo=V.eyeballs+V.business+V.ix; + R=R2;UI.hotMap=hotByCity(); +} diff --git a/src/game/80-simulation/40-billing.js b/src/game/80-simulation/40-billing.js new file mode 100644 index 0000000..668c6d6 --- /dev/null +++ b/src/game/80-simulation/40-billing.js @@ -0,0 +1,10 @@ +function p95(t,cur){const h=(t.hist||[]).slice(-29).concat([cur]).sort((a,b)=>a-b);return h[Math.max(0,Math.ceil(.95*h.length)-1)];} +function linkDown(l){return l.cut>S.day||(S.ev.runet>S.day&&ruCity(l.a)!==ruCity(l.b))||(S.ev.gulf>S.day&&((CITY[l.a].qa&&(CITY[l.b].gcc||CITY[l.b].uae))||(CITY[l.b].qa&&(CITY[l.a].gcc||CITY[l.a].uae))))||(l.kind==='vxc'&&!!S.ev.fab&&S.ev.fab[l.prov]>S.day)||(l.kind==='df'&&dfCap(l)<=0);} +function remoteCities(){return [...new Set(S.links.filter(l=>l.kind==='vxc').flatMap(l=>[l.a,l.b]))].filter(c=>!S.pops[c]);} +function nniUsed(c,prov){return S.links.filter(l=>l.kind==='vxc'&&l.prov===prov&&(l.a===c||l.b===c)).reduce((a,l)=>a+VXC[l.vt].g,0)+S.biz.filter(b=>BIZ_T[b.type].nni&&b.prov===prov&&b.city===c).reduce((a,b)=>a+b.bw,0);} +// Monthly price of one connection; compute() sums these, the connections overview lists them. +function transitMo(t,q){const n=t.n||1;return Math.max(q,PORT[t.tier].g*n*0.2)*NET[t.net].price*(t.premium&&t.city==='hkg'?NET[t.net].premium:1)*S.priceMul*regionMult(t.city)+PORT[t.tier].tmo*n+(t.clean?cleanMo(t):0);} +function pniMo(p,use){if(!pniOn(p))return 0;return (p.g1?Math.round(PORT[0].pni/2):PORT[p.tier].pni)*(p.n||1)+(NET[p.net].pol==='paid'&&!paidFree(NET[p.net])?NET[p.net].paidFee:0)+(NET[p.net].perG?Math.round(NET[p.net].perG*use):0);} +function ixMo(c){return S.myIx[c]?Math.round(myFab(c).mo*((S.ixSite||{})[c]==='ab'?1.5:1)):ixPortMo(c,S.ixp[c])*((S.ixn||{})[c]||1)+dkAddonMo(c);} +function nniPort(c,prov){return (S.nni||[]).find(x=>x.city===c&&x.prov===prov);} +function repayCost(l,B){return B.equity?Math.round(l.amount*3):Math.round(Math.max(l.bal,B.crypto&&l.got?l.got:0)*1.02);} diff --git a/src/game/80-simulation/50-sanitize.js b/src/game/80-simulation/50-sanitize.js new file mode 100644 index 0000000..763deed --- /dev/null +++ b/src/game/80-simulation/50-sanitize.js @@ -0,0 +1,78 @@ +const own=(o,k)=>Object.prototype.hasOwnProperty.call(o,k); +const isCity=c=>typeof c==='string'&&own(CITY,c),isIx=x=>typeof x==='string'&&(own(CITY,x)||own(XIXM,x)),isNet=n=>typeof n==='string'&&own(NET,n); +const num=(v,d=0)=>{v=+v;return Number.isFinite(v)?v:d;},int=(v,lo,hi,d)=>{v=Math.round(num(v,d));return Math.min(hi,Math.max(lo,v));}; +/* Saves come from localStorage or from imported files, so treat them as untrusted: fill in anything + missing, drop references to cities, networks or types that do not exist, and force numbers to be numbers. */ +function sanitize(s){ + const arr=k=>{if(!Array.isArray(s[k]))s[k]=[];},obj=k=>{if(!s[k]||typeof s[k]!=='object'||Array.isArray(s[k]))s[k]={};}; + ['links','nni','transit','pni','caches','biz','offers','inc','usedNames','loans','loanOffers','hist','log'].forEach(arr); + ['pops','ixp','rs','peers','myIx','done','ev','stats','ixn','ixPref','ixSite','confReg','ach'].forEach(obj); + s.v=1;s.name=String(s.name==null?'Packet Pals':s.name).slice(0,24);s.day=int(s.day,0,1e7,0);s.cash=num(s.cash,0);s.asn=int(s.asn,1,4294967294,200000); + s.priceMul=num(s.priceMul,1);s.nextFail=num(s.nextFail,s.day+45);s.nextEvent=num(s.nextEvent,s.day+40);s.lvl=int(s.lvl,1,LEVELS.length,1);s.neg=int(s.neg,0,1e7,0);s.loanStrikes=int(s.loanStrikes,0,1e3,0); + for(const k of Object.keys(s.stats)){const v=s.stats[k];if(k==='by'||k==='f'){if(!v||typeof v!=='object')s.stats[k]={};else for(const j of Object.keys(v))v[j]=num(v[j],0);}else if(typeof v!=='boolean')s.stats[k]=num(v,0);} + for(const k of ['survived','incidents','peak'])s.stats[k]=num(s.stats[k],0); + for(const c of Object.keys(s.pops)){const p=s.pops[c];if(!isCity(c)||!p||typeof p!=='object'){delete s.pops[c];continue;}p.routers=int(p.routers,1,RMAX,1);if(p.rupDay!==undefined)p.rupDay=num(p.rupDay,-1);if(p.rgen!==undefined)p.rgen=int(p.rgen,0,RG.length-1,0);p.down=num(p.down,0);if(p.bb&&typeof p.bb==='object')p.bb.d=num(p.bb.d,0);else p.bb=null;} + if(!isCity(s.home))s.home=Object.keys(s.pops)[0]||'fra'; + 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);l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);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='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&!own(CAB,l.cable))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);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);if(l.metric&&!own(MET,l.metric))l.metric='normal';return l;}); + for(const l of s.links)repairSubUpgradeDates(l,s.day); + const degO=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null; + s.transit=s.transit.filter(t=>t&&isCity(t.city)&&isNet(t.net)).map(t=>(t.lacp=degO(t.lacp),t.site=['a','b','ab'].includes(t.site)?t.site:'a',t.id=sid(t.id),t.tier=tier(t.tier),t.n=lag(t.n),t.down=num(t.down,0),t.clean=!!t.clean,t)); + s.pni=s.pni.filter(x=>x&&isCity(x.city)&&isNet(x.net)).map(x=>(x.lacp=degO(x.lacp),x.site=['a','b','ab'].includes(x.site)?x.site:'a',x.id=sid(x.id),x.tier=tier(x.tier),x.n=lag(x.n),x.sacrif=!!x.sacrif,x)); + // PNIs on order (#…): delivery day, a pending augment, and 1G for the one network that sells it + for(const x of s.pni){if(x.ready!==undefined)x.ready=num(x.ready,0);if(x.g1)x.g1=x.tier===0&&x.net==='dtk'?true:undefined;else delete x.g1;if(x.up){const u=x.up;x.up=u&&typeof u==='object'?{tier:tier(u.tier),n:lag(u.n),ready:num(u.ready,0),g1:!!u.g1&&x.net==='dtk'&&tier(u.tier)===0}:undefined;if(!x.up)delete x.up;}} + // Supply chain: a shortage and a price lock, both optional. + {const H=s.hw&&typeof s.hw==='object'&&!Array.isArray(s.hw)?s.hw:{},o={};const sh=H.shock,lk=H.lock; + if(sh&&typeof sh==='object'&&own(HW_SHOCK,sh.k))o.shock={k:sh.k,until:num(sh.until,0),mul:clamp(num(sh.mul,1),1,2)}; + if(lk&&typeof lk==='object')o.lock={until:num(lk.until,0),mul:clamp(num(lk.mul,1),1,HW_CAP)};s.hw=o;} + {const I=s.inbox&&typeof s.inbox==='object'&&!Array.isArray(s.inbox)?s.inbox:{},o=v=>v&&typeof v==='object'&&!Array.isArray(v)?v:{},str=(v,n)=>String(v==null?'':v).slice(0,n); + const items=(Array.isArray(I.items)?I.items:[]).filter(x=>x&&typeof x==='object'&&(x.k==='req'||x.k==='mp')&&typeof x.ix==='string'&&isIx(x.ix)&&(x.net===undefined||isNet(x.net))&&(x.net!==undefined||typeof x.nm==='string')).slice(0,INBOX_MAX).map(x=>({id:int(x.id,0,1e9,0),k:x.k,ix:x.ix,net:x.net,nm:x.net?undefined:str(x.nm,40),asn:x.net?undefined:int(x.asn,1,4294967294,64512),day:num(x.day,0),stale:!!x.stale,yrs:int(x.yrs,1,30,1),say:int(x.say,0,REQ_SAY.length-1,0),bump:x.bump?1:undefined,key:x.k==='mp'?str(x.key,80):undefined,lim:x.k==='mp'?int(x.lim,1,1e7,100):undefined,got:x.k==='mp'?int(x.got,1,1e7,100):undefined,leak:x.k==='mp'?!!x.leak:undefined})); + const down={};for(const [k,v] of Object.entries(o(I.down)))if(typeof k==='string'&&k.length<80)down[k]=num(v,0); + const tiny={};for(const [k,v] of Object.entries(o(I.tiny)).slice(0,200))if(/^\d{1,10}$/.test(k)&&v&&typeof v==='object'&&isIx(v.ix))tiny[k]={nm:str(v.nm,40),ix:v.ix,stale:!!v.stale}; + const log=(Array.isArray(I.log)?I.log:[]).filter(e=>e&&typeof e==='object'&&typeof e.m==='string').slice(0,40).map(e=>{const a={};for(const [k,v] of Object.entries(o(e.a)).slice(0,6))a[str(k,12)]=typeof v==='number'?v:str(v,60);return {d:num(e.d,0),m:str(e.m,200),a};}); + s.inbox={items,down,tiny,rep:clamp(num(I.rep,0),-10,5),bot:!!I.bot,pol:PPOL.includes(I.pol)?I.pol:'open',log,seq:Math.max(int(I.seq,0,1e9,0),...items.map(x=>x.id))};} + {const sp={};if(s.spares&&typeof s.spares==='object')for(const k in s.spares)if(own(OPT,k)){const v=Math.floor(+s.spares[k]);if(v>0)sp[k]=Math.min(999,v);}s.spares=sp;} + s.caches=s.caches.filter(x=>x&&isCity(x.city)&&isNet(x.net)&&NET[x.net].cache).map(x=>(x.id=sid(x.id),x.site=x.site==='b'&&s.pops[x.city]&&s.pops[x.city].site2?'b':'a',x)); + for(const c of Object.keys(s.ixp)){if(!isIx(c))delete s.ixp[c];else s.ixp[c]=tier(s.ixp[c]);} + for(const k of ['rs','ixn','ixPref','ixSite'])for(const c of Object.keys(s[k]))if(!isIx(c))delete s[k][c];if(s.ixCut&&typeof s.ixCut==='object'){for(const c of Object.keys(s.ixCut))if(!isIx(c))delete s.ixCut[c];else s.ixCut[c]=Math.min(1,Math.max(0.6,num(s.ixCut[c],1)));}else delete s.ixCut; + for(const c of Object.keys(s.ixn))s.ixn[c]=lag(s.ixn[c]);for(const c of Object.keys(s.ixSite))if(!['a','b','ab'].includes(s.ixSite[c]))s.ixSite[c]='a'; + for(const k of Object.keys(s.peers)){const [n,c]=k.split('@');if(!isNet(n)||!isIx(c))delete s.peers[k];} + for(const c of Object.keys(s.myIx)){const m=s.myIx[c];if(!isCity(c)||!m||typeof m!=='object'){delete s.myIx[c];continue;}m.members=Array.isArray(m.members)?m.members.filter(isNet):[];m.name=String(m.name||tr('common.your_ix')).slice(0,40);m.next=num(m.next,s.day);m.fab=int(m.fab,0,MYIX_FAB.length-1,0);} + const okBiz=b=>b&&own(BIZ_T,b.type)&&(!BIZ_T[b.type].nni||own(FAB,b.prov))&&isCity(b.city)&&(!b.city2||isCity(b.city2))&&(!b.sites||Array.isArray(b.sites)&&b.sites.every(isCity)); + const fixBiz=b=>{b.id=sid(b.id);b.name=String(b.name||tr('common.customer')).slice(0,80);b.bw=num(b.bw,1);b.rate=num(b.rate,0);if(b.fee!==undefined)b.fee=num(b.fee,0);if(b.start!==undefined)b.start=num(b.start,0);if(b.dur!==undefined)b.dur=num(b.dur,1);if(b.slots!==undefined)b.slots=num(b.slots,0);if(b.what!==undefined)b.what=String(b.what).slice(0,200);if(b.broker!==undefined)b.broker=!!b.broker;if(!Array.isArray(b.reqs))b.reqs=[];b.reqs=b.reqs.filter(r=>own(REQS,r));if(b.mood!==undefined)b.mood=num(b.mood,100);if(b.pm!==undefined)b.pm=num(b.pm,b.mood||100);if(b.exp!==undefined)b.exp=num(b.exp,0);if(b.latMax!=null)b.latMax=num(b.latMax,10);if(b.route&&!own(RT,b.route))b.route='normal';return b;}; + s.biz=s.biz.filter(okBiz).map(fixBiz);s.offers=s.offers.filter(okBiz).map(fixBiz); + s.inc=s.inc.filter(i=>i&&typeof i.type==='string').map(i=>(i.id=sid(i.id),i.until=num(i.until,s.day),i.cost=num(i.cost,0),i.msg=String(i.msg||'').slice(0,400),i.fix=i.fix==null?undefined:String(i.fix).slice(0,60),i)); + 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=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'&&LOG_OPEN.includes(e.o.a)?(e.o.a==='bank'||e.o.a==='inbox'?{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; + {const seen=new Set();s.scrubs=s.scrubs.filter(x=>x&&typeof x==='object'&&isCity(x.city)&&s.pops[x.city]&&!seen.has(x.city)&&seen.add(x.city)).map(x=>({city:x.city,tier:int(x.tier,0,SCRUB_TIERS.length-1,0)}));} + s.scrubMode=s.scrubMode==='ondemand'?'ondemand':'always'; + // Keep the legacy primary attack so old saves and imports remain compatible; additional floods overlap it. + const repairAttack=a=>{if(!a||typeof a!=='object'||!isCity(a.city)||!s.pops[a.city]||!own(DDOS_VEC,a.vec))return null; + a.id=sid(a.id);a.gbps=Math.max(0,num(a.gbps,2));a.until=num(a.until,s.day);a.bh=!!a.bh;a.ixbh=!!a.ixbh;a.start=Math.max(0,Math.min(s.day,num(a.start,s.day)));a.until=Math.min(a.until,a.start+7); + if(Array.isArray(a.entries)){a.entries=a.entries.filter(en=>en&&['t','ix','p'].includes(en.k)&&isCity(en.city)&&typeof en.id==='string'&&Number.isFinite(+en.share)&&+en.share>0).slice(0,3000).map(en=>({k:en.k,id:en.id.slice(0,40),city:en.city,lab:String(en.lab||'').slice(0,60),share:+en.share}));const sum=a.entries.reduce((n,en)=>n+en.share,0);if(Number.isFinite(sum)&&sum>0)for(const en of a.entries)en.share/=sum;else delete a.entries;}else delete a.entries; + a.sla=Array.isArray(a.sla)?a.sla.filter(x=>typeof x==='string').slice(0,s.biz.length):[]; + if(!a.entry||typeof a.entry!=='object')a.entry={k:'edge',lab:''};else{a.entry.lab=String(a.entry.lab||'').slice(0,60);a.entry.id=a.entry.id==null?undefined:String(a.entry.id).slice(0,40);}return a;}; + const attacks=[s.ev.ddos,...(Array.isArray(s.ev.ddosMore)?s.ev.ddosMore:[])].map(repairAttack).filter(Boolean).slice(0,14); + if(attacks.length)s.ev.ddos=attacks[0];else delete s.ev.ddos;s.ev.ddosMore=attacks.slice(1); + s.ddosStarts=(Array.isArray(s.ddosStarts)?s.ddosStarts:attacks.map(a=>a.start)).filter(d=>typeof d==='number'||typeof d==='string').map(Number).filter(d=>Number.isFinite(d)&&d>s.day-7&&d<=s.day).sort((a,b)=>a-b).slice(-14); + s.auV=s.auV===1?1:0;if(s.auNews!==true)delete s.auNews; + if(s.te){if(typeof s.te!=='object')s.te=null;else{s.te.on=!!s.te.on;s.te.script=typeof s.te.script==='string'?s.te.script.slice(0,4000):'';}} + return s;} +function migrate(s){sanitize(s); + // Older saves have one contract per broker sale: fold a carrier's alien waves on one fiber into one contract. + {const one=new Map();s.biz=s.biz.filter(b=>{if(b.type!=='wwave')return true;const k=b.link+'|'+b.name,a=one.get(k);if(!a){one.set(k,b);return true;} + a.slots=(a.slots||0)+(b.slots||0);a.rate=(a.rate||0)+(b.rate||0);a.since=Math.min(a.since??0,b.since??0);a.mood=Math.min(a.mood??100,b.mood??100);a.folded=true;return false;}); + for(const a of one.values())if(a.folded){delete a.folded;const l=s.links.find(x=>x.id===a.link);if(l)a.what=wwWhat(l,a.slots);}}if(s.scn&&s.scn.id==='stg'&&s.scn.rules&&typeof s.scn.rules==='object')s.scn.rules.local=true;for(const b of [...s.biz,...s.offers])if(Array.isArray(b.reqs))b.reqs=b.reqs.filter(k=>!REQS[k]||!REQS[k].can||(isCity(b.city)&&(!b.city2||isCity(b.city2))&&REQS[k].can(b,s)));if(s.ltv!==2){for(const l of s.links)if(l.kind==='wave'&&l.tier>=3)l.tier=Math.min(LT.length-1,l.tier+1);s.ltv=2;}if(s.dk){s.dk.m=s.dk.m||{};s.dk.add=s.dk.add||{};s.dk.ret=s.dk.ret||{};s.dk.retUsed=s.dk.retUsed||{};}s.hist=s.hist||[];s.loans=s.loans||[];s.loanOffers=s.loanOffers||[];s.loanStrikes=s.loanStrikes||0;for(const l of s.links||[])if(!l.kind)l.kind='wave'; + for(const c in s.pops){const p=s.pops[c];if(p.rgen===undefined){let g=0;const need=(i,key)=>{const k=RG.findIndex(r=>r[key]>=i);if(k>g)g=k;}; + for(const l of s.links||[])if((l.a===c||l.b===c)&&l.kind==='wave')need(l.tier,'maxLT'); + for(const t of s.transit||[])if(t.city===c)need(t.tier,'maxP');for(const x of s.pni||[])if(x.city===c)need(x.tier,'maxP');if(s.ixp&&s.ixp[c]!==undefined)need(s.ixp[c],'maxP');p.rgen=g;}}for(const b of s.biz||[])if(!b.reqs)b.reqs=BIZ_T[b.type]&&BIZ_T[b.type].div?['diverse']:[];for(const o of s.offers||[])if(!o.reqs)o.reqs=[];if(!s.lvl)s.lvl=1;s.nni=s.nni||[];s.cnLic=s.cnLic||{state:'none'};s.ev=s.ev||{};for(const l of s.links){if(!l.kind)l.kind='wave';if(l.mo===undefined)l.mo=Math.round(waveMo(l.km,l.sub,l.tier)*(l.mult||1));}for(const c in s.pops){if(!s.pops[c].routers)s.pops[c].routers=1;} + {const all=NETS.map(n=>n.id),seen=Array.isArray(s.seen)?s.seen.filter(x=>typeof x==='string'):null,fresh=seen?all.filter(id=>!seen.includes(id)):all; + if(fresh.length&&(s.day||0)>0){const g=s.grace&&s.grace.until>s.day?s.grace:{nets:[]};s.grace={until:s.day+GRACE_DAYS,nets:[...new Set(g.nets.concat(fresh))],fresh:seen?fresh.length:0};} + s.seen=all;} + // Australian pricing and peering changed in place (#148): a save that was already there gets told once. + if(s.auV!==1){if((s.day||0)>0&&Object.keys(s.pops).some(c=>CITY[c].au))s.auNews=true;s.auV=1;} + if(s.grace&&(typeof s.grace!=='object'||!isFinite(s.grace.until)||!Array.isArray(s.grace.nets)))s.grace=null;if(s.grace)s.grace.nets=s.grace.nets.filter(isNet); + return s;} diff --git a/src/game/80-simulation/60-requirements.js b/src/game/80-simulation/60-requirements.js new file mode 100644 index 0000000..4ea4e69 --- /dev/null +++ b/src/game/80-simulation/60-requirements.js @@ -0,0 +1,63 @@ +const GRACE_DAYS=60; +const REQS={ + lat:{only:true,l2:true,bonus:0,l:o=>tr('requirements.one_way_latency_within_max_ms',{max:o.latMax,best:(()=>{const v=R.l2lat[o.id]!==undefined?R.l2lat[o.id]:bestLat(o.city,o.city2);return isFinite(v)?v.toFixed(1)+' ms':tr('common.no_path')})()}),ok:b=>(R.l2lat[b.id]!==undefined?R.l2lat[b.id]:bestLat(b.city,b.city2))<=b.latMax}, + nni:{only:true,bonus:0,l:o=>tr('requirements.comes_in_over_fab_needs_your',{fab:FAB[o.prov]?FAB[o.prov].name:'?',city:CITY[o.city].name,bw:fmtG(o.bw)}),ok:b=>{const pt=nniPort(b.city,b.prov);return !!pt&&nniUsed(b.city,b.prov)<=NNI[pt.tier].g+1e-9;}}, + diverse:{l:tr('requirements.two_paths_that_share_no_trench'),bonus:.25,l2:true,can:(b,s=S)=>diversityPossible(b.city,b.city2,s),ok:b=>R.div[b.id]!==undefined?!!R.div[b.id]:diversePaths(b.city,b.city2)}, + sharks:{l:tr('requirements.afraid_of_sharks_needs_a_path'),bonus:.2,l2:true,ok:b=>terrestrialPath(b.city,b.city2),can:b=>!!b.city2&&!isSub(b.city,b.city2)}, + nocog:{l:tr('requirements.refuses_cogentle_transit_anywhere_on'),bonus:.15,ok:()=>!S.transit.some(t=>t.net==='cog')}, + ipv6:{l:tr('requirements.ipv6_or_bust_you_must_peer'),bonus:.1,ok:()=>Object.keys(S.ixp).some(c=>ixSessions(c).has('drz'))||S.pni.some(p=>p.net==='drz'&&pniOn(p))}, + netchill:{l:tr('requirements.wants_netchill_on_net_a_cache'),bonus:.15,ok:()=>S.caches.some(c=>c.net==='nfx')||S.pni.some(p=>p.net==='nfx'&&pniOn(p))}, + gen:{l:tr('requirements.backup_generator_in_every_city_they'),bonus:.15,ok:b=>[b.city,b.city2].filter(Boolean).every(c=>S.pops[c]&&S.pops[c].gen)}, + routers:{l:tr('requirements.insists_on_two_routers_in_their'),bonus:.15,ok:b=>((S.pops[b.city]&&S.pops[b.city].routers)||1)>=2}, + local:{l:tr('requirements.local_breakout_transit_or_an_ix'),bonus:.2,ip:true,ok:b=>S.transit.some(t=>t.city===b.city)||hasIxAt(b.city)||(isTier1()&&S.pni.some(p=>p.city===b.city))}, + metro:{l:tr('requirements.two_data_centers_in_every_metro'),bonus:.2,only:true,ok:b=>[b.city,b.city2].filter(Boolean).every(c=>S.pops[c]&&S.pops[c].site2)}, + twoup:{l:tr('requirements.wants_two_different_transit'),bonus:.15,ip:true,ok:()=>new Set(S.transit.map(t=>t.net)).size>=2||S.transit.length===0}, + china:{l:tr('requirements.needs_low_loss_reach_into_china'),bonus:.3,ip:true,ok:()=>S.transit.some(t=>t.premium&&t.city==='hkg')||S.links.some(l=>l.premium)||S.pni.some(p=>NET[p.net].cn&&pniOn(p))}, + scrubbed:{l:tr('requirements.will_only_sign_with_a_network'),bonus:.15,ok:()=>hasScrub()}, + scrubnear:{l:tr('requirements.wants_a_scrubbing_center_on_its'),bonus:.15,ip:true,ok:b=>S.scrubs.some(x=>CITY[x.city].reg===CITY[b.city].reg)}, + puns:{l:tr('requirements.their_ceo_hates_puns_please_do'),bonus:.05,ok:()=>true}, +}; +function terrestrialPath(a,b){const ls=S.links.filter(l=>!linkDown(l)&&!l.sub);const adj={};for(const l of ls){(adj[l.a]=adj[l.a]||[]).push(l.b);(adj[l.b]=adj[l.b]||[]).push(l.a);}const seen=new Set([a]),q=[a];while(q.length){const u=q.shift();if(u===b)return true;for(const v of adj[u]||[])if(!seen.has(v)){seen.add(v);q.push(v);}}return false;} +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 `
${ok?'✓':'✗'} ${esc(lab)}
`;}).join('');} +function diversePaths(a,b){ + const rem=remoteCities(),ok=c=>popUp(c)||rem.includes(c); + return disjointRoutes(a,b,S.links.filter(l=>!linkDown(l)&&ok(l.a)&&ok(l.b)));} +function disjointRoutes(a,b,live){const srlg=l=>l.kind==='vxc'?'fab:'+l.prov:(l.trench||l.id); + const bfs=ls=>{const adj={};for(const l of ls){(adj[l.a]=adj[l.a]||[]).push([l.b,l]);(adj[l.b]=adj[l.b]||[]).push([l.a,l]);} + const prev={[a]:null},q=[a];while(q.length){const u=q.shift();if(u===b)break;for(const [v,l] of adj[u]||[])if(!(v in prev)){prev[v]=l;q.push(v);}} + if(!(b in prev))return null;const path=[];let v=b;while(v!==a){const l=prev[v];path.push(l);v=l.a===v?l.b:l.a;}return path;}; + const p1=bfs(live);if(!p1)return false;const used=new Set(p1.map(srlg));return !!bfs(live.filter(l=>!used.has(srlg(l))));} +// Check buildable geography, not today's POPs, capacity or outages. Parallel land +// routes can use separate trenches; all segments of one cable share its risk. +let diversityMap=null; +function diversityPossible(a,b,state=S){ + if(!CITY[a]||!CITY[b]||a===b)return false; + const rules=state.scn&&state.scn.rules||{},key=JSON.stringify([!!state.won,rules]); + if(!diversityMap||diversityMap.key!==key){ + const links=[],cities=CITIES.filter(c=>!(rules.banCities||[]).includes(c.id)).map(c=>c.id); + const add=(a,b,id)=>links.push({a,b,id}); + for(let i=0;ip===c.cid+':'+a+'-'+b||p===c.cid+':'+b+'-'+a))add(a,b,'cab:'+c.cid); + if(state.won&&seaCab(a,b)&&landing(a)&&landing(b)&&!cnCity(a)&&!cnCity(b))add(a,b,'own:'+a+':'+b); + for(const f of FABS)if(f.cities.includes(a)&&f.cities.includes(b))add(a,b,'fab:'+f.id); + } + diversityMap={key,links,answers:{}}; + } + const pair=[a,b].sort().join(':'); + return diversityMap.answers[pair]??(diversityMap.answers[pair]=disjointRoutes(a,b,diversityMap.links)); +} +function fiberOk(b){const l=S.links.find(x=>x.id===b.link);if(!l)return false;if(b.type==='dfpair'||b.type==='pairs')return l.ready<=S.day&&!(l.cut>S.day);return l.ready<=S.day&&!(l.cut>S.day)&&!(l.eqDown>S.day);} +function soldSlots(l){return 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. +const freeCh=l=>chMax(l)-(l.ch||[]).length-soldSlots(l),pairFree=l=>!!l.own&&S.biz.filter(b=>b.type==='dfpair'&&b.link===l.id).length<2&&!S.biz.some(b=>b.type==='pairs'&&b.link===l.id); +const wwWhat=(l,n)=>trn('requirements.n_400g_alien_wave_on_your',n,{a:CITY[l.a].name,b:CITY[l.b].name}); +function fiberOffer(t,l,nm,cut=1){ + if(t==='wwave'){const slots=1+Math.floor(Math.random()*Math.min(4,freeCh(l))); + return {id:uid(),city:l.a,city2:l.b,link:l.id,slots,what:wwWhat(l,slots),name:nm(),type:t,bw:1,rate:Math.round(waveMo(l.km,false,2)*0.55*slots*cut),reqs:[],exp:S.day+30};} + return {id:uid(),city:l.a,city2:l.b,link:l.id,what:tr('requirements.a_spare_fiber_pair_in_your',{a:CITY[l.a].name,b:CITY[l.b].name}),name:nm(),type:t,bw:1,rate:Math.round(dfLeaseMo(l.km)*0.9*cut),reqs:[],exp:S.day+30};} diff --git a/src/game/80-simulation/70-customers-and-events.js b/src/game/80-simulation/70-customers-and-events.js new file mode 100644 index 0000000..5356eb3 --- /dev/null +++ b/src/game/80-simulation/70-customers-and-events.js @@ -0,0 +1,45 @@ +function bizSf(b){const T=BIZ_T[b.type];return T.fiber?(fiberOk(b)?1:0):T.l2?clamp((R.l2[b.id]||0)/b.bw,0,1):bizSfOf(R,b.city);} +// Protected business traffic has its own served share; without the rule it shares the city's. +function bizSfOf(r,c){const d=r.bizDem&&r.bizDem[c];return teRules()&&teRules().protect&&d>1e-6?clamp(r.bizSrv[c]/d,0,1):sfOf(r,c);} +function bCities(o){return o.sites?o.sites.slice():[o.city,o.city2].filter(Boolean);} +function bHas(o){return bCities(o).every(c=>S.pops[c]);} +function eventLive(b){return BIZ_T[b.type].event&&S.day>=b.start&&S.day⚠️ ${tr('customers_and_events.gaming_attracts_attacks')}
`:'';} +function bTerms(o){const T=BIZ_T[o.type]; + if(T.event){const live=S.day>=o.start;return tr('customers_and_events.bw_extra_for_d_days_when',{bw:fmtG(o.bw),d:o.dur,when:live?tr('customers_and_events.day_n_of_d',{n:S.day-o.start+1,d:o.dur}):tr('customers_and_events.starting_in_n_d',{n:o.start-S.day}),fee:fmt$(o.fee)});} + if(T.sdwan)return tr('customers_and_events.n_sites_list_bw_per_site',{n:o.sites.length,list:o.sites.map(c=>CITY[c].name).join(', '),bw:fmtG(o.bw),price:fmt$(o.bw*o.rate)}); + if(T.fiber)return esc(o.what)+' · '+tr('common.price_mo',{price:fmt$(o.rate)}); + return fmtG(o.bw)+' · '+tr('common.price_mo',{price:fmt$(o.bw*o.rate)});} +// Events are paid once at the end, prorated by how much of the crowd you served. +function eventTick(b,d){if(!BIZ_T[b.type].event)return false;if(d=0.95)S.stats.evFull=(S.stats.evFull||0)+1;const pay=avg>=0.95?b.fee:avg>=0.7?Math.round(b.fee*avg):-Math.round(b.fee*0.2);S.cash+=pay;S.biz=S.biz.filter(x=>x!==b); + toast(pay>=0?tr('customers_and_events.name_is_over_pay_you_delivered',{name:esc(b.name),pay:fmt$(pay),pct:pct(avg)})+(avg>=0.95?' '+tr('common.flawless'):''):tr('customers_and_events.name_was_a_disaster_only_pct',{name:esc(b.name),pct:pct(avg),pay:fmt$(-pay)}),pay>=0?'good':'bad');sfx(pay>=0?'coin':'err');return true;} +/* Where the giants actually build: gigawatt AI campuses and cloud regions, mapped to the nearest city on the map. */ +const MEGA=[{c:'ash',n:'Data Center Alley'},{c:'ash',n:'Prome-the-mess Ohio'},{c:'dal',n:'Star-Gait Abilene'},{c:'dal',n:'Hyperbole Louisiana'},{c:'dal',n:'Colossal Ego Memphis'},{c:'chi',n:'Fairweather Wisconsin'},{c:'chi',n:'Project Rainy-er Indiana'},{c:'chi',n:'Cornfield Cluster Iowa'},{c:'nyc',n:'Neocloud New Jersey'},{c:'sto',n:'Star-Gait Fjord-way'},{c:'mad',n:'Aragón Mega-shed'},{c:'dub',n:'Bring-Your-Own-Power Dublin'},{c:'auh',n:'Star-Gait UAE'},{c:'ruh',n:'Desert Kingdom AI Campus'},{c:'doh',n:'Lusail Data Oasis'},{c:'kul',n:'Johor Overflow'},{c:'hyd',n:'Vizag AI Hub'},{c:'icn',n:'Ulsan AI Campus'},{c:'tok',n:'Hokkaido Snow DC'},{c:'syd',n:'Star-Gait Down Under'},{c:'syd',n:'AirDrunk Western Sydney'},{c:'mel',n:'AirDrunk Melbourne West'},{c:'mex',n:'Querétaro Cluster'},{c:'for',n:'Short-Video Ceará Campus'},{c:'scl',n:'Quilicura Region'}]; +function spawnMega(t,T,nm,mine){ + const megaMine=MEGA.filter(m=>mine.includes(m.c));if(!megaMine.length)return; + if(t==='ingest'){const m=pick(megaMine),bw=pick(T.opts),dur=3+Math.floor(Math.random()*4),start=S.day+10+Math.floor(Math.random()*12); + S.offers.push({id:uid(),city:m.c,city2:null,name:tr('customers_and_events.name_at_site',{name:nm(),site:m.n}),type:t,bw,rate:0,reqs:[],start,dur,fee:Math.round(bw*dur*55),exp:start-2,mega:true});return;} + if(t==='aiwan'||t==='agi'){const a=pick(megaMine),others=MEGA.filter(m=>m.c!==a.c&&(Math.random()<0.7?mine.includes(m.c):true));if(!others.length)return;const b=pick(others);if(!reqCan('diverse',{city:a.c,city2:b.c}))return;const km=kmBetween(a.c,b.c),bw=pick(T.opts); + const reqs=['diverse'];if(Math.random()<0.4)reqs.push('metro'); + S.offers.push({id:uid(),city:a.c,city2:b.c,name:`${nm()}: ${a.n} ⇄ ${b.n}`,type:t,bw,rate:Math.round((150+km*0.08)*T.km),reqs,exp:S.day+45,mega:true});return;} + if(t==='mtrain'){const hub=pick(megaMine),reg=CITY[hub.c].reg,pool=[...new Set(MEGA.filter(m=>m.c!==hub.c&&CITY[m.c].reg===reg).map(m=>m.c))];if(pool.length<2)return; + const sites=[hub.c];while(sites.lengthx+kmBetween(hub.c,c),0)/(sites.length-1),bw=pick(T.opts); + S.offers.push({id:uid(),city:hub.c,city2:null,sites,name:tr('customers_and_events.name_hub_site',{name:nm(),site:hub.n}),type:t,bw,rate:Math.round((150+avg*0.08)*0.6),reqs:[],exp:S.day+45,mega:true});return;} + if(t==='pairs'){const ls=S.links.filter(l=>l.kind==='df'&&l.own&&l.ready<=S.day&&!S.biz.some(b=>(b.type==='pairs'||b.type==='dfpair')&&b.link===l.id)&&!S.offers.some(o=>o.link===l.id));if(!ls.length)return;const l=pick(ls),n=100+50*Math.floor(Math.random()*7); + S.offers.push({id:uid(),city:l.a,city2:l.b,link:l.id,what:tr('customers_and_events.n_fiber_pairs_in_your_a',{n,a:CITY[l.a].name,b:CITY[l.b].name}),name:nm(),type:t,bw:1,rate:Math.round(dfLeaseMo(l.km)*n*0.2),reqs:[],exp:S.day+30,mega:true});} +} +function spawnSpecial(t){const T=BIZ_T[t],mine=Object.keys(S.pops),lv=S.lvl||1; + const nm=()=>{const list=T.names.filter(n=>!S.usedNames.includes(n));const n=list.length?pick(list):pick(T.names);S.usedNames.push(n);return n;}; + if(T.mega){spawnMega(t,T,nm,mine);return;} + if(T.event){const city=Math.random()<0.85&&mine.length?pick(mine):pick(OFFC);const bw=pick(T.opts.slice(0,Math.min(T.opts.length,lv+2)));const dur=3+Math.floor(Math.random()*5),start=S.day+12+Math.floor(Math.random()*14); + S.offers.push({id:uid(),city,city2:null,name:tr('customers_and_events.name_in_city',{name:nm(),city:CITY[city].name}),type:t,bw,rate:0,reqs:[],start,dur,fee:Math.round(bw*dur*70),exp:start-2});return;} + if(T.sdwan){const hub=pick(mine),n=3+Math.floor(Math.random()*4),pool=(Math.random()<0.85?mine:OFFC).filter(c=>c!==hub),sites=[hub]; + while(sites.lengthl.kind==='df'&&l.ready<=S.day); + if(t==='wwave'){const ls=ready.filter(l=>freeCh(l)>=1&&!S.offers.some(o=>o.link===l.id));if(!ls.length)return;S.offers.push(fiberOffer(t,pick(ls),nm));return;} + if(t==='dfpair'){const ls=ready.filter(l=>pairFree(l)&&!S.offers.some(o=>o.link===l.id));if(!ls.length)return;S.offers.push(fiberOffer(t,pick(ls),nm));} +} diff --git a/src/game/80-simulation/80-geography-and-latency.js b/src/game/80-simulation/80-geography-and-latency.js new file mode 100644 index 0000000..cab5a75 --- /dev/null +++ b/src/game/80-simulation/80-geography-and-latency.js @@ -0,0 +1,39 @@ +function cnOk(){return S.cnLic&&S.cnLic.state==='ok';} +function regionMult(c){const C=CITY[c];if(!C||C.cn)return 1;if(C.kr)return KR_TRANSIT;if(C.au)return AU_TRANSIT;if(C.tape)return 1.5;return C.reg==='AS'?2.5:C.reg==='AF'?2:C.reg==='OC'?1.8:C.reg==='SA'?1.6:1;} +const uaePair=(a,b)=>!!CITY[a].uae&&!!CITY[b].uae; +const rainPair=(a,b)=>!!(CITY[a].rain||CITY[b].rain); +const borderPair=(a,b)=>!!CITY[a].cc&&!!CITY[b].cc&&CITY[a].cc!==CITY[b].cc; +// Perth to the east coast: the sea route round the south coast is domestic (AU_WAVE.ew), and the Nullarbor +// fiber costs a little more again because the incumbents own it. +const NULLARBOR=1.7,nullPair=(a,b)=>!!CITY[a].au&&!!CITY[b].au&&(a==='per')!==(b==='per'); +const andesPair=(a,b)=>!!CITY[a].andes&&!!CITY[b].andes&&CITY[a].andes!==CITY[b].andes; +/* Overland between continents (Europe to the Middle East and Asia) crosses a dozen borders and as many + carriers, each taking a cut: in real life it costs ten times the subsea route or more (#40). */ +const LAND_X=45,landX=(a,b)=>!isSub(a,b)&&CITY[a].reg!==CITY[b].reg; +function landMult(a,b){if(isSub(a,b))return 1;if(uaePair(a,b))return 3;return (landX(a,b)?LAND_X:1)*(andesPair(a,b)?2:1)*(nullPair(a,b)?NULLARBOR:1)*(rainPair(a,b)?2:1)*(borderPair(a,b)?2:1);} +function landWhy(a,b){if(isSub(a,b))return '';if(uaePair(a,b))return tr('geography_and_latency.inside_the_uae_only_the_two'); + const r=[];if(CITY[a].reg!==CITY[b].reg)r.push(tr('geography_and_latency.overland_between_continents_crosses',{x:LAND_X}));if(andesPair(a,b))r.push(tr('geography_and_latency.this_route_crosses_the_andes_2'));if(nullPair(a,b))r.push(tr('geography_and_latency.this_route_crosses_the_nullarbor_x',{x:NULLARBOR}));if(borderPair(a,b))r.push(tr('geography_and_latency.this_route_crosses_a_border_in'));if(rainPair(a,b))r.push(tr('geography_and_latency.this_route_goes_into_the_amazon'));return r.join(' ');} +function linkLat(l){const f=l.kind==='df'?(l.own?(l.sub?seaLatencyFactor(l):1.1):1.25):l.kind==='vxc'?1.4:l.cable?(CAB[l.cable].lat||1):1.3;return l.km*f/200;} +/* Wave prices differ a lot by market (TeleGeography): Europe's dense, competitive metro and + long-haul routes are cheap (Frankfurt–London 100G ≈ $1,150/mo), the US costs more, and + routes into Africa are several times dearer (Africa–Europe ≈ 5.9× London–New York). + Each route also gets its own market mood, and new leases get cheaper every year (~8%). */ +const WAVE_LAND={EU:0.65,AM:1,SA:1.6,AS:1.4,OC:1.2,AF:2.2},WAVE_SUB={EU:0.8,AM:1,SA:2,AS:1.5,OC:1.5,AF:4.5}; +const WAVE_NAME={EU:tr('common.europe'),AM:tr('common.north_america'),SA:tr('common.south_america'),AS:tr('common.asia'),OC:tr('common.oceania'),AF:tr('common.africa')}; +function waveMarket(a,b,sub){const ra=CITY[a].reg,rb=CITY[b].reg,T=sub?WAVE_SUB:WAVE_LAND,au=sub?AU_WAVE.sub:AU_WAVE.land; + const fa=CITY[a].au?au:(T[ra]||1),fb=CITY[b].au?au:(T[rb]||1),reg=sub&&nullPair(a,b)?AU_WAVE.ew:sub?Math.max(fa,fb):(fa+fb)/2; + const key=a1.03?tr('geography_and_latency.where_lvl_this_route_is_p_0196',{where,lvl,p:Math.round((k.mood-1)*100),since}):tr('geography_and_latency.where_lvl_this_route_is_right',{where,lvl,since});} +function waveRoute(a,b,mult,border){const cabs=cablesOk(a,b),sub=isSub(a,b);let via=UI.via; + if(!cabs.find(c=>c.cid===via))via=sub?(cabs[0]?cabs[0].cid:null):(via==='land'||!via?'land':'land'); + if(!via)return null;const bf=border?3*(UI.cnPrem&&(a==='hkg'||b==='hkg')?1.6:1):1; + if(via==='land')return {via,cabs,cab:null,km:kmBetween(a,b),sub:false,wm:mult*landMult(a,b)*waveMarket(a,b,false).m}; + const c=cabs.find(x=>x.cid===via);return {via,cabs,cab:via,km:c.km,sub:true,wm:bf*CAB[via].price*waveMarket(a,b,true).m};} +function viaSeg(a,b){const cabs=cablesOk(a,b),sub=isSub(a,b);if(!cabs.length)return landMult(a,b)>1?`

${landWhy(a,b)}

`:'';const wr=waveRoute(a,b,1,false); + const opts=(sub?[]:[{v:'land',l:`${tr('common.overland')} ${landMult(a,b)>1?landMult(a,b)+'× · ':''}${(kmBetween(a,b)*1.3/200).toFixed(1)} ms`}]).concat(cabs.map(c=>({v:c.cid,l:`${esc(CAB[c.cid].name)} ${CAB[c.cid].price}× · ${(c.km*(CAB[c.cid].lat||1)/200).toFixed(1)} ms${CAB[c.cid].age==='old'?' · '+tr('geography_and_latency.old_cuts_often'):''}`}))); + return `

${tr('common.route')}

${opts.map(o=>btn(o.l,'via',{v:o.v},wr&&wr.via===o.v?'pink':'ghost')).join('')}
${wr&&wr.cab?`

${esc(CAB[wr.cab].blurb)} ${tr('geography_and_latency.all_your_waves_on_one_cable')}

`:''}`;} +function bestLat(a,b){const ls=S.links.filter(l=>!linkDown(l));const dist={[a]:0},done=new Set();for(;;){let u=null,ud=Infinity;for(const k in dist)if(!done.has(k)&&dist[k]${tr('common.route_4a2e')}${Object.keys(RT).map(m=>btn(RT[m],'setRoute',{id:b.id,m},(b.route||'normal')===m?'pink sm':'ghost sm')).join('')}
${tr('sites_and_service.path_latency_lat',{lat:lt!==undefined&&isFinite(lt)?tr('common.ms_ms_one_way',{ms:lt.toFixed(1)}):tr('sites_and_service.no_path_right_now')})}${b.route==='scenic'&&R.l2split&&R.l2split[b.id]?' · '+tr('sites_and_service.split_over_two_equally_quiet_paths'):''}${b.latMax?' · '+tr('sites_and_service.budget_ms_ms',{ms:b.latMax}):''}
`;} +function nodeCap(c){const p=S.pops[c];if(!p)return Infinity;const eff=(p.routers||1)-(p.rdown>S.day?1:0);return RG[p.rgen||0].cap*Math.max(1,eff)*(p.hot>S.day?(p.site2?0.75:0.5):1)*(p.site2&&(siteDown(c,'a')||siteDown(c,'b'))?0.5:1);} +// With a second site, one building can be dark (or cut off by a ring cut) while the other carries on. +function siteDown(c,s){const p=S.pops[c];if(!p||!p.site2)return false;if(S.inc.some(i=>i.type==='site'&&i.ref===c&&i.site===s&&i.until>S.day))return true;return s==='b'&&p.ringcut>S.day;} +// Ports can live in site A, site B, or be split across both ('ab'): a LAG with members in each +// building, so one dark building only takes out its half. +function liveN(c,site,n){n=n||1;const p=S.pops[c];if(!p||!p.site2)return n;if(site==='ab'){const a=Math.ceil(n/2),b=n-a;return (siteDown(c,'a')?0:a)+(siteDown(c,'b')?0:b);}return siteDown(c,site==='b'?'b':'a')?0:n;} +// Your own IX is a switch, not a port: it lives in building A or B, or in both with a second switch (#36). +const myIxLive=c=>{const ct=ixCity(c),st=(S.ixSite||{})[c]||'a';return st==='ab'?!(siteDown(ct,'a')&&siteDown(ct,'b')):!siteDown(ct,st);}; +const liveCap=(g,c,site,n)=>{const k=liveN(c,site,n);return k?lagCap(g,k):0;}; +const onSite=(site,s)=>(site||'a')===s||site==='ab'; +function siteCtl(k,id,c,cur){const p=S.pops[c];if(!p||!p.site2)return '';cur=cur||'a';const n=k==='t'?(S.transit.find(x=>x.id===id)||{}).n:k==='p'?(S.pni.find(x=>x.id===id)||{}).n:(S.ixn||{})[id];return `
${tr('common.site')}${['a','b'].map(x=>btn(`${x.toUpperCase()} ${esc(siteName(c,x))}`,'siteSet',{k,id,s:x},cur===x?'pink sm':'ghost sm')).join('')}${btn(k==='ix'&&S.myIx[id]?tr('sites_and_service.both_a_second_switch_price_mo',{price:fmt$(Math.round(myFab(id).mo/2))}):(n||1)<2?tr('sites_and_service.both_adds_a_lag_member'):tr('sites_and_service.both_split_the_lag'),'siteSet',{k,id,s:'ab'},cur==='ab'?'pink sm':'ghost sm')}
`;} +function portOk(c,i){const p=S.pops[c];return i<=RG[p?(p.rgen||0):0].maxP;} +function waveOk(a,b,i){return [a,b].every(c=>i<=RG[S.pops[c]?(S.pops[c].rgen||0):0].maxLT);} +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 `
${RG.map((M,i)=>{if(i===g)return '';const why=modelFits(c,i),lk=M.lvl>lvl(); + return `
${esc(M.n)} ${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'):''}
${esc(M.blurb)}
${why?`
${esc(why)}
`:''}
${btn(lk?tr('sites_and_service.level_n',{n:M.lvl}):tr('sites_and_service.swap_cost_mo_mo',{cost:fmt$(swapCost(c,i)),mo:fmt$(M.mo*rt)}),'upRouter',{city:c,g:i},'sm',lk||!!why||S.cash`;}).join('')}
`;} +function portNote(c){const p=S.pops[c];if(!p)return '';const g=p.rgen||0;return RG[g].maxP${tr('sites_and_service.your_model_here_tops_out_at',{model:esc(RG[g].n),pn:RG[g].pn})}

`:'';} +// 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]); +function latNote(c){if(!latSlow(c))return '';const f=R.latFar[c];return `
🐢 ${tr('sites_and_service.p_of_city_s_traffic_is',{p:pct(Math.min(1,f.share)),city:esc(CITY[c].name),to:esc(CITY[f.to].name),ms:Math.round(f.ms)})}
`;} +const LAT_OK=20,LAT_BAD=50,latLoss=rtt=>rtt<=LAT_OK?0:rtt<=LAT_BAD?0.2*(rtt-LAT_OK)/(LAT_BAD-LAT_OK):0.5; +function sfOf(r,c){const d=r.cityDem[c]||0;return d<=1e-6?1:clamp(r.citySrv[c]/d,0,1)*((r.latF&&r.latF[c])??1);} + diff --git a/src/game/85-incidents/10-incidents-and-ddos.js b/src/game/85-incidents/10-incidents-and-ddos.js new file mode 100644 index 0000000..97959ae --- /dev/null +++ b/src/game/85-incidents/10-incidents-and-ddos.js @@ -0,0 +1,106 @@ +/* ---------- failures & events ---------- */ +// A few badges read the incident text: callers whose message mentions a shark, anchor, crocodile or llama pass its English as en. +function addInc(o,en=o.msg||''){if(S.loans&&S.loans.some(l=>(l.covs||[]).includes('pizza'))){S.cash-=COVS.pizza.each;S.stats.pizza=(S.stats.pizza||0)+1;}o.id=uid();o.start=S.day;S.inc.push(o);S.stats.incidents++;S.stats.by=S.stats.by||{};S.stats.by[o.type]=(S.stats.by[o.type]||0)+1;if(/shark/i.test(en))S.stats.sharks=(S.stats.sharks||0)+1;const f=S.stats.f=S.stats.f||{};if(/anchor/i.test(en))f.anchor=1;if(/crocodile/i.test(en))f.croc=1;if(/beaver/i.test(en))f.beaver=1;if(/llama/i.test(en))f.llama=1;} +const HARMLESS=[ + [tr('common.certificate_expired'),tr('incidents_and_ddos.the_tls_certificate_on_your_noc')], + [tr('incidents_and_ddos.it_was_dns'),tr('incidents_and_ddos.someone_deleted_the_dns_record_for')], + [tr('common.leap_second'),tr('incidents_and_ddos.a_leap_second_convinced_one_of')], + [tr('common.change_freeze'),tr('incidents_and_ddos.management_declared_a_change_freeze')], + [tr('incidents_and_ddos.ticket_of_the_week'),tr('incidents_and_ddos.a_customer_opened_a_p1_ticket')], + [tr('common.monitoring'),tr('incidents_and_ddos.your_monitoring_system_went_down_you')], + [tr('incidents_and_ddos.load_bearing_typo'),tr('incidents_and_ddos.someone_named_a_vlan_prodcution_it')], + [tr('common.ipv6_milestone'),tr('incidents_and_ddos.your_ipv6_traffic_grew_400_from')], + [tr('common.mystery_link'),tr('incidents_and_ddos.you_found_a_10g_link_in')], + [tr('common.spreadsheet_ipam'),tr('incidents_and_ddos.your_ip_address_spreadsheet_hit_1')], + [tr('common.goose_incident'),tr('incidents_and_ddos.a_goose_attacked_the_technician_on')], + [tr('common.latency_test'),tr('incidents_and_ddos.a_carrier_pigeon_beat_one_of')], + [tr('common.zombie_route'),tr('incidents_and_ddos.a_route_you_withdrew_in_year')], + [tr('common.auditor_visit'),tr('incidents_and_ddos.an_auditor_asked_for_a_network')], + [tr('incidents_and_ddos.open_to_work'),tr('incidents_and_ddos.your_peering_coordinator_updated')], + [tr('common.hold_music'),tr('incidents_and_ddos.your_upstream_support_line_plays_the')], + [tr('common.naming_committee'),tr('incidents_and_ddos.a_two_hour_meeting_about_router')], + [tr('common.vendor_tac'),tr('incidents_and_ddos.vendor_support_asked_you_to_try')], +]; +function lagsN(){const o=[];for(const t of S.transit)if((t.n||1)>=2&&!(t.down>S.day))o.push({k:'t',id:t.id,o:t,n:t.n,lab:tr('incidents_and_ddos.name_transit_lag_in_city',{name:NET[t.net].name,city:CITY[t.city].name})}); + for(const p of S.pni)if((p.n||1)>=2)o.push({k:'p',id:p.id,o:p,n:p.n,lab:tr('incidents_and_ddos.pni_lag_with_name_in_city',{name:NET[p.net].name,city:CITY[p.city].name})}); + for(const x in S.ixp){const n=(S.ixn||{})[x]||1;if(n>=2&&!S.myIx[x])o.push({k:'ix',id:x,n,lab:ixNamesCity(x)?tr('incidents_and_ddos.ix_lag',{ix:ixName(x)}):tr('incidents_and_ddos.ix_lag_in_city',{ix:ixName(x),city:CITY[ixCity(x)].name})});}return o;} +// Where the junk comes in: one of the city's live uplinks, or just "the edge" if it has none yet. +// The primary slot remains compatible with older saves; every system uses the full live set. +function ddosAll(s=S,live=true){return [s.ev.ddos,...(s.ev.ddosMore||[])].filter(a=>a&&(!live||a.until>s.day));} +const ddosFind=id=>ddosAll().find(a=>id===undefined||a.id===id); +function ddosDrop(a){const left=ddosAll(S,false).filter(x=>x!==a);S.ev.ddos=left[0]||null;S.ev.ddosMore=left.slice(1);} +function ddosExpire(){for(const a of ddosAll(S,false))if(a.until<=S.day||!S.pops[a.city]){ddosDone(a);ddosDrop(a);}} +function ddosEntries(){const ports=Object.values(R.ingressPorts||{}).filter(p=>p.cap>0),busy=ports.some(p=>p.traffic>1e-6),weight=p=>busy?p.traffic:p.cap,total=ports.reduce((n,p)=>n+weight(p),0); + return total>0?ports.filter(p=>weight(p)>0).map(p=>({k:p.k,id:p.id,city:p.city,lab:p.lab,share:weight(p)/total})):[];} +function ddosSlices(a){if(!a.entries?.length)return [a];const groups={}; + for(const en of a.entries){const c=S.pops[en.city]?en.city:a.city;(groups[c]||(groups[c]=[])).push(en);} + return Object.entries(groups).map(([city,entries])=>({...a,parent:a,city,entries,gbps:a.gbps*entries.reduce((n,en)=>n+en.share,0)}));} +const ddosCities=a=>[...new Set([a.city,...(a.entries||[]).map(en=>en.city)])].filter(c=>S.pops[c]); +const ddosHasIx=a=>ddosCities(a).some(hasIxAt); +const ddosSf=a=>Math.min(1,...ddosCities(a).map(c=>sfOf(R,c))); +function ddosReport(a){const ms=(R.ddos||[]).filter(m=>m.attack===a||m.attack.parent===a);if(!ms.length)return ddosMitigation(a); + const parts={};for(const m of ms)for(const x of m.sp?.parts||[]){const q=parts[x.city]||(parts[x.city]={city:x.city,tier:x.tier,a:0,cleaned:0});q.a+=x.a;q.cleaned+=x.cleaned;} + return {attack:a,blackhole:ms.some(m=>m.blackhole),upstream:ms.some(m=>m.upstream),reaching:ms.reduce((n,m)=>n+m.reaching,0),flowspec:ms.reduce((n,m)=>n+m.flowspec,0),fsMissing:ms.some(m=>m.fsMissing),filtered:ms.reduce((n,m)=>n+m.filtered,0),sp:Object.keys(parts).length?{parts:Object.values(parts)}:null,near:ms.find(m=>m.near)?.near||null,leak:ms.reduce((n,m)=>n+m.leak,0)};} +function ddosEntry(c){const o=[]; + for(const t of S.transit)if(t.city===c&&!(t.down>S.day))o.push({k:'t',id:t.id,lab:tr('common.net_transit',{net:NET[t.net].name})}); + for(const x of ixIdsIn(c))if(S.ixp[x]!==undefined)o.push({k:'ix',id:x,lab:tr('common.ix_peering',{ix:ixName(x)})}); + for(const p of S.pni)if(p.city===c)o.push({k:'p',id:p.id,lab:tr('common.pni_with_net',{net:NET[p.net].name})}); + return o.length?pick(o):{k:'edge',lab:''};} +// Flowspec capability at each ingress POP: 0 none, 1 basic, 2 full. +const fsAt=c=>{const p=S.pops[c];return p?(RG[p.rgen||0].fs||0):0;}; +// Scrubbing removes attack traffic up to the center's capacity; overflow leaks. On-demand +// does nothing for the first couple of days while traffic is being diverted. +function scrubEngaged(atk){return hasScrub()&&(S.scrubMode==='always'||(S.day-(atk.start??S.day))>=SCRUB_DELAY);} +// Several centers (#117): the flood goes to the nearest working one, and what it cannot take spills to the next. +// A center in another city only helps if the backbone can carry the flood there; routing works that out. +const scrubFar=c=>ddosAll().some(a=>ddosCities(a).includes(c))&&(R.haul||[]).find(q=>q.city===c&&q.ms!==null&&q.ms>=SCRUB_FAR_MS)||null; +function scrubPlan(atk,g=atk.gbps||0,room={},take=null){if(!scrubEngaged(atk))return null;const c=atk.city;const parts=[]; + for(const x of S.scrubs.filter(x=>popUp(x.city)&&(x.city===c||pathExists(c,x.city))).sort((a,b)=>(a.city===c?0:kmBetween(c,a.city))-(b.city===c?0:kmBetween(c,b.city)))){if(g<=0)break;const cap=SCRUB_TIERS[x.tier||0].g,a=Math.min(g,room[x.city]??cap);if(a<=0)continue;const cleaned=take?take(x,a):a;room[x.city]=(room[x.city]??cap)-cleaned;parts.push({city:x.city,tier:x.tier||0,a,cleaned});g-=cleaned;} + return parts.length?{parts,leak:g}:null;} +// One accounting pipeline for routing and the NOC: upstream -> edge -> scrubbing -> leakage. +function ddosMitigation(a,room={},blackhole=a.bh,plan=true){const entries=a.entries?.length?a.entries:[{...(a.entry||{}),share:1}],total=entries.reduce((n,en)=>n+en.share,0),ingress=[]; + let upstream=false,reaching=0,g=0,flowspec=0,fsMissing=false; + for(const en of entries){const t=en.k==='t'?S.transit.find(x=>x.id===en.id):null,p=en.k==='p'?S.pni.find(x=>x.id===en.id):null,clean=!!(t&&t.clean); + upstream=upstream||clean;let part=blackhole?0:a.gbps*en.share/total*(clean?0.1:1);reaching+=part; + if(DDOS_VEC[a.vec]?.fs){const cap=fsAt(S.pops[en.city]?en.city:a.city),before=part;part*=FS_RES[cap];flowspec+=before-part;if(cap===0&&before>0)fsMissing=true;} + if(a.ixbh&&hasIxAt(a.city))part*=0.5; + if(p&&p.sacrif)part=Math.min(part,liveCap(pniG(p),p.city,p.site,p.n)*0.9); + if(teRules()?.blackhole&&!blackhole)part=0; + g+=part;ingress.push({entry:en,g:part});} + const filtered=reaching-g,sp=plan&&g>0?scrubPlan(a,g,room):null; + return {attack:a,blackhole,upstream,reaching,flowspec,fsMissing,filtered,ingress,sp,leak:sp?sp.leak:g};} +// The NOC's live attack view: what is hitting you, what each tool would do about it right now, and the buttons. +function ddosPanel(){return S?ddosAll().filter(a=>S.pops[a.city]).map(ddosOne).join(''):'';} +function ddosOne(a){ + const V=DDOS_VEC[a.vec]||{n:'?',fs:false},en=a.entry||{}; + const sacP=en.k==='p'?S.pni.find(x=>x.id===en.id):null; + const m=ddosReport(a),sp=m.sp,hl=x=>{const qs=(R.haul||[]).filter(q=>q.to===x.city&&q.attack===a.id);return qs.length?{a:qs.reduce((n,q)=>n+q.a,0),h:qs.reduce((n,q)=>n+q.h,0)}:null;}; + const landLine=m.blackhole?'~ '+tr('incidents_and_ddos.blackholed_the_junk_is_gone_and',{city:esc(CITY[a.city].name)}) + :m.upstream?'✓ '+tr('incidents_and_ddos.after_upstream_scrubbing_g',{g:fmtG(m.reaching)}):''; + const fsLine=!V.fs?'— '+tr('incidents_and_ddos.flowspec_cannot_catch_vec',{vec:esc(V.n)}) + :m.flowspec<=1e-6?'— '+tr('incidents_and_ddos.no_flowspec_filtering_ingress') + :m.fsMissing?'~ '+tr('incidents_and_ddos.flowspec_dropping_g_some_ingress',{g:fmtG(m.flowspec)}) + :'✓ '+tr('incidents_and_ddos.flowspec_dropping_g',{g:fmtG(m.flowspec)}); + const used=c=>(R.ddos||[m]).reduce((n,q)=>n+(q.sp?.parts||[]).filter(x=>x.city===c).reduce((t,x)=>t+x.cleaned,0),0); + const scrOne=x=>{const T=SCRUB_TIERS[x.tier],q=hl(x),total=used(x.city); + return (x.cleaned>1e-6?'✓ ':'~ ')+tr('incidents_and_ddos.scrubbing_in_city_used_capacity',{city:esc(CITY[x.city].name),used:fmtG(total),capacity:T.n}) + +(total>x.cleaned+1e-6?' · '+tr('incidents_and_ddos.this_attack_g',{g:fmtG(x.cleaned)}):'') + +(q&&q.h~ '+tr('incidents_and_ddos.your_backbone_can_only_haul_g',{g:fmtG(q.h),city:esc(CITY[x.city].name)}):'');}; + const scrLine=!hasScrub()?'— '+tr('incidents_and_ddos.no_scrubbing_center') + :!scrubEngaged(a)?'… '+tr('incidents_and_ddos.on_demand_scrubbing_diverting_live',{n:Math.max(1,SCRUB_DELAY-(S.day-(a.start??S.day)))}) + :!sp?'— '+(m.leak<=1e-6?tr('incidents_and_ddos.no_scrubbing_needed_after_edge'):tr('incidents_and_ddos.scrubbing_centers_unavailable_or_at')) + :sp.parts.map(scrOne).join('
'); + const haulLine=m.near&&m.near.ms>0&&sp?.parts.some(x=>x.cleaned>1e-6)?'✓ '+tr('incidents_and_ddos.scrubbing_traffic_hauled_over_your',{city:esc(CITY[a.city].name),to:esc(CITY[m.near.city].name),ms:m.near.ms.toFixed(1)}):''; + const entryLine=sacP&&sacP.sacrif?'✓ '+tr('incidents_and_ddos.contained_on_your_sacrificial_net',{net:esc(NET[sacP.net].name)}):''; + let h=`
+
🚨 ${tr('incidents_and_ddos.live_attack_city',{city:esc(CITY[a.city].name)})}
+
${tr('incidents_and_ddos.size_vec_entry_n_d_left',{size:fmtG(a.gbps),vec:esc(V.n),entry:a.entry&&a.entry.lab?' · '+esc(a.entry.lab):'',n:a.until-S.day})}
+ ${landLine?`
${landLine}
`:''} + ${m.blackhole?'':`
${fsLine}
${entryLine?`
${entryLine}
`:''} + ${m.filtered-m.flowspec>1e-6?`
✓ ${tr('incidents_and_ddos.edge_filters_dropping_g',{g:fmtG(m.filtered-m.flowspec)})}
`:''} +
${scrLine}
+ ${haulLine?`
${haulLine}
`:''} +
${m.leak>1e-6?'~ '+tr('incidents_and_ddos.g_is_leaking_through',{g:fmtG(m.leak)}):'✓ '+tr('incidents_and_ddos.attack_fully_mitigated')}
`} +
${m.blackhole?btn(tr('common.stop_blackholing'),'unrtbh',{id:a.id},'ghost sm'):btn(tr('incidents_and_ddos.blackhole_the_target_rtbh'),'rtbh',{id:a.id},'red sm')}${ddosHasIx(a)&&!m.blackhole?btn(a.ixbh?tr('incidents_and_ddos.ix_blackhole_on'):tr('incidents_and_ddos.ix_blackhole_half_honour_it'),'ixbh',{id:a.id},a.ixbh?'green sm':'sm'):''}${btn(tr('incidents_and_ddos.hackback_3000tm_20k'),'hackback',{id:a.id},'sm',S.cash<20000)}
+

${tr('incidents_and_ddos.rtbh_is_free_and_instant_but')}

`; + return h;} diff --git a/src/game/85-incidents/20-failures.js b/src/game/85-incidents/20-failures.js new file mode 100644 index 0000000..4395a4e --- /dev/null +++ b/src/game/85-incidents/20-failures.js @@ -0,0 +1,183 @@ +function fireFailure(){ + const opts=[]; + const live=S.links.filter(l=>l.kind!=='vxc'&&!linkDown(l));const fabsUsed=[...new Set(S.links.filter(l=>l.kind==='vxc').map(l=>l.prov))]; + if(live.length){opts.push(['cut',2+Math.min(6,live.length/2)]);} + if(Object.keys(S.pops).length)opts.push(['crash',3],['power',2]); + if(Object.values(S.pops).some(p=>p.site2))opts.push(['ring',1.2]); + if(S.transit.some(t=>!(t.down>S.day)))opts.push(['transit',3]); + if(Object.keys(S.ixp).length)opts.push(['ixloop',2]); + if(S.transit.length&&S.day>60)opts.push(['leak',2]); + // DDoS has its own schedule, so other incidents cannot bypass the weekly limit. + if(fabsUsed.length)opts.push(['fabric',1.5]); + const lit=S.links.filter(l=>l.kind==='df'&&dfCap(l)>0&&!linkDown(l));if(lit.length)opts.push(['amp',1.5+lit.length*0.3],['optic',1.5+lit.length*0.3]); + opts.push(['funny',4]); + if(!opts.length)return; + 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(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(Object.keys(S.ixp).length)f.push('maxpfx');if(S.transit.length)f.push('prepend');if(S.day>30)f.push('rpki');if(lit.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(`${m[0]}
${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; + addInc({type,ref:c,until:pp.ringcut,msg:pick([tr('failures.a_backhoe_cut_the_metro_ring',{city:CITY[c].name}),tr('failures.someone_pulled_the_wrong_cross',{city:CITY[c].name,siteB:siteName(c,'b'),siteA:siteName(c,'a')}),tr('failures.a_tram_line_construction_project_in',{city:CITY[c].name})]),cost:3000,fix:tr('failures.splice_it_tonight')});} + else if(type==='ac'){const c=pick(Object.keys(S.pops)),pp=S.pops[c];pp.hot=S.day+2; + addInc({type,ref:c,until:pp.hot,msg:CITY[c].lux&&Math.random()<0.7?tr('failures.a_forestry_strike_stopped_the_waste',{dc:siteName(c,'a'),city:CITY[c].name}):pick([tr('failures.the_a_c_at_dc_died',{dc:siteName(c,'a'),city:CITY[c].name}),tr('failures.someone_set_the_data_center',{city:CITY[c].name}),tr('failures.the_cooling_contractor_in_city',{city:CITY[c].name})]),cost:2000,fix:tr('failures.buy_40_desk_fans')}); + }else if(type==='fatwave'||type==='label'){ + const l=pick(live),dur=1+Math.floor(Math.random()*2),A=CITY[l.a].name,B=CITY[l.b].name,W=pick(WAVECO);l.cut=Math.max(l.cut||0,S.day+dur); + const msg=type==='label'?pick([tr('failures.someone_in_dc_labeled_every_patch',{dc:siteName(l.a,'a'),a:A,b:B}),tr('failures.a_remote_hands_tech_in_a',{a:A,b:B}),tr('failures.a_new_tech_in_a_tidied',{a:A,b:B})]) + :l.kind==='df'?pick([tr('failures.the_landlord_in_a_re_routed',{a:A,b:B}),tr('failures.a_splicer_fusing_someone_else_s',{b:B})]) + :pick([tr('failures.co_fat_fingered_a_cross_connect',{co:W,a:A,b:B}),tr('failures.co_did_quick_maintenance_on_the',{co:W,a:A,b:B}),tr('failures.co_scheduled_maintenance_in_utc_your',{co:W,a:A,b:B}),tr('failures.an_engineer_at_co_swapped_tx',{co:W,a:A,b:B}),tr('failures.co_decommissioned_your_a_b_wave',{co:W,a:A,b:B})]); + addInc({type,ref:l.id,until:l.cut,msg,cost:1500,fix:tr('failures.bribe_their_noc_with_donuts')}); + }else if(type==='lacp'){ + const g=pick(lagsN()),n=g.n,dur=1+Math.floor(Math.random()*3),v=Math.floor(Math.random()*4); + const f=v===0?Math.max(0.3,1.4/n):v===3?0:(n-1)/n,until=S.day+(v===3?1:dur),lab=g.lab; + if(g.k==='ix'){S.ev.ixlacp=S.ev.ixlacp||{};S.ev.ixlacp[g.id]={until,f};}else g.o.lacp={until,f}; + const msg=[N_('failures.hash_polarisation_on_your_lab_nearly'), + N_('failures.lacp_fast_slow_timer_mismatch_on'), + N_('failures.one_member_of_your_lab_was'), + N_('failures.someone_set_min_links_on_your')][v]; + 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); + 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 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]; + addInc({type,ref:l.id,until:l.loss.until,msg:tr(msg,{a:CITY[l.a].name,b:CITY[l.b].name}),cost:900,fix:[tr('failures.clean_the_connector'),tr('failures.rate_limit_the_bursts'),tr('failures.swap_the_optic')][v]},msg); + }else if(type==='pmtud'){ + const top=NETS.filter(n=>(R.demTo[n.id]||0)>0.5).sort((a,b)=>(R.demTo[b.id]||0)-(R.demTo[a.id]||0)).slice(0,8),n=pick(top.length?top:NETS),dur=2+Math.floor(Math.random()*3); + S.ev.pmtud={net:n.id,until:S.day+dur,f:0.6}; + const msg=hasScrub()&&Math.random()<0.5?N_('failures.your_scrubbing_center_returns_clean') + :pick([N_('failures.someone_filtered_all_icmp_on_your'), + N_('failures.a_pppoe_hop_shaved_8_bytes')]); + addInc({type,ref:n.id,until:S.ev.pmtud.until,msg:tr(msg,{net:n.name}),cost:500,fix:tr('failures.clamp_the_mss_to_1360')},msg); + }else if(type==='mtu'){ + const l=pick(live);l.deg=S.day+3;addInc({type,ref:l.id,until:l.deg,msg:tr('failures.mtu_mismatch_on_a_b_jumbo',{a:CITY[l.a].name,b:CITY[l.b].name}),cost:800,fix:tr('failures.set_mtu_9216_everywhere')}); + }else if(type==='oops'||type==='cleaner'){ + const c=pick(Object.keys(S.pops)),pp=S.pops[c],C=CITY[c].name; + if(type==='cleaner'&&pp.site2&&(pp.routers||1)<2){S.stats.survived++;addInc({type:'site',ref:c,site:'a',until:S.day+1,msg:tr('failures.the_cleaner_unplugged_everything_at',{siteA:siteName(c,'a')}),cost:0});toast(tr('failures.vacuum_incident_in_city_the_cleaner',{city:C,siteA:esc(siteName(c,'a')),siteB:esc(siteName(c,'b'))}),'good');sfx('alert');return;} + if(type==='cleaner'&&(pp.routers||1)>=2){S.stats.incidents++;S.stats.survived++;toast(tr('failures.vacuum_incident_in_city_the_cleaner_47e0',{city:C,dc:siteName(c,'a')}),'good');sfx('alert');return;} + pp.down=Math.max(pp.down||0,S.day+1); + const msg=type==='cleaner'?tr('failures.the_cleaner_at_dc_unplugged_your',{dc:siteName(c,'a')}):pick([tr('failures.your_on_call_engineer_typed_clear',{city:C}),tr('failures.an_intern_pushed_an_acl_in',{city:C}),tr('failures.someone_ran_reload_on_the_city',{city:C}),tr('failures.a_config_template_rendered_router_id',{city:C}),tr('failures.someone_committed_a_config_in_city',{city:C}),tr('failures.someone_deployed_to_city_on_a',{city:C}),tr('failures.a_cosmic_ray_flipped_a_bit',{city:C}),tr('failures.an_automation_script_in_city_ran',{city:C})]); + addInc({type,ref:c,until:pp.down,msg:msg+(type==='oops'&&(pp.routers||1)>=2?' '+tr('failures.automation_pushed_it_to_every_router'):''),cost:1500,fix:type==='oops'?tr('failures.roll_back_the_config'):tr('failures.hide_the_vacuum')}); + }else if(type==='maxpfx'){ + const c=pick(Object.keys(S.ixp));S.ev.ixdown=S.ev.ixdown||{};S.ev.ixdown[c]=Math.max(S.ev.ixdown[c]||0,S.day+1+Math.floor(Math.random()*2)); + addInc({type,ref:c,until:S.ev.ixdown[c],msg:ixNamesCity(c)?tr('failures.a_member_at_ix_leaked_the',{ix:ixName(c)}):tr('failures.a_member_at_ix_leaked_the_5563',{ix:ixName(c),city:CITY[ixCity(c)].name}),cost:0}); + }else if(type==='prepend'){ + const t=pick(S.transit);t.down=Math.max(t.down||0,S.day+2);addInc({type,ref:t.id,until:t.down,msg:tr('failures.net_fat_fingered_a_route_map',{net:NET[t.net].name,n:30+Math.floor(Math.random()*60),city:CITY[t.city].name}),cost:0}); + }else if(type==='rpki'){ + S.ev.rpki={until:S.day+3,nets:NETS.map(n=>n.id).filter(()=>Math.random()<0.5)};addInc({type,ref:'rpki',until:S.day+3,msg:tr('failures.your_roa_expired_over_the_weekend'),cost:1000,fix:tr('failures.renew_the_roa')}); + }else if(type==='amp'||type==='roadmff'){ + const l=pick(lit),A=CITY[l.a].name,B=CITY[l.b].name,dur=type==='roadmff'?1:(l.spares?1:2+Math.floor(Math.random()*3));l.eqDown=S.day+dur; + const msg=type==='roadmff'?tr('failures.you_fat_fingered_the_channel_plan',{a:A,b:B}):pick([tr('failures.an_in_line_amplifier_hut_between',{a:A,b:B}),tr('failures.someone_stole_the_copper_grounding',{a:A,b:B}),tr('failures.a_firmware_bug_in_the_sys',{sys:DF_SYS[l.sys].n,a:A}),tr('failures.lightning_hit_an_amp_site_on',{a:A,b:B})]); + addInc({type,ref:l.id,until:l.eqDown,msg:msg+(type==='amp'&&l.spares?' '+tr('failures.your_spares_kit_gets_it_back'):''),cost:type==='amp'&&!l.spares?AMP_COST:0,fix:tr('failures.truck_a_spare_amp_out')}); + }else if(type==='optic'){ + const l=pick(lit),A=CITY[l.a].name,B=CITY[l.b].name,o=pick(l.ch),dur=l.spares?1:4;l.chFail={n:1,o,until:S.day+dur}; + addInc({type,ref:l.id,until:S.day+dur,msg:pick([tr('failures.a_optic_on_a_b_overheated',{optic:OPT[o].n,a:A,b:B}),tr('failures.the_laser_in_a_optic_on',{optic:OPT[o].n,a:A,b:B}),tr('failures.a_optic_on_a_b_started',{optic:OPT[o].n,a:A,b:B})])+(l.spares?' '+tr('failures.swapped_from_your_spares_kit_by'):''),cost:l.spares?0:OPT[o].cost,fix:tr('failures.buy_a_replacement')}); + }else if(type==='cut'){ + const mon=Math.floor((S.day%365)/30.42),monsoon=mon>=5&&mon<=8,tw=x=>x.sub&&(x.a==='tpe'||x.b==='tpe'||['clion','balt'].includes(x.cable)),vn=x=>x.sub&&(x.a==='sgn'||x.b==='sgn'),inl=x=>!x.sub&&(CITY[x.a].india||CITY[x.b].india); + const l=pick(live.flatMap(x=>{const w=(x.cable&&CAB[x.cable].age==='old'?3:1)*(x.cable&&CAB[x.cable].fragile?3:1)*(tw(x)?4*(scnRule('anchors')?3:1):1)*(scnRule('sharks')&&x.sub?2:1)*(vn(x)?3:1)*(!x.sub&&andesPair(x.a,x.b)?4:1)*(monsoon&&inl(x)?3:1)*(x.sub&&(x.a==='oos'||x.b==='oos')?3:1);return Array(w).fill(x);})),dur=10+Math.floor(Math.random()*8),trc=l.trench||l.id,hit=S.links.filter(x=>(x.trench||x.id)===trc);hit.forEach(x=>x.cut=Math.max(x.cut||0,S.day+dur)); + const A=CITY[l.a].name,B=CITY[l.b].name,au=CITY[l.a].au&&CITY[l.b].au,auSummer=mon>=11||mon<=1; + const en=l.sub&&(CITY[l.a].au||CITY[l.b].au)&&!(l.cable&&CAB[l.cable].fragile)&&Math.random()<0.35?pick([N_('failures.box_jellyfish_season_at_the_a'),N_('failures.a_great_white_took_an_interest')]):l.cable&&CAB[l.cable].fragile&&Math.random()<0.8?pick([N_('failures.your_a_b_cable_is_cut'),N_('failures.a_b_is_down_same_cable')]):!l.sub&&CITY[l.a].land==='nzs'&&CITY[l.b].land==='nzs'&&Math.random()<0.75?pick([N_('failures.a_kea_pulled_the_rubber_seals'),N_('failures.the_sandflies_drove_your_splicing'),N_('failures.a_farmer_s_post_hole_digger')]):l.cable==='cook'&&Math.random()<0.6?N_('failures.a_ferry_dropped_anchor_in_cook'):!l.sub&&au&&Math.random()<0.75?pick([N_('failures.a_sulphur_crested_cockatoo_chewed'),N_('failures.a_kangaroo_hit_the_fiber_hut'),N_('failures.thieves_dug_up_your_a_b'),N_('failures.a_kilometre_of_copper_went_missing'),N_('failures.a_backhoe_putting_in_a_new'),N_('failures.the_emus_won_again_a_mob'),N_('failures.a_kangaroo_boxed_your_field_tech'),N_('failures.a_drop_bear_fell_on_the'),N_('failures.an_eastern_brown_snake_moved_into'),...((S.day%365)/30.42>=8&&(S.day%365)/30.42<11?[N_('failures.magpie_swooping_season_the_field')]:[]),...(auSummer?[N_('failures.bushfire_season_the_fiber_along_a')]:[]),...(nullPair(l.a,l.b)?[N_('failures.your_a_b_fiber_broke_somewhere')]:[])]):l.sub&&(l.a==='bda'||l.b==='bda')&&Math.random()<0.7?pick([N_('failures.your_a_b_cable_went_quiet'),N_('failures.the_repair_ship_s_compass_spun')]):l.sub&&(l.a==='tbu'||l.b==='tbu')&&Math.random()<0.7?pick([N_('failures.an_undersea_volcano_erupted_next_to'),N_('failures.the_seabed_off_tonga_slid_down')]):vn(l)&&Math.random()<0.8?pick([N_('failures.another_of_vietnam_s_subsea_cables'),N_('failures.your_a_b_cable_broke_in')]):!l.sub&&(l.a==='drw'||l.b==='drw')&&Math.random()<0.7?pick([N_('failures.a_crocodile_took_a_bite_out'),N_('failures.termites_ate_the_duct_on_a')]):tw(l)&&Math.random()<0.8?pick([N_('failures.a_cargo_ship_forgot_to_raise'),N_('failures.another_anchor_another_cut_your_a'),N_('failures.a_fishing_boat_with_an_unusually')]):l.sub&&(l.a==='oos'||l.b==='oos')&&Math.random()<0.8?pick([N_('failures.a_trawler_off_ostend_dragged_its'),N_('failures.a_wind_farm_service_vessel_dropped')]):!l.sub&&(CITY[l.a].ca||CITY[l.b].ca)&&Math.random()<0.4?pick([N_('failures.a_beaver_chewed_through_your_a'),N_('failures.your_a_b_fiber_is_down'),N_('failures.frost_heave_cracked_the_duct_on')]):!l.sub&&andesPair(l.a,l.b)?pick([N_('failures.a_landslide_in_the_andes_buried'),N_('failures.snow_closed_the_mountain_pass_and'),N_('failures.an_earthquake_shook_your_a_b'),N_('failures.a_llama_herd_trampled_the_fiber')]):!l.sub&&(CITY[l.a].india||CITY[l.b].india)?pick([N_('failures.road_widening_near_a_cut_your'),N_('failures.the_monsoon_flooded_a_manhole_on'),N_('failures.a_digger_found_your_a_b')]):l.sub?pick([N_('failures.a_curious_shark_bit_your_subsea'),N_('failures.a_ship_dragged_its_anchor_across'),N_('failures.an_undersea_landslide_snapped_a_b')]):pick([N_('failures.a_backhoe_found_your_fiber_between'),N_('failures.squirrels_chewed_through_a_b_they'),N_('failures.road_works_cut_a_b_nobody')]); + addInc({type,ref:trc,until:S.day+dur,msg:tr(en,{a:A,b:B})+(hit.length>1?' '+tr('failures.all_n_links_in_that_trench',{n:hit.length}):''),cost:Math.max(4000,Math.round(hit.reduce((a,x)=>a+x.mo,0)*0.5))},en); + }else if(type==='crash'||type==='power'){ + const c=pick(Object.keys(S.pops).flatMap(x=>type==='power'&&(CITY[x].za||CITY[x].blackout)?[x,x,x]:type==='crash'&&RG[S.pops[x].rgen||0].flaky?[x,x,x]:[x])),pp=S.pops[c],slow=slowBoot(c),dur=(type==='crash'?2+Math.floor(Math.random()*2):3+Math.floor(Math.random()*3))*(type==='crash'&&S.ev.sanction>S.day?2:1)+(slow?2+Math.floor(Math.random()*3):0); + if(type==='crash'&&(pp.routers||1)>=2){pp.rdown=S.day+dur;S.stats.incidents++;S.stats.survived++;toast(tr('failures.router_crash_in_city_one_router',{city:CITY[c].name,slow:slow?' '+tr('failures.the_crashed_one_what',{what:esc(pick(SLOW_BOOT))}):'',d:dur}),'good');sfx('alert');return;} + if(type==='power'&&!pp.gen&&pp.site2){const sd=Math.random()<0.5?'a':'b';addInc({type:'site',ref:c,site:sd,until:S.day+dur,msg:(CITY[c].za?tr('failures.load_shedding_took_out_site_in',{site:siteName(c,sd),city:CITY[c].name,other:siteName(c,sd==='a'?'b':'a')}):tr('failures.a_power_cut_took_out_site',{site:siteName(c,sd),city:CITY[c].name,other:siteName(c,sd==='a'?'b':'a')})),cost:5000,fix:tr('incidents.rent_a_generator')});S.stats.survived++;return;} + if(type==='power'&&pp.gen&&CITY[c].blackout){S.stats.incidents++;S.stats.survived++;S.stats.shed=(S.stats.shed||0)+1;toast(tr('failures.blackout_in_city_the_grid_went',{city:CITY[c].name}),'good');sfx('alert');return;} + if(type==='power'&&pp.gen){S.stats.incidents++;S.stats.survived++;if(CITY[c].za)S.stats.shed=(S.stats.shed||0)+1;toast(CITY[c].za?tr('failures.load_shedding_in_city_stage_n',{city:CITY[c].name,n:2+Math.floor(Math.random()*5)}):tr('failures.power_cut_in_city_your_backup',{city:CITY[c].name}),'good');sfx('alert');return;} + pp.down=Math.max(pp.down||0,S.day+dur); + const auc=CITY[c].au&&Math.random()<0.5,msg=type==='power'&&c==='ivc'&&Math.random()<0.6?tr('failures.the_smelter_at_tiwai_point_pulled',{city:CITY[c].name}):type==='crash'&&auc&&!slow?pick([tr('failures.a_routine_overnight_upgrade_took',{city:CITY[c].name}),tr('failures.a_huntsman_spider_the_size_of',{city:CITY[c].name}),tr('failures.a_new_tech_in_city_used',{city:CITY[c].name}),tr('failures.a_visiting_engineer_from_london',{city:CITY[c].name})]):type==='power'&&auc&&!CITY[c].blackout?((S.day%365)/30.42>=11||(S.day%365)/30.42<2?tr('failures.a_45_c_heatwave_in_city',{city:CITY[c].name,dc:siteName(c,'a')}):(c==='bne'&&Math.random()<0.6?tr('failures.the_four_o_clock_storm_rolled',{dc:siteName(c,'a')}):tr('failures.a_possum_got_into_the_substation',{city:CITY[c].name,dc:siteName(c,'a')}))):type==='crash'?(slow?tr('failures.your_router_in_city_crashed_and',{city:CITY[c].name,what:pick(SLOW_BOOT),min:bootMin(c),n:2+Math.floor(Math.random()*5)}):pick([tr('failures.your_router_in_city_crashed_kernel',{city:CITY[c].name}),tr('failures.a_firmware_update_bricked_your',{city:CITY[c].name})])):CITY[c].blackout?tr('failures.a_blackout_hit_city_and_your',{city:CITY[c].name}):CITY[c].za?tr('failures.load_shedding_stage_n_in_city',{n:3+Math.floor(Math.random()*4),city:CITY[c].name}):tr('failures.power_outage_at_dc_in_city',{dc:siteName(c,'a'),city:CITY[c].name}); + addInc({type,ref:c,until:S.pops[c].down,msg,slow:type==='crash'&&slow,cost:type==='crash'?2500:7000,fix:type==='crash'?(slow?tr('failures.turn_it_off_and_on_again'):tr('failures.turn_it_off_and_on_again_0872')):tr('incidents.rent_a_generator')}); + }else if(type==='transit'){ + const t=pick(S.transit.filter(t=>!(t.down>S.day)));t.down=S.day+3+Math.floor(Math.random()*3); + addInc({type,ref:t.id,until:t.down,msg:tr('failures.net_is_having_an_outage_in',{net:NET[t.net].name,city:CITY[t.city].name}),cost:0}); + }else if(type==='ixloop'){ + const c=pick(Object.keys(S.ixp));S.ev.ixdown=S.ev.ixdown||{};S.ev.ixdown[c]=Math.max(S.ev.ixdown[c]||0,S.day+2+Math.floor(Math.random()*2)); + addInc({type,ref:c,until:S.ev.ixdown[c],msg:tr('failures.someone_plugged_a_loop_into_the',{ix:ixName(c)}),cost:0}); + }else if(type==='leak'){ + const n=pick(['nfx','ggl','fbk','amz','msf']);S.ev.leak={net:n,until:S.day+4}; + addInc({type,ref:n,until:S.day+4,msg:tr('failures.bgp_route_leak_a_small_isp',{net:NET[n].name}),cost:0}); + }else if(type==='fabric'){ + const f=pick(fabsUsed);S.ev.fab=S.ev.fab||{};S.ev.fab[f]=S.day+2+Math.floor(Math.random()*3); + addInc({type,ref:f,until:S.ev.fab[f],msg:tr('failures.fabric_is_having_a_bad_day',{fabric:FAB[f].name}),cost:0}); + }else if(type==='ddos'){ddosAttack();return; + } + compute(); + const last=S.inc[S.inc.length-1]; + last.impact=Math.max(0,before-R.served); + if(before>1&&last.impact${incTitle(type)}

${esc(last.msg)} ${tr('failures.traffic_rerouted_customers_barely')}`,'good',[],incOpen(last));} + else{const paused=pref('pauseIncident')&&autoPause();toast(`${incTitle(type)}
${esc(last.msg)}${paused?`
${tr('common.game_paused')}`:''}`,'bad',(last.cost?[{l:`${last.fix||tr('common.rush_repair')} ${fmt$(last.cost)}`,act:'fixInc',args:{id:last.id}}]:[]).concat(paused?[resumeAct()]:[]),incOpen(last));} + sfx('alert'); +} +const gamingCount=()=>S.biz.reduce((n,b)=>n+(BIZ_T[b.type]?.gaming?1:0),0); +const ddosVectors=()=>Object.keys(DDOS_VEC).filter(k=>!DDOS_VEC[k].gaming||gamingCount()>0); +// Expected starts per week in normal play; the rolling 14-start limit is a separate ceiling. +// Spread gaming exposure over dozens of customers, including the first, rather than switching baselines. +const ddosRate=()=>0.5+6.5*(1-Math.exp(-gamingCount()/50*(1+Math.max(1,S.lvl||1)/LEVELS.length))); +const ddosPressure=()=>1-Math.exp(-(.01+Math.max(0,(S.lvl||1)-1)/12+gamingCount()/10+(scnRule('ddos')?.2+S.day/365:0))); +// Normalize the vector mix so smaller gaming-only floods do not lower the advertised overall mean. +function ddosSizeMean(){const stage=Math.max(1,S.lvl||1)/LEVELS.length,games=gamingCount(),fl=scnRule('ddos'); + const base=Math.max(10,(R.demand||0)*4/3*stage,fl?1400:0); + if(fl)return base*(1+0.2*games/(games+10))*(1+S.day/365); + // Relative to no gaming: 3x at one customer, 8x at 50, approaching the existing 12x balance. + const mean=base*(games?1.2-0.9*Math.pow(4/9,(games-1)/49):0.1),vectors=ddosVectors(),weight=vectors.reduce((n,k)=>n+(DDOS_VEC[k].gaming?1/3:1),0)/vectors.length; + return mean/weight;} +// Normal rolls: 98% uniform 0.2–2, 2% uniform 8–12. Their mean is 1.278, so spikes do not inflate the balance. +const ddosSizeMax=()=>ddosSizeMean()*(scnRule('ddos')?1.5:12/1.278); +function ddosSize(vec){const fl=scnRule('ddos'),r=Math.random(),roll=fl?1/3+r*2/3:(r<.98?.2+1.8*r/.98:8+4*(r-.98)/.02)/12; + const raw=ddosSizeMax()*(DDOS_VEC[vec].gaming?1/3:1)*roll; + return fl?Math.max(2,Math.floor(raw)):Math.max(0.001,Math.floor(raw*1000)/1000);} +function ddosTick(){if(S.mode==='sandbox')return;if(scnRule('ddos')){let next=+S.scn.nextDdos||3,n=0; + while(S.day>=next&&n++<2){ddosAttack(false);next+=floodGap();}S.scn.nextDdos=next40||gamingCount())for(let i=0;i<2;i++)if(Math.random()d>S.day-7&&d<=S.day);if(S.ddosStarts.length>=14||!Object.keys(S.pops).length)return;S.ddosStarts.push(S.day); + const c=pick(Object.keys(S.pops)),vec=pick(ddosVectors()),V=DDOS_VEC[vec]; + const gbps=ddosSize(vec); + const dur=1+Math.floor(Math.random()*(1+6*ddosPressure())),entry=ddosEntry(c); + const entries=ddosEntries(),a={id:uid(),city:c,vec,gbps,until:S.day+dur,entry:entries.length>1?{k:'distributed',lab:tr('common.distributed_ingress')}:entries[0]||entry,entries,bh:false,start:S.day}; + if(!S.ev.ddos)S.ev.ddos=a;else(S.ev.ddosMore||(S.ev.ddosMore=[])).push(a); + const soaked=(V.fs&&fsAt(c))||hasScrub(); + const how=entries.length>1?tr('failures.across_n_transit_and_peering_ports',{n:entries.length}):entry&&entry.lab?tr('failures.in_via_e',{e:entry.lab}):''; + const msg=tr('failures.a_size_vec_attack_is_hitting',{size:fmtG(gbps),vec:V.n,city:CITY[c].name,how})+' '+(soaked?tr('failures.your_mitigation_is_eating_most_of'):tr('failures.junk_traffic_is_eating_your_capacity')); + if(fl)a.who=pick(FLOOD_WHO); + addInc({type,ref:c,atk:a.id,until:S.day+dur,msg:fl?msg+' '+tr('failures.attacker_who',{who:tr(a.who)}):msg,cost:0}); + if(soaked){S.stats.survived++;S.stats.ddosHeld=(S.stats.ddosHeld||0)+1;if(gbps>=1000)S.stats.ddosMonster=(S.stats.ddosMonster||0)+1;} + if(recompute){compute();a.worst=ddosSf(a);} + toast(`${incTitle('ddos')}: ${esc(CITY[c].name)}
${esc(msg)}${fl?`
${esc(tr('failures.attacker_who',{who:tr(a.who)}))}`:''}`,soaked?'goal':'bad',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}],{a:'city',v:c}); + sfx('alert');} +// When an attack is over: was it held? Held means the city under attack got at least 97% of its traffic every day. +function ddosDone(a){if(!a||a.done)return;a.done=1;if(a.worst===undefined&&S.pops[a.city])a.worst=ddosSf(a);const ok=(a.worst===undefined?1:a.worst)>=0.97; + if(ok){S.stats.ddosOk=(S.stats.ddosOk||0)+1;if(a.gbps>=1000)S.stats.ddosOkBig=(S.stats.ddosOkBig||0)+1;}else S.stats.ddosLost=(S.stats.ddosLost||0)+1; + if(scnRule('ddos')){const who=tr(a.who||FLOOD_WHO[0]);toast(ok?tr('failures.flood_held_g_who_gave_up',{g:fmtG(a.gbps),who:who.charAt(0).toUpperCase()+who.slice(1)}):tr('failures.that_one_got_through_g_city',{g:fmtG(a.gbps),city:CITY[a.city]?CITY[a.city].name:tr('common.your_network'),p:pct(a.worst||0),who}),ok?'goal':'bad');}} +const floodGap=()=>Math.max(0.05,(3+Math.random()*5)/(Math.sqrt(1+S.day/180)*(1+gamingCount()/10+Math.max(0,(S.lvl||1)-1)/12))); +const FLOOD_WHO=[N_('failures.a_botnet_of_40_000_smart'),N_('failures.every_unpatched_baby_monitor_in'),N_('failures.a_gaming_clan_that_lost_one'),N_('failures.a_fridge_that_achieved_sentience_and'),N_('failures.a_crypto_bro_shorting_your_stock'),N_('failures.a_teenager_with_a_stolen_credit'),N_('failures.a_rival_isp_s_stress_test'),N_('failures.ten_thousand_smart_light_bulbs'),N_('failures.a_printer_just_one_printer_nobody'),N_('failures.a_botnet_run_from_a_cloud'),N_('failures.somebody_who_did_not_like_your'),N_('failures.the_internet_connected_kettles_of_a')]; +function incTitle(t){return {ring:tr('failures.metro_ring_cut'),site:tr('common.site_outage'),cut:tr('common.fiber_cut'),crash:tr('common.router_crash'),power:tr('common.power_outage'),transit:tr('common.upstream_outage'),ixloop:tr('common.ix_meltdown'),leak:tr('common.route_leak'),ddos:tr('common.ddos_attack'),fabric:tr('common.fabric_outage'),depeer:tr('common.peering_spat'),fatwave:tr('failures.fat_fingered_wave'),label:tr('failures.patch_panel_mishap'),mtu:tr('common.mtu_mismatch'),krroute:tr('failures.rerouted_via_hong_kong'),ctrlplane:tr('failures.control_plane_meltdown'),lacp:tr('common.lacp_trouble'),loss:tr('common.packet_loss'),pmtud:tr('failures.pmtud_black_hole'),oops:tr('common.oops'),cleaner:tr('common.vacuum_incident'),maxpfx:tr('failures.max_prefix_meltdown'),prepend:tr('common.prepend_ageddon'),rpki:tr('common.rpki_invalid'),amp:tr('common.amplifier_failure'),roadmff:tr('failures.fat_fingered_roadm'),optic:tr('common.dead_optic'),maint:tr('common.maintenance_window_3a92'),ac:tr('common.cooling_failure'),hijack:tr('common.bgp_hijack'),shutdown:tr('common.government_shutdown'),redsea:tr('failures.geopolitical_cable_cut')}[t]||tr('common.incident');} +const LINKCUT_TR=['cut','redsea'],LINKCUT_ID=['fatwave','label'],POPDOWN=['crash','power','oops','cleaner','maint','shutdown'],IXDOWN=['ixloop','maxpfx'],TDOWN=['transit','prepend'],LINKEQ=['mtu','amp','roadmff','optic']; +function remainUntil(pred){let u=0;for(const x of S.inc)if(pred(x))u=Math.max(u,x.until);return u;} +// Remove an incident, then restore each affected thing to whatever other incidents still hold it down. +function clearInc(i){ + S.inc=S.inc.filter(x=>x!==i);const T=i.type; + if(LINKCUT_TR.includes(T)||LINKCUT_ID.includes(T)){const ls=LINKCUT_TR.includes(T)?S.links.filter(l=>(l.trench||l.id)===i.ref):S.links.filter(l=>l.id===i.ref); + for(const l of ls)l.cut=remainUntil(x=>(LINKCUT_TR.includes(x.type)&&x.ref===(l.trench||l.id))||(LINKCUT_ID.includes(x.type)&&x.ref===l.id));} + else if(POPDOWN.includes(T)){if(S.pops[i.ref])S.pops[i.ref].down=remainUntil(x=>POPDOWN.includes(x.type)&&x.ref===i.ref);} + else if(IXDOWN.includes(T)){if(S.ev.ixdown)S.ev.ixdown[i.ref]=remainUntil(x=>IXDOWN.includes(x.type)&&x.ref===i.ref);} + else if(TDOWN.includes(T)){const t=S.transit.find(x=>x.id===i.ref);if(t)t.down=remainUntil(x=>TDOWN.includes(x.type)&&x.ref===i.ref);} + else if(T==='rpki'||T==='hijack'){if(!S.inc.some(x=>x.type==='rpki'||x.type==='hijack'))S.ev.rpki=null;} + else if(T==='leak'){S.ev.leak=null;} + else if(T==='ddos'){const a=ddosAll(S,false).find(a=>i.atk?a.id===i.atk:a.city===i.ref&&(a.start===undefined||a.start===i.start));if(a){ddosDone(a);ddosDrop(a);}} + else if(T==='fabric'){if(S.ev.fab)S.ev.fab[i.ref]=remainUntil(x=>x.type==='fabric'&&x.ref===i.ref);} + else if(T==='mtu'){const l=S.links.find(x=>x.id===i.ref);if(l)l.deg=remainUntil(x=>x.type==='mtu'&&x.ref===i.ref);} + else if(T==='loss'){const l=S.links.find(x=>x.id===i.ref);if(l&&!S.inc.some(x=>x.type==='loss'&&x.ref===i.ref))l.loss=null;} + else if(T==='lacp'){if(!S.inc.some(x=>x.type==='lacp'&&x.ref===i.ref)){const [k,...r]=String(i.ref).split(':'),id=r.join(':');if(k==='ix'){if(S.ev.ixlacp)delete S.ev.ixlacp[id];}else{const o=(k==='t'?S.transit:S.pni).find(x=>x.id===id);if(o)o.lacp=null;}}} + else if(T==='ctrlplane'){for(const id of Array.isArray(i.links)?i.links:[]){const l=S.links.find(x=>x.id===id);if(l)l.cut=Math.max(remainUntil(x=>(LINKCUT_TR.includes(x.type)&&x.ref===(l.trench||l.id))||(LINKCUT_ID.includes(x.type)&&x.ref===l.id)||(x.type==='ctrlplane'&&Array.isArray(x.links)&&x.links.includes(l.id))),0);}} + else if(T==='pmtud'){if(!S.inc.some(x=>x.type==='pmtud'))S.ev.pmtud=null;} + else if(T==='ring'){if(S.pops[i.ref])S.pops[i.ref].ringcut=remainUntil(x=>x.type==='ring'&&x.ref===i.ref);} + else if(T==='ac'){if(S.pops[i.ref])S.pops[i.ref].hot=remainUntil(x=>x.type==='ac'&&x.ref===i.ref);} + else if(T==='amp'||T==='roadmff'){const l=S.links.find(x=>x.id===i.ref);if(l)l.eqDown=remainUntil(x=>(x.type==='amp'||x.type==='roadmff')&&x.ref===i.ref);} + else if(T==='optic'){const l=S.links.find(x=>x.id===i.ref);if(l&&!S.inc.some(x=>x.type==='optic'&&x.ref===i.ref))l.chFail=null;} +} +function purgeInc(){S.inc=S.inc.filter(i=>{const T=i.type;if(LINKCUT_TR.includes(T))return S.links.some(l=>(l.trench||l.id)===i.ref);if(LINKCUT_ID.includes(T)||LINKEQ.includes(T))return S.links.some(l=>l.id===i.ref);if(TDOWN.includes(T))return S.transit.some(t=>t.id===i.ref);if(IXDOWN.includes(T))return S.ixp[i.ref]!==undefined;if(POPDOWN.includes(T)||T==='ac')return !!S.pops[i.ref];return true;});} diff --git a/src/game/85-incidents/30-events.js b/src/game/85-incidents/30-events.js new file mode 100644 index 0000000..60fbeba --- /dev/null +++ b/src/game/85-incidents/30-events.js @@ -0,0 +1,55 @@ +function fireEvent(){ + const opts=['viral','price','grant']; + if(S.day>50)opts.push('sanction','tariff','hijack','landban','shutdown','redsea','baltic'); + if(S.day>HW_FREE&&!hwShock())opts.push('hwshock'); + if(S.day>90&&S.links.filter(l=>l.kind==='wave'&&!l.sub).length>=3)opts.push('ctrlplane'); + if(Object.keys(S.pops).some(ruCity))opts.push('runet','runet'); + if(S.pops.doh&&Object.keys(S.pops).some(c=>CITY[c].gcc||CITY[c].uae)&&!(S.ev.gulf>S.day))opts.push('gulf'); + if(Object.keys(S.pops).some(c=>CITY[c].saudi))opts.push('mega'); + if(['mnl','hkg','tok','icn','sha','jkt'].some(c=>S.pops[c]))opts.push('typhoon'); + if(S.pops.icn&&!S.krExit)opts.push('krexit');if(S.pops.icn&&!(S.ev.krroute>S.day))opts.push('krroute'); + if(Object.keys(S.pops).some(cnCity)||R.gfwCross>1)opts.push('golden','gfw'); + if(S.transit.some(t=>t.net==='cog'))opts.push('depeer','depeer'); + if(Object.keys(S.peers).some(k=>k.startsWith('drz@'))||Object.keys(S.rs).length)opts.push('cake'); + const e=pick(opts); + if(e==='gulf'){const dur=60+Math.floor(Math.random()*60);S.ev.gulf=S.day+dur;toast(tr('events.the_neighbours_have_fallen_out_a',{n:dur}),'bad');sfx('alert');} + /* A wave supplier pushes one bad update to its optical control plane, and every wave it sells you in a + region goes dark for a day or two. Your own dark fiber, subsea waves and fabric circuits keep working. */ + if(e==='ctrlplane'){const by={};for(const l of S.links)if(l.kind==='wave'&&!l.sub&&!(l.cut>S.day)){const r=CITY[l.a].reg;(by[r]=by[r]||[]).push(l);} + const reg=Object.keys(by).sort((a,b)=>by[b].length-by[a].length)[0];if(!reg)return;const hit=by[reg],until=S.day+2; + for(const l of hit)l.cut=Math.max(l.cut||0,until); + const RN={EU:tr('common.europe'),AM:tr('common.north_america'),SA:tr('common.south_america'),AS:tr('common.asia'),OC:tr('common.oceania'),AF:tr('common.africa')}; + addInc({type:'ctrlplane',ref:'reg:'+reg,links:hit.map(l=>l.id),until,msg:tr('events.your_wave_supplier_pushed_one',{n:hit.length,reg:RN[reg]||reg}),cost:Math.round(hit.reduce((a,l)=>a+l.mo,0)*0.3),fix:tr('events.escalate_to_their_cto')},'ctrlplane'); + toast(tr('events.optical_control_plane_meltdown_every',{reg:RN[reg]||reg}),'bad');sfx('alert');return;} + if(e==='krexit'){S.krExit=S.day+1;S.stats.incidents++;S.stats.survived++; + toast(tr('events.glitch_is_leaving_korea_the_game'),'bad');sfx('alert');return;} + if(e==='krroute'){S.ev.krroute=S.day+20;addInc({type:'krroute',ref:'icn',until:S.day+20,msg:tr('events.faceplant_got_tired_of_korean_usage'),cost:0},'krroute'); + toast(tr('events.faceplant_rerouted_korea_via_hong'),'bad');sfx('alert');return;} + if(e==='mega'){const c=pick(Object.keys(S.pops).filter(x=>CITY[x].saudi)),bw=pick([800,1600,3200]),start=S.day+15;S.offers.push({id:uid(),city:c,city2:null,name:tr('events.a_futuristic_city_that_is_not',{city:CITY[c].name}),type:'event',bw,rate:0,reqs:[],start,dur:4,fee:bw*4*90,exp:start-2});toast(tr('events.a_gigaproject_wants_a_demo_bw',{bw:fmtG(bw),city:CITY[c].name}),'goal');} + if(e==='sanction'){S.ev.sanction=S.day+60;toast(tr('events.sanctions_the_republic_of'),'bad');sfx('alert');return;} + if(e==='hwshock'){hwShockStart();return;} + if(e==='tariff'){S.ev.tariff=S.day+90;toast(tr('events.trade_war_on_optics_two_governments'),'bad');sfx('alert');return;} + if(e==='hijack'){const nh=NETS.map(n=>n.id).filter(()=>Math.random()<0.6),old=S.ev.rpki&&S.ev.rpki.until>S.day?S.ev.rpki:null;S.ev.rpki=old?{until:Math.max(old.until,S.day+1),nets:[...new Set(old.nets.concat(nh))]}:{until:S.day+1,nets:nh};addInc({type:'hijack',ref:'rpki',until:S.day+1,msg:tr('events.a_state_owned_isp_accidentally'),cost:1500,fix:tr('events.call_everyone_you_know')});toast(tr('events.bgp_hijack_someone_else_is'),'bad');sfx('alert');return;} + if(e==='landban'){const lc=[...new Set(CABLE_PAIRS.flatMap(c=>[c.a,c.b]))];const c=pick(lc);S.ev.landban={city:c,until:S.day+45};toast(tr('events.landing_permit_dispute_in_city_two',{city:CITY[c].name}),'bad');return;} + if(e==='shutdown'){const ps=Object.keys(S.pops).filter(c=>c!==S.home);if(!ps.length)return;const c=pick(ps);S.pops[c].down=Math.max(S.pops[c].down||0,S.day+1);addInc({type:'shutdown',ref:c,until:S.day+1,msg:tr('events.regulators_ordered_every_network_in',{city:CITY[c].name}),cost:0});toast(tr('events.ordered_offline_in_city_a_government',{city:CITY[c].name}),'bad');sfx('alert');return;} + if(e==='typhoon'){const c=pick(['mnl','hkg','tok','icn','sha','jkt'].filter(x=>S.pops[x])),p=S.pops[c],nm=pick([tr('common.typhoon_bandwidth'),tr('common.typhoon_latency'),tr('common.typhoon_jitter'),tr('events.typhoon_packet_loss')]); + if(p.gen){S.stats.survived++;toast(tr('events.name_hits_city_the_grid_is',{name:nm,city:CITY[c].name}),'good');sfx('alert');return;} + p.down=Math.max(p.down||0,S.day+2);addInc({type:'power',ref:c,until:p.down,msg:tr('events.name_knocked_out_power_in_city',{name:nm,city:CITY[c].name}),cost:7000,fix:tr('incidents.rent_a_generator')});toast(tr('events.name_hits_city_power_is_out',{name:nm,city:CITY[c].name}),'bad');sfx('alert');compute();return;} + if(e==='runet'){S.ev.runet=S.day+1;toast(tr('events.sovereign_internet_drill_moscow'),'bad');sfx('alert');compute();return;} + if(e==='baltic'){const BAL=['clion','havf','danice'];const hit=S.links.filter(l=>l.cable&&BAL.includes(l.cable)&&!(l.cut>S.day)); + if(!hit.length){toast(tr('events.baltic_cable_damaged_a_cargo_ship'),'goal');return;} + const dur=15+Math.floor(Math.random()*15),en=N_('events.a_cargo_ship_dragged_its_anchor');for(const tk of new Set(hit.map(l=>l.trench||l.id))){S.links.filter(l=>(l.trench||l.id)===tk).forEach(l=>l.cut=Math.max(l.cut||0,S.day+dur));addInc({type:'redsea',ref:tk,until:S.day+dur,msg:tr(en),cost:0},en);} + toast(tr('events.baltic_cable_damaged_n_of_your',{n:hit.length,d:dur}),'bad');sfx('alert');compute();return;} + if(e==='redsea'){const RED=['twoaf','smw6','peace','aae','eig','eassy'];const hit=S.links.filter(l=>l.cable&&RED.includes(l.cable)&&!(l.cut>S.day)); + if(!hit.length){toast(tr('events.cables_cut_in_the_red_sea'),'goal');return;} + const dur=20+Math.floor(Math.random()*15),en=N_('events.a_ship_drifting_without_power');for(const tk of new Set(hit.map(l=>l.trench||l.id))){S.links.filter(l=>(l.trench||l.id)===tk).forEach(l=>l.cut=Math.max(l.cut||0,S.day+dur));addInc({type:'redsea',ref:tk,until:S.day+dur,msg:tr(en),cost:0},en);} + toast(tr('events.cables_cut_in_the_red_sea_03e8',{n:hit.length,d:dur}),'bad');sfx('alert');compute();return;} + if(e==='golden'){S.ev.golden=S.day+7;toast(tr('events.golden_week_demand_in_mainland_china'),'goal');return;} + if(e==='gfw'){S.ev.gfw=S.day+10;toast(tr('events.the_border_got_stricter_cross_border'),'bad');sfx('alert');return;} + if(e==='viral'){S.ev.viral=S.day+8;toast(tr('events.new_season_of_stranger_pings_just'),'goal');} + else if(e==='price'){S.priceMul*=0.92;toast(tr('events.transit_prices_fell_8_they_do'),'good');} + else if(e==='grant'){S.cash+=30000;toast(tr('events.rural_broadband_grant_30k_the'),'good');sfx('coin');} + else if(e==='depeer'){S.ev.depeer=S.day+20;addInc({type:'depeer',ref:'cog',until:S.day+20,msg:tr('events.cogentle_and_goggle_are_in_a'),cost:0});toast(tr('events.peering_spat_cogentle_de_peered'),'bad');sfx('alert');} + else if(e==='cake'){S.cash+=8000;toast(tr('events.drizzle_electric_sent_you_an_ipv6'),'good');sfx('coin');} +} + diff --git a/src/game/88-days/10-day-tick.js b/src/game/88-days/10-day-tick.js new file mode 100644 index 0000000..506afcc --- /dev/null +++ b/src/game/88-days/10-day-tick.js @@ -0,0 +1,110 @@ +/* ---------- daily tick ---------- */ +function dayTick(){ + if(!S||S.lost)return; + S.day++; + const d=S.day; + dkTick(d);ixPriceWar(d);inboxDay(d);pniDay(d); + if(!S.phpDone&&d>45&&Math.random()<1/400)elephant(); + if(R&&R.teMoved)S.stats.teMax=Math.max(S.stats.teMax||0,R.teMoved); + {const t1=!!S.won&&isTier1();if(S.t1Now&&!t1)toast(tr('day_tick.you_are_no_longer_tier_1',{why:t1Why()}),'bad');S.t1Now=t1;} + if(S.grace&&S.grace.until===d){toast(tr('day_tick.the_courtesy_route_has_ended_new'),'bad',[{l:tr('common.open_noc'),act:'leftTab',args:{t:'noc'}}]);} + for(const a of ddosAll(S,false))if(a.until>=d&&R&&S.pops[a.city])a.worst=Math.min(a.worst===undefined?1:a.worst,ddosSf(a)); + ddosExpire(); + ddosTick(); + if(R&&R.demand>0)S.stats.clean=R.served/R.demand>=0.995?(S.stats.clean||0)+1:0; + if(S.scn&&S.scn.id==='redsea')S.stats.asiaRun=asiaG()>=RS_G?(S.stats.asiaRun||0)+1:0; + if(S.ev.php===d)toast(tr('day_tick.the_internet_is_back_half_of'),'good'); + for(const k in S.peers){const [id,c]=k.split('@'),sn=snub(id,c);if(!sn)continue;delete S.peers[k];S.stats.depeered=(S.stats.depeered||0)+1; + {const v={net:esc(NET[id].name),ix:esc(ixName(c)),city:esc(CITY[ixCity(c)].name),why:esc(sn.why)};toast(ixNamesCity(c)?tr('day_tick.net_de_peered_you_at_ix',v):tr('day_tick.net_de_peered_you_at_ix_caef',v),'bad');}} + if(S.cnLic&&S.cnLic.state==='pending'&&d>=S.cnLic.ready){S.cnLic.state='ok';toast(tr('day_tick.license_granted_your_joint_venture'),'goal');sfx('coin');} + // resolve incidents + for(const i of S.inc.slice())if(i.until<=d){const o=incOpen(i),l=o&&o.a==='link'&&S.links.find(x=>x.id===o.v),where=l?CITY[l.a].name+'–'+CITY[l.b].name:o&&o.a==='city'?CITY[o.v].name:'';clearInc(i); + toast(where?tr('day_tick.resolved_what_where_is_back_to',{what:incTitle(i.type),where:esc(where)}):tr('day_tick.resolved_what',{what:incTitle(i.type)}),'good',[],o);} + // eyeball growth / churn uses last computed service + for(const c in S.pops){const p=S.pops[c];if(!p.bb)continue;const sf=sfOf(R,c),P=eyeP(c); + if(sf>=0.9){const g=(CITY[c].be&&!(p.boost>d)?0.35:1)*0.025*(scnRule('boom')?1.5:1)*(p.boost>d?2:1)*sf*(0.7+0.6*(R.peerShare||0))*(CITY[c].reg==='AS'&&!CITY[c].cn?1.6:1);p.bb.d+=g*p.bb.d*(1-p.bb.d/P);} + else p.bb.d=Math.max(Math.min(3,P),p.bb.d*(1-(0.9-sf)*0.04));} + compute(); + for(const a of ddosAll())a.worst=Math.min(a.worst??1,ddosSf(a)); + for(const t of S.transit){(t.hist=t.hist||[]).push(R.useT[t.id]||0);if(t.hist.length>30)t.hist.shift();} + S.cash+=(R.revMo-R.costMo)/30; + S.stats.peak=Math.max(S.stats.peak,R.served); + S.hist=S.hist||[];S.hist.push({d,dem:+R.demand.toFixed(2),srv:+R.served.toFixed(2),c:+(R.egT.c||0).toFixed(2),p:+(R.egT.p||0).toFixed(2),ix:+(R.egT.ix||0).toFixed(2),t:+(R.egT.t||0).toFixed(2),l2:+(R.egT.l2||0).toFixed(2),rev:Math.round(R.revMo),cost:Math.round(R.costMo),cash:Math.round(S.cash),inc:S.inc.length});if(S.hist.length>180)S.hist.shift(); + {const top=custLevel();if(top>(S.lvl||1)){for(let lv=(S.lvl||1)+1;lv<=top;lv++){track('level_'+lv);toast(tr('day_tick.customer_level_lv_name_new_customers',{lv,name:LEVELS[lv-1].n,unlock:LEVELS[lv-1].unlock})+`
${esc(LEVELS[lv-1].q)}`,'goal');}S.lvl=top;sfx('coin');}} + for(const l of S.links){if(l.kind!=='df')continue; + if(l.ready===d){toast(`${l.own?tr('day_tick.your_fiber_is_finished_a_b',{a:CITY[l.a].name,b:CITY[l.b].name}):tr('day_tick.dark_fiber_handed_over_a_b',{a:CITY[l.a].name,b:CITY[l.b].name})}
${(l.ch||[]).length?tr('day_tick.channels_are_lighting_up_now'):tr('day_tick.it_is_dark_add_optics_to')}`,'goal',[{l:tr('common.open'),act:'selLink',args:{id:l.id}}]);sfx('coin');} + if(l.own&&l.ready>d&&Math.random()<0.012){const extra=10+Math.floor(Math.random()*40);setCableReady(l,l.ready+extra);toast(tr('day_tick.construction_delay_n_days_why_a',{n:extra,why:pick(l.sub?SEA_DELAYS.map(x=>tr(x)):[tr('day_tick.archaeologists_found_a_roman'),tr('day_tick.a_protected_hamster_species_lives'),tr('day_tick.the_railway_changed_its_mind_about'),tr('day_tick.the_drilling_crew_hit_a_granite'),tr('day_tick.a_town_council_wants_a_public'),tr('day_tick.somebody_else_s_gas_main_was'),tr('day_tick.the_permit_office_lost_your_permit')]),a:CITY[l.a].name,b:CITY[l.b].name}),'bad');}} + // DDoS protection SLA: if a protected customer's own city is hit and still goes down, you pay out (once per attack). + for(const a of ddosAll()){ + for(const b of S.biz)if(b.type==='scrub'&&ddosCities(a).includes(b.city)&&!(a.sla||[]).includes(b.id)&&(a.id||b.slaFor!==a.start)&&sfOf(R,b.city)<0.85){ + (a.sla||(a.sla=[])).push(b.id);b.slaFor=a.start;S.cash-=SLA_PEN;b.mood=Math.max(0,b.mood-18);S.stats.sla=(S.stats.sla||0)+1; + toast(tr('day_tick.sla_breach_name_the_attack_on',{name:esc(b.name),city:CITY[a.city].name,pen:fmt$(SLA_PEN)}),'bad');sfx('err');}} + // businesses mood + for(const b of S.biz.slice()){if(eventTick(b,d))continue;b.pm=b.mood;const sf=bizSf(b),reachOk=BIZ_T[b.type].l2||BIZ_T[b.type].fiber||R.reach>0.99||scnRule('local'),scrubOk=b.type!=='scrub'||(hasScrub()&&!scrubFar(b.city)),divOk=reqOk(b); + if(sf>=0.95&&reachOk&&scrubOk&&divOk)b.mood=Math.min(100,b.mood+2); + else if(S.day-(b.since||0)<15){} + else{b.mood-=(Math.max(0,0.95-sf)*45+(!reachOk?3:0)+(!scrubOk?4:0)+(!divOk?3:0)); + if(b.mood<=0){S.biz=S.biz.filter(x=>x!==b);toast(tr('day_tick.name_cancelled_too_many_outages_and',{name:esc(b.name),city:CITY[b.city].name}),'bad');sfx('err');} + else if(b.mood<30&&!b.warned){b.warned=b.warn60=true;const why=bizWhy(b)[0],paused=pref('pauseFurious')&&autoPause(); + toast(tr('day_tick.name_is_furious_fix_service_in',{name:esc(b.name),city:CITY[b.city].name})+(why?`
${esc(why)}`:'')+(paused?`
${tr('common.game_paused')}`:''),'bad',[{l:tr('common.show_me'),act:'custGo',args:{id:b.id}}].concat(paused?[resumeAct()]:[]));sfx('err');} + else if(b.mood<60&&!b.warn60&&pref('warnUnhappy')){b.warn60=true;const why=bizWhy(b)[0];toast(tr('day_tick.name_is_getting_unhappy_happiness_p',{name:esc(b.name),p:Math.round(b.mood),city:CITY[b.city].name})+(why?`
${esc(why)}`:''),'',[{l:tr('common.show_me'),act:'custGo',args:{id:b.id}}]);}} + if(b.mood>60)b.warned=false;if(b.mood>75)b.warn60=false;} + // own IX members join + for(const c in S.myIx){const m=S.myIx[c];if(d>=m.next&&m.members.lengthn.type!=='t1'&&!m.members.includes(n.id)&&(n.pops.includes(c)||n.pops.some(p=>CITY[p].reg===CITY[c].reg))); + if(cands.length){cands.sort((a,b)=>(a.pol==='open'?0:1)-(b.pol==='open'?0:1)||b.share-a.share);const n=Math.random()<.6?cands[0]:pick(cands);m.members.push(n.id);toast(tr('day_tick.net_joined_ix_another_member_paying',{net:esc(n.name),ix:esc(m.name),fee:fmt$(MYIX_FEE)}),'good');sfx('coin');} + m.next=d+8+Math.floor(Math.random()*10);}} + loanTick(d); + if(S.mode==='sandbox'&&S.cash<1e8)S.cash=1e9; + // offers + S.offers=S.offers.filter(o=>o.exp>d); + if(S.offers.length<5&&Math.random()<(0.05+0.01*(S.lvl||1))*(ppol()==='closed'?0.6:1))spawnOffer(); + // failures & events + let dirty=false; + if(d>=S.nextFail){dirty=true;fireFailure();const size=S.links.length+Object.keys(S.pops).length;S.nextFail=d+Math.round((Math.max(22,50-size*1.5)+Math.floor(Math.random()*25))*(scnRule('chaos')?0.5:1));} + if(d>=S.nextEvent){dirty=true;fireEvent();S.nextEvent=d+45+Math.floor(Math.random()*45);} + if(dirty)compute(); + // payday floaters + if(d%30===0){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-(CITY[c].arpu||1));if(v>500)floater(CITY[c].x,CITY[c].y-30,'+'+fmt$(v),'#16A866');}sfx('coin');} + checkGoals(); + scnTick(d); + confTick(d); + // money trouble + if(S.cash<0){S.neg++;if(S.neg===1)toast(tr('day_tick.you_are_in_the_red_cancel'),'bad');} + else S.neg=0; + if(S.cash<-100000){S.lost=true;track('bankrupt');showLose();return;} + if(d%360===0&&[1,2,4].includes(d/360))track('game_year_'+(d/360+1),true); + if(d%10===0)save(); +} +function spawnOffer(){ + const mine=Object.keys(S.pops),lv=S.lvl||1; + const types=['dia','dia','game','host'];if(mine.length>=2)types.push('l2vpn','l2vpn');if(S.day>60)types.push('scrub'); + if(lv>=2)types.push('isp','stream','edu','host','hft','bulk','event','event');if(mine.length>=3&&lv>=2)types.push('sdwan','sdwan'); + if(S.links.some(l=>l.kind==='df'&&l.ready<=S.day))types.push('wwave','wwave');if(S.links.some(l=>l.kind==='df'&&l.own&&l.ready<=S.day))types.push('dfpair');if(lv>=3)types.push('gpu','gpu','onramp','onramp');if(lv>=4)types.push('ai','ai','hyper','hyper'); + if(lv>=3&&MEGA.some(m=>mine.includes(m.c)))types.push('ingest');if(lv>=4&&MEGA.some(m=>mine.includes(m.c)))types.push('aiwan','aiwan','mtrain');if(lv>=4&&S.links.some(l=>l.kind==='df'&&l.own&&l.ready<=S.day))types.push('pairs'); + if(lv>=5)types.push('esport');if(lv>=6&&mine.length>=2)types.push('sov','sov');if(lv>=8)types.push('cgame','cgame');if(lv>=9)types.push('metav','metav');if(lv>=11&&MEGA.some(m=>mine.includes(m.c)))types.push('agi');if(lv>=13&&mine.length>=2)types.push('mars'); + const br=mine.filter(c=>CITY[c].br);if(br.length)types.push('provedor','provedor','provedor'); + const fabC=mine.filter(c=>FABS.some(f=>f.cities.includes(c)));if(lv>=2&&fabC.length){types.push('fabip','fabip');if(mine.length>=2)types.push('fabl2');} + const t=pick(types),T=BIZ_T[t]; + if(T.event||T.sdwan||T.fiber||T.mega){spawnSpecial(t);return;} + if(T.nni){const city=pick(fabC),prov=pick(FABS.filter(f=>f.cities.includes(city))).id,bw=pick(T.opts),others=mine.filter(c=>c!==city),city2=T.l2&&others.length?pick(others):null;if(T.l2&&!city2)return; + const base=pick(BIZ_N.filter(n=>!S.usedNames.includes(n)).concat(BIZ_N)).replace(/ (Inc\.|Co\.|Ltd)$/,'');const name=tr('day_tick.name_via_fab',{name:base,fab:FAB[prov].name});S.usedNames.push(base); + const rate=T.l2?Math.round((150+kmBetween(city,city2)*0.08)*T.km):T.rate; + S.offers.push({id:uid(),city,city2,prov,name,type:t,bw,rate,reqs:['nni'],exp:S.day+40});return;} + let city=(Math.random()<0.65&&mine.length)?pick(mine):pick(OFFC.concat(cnOk()?['pek','sha']:[])),city2=null; + if(T.l2){city=pick(mine);const pool=(Math.random()<(T.lv>=3?0.8:0.6)?mine:OFFC).filter(c=>c!==city);city2=pick(pool.length?pool:OFFC.filter(c=>c!==city));} + let bw=T.lv>=2?pick(T.opts):pick(T.opts.slice(0,mine.length>=4?4:3)); + const list=(T.names||BIZ_N).filter(n=>!S.usedNames.includes(n)); + let name=list.length?pick(list):(T.names?pick(T.names):'Startup #'+Math.floor(Math.random()*999)); + S.usedNames.push(name); + if(t==='provedor')city=pick(br); + if(t==='hft'){const fin=['nyc','chi','lon','fra','tok','sin','hkg','ams','ash'],mf=mine.filter(c=>fin.includes(c));city=mf.length?pick(mf):pick(mine);city2=pick(fin.filter(c=>c!==city));} + let rate=T.l2?Math.round((150+kmBetween(city,city2)*0.08)*T.km):T.rate; + if(CITY[city].au&&!T.l2&&!T.fiber&&!T.event){rate=Math.round(rate*AU_ARPU);bw=Math.min(bw,pick(T.opts.slice(0,2)));} + if(T.div&&!reqCan('diverse',{city,city2}))return; + const reqs=T.div?['diverse']:T.lat?['lat']:[];if((t==='hyper'||t==='ai'||t==='gpu')&&Math.random()<0.4)reqs.push('metro');const pool=Object.keys(REQS).filter(k=>!reqs.includes(k)&&!REQS[k].only&&(!REQS[k].l2||T.l2)&&(!REQS[k].ip||!T.l2)&&reqCan(k,{city,city2})); + if(Math.random()<(T.lv>=3?0.65:0.3))reqs.push(pick(pool)); + if(T.lv>=3&&Math.random()<0.35){const more=pool.filter(k=>!reqs.includes(k));if(more.length)reqs.push(pick(more));} + const r2=Math.round(rate*(1+reqs.reduce((a,k)=>a+REQS[k].bonus,0))); + S.offers.push({id:uid(),city,city2,name,type:t,bw,rate:r2,reqs,latMax:T.lat?+(kmBetween(city,city2)/200*1.35).toFixed(1):null,exp:S.day+40}); +} diff --git a/src/game/88-days/20-badges.js b/src/game/88-days/20-badges.js new file mode 100644 index 0000000..ca65535 --- /dev/null +++ b/src/game/88-days/20-badges.js @@ -0,0 +1,89 @@ +/* Badges: achievements with rarities. Earned per game, and also remembered across games on this + device in a hall of fame, so there is always something grand to work towards. */ +const RARITY={c:{n:tr('common.common'),col:'#16A866'},r:{n:tr('common.rare'),col:'#3A7BEA'},e:{n:tr('common.epic'),col:'#9D4EDD'},l:{n:tr('common.legendary'),col:'#FF8A3D'}}; +const st=()=>S.stats||{}; +const BADGES=[ + {id:'hello',i:'👋',t:tr('common.hello_neighbour'),d:tr('badges.bring_up_your_first_peering_session'),r:'c',ok:()=>R.sessions>=1}, + {id:'backhoe',i:'🚜',t:tr('badges.met_the_backhoe'),d:tr('badges.have_a_fiber_cut'),r:'c',ok:()=>(st().by||{}).cut>=1}, + {id:'debt',i:'🏦',t:tr('badges.in_debt_we_trust'),d:tr('badges.take_out_a_loan'),r:'c',ok:()=>(st().loans||0)>=1||(S.loans||[]).length>0}, + {id:'twins',i:'👯',t:tr('common.twins'),d:tr('badges.run_two_routers_in_one_pop'),r:'c',ok:()=>Object.values(S.pops).some(p=>(p.routers||1)>=2)}, + {id:'shark',i:'🦈',t:tr('common.shark_week'),d:tr('badges.get_a_subsea_cable_bitten_by'),r:'r',ok:()=>(st().sharks||0)>=1}, + {id:'ixc',i:'🔀',t:tr('common.ix_collector'),d:tr('badges.have_ports_on_10_internet_exchanges'),r:'r',ok:()=>Object.keys(S.ixp).length>=10}, + {id:'haggle',i:'🤝',t:tr('badges.never_paid_list_price'),d:tr('badges.haggle_a_de_kicks_quote_down'),r:'r',ok:()=>!!st().haggleWin}, + {id:'unsub',i:'📭',t:tr('common.unsubscribed'),d:tr('badges.opt_out_of_3_auto_enrolled'),r:'r',ok:()=>(st().optouts||0)>=3}, + {id:'read',i:'💔',t:tr('badges.left_on_read'),d:tr('badges.get_de_peered_by_a_big'),r:'r',ok:()=>(st().depeered||0)>=1}, + {id:'couch',i:'🛋️',t:tr('badges.peering_from_the_couch'),d:tr('badges.peer_at_an_ix_remotely'),r:'r',ok:()=>Object.keys(S.ixp).some(c=>isRemote(c)&&ixSessions(c).size>0)}, + {id:'sender',i:'🇰🇷',t:tr('common.sender_pays'),d:tr('badges.paid_pnis_with_all_three_korean'),r:'e',ok:()=>['ktt','skb','lgu'].every(n=>S.pni.some(p=>p.net===n&&pniOn(p)))}, + {id:'oink',i:'🐖',t:tr('common.pig_whisperer'),d:tr('badges.run_a_slow_booting_packetoinker'),r:'r',ok:()=>Object.keys(S.pops).some(c=>/Oinker/.test(RG[S.pops[c].rgen||0].chip)&&slowBoot(c))}, + {id:'gap',i:'🌴',t:tr('common.mind_the_gap'),d:tr('badges.link_panama_city_and_bogota'),r:'r',ok:()=>S.links.some(l=>[l.a,l.b].includes('pan')&&[l.a,l.b].includes('bog'))}, + {id:'andes',i:'🏔️',t:tr('badges.over_the_mountains'),d:tr('badges.build_fiber_across_the_andes'),r:'r',ok:()=>S.links.some(l=>!l.sub&&andesPair(l.a,l.b))}, + {id:'duo',i:'🏜️',t:tr('common.duopoly_customer'),d:tr('badges.buy_a_wave_inside_the_uae'),r:'r',ok:()=>S.links.some(l=>uaePair(l.a,l.b))}, + {id:'shed',i:'🔌',t:tr('common.stage_six'),d:tr('badges.ride_out_load_shedding_on_your'),r:'r',ok:()=>(st().shed||0)>=1}, + {id:'metro3',i:'🏢',t:tr('badges.two_buildings_three_cities'),d:tr('badges.have_a_second_site_in_3'),r:'r',ok:()=>Object.values(S.pops).filter(p=>p.site2).length>=3}, + {id:'penguin',i:'🐧',t:tr('common.lonely_penguin'),d:tr('badges.light_a_wave_on_the_humboldt'),r:'e',ok:()=>S.links.some(l=>l.cable==='humb')}, + {id:'horn',i:'⛵',t:tr('badges.the_long_way_round'),d:tr('badges.run_a_link_round_cape_horn'),r:'e',ok:()=>S.links.some(l=>l.cable==='sam1'&&[l.a,l.b].includes('bue')&&[l.a,l.b].includes('scl'))}, + {id:'six',i:'🌍',t:tr('common.six_continents'),d:tr('badges.pops_in_every_region_on_the'),r:'e',ok:()=>regionsCount()>=6}, + {id:'giants',i:'🏭',t:tr('badges.friend_of_giants'),d:tr('badges.hold_deals_at_3_different_ai'),r:'e',ok:()=>new Set(S.biz.filter(b=>BIZ_T[b.type]&&BIZ_T[b.type].mega).flatMap(b=>bCities(b))).size>=3}, + {id:'landlord',i:'🧵',t:tr('common.trench_landlord'),d:tr('badges.lease_hundreds_of_fiber_pairs_to'),r:'e',ok:()=>S.biz.some(b=>b.type==='pairs')}, + {id:'t1',i:'👑',t:tr('common.tier_1'),d:tr('badges.go_transit_free'),r:'e',ok:()=>!!S.won}, + {id:'bait',i:'🎣',t:tr('common.shark_bait'),d:tr('badges.get_bitten_by_sharks_3_times'),r:'l',ok:()=>(st().sharks||0)>=3}, + {id:'nines',i:'💎',t:tr('common.five_nines'),d:tr('badges.serve_99_5_of_demand_every'),r:'l',ok:()=>(st().clean||0)>=365}, + {id:'fifty',i:'🗺️',t:tr('badges.everywhere_at_once'),d:tr('badges.have_pops_in_50_cities'),r:'l',ok:()=>Object.keys(S.pops).length>=50}, + {id:'unicorn',i:'🦄',t:tr('common.unicorn'),d:tr('badges.hold_a_billion_dollars_in_cash'),r:'l',ok:()=>S.cash>=1e9}, + {id:'clean',i:'🧼',t:tr('badges.debt_free_tier_1'),d:tr('badges.win_without_ever_taking_a_loan'),r:'l',ok:()=>!!S.won&&!(st().loans||0)&&!(S.loans||[]).length}, + {id:'speed',i:'⚡',t:tr('common.speedrun'),d:tr('badges.reach_tier_1_within_three_years'),r:'l',ok:()=>!!S.won&&S.day<=1095}, + {id:'te',i:'🧭',t:tr('common.traffic_whisperer'),d:tr('badges.have_auto_te_move_100_gbps'),r:'r',ok:()=>(st().teMax||0)>=100}, + {id:'street',i:'🚧',t:tr('common.same_street'),d:tr('badges.lose_a_metro_ring_to_one'),r:'r',ok:()=>(st().by||{}).ring>=1}, + {id:'anchor',i:'⚓',t:tr('common.anchors_aweigh'),d:tr('badges.have_a_cable_cut_by_a'),r:'r',ok:()=>!!(st().f||{}).anchor}, + {id:'retained',i:'🎁',t:tr('badges.customer_success_story'),d:tr('badges.take_a_de_kicks_retention_offer'),r:'r',ok:()=>!!st().retained}, + {id:'brrr',i:'🇧🇷',t:tr('common.samba_peering'),d:tr('badges.ports_on_ix_brrr_in_sao'),r:'e',ok:()=>['sao','rio','for'].every(c=>S.ixp[c]!==undefined)}, + {id:'bingo',i:'🎰',t:tr('badges.de_kicks_bingo'),d:tr('badges.ports_at_all_six_de_kicks'),r:'e',ok:()=>DK_CITIES.filter(c=>CITY[c]&&CITY[c].ix).every(c=>S.ixp[c]!==undefined)}, + {id:'fire',i:'🌋',t:tr('badges.ring_of_fire'),d:tr('badges.pops_all_the_way_round_the'),r:'e',ok:()=>['lax','tok','tpe','mnl','jkt','syd','akl','scl'].every(c=>S.pops[c])}, + {id:'curtain',i:'🎭',t:tr('badges.iron_curtain_call'),d:tr('badges.pops_in_warsaw_prague_vienna'),r:'e',ok:()=>['waw','prg','vie','bud','buh','sof','beg','tll'].every(c=>S.pops[c])}, + {id:'islands',i:'🏝️',t:tr('common.island_hopper'),d:tr('badges.pops_in_reykjavik_dublin_london'),r:'e',ok:()=>['rek','dub','lon','cbo','tpe','mnl','tok','akl'].every(c=>S.pops[c])}, + {id:'wall',i:'🧱',t:tr('badges.through_the_wall'),d:tr('badges.run_a_licensed_pop_in_mainland'),r:'e',ok:()=>cnOk()&&Object.keys(S.pops).some(cnCity)}, + {id:'beaver',i:'🦫',t:tr('common.dam_it'),d:tr('badges.have_your_fiber_chewed_through_by'),r:'e',ok:()=>!!(st().f||{}).beaver}, + {id:'croc',i:'🐊',t:tr('common.darwin_award'),d:tr('badges.have_your_fiber_bitten_by_a'),r:'l',ok:()=>!!(st().f||{}).croc}, + {id:'unbreak',i:'🛡️',t:tr('common.unbreakable'),d:tr('badges.survive_100_incidents_without'),r:'l',ok:()=>(st().survived||0)>=100}, + {id:'lv13',i:'🌐',t:tr('badges.is_this_the_internet'),d:tr('badges.reach_customer_level_13'),r:'l',ok:()=>(S.lvl||1)>=13}, + {id:'gigawatt',i:'⚛️',t:tr('common.gigawatt_landlord'),d:tr('badges.hold_an_ai_wan_a_training'),r:'l',ok:()=>['aiwan','mtrain','ingest','pairs'].every(t=>S.biz.some(b=>b.type===t))}, + {id:'blitz',i:'🚀',t:tr('common.blitz'),d:tr('badges.reach_tier_1_within_two_years'),r:'l',ok:()=>!!S.won&&S.day<=730}, + {id:'peta',i:'🌌',t:tr('common.hundred_terabits'),d:tr('badges.serve_100_tbps'),r:'l',ok:()=>R.served>=100000}, + {id:'petabit',i:'🪐',t:tr('badges.a_petabit_a_second'),d:tr('badges.serve_1_pbps_a_thousand_terabits'),r:'l',ok:()=>R.served>=1e6}, + {id:'llama',i:'🦙',t:tr('common.llama_drama'),d:tr('badges.lose_fiber_to_a_llama_herd'),r:'l',secret:true,ok:()=>!!(st().f||{}).llama}, + {id:'hallway',i:'🎤',t:tr('common.hallway_track'),d:tr('badges.attend_a_conference'),r:'r',ok:()=>(st().confs||0)>=1}, + {id:'beer',i:'🍺',t:tr('badges.peering_over_beer'),d:tr('badges.set_up_a_pni_while_the'),r:'e',ok:()=>!!st().beerPni}, + {id:'circuit',i:'✈️',t:tr('common.conference_circuit'),d:tr('badges.attend_six_conferences_in_one_game'),r:'l',ok:()=>(st().confs||0)>=6}, + {id:'kiddie',i:'💻',t:tr('common.script_kiddie'),d:tr('badges.deploy_a_routescript_that_cuts_your'),r:'r',ok:()=>!!st().kiddie}, + {id:'fat',i:'🫠',t:tr('common.fat_finger'),d:tr('badges.deploy_a_routescript_that_takes_down'),r:'r',ok:()=>!!st().fat}, + {id:'scen1',i:'🎯',t:tr('common.scenario_solver'),d:tr('badges.complete_any_scenario'),r:'r',ok:()=>!!(S.scn&&S.scn.done&&S.scn.id!=='weekly')}, + {id:'weekly',i:'📅',t:tr('common.weekly_regular'),d:tr('badges.finish_a_weekly_challenge'),r:'r',ok:()=>!!(S.scn&&S.scn.done&&S.scn.id==='weekly')}, + {id:'scen3',i:'🏅',t:tr('common.scenario_specialist'),d:tr('badges.complete_three_different_scenarios'),r:'e',ok:()=>!!(S.scn&&S.scn.done&&S.scn.id!=='weekly')&&Object.keys(scnHof()).filter(k=>k!=='weekly').length>=3}, + {id:'scenall',i:'🏆',t:tr('common.scenario_grandmaster'),d:tr('badges.complete_every_scenario'),r:'l',ok:()=>!!(S.scn&&S.scn.done&&S.scn.id!=='weekly')&&SCN.every(x=>scnHof()[x.id])}, + {id:'elephant',i:'🐘',t:tr('badges.i_survived_the_elephant'),d:tr('badges.live_through_the_day_half_the'),r:'l',secret:true,ok:()=>!!S.phpDone&&!(S.ev.php>S.day)}, + {id:'vigil',i:'⚖️',t:tr('common.vigilante'),d:tr('badges.fire_the_hackback_3000tm_and_flatten'),r:'e',secret:true,ok:()=>(st().vigilante||0)>=1}, + {id:'nullroute',i:'💥',t:tr('common.collateral_damage'),d:tr('badges.blackhole_one_of_your_own_cities'),r:'r',ok:()=>(st().rtbh||0)>=1}, + {id:'toaster',i:'🍞',t:tr('common.toaster_wrangler'),d:tr('badges.weather_a_ddos_with_your_defences'),r:'c',ok:()=>(st().ddosHeld||0)>=1}, + {id:'cleanpipe',i:'🚿',t:tr('common.clean_pipes'),d:tr('badges.turn_on_a_transit_clean_pipe'),r:'r',ok:()=>S.transit.some(t=>t.clean)}, + {id:'lamb',i:'🐐',t:tr('common.sacrificial_lamb'),d:tr('badges.run_a_sacrificial_pni_choke_point'),r:'r',ok:()=>S.pni.some(p=>p.sacrif)}, + {id:'flood',i:'🌊',t:tr('badges.held_the_flood'),d:tr('badges.weather_a_multi_terabit_ddos'),r:'e',ok:()=>(st().ddosMonster||0)>=1}, + {id:'skynot',i:'🤖',t:tr('common.skynot_smiles'),d:tr('badges.land_a_hackback_3000tm_that_actually'),r:'e',secret:true,ok:()=>(st().hackWin||0)>=1}, + {id:'zero',i:'🕳️',t:tr('badges.zero_peers_given'),d:tr('badges.reach_tier_2_with_every_single'),r:'l',secret:true,ok:()=>isTier2()&&!Object.keys(S.peers).length&&!S.pni.length}, +]; +function hof(){try{return JSON.parse(localStorage.getItem('sot-badges')||'{}')||{};}catch(e){return {};}} +function checkBadges(){S.ach=S.ach||{};if(S.mode==='sandbox')return;let h=null; + for(const b of BADGES){if(S.ach[b.id]!==undefined)continue;let ok=false;try{ok=b.ok();}catch(e){} + if(!ok)continue;S.ach[b.id]=S.day;const R0=RARITY[b.r]; + if(!h)h=hof();if(!h[b.id])h[b.id]={d:new Date().toISOString().slice(0,10),n:S.name}; + toast(`${b.i} ${tr('badges.badge_unlocked_name',{name:esc(b.t)})}
${R0.n} · ${esc(b.d)}`,'goal',[],{a:'tab',v:'goals'});sfx('coin');track('badge_'+b.id);} + if(h)try{localStorage.setItem('sot-badges',JSON.stringify(h));}catch(e){}} +function badgeGrid(){const h=hof(),got=BADGES.filter(b=>S.ach&&S.ach[b.id]!==undefined).length; + return `

${tr('common.badges')} ${tr('badges.got_total_this_game_ever_ever',{got,total:BADGES.length,ever:Object.keys(h).filter(k=>BADGES.some(b=>b.id===k)).length})}

${BADGES.map(b=>{const on=S.ach&&S.ach[b.id]!==undefined,ever=!!h[b.id],R0=RARITY[b.r],hide=b.secret&&!on&&!ever; + return `
${hide?'❔':b.i}${esc(hide?'???':b.t)}${R0.n}${ever&&!on?' · '+tr('common.earned_before'):''}${hide?'':`${esc(b.d)}`}
`;}).join('')}
`;} +function checkGoals(){checkBadges(); + for(const g of GOALS){if(S.done[g.id]!==undefined)continue;let ok=false;try{ok=g.ok();}catch(e){} + if(ok){S.done[g.id]=S.day;if(g.r&&S.mode!=='sandbox'){S.cash+=g.r;} + toast(`${tr('badges.goal_complete_name',{name:esc(g.t)})}${g.r?`
${tr('badges.reward_amt',{amt:fmt$(g.r)})}`:''}`,'goal',[],{a:'tab',v:'goals'});sfx('coin'); + track('goal_'+g.id);if(g.win&&!S.won){S.won=true;track('win_tier1');checkBadges();showWin();}}} +} + diff --git a/src/game/90-actions/10-interface.js b/src/game/90-actions/10-interface.js new file mode 100644 index 0000000..af3bcfa --- /dev/null +++ b/src/game/90-actions/10-interface.js @@ -0,0 +1,49 @@ +/* ================= ACTIONS ================= */ +function spend(c){if(S.cash{v=+v;if(![0,0.5,1,2,4,8].includes(v))return;if(v)UI.lastSpeed=v;UI.speed=v;renderHUD();}, + help:()=>showHelp(), + dash:()=>{if(!S)return;const d=$('dash');d.hidden=!d.hidden;if(!d.hidden)renderDash();}, + dashClose:()=>{$('dash').hidden=true;}, + dashTab:({k})=>{if(!DTABS.includes(k))return;UI.dtab=k;renderDash();const d=$('dash');if(d)d.scrollTop=0;}, + dashSort:({k})=>{if(!['name','asn','type','traffic','cost','lost'].includes(k))return;if(UI.dashSort===k)UI.dashDir=-(UI.dashDir||-1);else{UI.dashSort=k;UI.dashDir=k==='name'||k==='type'||k==='asn'?1:-1;}renderDash();}, + bank:()=>{if(!S)return;UI.confirm=null;$('dash').hidden=true;const b=$('bankBox');b.hidden=false;UI._bh=null;renderBank();}, + bankClose:()=>{UI.confirm=null;$('bankBox').hidden=true;}, + takeLoan:({id})=>{const o=S.loanOffers.find(x=>x.id===id);if(!o)return;S.stats.loans=(S.stats.loans||0)+1;const B=BANKS[o.bank];let got=o.amount,note=''; + if(B.crypto){const f=0.55+Math.random()*0.8;got=Math.round(o.amount*f);note=' '+(f>=1?tr('interface.tubecoin_moved_up_p_on_the',{p:Math.round(Math.abs(f-1)*100)}):tr('interface.tubecoin_moved_down_p_on_the',{p:Math.round(Math.abs(f-1)*100)}));} + S.cash+=got;S.loanOffers=S.loanOffers.filter(x=>x!==o); + S.loans.push({id:o.id,bank:o.bank,start:S.day,amount:o.amount,got,bal:o.model==='transit'?o.owe:o.amount,apr:o.apr||0,apr0:o.apr||0,pay:o.pay||0,left:o.term||0,term:o.term||0,share:o.share||0,model:o.model,cut:o.cut,covs:o.covs,base:{sub:S.links.filter(x=>x.sub).length}}); + track('loan_taken');toast(`${tr('interface.amt_from_bank_has_landed',{amt:fmt$(got),bank:esc(B.name)})}
${B.equity?tr('interface.they_now_own_p_of_your',{p:pct(o.share)}):loanSummary(o)}${note}`,'good');sfx('coin');after();renderBank();}, + declineLoan:({id})=>{S.loanOffers=S.loanOffers.filter(x=>x.id!==id);sfx('click');renderBank();renderHUD();save();}, + repayLoan:({id})=>{const l=S.loans.find(x=>x.id===id);if(!l)return;const B=BANKS[l.bank];const cost=repayCost(l,B); + if(UI.confirm!==id){UI.confirm=id;renderBank();return;}UI.confirm=null;if(!spend(cost)){renderBank();return;}S.loans=S.loans.filter(x=>x!==l);track('loan_repaid'); + toast(B.equity?tr('interface.you_bought_out_bank_they_flew',{bank:esc(B.name)}):tr('interface.loan_from_bank_repaid_early',{bank:esc(B.name)}),'good');after();renderBank();}, + leaseSwap:({a,b,src})=>{if(!S.pops[a]||!S.pops[b]||a===b)return;$('dash').hidden=true;UI.lmode='df';UI.dfSrc=['lease','build','cable'].includes(src)?src:isSub(a,b)?'cable':'build';UI.dfSys=lvl()>=3?'roadm':'lite';openLinkModal(a,b);}, + dashLink:({id})=>{$('dash').hidden=true;selectLink(id);}, + animSet:({v})=>{if(!['auto','on','off'].includes(v))return;UI.anim=v;try{localStorage.setItem('sot-anim',v);}catch(e){}applyAnim();refreshSettings();}, + soundSet:({v})=>{UI.muted=v==='off';try{localStorage.setItem('sot-mute',UI.muted?'1':'0');}catch(e){}renderHUD();refreshSettings();}, + langSet:({v})=>{if(!Object.hasOwn(LANGS,v)||v===LANG)return;try{localStorage.setItem('sot-lang',v);}catch(e){}save();location.reload();}, + mute:()=>{UI.muted=!UI.muted;try{localStorage.setItem('sot-mute',UI.muted?'1':'0');}catch(e){}renderHUD();}, + closePanel:()=>{UI.sel=null;UI.confirm=null;renderPanel();renderLeft();}, + closeModal:()=>closeModal(), + tab:({t})=>{UI.tab=t;UI.confirm=null;renderPanel();}, + leftTab:({t})=>{UI.left=t;UI.leftOpen=true;renderLeft();}, + netFocus:({id})=>{if(!NET[id])return;$('dash').hidden=true;UI.netFocus=id;UI.nf='all';UI.left='nets';UI.leftOpen=true;UI.sel=null;renderPanel();renderLeft();const b=$('leftBody');if(b)b.scrollTop=0;}, + netFilter:({f})=>{UI.nf=f==='out'?'out':'all';UI.netFocus=null;$('dash').hidden=true;UI.left='nets';UI.leftOpen=true;UI.sel=null;renderPanel();renderLeft();const b=$('leftBody');if(b)b.scrollTop=0;}, + meetGo:({city})=>{if(!isCity(city))return;$('dash').hidden=true;ACT.focusCity({city});if(S.pops[city]){UI.tab='peer';renderPanel();}}, + toggleLeft:()=>{UI.leftOpen=!UI.leftOpen;renderLeft();}, + phoneTab:({t})=>{if(!['goals','deals','noc','nets'].includes(t))return;haptic(8);if(UI.leftOpen&&UI.left===t&&!UI.sel){UI.leftOpen=false;}else{UI.left=t;UI.leftOpen=true;UI.sel=null;renderPanel();}$('left').classList.remove('full');renderLeft();}, + phonePlay:()=>{haptic(10);if(UI.speed){UI.lastSpeed=UI.speed;UI.speed=0;}else UI.speed=UI.lastSpeed||1;renderHUD();}, + phoneSpeed:()=>{haptic(8);const cur=UI.speed||UI.lastSpeed||1,i=SPEEDS.indexOf(cur),n=SPEEDS[(i+1)%SPEEDS.length];UI.speed=n;UI.lastSpeed=n;renderHUD();}, + install:()=>{if(installEvt){installEvt.prompt();installEvt.userChoice.finally(()=>{installEvt=null;});return;} + openModal(pitchHtml(false));}, + pitchSkip:()=>{const p=UI.pendGame;UI.pendGame=null;UI.pitched=true;if(p)beginGame(...p);else closeModal();}, + logOpen:({id})=>{const e=(S.log||[]).find(x=>x.id===id),o=e&&e.o;if(!o)return;$('dash').hidden=true;closeModal(); + 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==='inbox'){ACT.inbox({});return;}if(o.a==='tab'&&LOG_TABS.includes(o.v))ACT.leftTab({t:o.v});}, + logAll:()=>{UI.logAll=!UI.logAll;renderLeft();}, + focusCity:({city})=>{selectCity(city);const C=CITY[city];cam.x=C.x;cam.y=C.y;cam.z=Math.max(cam.z,1.2);if(innerWidth<760)UI.leftOpen=false;renderLeft();}, + selLink:({id})=>selectLink(id), +}; diff --git a/src/game/90-actions/20-pops-transit-ix.js b/src/game/90-actions/20-pops-transit-ix.js new file mode 100644 index 0000000..2e18869 --- /dev/null +++ b/src/game/90-actions/20-pops-transit-ix.js @@ -0,0 +1,26 @@ +Object.assign(ACT,{ + buildPop:({city})=>{if(S.pops[city]||!cityOn(city))return;const flipNote=CITY[city]&&CITY[city].au;if(cnCity(city)&&!cnOk()){toast(tr('pops_transit_ix.you_need_a_license_first_foreign'),'bad');sfx('err');return;}if(!spend(popCost(city)))return;S.pops[city]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false};floater(CITY[city].x,CITY[city].y-30,tr('common.new_pop'),'#FF4F9A');if(flipNote)toast(pick([tr('pops_transit_ix.router_installed_in_city_upside_down',{city:CITY[city].name}),tr('pops_transit_ix.router_installed_in_city_the_vendor',{city:CITY[city].name})]),'good',[],{a:'city',v:city});UI.tab='cust';after();}, + launchBB:({city})=>{const p=S.pops[city];if(!p||p.bb)return;const C=CITY[city];if(!spend(bbCost(city)))return;p.bb={d:bbStart(city)};floater(C.x,C.y-30,tr('common.eyeballs_online'),'#16A866');after();}, + ad:({city})=>{const p=S.pops[city];if(!p||!p.bb)return;if(!spend(8000))return;p.boost=S.day+30;floater(CITY[city].x,CITY[city].y-30,tr('common.ad_campaign'),'#FF8A3D');after();}, + buyTransit:({city,net,tier})=>{tier=+tier;if(scnRule('noTransit')){toast(tr('pops_transit_ix.no_transit_in_this_scenario_peering'),'bad');sfx('err');return;}if(!S.pops[city]||!NET[net]||!sellsAt(NET[net],city)||!PORT[tier])return;if(!portOk(city,tier)){toast(tr('actions.your_router_can_t_take_a',{port:PORT[tier].n}),'bad');sfx('err');return;}const ex=S.transit.find(t=>t.city===city&&t.net===net);if(ex&&tier<=ex.tier)return;if(!portGate(city,ex?(PORT_SLOT(tier)-PORT_SLOT(ex.tier))*(ex.n||1):PORT_SLOT(tier)))return;if(!spend(PORT[tier].setup*(ex&&ex.n||1)))return;if(ex)ex.tier=tier;else S.transit.push({id:uid(),city,net,tier,down:0});toast(tr('pops_transit_ix.net_transit_is_live_in_city',{net:esc(NET[net].name),city:CITY[city].name}),'good');after();}, + lagT:({id,d})=>{d=+d;if(d!==1&&d!==-1)return;const t=S.transit.find(x=>x.id===id);if(!t)return;const n=(t.n||1)+(+d);if(n<1||n>LAG_MAX)return;if(+d>0){if(!portOk(t.city,t.tier)||!portGate(t.city,PORT_SLOT(t.tier)))return;if(!spend(PORT[t.tier].setup))return;}t.n=n;if(n<2&&t.site==='ab')t.site='a';toast(+d>0?tr('pops_transit_ix.lag_member_added_net_in_city',{net:esc(NET[t.net].name),city:CITY[t.city].name,lag:lagName(t.tier,n)}):tr('pops_transit_ix.lag_member_removed'),'good');after();}, + lagP:({id,d})=>{d=+d;if(d!==1&&d!==-1)return;const p=S.pni.find(x=>x.id===id);if(!p)return;const n=(p.n||1)+(+d);if(n<1||n>LAG_MAX)return;if(d>0&&(!pniOn(p)||p.up||msfNope(p.net,p.city)))return;if(+d>0&&(!portGate(p.city,PORT_SLOT(p.tier))||!spend(1500+PORT[p.tier].setup/2)))return; + // A LAG member is an augment: the big networks take months for that too. + if(d>0){const lead=pniLead(p.net);p.up={tier:p.tier,n,ready:S.day+lead,g1:!!p.g1};toast(tr('pops_transit_ix.augment_ordered_with_net_eta',{net:esc(NET[p.net].name),eta:pniWhen(lead)}),'good');after();return;}p.n=n;if(n<2&&p.site==='ab')p.site='a';sfx('build');after();}, + lagIx:({city,d})=>{d=+d;if(d!==1&&d!==-1)return;if(!isIx(city)||S.ixp[city]===undefined||S.myIx[city]||!S.pops[ixCity(city)])return;S.ixn=S.ixn||{};const n=(S.ixn[city]||1)+(+d);if(n<1||n>LAG_MAX)return;if(+d>0&&(!portGate(ixCity(city),PORT_SLOT(S.ixp[city]))||!spend(ixPortMo(city,S.ixp[city]))))return;S.ixn[city]=n;if(n<2&&S.ixSite&&S.ixSite[city]==='ab')S.ixSite[city]='a';sfx('build');after();}, + cancelTransit:({id,ok})=>{if(!ok&&UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.transit=S.transit.filter(t=>t.id!==id);UI.confirm=null;after();}, + buyIx:({city,tier,signed})=>{tier=+tier;if(!PORT[tier]||!ixName(city)||(!S.pops[ixCity(city)]&&(!remoteCities().includes(ixCity(city))||tier>1))||(S.ixp[city]!==undefined&&tier<=S.ixp[city]))return;if(S.pops[ixCity(city)]&&!portOk(ixCity(city),tier)){toast(tr('actions.your_router_can_t_take_a',{port:PORT[tier].n}),'bad');sfx('err');return;}{const h0=S.ixp[city]!==undefined;if(!S.myIx[city]&&!portGate(ixCity(city),h0?(PORT_SLOT(tier)-PORT_SLOT(S.ixp[city]))*((S.ixn||{})[city]||1):PORT_SLOT(tier)))return;} + if(isDk(city)&&S.ixp[city]===undefined&&!signed){const dk=dkState();if(dk.stall>S.day){toast(tr('pops_transit_ix.de_kicks_sales_is_still_aligning',{n:dk.stall-S.day}),'bad');sfx('err');return;}dk.lastQ=dk.lastQ||{};const lq=dk.lastQ[city];dk.q={city,tier,m:lq&&lq.until>S.day?lq.m:dkQuoteMult(),h:lq&&lq.until>S.day?lq.h:0};dk.lastQ[city]={m:dk.q.m,h:dk.q.h,until:S.day+90};dkQuoteModal();return;}const had=S.ixp[city]!==undefined;if(!spend(ixPortMo(city,tier)*(had?((S.ixn||{})[city]||1):1)))return;S.ixp[city]=tier;if(!had)toast(S.pops[ixCity(city)]?tr('pops_transit_ix.port_up_at_ix_now_request',{ix:esc(ixName(city))}):tr('pops_transit_ix.remote_port_up_at_ix_it',{ix:esc(ixName(city))}),'good',[],{a:'city',v:ixCity(city)});after();}, + cancelIx:({city,sure,ok})=>{if(!ok&&UI.confirm!=='ix'+city){UI.confirm='ix'+city;renderPanel();return;} + if(isDk(city)&&!sure){const dk=dkState();if(!dk.retUsed[city]){openModal(`
${tr('pops_transit_ix.de_kicks_group_customer_success')}

${tr('pops_transit_ix.wait_before_you_go')}

${tr('pops_transit_ix.we_value_our_partnership_too_much')}

${tr('common.retention_offer')}${tr('pops_transit_ix.40_off_for_6_months')}

${tr('pops_transit_ix.after_that_the_normal_price_returns')}

${btn(tr('pops_transit_ix.stay_take_the_discount'),'dkStay',{city},'pink')}${btn(tr('common.leave_anyway'),'cancelIx',{city,sure:1},'ghost')}
`);return;}} + closeModal();if(S.dk){if(S.dk.m[city]){S.dk.lastQ=S.dk.lastQ||{};S.dk.lastQ[city]={m:S.dk.m[city],h:3,until:S.day+365};}delete S.dk.m[city];delete S.dk.add[city];delete S.dk.ret[city];}delete S.ixp[city];delete S.rs[city];if(S.ixn)delete S.ixn[city];for(const k in S.peers)if(k.endsWith('@'+city))delete S.peers[k];UI.confirm=null;after();}, + rs:({city})=>{if(!isIx(city)||S.ixp[city]===undefined)return;S.rs[city]=!S.rs[city];if(S.rs[city])toast(tr('pops_transit_ix.route_server_session_up_you_now'),'good');sfx('build');after();}, + dkAccept:()=>{const dk=dkState(),q=dk.q;if(!q)return;dk.m[q.city]=q.m;dk.q=null;closeModal();ACT.buyIx({city:q.city,tier:q.tier,signed:true});if(S.ixp[q.city]===undefined)delete dk.m[q.city];else toast(tr('pops_transit_ix.signed_with_de_kicks_welcome_to'),'good');}, + dkHaggle:()=>{const dk=dkState(),q=dk.q;if(!q||q.h>=3)return;q.h++;const r=Math.random(); + if(r<0.45){S.stats.haggleWin=1;q.m=+(q.m*(0.75+Math.random()*0.15)).toFixed(2);dkQuoteModal();toast(tr('pops_transit_ix.just_this_once_your_account_manager'),'good');} + else if(r<0.75){q.m=+(q.m*1.1).toFixed(2);dkQuoteModal();toast(tr('pops_transit_ix.after_consulting_with_management_the'),'bad');} + else{dk.stall=S.day+5+Math.floor(Math.random()*6);dk.q=null;closeModal();toast(tr('pops_transit_ix.haggling_paused_why',{why:esc(pick(DK_STALL))}),'bad');}}, + dkWalk:()=>{const dk=dkState(),q=dk.q;if(q){dk.lastQ=dk.lastQ||{};dk.lastQ[q.city]={m:q.m,h:q.h,until:S.day+90};if(q.h>0)dk.stall=Math.max(dk.stall||0,S.day+3);}dk.q=null;closeModal();toast(tr('pops_transit_ix.de_kicks_will_circle_back_expect'),'');}, + dkOptOut:({city,n})=>{const dk=dkState(),k='dk'+city+n;if(UI.confirm!==k){UI.confirm=k;renderPanel();return;}dk.add[city]=(dk.add[city]||[]).filter(x=>x.n!==n);UI.confirm=null;S.stats.optouts=(S.stats.optouts||0)+1;toast(tr('pops_transit_ix.opted_out_of_name_it_took',{name:esc(n)}),'good');after();}, + dkStay:({city})=>{S.stats.retained=1;const dk=dkState();dk.ret[city]=S.day+180;dk.retUsed[city]=true;UI.confirm=null;closeModal();toast(tr('pops_transit_ix.40_off_ix_for_6_months',{ix:esc(ixName(city))}),'good');after();}, +}); diff --git a/src/game/90-actions/30-route-script-and-tools.js b/src/game/90-actions/30-route-script-and-tools.js new file mode 100644 index 0000000..97ee5f9 --- /dev/null +++ b/src/game/90-actions/30-route-script-and-tools.js @@ -0,0 +1,27 @@ +Object.assign(ACT,{ + teEdit:()=>{if(!S.te)return;UI.teDraft=undefined;teModal();}, + teClose:()=>{const t=$('teSrc');if(t)UI.teDraft=t.value;closeModal();}, + teOpt:()=>{UI.teDraft=teOptimize();teModal();}, + teExample:()=>{UI.teDraft=TE_EXAMPLE;teModal();}, + teSlop:()=>{const t0=performance.now(),a=aiSlop(Math.random()<0.02),secs=Math.max(0.1,(performance.now()-t0)/1000);UI.teDraft=UI.slop=a.src;teModal(`

🤖 ${esc(a.ai)} ${tr('route_script_and_tools.thought_for_s_seconds',{s:secs.toFixed(1)})}
${tr(a.say)}

`);sfx('build');}, + teHelp:()=>{const t=$('teSrc');if(t)UI.teDraft=t.value;teHelpModal();}, + teBack:()=>teModal(), + teRecipe:({id})=>{const r=TE_RECIPES.find(x=>x.id===id);if(!r)return;UI.teDraft=r.src().join('\n');teModal(`

${tr('route_script_and_tools.loaded_name_check_it_then_deploy',{name:tr(r.n)})}

`);}, + teClear:()=>{S.te.script='';UI.teDraft=undefined;TE_CACHE={src:null,p:null};after();teModal(`

${tr('route_script_and_tools.script_removed_plain_auto_te_is')}

`);}, + teCheck:()=>{const t=$('teSrc');const src=t?t.value:'';UI.teDraft=src;const p=teParse(src);if(p.errors.length){teModal(`
${esc(p.errors.join('\n'))}
`);return;}const r=teTrial(src);teModal(`
${esc(trn('route_script_and_tools.n_rule_ok',p.n)+'\n'+tr('route_script_and_tools.served_a_b',{a:fmtG(r.before.served),b:fmtG(r.after.served)})+'\n'+tr('route_script_and_tools.transit_a_mo_b_mo',{a:fmt$(r.before.tc),b:fmt$(r.after.tc)})+'\n'+tr('route_script_and_tools.spilled_g_onto_alternate_paths',{g:fmtG(r.after.moved)})+(r.after.bh?'\n'+tr('route_script_and_tools.blackholed_g',{g:fmtG(r.after.bh)}):''))}
`);}, + teDeploy:()=>{const t=$('teSrc');const src=(t?t.value:'').slice(0,4000);UI.teDraft=src;const p=teParse(src);if(p.errors.length){teModal(`
${esc(tr('common.commit_failed')+'\n'+p.errors.join('\n'))}
`);sfx('err');return;}const r=teTrial(src);S.te.script=src;S.te.on=true;TE_CACHE={src:null,p:null};UI.teDraft=undefined;after(); + const drop=r.before.served>1?1-r.after.served/r.before.served:0,saved=r.before.tc>0?1-r.after.tc/r.before.tc:0; + if(drop>0.1&&UI.slop===src){if(drop>0.3)S.stats.fat=1;toast(tr('route_script_and_tools.commit_complete_traffic_down_p_the',{p:pct(drop)}),'bad');sfx('alert');} + else if(drop>0.3){S.stats.fat=1;toast(tr('route_script_and_tools.commit_complete_traffic_down_p_you',{p:pct(drop)}),'bad');sfx('alert');} + else{if(saved>0.1&&drop<0.01)S.stats.kiddie=1;toast(`${tr('common.commit_complete')}
${saved>0.01?trn('route_script_and_tools.n_rule_live_transit_bill_down',p.n,{p:pct(saved)}):trn('route_script_and_tools.n_rule_live',p.n)}`,'good');sfx('build');}closeModal();UI.slop=undefined;checkGoals();}, + buyTE:()=>{if(S.te)return;if(lvl()<3){toast(tr('route_script_and_tools.auto_te_unlocks_at_customer_level'),'bad');sfx('err');return;}if(!spend(TE_COST))return;S.te={on:true,day:S.day};toast(tr('route_script_and_tools.auto_te_is_live_the_controller'),'good');after();}, + teToggle:()=>{if(!S.te)return;S.te.on=!S.te.on;after();}, + trace:({city})=>traceModal(city), + traceRun:()=>{const f=$('trFrom'),t=$('trTo');traceModal(f&&f.value,t&&t.value);}, + traceCopy:()=>{try{navigator.clipboard.writeText(UI.trText||'');toast(tr('route_script_and_tools.copied_paste_it_into_your_favourite'),'good');}catch(e){}}, + share:()=>shareModal(), + shareDl:()=>shareFile(f=>{if(!f)return;const a=document.createElement('a');a.href=URL.createObjectURL(f);a.download=f.name;document.body.appendChild(a);a.click();setTimeout(()=>{URL.revokeObjectURL(a.href);a.remove();},1000);track('share_download');}), + shareGo:()=>shareFile(f=>{const d={title:'Series of Tubes',text:tr('route_script_and_tools.name_as_asn_tier_peak_peak',{name:S.name,asn:S.asn,tier:tierLabel(),peak:fmtG(S.stats.peak||0)}),url:'https://seriesoftub.es/'};try{if(f&&navigator.canShare&&navigator.canShare({files:[f]}))d.files=[f];navigator.share(d).then(()=>track('share_done')).catch(()=>{});}catch(e){}}), + confGo:({key})=>{S.confReg=S.confReg||{};if(S.confReg[key])return;const cf=upcomingConfs(75).find(x=>x.key===key);if(!cf||cf.day<=S.day)return;if(!spend(CONF_COST))return;S.confReg[key]=true;toast(tr('route_script_and_tools.registered_flights_booked_badge'),'good');after();}, + tutSkip:()=>{S.tut=null;try{localStorage.setItem('sot-tut','1');}catch(e){}renderCoach();}, +}); diff --git a/src/game/90-actions/40-sites-peering-caches.js b/src/game/90-actions/40-sites-peering-caches.js new file mode 100644 index 0000000..05783be --- /dev/null +++ b/src/game/90-actions/40-sites-peering-caches.js @@ -0,0 +1,38 @@ +Object.assign(ACT,{ + addSite:({city})=>{const p=S.pops[city];if(!p||p.site2)return;if(!spend(SITE2_COST))return;p.site2=true;p.site2Day=S.day;toast(tr('sites_peering_caches.second_site_live_in_city_b',{city:CITY[city].name,b:esc(siteName(city,'b')),a:esc(siteName(city,'a'))}),'good');sfx('build');after();}, + rmSite:({city})=>{const p=S.pops[city];if(!p||!p.site2)return;if(UI.confirm!=='site'+city){UI.confirm='site'+city;renderPanel();return;}UI.confirm=null;p.site2=0;p.sdown=null;p.ringcut=0;for(const t of S.transit)if(t.city===city)t.site='a';for(const x of S.pni)if(x.city===city)x.site='a';for(const x of S.caches)if(x.city===city)x.site='a';if(S.ixSite)for(const x of ixIdsIn(city))delete S.ixSite[x];after();}, + siteSet:({k,id,s})=>{if(!['a','b','ab'].includes(s))return; + const o=k==='t'?S.transit.find(x=>x.id===id):k==='p'?S.pni.find(x=>x.id===id):null;if(k!=='ix'&&!o)return;if(k==='ix'&&(!isIx(id)||S.ixp[id]===undefined||!S.pops[ixCity(id)]))return; + if(k==='ix'&&S.myIx[id]){S.ixSite=S.ixSite||{};S.ixSite[id]=s;after();return;} + const n=()=>k==='ix'?((S.ixn||{})[id]||1):(o.n||1); + if(s==='ab'&&n()<2){const before=n();if(k==='t')ACT.lagT({id,d:1});else if(k==='p')ACT.lagP({id,d:1});else ACT.lagIx({city:id,d:1});if(n()<2||n()===before)return;toast(tr('sites_peering_caches.second_lag_member_added_one_member'),'good');} + if(k==='ix'){S.ixSite=S.ixSite||{};S.ixSite[id]=s;}else o.site=s;after();}, + peer:({city,net})=>{if(!isIx(city)||!isNet(net)||S.ixp[city]===undefined||!ixMembers(city).includes(net))return;const r=peerOk(net,'ix',city);if(!r.ok){toast(tr('sites_peering_caches.net_declined_why',{net:esc(NET[net].name),why:esc(r.why)}),'bad');sfx('err');return;}S.peers[net+'@'+city]=true; + toast(`${tr('sites_peering_caches.net_accepted',{net:esc(NET[net].name)})}
${NET[net].pol==='selective'?tr('sites_peering_caches.they_checked_your_pearingdb_page_and'):tr('sites_peering_caches.bgp_session_established')}`,'good');sfx('build');after();}, + unpeer:({city,net})=>{delete S.peers[net+'@'+city];after();}, + peerAll:({city})=>{if(!isIx(city)||S.ixp[city]===undefined)return;const set=ixSessions(city);let n=0;for(const id of ixMembers(city))if(!set.has(id)&&peerOk(id,'ix',city).ok){S.peers[id+'@'+city]=true;n++;}if(!n)return;toast(trn('sites_peering_caches.n_new_session_at_ix_small',n,{ix:esc(ixName(city))}),'good',[],{a:'city',v:ixCity(city)});sfx('build');after();}, + tailTog:()=>{UI.tailOpen=!UI.tailOpen;renderLeft();}, + pni:({city,net,tier})=>{tier=+tier;const g1=tier===-1;if(g1){if(!pniG1(net))return;tier=0;}if(!S.pops[city]||!NET[net]||!NET[net].pops.includes(city)||!PORT[tier])return;if(!portOk(city,tier)){toast(tr('actions.your_router_can_t_take_a',{port:PORT[tier].n}),'bad');sfx('err');return;}const r=peerOk(net,'pni',city);if(!r.ok){toast(tr('sites_peering_caches.net_declined_the_pni_why',{net:esc(NET[net].name),why:esc(r.why)}),'bad');sfx('err');after();return;} + if(!g1&&tierp.city===city&&p.net===net);if(ex&&(g1||!pniOn(ex)||ex.up))return;if(ex&&!(ex.g1&&tier===0)&&tier<=ex.tier)return; + const cost=g1?PNI_G1_COST:(1500+PORT[tier].setup/2)*(ex&&ex.n||1);if(!portGate(city,ex?(PORT_SLOT(tier)-PORT_SLOT(ex.tier))*(ex.n||1):PORT_SLOT(tier)))return;if(!spend(cost))return;if(S.conf&&S.conf.until>S.day)S.stats.beerPni=1; + // Nothing is instant: a cross-connect takes weeks, and the big networks quote months for a new PNI or an augment. + const lead=pniLead(net);if(ex)ex.up={tier,n:ex.n||1,ready:S.day+lead,g1:false};else S.pni.push({id:uid(),city,net,tier,g1:g1||undefined,ready:S.day+lead}); + toast(tr('sites_peering_caches.pni_with_net_ordered_eta_a',{net:esc(NET[net].name),eta:pniWhen(lead),dc:esc(siteName(city,'a'))}),'good');after();}, + pniChase:({id})=>{const p=S.pni.find(x=>x.id===id);if(!p||(pniOn(p)&&!p.up))return;const r=Math.random(); + if(r<0.15){if(p.up)p.up.ready=Math.max(S.day+1,p.up.ready-30);else p.ready=Math.max(S.day+1,p.ready-30);toast(tr('sites_peering_caches.your_account_manager_found_the_order'),'good');} + else toast(pick([tr('sites_peering_caches.it_is_with_the_provisioning_team'),tr('sites_peering_caches.we_are_waiting_on_the_colo'),tr('sites_peering_caches.your_ticket_was_merged_into_another'),tr('sites_peering_caches.could_you_resend_the_loa_you'),tr('sites_peering_caches.your_account_manager_is_on_paternity')]));after();}, + inbox:()=>{inboxModal();}, + inboxAct:({id,a})=>{if(!['accept','decline','raise','keep'].includes(a))return;ibxAnswer(+id,a);after();inboxModal();}, + inboxPol:({p})=>{if(!PPOL.includes(p))return;ibx().pol=p;after();inboxModal();}, + inboxRaiseAll:()=>{const I=ibx(),mp=I.items.filter(x=>x.k==='mp');if(!mp.length)return;const leaks=mp.filter(x=>x.leak).length;for(const x of mp)ibxAnswer(x.id,'raise',true); + toast(leaks?trn('sites_peering_caches.raised_n_max_prefix_limits_one',leaks,{n:mp.length,k:leaks}):tr('sites_peering_caches.raised_n_max_prefix_limits_all',{n:mp.length}),leaks?'bad':'good');after();inboxModal();}, + inboxAll:({a})=>{if(a!=='accept'&&a!=='decline')return;const I=ibx();for(const x of I.items.filter(x=>x.k==='req'))ibxAnswer(x.id,a,true);after();inboxModal();}, + inboxBot:({on})=>{const I=ibx();if(+on){if(I.bot||!spend(AI_MO))return;I.bot=true;ibxLog(N_('sites_peering_caches.hello_i_am_large_peering_model'),{});toast(tr('sites_peering_caches.large_peering_model_is_hired_your',{price:fmt$(20e6)}),'good');}else{I.bot=false;toast(tr('sites_peering_caches.the_ai_is_gone_it_left'));}after();inboxModal();}, + cancelPni:({id,ok})=>{if(!ok&&UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.pni=S.pni.filter(p=>p.id!==id);UI.confirm=null;after();}, + cache:({city,net})=>{const n=NET[net];if(!n||!n.cache||!S.pops[city])return;if((R.demTo[net]||0)x.city===city&&x.net===net),nb=hv.filter(x=>x.site==='b').length;S.caches.push({id:uid(),city,net,site:S.pops[city].site2&&nb{S.caches=S.caches.filter(c=>c.id!==id);after();}, + // Move one of a CDN's boxes to the other building (#69), so a dark building only takes out part of the cache. + cacheSite:({city,net,s})=>{if(s!=='a'&&s!=='b'||!S.pops[city]||!S.pops[city].site2)return;const x=S.caches.find(c=>c.city===city&&c.net===net&&(c.site==='b'?'b':'a')!==s);if(!x)return;x.site=s;sfx('click');after();}, +}); diff --git a/src/game/90-actions/50-customers.js b/src/game/90-actions/50-customers.js new file mode 100644 index 0000000..0ffd772 --- /dev/null +++ b/src/game/90-actions/50-customers.js @@ -0,0 +1,19 @@ +Object.assign(ACT,{ + advertise:({id})=>{const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||l.ready>S.day)return;if(S.offers.some(o=>o.link===l.id))return; + const t=freeCh(l)>=1?'wwave':pairFree(l)?'dfpair':null;if(!t){toast(tr('customers.nothing_spare_to_sell_on_this'),'bad');sfx('err');return;} + const T=BIZ_T[t],nm=()=>{const list=T.names.filter(n=>!S.usedNames.includes(n)),n=list.length?pick(list):pick(T.names);S.usedNames.push(n);return n;}; + // A capacity broker finds a buyer at once and keeps 10% of the monthly price. + const o=fiberOffer(t,l,nm,0.9);o.broker=true;S.offers.push(o);toast(tr('customers.listed_with_a_capacity_broker_name',{name:esc(o.name),what:esc(o.what)}),'good');sfx('click');after();}, + accept:({id})=>{const o=S.offers.find(x=>x.id===id);if(!o)return;if(!bHas(o)){toast(tr('customers.you_need_a_pop_in_every'),'bad');return;} + if(o.type==='wwave'){const l=S.links.find(x=>x.id===o.link);if(!l||chMax(l)-(l.ch||[]).length-soldSlots(l)=o.start){toast(tr('customers.too_late_the_event_has_already'),'bad');return;} + // A carrier renting more alien waves on a fiber it already rents grows its contract, like a real order for extra waves, + // instead of a new customer for every few waves (a big fiber business otherwise fills the save with tiny contracts). + const more=o.type==='wwave'&&S.biz.find(b=>b.type==='wwave'&&b.link===o.link&&b.name===o.name); + if(more){const l=S.links.find(x=>x.id===o.link);S.offers=S.offers.filter(x=>x!==o);more.slots=(more.slots||0)+(o.slots||0);more.rate+=o.rate;if(l)more.what=wwWhat(l,more.slots); + floater(CITY[o.city].x,CITY[o.city].y-30,tr('common.signed'),'#16A866');sfx('coin');after();return;} + S.offers=S.offers.filter(x=>x!==o);S.biz.push({id:o.id,city:o.city,city2:o.city2||null,reqs:o.reqs||[],latMax:o.latMax||null,route:BIZ_T[o.type].scenic?'scenic':BIZ_T[o.type].lat?'fast':'normal',name:o.name,type:o.type,bw:o.bw,rate:o.rate,mood:100,since:S.day,sites:o.sites||null,start:o.start,dur:o.dur,fee:o.fee,link:o.link,slots:o.slots||0,what:o.what,prov:o.prov}); + floater(CITY[o.city].x,CITY[o.city].y-30,tr('common.signed'),'#16A866');sfx('coin');after();}, + decline:({id})=>{S.offers=S.offers.filter(x=>x.id!==id);after();}, + dropBiz:({id})=>{const b0=S.biz.find(x=>x.id===id);if(!b0)return;if(BIZ_T[b0.type].event&&S.day>=b0.start){toast(tr('customers.the_event_is_already_running_the'),'bad');sfx('err');return;}if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.biz=S.biz.filter(b=>b.id!==id);UI.confirm=null;after();}, +}); diff --git a/src/game/90-actions/60-links.js b/src/game/90-actions/60-links.js new file mode 100644 index 0000000..c816d7f --- /dev/null +++ b/src/game/90-actions/60-links.js @@ -0,0 +1,33 @@ +Object.assign(ACT,{ + upLink:({id,tier})=>{tier=+tier;const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='wave'||!LT[tier]||tier<=l.tier)return;{const w=subWaveWhy(tier,l.km,l.sub);if(w){toast(tr('links.no_wave_waves_on_this_cable',{wave:LT[tier].n,why:esc(w)}),'bad');sfx('err');return;}}if(!waveOk(l.a,l.b,tier)){toast(tr('links.a_wave_wave_needs_need_at',{wave:LT[tier].n,need:esc(waveNeed(tier))}),'bad');sfx('err');return;}const nm=Math.round(waveMo(l.km,l.sub,tier)*(l.mult||1));if(!spend(nm))return;l.mo=nm;l.tier=tier;after();}, + decomOpen:({city})=>{UI.decom=new Set(city&&S.pops[city]?[city]:[]);decomModal();}, + decomToggle:({city})=>{if(!S.pops[city])return;UI.decom=UI.decom||new Set();if(UI.decom.has(city))UI.decom.delete(city);else UI.decom.add(city);decomModal();}, + decomGo:()=>{const sel=[...(UI.decom||[])].filter(c=>S.pops[c]);if(!sel.length||sel.length>=Object.keys(S.pops).length)return;closeModal();UI.decom=null;UI.sel=null;decommission(sel);sfx('alert');after();}, + rmLink:({id})=>{if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}{const l=S.links.find(x=>x.id===id),back=cabBack(l);if(back>0){S.cash+=back;toast(tr('links.name_is_called_off_the_cable',{name:esc(l.cname||tr('common.your_cable')),price:fmt$(back)}),'good');}}S.links=S.links.filter(l=>l.id!==id);UI.sel=null;UI.confirm=null;after();}, + fixInc:({id})=>{const i=S.inc.find(x=>x.id===id);if(!i||!(i.cost>0))return;if(i.slow&&i.rushed)return;if(!spend(i.cost))return; + if(i.slow&&i.until>S.day+1){i.rushed=true;i.cost=0;i.until=S.day+1;const p=S.pops[i.ref];if(p)p.down=Math.min(p.down,S.day+1);toast(tr('links.power_cycled_the_router_in_city',{city:esc(CITY[i.ref].name),chip:esc(RG[(p&&p.rgen)||0].chip)}),'good');after();return;}clearInc(i);toast(tr('links.fixed_what_resolved_early',{what:incTitle(i.type)}),'good');after();}, + myIxUp:({city})=>{const m=S.myIx[city];if(!m)return;const f=(m.fab|0)+1,N=MYIX_FAB[f];if(!N)return;if(N.lvl>lvl()){toast(tr('links.a_fab_fabric_unlocks_at_customer',{fab:N.n,lv:N.lvl}),'bad');sfx('err');return;}if(!spend(N.cost))return;m.fab=f;toast(tr('links.ix_now_runs_a_fab_fabric',{ix:esc(m.name),fab:N.n,max:N.max}),'good');m.next=Math.min(m.next,S.day+3);after();}, + foundIx:({city})=>{if(!S.pops[city]||S.myIx[city]||CITY[city].ix||CITY[city].cn)return;if(!spend(MYIX_COST))return;const nm=(S.name.split(' ')[0]||'My').replace(/[^A-Za-z0-9]/g,'').slice(0,10)+'-IX '+CITY[city].name; + S.myIx[city]={name:nm,members:[],next:S.day+4};S.ixp[city]=2;toast(tr('links.you_founded_ix_networks_will_join',{ix:esc(nm)}),'goal');after();}, + buildLink:({tier})=>{tier=+tier;const p=UI.pending;if(!p)return;const {a,b}=p;const km=kmBetween(a,b),sub=isSub(a,b),sib=pairLinks(a,b).filter(l=>l.kind!=='vxc'),jn=sib.length?routeJoin(a,b):null,same=!!jn,border=cnCity(a)!==cnCity(b),mult=(sib.length&&!(jn&&jn.k===(landTrenches(a,b)[0]||{}).k)?DIVERSE:1)*(border?3*(UI.cnPrem&&(a==='hkg'||b==='hkg')?1.6:1):1); + if((cnCity(a)||cnCity(b))&&!cnOk())return; + if(!waveOk(a,b,tier)){toast(tr('links.a_wave_wave_needs_need_at',{wave:LT[tier].n,need:esc(waveNeed(tier))}),'bad');sfx('err');return;} + const wr=waveRoute(a,b,mult,border);if(!wr){toast(tr('links.no_cable_available_for_that_route'),'bad');sfx('err');return;} + {const so=soldOut(a,b,tier,wr.cab);if(so){toast(tr('links.no_wave_capacity_on_this_route',{wave:LT[tier].n,why:tr(so.why),n:Math.max(1,so.until-S.day)}),'bad');sfx('err');return;}}{const w=subWaveWhy(tier,wr.km,wr.sub);if(w){toast(tr('links.no_wave_waves_on_this_cable',{wave:LT[tier].n,why:esc(w)}),'bad');sfx('err');return;}}const base=Math.round(waveMo(wr.km,wr.sub,tier)*wr.wm),cost=base+(S.pops[b]?0:popCost(b)); + if(!portGate(a,1)||!portGate(b,1))return;if(!spend(cost))return;if(!S.pops[b])S.pops[b]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false}; + const id=uid();const l={id,a,b,kind:'wave',border,premium:border&&!!UI.cnPrem&&(a==='hkg'||b==='hkg'),tier,km:wr.km,sub:wr.sub,cable:wr.cab,mo:base,mult:wr.wm,trench:wr.cab?'cab:'+wr.cab:(jn?jn.k:id),cut:0,day:S.day};S.links.push(l);closeModal(); + if(sib.length){UI.sel={type:'link',id};}else{UI.sel={type:'city',id:b};UI.tab='cust';} + floater((CITY[a].x+CITY[a].x+wrapDx(CITY[a].x,CITY[b].x))/2,(CITY[a].y+CITY[b].y)/2-20,tr('links.wave_lit',{wave:LT[tier].n}),'#FF4F9A');after();}, + buyNni:({city,prov,tier})=>{tier=+tier;if(!NNI[tier]||!isCity(city)||!own(FAB,prov)||!FAB[prov].cities.includes(city)||!S.pops[city])return;const ex=nniPort(city,prov);if(ex&&tier<=ex.tier)return;if(!ex&&!portGate(city,1))return;if(ex&&nniUsed(city,prov)>NNI[tier].g){toast(tr('links.too_many_circuits_for_a_smaller'),'bad');return;}if(!spend(NNI[tier].mo))return;if(ex)ex.tier=tier;else S.nni.push({id:uid(),city,prov,tier});toast(tr('links.fab_port_is_up_in_city',{fab:esc(FAB[prov].name),city:CITY[city].name}),'good');after();}, + rmNni:({city,prov})=>{if(nniUsed(city,prov)>0){toast(tr('links.cancel_the_circuits_on_this_port'),'bad');sfx('err');return;}S.nni=S.nni.filter(x=>!(x.city===city&&x.prov===prov));after();}, + openVxc:(a)=>openVxcModal(a), + buyVxc:({a,b,prov,t})=>{t=+t;const g=VXC[t].g,pa=nniPort(a,prov);if(!pa||nniUsed(a,prov)+g>NNI[pa.tier].g){toast(tr('links.not_enough_room_on_your_fabric'),'bad');sfx('err');return;} + if(S.pops[b]){const pb=nniPort(b,prov);if(!pb||nniUsed(b,prov)+g>NNI[pb.tier].g){toast(tr('links.not_enough_room_on_your_fab',{fab:esc(FAB[prov].name),city:CITY[b].name}),'bad');sfx('err');return;}} + const km=kmBetween(a,b),sub=isSub(a,b),mo=vxcMo(km,sub,t);if(!spend(mo))return;S.links.push({id:uid(),a,b,kind:'vxc',prov,vt:t,km,sub,mo,cut:0,day:S.day});closeModal(); + toast(tr('links.circuit_up_in_59_seconds_vxc',{vxc:VXC[t].n,fab:esc(FAB[prov].name),a:CITY[a].name,b:CITY[b].name})+(S.pops[b]?'':' '+tr('links.now_grab_an_ix_port_there')),'good');if(!S.pops[b])selectCity(b);after();}, + upVxc:({id,t})=>{t=+t;const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='vxc'||!VXC[t]||t<=l.vt)return;const extra=VXC[t].g-VXC[l.vt].g;for(const c of [l.a,l.b]){const pt=nniPort(c,l.prov);if(pt&&nniUsed(c,l.prov)+extra>NNI[pt.tier].g){toast(tr('links.fabric_port_in_city_is_full',{city:CITY[c].name}),'bad');sfx('err');return;}}const mo=vxcMo(l.km,l.sub,t);if(!spend(mo))return;l.vt=t;l.mo=mo;after();}, + cancelVxc:({id})=>{if(UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.links=S.links.filter(l=>l.id!==id);const rem=remoteCities();for(const c in S.ixp){if(!S.pops[ixCity(c)]&&!rem.includes(ixCity(c))){delete S.ixp[c];delete S.rs[c];for(const k in S.peers)if(k.endsWith('@'+c))delete S.peers[k];}}UI.sel=null;UI.confirm=null;after();}, + setPref:({kind,id,v})=>{if(!own(PREF,v))return;if(kind!=='t'&&kind!=='p'&&!(isIx(id)&&S.ixp[id]!==undefined))return;if(kind==='t'){const t=S.transit.find(x=>x.id===id);if(t)t.pref=v;}else if(kind==='p'){const x=S.pni.find(y=>y.id===id);if(x)x.pref=v;}else{S.ixPref=S.ixPref||{};S.ixPref[id]=v;}sfx('click');after();}, + setMetric:({id,v})=>{if(!own(MET,v))return;const l=S.links.find(x=>x.id===id);if(!l)return;for(const x of pairLinks(l.a,l.b))x.metric=v;sfx('click');after();}, + goEgress:({city,k})=>{ACT.focusCity({city});UI.tab=k==='t'?'up':k==='l2'?'cust':k==='nni'?'links':'peer';renderPanel();}, +}); diff --git a/src/game/90-actions/70-dashboard-lists.js b/src/game/90-actions/70-dashboard-lists.js new file mode 100644 index 0000000..41d9ff6 --- /dev/null +++ b/src/game/90-actions/70-dashboard-lists.js @@ -0,0 +1,17 @@ +Object.assign(ACT,{ + custGo:({id})=>{const b=S.biz.find(x=>x.id===id);if(!b)return;$('dash').hidden=true;ACT.focusCity({city:b.city});UI.tab='cust';renderPanel();}, + listMore:({k})=>{if(k!=='conn'&&k!=='cust')return;UI.listN=UI.listN||{};UI.listN[k]=listN(k)+LIST_PAGE;renderDash();}, + custF:({v})=>{UI.kf=UI.kf||{};UI.kf.f=v==='sad'?'sad':'';listReset('cust');renderDash();}, + custCity:({v})=>{UI.kf=UI.kf||{};UI.kf.city=isCity(v)?v:'';listReset('cust');renderDash();}, + custSort:({k})=>{if(!['mood','mo','name','city'].includes(k))return;listReset('cust');if(UI.custSort===k)UI.custDir=-(UI.custDir||1);else{UI.custSort=k;UI.custDir=k==='mo'?-1:1;}renderDash();}, + custOpen:({sad}={})=>{if(!S)return;UI.kf=sad?{f:'sad'}:{};listReset('cust');UI.dtab='cust';const d=$('dash');d.hidden=false;renderDash();d.scrollTop=0;}, + goConn:({city,k})=>{if(!isCity(city)||!own(CONN_K,k))return;$('dash').hidden=true;ACT.goEgress({city,k});}, + connF:({f,v})=>{const F=UI.cf=UI.cf||{};listReset('conn');if(f==='all'){UI.cf={};}else if(f==='k'){F.k=own(CONN_K,v)?v:'';}renderDash();}, + connCity:({v})=>{UI.cf=UI.cf||{};listReset('conn');UI.cf.city=isCity(v)?v:'';renderDash();}, + connNet:({v})=>{UI.cf=UI.cf||{};listReset('conn');UI.cf.net=NET[v]?v:'';renderDash();}, + connSort:({k})=>{if(!['k','city','name','use','mo'].includes(k))return;listReset('conn');if(UI.connSort===k)UI.connDir=-(UI.connDir||1);else{UI.connSort=k;UI.connDir=k==='use'||k==='mo'?-1:1;}renderDash();}, + connFor:({net})=>{if(!NET[net])return;UI.cf={net};ACT.connOpen();}, + connCancel:({k,id})=>{const r=conns().find(x=>x.k===k&&x.id===id);if(!r||r.mine)return;const key='cc:'+k+':'+id;if(UI.confirm!==key){UI.confirm=key;renderDash();return;}UI.confirm=null; + if(k==='t')ACT.cancelTransit({id,ok:1});else if(k==='p')ACT.cancelPni({id,ok:1});else if(k==='ix')ACT.cancelIx({city:id,ok:1});else if(k==='c')ACT.rmCache({id});else{const [city,prov]=id.split('|');ACT.rmNni({city,prov});}renderDash();}, + connOpen:()=>{if(!S)return;UI.dtab='conn';listReset('conn');const d=$('dash');d.hidden=false;renderDash();d.scrollTop=0;}, +}); diff --git a/src/game/90-actions/80-security-and-china.js b/src/game/90-actions/80-security-and-china.js new file mode 100644 index 0000000..3a44f5a --- /dev/null +++ b/src/game/90-actions/80-security-and-china.js @@ -0,0 +1,19 @@ +Object.assign(ACT,{ + applyCn:()=>{if(S.cnLic.state!=='none')return;if(!spend(CN_LIC))return;S.cnLic={state:'pending',ready:S.day+45};toast(tr('security_and_china.application_filed_your_local_partner'),'goal');after();}, + togglePrem:({id})=>{const t=S.transit.find(x=>x.id===id);if(!t)return;t.premium=!t.premium;sfx('click');after();}, + buildScrub:({city,tier})=>{if(!S.pops[city]||S.scrubs.some(x=>x.city===city))return;const T=SCRUB_TIERS[tier||0];if(!T)return;if((lvl()||1){const x=S.scrubs.find(q=>q.city===city);tier=+tier;if(!x||!SCRUB_TIERS[tier]||tier<=(x.tier||0))return;const T=SCRUB_TIERS[tier];if((lvl()||1){if(!hasScrub())return;S.scrubMode=S.scrubMode==='ondemand'?'always':'ondemand';sfx('click');after();}, + rmScrub:({city})=>{if(!S.scrubs.some(x=>x.city===city))return;if(UI.confirm!=='scrub:'+city){UI.confirm='scrub:'+city;renderAll();return;}S.scrubs=S.scrubs.filter(x=>x.city!==city);if(!hasScrub())S.scrubMode='always';UI.confirm=null;after();}, + cleanPipe:({id})=>{const t=S.transit.find(x=>x.id===id);if(!t)return;t.clean=!t.clean;toast(t.clean?tr('security_and_china.clean_pipe_add_on_enabled_on',{net:NET[t.net].name,mo:fmt$(cleanMo(t))}):tr('security_and_china.clean_pipe_add_on_removed_from',{net:NET[t.net].name}),t.clean?'good':'');after();}, + sacrif:({id})=>{const p=S.pni.find(x=>x.id===id);if(!p)return;p.sacrif=!p.sacrif;toast(p.sacrif?tr('security_and_china.net_pni_is_now_a_sacrificial',{net:NET[p.net].name}):tr('security_and_china.net_pni_is_back_to_normal',{net:NET[p.net].name}),p.sacrif?'good':'');after();}, + ixbh:({id}={})=>{const a=ddosFind(id);if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}if(!ddosHasIx(a)){toast(tr('security_and_china.no_ix_in_city_to_announce',{city:CITY[a.city].name}),'bad');sfx('err');return;}a.ixbh=!a.ixbh;toast(a.ixbh?tr('security_and_china.ix_blackhole_announced_in_city_about',{city:ddosCities(a).filter(hasIxAt).map(c=>CITY[c].name).join(', ')}):tr('security_and_china.ix_blackhole_withdrawn'),a.ixbh?'good':'');sfx('alert');after();}, + rtbh:({id}={})=>{const a=ddosFind(id);if(!a){toast(tr('security_and_china.no_attack_to_blackhole_right_now'),'');return;}a.bh=true;S.stats.rtbh=(S.stats.rtbh||0)+1;toast(tr('security_and_china.rtbh_announced_you_blackholed_the',{city:CITY[a.city].name}),'bad');sfx('alert');after();}, + unrtbh:({id}={})=>{const a=ddosFind(id);if(!a)return;for(const x of ddosAll())if(x.city===a.city)x.bh=false;toast(tr('security_and_china.blackhole_withdrawn_city_is',{city:CITY[a.city].name}),'');after();}, + hackback:({id}={})=>{const a=ddosFind(id);if(!a||a.until<=S.day){toast(tr('security_and_china.nothing_to_hack_back_right_now'),'');return;}if(!spend(20000))return;S.stats.hackback=(S.stats.hackback||0)+1; + if(Math.random()<0.35){a.until=S.day;a.bh=false;S.stats.hackWin=(S.stats.hackWin||0)+1;toast(tr('security_and_china.hackback_3000tm_strikes_back_skynot',{city:CITY[a.city].name}),'goal');sfx('coin');} + else{const fine=15000+Math.floor(Math.random()*35000);S.cash-=fine;S.stats.vigilante=(S.stats.vigilante||0)+1; + toast(tr('security_and_china.hackback_3000tm_hit_the_wrong_target',{who:pick([tr('security_and_china.skynot_ai_flattened_a_grandma_s'),tr('security_and_china.you_counter_flooded_a_hospital_in'),tr('security_and_china.the_botnet_was_already_someone_else')]),fine:fmt$(fine)}),'bad');sfx('err');} + after();}, + cnPrem:({v})=>{UI.cnPrem=!!+v;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, +}); diff --git a/src/game/90-actions/85-routing-and-routers.js b/src/game/90-actions/85-routing-and-routers.js new file mode 100644 index 0000000..f6520d4 --- /dev/null +++ b/src/game/90-actions/85-routing-and-routers.js @@ -0,0 +1,15 @@ +Object.assign(ACT,{ + via:({v})=>{UI.via=v;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + setRoute:({id,m})=>{if(!own(RT,m))return;const b=S.biz.find(x=>x.id===id);if(b){b.route=m;sfx('click');after();}}, + route:({r})=>{UI.route=r;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + addParallel:({id})=>{const l=S.links.find(x=>x.id===id);if(l)openLinkModal(l.a,l.b);}, + addRouter:({city})=>{const p=S.pops[city];if(!p||(p.routers||1)>=RMAX)return;if(!spend(routerCost(p.rgen||0)))return;p.routers=(p.routers||1)+1;floater(CITY[city].x,CITY[city].y-30,tr('common.router_added'),'#FF4F9A');after();}, + models:()=>{UI.models=!UI.models;renderPanel();}, + rmRouter:({city})=>{const p=S.pops[city];if(!p||(p.routers||1)<=1)return;if(portsUsed(city)>portsMax(city,undefined,p.routers-1)){toast(tr('routing_and_routers.unplug_something_first_used_ports',{used:fmtPorts(portsUsed(city)),max:portsMax(city,undefined,p.routers-1)}),'bad');sfx('err');return;}p.routers--;{const back=tradeIn(p.rgen||0,1);if(back>0){S.cash+=back;toast(tr('routing_and_routers.sold_a_model_on_ebuy_price',{model:esc(RG[p.rgen||0].n),price:fmt$(back)}),'good');}}after();}, + upRouter:({city,g})=>{const p=S.pops[city];if(!p)return;g=g===undefined?mainRG(RG[p.rgen||0].cls+1):+g;if(!RG[g]||g===(p.rgen||0))return;{const why=modelFits(city,g);if(why){toast(tr('routing_and_routers.the_model_won_t_fit_why',{model:esc(RG[g].n),why:esc(why)}),'bad');sfx('err');return;}}if(RG[g].lvl>lvl()){toast(tr('routing_and_routers.model_unlocks_at_customer_level_lv',{model:esc(RG[g].n),lv:RG[g].lvl}),'bad');sfx('err');return;} + const rt=p.routers||1,old=p.rgen||0;if(p.rupDay===S.day){toast(tr('routing_and_routers.the_new_routers_in_city_are',{city:CITY[city].name}),'bad');sfx('err');return;}const back=tradeIn(old,rt);if(!spend(swapCost(city,g)))return;p.rgen=g;p.rupDay=S.day;if(back>0)toast(tr('routing_and_routers.sold_the_old_model_on_ebuy',{model:esc(RG[old].n),price:fmt$(back)}),'good'); + if(rt===1&&popIdle(city))toast(tr('routing_and_routers.new_router_in_city_swapped_before',{city:CITY[city].name}),'good'); + else if(rt===1){const sl=slowBoot(city),dd=sl?3:1;p.down=Math.max(p.down||0,S.day+dd);addInc({type:'maint',ref:city,until:S.day+dd,msg:sl?tr('routing_and_routers.swapping_the_only_router_in_city',{city:CITY[city].name,model:RG[g].n,how:pick(SLOW_BOOT),n:dd}):tr('routing_and_routers.swapping_the_only_router_in_city_d5b5',{city:CITY[city].name,model:RG[g].n}),cost:0});toast(`${tr('routing_and_routers.maintenance_window_in_city',{city:CITY[city].name})}
${sl?tr('routing_and_routers.one_router_and_this_one_takes',{n:dd}):tr('routing_and_routers.one_router_means_downtime_during_the')}`,'bad');} + else toast(tr('routing_and_routers.rolling_upgrade_in_city_n_model',{city:CITY[city].name,n:rt,model:esc(RG[g].n)}),'good'); + floater(CITY[city].x,CITY[city].y-30,RG[g].n+'!','#FF4F9A');after();}, +}); diff --git a/src/game/90-actions/87-fiber-and-hardware.js b/src/game/90-actions/87-fiber-and-hardware.js new file mode 100644 index 0000000..af3a450 --- /dev/null +++ b/src/game/90-actions/87-fiber-and-hardware.js @@ -0,0 +1,37 @@ +Object.assign(ACT,{ + dfMode:({m})=>{UI.lmode=m;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + seaPackage:({k})=>{if(!own(SUB_UPGRADES,k))return;UI['sea'+k]=!UI['sea'+k];if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + subUpgrade:({id,k})=>{const l=S.links.find(l=>l.id===id);if(!l||l.kind!=='df'||!l.own||!l.sub||!own(SUB_UPGRADES,k)||lvl()<4||l['sub'+k]!==undefined)return;if(!spend(subUpgradeCost(l,k)))return;l.paid=(l.paid>0?l.paid:ownCabCost(l.km))+subUpgradeCost(l,k);l['sub'+k]=Math.max(S.day,l.ready||0)+SUB_UPGRADES[k].days;after();}, + seaDesign:({v})=>{if(!own(SEA_DESIGNS,v))return;UI.seaDesign=v;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + ownCab:()=>{UI.lmode='df';UI.dfSrc='cable';UI.seaDesign='standard';UI.seaterminal=UI.seaengineering=false;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + dfSrc:({v})=>{UI.dfSrc=v;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + dfSys:({v})=>{UI.dfSys=v;if(UI.pending)openLinkModal(UI.pending.a,UI.pending.b);}, + orderCable:()=>{const p=UI.pending;if(!p)return;const {a,b}=p;if(ownCabWhy(a,b))return;const design=own(SEA_DESIGNS,UI.seaDesign)?UI.seaDesign:'standard',up={terminal:!!UI.seaterminal,engineering:!!UI.seaengineering},q=seaQuote(a,b,design,up),km=q.km,cost=q.cost+(S.pops[b]?0:popCost(b));if(seaLack(km,up).length||!spend(cost))return; + if(!S.pops[b])S.pops[b]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false,rgen:0}; + const used=new Set(S.links.map(l=>l.cname).filter(Boolean)),cname=OWNCAB_NAMES.find(n=>!used.has(n))||`${pick(OWNCAB_NAMES)} ${used.size+1}`,ship=pick(OWNCAB_SHIPS),id=uid(),days=q.days; + S.links.push({id,a,b,kind:'df',own:true,sub:true,seaDesign:design,seaPath:q.pts.map(p=>p.slice()),sys:'roadm',ch:[],km,cable:null,cname,mo:Math.round(km*OWNCAB_OM),trench:'own:'+id,cut:0,day:S.day,ready:S.day+days,spares:false,pairs:1}); + const laid=S.links[S.links.length-1];laid.paid=q.cost;for(const k of Object.keys(SUB_UPGRADES))if(up[k])laid['sub'+k]=laid.ready;UI.seaDesign='standard';UI.seaterminal=UI.seaengineering=false; + S.stats.ownCab=(S.stats.ownCab||0)+1;UI.dfSrc='lease';closeModal();UI.sel={type:'link',id}; + toast(tr('fiber_and_hardware.the_ship_sets_sail_name_your',{ship,name:cname,km:km.toLocaleString(),a:CITY[a].name,b:CITY[b].name,n:days}),'goal');sfx('build');after();}, + orderDf:()=>{const p=UI.pending;if(!p)return;const {a,b}=p;if(!dfAllowed(a,b))return;const sc=isSub(a,b)?subDfCable(a,b):null,km=sc?sc.km:kmBetween(a,b); + const own=UI.dfSrc==='build'&&lvl()>=3&&!sc,sys=DF_SYS[UI.dfSys]&&DF_SYS[UI.dfSys].lvl<=lvl()?UI.dfSys:'lite';if(lvl()<2)return; + const up=(own?dfBuildCost(km):0)+DF_SYS[sys].cost+ampCount(km)*AMP_COST+(S.pops[b]?0:popCost(b));if(!spend(up))return; + if(!S.pops[b])S.pops[b]={day:S.day,bb:null,boost:0,down:0,routers:1,gen:false,rgen:0}; + const sib=pairLinks(a,b).filter(l=>l.kind!=='vxc'),id=uid(); + const l={id,a,b,kind:'df',own,sys,ch:[],km,sub:!!sc,cable:sc?sc.cid:null,mo:own?Math.round(km*0.15):dfLeaseMo(km),trench:sc?'cab:'+sc.cid:id,cut:0,day:S.day,ready:S.day+(own?dfBuildDays(km):30),spares:false}; + S.links.push(l);closeModal();UI.sel={type:'link',id}; + 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||(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,{km:l.km,regen: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();}, + 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,1)||!portGate(l.b,1))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])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();}, + buySpare:({o})=>{if(!OPT[o]||OPT[o].lvl>lvl()||spareN(o)>=64)return;if(!spend(optCost(o)))return;S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)+1;sfx('build');after();}, + sellSpare:({o})=>{if(!OPT[o]||spareN(o)<1)return;S.spares[o]--;const v=spareValue(o);S.cash+=v;toast(tr('fiber_and_hardware.sold_a_spare_optic_on_ebuy',{optic:OPT[o].n,price:fmt$(v),p:pct(SPARE_RESALE)}),'good');sfx('coin');after();}, + addPair:({id})=>{const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||!l.own||!isRdm(l.sys)||l.ready>S.day)return;const n=Math.max(1,l.pairs|0);if(n>=pairsMax(l))return;if((l.ch||[]).length+soldSlots(l){const l=S.links.find(x=>x.id===id),to=l&&sysNext(l);if(!to||DF_SYS[to].lvl>lvl())return;if(!spend(sysUpCost(l)))return;l.sys=to;if(l.ready<=S.day){l.eqDown=S.day+1;toast(tr('fiber_and_hardware.line_system_swap_all_channels_are'),'bad');}after();}, + spares:({id})=>{const l=S.links.find(x=>x.id===id);if(!l)return;l.spares=!l.spares;sfx('click');after();}, + crews:({id,all})=>{const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||!l.own||l.ready<=S.day+1)return;const n=all?crewSteps(l):1,c=n*crewCost(l);if(!spend(c))return;const ready=Math.max(S.day+1,l.ready-30*n),saved=l.ready-ready;setCableReady(l,ready);toast(trn('fiber_and_hardware.more_crews_on_site_construction_is',saved,{n:saved}),'good');after();}, + addGen:({city})=>{const p=S.pops[city];if(!p||p.gen)return;if(!spend(GEN_COST))return;p.gen=true;floater(CITY[city].x,CITY[city].y-30,tr('common.generator'),'#FF8A3D');after();}, +}); diff --git a/src/game/90-actions/89-game-and-settings.js b/src/game/90-actions/89-game-and-settings.js new file mode 100644 index 0000000..ed9a284 --- /dev/null +++ b/src/game/90-actions/89-game-and-settings.js @@ -0,0 +1,37 @@ +Object.assign(ACT,{ + randomName:()=>{const input=$('nmIn');if(input)input.value=UI.nm=randomNetworkName(input.value);}, + start:()=>{const nm=(($('nmIn')&&$('nmIn').value)||randomNetworkName()).slice(0,24);beginGame(nm,UI.startCity,{mode:UI.mode==='sandbox'?'sandbox':'normal'});}, + modeSet:({m})=>{UI.mode=m;document.querySelectorAll('.modeb').forEach(b=>b.classList.toggle('pink',b.dataset.m===m));document.querySelectorAll('.modeb').forEach(b=>b.classList.toggle('ghost',b.dataset.m!==m));}, + scenarios:()=>{UI.nm=(($('nmIn')&&$('nmIn').value)||UI.nm||(S&&S.name)||randomNetworkName()).slice(0,24);scenarioModal();}, + startScn:({id,sure})=>{const sc=SCN.find(x=>x.id===id);if(!sc)return;if(!sure&&S&&UI.started&&!S.lost&&!(S.scn&&(S.scn.done||S.scn.failed))){openModal(`

${tr('game_and_settings.start_name',{name:esc(sc.n)})}

${tr('game_and_settings.name_will_be_replaced_export_it',{name:esc(S.name)})}

${btn(tr('game_and_settings.start_the_scenario'),'startScn',{id,sure:1},'pink big')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost big')}
`);return;}beginGame(UI.nm||(S&&S.name)||randomNetworkName(),sc.city,{scn:sc});}, + startWeekly:({sure}={})=>{if(!sure&&S&&UI.started&&!S.lost&&!(S.scn&&(S.scn.done||S.scn.failed))){openModal(`

${tr('game_and_settings.start_the_weekly_challenge')}

${tr('game_and_settings.name_will_be_replaced_export_it',{name:esc(S.name)})}

${btn(tr('game_and_settings.start_the_challenge'),'startWeekly',{sure:1},'pink big')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost big')}
`);return;}const wk=weekly();beginGame(UI.nm||(S&&S.name)||randomNetworkName(),wk.city,{scn:wk,seed:wk.seed});}, + pickStart:({city})=>{UI.startCity=city;document.querySelectorAll('.start').forEach(b=>b.classList.toggle('on',b.dataset.city===city));}, + cont:()=>{migrate(S);track('game_continue',true);UI.started=true;closeModal();renderAll();}, + newgame:()=>{try{localStorage.removeItem('sot-save-v1');}catch(e){}S=null;UI.started=false;UI.sel=null;UI.nm=null;$('dash').hidden=true;$('bankBox').hidden=true;renderAll();showTitle();}, + keepPlaying:()=>{closeModal();}, + exportSave:()=>exportSave(), + importPick:()=>{let f=$('importIn');if(!f){f=document.createElement('input');f.type='file';f.accept='.json,application/json';f.id='importIn';f.hidden=true;document.body.appendChild(f);f.addEventListener('change',()=>{importFile(f.files[0]);f.value='';});}f.click();}, + importGo:()=>{const s0=UI.importing;if(!s0)return;UI.importing=null;const prev=S;try{S=migrate(JSON.parse(JSON.stringify(s0)));compute();checkGoals();renderAll();}catch(e){S=prev;if(S)compute();renderAll();toast(tr('game_and_settings.import_failed_that_save_is_damaged'),'bad');sfx('err');return;}UI.confirm=null;$('bankBox').hidden=true;$('dash').hidden=true;UI.started=true;UI.sel=null;UI.speed=S.uiSpeed===undefined?1:S.uiSpeed;if(S.cam&&isFinite(S.cam.x))Object.assign(cam,S.cam);else{const h=CITY[S.home];if(h){cam.x=h.x;cam.y=h.y;}}closeModal();$('modal').hidden=true;compute();renderAll();save();toast(tr('game_and_settings.welcome_back_name_imported_and_saved',{name:esc(S.name)}),'good');sfx('coin');track('game_import');}, + menu:()=>{if(!S||!UI.started){showTitle();return;}openModal(`
AS${S.asn} · ${esc(dateStr(S.day))} · ${tierLabel()}

${esc(S.name)}

+

${tr('game_and_settings.your_game_saves_itself_every_few')}

${isPhone()?installRow():''} + ${chatHtml()}`);}, + settings:()=>{UI.setOpen=true;openModal(settingsHtml());}, + settingsClose:()=>{UI.setOpen=false;if(!S||!UI.started)showTitle();else closeModal();}, + prefSet:({v})=>{const [k,b]=String(v).split(':');if(!own(PREF_DEF,k))return;setPref(k,b==='1');sfx('click');refreshSettings();}, + vpSet:({v})=>{vpOn(v==='on');refreshSettings();}, + resetAsk:()=>openModal(`

${tr('game_and_settings.start_a_new_network')}

${tr('game_and_settings.name_and_everything_it_owns_will',{name:esc(S?S.name:tr('common.your_network'))})}

${btn(tr('game_and_settings.delete_and_start_over'),'newgame',{},'red big')}${btn(tr('common.keep_playing'),'closeModal',{},'ghost big')}
`), + whatsNewShow:()=>whatsNew(true,true), + updateNow:()=>{save();location.reload();}, + updateLater:()=>{$('update').hidden=true;UI.updLater=Date.now();}, + helpClose:()=>{if(UI.started)closeModal();else showTitle();}, +}); diff --git a/src/game/90-actions/90-action-helpers.js b/src/game/90-actions/90-action-helpers.js new file mode 100644 index 0000000..67c8055 --- /dev/null +++ b/src/game/90-actions/90-action-helpers.js @@ -0,0 +1,27 @@ +// Overland routes already dug between two cities, in the order they were built (#77). The first is the +// main route; every other one was a diverse route and keeps that price when you add waves to it. +function landTrenches(a,b){const out=[];for(const l of pairLinks(a,b)){if(l.kind==='vxc'||l.cable||l.sub)continue;const k=l.trench||l.id;let t=out.find(x=>x.k===k);if(!t)out.push(t={k,n:0,caps:[]});t.n++;t.caps.push(capName(l));}return out;} +// Which route a new wave joins: null = a new diverse route. 'same' is the old two-way choice (the main route). +function routeJoin(a,b){const ts=landTrenches(a,b),r=UI.route||'';if(r==='same')return ts[0]||null;if(r.startsWith('t:'))return ts.find(t=>t.k===r.slice(2))||null;return null;} +function pairLinks(a,b){return S.links.filter(l=>(l.a===a&&l.b===b)||(l.a===b&&l.b===a));} +// Short, busy subsea routes (London–Amsterdam, London–Paris) sell dark fiber pairs too. +function subDfCable(a,b){return cablesOk(a,b).filter(c=>CAB[c.cid].df).sort((x,y)=>x.km-y.km)[0]||null;} +function dfAllowed(a,b){if(isSub(a,b))return !!subDfCable(a,b);return cnCity(a)===cnCity(b)&&!uaePair(a,b)&&!landX(a,b);} +/* Optics you unplug go on a spares shelf instead of in the bin (#45): the next channel of that type uses a spare + for free (only the regen sites' transponders are new), or you sell it on eBuy for part of the price. */ +const SPARE_RESALE=0.4,spareN=o=>(S&&S.spares&&S.spares[o])|0,spareValue=o=>Math.round(optCost(o)*SPARE_RESALE); +function chCost(l,o){const r=REGEN_CH*(l.regen|0);return Math.round(optCost(o)*(spareN(o)>0?r:1+r));} +function optCost(o){return Math.round(OPT[o].cost*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?DF_SYS[t].cost*(t==='cl'&&l.own?Math.max(1,l.pairs|0):1):0;}; +function pairBtn(l){if(!l.own||!isRdm(l.sys)||l.ready>S.day)return '';const n=Math.max(1,l.pairs|0);if(n>=pairsMax(l))return `${tr('action_helpers.n_fiber_pairs_lit_the_trench',{n})}`; + const full=(l.ch||[]).length+soldSlots(l)>=chMax(l),c=pairCost(l);return btn(l.sub?tr('action_helpers.light_fiber_pair_n_price',{n:n+1,price:fmt$(c)}):tr('action_helpers.light_fiber_pair_n_price_mo',{n:n+1,price:fmt$(c),mo:fmt$(ampCount(l.km)*AMP_MO)}),'addPair',{id:l.id},full?'pink sm':'ghost sm',!full||S.cashlvl())return tr('action_helpers.unlocks_at_customer_level_n',{n:O.lvl});if(O.sys==='roadm'&&!isRdm(l.sys))return tr('action_helpers.needs_a_roadmaster_9000_line_system');if(!optMode(o,l)){const mx=optModes(o,l).at(-1)[1];if(l.sub&&l.own)return tr('action_helpers.this_channel_reaches_max_km_on',{max:mx.toLocaleString(),span:spanKm(l).toLocaleString()});return tr('action_helpers.too_far_even_at_its_slowest',{span:spanKm(l).toLocaleString(),max:mx.toLocaleString()});} + if((l.ch||[]).length+soldSlots(l)>=chMax(l))return soldSlots(l)?tr('action_helpers.sys_is_full_max_channels_sold',{sys:DF_SYS[l.sys].n,max:chMax(l),sold:soldSlots(l)}):tr('action_helpers.sys_is_full_max_channels',{sys:DF_SYS[l.sys].n,max:chMax(l)}); + for(const c of [l.a,l.b]){const p=S.pops[c];if(p&&RG[p.rgen||0].clsinnerWidth>760&&innerWidth<=1200; +function selectLink(id){UI.sel={type:'link',id};UI.confirm=null;if(isTablet()||isPhone())UI.leftOpen=false;$('panel').classList.remove('full');renderPanel();renderLeft();} +function selectCity(c){UI.sel={type:'city',id:c};UI.confirm=null;if(isTablet()||isPhone())UI.leftOpen=false;const P=$('panel');if(P)P.classList.remove('full');if(!S.pops[c])UI.tab='cust';renderPanel();} + diff --git a/src/game/91-save.js b/src/game/91-save.js new file mode 100644 index 0000000..e80a76c --- /dev/null +++ b/src/game/91-save.js @@ -0,0 +1,23 @@ +/* ================= SAVE ================= */ +function save(){if(!S||S.lost)return;S.uiSpeed=UI.speed;S.cam={x:cam.x,y:cam.y,z:cam.z};try{localStorage.setItem('sot-save-v1',JSON.stringify(S));}catch(e){}UI.lastSave=performance.now();} +// Save whenever the player might be leaving: tab hidden, page closing or reloading. +addEventListener('pagehide',()=>save()); +document.addEventListener('visibilitychange',()=>{if(document.visibilityState==='hidden')save();else checkUpdate();}); +/* Export / import: move a network to another device or keep a backup. The file is the same + object the autosave writes, wrapped with a little metadata. */ +function saveFileName(){const d=new Date().toISOString().slice(0,10),n=(S&&S.name||'network').toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'')||'network';return `series-of-tubes-${n}-${d}.json`;} +function exportSave(){if(!S)return;save();const blob=new Blob([JSON.stringify({app:'series-of-tubes',version:APP_VERSION,exported:new Date().toISOString(),S},null,1)],{type:'application/json'}); + const a=document.createElement('a');a.href=URL.createObjectURL(blob);a.download=saveFileName();document.body.appendChild(a);a.click();setTimeout(()=>{URL.revokeObjectURL(a.href);a.remove();},1000); + toast(tr('save.save_exported_file_is_in_your',{file:esc(saveFileName())}),'good');} +function parseSave(txt){if(typeof txt!=='string')return {err:tr('save.that_file_is_not_valid_json')};let j;try{j=JSON.parse(txt);}catch(e){return {err:tr('save.that_file_is_not_valid_json')};} + const s=j&&j.app==='series-of-tubes'&&j.S?j.S:j; + if(!s||typeof s!=='object'||s.v!==1||typeof s.day!=='number'||typeof s.cash!=='number'||!s.pops||typeof s.pops!=='object'||!Array.isArray(s.links))return {err:tr('save.that_does_not_look_like_a')}; + if(s.lost)return {err:tr('save.that_network_went_bankrupt_it_cannot')}; + for(const c of Object.keys(s.pops))if(!isCity(c))return {err:tr('save.that_save_has_a_pop_in',{city:esc(String(c).slice(0,12))})}; + return {s,ver:j.version||'?',name:String(s.name||tr('common.unnamed_network'))};} +function importFile(file){if(!file)return;if(file.size>8e6){toast(tr('save.that_file_is_too_big_to'),'bad');return;} + const rd=new FileReader();rd.onload=()=>{const r=parseSave(String(rd.result));if(r.err){toast(tr('save.import_failed_err',{err:esc(r.err)}),'bad');sfx('err');return;} + UI.importing=r.s;openModal(`
${tr('common.import_a_save')}

${tr('save.load_name',{name:esc(r.name)})}

${esc(dateStr(r.s.day))} · ${tr('save.cash_in_the_bank',{cash:fmt$(r.s.cash)})} · ${trn('save.n_pop',Object.keys(r.s.pops).length)} · ${tr('save.saved_by_v_ver',{ver:esc(r.ver)})}

${S&&UI.started&&!S.lost?`

${tr('save.this_replaces_name_export_it_first',{name:esc(S.name)})}

`:''}
${btn(tr('save.load_this_network'),'importGo',{},'pink big')}${btn(tr('common.cancel'),UI.started?'closeModal':'helpClose',{},'ghost big')}
`);}; + rd.readAsText(file);} +function loadSave(){try{const t=localStorage.getItem('sot-save-v1');if(t){const s=JSON.parse(t);if(s&&s.v===1&&!s.lost)return s;}}catch(e){}return null;} + diff --git a/src/game/92-audio.js b/src/game/92-audio.js new file mode 100644 index 0000000..117eee5 --- /dev/null +++ b/src/game/92-audio.js @@ -0,0 +1,12 @@ +/* ================= AUDIO ================= */ +let AC=null; +function audioInit(){if(AC)return;try{AC=new (window.AudioContext||window.webkitAudioContext)();}catch(e){}} +function tone(f,t0,dur,type='square',vol=.05){if(!AC)return;const o=AC.createOscillator(),g=AC.createGain();o.type=type;o.frequency.value=f;g.gain.setValueAtTime(vol,AC.currentTime+t0);g.gain.exponentialRampToValueAtTime(.0001,AC.currentTime+t0+dur);o.connect(g).connect(AC.destination);o.start(AC.currentTime+t0);o.stop(AC.currentTime+t0+dur+.02);} +function sfx(k){if(UI.muted||!AC)return;try{ + if(k==='coin'){tone(988,0,.08);tone(1319,.08,.18);} + else if(k==='build'){tone(523,0,.07,'triangle',.08);tone(784,.06,.12,'triangle',.08);} + else if(k==='err'){tone(180,0,.18,'sawtooth',.04);} + else if(k==='alert'){tone(880,0,.1,'square',.04);tone(660,.12,.1,'square',.04);tone(880,.24,.12,'square',.04);} + else if(k==='click'){tone(660,0,.04,'triangle',.05);} +}catch(e){}} + diff --git a/src/game/93-ui/10-dom.js b/src/game/93-ui/10-dom.js new file mode 100644 index 0000000..c800be6 --- /dev/null +++ b/src/game/93-ui/10-dom.js @@ -0,0 +1,27 @@ +/* ================= DOM RENDER ================= */ +const $=id=>document.getElementById(id); +const btn=(label,act,args={},cls='',dis=false,title='')=>``; +const logo=n=>``; +const barCls=u=>u>=0.9?'bad':u>=0.65?'warn':''; +/* Panels are rebuilt from state every tick. Replacing a thousand rows makes the browser style and lay out every one + of them again, so patch what changed instead: same HTML, far less work. A button that now does something else, and + any form field that changed, is swapped out whole, so a tap that started on the old one still cannot fire it (#44). */ +const SWAP={INPUT:1,SELECT:1,TEXTAREA:1,OPTION:1}; +function morph(el,html){const t=document.createElement(el.tagName);t.innerHTML=html;morphKids(el,t);} +function sameNode(x,y){if(x.nodeType!==y.nodeType||x.nodeName!==y.nodeName)return false;if(x.nodeType!==1)return true; + if(SWAP[x.nodeName])return x.outerHTML===y.outerHTML; + return x.getAttribute('data-act')===y.getAttribute('data-act')&&x.getAttribute('data-args')===y.getAttribute('data-args');} +function morphKids(a,b){let x=a.firstChild,y=b.firstChild; + while(y){const ny=y.nextSibling; + if(!x)a.appendChild(y); + else if(!sameNode(x,y)){a.replaceChild(y,x);x=y;} + else if(x.nodeType===1){if(!SWAP[x.nodeName]){const ya=y.attributes,xa=x.attributes; + for(let i=0;i=0;i--)if(!y.hasAttribute(xa[i].name))x.removeAttribute(xa[i].name); + morphKids(x,y);}} + else if(x.nodeValue!==y.nodeValue)x.nodeValue=y.nodeValue; + x=x&&x.nextSibling;y=ny;} + while(x){const nx=x.nextSibling;a.removeChild(x);x=nx;}} +function renderAll(){if(isTablet()&&!UI.sel)UI.leftOpen=false;renderHUD();renderLeft();renderPanel();renderHint();renderMega();renderCoach();} +function renderMega(){const el=$('mega');if(!el)return;const on=!!(S&&S.ev&&S.ev.php>S.day);if(el.hidden===!on)return;el.hidden=!on;} + diff --git a/src/game/93-ui/20-phone.js b/src/game/93-ui/20-phone.js new file mode 100644 index 0000000..3f601ca --- /dev/null +++ b/src/game/93-ui/20-phone.js @@ -0,0 +1,23 @@ +/* ================= PHONE ================= */ +const isPhone=()=>innerWidth<=760||(innerHeight<=500&&matchMedia('(pointer:coarse)').matches); +const SPEEDS=[0.5,1,2,4,8]; +function renderTabbar(){const tb=$('tabbar');if(!tb||(pressing&&UI.ticking))return;if(!isPhone()||!S||!UI.started){tb.hidden=true;document.body.classList.remove('sheet-open');return;}tb.hidden=false; + const open=UI.leftOpen&&!UI.sel,cur=UI.left||'goals',ndone=GOALS.filter(g=>S.done[g.id]!==undefined).length; + const tab=(k,ic,l,cnt,red)=>``; + const h=``+ + ``+ + (()=>{const P=scnProg();return tab('goals','🎯',tr('common.goals'),P&&!S.scn.done&&!S.scn.failed?`${Math.round(P.f*100)}%`:`${ndone}/${GOALS.length}`);})()+(()=>{const u=custStats().unhappy;return u?tab('deals','💼',tr('common.deals'),u,true):tab('deals','💼',tr('common.deals'),S.offers.length||'');})()+tab('noc','🚨','NOC',S.inc.length||(UI.left==='noc'&&UI.leftOpen?'':logUnread())||'',S.inc.length>0)+tab('nets','🌐',tr('common.networks'),ibxOpen()||'',ibxUrgent()>0); + if(h!==UI._tb){UI._tb=h;tb.innerHTML=h;} + document.body.classList.toggle('sheet-open',!!(UI.sel||UI.leftOpen));} +function haptic(ms){if(UI.muted)return;try{navigator.vibrate&&navigator.vibrate(ms||12);}catch(e){}} +// Bottom sheets: drag the handle up to expand, down to shrink or close; tap it to toggle. +(function(){let g=null; + document.addEventListener('pointerdown',e=>{const h=e.target.closest('[data-grab]');if(!h||!isPhone())return;const el=h.parentElement;g={el,y:e.clientY,dy:0,id:e.pointerId,full:el.classList.contains('full')};try{h.setPointerCapture(e.pointerId);}catch(_){}el.style.transition='none';}); + document.addEventListener('pointermove',e=>{if(!g||e.pointerId!==g.id)return;g.dy=e.clientY-g.y;if(g.dy>0)g.el.style.transform=`translateY(${g.dy}px)`;}); + const end=e=>{if(!g||e.pointerId!==g.id)return;const {el,dy,full}=g;g=null;el.style.transition='';el.style.transform=''; + if(Math.abs(dy)<6){el.classList.toggle('full');return;} + if(dy<-40){el.classList.add('full');return;} + if(dy>40){if(full){el.classList.remove('full');return;}if(el.id==='panel')ACT.closePanel();else{UI.leftOpen=false;renderLeft();}}}; + document.addEventListener('pointerup',end);document.addEventListener('pointercancel',end);})(); +// Toasts can be tapped away on touch screens. +document.addEventListener('click',e=>{const t=e.target.closest('.toast');if(t&&!e.target.closest('[data-act]')&&isPhone())t.remove();}); diff --git a/src/game/93-ui/30-install.js b/src/game/93-ui/30-install.js new file mode 100644 index 0000000..73e0c71 --- /dev/null +++ b/src/game/93-ui/30-install.js @@ -0,0 +1,23 @@ +/* ================= INSTALL (PWA) ================= */ +let installEvt=null; +addEventListener('beforeinstallprompt',e=>{e.preventDefault();installEvt=e;}); +addEventListener('appinstalled',()=>{installEvt=null;track('pwa_installed',true);if(UI.pendGame){const p=UI.pendGame;UI.pendGame=null;UI.pitched=true;beginGame(...p);}toast(tr('install.installed_open_series_of_tubes_from'),'good');}); +const isStandalone=()=>{try{return navigator.standalone===true||!!(window.matchMedia&&matchMedia('(display-mode: standalone)').matches);}catch(e){return false;}}; +const isIOS=()=>/iPad|iPhone|iPod/.test(navigator.userAgent)||(navigator.platform==='MacIntel'&&navigator.maxTouchPoints>1); +function installRow(){if(isStandalone())return ''; + return `
📲 ${tr('install.best_played_as_an_app')}
${tr('install.full_screen_works_offline_one_tap')}${isIOS()?' '+tr('install.install_it_before_you_start_a'):''}
${btn(tr('common.install'),'install',{},'pink sm')}
`;} +/* Phones get a real pitch before a new game: an installed app is full screen, works offline, and on iPhone + keeps its save away from Safari's clean-ups. Storage is separate on iOS, so installing first matters. */ +const SHARE_SVG=''; +const needPitch=()=>isPhone()&&!isStandalone(); +function installSteps(){ + if(isIOS())return `
  1. ${tr('install.tap_share_icon_in_the_browser',{icon:SHARE_SVG})}
  2. ${tr('install.tap_add_to_home_screen_you')}
  3. ${tr('install.open_series_of_tubes_from_your')}
`; + if(installEvt)return ''; + return `
  1. ${tr('install.open_your_browser_menu')}
  2. ${tr('install.tap_install_app_or_add_to')}
  3. ${tr('install.open_series_of_tubes_from_your_e03f')}
`;} +function pitchHtml(starting){const ios=isIOS(); + return `
${starting?`
${tr('install.before_you_start')}
`:''}

📲 ${tr('install.play_it_as_an_app')}

+

${tr('install.series_of_tubes_is_made_for')}

+
  • 🗺️ ${tr('common.full_screen')} ${tr('install.no_browser_bars_a_lot_more')}
  • 📶 ${tr('common.works_offline')} ${tr('install.build_your_backbone_on_the_train')}
  • ${ios?`
  • 💾 ${tr('install.your_save_stays_safe')} ${tr('install.safari_can_clear_the_data_of')}
  • ⚠️ ${tr('common.install_first')} ${tr('install.on_iphone_a_game_started_in')}
  • `:`
  • ⚡ ${tr('install.one_tap_away')} ${tr('install.it_opens_straight_into_your_network')}
  • `}
+ ${installSteps()} +
${installEvt?btn(tr('install.install_the_app'),'install',{},'pink big'):''}${starting?btn(tr('install.play_in_the_browser_anyway'),'pitchSkip',{},installEvt?'ghost':'ghost big'):btn(tr('common.got_it'),'closeModal',{},installEvt?'ghost':'pink')}
`;} +if('serviceWorker' in navigator&&location.protocol==='https:'&&!IS_DEV)addEventListener('load',()=>{navigator.serviceWorker.register('/sw.js').catch(()=>{});}); diff --git a/src/game/93-ui/40-hud-and-panels.js b/src/game/93-ui/40-hud-and-panels.js new file mode 100644 index 0000000..e2c78a2 --- /dev/null +++ b/src/game/93-ui/40-hud-and-panels.js @@ -0,0 +1,91 @@ +function fitHud(){const h=$('hud');if(!h)return;h.classList.remove('fit1','fit2','fit3');if(innerWidth<=760)return; + const row=()=>{let m=0;for(const c of h.children)if(c.offsetParent)m=Math.max(m,c.offsetHeight);return m;}; + for(const c of ['fit1','fit2','fit3']){if(h.offsetHeight<=row()*1.5)break;h.classList.add(c);}} +function renderHUD(){ + for(const v of [0,0.5,1,2,4,8]){const b=$('sp'+v);if(b)b.classList.toggle('on',UI.speed===v);} + $('muteBtn').style.opacity=UI.muted?.4:1; + if(!S)return; + $('hName').textContent=S.name;$('hAsn').textContent='AS'+S.asn+(S.mode==='sandbox'?' · '+tr('common.sandbox'):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)':''; + const net=R.revMo-R.costMo;$('hRate').innerHTML=`${net>=0?'▲':'▼'} ${tr('common.price_mo',{price:fmt$(Math.abs(net))})}`; + $('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)'; + $('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); + {const bo=(S.loanOffers||[]).length,hb=$('hBank');hb.hidden=!bo;hb.textContent=bo;} + {const st=custStats(),hc=$('hCust');hc.hidden=!st.n;if(st.n){$('hCustVal').innerHTML=`${st.avg>=80?'😀':st.avg>=60?'🙂':st.avg>=30?'😟':'😡'} ${Math.round(st.avg)}%${st.unhappy?` ${st.unhappy}`:''}`;hc.classList.toggle('hot',st.furious>0);}} + const n=S.inc.length;$('hNoc').classList.toggle('hot',n>0);{const u=UI.left==='noc'&&UI.leftOpen?0:logUnread(),b=$('hNocNew');if(b){b.hidden=!u;b.textContent=u>99?'99+':String(u);b.title=trn('hud_and_panels.n_new_notification',u);}}$('hNocVal').textContent=n?trn('hud_and_panels.n_incident',n):tr('common.all_quiet'); + if(!window.__TUBES_TEST__)fitHud(); + renderTabbar(); +} +function renderLeft(){checkLayer(); + // Tablets in landscape: both side panels don't fit next to the map, so the left one tucks away + // while a city or link is open and comes back with the toggle button. + const tab=isTablet(),L=$('left');L.classList.toggle('closed',tab?(!!UI.sel&&!UI.leftOpen):!UI.leftOpen);const tg=$('leftToggle');if(tg&&innerWidth>760)tg.hidden=!(tab&&L.classList.contains('closed')); + renderTabbar(); + if(!S){L.hidden=true;return;}L.hidden=false; + const ndone=GOALS.filter(g=>S.done[g.id]!==undefined).length; + const tabs=[['goals',`${tr('common.goals')}${ndone}/${GOALS.length}`],['deals',`${tr('common.deals')}${S.offers.length?`${S.offers.length}`:''}`],['noc',`NOC${S.inc.length?`${S.inc.length}`:''}`],['nets',`${tr('common.networks')}${ibxOpen()?`${ibxOpen()}`:''}`]]; + $('leftTabs').innerHTML=tabs.map(([k,l])=>``).join('')+(innerWidth<760?``:''); + let h=''; + if(UI.left==='goals'){ + h+=scnCard()+lvlCard()+t1Card(); + const cur=GOALS.find(g=>S.done[g.id]===undefined); + h+=GOALS.map(g=>{const d=S.done[g.id]!==undefined,c=g===cur;return `
${d?'✓':''}
${esc(g.t)}
${c||!d?`
${esc(g.d)}
`:''}${!d&&g.r?`
${tr('hud_and_panels.reward_cash',{cash:fmt$(g.r)})}
`:''}
`;}).join(''); + h+=badgeGrid(); + }else if(UI.left==='deals'){ + {const st=custStats();if(st.n)h+=`
${tr('common.your_customers')} ${st.n} · ${tr('hud_and_panels.happiness_p',{p:Math.round(st.avg)})}
${st.unhappy?`
${trn('hud_and_panels.n_unhappy_customer_price_mo_at',st.unhappy,{price:fmt$(st.risk)})}
`:''}
${btn(st.unhappy?tr('common.see_who'):tr('common.all_customers'),'custOpen',{sad:st.unhappy?1:0},st.unhappy?'pink sm':'ghost sm')}
`;} + h+=confSection(); + {const lv=S.lvl||1,nx=LEVELS[lv];h+=`
${tr('hud_and_panels.customer_level_lv_name',{lv,name:LEVELS[lv-1].n})}
${nx?tr('hud_and_panels.next_req_unlocks_what',{req:nx.req,what:lc1(nx.unlock)}):tr('common.every_customer_type_is_unlocked_go')}
`;} + if(!S.offers.length)h+=`

${tr('hud_and_panels.no_open_offers_right_now_businesses')}

`; + for(const o of S.offers.slice().sort((a,b)=>a.exp-b.exp)){const has=bHas(o); + h+=`
${esc(o.name)}
${esc(BIZ_T[o.type].l)} · ${CITY[o.city].name}${o.city2?' ⇄ '+CITY[o.city2].name:''} · ${bTerms(o)} · ${tr('ui.n_d_left',{n:o.exp-S.day})}${(o.reqs||[]).length?` · ${trn('hud_and_panels.n_special_requirement',o.reqs.length)}`:''}
${bRisk(o)}${reqList(o)} +
${has?btn(tr('common.accept'),'accept',{id:o.id},'green sm'):btn(tr('common.go_there'),'focusCity',{city:bCities(o).find(c=>!S.pops[c])},'ghost sm')}${btn(tr('common.decline'),'decline',{id:o.id},'ghost sm')}
${has?'':`
${tr('hud_and_panels.needs_a_pop_in_cities',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}
`}
`;} + }else if(UI.left==='noc'){ + h+=`
${btn(tr('hud_and_panels.open_noc_dashboard'),'dash',{},'pink')}${btn(tr('common.connections'),'connOpen',{},'')}${btn(tr('common.traceroute'),'trace',{},'')}
`; + h+=`

${tr('hud_and_panels.your_network_operations_center_every')}

`; + // Incidents come first, the ones you can fix with one click at the top (#63): no scrolling past hot ports to replace an optic. + for(const i of S.inc.filter(i=>i.type!=='ddos').sort((a,b)=>(b.cost?1:0)-(a.cost?1:0)||(b.impact||0)-(a.impact||0))){h+=`
${incTitle(i.type)}
${esc(i.msg)}
${trn('hud_and_panels.auto_fix_in_n_day',i.until-S.day)}${i.impact?` · ${tr('hud_and_panels.g_lost',{g:fmtG(i.impact)})}`:''}
${i.cost?`
${btn(`${esc(i.fix||tr('common.rush_repair'))} ${fmt$(i.cost)}`,'fixInc',{id:i.id},'red sm',S.cash`:''}
`;} + h+=logSection();UI.logSeen=Date.now(); + h+=`
${tr('common.ddos_scrubbing')}${hasScrub()?tr('hud_and_panels.on_city',{city:S.scrubs.map(x=>CITY[x.city].name).join(', ')}):tr('hud_and_panels.none_build_one_from_a_pop')}
`; + {const pops=Object.keys(S.pops),nfs=pops.filter(c=>fsAt(c)).length; + h+=`
${tr('hud_and_panels.flowspec_capable_pops')}${nfs}/${pops.length}
`; + if(nfs${tr('hud_and_panels.flowspec_drop_rules_live_in_router')}

`;} + if(S.grace&&S.grace.until>S.day&&R.graceNets)h+=`
${tr('common.courtesy_route')}${tr('hud_and_panels.n_networks_d_days_left',{n:R.graceNets,d:S.grace.until-S.day})}

${tr('hud_and_panels.reaches_networks_from_the_last')}

`; + h+=ddosPanel(); + h+=S.te?`
Auto-TE${S.te.on?tr('hud_and_panels.on_moving_g_onto_alternate_paths',{g:fmtG(R.teMoved||0)}):tr('common.off')}
${btn(S.te.on?tr('hud_and_panels.turn_auto_te_off'):tr('hud_and_panels.turn_auto_te_on'),'teToggle',{},'ghost sm')}${btn(S.te.script?tr('common.edit_routescript'):tr('hud_and_panels.write_a_routescript'),'teEdit',{},'pink sm')}
${S.te.script?`

RouteScript: ${teRules()?tr('hud_and_panels.n_rules_live',{n:teRules().n}):S.te.on?tr('hud_and_panels.has_errors_not_running'):tr('common.controller_off')}${R.teBlack?` · ${tr('hud_and_panels.blackholing_g',{g:fmtG(R.teBlack)})}`:''}

`:''}` + :`
Auto-TE${lvl()<3?tr('hud_and_panels.unlocks_at_customer_level_3'):tr('common.not_installed')}

${tr('hud_and_panels.traffic_takes_the_shortest_path_even')}

${btn(tr('hud_and_panels.install_auto_te_cost_mo_mo',{cost:fmt$(TE_COST),mo:fmt$(TE_MO)}),'buyTE',{},'pink sm',lvl()<3||S.cash`; + const hot=S.links.filter(l=>!linkDown(l)&&capOf(l)>0&&(R.load[l.id]||0)/capOf(l)>=0.85).sort((a,b)=>(R.load[b.id]/capOf(b))-(R.load[a.id]/capOf(a))); + if(hot.length){h+=`

${tr('common.congested_links')}

${S.te&&S.te.on?'':'

'+tr('hud_and_panels.raise_a_full_link_s_metric')+'

'}`+hot.map(l=>`
${CITY[l.a].name} ⇄ ${CITY[l.b].name}
${capName(l)} · ${tr('hud_and_panels.p_full',{p:pct((R.load[l.id]||0)/capOf(l))})}
${btn(tr('common.inspect'),'selLink',{id:l.id},'pink sm')}
`).join('');} + h+=hwCard(); + const slow=Object.keys(S.pops).filter(latSlow).sort((a,b)=>R.latF[a]-R.latF[b]); + if(slow.length)h+=`

🐢 ${tr('common.slow_cities')}

${tr('hud_and_panels.their_users_go_out_through_transit')}

`+slow.map(c=>{const f=R.latFar[c];return `
${CITY[c].name} → ${CITY[f.to].name}
${tr('hud_and_panels.p_of_its_traffic_ms_ms',{p:pct(Math.min(1,f.share)),ms:Math.round(f.ms),sf:pct(R.latF[c])})}
${btn(tr('common.inspect'),'focusCity',{city:c},'ghost sm')}
`;}).join(''); + const hotR=hotPorts(); + if(hotR.length)h+=`

${tr('hud_and_panels.ports_caches_and_routers_running_hot')}

`+hotR.map(x=>`
${HOTL[x.k]}
${CITY[x.city].name} · ${esc(x.lab)}
${tr('hud_and_panels.p_full',{p:pct(Math.min(1,x.u))})}${x.u>=0.995?' · '+tr('hud_and_panels.dropping_or_overflowing'):''} · ${esc(x.tip)}
${btn(tr('common.inspect'),'focusCity',{city:x.city},'pink sm')}
`).join(''); + if(!S.inc.length&&!hot.length&&!hotR.length&&!slow.length)h+=`

${tr('hud_and_panels.all_systems_green_enjoy_it_while')}

`; + h+=`
${tr('hud_and_panels.incidents_so_far')}${S.stats.incidents}
${tr('hud_and_panels.survived_with_no_impact')}${S.stats.survived}
`; + }else{ + if(Object.keys(S.ixp).length||ibxOpen()||(S.inbox&&S.inbox.bot)){const n=ibxOpen(),u=ibxUrgent();h+=`
📬 ${tr('common.peering_inbox')} ${n?`${n}`:''}
${S.inbox&&S.inbox.bot?tr('hud_and_panels.large_peering_model_is_on_it'):u?trn('hud_and_panels.n_session_is_down_on_its',u):n?trn('hud_and_panels.n_message_waiting_for_an_answer',n):tr('common.inbox_zero')}
${btn(tr('common.open_inbox'),'inbox',{},'sm')}
`;} + h+=`

${tr('hud_and_panels.every_network_on_the_map_traffic')}

`; + {const nc=conns().length;if(nc)h+=`
${btn(tr('hud_and_panels.all_connections_n',{n:nc}),'connOpen',{},'pink sm')}
`;} + const where=netWhereIdx(),tl=NETS.filter(n=>n.tail),tlOn=tl.filter(n=>where(n.id).some(x=>x[2]==='ix')).length; + const foc=UI.netFocus&&NET[UI.netFocus]?NET[UI.netFocus]:null,out=!foc&&UI.nf==='out',lostN=ntLost().length; + h+=`
${btn(tr('common.all_networks'),'netFilter',{f:'all'},!foc&&!out?'sm':'ghost sm')}${btn(tr('hud_and_panels.out_of_reach_without_transit_n',{n:lostN}),'netFilter',{f:'out'},out?'sm':'ghost sm')}
`; + if(out&&!lostN)h+=`

${tr('hud_and_panels.nothing_every_network_is_reachable')}

`; + for(const n of foc?[foc]:out?ntLost():NETS){if(n.tail&&!UI.tailOpen&&!foc&&!out)continue; + h+=`
${logo(n)}
${esc(n.name)} AS${n.asn}
${TYPE_L[n.type]} ${n.pol} · ${tr('hud_and_panels.p_of_traffic',{p:(NSH[n.id]*100).toFixed(1)})}${n.price?` · ${tr('hud_and_panels.transit_price_gbps',{price:(n.price*S.priceMul).toFixed(2)})}`:''}
${esc(n.blurb)}
${netWhere(n,where)}${(foc||out)&&!R.nt[n.id]?`

${esc(offTransitHint(n.id))}

`:''}${foc||out&&!R.nt[n.id]?meetLine(n,foc?24:4):''}
`;} + if(!foc&&!out)h+=`
${tr('hud_and_panels.the_long_tail')} ${tr('hud_and_panels.n_small_networks',{n:tl.length})}
${tr('hud_and_panels.p_of_traffic_between_them_scattered',{p:(tl.reduce((a,n)=>a+NSH[n.id],0)*100).toFixed(1),n:tlOn})}
${btn(UI.tailOpen?tr('common.hide'):tr('common.show'),'tailTog',{},'ghost sm')}
`; + } + if(h!==UI._lh){UI._lh=h;morph($('leftBody'),h);} +} +function renderPanel(){checkLayer(); + const P=$('panel'); + if(!S||!UI.sel){P.hidden=true;return;} + P.hidden=false; + const scrollEl=$('panelBody').querySelector('.scroll');const st=scrollEl?scrollEl.scrollTop:0; + const html=UI.sel.type==='city'?cityPanel(UI.sel.id):linkPanel(UI.sel.id);if(html===UI._ph&&!P.hidden&&$('panelBody').firstChild)return;UI._ph=html;morph($('panelBody'),html); + const ns=$('panelBody').querySelector('.scroll');if(ns)ns.scrollTop=st; +} diff --git a/src/game/93-ui/50-city-panel.js b/src/game/93-ui/50-city-panel.js new file mode 100644 index 0000000..82b8098 --- /dev/null +++ b/src/game/93-ui/50-city-panel.js @@ -0,0 +1,112 @@ +function cityPanel(c){ + const C=CITY[c],p=S.pops[c],ix=ixName(c),down=p&&p.down>S.day; + let h=`
${REG[C.reg]} · ${esc(siteName(c,'a'))}

${C.name}

+
${tr('city_panel.g_of_eyeballs',{g:fmtG(eyeP(c))})}${latSlow(c)?`🐢 ${tr('city_panel.ms_ms_to_transit',{ms:Math.round(R.latFar[c].ms)})}`:''}${regionMult(c)>1?`${tr('city_panel.transit_x_pricier',{x:regionMult(c)})}`:''}${C.reg==='AS'&&!C.cn?''+tr('city_panel.underserved_users_grow_60_faster')+'':''}${ix?`${tr('city_panel.ix_ix',{ix:esc(ix)})}`:''}${p?`${tr('common.your_pop')}`:''}${down?`DOWN`:''}
+
`; + if(!p){ + h+=`
${C.note?`

${esc(C.note)}

`:''} + ${C.cn?chinaSection(c):''}${C.cn&&!cnOk()?'':`

${tr('city_panel.open_a_pop_here')}

${tr('city_panel.a_pop_point_of_presence_is')}

+ ${C.ru?`

${tr('city_panel.includes_the_mandatory_government',{cost:fmt$(RU_BOX),mo:fmt$(RU_BOX_MO)})}

`:''}${btn(tr('city_panel.build_pop_cost_mo_mo',{cost:fmt$(popCost(c)),mo:fmt$(POP_MO)}),'buildPop',{city:c},'pink big',S.cash${tr('city_panel.or_drag_from_one_of_your')}

`}`; + h+=offersHere(c); + const trs=NETS.filter(n=>sellsAt(n,c)); + const fh=FABS.filter(f=>f.cities.includes(c)); + if(ix&&fh.length){if(remoteCities().includes(c))h+=ixSection(c).replace('

'+tr('common.internet_exchange')+'

','

'+tr('city_panel.remote_peering_at_the_ix')+'

'); + else h+=`

${tr('common.remote_peering')}

${tr('city_panel.peer_at_ix_without_building_a',{ix:esc(ix),fabs:fh.map(f=>esc(f.name)).join(tr('common.or'))})}

${REMOTE_WARN}${btn(tr('city_panel.order_circuit_anyway'),'openVxc',{to:c},'ghost sm')}
`;} + h+=`

${tr('city_panel.who_s_here')}

${MEGA.filter(m=>m.c===c).length?`${tr('city_panel.ai_and_cloud_campuses_nearby_list',{list:MEGA.filter(m=>m.c===c).map(m=>`${esc(m.n)}`).join(', ')})}
`:''}${tr('city_panel.transit_sellers_list',{list:trs.map(n=>`${esc(n.name)}`).join(', ')||tr('common.none')})}
${tr('city_panel.fabrics_list',{list:fh.map(f=>`${esc(f.name)}`).join(', ')||tr('common.none')})}
${ix?ixIdsIn(c).map(x=>tr('city_panel.ix_members_on_ix_n',{ix:esc(ixName(x)),n:ixMembers(x).length})).join('
'):tr('city_panel.no_ix_here_yet_you_could')}
`; + return h; + } + const tabs=[['cust',tr('common.customers')],['up',tr('common.transit')],['peer',tr('common.peering')],['links',tr('common.infra')]]; + h+=`
`; + 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+=`

${tr('city_panel.this_pop_is_down')}

${i?esc(i.msg):''} ${tr('city_panel.customers_here_get_nothing_until_it')}

${i&&i.cost?btn(`${i.fix} ${fmt$(i.cost)}`,'fixInc',{id:i.id},'red'):''}
`;} + if(UI.tab==='cust'){ + {const nl=R.nodeLoad[c]||0,nc=R.nodeCap[c]||1;if(nl>=nc*0.95)h+=`

${tr('city_panel.router_maxed_out')}

${tr('city_panel.your_routers_here_are_forwarding',{load:fmtG(nl),cap:fmtG(nc)})}

${btn(tr('common.open_infra'),'tab',{t:'links'},'pink sm')}
`;} + h+=`

${tr('common.home_broadband')}

`; + if(!p.bb){const s=bbStart(c);h+=`

${tr('city_panel.sell_internet_to_homes_here_starts',{start:fmtG(s),max:fmtG(eyeP(c)),rate:fmt$(EYE_RATE*(C.arpu||1))})}${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)})}`:''}

${btn(tr('city_panel.launch_broadband_cost',{cost:fmt$(bbCost(c))}),'launchBB',{city:c},'pink big',S.cash${tr('common.eyeball_demand')}${tr('city_panel.a_of_b',{a:fmtG(eye),b:fmtG(eyeP(c))})}
+
${tr('city_panel.served_in_city',{city:C.name})}${pct(sf)}
+
${tr('common.revenue')}${tr('common.price_mo',{price:fmt$(eye*sf*EYE_RATE*(C.arpu||1))})}
+
${tr('city_panel.network_wide_peering_ratio')}${pct(R.peerShare||0)}

${tr('city_panel.more_traffic_over_peering_pnis_and')}

+ ${sf<0.9?`

${tr('city_panel.customers_are_unhappy_and_leaving')}

`:''} +
${p.boost>S.day?`${tr('city_panel.ad_campaign_n_d_left',{n:p.boost-S.day})}`:btn(tr('city_panel.run_ad_campaign_8k_2_growth'),'ad',{city:c},'',S.cash<8000)}
`;} + h+=`

${tr('common.business_customers')}

`; + const bz=S.biz.filter(b=>bCities(b).includes(c)); + if(!bz.length)h+=`

${tr('city_panel.no_businesses_yet_offers_pop_up')}

`; + for(const b of bz)h+=`
${esc(b.name)}
${esc(BIZ_T[b.type].l)}${b.city2?` ${CITY[b.city].name} ⇄ ${CITY[b.city2].name}`:''} · ${bTerms(b)}${BIZ_T[b.type].l2?` · ${b.sites?tr('city_panel.carrying_g_per_site',{g:fmtG(R.l2[b.id]||0)}):tr('city_panel.carrying_g',{g:fmtG(R.l2[b.id]||0)})}`:''}${BIZ_T[b.type].fiber&&!fiberOk(b)?' · '+tr('city_panel.fiber_is_down')+'':''}${BIZ_T[b.type].event&&eventLive(b)?` · ${tr('city_panel.serving_v',{v:pct(sfOf(R,b.city))})}`:''}${b.type==='scrub'&&!hasScrub()?' · '+tr('common.needs_a_scrubbing_center')+'':''}${S.day-(b.since||0)<15?` · ${tr('common.provisioning_n_d_grace',{n:15-(S.day-(b.since||0))})}`:''}
${bRisk(b)}${reqList(b)}${BIZ_T[b.type].l2?routeCtl(b):''}
${tr('common.happiness_p',{p:Math.round(b.mood)})}
${btn(UI.confirm===b.id?tr('common.really_drop'):tr('common.drop'),'dropBiz',{id:b.id},'ghost sm')}
`; + h+=`
`+offersHere(c); + }else if(UI.tab==='up'){ + h+=portNote(c)+latNote(c); + h+=`

${tr('common.ip_transit')}

${tr('city_panel.pay_a_bigger_network_per_gbps')}

`; + const prov=NETS.filter(n=>sellsAt(n,c)).sort((a,b)=>a.price-b.price); + if(!prov.length)h+=`

${tr('city_panel.nobody_sells_transit_here_haul_your')}

`; + for(const n of prov){const t=S.transit.find(x=>x.city===c&&x.net===n.id);const pr=n.price*S.priceMul*(t&&t.premium&&c==='hkg'?n.premium:1)*regionMult(c); + h+=`
${logo(n)}
${esc(n.name)} ${TYPE_L[n.type]}
${tr('city_panel.price_per_gbps_month_billed_on',{price:pr.toFixed(2)})}
`; + if(t){const u=R.useT[t.id]||0,cap=lagCap(PORT[t.tier].g,t.n),tdown=t.down>S.day; + h+=`
${lagName(t.tier,t.n)}${tdown?' · '+tr('common.outage')+'':''}${fmtG(u)}
${prefCtl('t',t.id,t.pref)}${siteCtl('t',t.id,c,t.site)}${n.premium&&c==='hkg'?`
${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')}
`:''}${(()=>{const top=transitTop([t.id],4);return top.length?`
${tr('city_panel.top_destinations_on_this_port')}
${top.map(([id,v])=>`
${esc(NET[id].name)} · ${fmtG(v)} · ${esc(offTransitHint(id,c))}
`).join('')}
`:'';})()}
${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))})}
+
${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.cash1?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')}
`;} + else h+=`
${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`; + h+=`
`;} + h+=`
`; + }else if(UI.tab==='peer'){ + h+=portNote(c); + h+=ixSection(c); + h+=`

${tr('city_panel.private_interconnects_pni')}

${tr('city_panel.a_dedicated_cross_connect_to_one',{dc:esc(siteName(c,'a'))})}

`; + const here=NETS.filter(n=>n.pops.includes(c)); + for(const n of here){const pn=S.pni.find(x=>x.city===c&&x.net===n.id),chk=peerOk(n.id,'pni',c); + h+=`
${logo(n)}
${esc(n.name)} ${n.pol}
`; + if(pn&&!pniOn(pn))h+=pniWait(pn,c); + else if(pn){const u=R.usePni[pn.id]||0,cap=lagCap(pniG(pn),pn.n);h+=`
${(pn.n||1)>1?`${pn.n}×${pniPN(pn)} LAG`:pniPN(pn)} PNI${fmtG(u)}
${pn.up?`
${tr('city_panel.augment_on_order_port_about_n',{port:(pn.up.n>1?pn.up.n+'×':'')+(pn.up.g1?'1G':PORT[pn.up.tier].n),n:Math.max(0,pn.up.ready-S.day)})} ${btn(tr('common.chase_it'),'pniChase',{id:pn.id},'ghost sm')}
`:''}
${prefCtl('p',pn.id,pn.pref)}${siteCtl('p',pn.id,c,pn.site)}
${PORT.map((P2,i)=>!pn.up&&!msfNope(n.id,c)&&(i>pn.tier||(pn.g1&&i===0))?btn((a=>(pn.n||1)>1?tr('common.upgrade_all_to_port_cost_mo',a):tr('common.upgrade_port_cost_mo_mo',a))({port:P2.n,cost:fmt$((1500+P2.setup/2)*(pn.n||1)),mo:fmt$(P2.pni*(pn.n||1))}),'pni',{city:c,net:n.id,tier:i},'sm',!portOk(c,i)||S.cash<(1500+P2.setup/2)*(pn.n||1)):'').join('')}${(pn.n||1)1?btn(tr('common.member'),'lagP',{id:pn.id,d:-1},'ghost sm'):''}${NET[n.id].cn?btn(pn.sacrif?tr('common.sacrificial_choke'):tr('city_panel.make_sacrificial_contains_floods_1_2'),'sacrif',{id:pn.id},pn.sacrif?'green sm':'sm'):''}${btn(UI.confirm===pn.id?tr('common.really_remove'):tr('common.remove'),'cancelPni',{id:pn.id},'ghost sm')}
`;} + else{h+=chk.ok?`
${pniG1(n.id)?btn(tr('city_panel.port_cost_mo_mo',{port:'1G',cost:fmt$(PNI_G1_COST),mo:fmt$(Math.round(PORT[0].pni/2))}),'pni',{city:c,net:n.id,tier:-1},'sm',S.cashportShown(i)&&i>=pniMin(n.id)?btn(tr('city_panel.port_cost_mo_mo',{port:P2.n,cost:fmt$(1500+P2.setup/2),mo:fmt$(P2.pni)}),'pni',{city:c,net:n.id,tier:i},'sm',S.cash<1500+P2.setup/2||!portOk(c,i)):'').join('')}
${pniEta(n.id)}${pniMin(n.id)?' · '+tr('city_panel.no_10g_net_starts_at_100g',{net:esc(n.name)}):pniG1(n.id)?' · '+tr('city_panel.sells_pnis_down_to_1g'):''}
${chk.fee?`
${tr('city_panel.paid_peering_price_mo_on_top',{price:fmt$(chk.fee)})}
`:''}`:`
${esc(chk.why)}
`;} + h+=`
`;} + h+=`

${tr('common.embedded_caches')}

${tr('city_panel.cdns_put_free_cache_servers_inside')}

`; + for(const n of NETS.filter(n=>n.cache)){const have=S.caches.filter(x=>x.city===c&&x.net===n.id),dem=R.demTo[n.id]||0,ok=dem>=n.cache.min; + h+=`
${logo(n)}
${esc(n.cache.name)}
${tr('common.from_net',{net:esc(n.name)})} · ${have.length?`${trn('common.n_box',have.length)} · ${tr('city_panel.serving_v',{v:fmtG(have.reduce((a,x)=>a+(R.useCache[x.id]||0),0))})}`:tr('city_panel.100g_per_box')}
${!ok?`
${tr('city_panel.needs_min_gbps_of_traffic_to',{min:n.cache.min,net:esc(n.name),now:dem.toFixed(1)})}
`:''}
+ ${have.length?btn(tr('common.remove'),'rmCache',{id:(have.find(x=>x.site==='b')||have[0]).id},'ghost sm'):''}${btn(have.length?tr('common.box'):tr('common.request'),'cache',{city:c,net:n.id},'sm',!ok)}
${S.pops[c].site2&&have.length?(()=>{const nb=have.filter(x=>x.site==='b').length,na=have.length-nb;return `
${tr('city_panel.boxes_a_in_a_b_in',{a:na,b:nb})}${na?btn(tr('city_panel.move_one_to_b'),'cacheSite',{city:c,net:n.id,s:'b'},'ghost sm'):''}${nb?btn(tr('city_panel.move_one_to_a'),'cacheSite',{city:c,net:n.id,s:'a'},'ghost sm'):''}
`;})():''}`;} + h+=`
`; + }else{ + const ls=S.links.filter(l=>l.a===c||l.b===c); + const rt=p.routers||1,g=p.rgen||0,G=RG[g],nl=R.nodeLoad[c]||0,nc=R.nodeCap[c]||nodeCap(c),Ni=g===mainRG(G.cls)?mainRG(G.cls+1):-1,N=Ni>=0?RG[Ni]:null,pu=portsUsed(c),pm=portsMax(c); + h+=`

${tr('common.routers')}

${tr('city_panel.the_model_sets_your_fastest')}

+
${rt} × ${esc(G.n)}
${tr('city_panel.up_to_pn_interfaces_ports_ports',{pn:G.pn,ports:G.ports,cap:fmtG(G.cap)})} · ${esc(G.blurb)}
+
${tr('common.router_ports')}${tr('city_panel.used_max_in_use',{used:fmtPorts(pu),max:pm})}
${pu>=pm?`

${tr('city_panel.every_port_is_taken_add_a')}

`:''} +
${tr('common.forwarding_chip')}${esc(G.chip)}
${tr('common.boot_time')}${slowBoot(c)?`${tr('city_panel.n_min_a_slow_one',{n:bootMin(c)})}`:tr('city_panel.n_min',{n:bootMin(c)})}
${slowBoot(c)?`

${tr('city_panel.this_chassis_takes_forever_to_boot')}

`:''} +
${tr('common.forwarding_load')}${fmtG(nl)} / ${fmtG(nc)}
+ ${nl>=nc*0.95?`

${tr('city_panel.maxed_out_traffic_here_is_being')}

`:''} +
${N?btn(N.lvl>lvl()?tr('city_panel.model_level_lv',{model:esc(N.n),lv:N.lvl}):tr('city_panel.upgrade_to_model_cost_mo_mo',{model:esc(N.n),cost:fmt$(swapCost(c,Ni)),mo:fmt$(N.mo*rt)}),'upRouter',{city:c,g:Ni},'pink',N.lvl>lvl()||S.cash1?btn(tr('common.remove_one'),'rmRouter',{city:c},'ghost sm'):''}
+ ${UI.models?routerModels(c):''} + ${N||UI.models?`

${(p.rgen||0)>0?tr('city_panel.prices_include_p_back_for_the',{p:fmt$(tradeIn(p.rgen||0,rt))})+' ':''}${p.rupDay===S.day?tr('city_panel.new_routers_went_in_today_the')+' ':''}${rt>1?tr('city_panel.rolling_upgrade_one_router_at_a'):tr('city_panel.with_one_router_the_upgrade_needs')}

`:''} +

${rt>=2?tr('city_panel.a_crash_here_only_costs_one'):tr('city_panel.one_router_is_a_single_point')}

+

${tr('common.metro_diversity')}

${p.site2?(()=>{const up=s=>[...S.transit.filter(t=>t.city===c&&onSite(t.site,s)).map(t=>tr('common.net_transit',{net:NET[t.net].name})+(t.site==='ab'?' '+tr('common.split'):'')),...S.pni.filter(x=>x.city===c&&onSite(x.site,s)).map(x=>'PNI '+NET[x.net].name+(x.site==='ab'?' '+tr('common.split'):'')),...ixIdsIn(c).filter(x=>S.ixp[x]!==undefined&&onSite((S.ixSite||{})[x],s)).map(x=>(S.myIx[x]?tr('city_panel.ix_switch',{ix:ixName(x)}):tr('common.port_port',{port:ixName(x)}))+((S.ixSite||{})[x]==='ab'?' '+tr('common.split'):'')),...S.caches.filter(x=>x.city===c&&(x.site==='b'?'b':'a')===s).map(x=>NET[x.net].cache.name)]; + const row=s=>{const dn=siteDown(c,s),u=up(s);return `
${esc(siteName(c,s))}${dn?' DOWN':''}
${u.length?esc(u.join(', ')):tr('city_panel.nothing_plugged_in_here_yet')}
`;}; + return `

${tr('city_panel.two_buildings_joined_by_your_own')}

${row('a')}${row('b')}${up('b').length&&up('a').length?'':`

${tr('city_panel.everything_is_in_one_building_move')}

`}
${tr('city_panel.second_site_and_metro_ring')}${tr('common.price_mo',{price:fmt$(SITE2_MO)})}
${btn(UI.confirm==='site'+c?tr('city_panel.really_close_it'):tr('city_panel.close_site_b'),'rmSite',{city:c},'ghost sm')}
`;})() + :`

${tr('city_panel.right_now_city_is_one_building',{city:esc(CITY[c].name)})}

${btn(tr('city_panel.add_a_second_site_cost_mo',{cost:fmt$(SITE2_COST),mo:fmt$(SITE2_MO)}),'addSite',{city:c},'pink',S.cash`}
+

${tr('common.power')}

${tr('common.backup_generator')}${p.gen?tr('common.installed'):tr('common.none_304f')}
${p.gen?'

'+tr('city_panel.power_cuts_are_covered')+'

':`
${btn(tr('city_panel.install_generator_cost_mo_mo',{cost:fmt$(GEN_COST),mo:fmt$(GEN_MO)}),'addGen',{city:c},'',S.cash`}
`; + h+=`

${tr('city_panel.ddos_scrubbing_center')}

`; + {const here=S.scrubs.find(x=>x.city===c),others=S.scrubs.filter(x=>x.city!==c); + if(here){const T=SCRUB_TIERS[here.tier||0]; + h+=`

${tr('city_panel.cleans_attacks_for_your_whole')}

+
${tr('common.capacity')}${T.n} · ${fmtG(T.g)}
+
${tr('common.mode')}${S.scrubMode==='ondemand'?tr('city_panel.on_demand_engages_in_n_d',{n:SCRUB_DELAY}):tr('common.always_on')} · ${fmt$(scrubMo1(here))}/mo
+
${btn(S.scrubMode==='ondemand'?tr('city_panel.switch_to_always_on'):tr('city_panel.switch_to_on_demand_cheaper'),'scrubMode',{},'sm')}${SCRUB_TIERS.map((X,i)=>i>(here.tier||0)?btn(tr('city_panel.upgrade_to_tier_cost',{tier:X.n,cost:fmt$(Math.round(X.cost*0.6))}),'scrubUp',{city:c,tier:i},'sm',(lvl()||1)`;} + else{h+=`

${others.length?tr('city_panel.attacks_go_to_your_nearest_scrubbing',{city:CITY[others.slice().sort((a,b)=>kmBetween(c,a.city)-kmBetween(c,b.city))[0].city].name,km:Math.round(kmBetween(c,others.slice().sort((a,b)=>kmBetween(c,a.city)-kmBetween(c,b.city))[0].city)).toLocaleString()}):tr('city_panel.cleans_ddos_attacks_for_your_whole')}

${SCRUB_TIERS.map((X,i)=>btn(tr('city_panel.build_tier_cost_mo_mo',{tier:X.n,cost:fmt$(X.cost),mo:fmt$(X.mo)}),'buildScrub',{city:c,tier:i},i===0?'':'sm',(lvl()||1)`;}} + h+=`
`; + const fabs=FABS.filter(f=>f.cities.includes(c)); + if(fabs.length){h+=`

${tr('city_panel.interconnection_fabrics_nni')}

${tr('city_panel.buy_a_port_on_a_fabric')}

`; + for(const f of fabs){const pt=nniPort(c,f.id),used=nniUsed(c,f.id); + h+=`
${esc(f.name)}
${esc(f.blurb)}
`; + if(pt){const cap=NNI[pt.tier].g;h+=`
${tr('city_panel.port_port_price_mo',{port:NNI[pt.tier].n,price:fmt$(NNI[pt.tier].mo)})}${tr('city_panel.g_of_circuits',{g:fmtG(used)})}
${btn(tr('common.new_circuit'),'openVxc',{from:c,prov:f.id},'pink sm')}${pt.tier<1?btn(tr('common.upgrade_port_price_mo',{port:NNI[1].n,price:fmt$(NNI[1].mo)}),'buyNni',{city:c,prov:f.id,tier:1},'sm'):''}${btn(tr('common.remove_port'),'rmNni',{city:c,prov:f.id},'ghost sm')}
`;} + else h+=`
${NNI.map((N,i)=>btn(tr('city_panel.port_port_price_mo_197d',{port:N.n,price:fmt$(N.mo)}),'buyNni',{city:c,prov:f.id,tier:i},'sm',S.cash`; + h+=`
`;} + h+=`
`;} + h+=`

${tr('city_panel.fiber_from_city',{city:C.name})}

${tr('city_panel.drag_from_this_router_to_any')}

`; + if(!ls.length)h+=`

${tr('common.no_links_yet')}

`; + for(const l of ls){const o=l.a===c?l.b:l.a,u=capOf(l)?(R.load[l.id]||0)/capOf(l):0,cut=linkDown(l); + h+=`
→ ${CITY[o].name}${l.mult>1?' · '+tr('common.diverse'):''} ${cut?''+tr('common.cut')+'':''}
${capName(l)} · ${l.km.toLocaleString()} km ${l.kind==='vxc'?tr('city_panel.virtual_circuit_via_fab',{fab:esc(FAB[l.prov].name)}):l.kind==='df'?(l.own?(l.sub&&l.cname?tr('city_panel.your_own_subsea_cable_name',{name:l.cname}):tr('common.own_dark_fiber')):tr('city_panel.dark_fiber_iru'))+(l.ready>S.day?` · ${tr('city_panel.ready_in_n_d',{n:l.ready-S.day})}`:''):l.sub?tr('common.subsea'):tr('common.terrestrial')} · ${tr('common.price_mo',{price:fmt$(l.mo)})}
${btn(tr('common.open'),'selLink',{id:l.id},'ghost sm')}
`;} + h+=`
`; + if(Object.keys(S.pops).length>1)h+=`

${tr('common.decommission')}

${tr('city_panel.shut_this_pop_down_its_links')}

${btn(tr('city_panel.decommission_city',{city:C.name}),'decomOpen',{city:c},'ghost sm')}${btn(tr('city_panel.decommission_several_pops'),'decomOpen',{},'ghost sm')}
`; + } + return h+`
`; +} diff --git a/src/game/93-ui/60-decommission.js b/src/game/93-ui/60-decommission.js new file mode 100644 index 0000000..148b08a --- /dev/null +++ b/src/game/93-ui/60-decommission.js @@ -0,0 +1,22 @@ +/* Decommissioning POPs. Customers that touch a decommissioned city, or ride a removed link, are let go + with an early-termination penalty of three months of their contract. */ +const DECOM_MONTHS=3; +function decomImpact(cities){const set=new Set(cities),links=S.links.filter(l=>set.has(l.a)||set.has(l.b)),lids=new Set(links.map(l=>l.id)); + const biz=S.biz.filter(b=>bCities(b).some(c=>set.has(c))||(b.link&&lids.has(b.link))); + const pen=b=>Math.max(2000,Math.round(b.fee?b.fee*0.5:b.bw*b.rate*DECOM_MONTHS)); + return {links,biz,pen,fee:biz.reduce((a,b)=>a+pen(b),0),eye:cities.reduce((a,c)=>a+(R.cityEye[c]||0),0)};} +function decomModal(){const sel=[...(UI.decom||[])],im=decomImpact(sel),all=Object.keys(S.pops),left=all.length-sel.length; + const rows=all.map(c=>``).join(''); + openModal(`

${tr('common.decommission_pops')}

+

${tr('decommission.pick_the_pops_to_shut_down')}

${rows} + ${sel.length?`
${tr('common.links_removed')}${im.links.length}
${tr('decommission.eyeballs_you_stop_serving')}${fmtG(im.eye)}
${trn('decommission.n_customer_let_go',im.biz.length)}${fmt$(im.fee)}
${im.biz.length?`

${im.biz.map(b=>esc(b.name)+' '+fmt$(im.pen(b))).join(' · ')}

`:''}`:''} + ${left<1?`

${tr('decommission.keep_at_least_one_pop')}

`:''} +
${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')}
`);} +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)); + S.links=S.links.filter(l=>!lids.has(l.id));S.biz=S.biz.filter(b=>!bids.has(b.id));S.offers=S.offers.filter(o=>!bCities(o).some(c=>set.has(c))); + S.transit=S.transit.filter(t=>!set.has(t.city));S.pni=S.pni.filter(x=>!set.has(x.city));S.caches=S.caches.filter(x=>!set.has(x.city));S.nni=(S.nni||[]).filter(x=>!set.has(x.city)); + for(const c of cities){for(const x of ixIdsIn(c)){delete S.ixp[x];delete S.rs[x];if(S.ixn)delete S.ixn[x];if(S.ixSite)delete S.ixSite[x];for(const k in S.peers)if(k.endsWith('@'+x))delete S.peers[k];}delete S.myIx[c];S.scrubs=S.scrubs.filter(x=>x.city!==c);delete S.pops[c];} + const rem=remoteCities();for(const x in S.ixp){const c=ixCity(x);if(!S.pops[c]&&!rem.includes(c)){delete S.ixp[x];delete S.rs[x];for(const k in S.peers)if(k.endsWith('@'+x))delete S.peers[k];}} + if(set.has(S.home))S.home=Object.keys(S.pops)[0]; + purgeInc();S.cash-=im.fee;S.stats.decom=(S.stats.decom||0)+cities.length; + toast(trn('decommission.n_pop_decommissioned_fee_in_early',cities.length,{fee:fmt$(im.fee),m:im.biz.length}),'bad');} diff --git a/src/game/93-ui/70-link-panels.js b/src/game/93-ui/70-link-panels.js new file mode 100644 index 0000000..9141773 --- /dev/null +++ b/src/game/93-ui/70-link-panels.js @@ -0,0 +1,139 @@ +const portMo=v=>v?tr('common.price_mo',{price:fmt$(v)}):tr('common.free'); +function ixSection(c){const ids=ixIdsIn(c);if(ids.length<2)return ixBlock(c,false); + let h=`

${tr('common.internet_exchanges')}

${tr('link_panels.n_exchanges_compete_in_city_members',{n:ids.length,city:esc(CITY[c].name)})}

`; + for(const x of ids)h+=ixBlock(x,true);return h;} +function ixBlock(c,multi){const city=ixCity(c),C=CITY[city],ix=ixName(c),X=XIXM[c];let h=''; + h+=`

${multi?esc(ix)+(X?' '+tr('common.challenger')+'':' '+tr('common.incumbent')+''):tr('common.internet_exchange')}

`; + if(!ix&&C.cn){h+=`

${tr('link_panels.running_an_exchange_in_mainland')}

`;} + else if(!ix){h+=`

${tr('link_panels.there_s_no_ix_in_city',{city:C.name})}

${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'+tr('link_panels.build_a_pop_here_first')+'

'}`;} + else if(S.ixp[c]===undefined){h+=`

${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):'');})()})}

${S.pops[city]?'':REMOTE_WARN}${X?`

${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)})}

`:''}${CITY[city].ixCheap?`

${tr('link_panels.run_by_a_nonprofit_public_prices')}

`:''}${isDk(c)?`

${tr('link_panels.run_by_de_kicks_group_no')}

`:''}
${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.cash1))).join('')}
`;} + 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+=`
${mine?tr('link_panels.your_own_fabric_name',{name:myFab(c).n}):lagName(S.ixp[c],(S.ixn||{})[c])}${xdown?' · FABRIC DOWN':''}${fmtG(u)}
${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+=`

${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)})}

`; + for(const x of ad)h+=`
${esc(x.n)}
${esc(x.blurb)} · ${tr('common.price_mo',{price:fmt$(x.mo)})}
${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')}
`;} + if(isRemote(c))h+=`

${trn('link_panels.remote_port_via_a_reseller_1',ixMembers(c).filter(noRemote).length)}

`; + if(mine){const f=S.myIx[c].fab|0,N=MYIX_FAB[f+1];h+=`
${tr('link_panels.members_paying_you')}${tr('link_panels.n_of_up_to_max_price',{n:S.myIx[c].members.length,max:myFab(c).max,price:fmt$(S.myIx[c].members.length*MYIX_FEE)})}
${N?`
${btn(N.lvl>lvl()?tr('link_panels.name_fabric_level_lv',{name:N.n,lv:N.lvl}):tr('link_panels.upgrade_fabric_to_name_cost_mo',{name:N.n,cost:fmt$(N.cost),mo:fmt$(N.mo)}),'myIxUp',{city:c},'pink sm',N.lvl>lvl()||S.cash

${tr('link_panels.a_bigger_fabric_carries_more_traffic')}

`:'

'+tr('link_panels.biggest_fabric_money_can_buy')+'

'}`;} + else h+=`
${PORT.map((P2,i)=>i>S.ixp[c]&&portShown(i)?btn(tr('common.upgrade_port_price',{port:P2.n,price:portMo(ixPortMo(c,i)*((S.ixn||{})[c]||1))}),'buyIx',{city:c,tier:i},'sm',(!!S.pops[city]&&!portOk(city,i))||(!S.pops[city]&&i>1)):'').join('')}${S.pops[city]&&((S.ixn||{})[c]||1)1?btn(tr('common.member'),'lagIx',{city:c,d:-1},'ghost sm'):''}${btn(S.rs[c]?tr('link_panels.leave_route_server'):tr('link_panels.join_route_server'),'rs',{city:c},S.rs[c]?'ghost sm':'pink sm')}${S.rs[c]&&ppol()!=='open'?`${tr('link_panels.off_while_your_peering_policy_is',{pol:tr(PPOL_N[ppol()])})}`:''}${btn(UI.confirm==='ix'+c?tr('common.really_leave'):tr('common.leave_ix'),'cancelIx',{city:c},'ghost sm')}
`; + h+=`
`; + {const elig=mine?[]:ixMembers(c).filter(id=>!set.has(id)&&peerOk(id,'ix',c).ok);if(elig.length>1)h+=`
${btn(tr('link_panels.request_all_n_willing_peers',{n:elig.length}),'peerAll',{city:c},'pink sm')}
`;} + for(const id of ixMembers(c).sort((a,b)=>NSH[b]-NSH[a])){const n=NET[id],on=set.has(id),viaRs=on&&!S.peers[id+'@'+c]&&!mine,chk=peerOk(id,'ix',c); + h+=`
${logo(n)}
${esc(n.name)}
${TYPE_L[n.type]} ${n.pol} · ${(NSH[id]*100).toFixed(NSH[id]<0.01?1:0)}%${n.tail?' '+tr('common.tiny')+'':''}
${!on&&!chk.ok?`
${esc(chk.why)}
`:''}
+ ${on?(viaRs||mine?`${mine?tr('common.member_fef5'):tr('common.via_rs')}`:btn(tr('common.peered_ce2f'),'unpeer',{city:c,net:id},'green sm',false,tr('link_panels.click_to_tear_down'))):btn(tr('common.request'),'peer',{city:c,net:id},'sm',!chk.ok)}
`;} + h+=`
`;} + h+=`
`;return h; +} +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=`
${tr('link_panels.virtual_circuit_name_km_km',{name:esc(f.name),km:l.km.toLocaleString()})}

${CITY[l.a].name} ⇄ ${CITY[l.b].name}

`; + if(down)h+=`

${tr('common.fabric_outage')}

${tr('link_panels.name_is_down_nothing_you_can',{name:esc(f.name)})}

`; + h+=`

${tr('common.capacity')}

${tr('link_panels.name_circuit',{name:VXC[l.vt].n})}${fmtG(load)} / ${fmtG(cap)}
+
${tr('common.monthly')}${tr('common.price_mo',{price:fmt$(l.mo)})}
${!S.pops[l.b]?`

${tr('link_panels.remote_peering_leg_into_ix',{ix:esc(CITY[l.b].ix)})}

`:''} +
${VXC.map((V,t)=>t>l.vt?btn(`${V.n} ${tr('common.price_mo',{price:fmt$(vxcMo(l.km,l.sub,t))})}`,'upVxc',{id:l.id,t},'sm'):'').join('')}
+ ${trafficSection(l)}${metricSection(l)} +
${btn(UI.confirm===l.id?tr('common.really_cancel'):tr('common.cancel_circuit'),'cancelVxc',{id:l.id},'ghost sm')}
`; + return h; +} +function prefCtl(kind,id,cur){cur=cur||'normal';return `
${tr('common.egress')}${Object.keys(PREF).map(v=>btn(PREF[v],'setPref',{kind,id,v},cur===v?'pink sm':'ghost sm')).join('')}
`;} +function trafficSection(l){ + const rec=R.ef[edgeKey(l)],n=pairLinks(l.a,l.b).length; + let h=`

${tr('link_panels.what_s_on_this_link')}

`; + if(!rec){return h+`

${tr('link_panels.no_traffic_right_now')}

`;} + const tot=Object.values(rec.net).reduce((a,b)=>a+b,0)||1; + const nets=Object.entries(rec.net).sort((a,b)=>b[1]-a[1]); + const col=id=>id==='junk'?'#FF4D5E':id==='l2vpn'?'#7B61FF':NET[id].col,nm=id=>id==='junk'?tr('common.ddos_junk'):id==='l2vpn'?tr('common.l2vpn_customers'):NET[id].name; + h+=`${n>1?`

${tr('link_panels.totals_for_all_n_links_between',{n})}

`:''}
${nets.map(([id,v])=>``).join('')}
`; + h+=`

${tr('common.content_from')}

`+nets.slice(0,6).map(([id,v])=>`
${esc(nm(id))}${fmtG(v)} · ${pct(v/tot)}
`).join(''); + const egs=Object.entries(rec.eg).sort((a,b)=>b[1]-a[1]); + h+=`

${tr('link_panels.enters_your_network_at')}

`+egs.slice(0,6).map(([k,v])=>{const d=R.egDesc[k];return `
${esc(d.lab)}
${CITY[d.city].name} · ${fmtG(v)} · ${pct(v/tot)}
${btn(tr('common.open'),'goEgress',{city:d.city,k:d.k},'ghost sm')}
`;}).join(''); + const dst=Object.entries(rec.dst).sort((a,b)=>b[1]-a[1]); + h+=`

${tr('link_panels.going_to_customers_in')}

`+dst.slice(0,6).map(([c,v])=>`
${CITY[c].name}${fmtG(v)} · ${pct(v/tot)}
`).join(''); + const u=tot/pairLinks(l.a,l.b).filter(x=>!linkDown(x)).reduce((a,x)=>a+capOf(x),0); + if(u>=0.8&&egs.length){const d=R.egDesc[egs[0][0]];h+=`

${tr('link_panels.biggest_feeder_egress_in_city_set',{egress:esc(d.lab),city:CITY[d.city].name})}

`;} + return h+``; +} +function metricSection(l){const cur=l.metric||'normal'; + return `

${tr('common.routing_metric')}

${tr('link_panels.your_routers_pick_the_lowest_cost')}

${Object.keys(MET).map(k=>btn(MET[k].l,'setMetric',{id:l.id,v:k},cur===k?'pink sm':'ghost sm')).join('')}
`;} +function chinaSection(c){const st=S.cnLic?S.cnLic.state:'none',loss=S.ev.gfw>S.day?0.35:0.2; + let h=`

${tr('link_panels.behind_the_great_firewall')}

${tr('link_panels.mainland_china_plays_by_its_own',{list:CN_BLOCKED.slice(0,4).map(esc).join(', '),pct:pct(loss)})}

`; + if(st==='none')h+=`

${tr('link_panels.foreign_networks_need_a_local_joint')}

${btn(tr('link_panels.apply_for_a_license_price_mo',{price:fmt$(CN_LIC),mo:fmt$(CN_JV_MO)}),'applyCn',{},'pink',S.cash${tr('link_panels.license_paperwork_in_progress_n_days',{n:Math.max(0,S.cnLic.ready-S.day)})}

`; + else h+=`

${tr('link_panels.your_joint_venture_holds_an')}

`; + if(R.gfwCross>0.5)h+=`
${tr('link_panels.your_traffic_crossing_the_border')}${fmtG(R.gfwCross)}
${tr('link_panels.lost_on_the_way')}${fmtG(R.gfwLost)}
`; + return h+`
`;} +function subUpgradePanel(l){return `

${tr('common.submarine_transmission')}

${tr('common.better_terminals_and_optical_tuning')}

`+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}; + const status=done?tr('common.installed'):at!==undefined?tr('link_panels.ready_in_n_days',{n:Math.max(0,at-S.day)}):tr('link_panels.price_n_days',{price:fmt$(cost),n:U.days}); + return `
${tr(U.n)}
${status}
${tr('common.up_to_g_per_channel',{g:fmtG(submarineRate(preview))})}
${at===undefined?btn(tr('common.install'),'subUpgrade',{id:l.id,k},'sm',lvl()<4||S.cash`;}).join('');} +function dfPanel(l){ + const load=R.load[l.id]||0,cap=dfCap(l),u=cap?load/cap:0,bld=l.ready>S.day,A=CITY[l.a].name,B=CITY[l.b].name,inc=S.inc.find(i=>i.ref===l.id||i.ref===(l.trench||l.id)),amps=ampCount(l.km),sysD=DF_SYS[l.sys]; + let h=`
${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()})}

${A} ⇄ ${B}

`; + if(bld){const tot=Math.max(1,l.ready-l.day),done=clamp((S.day-l.day)/tot,0,1); + h+=`

${l.own?tr('common.under_construction'):tr('common.being_spliced')}

${l.own?tr('link_panels.permits_trenching_splicing'):tr('common.iru_handover')}${tr('common.n_days_left',{n:l.ready-S.day})}
${l.own?`
${btn(tr('link_panels.hire_extra_crews_price_30_days',{price:fmt$(crewCost(l))}),'crews',{id:l.id},'sm',l.ready<=S.day+1||S.cash`:''}

${tr('link_panels.you_can_pre_install_optics_now')}

`;} + else if(inc&&linkDown(l))h+=`

${tr('common.dark_6bf5')}

${esc(inc.msg)}

${inc.cost?btn(`${esc(inc.fix||tr('common.rush_repair'))} ${fmt$(inc.cost)}`,'fixInc',{id:inc.id},'red',S.cash`; + h+=`

${tr('common.capacity')}

${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)})}`:''}${fmtG(load)} / ${fmtG(cap)}
+ ${l.own&&l.sub?`
${tr('common.cable_design')}${tr((SEA_DESIGNS[l.seaDesign]||SEA_DESIGNS.standard).n)}
`:''} +
${tr('common.latency')}${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}
${l.own?tr('link_panels.right_of_way_upkeep'):tr('common.iru_lease')}${tr('common.price_mo',{price:fmt$(l.mo)})}
${tr('link_panels.n_amp_huts',{n:amps})}${tr('common.price_mo',{price:fmt$(amps*AMP_MO)})}
${!bld&&!(l.ch||[]).length?`

${tr('link_panels.this_fiber_is_dark_add_optics')}

`:''}
`; + if(!bld){const sold=S.biz.filter(b=>b.link===l.id&&(b.type==='wwave'||b.type==='dfpair'||b.type==='pairs')),off=S.offers.find(o=>o.link===l.id),fc=freeCh(l); + h+=`

${tr('link_panels.selling_spare_capacity')}

${tr('link_panels.other_carriers_rent_what_you_do')}

+
${tr('common.free_channels')}${fc} / ${chMax(l)}
${sold.map(b=>`
${esc(b.name)}
${esc(b.what||BIZ_T[b.type].l)} · ${tr('common.price_mo',{price:fmt$(b.rate)})}
`).join('')} + ${off?`
${esc(off.name)}
${esc(off.what)} · ${tr('common.price_mo',{price:fmt$(off.rate)})} · ${tr('ui.n_d_left',{n:off.exp-S.day})}${off.broker?' · '+tr('link_panels.via_a_capacity_broker'):''}
${btn(tr('common.accept'),'accept',{id:off.id},'pink sm')}
`:fc>=1||pairFree(l)?`
${btn(tr('link_panels.list_it_with_a_capacity_broker'),'advertise',{id:l.id},'sm')}
`:`

${tr('link_panels.nothing_spare_to_sell_on_this')}

`}
`;} + h+=`

${tr('common.optics')}

${tr('link_panels.each_channel_is_a_pair_of')}

`; + if(l.own&&l.sub)h+=subUpgradePanel(l); + for(const k of Object.keys(OPT)){const O=OPT[k],n=(l.ch||[]).filter(x=>x===k).length,why=chWhy(l,k); + const md=optMode(k,l),cc=chCost(l,k),sp=spareN(k); + h+=`
${O.n} ${optModes(k,l).map(([g,r])=>tr('link_panels.g_to_km_km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')}
${esc(O.blurb)}${n?` · ${tr('link_panels.n_lit',{n})}`:''}${sp?` · ${trn('link_panels.n_spare_on_the_shelf',sp)}`:''}
${md&&!md.full?`
⚠️ ${tr('link_panels.runs_at_g_per_channel_on',{g:fmtG(md.g)})} ${!l.sub&®enNeed(k,l)>(l.regen|0)?trn('link_panels.n_regen_site_would_bring_it',regenNeed(k,l),{g:fmtG(O.g)}):''}
`:''}${why?`
${esc(why)}
`:''}
${n?btn('−','rmCh',{id:l.id,o:k},'ghost sm'):''}${btn(sp?`+ ${cc?tr('link_panels.spare_price',{price:fmt$(cc)}):tr('common.spare')}`:`+ ${fmt$(cc)}`,'addCh',{id:l.id,o:k},'sm',!!why||S.cash`;} + {const st=Object.keys(OPT).filter(k=>spareN(k)>0);h+=`

${tr('link_panels.unplugged_optics_go_on_the_spares')}

`; + {const used=[...new Set(l.ch||[])].filter(k=>OPT[k]&&OPT[k].lvl<=lvl());if(used.length)h+=`
${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=64)).join('')}

${tr('link_panels.spares_bought_now_are_already_paid')}

`;}if(st.length)h+=`

${tr('common.spares_shelf')}

`+st.map(k=>`
${spareN(k)} × ${OPT[k].n}
${btn(tr('link_panels.sell_one_price',{price:fmt$(spareValue(k))}),'sellSpare',{o:k},'ghost sm')}
`).join('');} + const rg=l.regen|0,rgAdd=REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH); + h+=`

${tr('common.line_system')}

${esc(sysD.n)}${tr('link_panels.n_amplifiers',{n:amps})}
+
${tr('common.regen_sites')}${rg?tr('link_panels.n_optical_spans_of_km_km',{n:rg,km:spanKm(l).toLocaleString()}):tr('common.none')}

${tr('link_panels.a_regen_site_turns_the_light',{price:fmt$(REGEN_MO)})}

${l.sub&&l.own?`

${tr('link_panels.no_regen_sites_in_the_middle')}

`:`
${rg`}

${esc(sysD.blurb)}

${(()=>{const t=sysNext(l);if(!t)return '';const T=DF_SYS[t],c=sysUpCost(l);return T.lvl>lvl()?btn(tr('link_panels.sys_level_n',{sys:T.n,n:T.lvl}),'upSys',{id:l.id},'sm',true):btn(tr('link_panels.upgrade_to_sys_price',{sys:T.n,price:fmt$(c)}),'upSys',{id:l.id},'sm',S.cash

${tr('link_panels.spare_optics_and_amplifier_cards_on')}

`; + {const sib=pairLinks(l.a,l.b).filter(x=>x!==l&&x.kind!=='vxc');h+=`

${tr('common.redundancy')}

${sib.length?tr('link_panels.other_links_between_these_cities'):tr('link_panels.this_is_the_only_link_between')}

${sib.map(x=>`
${esc(capName(x))} ${linkDown(x)?''+tr('common.cut')+'':''}
${(x.trench||x.id)===(l.trench||l.id)?tr('common.same_trench'):tr('common.diverse_route')}
${btn(tr('common.open'),'selLink',{id:x.id},'ghost sm')}
`).join('')}
${btn(tr('link_panels.add_parallel_link'),'addParallel',{id:l.id},'pink sm')}
`;} + h+=`${trafficSection(l)}${metricSection(l)}
${btn(UI.confirm===l.id?tr('link_panels.really_give_it_up'):(l.own?tr('link_panels.abandon_the_fiber'):tr('link_panels.cancel_the_iru')),'rmLink',{id:l.id},'ghost sm')}${cabBack(l)>0?`

${tr('link_panels.giving_it_up_now_returns_price',{price:fmt$(cabBack(l))})}

`:''}
`; + return h; +} +function offersHere(c){ + const os=S.offers.filter(o=>bCities(o).includes(c));if(!os.length)return ''; + return `

${tr('common.offers_here')}

${os.map(o=>`
${esc(o.name)}
${esc(BIZ_T[o.type].l)}${o.city2?` ${CITY[o.city].name} ⇄ ${CITY[o.city2].name}`:''} · ${bTerms(o)} · ${tr('ui.n_d_left',{n:o.exp-S.day})}
${R.reach<0.99&&!BIZ_T[o.type].l2?`
${tr('link_panels.they_need_the_full_internet_your',{pct:pct(R.reach)})}
`:''}${o.type==='scrub'&&!hasScrub()?`
${tr('link_panels.needs_your_own_scrubbing_center')}
`:''}${bRisk(o)}${reqList(o)}${bHas(o)?'':`
${tr('link_panels.needs_a_pop_in_cities_too',{cities:bCities(o).filter(x=>!S.pops[x]).map(x=>CITY[x].name).join(', ')})}
`}
${bHas(o)?btn(tr('common.accept'),'accept',{id:o.id},'green sm'):''}${btn(tr('common.no'),'decline',{id:o.id},'ghost sm')}
`).join('')}
`; +} +function linkPanel(id){ + const l=S.links.find(x=>x.id===id);if(!l){UI.sel=null;return '';} + if(l.kind==='vxc')return vxcPanel(l); + if(l.kind==='df')return dfPanel(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=`
${l.cable?esc(CAB[l.cable].name):l.sub?tr('common.subsea_cable'):tr('common.terrestrial_fiber')} · ${l.km.toLocaleString()} km

${CITY[l.a].name} ⇄ ${CITY[l.b].name}

`; + if(cut)h+=`

${tr('common.cut_2e50')}

${inc?esc(inc.msg):''} ${tr('link_panels.back_in_n_days',{n:l.cut-S.day})}

${inc&&inc.cost?btn(`${esc(inc.fix||tr('common.rush_repair'))} ${fmt$(inc.cost)}`,'fixInc',{id:inc.id},'red',S.cash`; + h+=`

${tr('common.capacity')}

${tr('link_panels.name_wave',{name:LT[l.tier].n})}${fmtG(load)} / ${fmtG(cap)}
+
${tr('common.latency')}${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}
${l.cable?`
${tr('common.cable_system')}${esc(CAB[l.cable].name)}
`:''} +
${tr('common.wave_lease')}${tr('common.price_mo',{price:fmt$(l.mo)})}
${u>=0.9?`

${tr('link_panels.congested_upgrade_it_or_add_a')}

`:''} +
${LT.map((T,i)=>{const d=Math.round(waveMo(l.km,l.sub,i)*(l.mult||1)),sw=subWaveWhy(i,l.km,l.sub),ok=waveOk(l.a,l.b,i);return i>l.tier&&waveShown(i)?btn(`${T.n} ${sw?tr('common.too_far_for_this_cable'):ok?tr('common.price_mo',{price:fmt$(d)}):tr('link_panels.needs_what',{what:esc(waveNeed(i))})}`,'upLink',{id:l.id,tier:i},'sm',S.cash${tr('common.km_km_of_cable_carries_at',{km:Math.round(l.km).toLocaleString(),g:fmtCap(subCarrier(l.km))})}${l.tier>subMaxTier(l.km)?' '+tr('link_panels.your_wave_was_sold_before_the'):''}

`:''}
+

${tr('common.redundancy')}

${mates.length?trn('link_panels.shares_a_trench_with_n_other',mates.length):sib.length?tr('link_panels.runs_on_its_own_route_a'):tr('link_panels.this_is_the_only_link_between')}

+ ${sib.map(x=>`
${tr('link_panels.name_parallel_link',{name:capName(x)})} ${x.cut>S.day?''+tr('common.cut')+'':''}
${(x.trench||x.id)===trk?tr('common.same_trench'):tr('common.diverse_route')}
${btn(tr('common.open'),'selLink',{id:x.id},'ghost sm')}
`).join('')} +
${btn(tr('link_panels.add_parallel_link'),'addParallel',{id:l.id},'pink sm')}
+ ${trafficSection(l)}${metricSection(l)} +
${btn(UI.confirm===l.id?tr('common.really_decommission'):tr('common.decommission_link'),'rmLink',{id:l.id},'ghost sm')}
`; + return h; +} +const EGC={c:[tr('common.caches'),'#16A866'],p:[tr('common.pnis'),'#7B61FF'],ix:[tr('common.ix_peering_0631'),'#FFD23F'],t:[tr('common.transit'),'#FF8A3D'],l2:[tr('common.l2_circuits'),'#2F8CFF']}; +function svgChart(rows,stackKeys,lines,fmtY){ + const W=600,H=180,L=50,B=20,T=8,Rr=8;if(rows.length<2)return `

${tr('link_panels.collecting_data_check_back_in_a')}

`; + let ymax=1;for(const r of rows){let s=0;for(const k of stackKeys)s+=r[k]||0;ymax=Math.max(ymax,s);for(const ln of lines)ymax=Math.max(ymax,r[ln.k]||0);}ymax*=1.1; + const x=i=>L+(W-L-Rr)*i/(rows.length-1),y=v=>T+(H-T-B)*(1-v/ymax);let g=''; + for(let j=0;j<=3;j++){const v=ymax*j/3,yy=y(v);g+=`${fmtY(v)}`;} + const base=rows.map(()=>0); + for(const k of stackKeys){const top=rows.map((r,i)=>base[i]+(r[k]||0));let d=`M${x(0)},${y(top[0])}`;for(let i=1;i=0;i--)d+=`L${x(i)},${y(base[i])}`;g+=``;top.forEach((v,i)=>base[i]=v);} + for(const ln of lines){let d='';rows.forEach((r,i)=>{d+=(i?'L':'M')+x(i)+','+y(r[ln.k]||0);});g+=``;const last=rows[rows.length-1][ln.k]||0;g+=``;} + g+=`${dateStr(rows[0].d)}${dateStr(rows[rows.length-1].d)}`; + return `${g}`;} +// For a network you currently reach over transit: the cheapest way to move it to peering. +// Exchange members as sets, rebuilt once per routing pass: hints are asked for many networks at a time. +let IXMR=null,IXMC={};const ixHas=(x,id)=>{if(IXMR!==R){IXMR=R;IXMC={};}return (IXMC[x]||(IXMC[x]=new Set(ixMembers(x)))).has(id);}; +function offTransitHint(id,city){const n=NET[id];if(n.type==='t1')return tr('link_panels.tier_1_only_a_pni_and'); + const ixc=Object.keys(S.pops).flatMap(ixIdsIn).filter(x=>ixHas(x,id)),here=city&&ixIdsIn(city).find(x=>ixHas(x,id))||null,pick1=here||ixc.find(x=>S.ixp[x]!==undefined)||ixc[0]; + if(n.pol==='open'){if(pick1)return here||ixNamesCity(pick1)?tr('link_panels.open_peer_join_the_route_server',{ix:ixName(pick1)}):tr('link_panels.open_peer_join_the_route_server_01a1',{ix:ixName(pick1),city:CITY[ixCity(pick1)].name});const x=nearestSpot(id);return x?tr('link_panels.open_peer_but_not_on_any',{city:CITY[x.c].name}):tr('link_panels.open_peer_but_not_on_any_bfbb');} + if(n.pol==='paid')return paidFree(n)?tr('link_panels.peers_with_you_for_free_over'):n.freeLv?tr('link_panels.paid_peering_only_a_pni_costs',{price:fmt$(n.paidFee),n:n.freeLv}):tr('link_panels.paid_peering_only_a_pni_costs_921d',{price:fmt$(n.paidFee)}); + const pniC=Object.keys(S.pops).filter(c=>n.pops.includes(c));const ixOk=pick1?peerOk(id,'ix',pick1):null,pOk=pniC.length?peerOk(id,'pni',pniC.includes(city)?city:pniC[0]):null; + if(pOk&&pOk.ok)return tr('link_panels.ready_for_a_pni_in_city',{city:CITY[pniC.includes(city)?city:pniC[0]].name}); + if(ixOk&&ixOk.ok)return tr('link_panels.will_peer_at_ix_request_a',{ix:ixName(pick1)}); + if(ixOk)return `${ixName(pick1)}: ${ixOk.why}`; + if(pniC.length)return tr('link_panels.pni_in_city_why',{city:CITY[pniC[0]].name,why:pOk.why});{const x=nearestSpot(id);return x?tr('link_panels.not_in_your_cities_yet_nearest',{city:CITY[x.c].name}):tr('link_panels.not_present_in_any_of_your');}} +function transitTop(ids,k=5){const m={};for(const id of ids)for(const [n,v] of Object.entries(R.tNet[id]||{}))m[n]=(m[n]||0)+v;return Object.entries(m).filter(([,v])=>v>0.01).sort((a,b)=>b[1]-a[1]).slice(0,k);} diff --git a/src/game/94-dashboard/10-progress.js b/src/game/94-dashboard/10-progress.js new file mode 100644 index 0000000..be14c3a --- /dev/null +++ b/src/game/94-dashboard/10-progress.js @@ -0,0 +1,30 @@ +/* ---------- scenario and level progress (#34) ---------- */ +// Red Sea Crisis (#113): traffic your links carry into and out of Asia, and how long it has stayed above the goal. +const RS_G=80,RS_DAYS=30,asiaG=()=>S.links.reduce((a,l)=>a+((CITY[l.a].reg==='AS')!==(CITY[l.b].reg==='AS')?(R.load[l.id]||0):0),0); +const pSrv=g=>({l:tr('common.traffic_served'),v:R.served,max:g,txt:`${fmtG(R.served)} / ${fmtG(g)}`}); +const pReach=()=>({l:tr('common.reach'),v:R.reach,max:0.99,txt:`${pct(R.reach)} / 99%`}); +const pChk=(l,ok)=>({l,v:ok?1:0,max:1,txt:ok?'✓':'—'}); +const SCN_PROG={stg:()=>[{l:tr('common.reach'),v:R.reach,max:0.45,txt:`${pct(R.reach)} / 45%`},pSrv(300)],redsea:()=>{const g=asiaG(),n=S.stats.asiaRun||0;return [pChk(tr('progress.a_path_from_marseille_to_singapore'),pathExists('mrs','sin')),{l:tr('progress.your_traffic_to_and_from_asia'),v:Math.min(g,RS_G),max:RS_G,txt:`${fmtG(g)} / ${fmtG(RS_G)}`},{l:tr('progress.days_in_a_row_at_g',{g:fmtG(RS_G)}),v:n,max:RS_DAYS,txt:`${n} / ${RS_DAYS}`}];},spat:()=>[pReach(),pSrv(150)], + carnaval:()=>[pChk(tr('progress.carnaval_delivered_in_full'),(S.stats.evFull||0)>=1)],ixbr:()=>{const n=brIxN();return [{l:tr('progress.ix_brrr_ports'),v:n,max:15,txt:`${n} / 15`},pChk(tr('progress.a_port_on_ix_brrr_manaus'),S.ixp.mao!==undefined),pSrv(200)];}, + c2c:()=>[pChk(tr('progress.a_path_from_cape_town_to'),pathExists('cpt','cai')),...['lag','nbo'].map(c=>pChk(tr('progress.pop_in_city',{city:CITY[c].name}),!!S.pops[c])),pSrv(150)], + pac:()=>[pChk(tr('progress.1_6t_on_every_hop_from'),fastPath('lax','syd',1600)),pChk(tr('progress.a_path_from_los_angeles_to'),pathExists('lax','tok')),pSrv(150)], + atl:()=>[pChk(tr('progress.1_6t_on_every_hop_from_a90b'),fastPath('mia','mad',1600)),pChk(tr('progress.1_6t_on_every_hop_from_da01'),fastPath('lis','lag',1600)),pSrv(100)], + darien:()=>[...['bog','lim','scl','sao'].map(c=>pChk(tr('progress.pop_in_city',{city:CITY[c].name}),!!S.pops[c])),pSrv(150)], + gangnam:()=>[pReach(),pSrv(200)], + fttb:()=>[...AU_BB.map(c=>pChk(tr('progress.broadband_in_city',{city:CITY[c].name}),!!(S.pops[c]&&S.pops[c].bb))),{l:tr('common.cables_overseas'),v:Math.min(2,auExits()),max:2,txt:`${auExits()} / 2`}], + flood:()=>{const ok=S.stats.ddosOk||0,big=S.stats.ddosOkBig||0,attacks=ddosAll(); + return [{l:tr('common.floods_held'),v:ok,max:20,txt:`${ok} / 20`},{l:tr('progress.terabit_floods_held'),v:big,max:5,txt:`${big} / 5`},{l:tr('progress.floods_that_got_through'),v:0,max:0,txt:String(S.stats.ddosLost||0)}].concat(attacks.map(a=>({l:tr('progress.under_attack_now'),v:0,max:0,txt:`${fmtG(a.gbps)} · ${CITY[a.city].name} · ${pct(a.worst===undefined?1:a.worst)}`})));},baltic:()=>[{l:tr('progress.days_in_a_row_with_99'),v:S.stats.clean||0,max:90,txt:tr('progress.n_of_m',{n:S.stats.clean||0,m:90})}]}; +function scnProg(){const sc=S&&S.scn;if(!sc)return null; + if(sc.id==='weekly')return {goal:tr('common.serve_as_much_traffic_as_you'),items:[{l:tr('progress.your_score_peak_traffic'),v:0,max:0,txt:fmtG(S.stats.peak||0)}],f:Math.min(1,S.day/sc.days)}; + const def=SCN.find(x=>x.id===sc.id),fn=SCN_PROG[sc.id];if(!def)return null;let items=[];try{items=fn?fn():[];}catch(e){items=[];} + 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=>`
${esc(x.l)}${esc(x.txt)}
${x.max?`
`:''}`; +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?`${tr('progress.done_in_d_days',{d:sc.done})}`:sc.failed?`${tr('common.time_s_up')}`:tr('common.n_days_left',{n:left}); + return `
${tr('common.scenario')} · ${Math.round(P.f*100)}%
${esc(sc.name)}
🎯 ${esc(P.goal)}
${P.items.map(pRow).join('')}
${tr('common.time')}${st}
`;} +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;} +// Lost Tier 1 status explains itself where you look for it, not only in a toast you may have missed (#73). +const t1Note=()=>S.won&&!isTier1()?`

${tr('progress.not_tier_1_right_now_why',{why:esc(t1Why())})}

`:''; +function lvlCard(){const lv=S.lvl||1,nx=LEVELS[lv]; + return `
${tr('progress.customer_level_lv_of_max',{lv,max:LEVELS.length})}
${esc(LEVELS[lv-1].n)}
${esc(LEVELS[lv-1].q)}
${t1Note()}${nx?`
${tr('progress.next_name_unlocks_what',{name:esc(nx.n),what:esc(lc1(nx.unlock))})}
${lvlItems().map(pRow).join('')}`:`
${tr('common.every_customer_type_is_unlocked_go')}
`}
`;} diff --git a/src/game/94-dashboard/20-meet-a-network.js b/src/game/94-dashboard/20-meet-a-network.js new file mode 100644 index 0000000..344f305 --- /dev/null +++ b/src/game/94-dashboard/20-meet-a-network.js @@ -0,0 +1,31 @@ +/* ---------- where to meet a network (#12, #111, #121) ---------- */ +// Static: the cities where a network takes PNIs and the exchanges it sits on. Built once, on first use. +let PLACES=null; +function netPlaces(id){if(!PLACES){PLACES={};for(const n of NETS)PLACES[n.id]={p:n.pops.filter(c=>CITY[c]&&!CITY[c].off),x:[]}; + for(const c of CITIES)if(c.ix&&!c.off)for(const n of NETS)if(n.ix==='ALL'||(Array.isArray(n.ix)&&n.ix.includes(c.id)))PLACES[n.id].x.push(c.id); + for(const X of XIX)for(const m of X.members)if(PLACES[m])PLACES[m].x.push(X.id);}return PLACES[id];} +// km from each city to your nearest POP, cached until the set of POPs changes. +let NEARK='',NEARM=null; +function popNear(){const ps=Object.keys(S.pops),k=ps.join();if(k!==NEARK||!NEARM){NEARK=k;NEARM={};for(const c of CITIES)NEARM[c.id]=ps.length?Math.min(...ps.map(q=>q===c.id?0:kmBetween(q,c.id))):0;}return NEARM;} +// One entry per city: can you PNI there, which of its exchanges have them. Your POPs first, then nearest. +let SPOTK='',SPOTM={}; +function meetSpots(id){const near=popNear();if(SPOTK!==NEARK){SPOTK=NEARK;SPOTM={};}if(SPOTM[id])return SPOTM[id];const P=netPlaces(id),m={};if(!P)return []; + for(const c of P.p)(m[c]||(m[c]={c,pni:false,ix:[]})).pni=true; + for(const x of P.x){const c=ixCity(x);if(CITY[c])(m[c]||(m[c]={c,pni:false,ix:[]})).ix.push(x);} + return SPOTM[id]=Object.values(m).sort((a,b)=>(!!S.pops[b.c]-!!S.pops[a.c])||(near[a.c]-near[b.c])||(a.c[x.pni?'PNI':'',...x.ix.map(ixName)].filter(Boolean).join(' · '); + return `
${tr('meet_a_network.where_to_meet_them')}
${sp.slice(0,max).map(x=>btn(`${esc(CITY[x.c].name)} ${esc(lab(x))}`,'meetGo',{city:x.c},S.pops[x.c]?'sm':'ghost sm')).join('')}${sp.length>max?btn(tr('dashboard.n_more',{n:sp.length-max}),'netFocus',{id:n.id},'ghost sm'):''}
`;} +// The nearest place to meet a network you have no POP for, for one-line hints. +function nearestSpot(id){const x=meetSpots(id)[0];return x&&!S.pops[x.c]?x:null;} +// Networks you reach only through transit, biggest first: what stands between you and Tier 1. +const ntLost=()=>NETS.filter(n=>!R.nt[n.id]).sort((a,b)=>NSH[b.id]-NSH[a.id]); +function t1Card(){const cur=GOALS.find(g=>S.done[g.id]===undefined);if(!((cur&&cur.id==='t1')||S.won)||isTier1())return ''; + const need=t1Need(),miss=need.filter(n=>!S.pni.some(p=>p.net===n.id&&pniOn(p))),club=t1Club(),lost=ntLost(),nb=n=>btn(esc(n.name),'netFocus',{id:n.id},'ghost sm'); + let h=`
${tr('common.goal')} · ${tr('common.go_transit_free_tier_1')}
${tr('meet_a_network.road_to_tier_1')}
`; + h+=pRow({l:tr('meet_a_network.transit_ports_to_cancel'),v:S.transit.length?0:1,max:1,txt:S.transit.length?String(S.transit.length):'✓'}); + h+=pRow({l:tr('meet_a_network.pnis_with_every_tier_1'),v:need.length-miss.length,max:need.length,txt:`${need.length-miss.length} / ${need.length}`}); + if(miss.length)h+=`
${miss.map(nb).join('')}
`+(club.ok?'':`

${tr('meet_a_network.tier_1s_only_take_a_pni',{list:club.missing.join(', ')})}

`); + h+=pRow({l:tr('meet_a_network.reach_without_transit'),v:Math.min(R.reachNT,0.999),max:0.999,txt:`${reachPct(R.reachNT)} / 99.9%`}); + if(lost.length)h+=`
${lost.slice(0,3).map(nb).join('')}${btn(trn('meet_a_network.all_n_out_of_reach',lost.length),'netFilter',{f:'out'},'pink sm')}
`; + return h+'
';} diff --git a/src/game/94-dashboard/30-customers.js b/src/game/94-dashboard/30-customers.js new file mode 100644 index 0000000..a4d75ba --- /dev/null +++ b/src/game/94-dashboard/30-customers.js @@ -0,0 +1,34 @@ +/* ---------- customers overview (#13, #14, #15) ---------- */ +const bizMo=b=>{const T=BIZ_T[b.type];return T.event?0:T.fiber?b.rate:b.bw*b.rate;}; +// Why a customer is unhappy, in the same terms the daily mood update uses. +function bizWhy(b){const T=BIZ_T[b.type],out=[];if(T.event&&!eventLive(b))return out; + const sf=bizSf(b);if(sf<0.95)out.push(T.fiber?tr('customers.their_fiber_is_down'):tr('customers.getting_only_p_of_the_bandwidth',{p:pct(sf)})); + if(!(T.l2||T.fiber)&&R.reach<=0.99&&!scnRule('local'))out.push(tr('customers.you_cannot_reach_the_whole_internet',{p:pct(R.reach)})); + if(b.type==='scrub'&&!hasScrub())out.push(tr('common.needs_a_scrubbing_center')); + {const q=b.type==='scrub'&&scrubFar(b.city);if(q)out.push(tr('customers.attacks_on_city_are_hauled_to',{city:CITY[b.city].name,to:CITY[q.to].name,ms:Math.round(q.ms)}));} + for(const k of b.reqs||[])if(REQS[k]&&!REQS[k].ok(b))out.push(typeof REQS[k].l==='function'?REQS[k].l(b):REQS[k].l); + return out;} +const moodCls=m=>m<30?'bad':m<60?'warn':''; +const custStats=()=>{const bz=S.biz.filter(b=>!BIZ_T[b.type].event),mo=bz.reduce((a,b)=>a+bizMo(b),0); + return {n:bz.length,unhappy:bz.filter(b=>b.mood<60).length,furious:bz.filter(b=>b.mood<30).length,avg:bz.length?(mo>0?bz.reduce((a,b)=>a+b.mood*bizMo(b),0)/mo:bz.reduce((a,b)=>a+b.mood,0)/bz.length):100,risk:bz.filter(b=>b.mood<60).reduce((a,b)=>a+bizMo(b),0)};}; +// Long lists show their first rows and grow on request: a thousand rows of buttons take the browser a long time to +// lay out again every day, worst of all on a phone. Filters, sorting and totals still cover every row. +const LIST_PAGE=100,listN=k=>(UI.listN&&UI.listN[k])||LIST_PAGE,listReset=k=>{if(UI.listN)delete UI.listN[k];}; +const listMore=(k,n,lab)=>n>listN(k)?`
${btn(lab(Math.min(LIST_PAGE,n-listN(k))),'listMore',{k},'ghost sm')}
`:''; +function custSection(){const F=UI.kf||{};let h=`

${tr('common.customers')}

`; + if(!S.biz.length)return h+`

${tr('customers.no_customers_yet_offers_show_up')}

`; + const st=custStats(); + h+=`

${tr('customers.everyone_who_pays_you_happiest_last')}

`; + h+=`
${tr('common.happiness')}
${Math.round(st.avg)}%
${tr('customers.weighted_by_what_they_pay')}
${tr('common.unhappy')}
${st.unhappy}
${trn('customers.n_furious',st.furious)}
${tr('common.at_risk')}
${tr('common.price_mo',{price:fmt$(st.risk)})}
${tr('customers.from_unhappy_customers')}
`; + const cities=[...new Set(S.biz.map(b=>b.city))].sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name)); + h+=`
${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')}
`; + 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))); + const sk=UI.custSort||'mood',dir=UI.custDir||1,val=b=>sk==='name'?b.name.toLowerCase():sk==='city'?CITY[b.city].name:sk==='mo'?bizMo(b):b.mood; + rows.sort((a,b)=>{const A=val(a),B=val(b);return (AB?1:0)*dir||a.mood-b.mood;}); + if(!rows.length)return h+`

${F.f?tr('customers.nobody_is_unhappy_enjoy_it_while'):tr('customers.no_customers_here')}

`; + 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?' ▲':' ▼'; + const sorts=[['mood',tr('common.happiness')],['mo',tr('common.per_month')],['name',tr('common.name')],['city',tr('common.where')]]; + h+=`
${sorts.map(([k,l])=>btn(l+(sk===k?(dir>0?' ▲':' ▼'):''),'custSort',{k},sk===k?'pink sm':'ghost sm')).join('')}
`; + h+=rows.slice(0,listN('cust')).map(b=>{const why=bizWhy(b),grace=S.day-(b.since||0)<15;return `
${esc(b.name)} ${esc(BIZ_T[b.type].l)}
${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))})}`:''}
${bRisk(b)}${why.length?`
${why.map(esc).join(' · ')}
`:''}
${tr('common.happiness_p',{p:Math.round(b.mood)})}${trend(b)}
${btn(tr('common.open'),'custGo',{id:b.id},'ghost sm')}
`;}).join(''); + return h+listMore('cust',rows.length,n=>trn('customers.n_more_customer',n))+`
`;} diff --git a/src/game/94-dashboard/40-connections.js b/src/game/94-dashboard/40-connections.js new file mode 100644 index 0000000..90b21d1 --- /dev/null +++ b/src/game/94-dashboard/40-connections.js @@ -0,0 +1,65 @@ +/* ---------- connections overview (#31, #33, #38) ---------- + Every transit port, PNI, IX port, cache and fabric port in one list, filterable by type, city and + network, with a jump to the POP that holds it. The Networks tab shows the same per network. */ +const CONN_K={t:N_('common.transit'),p:'PNI',ix:'IX',c:N_('common.cache'),nni:'NNI'},CONN_ORD=['t','p','ix','c','nni'],CONN_COL={t:'#FF8A3D',p:'#7B61FF',ix:'#2DB7F5',c:'#16A866',nni:'#1E2640'}; +const connTab=k=>k==='t'?'up':k==='nni'?'links':'peer'; +function conns(){const out=[],pn=(tier,n)=>(n||1)>1?`${n}×${PORT[tier].n} LAG`:PORT[tier].n; + for(const t of S.transit){const q=(R.p95&&R.p95[t.id])||0;out.push({k:'t',id:t.id,city:t.city,net:t.net,name:NET[t.net].name,port:pn(t.tier,t.n),cap:lagCap(PORT[t.tier].g,t.n),use:R.useT[t.id]||0,mo:transitMo(t,q),down:t.down>S.day||!popUp(t.city),low:t.pref==='low',note:tr('connections.95th_percentile_g',{g:fmtG(q)})});} + for(const x of S.pni){const u=R.usePni[x.id]||0;out.push({k:'p',id:x.id,city:x.city,net:x.net,name:NET[x.net].name,port:x.g1?((x.n||1)>1?x.n+'×1G':'1G'):pn(x.tier,x.n),cap:lagCap(pniG(x),x.n),use:u,mo:pniMo(x,u),down:!popUp(x.city)||!pniOn(x),low:x.pref==='low',note:!pniOn(x)?tr('connections.on_order_n_days',{n:x.ready-S.day}):NET[x.net].pol==='paid'?tr('common.paid_peering'):''});} + for(const c in S.ixp){const ses=ixSessions(c),mine=!!S.myIx[c];out.push({k:'ix',id:c,city:ixCity(c),net:null,nets:[...ses],name:ixName(c),port:mine?tr('common.your_exchange'):pn(S.ixp[c],(S.ixn||{})[c]),cap:ixCap(c),use:R.useIx[c]||0,mo:ixMo(c),mine,down:!!(S.ev.ixdown&&S.ev.ixdown[c]>S.day),low:(S.ixPref&&S.ixPref[c])==='low',note:trn('connections.n_peering_session',ses.size)+(isRemote(c)?' · '+tr('common.remote'):'')});} + const cg={};for(const x of S.caches){const key=x.city+'|'+x.net;(cg[key]=cg[key]||[]).push(x);} + for(const key in cg){const g=cg[key],x=g[0];out.push({k:'c',id:x.id,n:g.length,city:x.city,net:x.net,name:NET[x.net].cache.name,port:trn('common.n_box',g.length),cap:CACHE_CAP*g.length,use:g.reduce((a,y)=>a+(R.useCache[y.id]||0),0),mo:CACHE_MO*g.length,down:!popUp(x.city),low:false,note:tr('common.from_net',{net:NET[x.net].name})});} + for(const x of S.nni||[])if(FAB[x.prov]&&NNI[x.tier])out.push({k:'nni',id:x.city+'|'+x.prov,city:x.city,net:null,name:FAB[x.prov].name,port:NNI[x.tier].n,cap:NNI[x.tier].g,use:nniUsed(x.city,x.prov),mo:NNI[x.tier].mo,down:!popUp(x.city),low:false,note:tr('connections.virtual_circuits_and_fabric')}); + return out;} +// Cancel straight from the list, with the same "Really?" step as the POP panel. +// Grow a connection from the list: the next port size and one more LAG member, same actions and prices as the POP panel. +function connUp(r){if(r.mine)return '';const nx=t=>PORT[t+1]&&portShown(t+1)?t+1:-1;let h=''; + if(r.k==='t'){const t=S.transit.find(x=>x.id===r.id);if(!t)return '';const n=t.n||1,i=nx(t.tier); + if(i>=0){const a={port:PORT[i].n,cost:fmt$(PORT[i].setup*n),mo:fmt$(PORT[i].tmo*n)};h+=btn(n>1?tr('common.upgrade_all_to_port_cost_mo',a):tr('common.upgrade_port_cost_mo_mo',a),'buyTransit',{city:t.city,net:t.net,tier:i},'sm',S.cashx.id===r.id);if(!p)return '';if(!pniOn(p)||p.up||msfNope(p.net,p.city))return `${!pniOn(p)||p.up?tr('common.on_order'):''}`;const n=p.n||1,i=p.g1?0:nx(p.tier),c=i>=0?(1500+PORT[i].setup/2)*n:0; + if(i>=0){const a={port:PORT[i].n,cost:fmt$(c),mo:fmt$(PORT[i].pni*n)};h+=btn(n>1?tr('common.upgrade_all_to_port_cost_mo',a):tr('common.upgrade_port_cost_mo_mo',a),'pni',{city:p.city,net:p.net,tier:i},'sm',!portOk(p.city,i)||S.cash=0)h+=btn(tr('common.upgrade_port_price',{port:PORT[i].n,price:portMo(ixPortMo(c,i)*n)}),'buyIx',{city:c,tier:i},'sm',(!!S.pops[city]&&!portOk(city,i))||(!S.pops[city]&&i>1)); + if(S.pops[city]&&!S.myIx[c]&&n1?tr('common.box_6ee3'):r.k==='nni'?tr('common.remove_port'):tr('common.remove'),'connCancel',{k:r.k,id:r.id},on?'red sm':'ghost sm');} +function connMatch(r,F){return (!F.k||r.k===F.k)&&(!F.city||r.city===F.city)&&(!F.net||r.net===F.net||(r.nets&&r.nets.includes(F.net)));} +function connSection(){const all=conns(),F=UI.cf||{}; + let h=`

${tr('common.connections')}

${tr('connections.every_port_that_connects_you_to')}

`; + if(!all.length)return h+`

${tr('connections.no_connections_yet_buy_transit_or')}

`; + const cnt=k=>all.filter(r=>r.k===k&&connMatch(r,{...F,k:null})).length; + h+=`
${btn(tr('dashboard.all_n',{n:all.filter(r=>connMatch(r,{...F,k:null})).length}),'connF',{f:'k',v:''},!F.k?'pink sm':'ghost sm')}${CONN_ORD.filter(k=>all.some(r=>r.k===k)).map(k=>btn(`${tr(CONN_K[k])} (${cnt(k)})`,'connF',{f:'k',v:k},F.k===k?'pink sm':'ghost sm')).join('')}
`; + const cities=[...new Set(all.map(r=>r.city))].sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name)); + const nets=[...new Set(all.flatMap(r=>r.net?[r.net]:(r.nets||[])))].filter(id=>NET[id]&&!NET[id].tail).sort((a,b)=>NET[a].name.localeCompare(NET[b].name)); + h+=`
${F.k||F.city||F.net?btn(tr('common.clear_filters'),'connF',{f:'all',v:''},'ghost sm'):''}
`; + const rows=all.filter(r=>connMatch(r,F)); + const sk=UI.connSort||'k',dir=UI.connDir||1,val=r=>sk==='city'?CITY[r.city].name:sk==='name'?r.name.toLowerCase():sk==='use'?(r.cap?r.use/r.cap:0):sk==='mo'?r.mo:CONN_ORD.indexOf(r.k); + rows.sort((a,b)=>{const A=val(a),B=val(b);return (AB?1:0)*dir||CONN_ORD.indexOf(a.k)-CONN_ORD.indexOf(b.k)||CITY[a.city].name.localeCompare(CITY[b.city].name)||a.name.localeCompare(b.name);}); + const tc=rows.reduce((a,r)=>a+r.cap,0),tu=rows.reduce((a,r)=>a+r.use,0),tm=rows.reduce((a,r)=>a+r.mo,0); + if(isPhone()){const st=(r)=>r.down?` ${tr('common.down')}`:r.low?` ${tr('common.backup')}`:''; + h+=`
${[['k',tr('common.type')],['city',tr('common.where')],['use',tr('common.in_use')],['mo',tr('common.per_month')]].map(([k,l])=>btn(l+(sk===k?(dir>0?' ▲':' ▼'):''),'connSort',{k},sk===k?'pink sm':'ghost sm')).join('')}
`; + h+=rows.slice(0,listN('conn')).map(r=>{const u=r.cap?r.use/r.cap:0,N=r.net&&NET[r.net];return `
${N?logo(N):``}
${esc(r.name)} ${tr(CONN_K[r.k])}${st(r)}
${esc(CITY[r.city].name)} · ${esc(r.port)} · ${tr('common.price_mo',{price:fmt$(r.mo)})}${r.note?' · '+esc(r.note):''}
${tr('common.in_use')}${fmtG(r.use)} / ${fmtCap(Math.round(r.cap))}
${r.mine?'':`
${connUp(r)}${connX(r)}
`}
${btn(tr('common.open'),'goConn',{city:r.city,k:r.k},'ghost sm')}
`;}).join(''); + return h+listMore('conn',rows.length,n=>trn('connections.n_more_connection',n))+`
${trn('connections.n_connection',rows.length)}${fmtG(tu)} / ${fmtCap(Math.round(tc))} · ${tr('common.price_mo',{price:fmt$(tm)})}
`;} + const th=(k,l,c)=>`${k?``:l}`; + h+=`
${th('k',tr('common.type'))}${th('city',tr('common.where'))}${th('name',tr('common.with'))}${th('',tr('common.port'))}${th('use',tr('common.in_use'),'r')}${th('mo',tr('common.per_month'),'r')}`; + h+=rows.slice(0,listN('conn')).map(r=>{const u=r.cap?r.use/r.cap:0,N=r.net&&NET[r.net];return ``;}).join(''); + h+=`
${tr(CONN_K[r.k])}${esc(CITY[r.city].name)}${N?logo(N):''}${esc(r.name)}${r.note?`
${esc(r.note)}`:''}
${esc(r.port)}${r.down?` ${tr('common.down')}`:r.low?` ${tr('common.backup')}`:''}${fmtG(r.use)} / ${fmtCap(Math.round(r.cap))}
${fmt$(r.mo)}
${btn(tr('common.open'),'goConn',{city:r.city,k:r.k},'ghost sm')}${connUp(r)}${connX(r)}
${trn('connections.n_connection',rows.length)}${fmtG(tu)} / ${fmtCap(Math.round(tc))}${fmt$(tm)}
${listMore('conn',rows.length,n=>trn('connections.n_more_connection',n))}