Bug fixes for new Netscript commands. Added total Playtime statistics. Minor UI improvements

This commit is contained in:
Daniel Xie
2017-05-15 09:15:59 -05:00
parent f32ec4f9a7
commit 3919d3e97a
11 changed files with 57 additions and 36 deletions
+4
View File
@@ -638,6 +638,7 @@ function evaluate(exp, workerScript) {
reject(e);
});
} else if (exp.func.value == "run") {
console.log("run() called");
if (exp.args.length != 1) {
reject("|"+workerScript.serverIp+"|"+workerScript.name+"|run() call has incorrect number of arguments. Takes 1 argument");
}
@@ -660,10 +661,12 @@ function evaluate(exp, workerScript) {
reject(e);
});
} else if (exp.func.value == "getHackingLevel") {
console.log("getHackingLevel called");
if (exp.args.length != 0) {
reject("|"+workerScript.serverIp+"|"+workerScript.name+"|getHackingLevel() call has incorrect number of arguments. Takes 0 arguments");
}
setTimeout(function() {
console.log("About to resolve getHackingLevel");
resolve(Player.hacking_skill);
}, CONSTANTS.CodeInstructionRunTime);
} else if (exp.func.value == "getServerMoneyAvailable") {
@@ -687,6 +690,7 @@ function evaluate(exp, workerScript) {
}
}, CONSTANTS.CodeInstructionRunTime);
});
reject("|" + workerScript.serverIp + "|" + workerScript.name + "|Unrecognized function call");
break;
default: