mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 07:07:50 +02:00
MISC: Support compression of save data (#1162)
* Use Compression Streams API instead of jszip or other libraries. * Remove usage of base64 in the new binary format. * Do not convert binary data to string and back. The type of save data is SaveData, it's either string (old base64 format) or Uint8Array (new binary format). * Proper support for interacting with electron-related code. Electron-related code assumes that save data is in the base64 format. * Proper support for other tools (DevMenu, pretty-save.js). Full support for DevMenu will be added in a follow-up PR. Check the comments in src\DevMenu\ui\SaveFileDev.tsx for details.
This commit is contained in:
+2
-1
@@ -2,6 +2,7 @@ import type { ScriptFilePath } from "../Paths/ScriptFilePath";
|
||||
import type { TextFilePath } from "../Paths/TextFilePath";
|
||||
import type { Faction } from "../Faction/Faction";
|
||||
import type { Location } from "../Locations/Location";
|
||||
import { SaveData } from "../types";
|
||||
|
||||
// This enum doesn't need enum helper support for now
|
||||
/**
|
||||
@@ -70,7 +71,7 @@ export type PageContext<T extends Page> = T extends ComplexPage.BitVerse
|
||||
: T extends ComplexPage.Location
|
||||
? { location: Location }
|
||||
: T extends ComplexPage.ImportSave
|
||||
? { base64Save: string; automatic?: boolean }
|
||||
? { saveData: SaveData; automatic?: boolean }
|
||||
: T extends ComplexPage.Documentation
|
||||
? { docPage?: string }
|
||||
: never;
|
||||
|
||||
Reference in New Issue
Block a user