mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 09:42:53 +02:00
This reverts commit 92b8b58588.
Accidental merge on my part - the code is in decent shape, but isn't meant to go in for 3.0.
This commit is contained in:
+10
-17
@@ -112,7 +112,6 @@ import { NetscriptFormat } from "./NetscriptFunctions/Format";
|
||||
import { checkDarknetServer } from "./DarkNet/effects/offlineServerHandling";
|
||||
import { DarknetServer } from "./Server/DarknetServer";
|
||||
import { FragmentTypeEnum } from "./CotMG/FragmentType";
|
||||
import { PortHandle } from "./NetscriptPort";
|
||||
import { exampleDarknetServerData, ResponseCodeEnum } from "./DarkNet/Enums";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { Literatures } from "./Literature/Literatures";
|
||||
@@ -428,49 +427,47 @@ export const ns: InternalAPI<NSFull> = {
|
||||
throw helpers.errorMessage(ctx, "Takes at least 1 argument.");
|
||||
}
|
||||
const str = helpers.argsToString(args);
|
||||
const stdOut = ctx.workerScript.scriptRef.terminalStdOut;
|
||||
if (str.startsWith("ERROR") || str.startsWith("FAIL")) {
|
||||
Terminal.error(`${ctx.workerScript.name}: ${str}`);
|
||||
return;
|
||||
}
|
||||
if (str.startsWith("SUCCESS")) {
|
||||
Terminal.success(`${ctx.workerScript.name}: ${str}`, stdOut);
|
||||
Terminal.success(`${ctx.workerScript.name}: ${str}`);
|
||||
return;
|
||||
}
|
||||
if (str.startsWith("WARN")) {
|
||||
Terminal.warn(`${ctx.workerScript.name}: ${str}`, stdOut);
|
||||
Terminal.warn(`${ctx.workerScript.name}: ${str}`);
|
||||
return;
|
||||
}
|
||||
if (str.startsWith("INFO")) {
|
||||
Terminal.info(`${ctx.workerScript.name}: ${str}`, stdOut);
|
||||
Terminal.info(`${ctx.workerScript.name}: ${str}`);
|
||||
return;
|
||||
}
|
||||
Terminal.print(`${ctx.workerScript.name}: ${str}`, stdOut);
|
||||
Terminal.print(`${ctx.workerScript.name}: ${str}`);
|
||||
},
|
||||
tprintf:
|
||||
(ctx) =>
|
||||
(_format, ...args) => {
|
||||
const format = helpers.string(ctx, "format", _format);
|
||||
const str = vsprintf(format, args);
|
||||
const stdOut = ctx.workerScript.scriptRef.terminalStdOut;
|
||||
|
||||
if (str.startsWith("ERROR") || str.startsWith("FAIL")) {
|
||||
Terminal.error(`${str}`);
|
||||
return;
|
||||
}
|
||||
if (str.startsWith("SUCCESS")) {
|
||||
Terminal.success(`${str}`, stdOut);
|
||||
Terminal.success(`${str}`);
|
||||
return;
|
||||
}
|
||||
if (str.startsWith("WARN")) {
|
||||
Terminal.warn(`${str}`, stdOut);
|
||||
Terminal.warn(`${str}`);
|
||||
return;
|
||||
}
|
||||
if (str.startsWith("INFO")) {
|
||||
Terminal.info(`${str}`, stdOut);
|
||||
Terminal.info(`${str}`);
|
||||
return;
|
||||
}
|
||||
Terminal.print(`${str}`, stdOut);
|
||||
Terminal.print(`${str}`);
|
||||
},
|
||||
clearLog: (ctx) => () => {
|
||||
ctx.workerScript.scriptRef.clearLog();
|
||||
@@ -1510,8 +1507,8 @@ export const ns: InternalAPI<NSFull> = {
|
||||
const name = helpers.string(ctx, "name", _name);
|
||||
return getRamCost(name.split("."), true);
|
||||
},
|
||||
tprintRaw: (ctx) => (value) => {
|
||||
Terminal.printRaw(wrapUserNode(value), ctx.workerScript.scriptRef.terminalStdOut);
|
||||
tprintRaw: () => (value) => {
|
||||
Terminal.printRaw(wrapUserNode(value));
|
||||
},
|
||||
printRaw: (ctx) => (value) => {
|
||||
ctx.workerScript.print(wrapUserNode(value));
|
||||
@@ -1527,10 +1524,6 @@ export const ns: InternalAPI<NSFull> = {
|
||||
//Script **must** be a script at this point
|
||||
return compile(script as Script, server.scripts);
|
||||
},
|
||||
getStdin: (ctx) => () => {
|
||||
const stdinHandle = ctx.workerScript.scriptRef.stdin?.handle;
|
||||
return stdinHandle ? new PortHandle(stdinHandle.n) : null;
|
||||
},
|
||||
flags: Flags,
|
||||
heart: { break: () => () => Player.karma },
|
||||
...NetscriptExtra(),
|
||||
|
||||
Reference in New Issue
Block a user