mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 22:38:34 +02:00
fix a few things about getRecentScritps
This commit is contained in:
@@ -5,15 +5,11 @@ import { WorkerScript } from "./WorkerScript";
|
||||
export const recentScripts: RecentScript[] = [];
|
||||
|
||||
export function AddRecentScript(workerScript: WorkerScript): void {
|
||||
if (recentScripts.find((r) => r.pid === workerScript.pid)) return;
|
||||
if (recentScripts.find((r) => r.runningScript.pid === workerScript.pid)) return;
|
||||
|
||||
const killedTime = new Date();
|
||||
recentScripts.unshift({
|
||||
filename: workerScript.name,
|
||||
args: workerScript.args,
|
||||
pid: workerScript.pid,
|
||||
timestamp: killedTime,
|
||||
timestampEpoch: killedTime.getTime(),
|
||||
timeOfDeath: killedTime,
|
||||
runningScript: workerScript.scriptRef,
|
||||
});
|
||||
|
||||
@@ -23,10 +19,6 @@ export function AddRecentScript(workerScript: WorkerScript): void {
|
||||
}
|
||||
|
||||
export interface RecentScript {
|
||||
filename: string;
|
||||
args: string[];
|
||||
pid: number;
|
||||
timestamp: Date;
|
||||
timestampEpoch: number;
|
||||
timeOfDeath: Date;
|
||||
runningScript: RunningScript;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user