Thankfully, the existing AllServers map is not exported, so we can
ensure that all the changes are only local to this file.
This also fixes a bug if renameServer was called with the same
name. (Probably calling code checked that case already.)
Subscribing or unsubscribing from within an event handler (possibly
transitively) could cause issues or even infinite loops.
This was initially fixed in #2257, which exhibited such problems.
Currently no code is known to have this issue, but it could easily come
up again in the future.
* Convert purchased server functions to cloud API
- Create `ns.cloud`
- Change `bitnode multipliers` and `server constants` wording for consistency
- change `server`, `ram` and `getting started` docs for consistency
- Added changes to 3.0.0 API Break and `setRemovedFunctions` in NetscriptFunctions.js
Tested by
- running tutorial `purchase-server-8gb.js`, and a more typical player one
- buying manually using vendor (Alpha Ent in Sector 12)
- deleting them all using script, and checked all deleted functions gave correct error
- Imported completed save to ensure auto-transfer of function work
* Revision in line with comments
- changed more `purchased` to `cloud` references
- Added BN mults auto-conversion
* Update getting_started.md
- Corrected function names for new `cloud API`
* Don't show `cloud API` warning
v3.0.0 API break auto-replaces `cloud` functions, not warning suggested.
* API Break correction
- `cloud` affected API break replacement changed to be more descriptive and functional
* Fix typo and add empty lines
* Update many things (check commit's description)
- Comments
- Terminal message
- UI Text
- TSDoc
- md docs
- Improve error messages in src\NetscriptFunctions\Cloud.ts
The primary parts are changing the way stats affect infiltration difficulty, to make rewards more intuitive and balanced, and adding a "market demand" mechanism, which kicks in when doing lots of infils quickly. With current parameters, market demand shouldn't affect manual play at all, and won't affect most auto-infil terribly (it depends how they're implemented).
This was a complex change, see PR #2210 for the full context
* DOC: Move all docs into en/ subdirectory
PR #1502 is working on adding a Chinese translation to the docs. In
general, I encouraged this (in #1452) as a path towards getting useful
translated content in the game without requiring a massive
refactor/rearchitecting of everything.
To support this, this takes the first step of moving our docs into an
en/ subdirectory, so that other languages can live alongside. No effort
is made at this time to support or select between alternate languages;
this is a pure-rename refactor.