mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-19 07:48:37 +02:00
SAVEGAME: Reduce size of savefile (#1148)
Storing less info in the save for Factions/Companies if it's still the default info
This commit is contained in:
@@ -30,15 +30,13 @@ export function Reviver(_key: string, value: unknown): any {
|
||||
if (!ctor) {
|
||||
// Known missing constructors with special handling.
|
||||
switch (value.ctor) {
|
||||
case "AllServersMap":
|
||||
console.warn("Converting AllServersMap for v0.43.1");
|
||||
case "AllServersMap": // Reviver removed in v0.43.1
|
||||
case "Industry": // No longer part of save data since v2.3.0
|
||||
case "Employee": // Entire object removed from game in v2.2.0 (employees abstracted)
|
||||
case "Company": // Reviver removed in v2.6.1
|
||||
case "Faction": // Reviver removed in v2.6.1
|
||||
console.warn(`Legacy load type ${value.ctor} converted to expected format while loading.`);
|
||||
return value.data;
|
||||
case "Industry":
|
||||
console.warn("Converting a corp from pre-2.3");
|
||||
return value.data; // Will immediately be overwritten by v2.3 save migration code
|
||||
case "Employee":
|
||||
console.warn("Converting a corp from pre-2.2");
|
||||
return value.data; // Will immediately be overwritten by v2.3 save migration code
|
||||
}
|
||||
// Missing constructor with no special handling. Throw error.
|
||||
throw new Error(`Could not locate constructor named ${value.ctor}. If the save data is valid, this is a bug.`);
|
||||
|
||||
Reference in New Issue
Block a user