mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-02 05:47:14 +02:00
MISC: Rework reputation bonus after installing a backdoor (#1236)
This commit is contained in:
@@ -10,6 +10,7 @@ import { Person as IPerson } from "@nsdefs";
|
||||
import { Server as IServer } from "@nsdefs";
|
||||
import { workerScripts } from "../Netscript/WorkerScripts";
|
||||
import { killWorkerScriptByPid } from "../Netscript/killWorkerScript";
|
||||
import { serverMetadata } from "./data/servers";
|
||||
|
||||
/**
|
||||
* Constructs a new server, while also ensuring that the new server
|
||||
@@ -236,6 +237,15 @@ export function isBackdoorInstalled(server: BaseServer): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isBackdoorInstalledInCompanyServer(companyName: string): boolean {
|
||||
const serverMeta = serverMetadata.find((s) => s.specialName === companyName);
|
||||
const server = GetServer(serverMeta ? serverMeta.hostname : "");
|
||||
if (!server) {
|
||||
return false;
|
||||
}
|
||||
return isBackdoorInstalled(server);
|
||||
}
|
||||
|
||||
export function getCoreBonus(cores = 1): number {
|
||||
const coreBonus = 1 + (cores - 1) / 16;
|
||||
return coreBonus;
|
||||
|
||||
Reference in New Issue
Block a user