API: Move and rename purchased server functions to cloud API (#2367)

* 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
This commit is contained in:
gmcew
2025-11-07 20:10:33 +00:00
committed by GitHub
parent d1a4ec8337
commit 7c0286222c
58 changed files with 1301 additions and 1045 deletions
+13 -13
View File
@@ -41,10 +41,6 @@ export const RamCostConstants = {
HNUpgCore: 0.8,
GetStock: 2.0,
BuySellStock: 2.5,
GetPurchaseServer: 0.25,
PurchaseServer: 2.25,
GetPurchasedServerLimit: 0.05,
GetPurchasedServerMaxRam: 0.05,
Round: 0.05,
ReadWrite: 1.0,
ArbScript: 1.0,
@@ -226,6 +222,18 @@ const singularity = {
getUnlockedAchievements: SF4Cost(RamCostConstants.SingularityFn3),
} as const;
const cloud = {
getServerLimit: 0.05,
getRamLimit: 0.05,
getServerCost: 0.25,
getServerUpgradeCost: 0.1,
getServerNames: 1.05,
upgradeServer: 0.25,
renameServer: 0,
purchaseServer: 2.25,
deleteServer: 2.25,
} as const;
const format = {
number: 0,
ram: 0,
@@ -500,6 +508,7 @@ export const RamCosts: RamCostTree<NSFull> = {
stock,
singularity,
format,
cloud,
gang,
go,
bladeburner,
@@ -577,15 +586,6 @@ export const RamCosts: RamCostTree<NSFull> = {
serverExists: RamCostConstants.GetServer,
fileExists: RamCostConstants.FileExists,
isRunning: RamCostConstants.IsRunning,
getPurchasedServerLimit: RamCostConstants.GetPurchasedServerLimit,
getPurchasedServerMaxRam: RamCostConstants.GetPurchasedServerMaxRam,
getPurchasedServerCost: RamCostConstants.GetPurchaseServer,
getPurchasedServerUpgradeCost: 0.1,
getPurchasedServers: 1.05,
upgradePurchasedServer: 0.25,
renamePurchasedServer: 0,
purchaseServer: RamCostConstants.PurchaseServer,
deleteServer: RamCostConstants.PurchaseServer,
write: 0,
tryWritePort: 0,
read: 0,