DARKNET: Improve documentation; remove requirement that getBlockedRam and getDepth be called on a darknet server (#2472)

This commit is contained in:
Michael Ficocelli
2026-02-05 10:28:06 -05:00
committed by GitHub
parent a16706a33b
commit 0eae02adcf
8 changed files with 21 additions and 23 deletions
+3 -3
View File
@@ -19,9 +19,6 @@ import { isLabyrinthServer } from "./labyrinth";
export const handleRamBlockRemoved = (ctx: NetscriptContext, server: DarknetServer) => {
const threads = ctx.workerScript.scriptRef.threads;
const difficulty = server.difficulty + 1;
const xpGained =
Player.mults.charisma_exp * threads * 10 * 1.1 ** difficulty * ((200 + Player.skills.charisma) / 200);
Player.gainCharismaExp(xpGained);
const ramBlockRemoved = getRamBlockRemoved(server, threads);
server.blockedRam -= ramBlockRemoved;
@@ -30,6 +27,9 @@ export const handleRamBlockRemoved = (ctx: NetscriptContext, server: DarknetServ
if (server.blockedRam <= 0) {
handleRamBlockClearedRewards(server);
}
const xpGained =
Player.mults.charisma_exp * threads * 10 * 1.1 ** difficulty * ((200 + Player.skills.charisma) / 200);
Player.gainCharismaExp(xpGained);
const result = `Liberated ${formatNumber(
ramBlockRemoved,