MISC: Show custom error message when player imports decompressed save file (#2108)

This commit is contained in:
catloversg
2025-05-12 14:27:48 +07:00
committed by GitHub
parent 19120b51b7
commit 37d471fb0d

View File

@@ -318,6 +318,12 @@ class BitburnerSaveObject implements BitburnerSaveObjectType {
throw new Error("Invalid save data");
}
if (typeof saveData === "string" && saveData.startsWith(`{"ctor"`)) {
throw new Error(
"The save data is invalid. You must import the original save file. If it's a .gz file, don't decompress it.",
);
}
let decodedSaveData;
try {
decodedSaveData = await decodeSaveData(saveData);