CODEBASE: Show error dialog when finding out old bugs in pre-v2.4.0 (#1816)

* CODEBASE: Show error dialog when finding out old bugs in pre-v2.4.0

* Only show error dialog once
This commit is contained in:
catloversg
2024-12-01 06:31:44 +07:00
committed by GitHub
parent 9c7223f876
commit 7a4b3e23c1
3 changed files with 17 additions and 5 deletions
+6 -2
View File
@@ -37,6 +37,7 @@ import { CompleteRunOptions, getRunningScriptsByArgs } from "./Netscript/Netscri
import { handleUnknownError } from "./utils/ErrorHandler";
import { isLegacyScript, legacyScriptExtension, resolveScriptFilePath, ScriptFilePath } from "./Paths/ScriptFilePath";
import { root } from "./Paths/Directory";
import { exceptionAlert } from "./utils/helpers/exceptionAlert";
export const NetscriptPorts = new Map<PortNumber, Port>();
@@ -278,8 +279,11 @@ function processNetscript1Imports(code: string, workerScript: WorkerScript): { c
export function startWorkerScript(runningScript: RunningScript, server: BaseServer, parent?: WorkerScript): number {
if (server.hostname !== runningScript.server) {
// Temporarily adding a check here to see if this ever triggers
console.error(
`Tried to launch a worker script on a different server ${server.hostname} than the runningScript's server ${runningScript.server}`,
exceptionAlert(
new Error(
`Tried to launch a worker script on a different server ${server.hostname} than the runningScript's server ${runningScript.server}`,
),
true,
);
return 0;
}