DNET: Remove bonus time effect on authentication and heartbleed speed; fix ram rounding (#2627)

This commit is contained in:
Michael Ficocelli
2026-04-10 16:04:05 -07:00
committed by GitHub
parent be6fcd206f
commit 00a1bc2f6e
5 changed files with 18 additions and 17 deletions

View File

@@ -34,6 +34,7 @@ import {
import { getMostRecentAuthLog } from "../../../src/DarkNet/models/packetSniffing";
import type { Result } from "@nsdefs";
import { assertNonNullish } from "../../../src/utils/TypeAssertion";
import { roundToTwo } from "../../../src/utils/helpers/roundToTwo";
const hostnameOfNonExistentServer = "fake-server";
const errorMessageForNonExistentServer = `Invalid host: '${hostnameOfNonExistentServer}'`;
@@ -53,7 +54,9 @@ beforeEach(() => {
getDarkscapeNavigator();
Player.getHomeComputer().programs.push(CompletedProgramName.formulas);
Player.mults.charisma = 1e10;
Player.mults.hacking = 1e10;
Player.gainCharismaExp(1e100);
Player.gainHackingExp(1e100);
getNsOnServerNearLabyrinth();
});
@@ -1223,9 +1226,13 @@ describe("Use IP instead of hostname", () => {
server.ramUsed = server.blockedRam = 1;
const ns = getNS(server.hostname);
const initialBlockedRam = server.blockedRam;
const result3 = await ns.dnet.memoryReallocation(ns.getIP());
const updatedBlockedRam = getDarknetServerOrThrow(server.hostname).blockedRam;
expect(result3.success).toStrictEqual(true);
expect(result3.code).toStrictEqual(ResponseCodeEnum.Success);
expect(updatedBlockedRam).toBeLessThan(initialBlockedRam);
expect(updatedBlockedRam).toEqual(roundToTwo(updatedBlockedRam));
});
test("getBlockedRam", () => {
const ns = getNsOnNonDarkwebDarknetServer();