Implemented several optimizations - running scripts dont keep track of script refs or a map of ALL servers. Not completely tested yet

This commit is contained in:
danielyxie
2019-02-05 23:06:48 -08:00
parent dc63b14476
commit 8c8e3f2476
11 changed files with 98 additions and 771 deletions
+4 -4
View File
@@ -13,10 +13,10 @@ function unknownBladeburnerExceptionMessage(functionName, err) {
}
function checkBladeburnerAccess(workerScript, functionName) {
const accessDenied = `${functionName}() failed because you do not` +
" currently have access to the Bladeburner API. This is either" +
" because you are not currently employed at the Bladeburner division" +
" or because you do not have Source-File 7";
const accessDenied = `${functionName}() failed because you do not ` +
"currently have access to the Bladeburner API. To access the Bladeburner API" +
"you must be employed at the Bladeburner division, AND you must either be in " +
"BitNode-7 or have Source-File 7.";
const hasAccess = Player.bladeburner instanceof Bladeburner && (Player.bitNodeN === 7 || Player.sourceFiles.some(a=>{return a.n === 7}));
if(!hasAccess) {
throw makeRuntimeRejectMsg(workerScript, accessDenied);