mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
Added dynamic RAM evaluation to Netscript to prevent exploits by evading RAM usage in NetscriptJS. Calling a HacknetNode API Netscript fn now immediately updates HacknetNodeWrappers
This commit is contained in:
+13
-4
@@ -109,7 +109,9 @@ HacknetNode.prototype.purchaseLevelUpgrade = function(levels=1) {
|
||||
|
||||
//Wrapper function for Netscript
|
||||
HacknetNode.prototype.upgradeLevel = function(levels=1) {
|
||||
return this.purchaseLevelUpgrade(levels);
|
||||
let res = this.purchaseLevelUpgrade(levels);
|
||||
createPlayerHacknetNodeWrappers();
|
||||
return res;
|
||||
}
|
||||
|
||||
HacknetNode.prototype.calculateRamUpgradeCost = function() {
|
||||
@@ -140,7 +142,9 @@ HacknetNode.prototype.purchaseRamUpgrade = function() {
|
||||
|
||||
//Wrapper function for Netscript
|
||||
HacknetNode.prototype.upgradeRam = function() {
|
||||
return this.purchaseRamUpgrade();
|
||||
let res = this.purchaseRamUpgrade();
|
||||
createPlayerHacknetNodeWrappers();
|
||||
return res;
|
||||
}
|
||||
|
||||
HacknetNode.prototype.calculateCoreUpgradeCost = function() {
|
||||
@@ -151,7 +155,9 @@ HacknetNode.prototype.calculateCoreUpgradeCost = function() {
|
||||
|
||||
//Wrapper function for Netscript
|
||||
HacknetNode.prototype.getCoreUpgradeCost = function() {
|
||||
return this.calculateCoreUpgradeCost();
|
||||
let res = this.calculateCoreUpgradeCost();
|
||||
createPlayerHacknetNodeWrappers();
|
||||
return res;
|
||||
}
|
||||
|
||||
HacknetNode.prototype.purchaseCoreUpgrade = function() {
|
||||
@@ -240,7 +246,10 @@ function purchaseHacknet() {
|
||||
Player.loseMoney(cost);
|
||||
Player.hacknetNodes.push(node);
|
||||
|
||||
displayHacknetNodesContent();
|
||||
if (Engine.currentPage === Engine.Page.HacknetNodes) {
|
||||
displayHacknetNodesContent();
|
||||
}
|
||||
createPlayerHacknetNodeWrappers();
|
||||
updateTotalHacknetProduction();
|
||||
return numOwned;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user