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:
danielyxie
2018-06-06 11:02:21 -05:00
parent f28ffcc49e
commit 82f1c14656
8 changed files with 52043 additions and 53977 deletions
+5 -1
View File
@@ -31,8 +31,12 @@ function WorkerScript(runningScriptObj) {
this.delay = null;
this.fnWorker = null; //Workerscript for a function call
this.checkingRam = false;
this.loadedFns = {}; //Stores names of fns that are "loaded" by this script, thus using RAM
this.loadedFns = {}; //Stores names of fns that are "loaded" by this script, thus using RAM. Used for static RAM evaluation
this.disableLogs = {}; //Stores names of fns that should have logs disabled
//Properties used for dynamic RAM evaluation
this.dynamicRamUsage = 1.4;
this.dynamicLoadedFns = {};
}
//Returns the server on which the workerScript is running