From 366c44d5c2b9c734bedc257fbabe292788a71f2e Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Thu, 29 Jan 2026 03:10:13 +0700 Subject: [PATCH] API: Add warning when installing backdoor on backdoored server with Singularity API (#2458) --- src/NetscriptFunctions/Singularity.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index d66a48eb3..22b04a3ff 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -529,6 +529,14 @@ export function NetscriptSingularity(): InternalAPI { throw helpers.errorMessage(ctx, canHack.msg || ""); } + if (server.backdoorInstalled) { + helpers.log( + ctx, + () => + "You have already installed a backdoor on this server. You can check if the server has a backdoor installed " + + "with ns.getServer().backdoorInstalled.", + ); + } helpers.log( ctx, () => `Installing backdoor on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(installTime, true)}`,