mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-08 08:37:48 +02:00
DARKNET: Darkweb Expansion Project & Bitnode (#2139)
This is BN15. It is a really big change; see the PR for all the details.
This commit is contained in:
committed by
GitHub
parent
a674633f6c
commit
6073964768
@@ -29,9 +29,12 @@ import { handleGetSaveDataInfoError } from "./utils/ErrorHandler";
|
||||
import { isObject, assertObject } from "./utils/TypeAssertion";
|
||||
import { evaluateVersionCompatibility } from "./utils/SaveDataMigrationUtils";
|
||||
import { Reviver } from "./utils/GenericReviver";
|
||||
import { populateDarknet } from "./DarkNet/controllers/NetworkGenerator";
|
||||
import { getDarkNetSave, loadDarkNet } from "./DarkNet/effects/SaveLoad";
|
||||
import { giveExportBonus } from "./ExportBonus";
|
||||
import { loadInfiltrations } from "./Infiltration/SaveLoadInfiltration";
|
||||
import { InfiltrationState } from "./Infiltration/formulas/game";
|
||||
import { hasDarknetAccess } from "./DarkNet/utils/darknetAuthUtils";
|
||||
|
||||
/* SaveObject.js
|
||||
* Defines the object used to save/load games
|
||||
@@ -85,6 +88,7 @@ export type BitburnerSaveObjectType = {
|
||||
LastExportBonus?: string;
|
||||
StaneksGiftSave: string;
|
||||
GoSave: unknown; // "loadGo" function can process unknown data
|
||||
DarknetSave: unknown;
|
||||
InfiltrationsSave: unknown;
|
||||
};
|
||||
|
||||
@@ -196,6 +200,7 @@ class BitburnerSaveObject implements BitburnerSaveObjectType {
|
||||
LastExportBonus = "0";
|
||||
StaneksGiftSave = "";
|
||||
GoSave = "";
|
||||
DarknetSave = "";
|
||||
InfiltrationsSave = "";
|
||||
|
||||
async getSaveData(forceExcludeRunningScripts = false): Promise<SaveData> {
|
||||
@@ -217,6 +222,7 @@ class BitburnerSaveObject implements BitburnerSaveObjectType {
|
||||
this.LastExportBonus = JSON.stringify(ExportBonus.LastExportBonus);
|
||||
this.StaneksGiftSave = JSON.stringify(staneksGift);
|
||||
this.GoSave = JSON.stringify(getGoSave());
|
||||
this.DarknetSave = JSON.stringify(getDarkNetSave());
|
||||
this.InfiltrationsSave = JSON.stringify(InfiltrationState);
|
||||
|
||||
if (Player.gang) this.AllGangsSave = JSON.stringify(AllGangs);
|
||||
@@ -468,7 +474,9 @@ async function loadGame(saveData: SaveData): Promise<boolean> {
|
||||
loadCompanies(saveObj.CompaniesSave);
|
||||
loadFactions(saveObj.FactionsSave, Player);
|
||||
loadGo(saveObj.GoSave);
|
||||
loadDarkNet(saveObj.DarknetSave);
|
||||
loadInfiltrations(saveObj.InfiltrationsSave);
|
||||
|
||||
try {
|
||||
loadAliases(saveObj.AliasesSave);
|
||||
} catch (e) {
|
||||
@@ -538,6 +546,11 @@ async function loadGame(saveData: SaveData): Promise<boolean> {
|
||||
} else {
|
||||
createNewUpdateText();
|
||||
}
|
||||
|
||||
if (hasDarknetAccess()) {
|
||||
populateDarknet();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user