NETSCRIPT: Add "temporary" as a RunOption to run/exec/spawn (#432)

This commit is contained in:
David Walker
2023-03-21 15:54:49 -07:00
committed by GitHub
parent 042a476f78
commit 98f7f473b4
22 changed files with 611 additions and 45 deletions
+9
View File
@@ -12,6 +12,8 @@ import { isValidIPAddress } from "../utils/helpers/isValidIPAddress";
import { SpecialServers } from "./data/SpecialServers";
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import type { RunningScript } from "../Script/RunningScript";
/**
* Map of all Servers that exist in the game
* Key (string) = IP
@@ -206,10 +208,17 @@ function excludeReplacer(key: string, value: any): any {
return value;
}
function scriptFilter(script: RunningScript): boolean {
return !script.temporary;
}
function includeReplacer(key: string, value: any): any {
if (key === "logs") {
return [];
}
if (key === "runningScripts") {
return value.filter(scriptFilter);
}
return value;
}