mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 19:37:07 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user