added purchasable servers functions to get constants

This commit is contained in:
Olivier Gagnon
2018-07-19 22:21:11 -04:00
parent 5845fa8702
commit a2b5ca10ac
3 changed files with 21 additions and 2 deletions
+16
View File
@@ -1572,6 +1572,22 @@ function NetscriptFunctions(workerScript) {
};
return cancelOrder(params, workerScript);
},
getPurchasedServerLimit : function() {
if (workerScript.checkingRam) {
return updateStaticRam("getPurchasedServerLimit", CONSTANTS.ScriptGetPurchasedServerLimit);
}
updateDynamicRam("getPurchasedServerLimit", CONSTANTS.ScriptGetPurchasedServerLimit);
return CONSTANTS.PurchasedServerLimit
},
getPurchasedServerMaxRam: function() {
if (workerScript.checkingRam) {
return updateStaticRam("getPurchasedServerMaxRam", CONSTANTS.ScriptGetPurchasedServerMaxRam);
}
updateDynamicRam("getPurchasedServerMaxRam", CONSTANTS.ScriptGetPurchasedServerMaxRam);
return CONSTANTS.PurchasedServerMaxRam
},
purchaseServer : function(hostname, ram) {
if (workerScript.checkingRam) {
return updateStaticRam("purchaseServer", CONSTANTS.ScriptPurchaseServerRamCost);