@etothepii/satisfactory-file-parser 3.1.3 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/parser/context/context.d.ts +1 -0
- package/build/parser/context/context.d.ts.map +1 -1
- package/build/parser/context/context.js.map +1 -1
- package/build/parser/parser.d.ts.map +1 -1
- package/build/parser/parser.js +4 -4
- package/build/parser/parser.js.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save-header.d.ts.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save-header.js +4 -3
- package/build/parser/satisfactory/save/satisfactory-save-header.js.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save.d.ts +2 -3
- package/build/parser/satisfactory/save/satisfactory-save.d.ts.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save.js +1 -2
- package/build/parser/satisfactory/save/satisfactory-save.js.map +1 -1
- package/build/parser/satisfactory/save/save-reader.d.ts +0 -20
- package/build/parser/satisfactory/save/save-reader.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save-reader.js +0 -46
- package/build/parser/satisfactory/save/save-reader.js.map +1 -1
- package/build/parser/satisfactory/save/save-writer.d.ts +0 -3
- package/build/parser/satisfactory/save/save-writer.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save-writer.js +0 -25
- package/build/parser/satisfactory/save/save-writer.js.map +1 -1
- package/build/parser/satisfactory/types/property/PropertiesList.js +1 -1
- package/build/parser/satisfactory/types/property/PropertiesList.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.d.ts +1 -1
- package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts +3 -3
- package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.js +12 -2
- package/build/parser/satisfactory/types/property/generic/MapProperty.js.map +1 -1
- package/build/parser/satisfactory/types/structs/FGDynamicStruct.d.ts +1 -0
- package/build/parser/satisfactory/types/structs/FGDynamicStruct.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/FGDynamicStruct.js +20 -13
- package/build/parser/satisfactory/types/structs/FGDynamicStruct.js.map +1 -1
- package/build/parser/satisfactory/types/structs/SaveBodyValidation.d.ts +19 -0
- package/build/parser/satisfactory/types/structs/SaveBodyValidation.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/SaveBodyValidation.js +41 -0
- package/build/parser/satisfactory/types/structs/SaveBodyValidation.js.map +1 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINItemStateFileSystem.d.ts +12 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINItemStateFileSystem.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINItemStateFileSystem.js +22 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINItemStateFileSystem.js.map +1 -0
- package/build/parser/stream/reworked/readable-stream-parser.d.ts +1 -1
- package/build/parser/stream/reworked/readable-stream-parser.d.ts.map +1 -1
- package/build/parser/stream/reworked/readable-stream-parser.js +6 -8
- package/build/parser/stream/reworked/readable-stream-parser.js.map +1 -1
- package/build/parser/stream/reworked/save-stream-json-stringifier.d.ts.map +1 -1
- package/build/parser/stream/reworked/save-stream-json-stringifier.js +1 -2
- package/build/parser/stream/reworked/save-stream-json-stringifier.js.map +1 -1
- package/build/parser/stream/reworked/save-stream-writer.class.d.ts +2 -3
- package/build/parser/stream/reworked/save-stream-writer.class.d.ts.map +1 -1
- package/build/parser/stream/reworked/save-stream-writer.class.js +4 -7
- package/build/parser/stream/reworked/save-stream-writer.class.js.map +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/BlueprintConfigReader.html +4 -4
- package/docs/classes/BlueprintConfigWriter.html +4 -4
- package/docs/classes/BlueprintReader.html +4 -4
- package/docs/classes/BlueprintWriter.html +4 -4
- package/docs/classes/CompressionLibraryError.html +2 -2
- package/docs/classes/CorruptBlueprintError.html +2 -2
- package/docs/classes/CorruptSaveError.html +2 -2
- package/docs/classes/Parser.html +6 -6
- package/docs/classes/ParserError.html +2 -2
- package/docs/classes/ReadableStreamParser.html +2 -2
- package/docs/classes/SatisfactorySave.html +3 -4
- package/docs/classes/SaveComponent.html +2 -2
- package/docs/classes/SaveEntity.html +2 -2
- package/docs/classes/SaveObject.html +2 -2
- package/docs/classes/SaveReader.html +4 -5
- package/docs/classes/SaveStreamJsonStringifier.html +2 -2
- package/docs/classes/SaveStreamWriter.html +3 -4
- package/docs/classes/SaveWriter.html +4 -5
- package/docs/classes/TimeoutError.html +2 -2
- package/docs/classes/UnimplementedError.html +2 -2
- package/docs/classes/UnsupportedVersionError.html +2 -2
- package/docs/enums/BlueprintConfigVersion.html +2 -2
- package/docs/enums/BlueprintHeaderVersion.html +2 -2
- package/docs/enums/CompressionAlgorithmCode.html +2 -2
- package/docs/enums/FactoryGameCustomVersion.html +2 -2
- package/docs/enums/RuntimeBuildableInstanceDataVersion.html +2 -2
- package/docs/enums/SaveCustomVersion.html +10 -10
- package/docs/enums/SaveHeaderType.html +2 -2
- package/docs/functions/AbstractBaseProperty.Create.html +1 -1
- package/docs/functions/ArrayProperty.CalcOverhead.html +1 -1
- package/docs/functions/ArrayProperty.Parse.html +1 -1
- package/docs/functions/ArrayProperty.Serialize.html +1 -1
- package/docs/functions/BlueprintConfig.Parse.html +1 -1
- package/docs/functions/BlueprintConfig.Serialize.html +1 -1
- package/docs/functions/BlueprintHeader.Parse.html +1 -1
- package/docs/functions/BlueprintHeader.Serialize.html +1 -1
- package/docs/functions/BoolArrayProperty.Parse.html +1 -1
- package/docs/functions/BoolArrayProperty.Serialize.html +1 -1
- package/docs/functions/BoolProperty.CalcOverhead.html +1 -1
- package/docs/functions/BoolProperty.Parse.html +1 -1
- package/docs/functions/BoolProperty.ReadValue.html +1 -1
- package/docs/functions/BoolProperty.Serialize.html +1 -1
- package/docs/functions/BoolProperty.SerializeValue.html +1 -1
- package/docs/functions/BuildableSubsystemSpecialProperties.Parse.html +1 -1
- package/docs/functions/BuildableSubsystemSpecialProperties.Serialize.html +1 -1
- package/docs/functions/BuildableTypeInstance.Parse.html +1 -1
- package/docs/functions/BuildableTypeInstance.Serialize.html +1 -1
- package/docs/functions/ByteArrayProperty.Parse.html +1 -1
- package/docs/functions/ByteArrayProperty.Serialize.html +1 -1
- package/docs/functions/ByteProperty.CalcOverhead.html +1 -1
- package/docs/functions/ByteProperty.Parse.html +1 -1
- package/docs/functions/ByteProperty.ReadValue.html +1 -1
- package/docs/functions/ByteProperty.Serialize.html +1 -1
- package/docs/functions/ByteProperty.SerializeValue.html +1 -1
- package/docs/functions/CircuitSpecialProperties.Parse.html +1 -1
- package/docs/functions/CircuitSpecialProperties.Serialize.html +1 -1
- package/docs/functions/ConveyorChainActorSpecialProperties.Parse.html +1 -1
- package/docs/functions/ConveyorChainActorSpecialProperties.Serialize.html +1 -1
- package/docs/functions/ConveyorSpecialProperties.Parse.html +1 -1
- package/docs/functions/ConveyorSpecialProperties.Serialize.html +1 -1
- package/docs/functions/DoubleArrayProperty.Parse.html +1 -1
- package/docs/functions/DoubleArrayProperty.Serialize.html +1 -1
- package/docs/functions/DoubleProperty.CalcOverhead.html +1 -1
- package/docs/functions/DoubleProperty.Parse.html +1 -1
- package/docs/functions/DoubleProperty.ReadValue.html +1 -1
- package/docs/functions/DoubleProperty.Serialize.html +1 -1
- package/docs/functions/DoubleProperty.SerializeValue.html +1 -1
- package/docs/functions/DynamicStructPropertyValue.read.html +1 -1
- package/docs/functions/DynamicStructPropertyValue.write.html +1 -1
- package/docs/functions/EmptySpecialProperties.Parse.html +1 -1
- package/docs/functions/EmptySpecialProperties.Serialize.html +1 -1
- package/docs/functions/EnumArrayProperty.Parse.html +1 -1
- package/docs/functions/EnumArrayProperty.Serialize.html +1 -1
- package/docs/functions/EnumProperty.CalcOverhead.html +1 -1
- package/docs/functions/EnumProperty.Parse.html +1 -1
- package/docs/functions/EnumProperty.ReadValue.html +1 -1
- package/docs/functions/EnumProperty.Serialize.html +1 -1
- package/docs/functions/EnumProperty.SerializeValue.html +1 -1
- package/docs/functions/FGDynamicStruct.Parse.html +1 -1
- package/docs/functions/FGDynamicStruct.Serialize.html +1 -1
- package/docs/functions/FICFrameRange.Parse.html +1 -1
- package/docs/functions/FICFrameRange.Serialize.html +1 -1
- package/docs/functions/FloatArrayProperty.Parse.html +1 -1
- package/docs/functions/FloatArrayProperty.Serialize.html +1 -1
- package/docs/functions/FloatProperty.CalcOverhead.html +1 -1
- package/docs/functions/FloatProperty.Parse.html +1 -1
- package/docs/functions/FloatProperty.ReadValue.html +1 -1
- package/docs/functions/FloatProperty.Serialize.html +1 -1
- package/docs/functions/FloatProperty.SerializeValue.html +1 -1
- package/docs/functions/GUID.read.html +1 -1
- package/docs/functions/GUID.write.html +1 -1
- package/docs/functions/GUIDInfo.read.html +1 -1
- package/docs/functions/GUIDInfo.write.html +1 -1
- package/docs/functions/Int32ArrayProperty.Parse.html +1 -1
- package/docs/functions/Int32ArrayProperty.Serialize.html +1 -1
- package/docs/functions/Int32Property.CalcOverhead.html +1 -1
- package/docs/functions/Int32Property.Parse.html +1 -1
- package/docs/functions/Int32Property.ReadValue.html +1 -1
- package/docs/functions/Int32Property.Serialize.html +1 -1
- package/docs/functions/Int32Property.SerializeValue.html +1 -1
- package/docs/functions/Int32SetProperty.Parse.html +1 -1
- package/docs/functions/Int32SetProperty.Serialize.html +1 -1
- package/docs/functions/Int64ArrayProperty.Parse.html +1 -1
- package/docs/functions/Int64ArrayProperty.Serialize.html +1 -1
- package/docs/functions/Int64Property.CalcOverhead.html +1 -1
- package/docs/functions/Int64Property.Parse.html +1 -1
- package/docs/functions/Int64Property.ReadValue.html +1 -1
- package/docs/functions/Int64Property.Serialize.html +1 -1
- package/docs/functions/Int64Property.SerializeValue.html +1 -1
- package/docs/functions/Int8Property.CalcOverhead.html +1 -1
- package/docs/functions/Int8Property.Parse.html +1 -1
- package/docs/functions/Int8Property.ReadValue.html +1 -1
- package/docs/functions/Int8Property.Serialize.html +1 -1
- package/docs/functions/Int8Property.SerializeValue.html +1 -1
- package/docs/functions/Level.ReadAllObjectContents.html +1 -1
- package/docs/functions/Level.ReadAllObjectHeaders.html +1 -1
- package/docs/functions/Level.ReadLevel.html +1 -1
- package/docs/functions/Level.ReadNObjectContents.html +1 -1
- package/docs/functions/Level.ReadNObjectHeaders.html +1 -1
- package/docs/functions/Level.SerializeAllObjectContents.html +1 -1
- package/docs/functions/Level.SerializeAllObjectHeaders.html +1 -1
- package/docs/functions/Level.SerializeLevel.html +1 -1
- package/docs/functions/LevelToDestroyedActorsMap.read.html +1 -1
- package/docs/functions/LevelToDestroyedActorsMap.write.html +1 -1
- package/docs/functions/MD5Hash.read.html +1 -1
- package/docs/functions/MD5Hash.write.html +1 -1
- package/docs/functions/MapProperty.CalcOverhead.html +1 -1
- package/docs/functions/MapProperty.Parse.html +1 -1
- package/docs/functions/MapProperty.Serialize.html +1 -1
- package/docs/functions/ObjectArrayProperty.Parse.html +1 -1
- package/docs/functions/ObjectArrayProperty.Serialize.html +1 -1
- package/docs/functions/ObjectProperty.CalcOverhead.html +1 -1
- package/docs/functions/ObjectProperty.Parse.html +1 -1
- package/docs/functions/ObjectProperty.ReadValue.html +1 -1
- package/docs/functions/ObjectProperty.Serialize.html +1 -1
- package/docs/functions/ObjectProperty.SerializeValue.html +1 -1
- package/docs/functions/ObjectReference.IsEqual.html +1 -1
- package/docs/functions/ObjectReference.read.html +1 -1
- package/docs/functions/ObjectReference.write.html +1 -1
- package/docs/functions/ObjectSetProperty.Parse.html +1 -1
- package/docs/functions/ObjectSetProperty.Serialize.html +1 -1
- package/docs/functions/ObjectsListSpecialProperties.Parse.html +1 -1
- package/docs/functions/ObjectsListSpecialProperties.Serialize.html +1 -1
- package/docs/functions/PlayerSpecialProperties.Parse.html +1 -1
- package/docs/functions/PlayerSpecialProperties.Serialize.html +1 -1
- package/docs/functions/PowerLineSpecialProperties.Parse.html +1 -1
- package/docs/functions/PowerLineSpecialProperties.Serialize.html +1 -1
- package/docs/functions/PropertiesList.ParseList.html +1 -1
- package/docs/functions/PropertiesList.ParseSingleProperty.html +1 -1
- package/docs/functions/PropertiesList.SerializeList.html +1 -1
- package/docs/functions/PropertiesList.SerializeSingleProperty.html +1 -1
- package/docs/functions/SatisfactorySaveHeader.Parse.html +1 -1
- package/docs/functions/SatisfactorySaveHeader.Serialize.html +1 -1
- package/docs/functions/SaveBodyChunks.CompressDataIntoChunks.html +1 -1
- package/docs/functions/SaveBodyChunks.DecompressChunks.html +1 -1
- package/docs/functions/SaveBodyValidation.Parse.html +1 -0
- package/docs/functions/SaveBodyValidation.Serialize.html +1 -0
- package/docs/functions/SetProperty.CalcOverhead.html +1 -1
- package/docs/functions/SetProperty.Parse.html +1 -1
- package/docs/functions/SetProperty.Serialize.html +1 -1
- package/docs/functions/SoftObjectArrayProperty.Parse.html +1 -1
- package/docs/functions/SoftObjectArrayProperty.Serialize.html +1 -1
- package/docs/functions/SoftObjectReference.read.html +1 -1
- package/docs/functions/SoftObjectReference.write.html +1 -1
- package/docs/functions/SpecialDroneActionProperties.Parse.html +1 -1
- package/docs/functions/SpecialDroneActionProperties.Serialize.html +1 -1
- package/docs/functions/SpecialProperties.ParseClassSpecificSpecialProperties.html +1 -1
- package/docs/functions/SpecialProperties.SerializeClassSpecificSpecialProperties.html +1 -1
- package/docs/functions/StrArrayProperty.Parse.html +1 -1
- package/docs/functions/StrArrayProperty.Serialize.html +1 -1
- package/docs/functions/StrProperty.CalcOverhead.html +1 -1
- package/docs/functions/StrProperty.Parse.html +1 -1
- package/docs/functions/StrProperty.ReadValue.html +1 -1
- package/docs/functions/StrProperty.Serialize.html +1 -1
- package/docs/functions/StrProperty.SerializeValue.html +1 -1
- package/docs/functions/StrSetProperty.Parse.html +1 -1
- package/docs/functions/StrSetProperty.Serialize.html +1 -1
- package/docs/functions/StructArrayProperty.Parse.html +1 -1
- package/docs/functions/StructArrayProperty.Serialize.html +1 -1
- package/docs/functions/StructProperty.CalcOverhead.html +1 -1
- package/docs/functions/StructProperty.Parse.html +1 -1
- package/docs/functions/StructProperty.ParseValue.html +1 -1
- package/docs/functions/StructProperty.Serialize.html +1 -1
- package/docs/functions/StructProperty.SerializeValue.html +1 -1
- package/docs/functions/StructSetProperty.Parse.html +1 -1
- package/docs/functions/StructSetProperty.Serialize.html +1 -1
- package/docs/functions/TextArrayProperty.Parse.html +1 -1
- package/docs/functions/TextArrayProperty.Serialize.html +1 -1
- package/docs/functions/TextProperty.CalcOverhead.html +1 -1
- package/docs/functions/TextProperty.Parse.html +1 -1
- package/docs/functions/TextProperty.ReadValue.html +1 -1
- package/docs/functions/TextProperty.Serialize.html +1 -1
- package/docs/functions/TextProperty.SerializeValue.html +1 -1
- package/docs/functions/Transform.Parse.html +1 -1
- package/docs/functions/Transform.ParseF.html +1 -1
- package/docs/functions/Transform.Serialize.html +1 -1
- package/docs/functions/Transform.SerializeF.html +1 -1
- package/docs/functions/Uint32Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint32Property.Parse.html +1 -1
- package/docs/functions/Uint32Property.ReadValue.html +1 -1
- package/docs/functions/Uint32Property.Serialize.html +1 -1
- package/docs/functions/Uint32Property.SerializeValue.html +1 -1
- package/docs/functions/Uint32SetProperty.Parse.html +1 -1
- package/docs/functions/Uint32SetProperty.Serialize.html +1 -1
- package/docs/functions/Uint64Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint64Property.Parse.html +1 -1
- package/docs/functions/Uint64Property.ReadValue.html +1 -1
- package/docs/functions/Uint64Property.Serialize.html +1 -1
- package/docs/functions/Uint64Property.SerializeValue.html +1 -1
- package/docs/functions/Uint8Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint8Property.Parse.html +1 -1
- package/docs/functions/Uint8Property.ReadValue.html +1 -1
- package/docs/functions/Uint8Property.Serialize.html +1 -1
- package/docs/functions/Uint8Property.SerializeValue.html +1 -1
- package/docs/functions/VehiclePhysicsData.Parse.html +1 -1
- package/docs/functions/VehiclePhysicsData.Serialize.html +1 -1
- package/docs/functions/VehicleSpecialProperties.Parse.html +1 -1
- package/docs/functions/VehicleSpecialProperties.Serialize.html +1 -1
- package/docs/functions/col4.ParseBGRA.html +1 -1
- package/docs/functions/col4.ParseRGBA.html +1 -1
- package/docs/functions/col4.SerializeBGRA.html +1 -1
- package/docs/functions/col4.SerializeRGBA.html +1 -1
- package/docs/functions/isArrayProperty.html +1 -1
- package/docs/functions/isBoolArrayProperty.html +1 -1
- package/docs/functions/isBoolProperty.html +1 -1
- package/docs/functions/isBuildableSubsystemSpecialProperties.html +1 -1
- package/docs/functions/isByteArrayProperty.html +1 -1
- package/docs/functions/isByteProperty.html +1 -1
- package/docs/functions/isCircuitSpecialProperties.html +1 -1
- package/docs/functions/isConveyorChainActorSpecialProperties.html +1 -1
- package/docs/functions/isConveyorSpecialProperties.html +1 -1
- package/docs/functions/isDoubleArrayProperty.html +1 -1
- package/docs/functions/isDoubleProperty.html +1 -1
- package/docs/functions/isEmptySpecialProperties.html +1 -1
- package/docs/functions/isEnumArrayProperty.html +1 -1
- package/docs/functions/isEnumProperty.html +1 -1
- package/docs/functions/isFloatArrayProperty.html +1 -1
- package/docs/functions/isFloatProperty.html +1 -1
- package/docs/functions/isInt32ArrayProperty.html +1 -1
- package/docs/functions/isInt32Property.html +1 -1
- package/docs/functions/isInt32SetProperty.html +1 -1
- package/docs/functions/isInt64ArrayProperty.html +1 -1
- package/docs/functions/isInt64Property.html +1 -1
- package/docs/functions/isInt8Property.html +1 -1
- package/docs/functions/isMapProperty.html +1 -1
- package/docs/functions/isObjectArrayProperty.html +1 -1
- package/docs/functions/isObjectProperty.html +1 -1
- package/docs/functions/isObjectSetProperty.html +1 -1
- package/docs/functions/isObjectsListSpecialProperties.html +1 -1
- package/docs/functions/isPlayerSpecialProperties.html +1 -1
- package/docs/functions/isPowerLineSpecialProperties.html +1 -1
- package/docs/functions/isSaveComponent.html +1 -1
- package/docs/functions/isSaveEntity.html +1 -1
- package/docs/functions/isSetProperty.html +1 -1
- package/docs/functions/isSoftObjectArrayProperty.html +1 -1
- package/docs/functions/isSpecialDroneActionProperties.html +1 -1
- package/docs/functions/isStrArrayProperty.html +1 -1
- package/docs/functions/isStrProperty.html +1 -1
- package/docs/functions/isStrSetProperty.html +1 -1
- package/docs/functions/isStructArrayProperty.html +1 -1
- package/docs/functions/isStructProperty.html +1 -1
- package/docs/functions/isStructSetProperty.html +1 -1
- package/docs/functions/isTextArrayProperty.html +1 -1
- package/docs/functions/isTextProperty.html +1 -1
- package/docs/functions/isUInt64Property.html +1 -1
- package/docs/functions/isUint32Property.html +1 -1
- package/docs/functions/isUint32SetProperty.html +1 -1
- package/docs/functions/isUint8Property.html +1 -1
- package/docs/functions/isVehicleSpecialProperties.html +1 -1
- package/docs/functions/vec2.Parse.html +1 -1
- package/docs/functions/vec2.ParseF.html +1 -1
- package/docs/functions/vec2.Serialize.html +1 -1
- package/docs/functions/vec2.SerializeF.html +1 -1
- package/docs/functions/vec3.Parse.html +1 -1
- package/docs/functions/vec3.ParseF.html +1 -1
- package/docs/functions/vec3.ParseInt.html +1 -1
- package/docs/functions/vec3.Serialize.html +1 -1
- package/docs/functions/vec3.SerializeF.html +1 -1
- package/docs/functions/vec3.SerializeInt.html +1 -1
- package/docs/functions/vec3.add.html +1 -1
- package/docs/functions/vec3.length.html +1 -1
- package/docs/functions/vec3.mult.html +1 -1
- package/docs/functions/vec3.norm.html +1 -1
- package/docs/functions/vec3.sub.html +1 -1
- package/docs/functions/vec4.Parse.html +1 -1
- package/docs/functions/vec4.ParseF.html +1 -1
- package/docs/functions/vec4.Serialize.html +1 -1
- package/docs/functions/vec4.SerializeF.html +1 -1
- package/docs/index.html +2 -1
- package/docs/interfaces/Blueprint.html +2 -2
- package/docs/interfaces/BlueprintConfig-1.html +2 -2
- package/docs/interfaces/SaveComponentHeader.html +2 -2
- package/docs/interfaces/SaveEntityHeader.html +2 -2
- package/docs/interfaces/SaveObjectHeader.html +2 -2
- package/docs/modules/AbstractBaseProperty.html +1 -1
- package/docs/modules/ArrayProperty.html +1 -1
- package/docs/modules/BlueprintConfig.html +1 -1
- package/docs/modules/BlueprintHeader.html +1 -1
- package/docs/modules/BoolArrayProperty.html +1 -1
- package/docs/modules/BoolProperty.html +1 -1
- package/docs/modules/BuildableSubsystemSpecialProperties.html +1 -1
- package/docs/modules/BuildableTypeInstance.html +1 -1
- package/docs/modules/ByteArrayProperty.html +1 -1
- package/docs/modules/ByteProperty.html +1 -1
- package/docs/modules/CircuitSpecialProperties.html +1 -1
- package/docs/modules/ConveyorChainActorSpecialProperties.html +1 -1
- package/docs/modules/ConveyorSpecialProperties.html +1 -1
- package/docs/modules/DoubleArrayProperty.html +1 -1
- package/docs/modules/DoubleProperty.html +1 -1
- package/docs/modules/DynamicStructPropertyValue.html +1 -1
- package/docs/modules/EmptySpecialProperties.html +1 -1
- package/docs/modules/EnumArrayProperty.html +1 -1
- package/docs/modules/EnumProperty.html +1 -1
- package/docs/modules/FGDynamicStruct.html +1 -1
- package/docs/modules/FICFrameRange.html +1 -1
- package/docs/modules/FloatArrayProperty.html +1 -1
- package/docs/modules/FloatProperty.html +1 -1
- package/docs/modules/GUID.html +1 -1
- package/docs/modules/GUIDInfo.html +1 -1
- package/docs/modules/Int32ArrayProperty.html +1 -1
- package/docs/modules/Int32Property.html +1 -1
- package/docs/modules/Int32SetProperty.html +1 -1
- package/docs/modules/Int64ArrayProperty.html +1 -1
- package/docs/modules/Int64Property.html +1 -1
- package/docs/modules/Int8Property.html +1 -1
- package/docs/modules/Level.html +1 -1
- package/docs/modules/LevelToDestroyedActorsMap.html +1 -1
- package/docs/modules/MD5Hash.html +1 -1
- package/docs/modules/MapProperty.html +1 -1
- package/docs/modules/ObjectArrayProperty.html +1 -1
- package/docs/modules/ObjectProperty.html +1 -1
- package/docs/modules/ObjectReference.html +1 -1
- package/docs/modules/ObjectSetProperty.html +1 -1
- package/docs/modules/ObjectsListSpecialProperties.html +1 -1
- package/docs/modules/PlayerSpecialProperties.html +1 -1
- package/docs/modules/PowerLineSpecialProperties.html +1 -1
- package/docs/modules/PropertiesList.html +1 -1
- package/docs/modules/SatisfactorySaveHeader.html +1 -1
- package/docs/modules/SaveBodyChunks.html +1 -1
- package/docs/modules/SaveBodyValidation.html +6 -0
- package/docs/modules/SetProperty.html +1 -1
- package/docs/modules/SoftObjectArrayProperty.html +1 -1
- package/docs/modules/SoftObjectReference.html +1 -1
- package/docs/modules/SpecialDroneActionProperties.html +1 -1
- package/docs/modules/SpecialProperties.html +1 -1
- package/docs/modules/StrArrayProperty.html +1 -1
- package/docs/modules/StrProperty.html +1 -1
- package/docs/modules/StrSetProperty.html +1 -1
- package/docs/modules/StructArrayProperty.html +1 -1
- package/docs/modules/StructProperty.html +1 -1
- package/docs/modules/StructSetProperty.html +1 -1
- package/docs/modules/TextArrayProperty.html +1 -1
- package/docs/modules/TextProperty.html +1 -1
- package/docs/modules/Transform.html +1 -1
- package/docs/modules/Uint32Property.html +1 -1
- package/docs/modules/Uint32SetProperty.html +1 -1
- package/docs/modules/Uint64Property.html +1 -1
- package/docs/modules/Uint8Property.html +1 -1
- package/docs/modules/VehiclePhysicsData.html +1 -1
- package/docs/modules/VehicleSpecialProperties.html +1 -1
- package/docs/modules/col4.html +1 -1
- package/docs/modules/vec2.html +1 -1
- package/docs/modules/vec3.html +1 -1
- package/docs/modules/vec4.html +1 -1
- package/docs/modules.html +3 -3
- package/docs/types/AbstractBaseProperty-1.html +1 -1
- package/docs/types/ArrayProperty.AvailableArrayPropertyTypes.html +1 -1
- package/docs/types/ArrayPropertyStructValueFields.html +1 -1
- package/docs/types/BasicMultipleStructPropertyValue.html +1 -1
- package/docs/types/BasicStructPropertyValue.html +1 -1
- package/docs/types/BlueprintHeader-1.html +1 -1
- package/docs/types/BoolArrayProperty-1.html +1 -1
- package/docs/types/BoolProperty-1.html +1 -1
- package/docs/types/BoxStructPropertyValue.html +1 -1
- package/docs/types/BuildableSubsystemSpecialProperties-1.html +1 -1
- package/docs/types/BuildableTypeInstance-1.html +1 -1
- package/docs/types/ByteArrayProperty-1.html +1 -1
- package/docs/types/ByteProperty-1.html +1 -1
- package/docs/types/BytePropertyValue.html +1 -1
- package/docs/types/ChunkCompressionInfo.html +1 -1
- package/docs/types/ChunkSummary.html +1 -1
- package/docs/types/CircuitSpecialProperties-1.html +1 -1
- package/docs/types/ClientIdentityInfo.html +1 -1
- package/docs/types/ConveyorChainActorSpecialProperties-1.html +1 -1
- package/docs/types/ConveyorChainSegmentSpecialProperties.html +1 -1
- package/docs/types/ConveyorItemSpecialProperties.html +1 -1
- package/docs/types/ConveyorSpecialProperties-1.html +1 -1
- package/docs/types/DoubleArrayProperty-1.html +1 -1
- package/docs/types/DoubleProperty-1.html +1 -1
- package/docs/types/DynamicStructPropertyValue-1.html +1 -1
- package/docs/types/EmptySpecialProperties-1.html +1 -1
- package/docs/types/EnumArrayProperty-1.html +1 -1
- package/docs/types/EnumProperty-1.html +1 -1
- package/docs/types/FGDynamicStruct-1.html +6 -1
- package/docs/types/FICFrameRange-1.html +1 -1
- package/docs/types/FICFrameRangeStructPropertyValue.html +1 -1
- package/docs/types/FloatArrayProperty-1.html +1 -1
- package/docs/types/FloatProperty-1.html +1 -1
- package/docs/types/GENERIC_MAP_KEY_TYPE.html +1 -1
- package/docs/types/GENERIC_MAP_VALUE_TYPE.html +1 -1
- package/docs/types/GENERIC_STRUCT_PROPERTY_VALUE.html +1 -1
- package/docs/types/GUID-1.html +1 -1
- package/docs/types/GUIDInfo-1.html +1 -1
- package/docs/types/Grids.html +1 -1
- package/docs/types/Int32ArrayProperty-1.html +1 -1
- package/docs/types/Int32Property-1.html +1 -1
- package/docs/types/Int32SetProperty-1.html +1 -1
- package/docs/types/Int64ArrayProperty-1.html +1 -1
- package/docs/types/Int64Property-1.html +1 -1
- package/docs/types/Int8Property-1.html +1 -1
- package/docs/types/InventoryItemStructPropertyValue.html +1 -1
- package/docs/types/Level-1.html +1 -1
- package/docs/types/LevelToDestroyedActorsMap-1.html +1 -1
- package/docs/types/Levels.html +1 -1
- package/docs/types/MAP_STRUCT_PROXY.html +1 -0
- package/docs/types/MD5Hash-1.html +1 -1
- package/docs/types/MapProperty-1.html +1 -1
- package/docs/types/ModData.html +1 -1
- package/docs/types/ObjectArrayProperty-1.html +1 -1
- package/docs/types/ObjectProperty-1.html +1 -1
- package/docs/types/ObjectReference-1.html +1 -1
- package/docs/types/ObjectSetProperty-1.html +1 -1
- package/docs/types/ObjectsListSpecialProperties-1.html +1 -1
- package/docs/types/PlayerSpecialProperties-1.html +1 -1
- package/docs/types/PowerLineSpecialProperties-1.html +1 -1
- package/docs/types/PropertiesMap.html +1 -1
- package/docs/types/RailroadTrackPositionStructPropertyValue.html +1 -1
- package/docs/types/RoughSaveVersion.html +1 -1
- package/docs/types/SatisfactoryModMetadata.html +1 -1
- package/docs/types/SatisfactorySaveHeader-1.html +1 -1
- package/docs/types/SaveBodyChunks-1.html +1 -1
- package/docs/types/SaveBodyValidation-1.html +1 -0
- package/docs/types/SetProperty.AvailableSetPropertyTypes.html +1 -1
- package/docs/types/SoftObjectArrayProperty-1.html +1 -1
- package/docs/types/SoftObjectReference-1.html +1 -1
- package/docs/types/SpecialDroneAction.html +1 -1
- package/docs/types/SpecialDroneActionProperties-1.html +1 -1
- package/docs/types/SpecialProperties.AvailableSpecialPropertiesTypes.html +1 -1
- package/docs/types/StrArrayProperty-1.html +1 -1
- package/docs/types/StrProperty-1.html +1 -1
- package/docs/types/StrSetProperty-1.html +1 -1
- package/docs/types/StructArrayProperty-1.html +1 -1
- package/docs/types/StructProperty-1.html +1 -1
- package/docs/types/StructSetProperty-1.html +1 -1
- package/docs/types/TextArrayProperty-1.html +1 -1
- package/docs/types/TextProperty-1.html +1 -1
- package/docs/types/TextPropertyValue.html +1 -1
- package/docs/types/Transform-1.html +1 -1
- package/docs/types/Uint32Property-1.html +1 -1
- package/docs/types/Uint32SetProperty-1.html +1 -1
- package/docs/types/Uint64Property-1.html +1 -1
- package/docs/types/Uint8Property-1.html +1 -1
- package/docs/types/VehiclePhysicsData-1.html +1 -1
- package/docs/types/VehicleSpecialProperties-1.html +1 -1
- package/docs/types/col4-1.html +1 -1
- package/docs/types/vec2-1.html +1 -1
- package/docs/types/vec3-1.html +1 -1
- package/docs/types/vec4-1.html +1 -1
- package/docs/variables/DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE.html +1 -1
- package/docs/variables/EDIT.html +1 -1
- package/docs/variables/SaveBodyChunks.HEADER_V1.html +1 -1
- package/docs/variables/SaveBodyChunks.HEADER_V2.html +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/docs/types/ByteArray4.html +0 -1
- package/docs/types/MAP_STRUCT_KEY_PROXY.html +0 -1
- package/docs/types/SaveBodyValidation.html +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
Make sure to use the same version, when parsing and serializing saves.
|
|
3
|
+
|
|
4
|
+
### [3.2.3] (2025-12-14)
|
|
5
|
+
#### Extending Mod Support
|
|
6
|
+
* Added FicsItNetworks mod support
|
|
7
|
+
#### Bugfix
|
|
8
|
+
* Made `AbstractBaseProperty` more robust, accepting any type extension.
|
|
9
|
+
#### Dependency Updates
|
|
10
|
+
|
|
11
|
+
### [3.2.2] (2025-11-29)
|
|
12
|
+
#### Bugfix
|
|
13
|
+
* Explicit return type for function
|
|
14
|
+
|
|
15
|
+
### [3.2.1] (2025-11-29)
|
|
16
|
+
#### SaveBodyValidation moved slightly
|
|
17
|
+
* `save.grids` and `save.gridHash` merged together in a `save.saveBodyValidation` property. This will not affect you, unless you specifically used them. But will break parsing/serializing saves of earlier parser versions.
|
|
18
|
+
#### MapProperty updated slightly
|
|
19
|
+
* Types exported by `MapProperty` changed slightly. The `MAP_STRUCT_KEY_PROXY` got renamed to `MAP_STRUCT_PROXY`. Values in MapProperties can be struct proxies too.
|
|
20
|
+
#### Extending Mod Support
|
|
21
|
+
* Added support for Modular Load Balancer Mod and Alternates
|
|
22
|
+
|
|
2
23
|
### [3.1.3] (2025-10-01)
|
|
3
24
|
#### Extending Mod Support
|
|
4
25
|
* Added Support for Mods that have custom levels/maps. Like the Platform Expansion Program
|
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ If you parse a U8 save/blueprint, the parser will also serialize it back to a U8
|
|
|
43
43
|
|
|
44
44
|
# Bug Reports or Feedback
|
|
45
45
|
You can always raise an issue on the linked [github project](https://github.com/etothepii4/satisfactory-file-parser) or hit me up in discord [`etothepii`](https://discordapp.com/users/268751901212803074).
|
|
46
|
+
Every mistake that i know of makes the parser more robust. It wouldnt be where it is now, without the help of a lot of people!
|
|
46
47
|
|
|
47
48
|
# Mod Support ✅
|
|
48
49
|
By Default, most Mods just reuse Properties and Structs of the base game.
|
package/build/index.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';
|
|
|
69
69
|
export * from './parser/satisfactory/types/structs/FGDynamicStruct';
|
|
70
70
|
export * from './parser/satisfactory/types/structs/GUID';
|
|
71
71
|
export * from './parser/satisfactory/types/structs/GUIDInfo';
|
|
72
|
+
export * from './parser/satisfactory/types/structs/SaveBodyValidation';
|
|
72
73
|
export * from './parser/satisfactory/types/structs/MD5Hash';
|
|
73
74
|
export * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';
|
|
74
75
|
export * from './parser/satisfactory/types/structs/ObjectReference';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"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GvE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAC1G,cAAc,wCAAwC,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAGrF,cAAc,6BAA6B,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAGvF,cAAc,2CAA2C,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -86,6 +86,7 @@ __exportStar(require("./parser/satisfactory/types/structs/DynamicStructPropertyV
|
|
|
86
86
|
__exportStar(require("./parser/satisfactory/types/structs/FGDynamicStruct"), exports);
|
|
87
87
|
__exportStar(require("./parser/satisfactory/types/structs/GUID"), exports);
|
|
88
88
|
__exportStar(require("./parser/satisfactory/types/structs/GUIDInfo"), exports);
|
|
89
|
+
__exportStar(require("./parser/satisfactory/types/structs/SaveBodyValidation"), exports);
|
|
89
90
|
__exportStar(require("./parser/satisfactory/types/structs/MD5Hash"), exports);
|
|
90
91
|
__exportStar(require("./parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange"), exports);
|
|
91
92
|
__exportStar(require("./parser/satisfactory/types/structs/ObjectReference"), exports);
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,mFAAiE;AACjE,2FAAyE;AACzE,mFAAiE;AACjE,2FAAyE;AACzE,kFAAgE;AAChE,yFAAuE;AACvE,mEAAiD;AACjD,2FAAyE;AACzE,+EAA6D;AAC7D,sFAAoE;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A3D,yGAAA,UAAU,OAAA;AACnB,sGAAkG;AAAzF,yIAAA,yBAAyB,OAAA;AAClC,8FAAqF;AAA5E,4HAAA,gBAAgB,OAAA;AAGzB,8DAA4C;AAG5C,0CAAyC;AAAhC,gGAAA,MAAM,OAAA;AACf,0FAAuF;AAA9E,8HAAA,oBAAoB,OAAA;AAG7B,4EAA0D","sourcesContent":["// types & classes for convenience\nexport * from './parser/satisfactory/blueprint/blueprint-config';\nexport * from './parser/satisfactory/blueprint/blueprint-config-version';\nexport * from './parser/satisfactory/blueprint/blueprint-header';\nexport * from './parser/satisfactory/blueprint/blueprint-header-version';\nexport * from './parser/satisfactory/blueprint/blueprint.types';\nexport * from './parser/satisfactory/save/factory-game-custom-version';\nexport * from './parser/satisfactory/save/level';\nexport * from './parser/satisfactory/save/level-to-destroyed-actors-map';\nexport * from './parser/satisfactory/save/satisfactory-save';\nexport * from './parser/satisfactory/save/satisfactory-save-header';\nexport * from './parser/satisfactory/save/save-body-chunks';\nexport * from './parser/satisfactory/save/save-custom-version';\nexport * from './parser/satisfactory/save/save-header-type';\nexport * from './parser/satisfactory/save/save.types';\nexport * from './parser/satisfactory/types/objects/SaveComponent';\nexport * from './parser/satisfactory/types/objects/SaveEntity';\nexport * from './parser/satisfactory/types/objects/SaveObject';\nexport * from './parser/satisfactory/types/property/generic/AbstractBaseProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/BoolProperty';\nexport * from './parser/satisfactory/types/property/generic/ByteProperty';\nexport * from './parser/satisfactory/types/property/generic/DoubleProperty';\nexport * from './parser/satisfactory/types/property/generic/EnumProperty';\nexport * from './parser/satisfactory/types/property/generic/FloatProperty';\nexport * from './parser/satisfactory/types/property/generic/Int32Property';\nexport * from './parser/satisfactory/types/property/generic/Int64Property';\nexport * from './parser/satisfactory/types/property/generic/Int8Property';\nexport * from './parser/satisfactory/types/property/generic/MapProperty';\nexport * from './parser/satisfactory/types/property/generic/ObjectProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/SetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/StrSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/StructSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty';\nexport * from './parser/satisfactory/types/property/generic/StrProperty';\nexport * from './parser/satisfactory/types/property/generic/StructProperty';\nexport * from './parser/satisfactory/types/property/generic/TextProperty';\nexport * from './parser/satisfactory/types/property/generic/Uint32Property';\nexport * from './parser/satisfactory/types/property/generic/Uint64Property';\nexport * from './parser/satisfactory/types/property/generic/Uint8Property';\nexport * from './parser/satisfactory/types/property/PropertiesList';\nexport * from './parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/CircuitSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ConveyorSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/EmptySpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ObjectsListSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/PlayerSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/PowerLineSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/runtime-buildable-instance-data-version';\nexport * from './parser/satisfactory/types/property/special/SpecialDroneActionProperties';\nexport * from './parser/satisfactory/types/property/special/SpecialProperties';\nexport * from './parser/satisfactory/types/property/special/VehicleSpecialProperties';\nexport * from './parser/satisfactory/types/structs/col4';\nexport * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';\nexport * from './parser/satisfactory/types/structs/FGDynamicStruct';\nexport * from './parser/satisfactory/types/structs/GUID';\nexport * from './parser/satisfactory/types/structs/GUIDInfo';\nexport * from './parser/satisfactory/types/structs/MD5Hash';\nexport * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';\nexport * from './parser/satisfactory/types/structs/ObjectReference';\nexport * from './parser/satisfactory/types/structs/SoftObjectReference';\nexport * from './parser/satisfactory/types/structs/Transform';\nexport * from './parser/satisfactory/types/structs/vec2';\nexport * from './parser/satisfactory/types/structs/vec3';\nexport * from './parser/satisfactory/types/structs/vec4';\nexport * from './parser/satisfactory/types/structs/VehiclePhysicsData';\n\n// should better be removed in a future update to prevent shenanigans.\nexport { BlueprintConfigReader, BlueprintReader } from './parser/satisfactory/blueprint/blueprint-reader';\nexport { BlueprintConfigWriter, BlueprintWriter } from './parser/satisfactory/blueprint/blueprint-writer';\nexport * from './parser/satisfactory/save/save-reader';\nexport { SaveWriter } from './parser/satisfactory/save/save-writer';\nexport { SaveStreamJsonStringifier } from './parser/stream/reworked/save-stream-json-stringifier';\nexport { SaveStreamWriter } from './parser/stream/reworked/save-stream-writer.class';\n\n// errors\nexport * from './parser/error/parser.error';\n\n// facade\nexport { Parser } from './parser/parser';\nexport { ReadableStreamParser } from './parser/stream/reworked/readable-stream-parser';\n\n// edit\nexport * from './parser/satisfactory/edit/edit-constants';\n\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,mFAAiE;AACjE,2FAAyE;AACzE,mFAAiE;AACjE,2FAAyE;AACzE,kFAAgE;AAChE,yFAAuE;AACvE,mEAAiD;AACjD,2FAAyE;AACzE,+EAA6D;AAC7D,sFAAoE;AACpE,8EAA4D;AAC5D,iFAA+D;AAC/D,8EAA4D;AAC5D,wEAAsD;AACtD,oFAAkE;AAClE,iFAA+D;AAC/D,iFAA+D;AAC/D,oGAAkF;AAClF,2GAAyF;AACzF,+GAA6F;AAC7F,+GAA6F;AAC7F,iHAA+F;AAC/F,+GAA6F;AAC7F,gHAA8F;AAC9F,gHAA8F;AAC9F,gHAA8F;AAC9F,iHAA+F;AAC/F,qHAAmG;AACnG,8GAA4F;AAC5F,iHAA+F;AAC/F,+GAA6F;AAC7F,4FAA0E;AAC1E,4FAA0E;AAC1E,8FAA4E;AAC5E,4FAA0E;AAC1E,6FAA2E;AAC3E,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,2FAAyE;AACzE,8FAA4E;AAC5E,4GAA0F;AAC1F,6GAA2F;AAC3F,uGAAqF;AACrF,0GAAwF;AACxF,6GAA2F;AAC3F,6GAA2F;AAC3F,2FAAyE;AACzE,8FAA4E;AAC5E,4FAA0E;AAC1E,8FAA4E;AAC5E,8FAA4E;AAC5E,6FAA2E;AAC3E,sFAAoE;AACpE,mHAAiG;AACjG,wGAAsF;AACtF,mHAAiG;AACjG,yGAAuF;AACvF,sGAAoF;AACpF,4GAA0F;AAC1F,uGAAqF;AACrF,0GAAwF;AACxF,uHAAqG;AACrG,4GAA0F;AAC1F,iGAA+E;AAC/E,wGAAsF;AACtF,2EAAyD;AACzD,iGAA+E;AAC/E,sFAAoE;AACpE,2EAAyD;AACzD,+EAA6D;AAC7D,yFAAuE;AACvE,8EAA4D;AAC5D,mGAAiF;AACjF,sFAAoE;AACpE,0FAAwE;AACxE,gFAA8D;AAC9D,2EAAyD;AACzD,2EAAyD;AACzD,2EAAyD;AACzD,yFAAuE;AAGvE,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,yEAAuD;AACvD,sEAAoE;AAA3D,yGAAA,UAAU,OAAA;AACnB,sGAAkG;AAAzF,yIAAA,yBAAyB,OAAA;AAClC,8FAAqF;AAA5E,4HAAA,gBAAgB,OAAA;AAGzB,8DAA4C;AAG5C,0CAAyC;AAAhC,gGAAA,MAAM,OAAA;AACf,0FAAuF;AAA9E,8HAAA,oBAAoB,OAAA;AAG7B,4EAA0D","sourcesContent":["// types & classes for convenience\nexport * from './parser/satisfactory/blueprint/blueprint-config';\nexport * from './parser/satisfactory/blueprint/blueprint-config-version';\nexport * from './parser/satisfactory/blueprint/blueprint-header';\nexport * from './parser/satisfactory/blueprint/blueprint-header-version';\nexport * from './parser/satisfactory/blueprint/blueprint.types';\nexport * from './parser/satisfactory/save/factory-game-custom-version';\nexport * from './parser/satisfactory/save/level';\nexport * from './parser/satisfactory/save/level-to-destroyed-actors-map';\nexport * from './parser/satisfactory/save/satisfactory-save';\nexport * from './parser/satisfactory/save/satisfactory-save-header';\nexport * from './parser/satisfactory/save/save-body-chunks';\nexport * from './parser/satisfactory/save/save-custom-version';\nexport * from './parser/satisfactory/save/save-header-type';\nexport * from './parser/satisfactory/save/save.types';\nexport * from './parser/satisfactory/types/objects/SaveComponent';\nexport * from './parser/satisfactory/types/objects/SaveEntity';\nexport * from './parser/satisfactory/types/objects/SaveObject';\nexport * from './parser/satisfactory/types/property/generic/AbstractBaseProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/BoolProperty';\nexport * from './parser/satisfactory/types/property/generic/ByteProperty';\nexport * from './parser/satisfactory/types/property/generic/DoubleProperty';\nexport * from './parser/satisfactory/types/property/generic/EnumProperty';\nexport * from './parser/satisfactory/types/property/generic/FloatProperty';\nexport * from './parser/satisfactory/types/property/generic/Int32Property';\nexport * from './parser/satisfactory/types/property/generic/Int64Property';\nexport * from './parser/satisfactory/types/property/generic/Int8Property';\nexport * from './parser/satisfactory/types/property/generic/MapProperty';\nexport * from './parser/satisfactory/types/property/generic/ObjectProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/SetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/StrSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/StructSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty';\nexport * from './parser/satisfactory/types/property/generic/StrProperty';\nexport * from './parser/satisfactory/types/property/generic/StructProperty';\nexport * from './parser/satisfactory/types/property/generic/TextProperty';\nexport * from './parser/satisfactory/types/property/generic/Uint32Property';\nexport * from './parser/satisfactory/types/property/generic/Uint64Property';\nexport * from './parser/satisfactory/types/property/generic/Uint8Property';\nexport * from './parser/satisfactory/types/property/PropertiesList';\nexport * from './parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/CircuitSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ConveyorSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/EmptySpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ObjectsListSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/PlayerSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/PowerLineSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/runtime-buildable-instance-data-version';\nexport * from './parser/satisfactory/types/property/special/SpecialDroneActionProperties';\nexport * from './parser/satisfactory/types/property/special/SpecialProperties';\nexport * from './parser/satisfactory/types/property/special/VehicleSpecialProperties';\nexport * from './parser/satisfactory/types/structs/col4';\nexport * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';\nexport * from './parser/satisfactory/types/structs/FGDynamicStruct';\nexport * from './parser/satisfactory/types/structs/GUID';\nexport * from './parser/satisfactory/types/structs/GUIDInfo';\nexport * from './parser/satisfactory/types/structs/SaveBodyValidation';\nexport * from './parser/satisfactory/types/structs/MD5Hash';\nexport * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';\nexport * from './parser/satisfactory/types/structs/ObjectReference';\nexport * from './parser/satisfactory/types/structs/SoftObjectReference';\nexport * from './parser/satisfactory/types/structs/Transform';\nexport * from './parser/satisfactory/types/structs/vec2';\nexport * from './parser/satisfactory/types/structs/vec3';\nexport * from './parser/satisfactory/types/structs/vec4';\nexport * from './parser/satisfactory/types/structs/VehiclePhysicsData';\n\n// should better be removed in a future update to prevent shenanigans.\nexport { BlueprintConfigReader, BlueprintReader } from './parser/satisfactory/blueprint/blueprint-reader';\nexport { BlueprintConfigWriter, BlueprintWriter } from './parser/satisfactory/blueprint/blueprint-writer';\nexport * from './parser/satisfactory/save/save-reader';\nexport { SaveWriter } from './parser/satisfactory/save/save-writer';\nexport { SaveStreamJsonStringifier } from './parser/stream/reworked/save-stream-json-stringifier';\nexport { SaveStreamWriter } from './parser/stream/reworked/save-stream-writer.class';\n\n// errors\nexport * from './parser/error/parser.error';\n\n// facade\nexport { Parser } from './parser/parser';\nexport { ReadableStreamParser } from './parser/stream/reworked/readable-stream-parser';\n\n// edit\nexport * from './parser/satisfactory/edit/edit-constants';\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/parser/context/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAK7E,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,GAAG,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/parser/context/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAK7E,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,GAAG,4BAA4B,CAAA;AAOxF,MAAM,MAAM,uBAAuB,GAAG;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,oBAAoB,CAAC;CAC1C,CAAA;AAKD,MAAM,MAAM,4BAA4B,GAAG;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,sBAAsB,EAAE,MAAM,CAAC;CAClC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/parser/context/context.ts"],"names":[],"mappings":"","sourcesContent":["import { ChunkCompressionInfo } from \"../satisfactory/save/save-body-chunks\";\n\n/**\n * Merged Context Type for Saves and Blueprints.\n */\nexport type ReaderWriterContext = SaveReaderWriterContext & BlueprintReaderWriterContext\n\n/**\n * Context for reading/writing save files.\n */\nexport type SaveReaderWriterContext = {\n saveHeaderType: number;\n saveVersion: number;\n buildVersion: number;\n mapName?: string;\n compressionInfo?: ChunkCompressionInfo;\n}\n\n/**\n * Context for reading/writing blueprint files.\n */\nexport type BlueprintReaderWriterContext = {\n headerVersion: number;\n saveVersion: number;\n buildVersion: number;\n blueprintConfigVersion: number;\n}"]}
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/parser/context/context.ts"],"names":[],"mappings":"","sourcesContent":["import { ChunkCompressionInfo } from \"../satisfactory/save/save-body-chunks\";\n\n/**\n * Merged Context Type for Saves and Blueprints.\n */\nexport type ReaderWriterContext = SaveReaderWriterContext & BlueprintReaderWriterContext\n\n/**\n * Context for reading/writing save files.\n * \n * @param mods describes a list of mod names to their versions. Some mods have special needs.\n */\nexport type SaveReaderWriterContext = {\n saveHeaderType: number;\n saveVersion: number;\n buildVersion: number;\n mods: Record<string, string>;\n mapName?: string;\n compressionInfo?: ChunkCompressionInfo;\n}\n\n/**\n * Context for reading/writing blueprint files.\n */\nexport type BlueprintReaderWriterContext = {\n headerVersion: number;\n saveVersion: number;\n buildVersion: number;\n blueprintConfigVersion: number;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAKA,OAAO,EA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oB,EAAE,YAAY,EAAE,CAAC;QACrC,gBAAgB,EAAE,WAAW,CAAA;KAC7B;WA+Ca,mBAAmB,CAChC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,eAAe,EAC9B,mBAAmB,EAAE,eAAe,EACpC,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,2BAA2B,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAA;KAC9D,CAAC,GACA,SAAS;IAoCZ,OAAc,qBAAqB,QAAS,GAAG,WAAU,MAAM,KAAO,MAAM,CAQjE;CAEX"}
|
package/build/parser/parser.js
CHANGED
|
@@ -12,6 +12,7 @@ const save_custom_version_1 = require("./satisfactory/save/save-custom-version")
|
|
|
12
12
|
const save_reader_1 = require("./satisfactory/save/save-reader");
|
|
13
13
|
const save_writer_1 = require("./satisfactory/save/save-writer");
|
|
14
14
|
const ObjectReference_1 = require("./satisfactory/types/structs/ObjectReference");
|
|
15
|
+
const SaveBodyValidation_1 = require("./satisfactory/types/structs/SaveBodyValidation");
|
|
15
16
|
class Parser {
|
|
16
17
|
static ParseSave(name, bytes, options) {
|
|
17
18
|
const reader = new save_reader_1.SaveReader(bytes, options?.onProgressCallback);
|
|
@@ -27,9 +28,7 @@ class Parser {
|
|
|
27
28
|
options.onDecompressedSaveBody(reader.getBuffer());
|
|
28
29
|
}
|
|
29
30
|
if (reader.context.saveVersion >= save_custom_version_1.SaveCustomVersion.IntroducedWorldPartition) {
|
|
30
|
-
|
|
31
|
-
save.gridHash = gridHash;
|
|
32
|
-
save.grids = grids;
|
|
31
|
+
save.saveBodyValidation = SaveBodyValidation_1.SaveBodyValidation.Parse(reader);
|
|
33
32
|
}
|
|
34
33
|
save.levels = reader.readLevels();
|
|
35
34
|
const countUnresolvedWorldSaveData = reader.readInt32();
|
|
@@ -48,10 +47,11 @@ class Parser {
|
|
|
48
47
|
writer.context.saveVersion = save.header.saveVersion;
|
|
49
48
|
writer.context.buildVersion = save.header.buildVersion;
|
|
50
49
|
writer.context.mapName = save.header.mapName;
|
|
50
|
+
writer.context.mods = Object.fromEntries(save.header.modMetadata?.Mods?.map(mod => [mod.Reference, mod.Version]) ?? []);
|
|
51
51
|
satisfactory_save_header_1.SatisfactorySaveHeader.Serialize(writer, save.header);
|
|
52
52
|
const posAfterHeader = writer.getBufferPosition();
|
|
53
53
|
if (writer.context.saveVersion >= save_custom_version_1.SaveCustomVersion.IntroducedWorldPartition) {
|
|
54
|
-
|
|
54
|
+
SaveBodyValidation_1.SaveBodyValidation.Serialize(writer, save.saveBodyValidation);
|
|
55
55
|
}
|
|
56
56
|
save_writer_1.SaveWriter.WriteLevels(writer, save);
|
|
57
57
|
if (save.unresolvedWorldSaveData && save.unresolvedWorldSaveData.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAC/D,gFAA4E;AAC5E,gFAA4E;AAC5E,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,2FAAsF;AAEtF,iFAA4E;AAC5E,iEAA6D;AAC7D,iEAA6D;AAC7D,kFAA+E;AAI/E,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAsB,EACtB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,iDAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;YAChC,MAAM,IAAI,sCAAuB,CAAC,iGAAiG,CAAC,CAAC;QACtI,C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E,CAAC;QAC/B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;SAAM,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { UnsupportedVersionError } from './error/parser.error';\nimport { BlueprintConfig } from './satisfactory/blueprint/blueprint-config';\nimport { BlueprintHeader } from './satisfactory/blueprint/blueprint-header';\nimport { BlueprintConfigReader, BlueprintReader } from \"./satisfactory/blueprint/blueprint-reader\";\nimport { BlueprintConfigWriter, BlueprintWriter } from \"./satisfactory/blueprint/blueprint-writer\";\nimport { Blueprint } from \"./satisfactory/blueprint/blueprint.types\";\nimport { SatisfactorySave } from \"./satisfactory/save/satisfactory-save\";\nimport { SatisfactorySaveHeader } from './satisfactory/save/satisfactory-save-header';\nimport { ChunkSummary } from './satisfactory/save/save-body-chunks';\nimport { SaveCustomVersion } from './satisfactory/save/save-custom-version';\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\nimport { ObjectReference } from './satisfactory/types/structs/ObjectReference';\n\n\n/** @public */\nexport class Parser {\n\n\t/**\n\t * Parses a given binary buffer as {@link SatisfactorySave}\n\t * @param name the save name. It won't be serialized, so it does not matter how you name it.\n\t * @param bytes the actual binary buffer\n\t * @param options provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.\n\t * @returns \n\t */\n\tpublic static ParseSave(\n\t\tname: string,\n\t\tbytes: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBufferLike) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes, options?.onProgressCallback);\n\n\t\tconst header = SatisfactorySaveHeader.Parse(reader);\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = inflateResult.compressionInfo;\n\n\t\t// call callback on decompressed save body\n\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t}\n\n\t\t// world partition\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tconst {gridHash, grids} = reader.readSaveBodyValidationAndGrids();\n\t\t\tsave.gridHash = gridHash;\n\t\t\tsave.grids = grids;\n\t\t}\n\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\t// unresolved data, probably not even useful.\n\t\tconst countUnresolvedWorldSaveData = reader.readInt32();\n\t\tif (countUnresolvedWorldSaveData) {\n\t\t\tsave.unresolvedWorldSaveData = [];\n\t\t\tfor (let i = 0; i < countUnresolvedWorldSaveData; i++) {\n\t\t\t\tsave.unresolvedWorldSaveData.push(ObjectReference.read(reader));\n\t\t\t}\n\t\t}\n\n\t\treader.onProgressCallback(reader.getBufferProgress(), 'finished parsing.');\n\n\t\treturn save;\n\t}\n\n\t/**\n\t * serializes a {@link SatisfactorySave} into binary and reports back on individual callbacks.\n\t * @param save the {@link SatisfactorySave} to serialize into binary.\n\t * @param options provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed.\n\t * onHeader gets called on the binary save header, which is always uncompressed.\n\t * onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.\n\t * @returns a summary of the generated chunks.\n\t */\n\tpublic static WriteSave(save: SatisfactorySave,\n\t\tonHeader: (header: Uint8Array) => void,\n\t\tonChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonBinaryBeforeCompressing: (buffer: ArrayBuffer) => void,\n\t\t}>\n\t): ChunkSummary[] {\n\n\t\tconst writer = new SaveWriter();\n\t\twriter.context.saveHeaderType = save.header.saveHeaderType;\n\t\twriter.context.saveVersion = save.header.saveVersion;\n\t\twriter.context.buildVersion = save.header.buildVersion;\n\t\twriter.context.mapName = save.header.mapName;\n\n\t\tSatisfactorySaveHeader.Serialize(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tSaveWriter.WriteSaveBodyHashAndGrids(writer, save.gridHash, save.grids);\n\t\t}\n\n\t\tSaveWriter.WriteLevels(writer, save);\n\n\t\t// unresolved data\n\t\t// TODO: check if we ever encounter it.\n\t\tif (save.unresolvedWorldSaveData && save.unresolvedWorldSaveData.length > 0) {\n\t\t\twriter.writeInt32(save.unresolvedWorldSaveData?.length ?? 0);\n\t\t\tfor (const actor of save.unresolvedWorldSaveData ?? []) {\n\t\t\t\tObjectReference.write(writer, actor);\n\t\t\t}\n\t\t}\n\n\t\twriter.endWriting();\n\t\tconst chunkSummary = writer.generateChunks(save.compressionInfo!, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);\n\t\treturn chunkSummary;\n\t}\n\n\t/**\n\t * Writes a {@link Blueprint} object to binary. And reports back on individual callbacks.\n\t * @param blueprint the blueprint to be written\n\t * @param options onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing.\n\t * onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.\n\t * @returns a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.\n\t */\n\tpublic static WriteBlueprintFiles(\n\t\tblueprint: Blueprint,\n\t\tonMainFileHeader: (header: Uint8Array) => void,\n\t\tonMainFileChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\t}>\n\t): {\n\t\tmainFileChunkSummary: ChunkSummary[],\n\t\tconfigFileBinary: ArrayBuffer\n\t} {\n\n\t\t// write main blueprint file\n\t\tconst blueprintWriter = new BlueprintWriter();\n\t\tblueprintWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintHeader.Serialize(blueprintWriter, blueprint.header);\n\t\tconst saveBodyPos = blueprintWriter.getBufferPosition();\n\t\tBlueprintWriter.SerializeObjects(blueprintWriter, blueprint.objects);\n\t\tblueprintWriter.endWriting();\n\t\tlet binaryChunks: Uint8Array[] = [];\n\t\tlet binaryHeader: Uint8Array;\n\t\tconst mainFileChunkSummary = blueprintWriter.generateChunks(\n\t\t\tblueprint.compressionInfo,\n\t\t\tsaveBodyPos,\n\t\t\t{\n\t\t\t\tonBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),\n\t\t\t\tonHeader: onMainFileHeader,\n\t\t\t\tonChunk: onMainFileChunk\n\t\t\t}\n\t\t);\n\n\t\t// write config as well.\n\t\tconst configWriter = new BlueprintConfigWriter();\n\t\tconfigWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintConfig.Serialize(configWriter, blueprint.config);\n\t\tconst configFileBinary = configWriter.endWriting();\n\n\t\treturn {\n\t\t\tmainFileChunkSummary,\n\t\t\tconfigFileBinary\n\t\t}\n\t}\n\n\t/**\n\t * Parses two buffers (main blueprint file + config file) into a {@link Blueprint object}\n\t * @param name the name of the blueprint, since it is not part of the binary data and has to be passed.\n\t * @param blueprintFile the main blueprint file \".sbp\"\n\t * @param blueprintConfigFile the config blueprint file \".sbpcfg\"\n\t * @param options provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.\n\t * @returns \n\t */\n\tpublic static ParseBlueprintFiles(\n\t\tname: string,\n\t\tblueprintFile: ArrayBufferLike,\n\t\tblueprintConfigFile: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBufferLike) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(blueprintConfigFile);\n\t\tconst config = BlueprintConfig.Parse(blueprintConfigReader);\n\n\t\t// read actual blueprint file. with context from config\n\t\tconst blueprintReader = new BlueprintReader(blueprintFile);\n\t\tblueprintReader.context.blueprintConfigVersion = config.configVersion;\n\t\tconst header = BlueprintHeader.Parse(blueprintReader);\n\t\tconst inflateResult = blueprintReader.inflateChunks();\n\n\t\t// call back on decompressed body.\n\t\tif (options?.onDecompressedBlueprintBody !== undefined) {\n\t\t\toptions.onDecompressedBlueprintBody(inflateResult.inflatedData);\n\t\t}\n\n\t\tconst blueprintObjects = BlueprintReader.ParseObjects(blueprintReader);\n\t\tconst blueprint: Blueprint = {\n\t\t\tname,\n\t\t\tcompressionInfo: blueprintReader.compressionInfo,\n\t\t\theader: header,\n\t\t\tconfig,\n\t\t\tobjects: blueprintObjects\n\t\t};\n\t\treturn blueprint;\n\t}\n\n\t/**\n\t * It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems:\n\t * 1. it cannot stringify bigints. So we help out by converting it into a string.\n\t * 2. It cannot distinguish between 0 and -0. But a float32 is encoded in a uint8Array for 0 to be [0,0,0,0] (0x00000000) and -0 to be [0,0,0,128] (0x00000080) in little endian.\n\t * @param obj basically anything that can be stringified\n\t * @param indent the indentation, just like with the real JSON stringify.\n\t * @returns a string that is safely stringified.\n\t */\n\tpublic static JSONStringifyModified = (obj: any, indent: number = 0): string =>\n\t\tJSON.stringify(obj, (key, value) => {\n\t\t\tif (typeof value === 'bigint') {\n\t\t\t\treturn value.toString();\n\t\t\t} else if (value === 0 && 1 / value < 0) {\t// -0\n\t\t\t\treturn '-0';\n\t\t\t}\n\t\t\treturn value;\n\t\t}, indent)\n\n}"]}
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAC/D,gFAA4E;AAC5E,gFAA4E;AAC5E,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,2FAAsF;AAEtF,iFAA4E;AAC5E,iEAA6D;AAC7D,iEAA6D;AAC7D,kFAA+E;AAC/E,wFAAqF;AAIrF,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAsB,EACtB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,iDAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;YAChC,MAAM,IAAI,sCAAuB,CAAC,iGAAiG,CAAC,CAAC;QACtI,CAAC;QAGD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC7C,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;QAGrD,IAAI,OAAO,EAAE,sBAAsB,KAAK,SAAS,EAAE,CAAC;YACnD,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACpD,CAAC;QAGD,IAAI,MAAM,CAAC,OAAO,CAAC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;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { UnsupportedVersionError } from './error/parser.error';\nimport { BlueprintConfig } from './satisfactory/blueprint/blueprint-config';\nimport { BlueprintHeader } from './satisfactory/blueprint/blueprint-header';\nimport { BlueprintConfigReader, BlueprintReader } from \"./satisfactory/blueprint/blueprint-reader\";\nimport { BlueprintConfigWriter, BlueprintWriter } from \"./satisfactory/blueprint/blueprint-writer\";\nimport { Blueprint } from \"./satisfactory/blueprint/blueprint.types\";\nimport { SatisfactorySave } from \"./satisfactory/save/satisfactory-save\";\nimport { SatisfactorySaveHeader } from './satisfactory/save/satisfactory-save-header';\nimport { ChunkSummary } from './satisfactory/save/save-body-chunks';\nimport { SaveCustomVersion } from './satisfactory/save/save-custom-version';\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\nimport { ObjectReference } from './satisfactory/types/structs/ObjectReference';\nimport { SaveBodyValidation } from './satisfactory/types/structs/SaveBodyValidation';\n\n\n/** @public */\nexport class Parser {\n\n\t/**\n\t * Parses a given binary buffer as {@link SatisfactorySave}\n\t * @param name the save name. It won't be serialized, so it does not matter how you name it.\n\t * @param bytes the actual binary buffer\n\t * @param options provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.\n\t * @returns \n\t */\n\tpublic static ParseSave(\n\t\tname: string,\n\t\tbytes: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBufferLike) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes, options?.onProgressCallback);\n\n\t\tconst header = SatisfactorySaveHeader.Parse(reader);\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = inflateResult.compressionInfo;\n\n\t\t// call callback on decompressed save body\n\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t}\n\n\t\t// world partition and validation\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tsave.saveBodyValidation = SaveBodyValidation.Parse(reader);\n\t\t}\n\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\t// unresolved data, probably not even useful.\n\t\tconst countUnresolvedWorldSaveData = reader.readInt32();\n\t\tif (countUnresolvedWorldSaveData) {\n\t\t\tsave.unresolvedWorldSaveData = [];\n\t\t\tfor (let i = 0; i < countUnresolvedWorldSaveData; i++) {\n\t\t\t\tsave.unresolvedWorldSaveData.push(ObjectReference.read(reader));\n\t\t\t}\n\t\t}\n\n\t\treader.onProgressCallback(reader.getBufferProgress(), 'finished parsing.');\n\n\t\treturn save;\n\t}\n\n\t/**\n\t * serializes a {@link SatisfactorySave} into binary and reports back on individual callbacks.\n\t * @param save the {@link SatisfactorySave} to serialize into binary.\n\t * @param options provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed.\n\t * onHeader gets called on the binary save header, which is always uncompressed.\n\t * onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.\n\t * @returns a summary of the generated chunks.\n\t */\n\tpublic static WriteSave(save: SatisfactorySave,\n\t\tonHeader: (header: Uint8Array) => void,\n\t\tonChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonBinaryBeforeCompressing: (buffer: ArrayBuffer) => void,\n\t\t}>\n\t): ChunkSummary[] {\n\n\t\tconst writer = new SaveWriter();\n\t\twriter.context.saveHeaderType = save.header.saveHeaderType;\n\t\twriter.context.saveVersion = save.header.saveVersion;\n\t\twriter.context.buildVersion = save.header.buildVersion;\n\t\twriter.context.mapName = save.header.mapName;\n\t\twriter.context.mods = Object.fromEntries(save.header.modMetadata?.Mods?.map(mod => [mod.Reference, mod.Version]) ?? []);\n\n\t\tSatisfactorySaveHeader.Serialize(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tSaveBodyValidation.Serialize(writer, save.saveBodyValidation);\n\t\t}\n\n\t\tSaveWriter.WriteLevels(writer, save);\n\n\t\t// unresolved data\n\t\t// TODO: check if we ever encounter it.\n\t\tif (save.unresolvedWorldSaveData && save.unresolvedWorldSaveData.length > 0) {\n\t\t\twriter.writeInt32(save.unresolvedWorldSaveData?.length ?? 0);\n\t\t\tfor (const actor of save.unresolvedWorldSaveData ?? []) {\n\t\t\t\tObjectReference.write(writer, actor);\n\t\t\t}\n\t\t}\n\n\t\twriter.endWriting();\n\t\tconst chunkSummary = writer.generateChunks(save.compressionInfo!, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);\n\t\treturn chunkSummary;\n\t}\n\n\t/**\n\t * Writes a {@link Blueprint} object to binary. And reports back on individual callbacks.\n\t * @param blueprint the blueprint to be written\n\t * @param options onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing.\n\t * onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.\n\t * @returns a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.\n\t */\n\tpublic static WriteBlueprintFiles(\n\t\tblueprint: Blueprint,\n\t\tonMainFileHeader: (header: Uint8Array) => void,\n\t\tonMainFileChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\t}>\n\t): {\n\t\tmainFileChunkSummary: ChunkSummary[],\n\t\tconfigFileBinary: ArrayBuffer\n\t} {\n\n\t\t// write main blueprint file\n\t\tconst blueprintWriter = new BlueprintWriter();\n\t\tblueprintWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintHeader.Serialize(blueprintWriter, blueprint.header);\n\t\tconst saveBodyPos = blueprintWriter.getBufferPosition();\n\t\tBlueprintWriter.SerializeObjects(blueprintWriter, blueprint.objects);\n\t\tblueprintWriter.endWriting();\n\t\tlet binaryChunks: Uint8Array[] = [];\n\t\tlet binaryHeader: Uint8Array;\n\t\tconst mainFileChunkSummary = blueprintWriter.generateChunks(\n\t\t\tblueprint.compressionInfo,\n\t\t\tsaveBodyPos,\n\t\t\t{\n\t\t\t\tonBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),\n\t\t\t\tonHeader: onMainFileHeader,\n\t\t\t\tonChunk: onMainFileChunk\n\t\t\t}\n\t\t);\n\n\t\t// write config as well.\n\t\tconst configWriter = new BlueprintConfigWriter();\n\t\tconfigWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintConfig.Serialize(configWriter, blueprint.config);\n\t\tconst configFileBinary = configWriter.endWriting();\n\n\t\treturn {\n\t\t\tmainFileChunkSummary,\n\t\t\tconfigFileBinary\n\t\t}\n\t}\n\n\t/**\n\t * Parses two buffers (main blueprint file + config file) into a {@link Blueprint object}\n\t * @param name the name of the blueprint, since it is not part of the binary data and has to be passed.\n\t * @param blueprintFile the main blueprint file \".sbp\"\n\t * @param blueprintConfigFile the config blueprint file \".sbpcfg\"\n\t * @param options provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.\n\t * @returns \n\t */\n\tpublic static ParseBlueprintFiles(\n\t\tname: string,\n\t\tblueprintFile: ArrayBufferLike,\n\t\tblueprintConfigFile: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBufferLike) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(blueprintConfigFile);\n\t\tconst config = BlueprintConfig.Parse(blueprintConfigReader);\n\n\t\t// read actual blueprint file. with context from config\n\t\tconst blueprintReader = new BlueprintReader(blueprintFile);\n\t\tblueprintReader.context.blueprintConfigVersion = config.configVersion;\n\t\tconst header = BlueprintHeader.Parse(blueprintReader);\n\t\tconst inflateResult = blueprintReader.inflateChunks();\n\n\t\t// call back on decompressed body.\n\t\tif (options?.onDecompressedBlueprintBody !== undefined) {\n\t\t\toptions.onDecompressedBlueprintBody(inflateResult.inflatedData);\n\t\t}\n\n\t\tconst blueprintObjects = BlueprintReader.ParseObjects(blueprintReader);\n\t\tconst blueprint: Blueprint = {\n\t\t\tname,\n\t\t\tcompressionInfo: blueprintReader.compressionInfo,\n\t\t\theader: header,\n\t\t\tconfig,\n\t\t\tobjects: blueprintObjects\n\t\t};\n\t\treturn blueprint;\n\t}\n\n\t/**\n\t * It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems:\n\t * 1. it cannot stringify bigints. So we help out by converting it into a string.\n\t * 2. It cannot distinguish between 0 and -0. But a float32 is encoded in a uint8Array for 0 to be [0,0,0,0] (0x00000000) and -0 to be [0,0,0,128] (0x00000080) in little endian.\n\t * @param obj basically anything that can be stringified\n\t * @param indent the indentation, just like with the real JSON stringify.\n\t * @returns a string that is safely stringified.\n\t */\n\tpublic static JSONStringifyModified = (obj: any, indent: number = 0): string =>\n\t\tJSON.stringify(obj, (key, value) => {\n\t\t\tif (typeof value === 'bigint') {\n\t\t\t\treturn value.toString();\n\t\t\t} else if (value === 0 && 1 / value < 0) {\t// -0\n\t\t\t\treturn '-0';\n\t\t\t}\n\t\t\treturn value;\n\t\t}, indent)\n\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satisfactory-save-header.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/satisfactory-save-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,MAAM,sBAAsB,GAAG;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAA;AAED,yBAAiB,sBAAsB,CAAC;IAC7B,MAAM,KAAK,WAAY,aAAa,KAAG,
|
|
1
|
+
{"version":3,"file":"satisfactory-save-header.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/satisfactory-save-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,MAAM,sBAAsB,GAAG;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAA;AAED,yBAAiB,sBAAsB,CAAC;IAC7B,MAAM,KAAK,WAAY,aAAa,KAAG,sBA4E7C,CAAA;IAEM,MAAM,SAAS,WAAY,aAAa,UAAU,sBAAsB,KAAG,IAiDjF,CAAA;CACJ"}
|
|
@@ -22,9 +22,6 @@ var SatisfactorySaveHeader;
|
|
|
22
22
|
header.saveHeaderType = reader.readInt32();
|
|
23
23
|
header.saveVersion = reader.readInt32();
|
|
24
24
|
header.buildVersion = reader.readInt32();
|
|
25
|
-
reader.context.saveHeaderType = header.saveHeaderType;
|
|
26
|
-
reader.context.saveVersion = header.saveVersion;
|
|
27
|
-
reader.context.buildVersion = header.buildVersion;
|
|
28
25
|
if (header.saveHeaderType >= save_header_type_1.SaveHeaderType.AddedSaveName) {
|
|
29
26
|
header.saveName = reader.readString();
|
|
30
27
|
}
|
|
@@ -49,6 +46,10 @@ var SatisfactorySaveHeader;
|
|
|
49
46
|
}
|
|
50
47
|
header.isModdedSave = reader.readInt32();
|
|
51
48
|
}
|
|
49
|
+
reader.context.saveHeaderType = header.saveHeaderType;
|
|
50
|
+
reader.context.saveVersion = header.saveVersion;
|
|
51
|
+
reader.context.buildVersion = header.buildVersion;
|
|
52
|
+
reader.context.mods = Object.fromEntries(header.modMetadata?.Mods?.map(mod => [mod.Reference, mod.Version]) ?? []);
|
|
52
53
|
if (header.saveHeaderType >= save_header_type_1.SaveHeaderType.AddedSaveIdentifier) {
|
|
53
54
|
header.saveIdentifier = reader.readString();
|
|
54
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satisfactory-save-header.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/satisfactory-save-header.ts"],"names":[],"mappings":";;;AAEA,2DAAmE;AACnE,sDAAmD;AACnD,yDAAoD;AACpD,+CAA2C;AAyB3C,IAAiB,sBAAsB,CAgItC;AAhID,WAAiB,sBAAsB;IACtB,4BAAK,GAAG,CAAC,MAAqB,EAA0B,EAAE;QAEnE,MAAM,MAAM,GAAG;YACX,cAAc,EAAE,CAAC;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,EAAE;YACd,WAAW,EAAE,EAAE;YACf,mBAAmB,EAAE,CAAC;YACtB,YAAY,EAAE,GAAG;YACjB,iBAAiB,EAAE,CAAC;SACG,CAAC;QAE5B,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAC3C,MAAM,CAAC,WAAW,GAAG,MAAM,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,CAAC;YAC9D,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,cAAe,CAAC,CAAC;QAC/C,CAAC;QAGD,IAAI,MAAM,CAAC,cAAc,IAAI,iCAAc,CAAC,0BAA0B,EAAE,CAAC;YACrE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,MAAM,CAAC,cAAc,IAAI,iCAAc,CAAC,6BAA6B,EAAE,CAAC;YACxE,iBAAO,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,oBAAqB,CAAC,CAAC;QACxD,CAAC;QAGD,IAAI,MAAM,CAAC,cAAc,IAAI,iCAAc,CAAC,0BAA0B,EAAE,CAAC;YACrE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,MAAM,CAAC,WAAW,GAAG,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,sCAAuB,CAAC,wDAAwD,CAAC,CAAC;QAChG,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAhIgB,sBAAsB,sCAAtB,sBAAsB,QAgItC","sourcesContent":["import { ContextReader } from '../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { UnsupportedVersionError } from '../../error/parser.error';\nimport { MD5Hash } from '../types/structs/MD5Hash';\nimport { SaveHeaderType } from './save-header-type';\nimport { SaveReader } from './save-reader';\nimport { SatisfactoryModMetadata } from './save.types';\n\n/** @public */\nexport type SatisfactorySaveHeader = {\n saveHeaderType: number;\n saveVersion: number;\n saveName?: string;\n buildVersion: number;\n mapName: string;\n mapOptions: string;\n sessionName: string;\n playDurationSeconds: number;\n saveDateTime: string;\n sessionVisibility: number;\n rawModMetadataString?: string;\n modMetadata?: SatisfactoryModMetadata;\n isModdedSave?: number;\n saveIdentifier?: string;\n fEditorObjectVersion?: number;\n partitionEnabledFlag?: boolean;\n consistencyHashBytes?: MD5Hash;\n creativeModeEnabled?: boolean;\n}\n\nexport namespace SatisfactorySaveHeader {\n export const Parse = (reader: ContextReader): SatisfactorySaveHeader => {\n\n const header = {\n saveHeaderType: 0,\n saveVersion: 0,\n buildVersion: 0,\n mapName: \"DEFAULT\",\n mapOptions: \"\",\n sessionName: \"\",\n playDurationSeconds: 0,\n saveDateTime: \"0\",\n sessionVisibility: 0\n } as SatisfactorySaveHeader;\n\n header.saveHeaderType = reader.readInt32();\n header.saveVersion = reader.readInt32();\n header.buildVersion = reader.readInt32();\n\n // set context\n reader.context.saveHeaderType = header.saveHeaderType;\n reader.context.saveVersion = header.saveVersion;\n reader.context.buildVersion = header.buildVersion;\n\n // 14 is 1.1\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveName) {\n header.saveName = reader.readString();\n }\n\n header.mapName = reader.readString();\n reader.context.mapName = header.mapName;\n\n header.mapOptions = reader.readString();\n header.sessionName = reader.readString();\n header.playDurationSeconds = reader.readInt32();\n const rawSaveDateTimeInTicks = reader.readLong(); // in UTC\n const unixMilliseconds = (rawSaveDateTimeInTicks - SaveReader.EPOCH_TICKS) / 10000n;\n header.saveDateTime = unixMilliseconds.toString();\n header.sessionVisibility = reader.readByte();\n\n if (header.saveHeaderType >= SaveHeaderType.UE425EngineUpdate) {\n header.fEditorObjectVersion = reader.readInt32();\n }\n if (header.saveHeaderType >= SaveHeaderType.AddedModdingParams) {\n header.rawModMetadataString = reader.readString();\n try {\n header.modMetadata = JSON.parse(header.rawModMetadataString);\n } catch (error) {\n // ignore.\n }\n header.isModdedSave = reader.readInt32();\n }\n\n //10 is U7\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveIdentifier) {\n header.saveIdentifier = reader.readString();\n }\n\n if (header.saveHeaderType >= SaveHeaderType.AddedWorldPartitionSupport) {\n header.partitionEnabledFlag = reader.readInt32() === 1;\n }\n\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveModificationChecksum) {\n header.consistencyHashBytes = MD5Hash.read(reader);\n }\n\n // 13 is U8 Experimental, Also First 1.0 Release\n if (header.saveHeaderType >= SaveHeaderType.AddedIsCreativeModeEnabled) {\n header.creativeModeEnabled = reader.readInt32() == 1;\n }\n\n if (header.saveVersion < 21) {\n throw new UnsupportedVersionError(\"The save version is too old to support encoding currently. Save in newer game version.\");\n }\n\n return header;\n }\n\n export const Serialize = (writer: ContextWriter, header: SatisfactorySaveHeader): void => {\n\n writer.writeInt32(header.saveHeaderType);\n writer.writeInt32(header.saveVersion);\n writer.writeInt32(header.buildVersion);\n\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveName) {\n writer.writeString(header.saveName ?? '');\n }\n\n writer.writeString(header.mapName);\n writer.writeString(header.mapOptions);\n writer.writeString(header.sessionName);\n writer.writeInt32(header.playDurationSeconds);\n writer.writeInt64(BigInt(header.saveDateTime) * 10000n + SaveReader.EPOCH_TICKS);\n writer.writeByte(header.sessionVisibility);\n\n if (header.saveHeaderType >= SaveHeaderType.UE425EngineUpdate) {\n writer.writeInt32(header.fEditorObjectVersion!);\n }\n if (header.saveHeaderType >= SaveHeaderType.AddedModdingParams) {\n if (header.modMetadata) {\n writer.writeString(JSON.stringify(header.modMetadata));\n } else {\n writer.writeString(header.rawModMetadataString!);\n }\n writer.writeInt32(header.isModdedSave!);\n }\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveIdentifier) {\n writer.writeString(header.saveIdentifier!);\n }\n\n // U8 jumped directly to 13.\n if (header.saveHeaderType >= SaveHeaderType.AddedWorldPartitionSupport) {\n writer.writeInt32(header.partitionEnabledFlag ? 1 : 0);\n }\n\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveModificationChecksum) {\n MD5Hash.write(writer, header.consistencyHashBytes!);\n }\n\n // 13 is U8 Experimental First Release\n if (header.saveHeaderType >= SaveHeaderType.AddedIsCreativeModeEnabled) {\n writer.writeInt32(header.creativeModeEnabled ? 1 : 0);\n }\n\n if (header.saveVersion < 21) {\n throw new UnsupportedVersionError(\"The save version is too old to be supported currently.\");\n }\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"satisfactory-save-header.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/satisfactory-save-header.ts"],"names":[],"mappings":";;;AAEA,2DAAmE;AACnE,sDAAmD;AACnD,yDAAoD;AACpD,+CAA2C;AAyB3C,IAAiB,sBAAsB,CAiItC;AAjID,WAAiB,sBAAsB;IACtB,4BAAK,GAAG,CAAC,MAAqB,EAA0B,EAAE;QAEnE,MAAM,MAAM,GAAG;YACX,cAAc,EAAE,CAAC;YACjB,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,EAAE;YACd,WAAW,EAAE,EAAE;YACf,mBAAmB,EAAE,CAAC;YACtB,YAAY,EAAE,GAAG;YACjB,iBAAiB,EAAE,CAAC;SACG,CAAC;QAE5B,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAC3C,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QACxC,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAGzC,IAAI,MAAM,CAAC,cAAc,IAAI,iCAAc,CAAC,aAAa,EAAE,CAAC;YACxD,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,CAAC;QAED,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACrC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAExC,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACxC,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACzC,MAAM,CAAC,mBAAmB,GAAG,MAAM,CAAC,SAAS,EAA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IAAI,iCAAc,CAAC,6BAA6B,EAAE,CAAC;YACxE,iBAAO,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,oBAAqB,CAAC,CAAC;QACxD,CAAC;QAGD,IAAI,MAAM,CAAC,cAAc,IAAI,iCAAc,CAAC,0BAA0B,EAAE,CAAC;YACrE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,MAAM,CAAC,WAAW,GAAG,EAAE,EAAE,CAAC;YAC1B,MAAM,IAAI,sCAAuB,CAAC,wDAAwD,CAAC,CAAC;QAChG,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAjIgB,sBAAsB,sCAAtB,sBAAsB,QAiItC","sourcesContent":["import { ContextReader } from '../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { UnsupportedVersionError } from '../../error/parser.error';\nimport { MD5Hash } from '../types/structs/MD5Hash';\nimport { SaveHeaderType } from './save-header-type';\nimport { SaveReader } from './save-reader';\nimport { SatisfactoryModMetadata } from './save.types';\n\n/** @public */\nexport type SatisfactorySaveHeader = {\n saveHeaderType: number;\n saveVersion: number;\n saveName?: string;\n buildVersion: number;\n mapName: string;\n mapOptions: string;\n sessionName: string;\n playDurationSeconds: number;\n saveDateTime: string;\n sessionVisibility: number;\n rawModMetadataString?: string;\n modMetadata?: SatisfactoryModMetadata;\n isModdedSave?: number;\n saveIdentifier?: string;\n fEditorObjectVersion?: number;\n partitionEnabledFlag?: boolean;\n consistencyHashBytes?: MD5Hash;\n creativeModeEnabled?: boolean;\n}\n\nexport namespace SatisfactorySaveHeader {\n export const Parse = (reader: ContextReader): SatisfactorySaveHeader => {\n\n const header = {\n saveHeaderType: 0,\n saveVersion: 0,\n buildVersion: 0,\n mapName: \"DEFAULT\",\n mapOptions: \"\",\n sessionName: \"\",\n playDurationSeconds: 0,\n saveDateTime: \"0\",\n sessionVisibility: 0\n } as SatisfactorySaveHeader;\n\n header.saveHeaderType = reader.readInt32();\n header.saveVersion = reader.readInt32();\n header.buildVersion = reader.readInt32();\n\n // 14 is 1.1\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveName) {\n header.saveName = reader.readString();\n }\n\n header.mapName = reader.readString();\n reader.context.mapName = header.mapName;\n\n header.mapOptions = reader.readString();\n header.sessionName = reader.readString();\n header.playDurationSeconds = reader.readInt32();\n const rawSaveDateTimeInTicks = reader.readLong(); // in UTC\n const unixMilliseconds = (rawSaveDateTimeInTicks - SaveReader.EPOCH_TICKS) / 10000n;\n header.saveDateTime = unixMilliseconds.toString();\n header.sessionVisibility = reader.readByte();\n\n if (header.saveHeaderType >= SaveHeaderType.UE425EngineUpdate) {\n header.fEditorObjectVersion = reader.readInt32();\n }\n if (header.saveHeaderType >= SaveHeaderType.AddedModdingParams) {\n header.rawModMetadataString = reader.readString();\n try {\n header.modMetadata = JSON.parse(header.rawModMetadataString);\n } catch (error) {\n // ignore.\n }\n header.isModdedSave = reader.readInt32();\n }\n\n // set context\n reader.context.saveHeaderType = header.saveHeaderType;\n reader.context.saveVersion = header.saveVersion;\n reader.context.buildVersion = header.buildVersion;\n reader.context.mods = Object.fromEntries(header.modMetadata?.Mods?.map(mod => [mod.Reference, mod.Version]) ?? []);\n\n //10 is U7\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveIdentifier) {\n header.saveIdentifier = reader.readString();\n }\n\n if (header.saveHeaderType >= SaveHeaderType.AddedWorldPartitionSupport) {\n header.partitionEnabledFlag = reader.readInt32() === 1;\n }\n\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveModificationChecksum) {\n header.consistencyHashBytes = MD5Hash.read(reader);\n }\n\n // 13 is U8 Experimental, Also First 1.0 Release\n if (header.saveHeaderType >= SaveHeaderType.AddedIsCreativeModeEnabled) {\n header.creativeModeEnabled = reader.readInt32() == 1;\n }\n\n if (header.saveVersion < 21) {\n throw new UnsupportedVersionError(\"The save version is too old to support encoding currently. Save in newer game version.\");\n }\n\n return header;\n }\n\n export const Serialize = (writer: ContextWriter, header: SatisfactorySaveHeader): void => {\n\n writer.writeInt32(header.saveHeaderType);\n writer.writeInt32(header.saveVersion);\n writer.writeInt32(header.buildVersion);\n\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveName) {\n writer.writeString(header.saveName ?? '');\n }\n\n writer.writeString(header.mapName);\n writer.writeString(header.mapOptions);\n writer.writeString(header.sessionName);\n writer.writeInt32(header.playDurationSeconds);\n writer.writeInt64(BigInt(header.saveDateTime) * 10000n + SaveReader.EPOCH_TICKS);\n writer.writeByte(header.sessionVisibility);\n\n if (header.saveHeaderType >= SaveHeaderType.UE425EngineUpdate) {\n writer.writeInt32(header.fEditorObjectVersion!);\n }\n if (header.saveHeaderType >= SaveHeaderType.AddedModdingParams) {\n if (header.modMetadata) {\n writer.writeString(JSON.stringify(header.modMetadata));\n } else {\n writer.writeString(header.rawModMetadataString!);\n }\n writer.writeInt32(header.isModdedSave!);\n }\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveIdentifier) {\n writer.writeString(header.saveIdentifier!);\n }\n\n // U8 jumped directly to 13.\n if (header.saveHeaderType >= SaveHeaderType.AddedWorldPartitionSupport) {\n writer.writeInt32(header.partitionEnabledFlag ? 1 : 0);\n }\n\n if (header.saveHeaderType >= SaveHeaderType.AddedSaveModificationChecksum) {\n MD5Hash.write(writer, header.consistencyHashBytes!);\n }\n\n // 13 is U8 Experimental First Release\n if (header.saveHeaderType >= SaveHeaderType.AddedIsCreativeModeEnabled) {\n writer.writeInt32(header.creativeModeEnabled ? 1 : 0);\n }\n\n if (header.saveVersion < 21) {\n throw new UnsupportedVersionError(\"The save version is too old to be supported currently.\");\n }\n }\n}"]}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { SaveBodyValidation } from '../types/structs/SaveBodyValidation';
|
|
1
2
|
import { ObjectReference } from '../types/structs/ObjectReference';
|
|
2
3
|
import { Levels } from './level';
|
|
3
4
|
import { SatisfactorySaveHeader } from './satisfactory-save-header';
|
|
4
5
|
import { ChunkCompressionInfo } from './save-body-chunks';
|
|
5
|
-
import { Grids, SaveBodyValidation } from "./save-reader";
|
|
6
6
|
export declare class SatisfactorySave {
|
|
7
7
|
name: string;
|
|
8
8
|
header: SatisfactorySaveHeader;
|
|
9
|
-
|
|
10
|
-
grids: Grids;
|
|
9
|
+
saveBodyValidation: SaveBodyValidation;
|
|
11
10
|
levels: Levels;
|
|
12
11
|
compressionInfo?: ChunkCompressionInfo;
|
|
13
12
|
unresolvedWorldSaveData?: ObjectReference[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satisfactory-save.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/satisfactory-save.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"satisfactory-save.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/satisfactory-save.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,qBAAa,gBAAgB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,sBAAsB,CAAC;IAC/B,kBAAkB,EAAE,kBAAkB,CAAiB;IACvD,MAAM,EAAE,MAAM,CAAM;IACpB,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,uBAAuB,CAAC,EAAE,eAAe,EAAE,CAAC;gBAGvC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB;CAOxD"}
|
|
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SatisfactorySave = void 0;
|
|
4
4
|
class SatisfactorySave {
|
|
5
5
|
constructor(name, header) {
|
|
6
|
-
this.
|
|
7
|
-
this.grids = {};
|
|
6
|
+
this.saveBodyValidation = { grids: {} };
|
|
8
7
|
this.levels = {};
|
|
9
8
|
this.name = name;
|
|
10
9
|
this.header = header;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satisfactory-save.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/satisfactory-save.ts"],"names":[],"mappings":";;;AAMA,MAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"satisfactory-save.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/satisfactory-save.ts"],"names":[],"mappings":";;;AAMA,MAAa,gBAAgB;IAS5B,YAAY,IAAY,EAAE,MAA8B;QANjD,uBAAkB,GAAuB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QACvD,WAAM,GAAW,EAAE,CAAC;QAM1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC7B,CAAC;IACF,CAAC;CACD;AAhBD,4CAgBC","sourcesContent":["import { Grids, SaveBodyValidation } from '../types/structs/SaveBodyValidation';\nimport { ObjectReference } from '../types/structs/ObjectReference';\nimport { Levels } from './level';\nimport { SatisfactorySaveHeader } from './satisfactory-save-header';\nimport { ChunkCompressionInfo } from './save-body-chunks';\n\nexport class SatisfactorySave {\n\tpublic name: string;\n\tpublic header: SatisfactorySaveHeader;\n\tpublic saveBodyValidation: SaveBodyValidation = { grids: {} };\n\tpublic levels: Levels = {};\n\tpublic compressionInfo?: ChunkCompressionInfo;\n\tpublic unresolvedWorldSaveData?: ObjectReference[];\n\n\t// since 1.1 we finally have the save file name in the header.\n\tconstructor(name: string, header: SatisfactorySaveHeader) {\n\t\tthis.name = name;\n\t\tthis.header = header;\n\t\tif (header.saveName !== undefined) {\n\t\t\tthis.name = header.saveName;\n\t\t}\n\t}\n}"]}
|
|
@@ -3,21 +3,6 @@ import { Level } from './level';
|
|
|
3
3
|
import { ChunkCompressionInfo } from './save-body-chunks';
|
|
4
4
|
import { RoughSaveVersion } from './save.types';
|
|
5
5
|
export declare const DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE = 49;
|
|
6
|
-
export type ByteArray4 = [number, number, number, number];
|
|
7
|
-
export type SaveBodyValidation = {
|
|
8
|
-
version: number;
|
|
9
|
-
hash1: ByteArray4;
|
|
10
|
-
hash2: ByteArray4;
|
|
11
|
-
};
|
|
12
|
-
export type Grids = {
|
|
13
|
-
[parentName: string]: {
|
|
14
|
-
cellSize: number;
|
|
15
|
-
gridHash: number;
|
|
16
|
-
children: {
|
|
17
|
-
[name: string]: number;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
6
|
export declare class SaveReader extends ContextReader {
|
|
22
7
|
onProgressCallback: (progress: number, msg?: string) => void;
|
|
23
8
|
static readonly EPOCH_TICKS = 621355968000000000n;
|
|
@@ -31,11 +16,6 @@ export declare class SaveReader extends ContextReader {
|
|
|
31
16
|
inflateChunks(): {
|
|
32
17
|
compressionInfo: ChunkCompressionInfo;
|
|
33
18
|
};
|
|
34
|
-
readSaveBodyValidationAndGrids: () => {
|
|
35
|
-
gridHash: SaveBodyValidation;
|
|
36
|
-
grids: Grids;
|
|
37
|
-
};
|
|
38
|
-
private readGrids;
|
|
39
19
|
readLevels(): {
|
|
40
20
|
[levelName: string]: Level;
|
|
41
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-reader.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-reader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"save-reader.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-reader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAkB,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAIzD,qBAAa,UAAW,SAAQ,aAAa;IAKI,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI;IAF5G,gBAAuB,WAAW,uBAAuB;gBAE7C,UAAU,EAAE,eAAe,EAAS,kBAAkB,GAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAgB;IAIjH,MAAM,UAAW,GAAG,YAAY,GAAG,KAAG,IAAI,CAI/C;IAEF,OAAc,mBAAmB,gBAAiB,MAAM,KAAG,gBAAgB,CAYzE;IACF,OAAc,yBAAyB,gBAAiB,MAAM,aAA4E;IAC1I,OAAc,uBAAuB,gBAAiB,MAAM,aAA+C;IAC3G,OAAc,uBAAuB,gBAAiB,MAAM,aAAoD;IAChH,OAAc,0BAA0B,gBAAiB,MAAM,aAA6D;IAErH,aAAa,IAAI;QAAE,eAAe,EAAE,oBAAoB,CAAA;KAAE;IAoB1D,UAAU,IAAI;QAAE,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC;KAAE;CA2BpD"}
|
|
@@ -17,52 +17,6 @@ class SaveReader extends context_reader_1.ContextReader {
|
|
|
17
17
|
console.warn(`Read a value that's usually '${expected}', but this time '${value}'. Meaning unclear. Especially if you use mods. Raise an issue or contact me if you want.`);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
this.readSaveBodyValidationAndGrids = () => {
|
|
21
|
-
let gridHash;
|
|
22
|
-
let grids;
|
|
23
|
-
this.expect(this.readInt32(), 0);
|
|
24
|
-
const version = this.readInt32();
|
|
25
|
-
if (version > 0) {
|
|
26
|
-
this.expect(this.readString(), 'None');
|
|
27
|
-
this.expect(this.readInt32(), 0);
|
|
28
|
-
const hash1 = Array.from(this.readBytes(4));
|
|
29
|
-
this.expect(this.readInt32(), 1);
|
|
30
|
-
this.expect(this.readString(), 'None');
|
|
31
|
-
const hash2 = Array.from(this.readBytes(4));
|
|
32
|
-
gridHash = {
|
|
33
|
-
version,
|
|
34
|
-
hash1,
|
|
35
|
-
hash2
|
|
36
|
-
};
|
|
37
|
-
grids = this.readGrids();
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
gridHash = { version, hash1: [0, 0, 0, 0], hash2: [0, 0, 0, 0] };
|
|
41
|
-
grids = {};
|
|
42
|
-
}
|
|
43
|
-
return { gridHash, grids };
|
|
44
|
-
};
|
|
45
|
-
this.readGrids = () => {
|
|
46
|
-
const grids = {};
|
|
47
|
-
const readGrid = () => {
|
|
48
|
-
const gridName = this.readString();
|
|
49
|
-
const cellSize = this.readInt32();
|
|
50
|
-
const gridHash = this.readUint32();
|
|
51
|
-
grids[gridName] = { children: {}, cellSize, gridHash };
|
|
52
|
-
const childrenCount = this.readUint32();
|
|
53
|
-
for (let i = 0; i < childrenCount; i++) {
|
|
54
|
-
const levelInstanceName = this.readString();
|
|
55
|
-
const cellHash = this.readUint32();
|
|
56
|
-
grids[gridName].children[levelInstanceName] = cellHash;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
readGrid();
|
|
60
|
-
readGrid();
|
|
61
|
-
readGrid();
|
|
62
|
-
readGrid();
|
|
63
|
-
readGrid();
|
|
64
|
-
return grids;
|
|
65
|
-
};
|
|
66
20
|
}
|
|
67
21
|
inflateChunks() {
|
|
68
22
|
const result = save_body_chunks_1.SaveBodyChunks.DecompressChunks(this.fileBuffer.slice(this.currentByte), this.alignment);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AG,mBAAmB,AAAtB,CAAuB;AAY3C,8BAAmB,GAAG,CAAC,WAAmB,EAAoB,EAAE;IAC7E,IAAI,UAAU,CAAC,yBAAyB,CAAC,WAAW,CAAC,EAAE,CAAC;QACvD,OAAO,OAAO,CAAC;IAChB,CAAC;SAAM,IAAI,UAAU,CAAC,uBAAuB,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5D,OAAO,MAAM,CAAC;IACf,CAAC;SAAM,IAAI,UAAU,CAAC,uBAAuB,CAAC,WAAW,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACb,CAAC;SAAM,IAAI,UAAU,CAAC,0BAA0B,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/D,OAAO,OAAO,CAAC;IAChB,CAAC;SAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,AAZgC,CAY/B;AACY,oCAAyB,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,qCAAqC,AAAlG,CAAmG;AAC5H,kCAAuB,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,QAAQ,AAArE,CAAsE;AAC7F,kCAAuB,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,aAAa,AAA1E,CAA2E;AAClG,qCAA0B,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,sBAAsB,AAAnF,CAAoF","sourcesContent":["import { Alignment } from '../../byte/alignment.enum';\nimport { ContextReader } from '../../context/context-reader';\nimport { CorruptSaveError, ParserError, UnsupportedVersionError } from '../../error/parser.error';\nimport { Level } from './level';\nimport { ChunkCompressionInfo, SaveBodyChunks } from './save-body-chunks';\nimport { SaveCustomVersion } from './save-custom-version';\nimport { RoughSaveVersion } from './save.types';\n\n\nexport const DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE = 49;\n\nexport type ByteArray4 = [number, number, number, number];\n\nexport type SaveBodyValidation = {\n\tversion: number;\n\thash1: ByteArray4;\n\thash2: ByteArray4;\n}\n\nexport type Grids = {\n\t[parentName: string]: {\n\t\tcellSize: number;\n\t\tgridHash: number;\n\t\tchildren: {\n\t\t\t[name: string]: number;\t// children object contains names and their binary size.\n\t\t}\n\t}\n};\nexport class SaveReader extends ContextReader {\n\n\t// the number of .net ticks at the unix epoch\n\tpublic static readonly EPOCH_TICKS = 621355968000000000n;\n\n\tconstructor(fileBuffer: ArrayBufferLike, public onProgressCallback: (progress: number, msg?: string) => void = () => { }) {\n\t\tsuper(fileBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic expect = (value: any, expected: any): void => {\n\t\tif (value !== expected) {\n\t\t\tconsole.warn(`Read a value that's usually '${expected}', but this time '${value}'. Meaning unclear. Especially if you use mods. Raise an issue or contact me if you want.`);\n\t\t}\n\t};\n\n\tpublic static GetRoughSaveVersion = (saveVersion: number): RoughSaveVersion => {\n\t\tif (SaveReader.IsGameVersionAtLeast_U1_1(saveVersion)) {\n\t\t\treturn 'U1.1+';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U1(saveVersion)) {\n\t\t\treturn 'U1.0';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U8(saveVersion)) {\n\t\t\treturn 'U8';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U6_U7(saveVersion)) {\n\t\t\treturn 'U6/U7';\n\t\t} else {\n\t\t\treturn '<U6';\n\t\t}\n\t};\n\tpublic static IsGameVersionAtLeast_U1_1 = (saveVersion: number) => saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion;\n\tpublic static IsGameVersionAtLeast_U1 = (saveVersion: number) => saveVersion >= SaveCustomVersion.Version1;\n\tpublic static IsGameVersionAtLeast_U8 = (saveVersion: number) => saveVersion >= SaveCustomVersion.UnrealEngine5;\t// Could be anywhere from UnrealEngine5 (37) to ResetBrokenBlueprintSplinnes (42)\n\tpublic static IsGameVersionAtLeast_U6_U7 = (saveVersion: number) => saveVersion >= SaveCustomVersion.AddedSublevelStreaming;\n\n\tpublic inflateChunks(): { compressionInfo: ChunkCompressionInfo } {\n\n\t\tconst result = SaveBodyChunks.DecompressChunks(this.fileBuffer.slice(this.currentByte), this.alignment);\n\n\t\t// reset on decompressed data.\n\t\tthis.currentByte = 0;\n\t\tthis.fileBuffer = result.uncompressedData.buffer;\n\t\tthis.maxByte = this.fileBuffer.byteLength;\n\t\tthis.bufferView = new DataView(this.fileBuffer);\n\n\t\tconst totalBodyRestSize = this.readInt32();\n\t\tif (result.uncompressedData.byteLength !== (totalBodyRestSize + (this.context.saveVersion >= SaveCustomVersion.UnrealEngine5 ? 8 : 4))) {\n\t\t\tthrow new CorruptSaveError(`Possibly corrupt. Indicated size of total save body (${totalBodyRestSize + 8}) does not match the uncompressed real size of ${result.uncompressedData.byteLength}.`);\n\t\t}\n\n\t\treturn {\n\t\t\tcompressionInfo: result.compressionInfo\n\t\t};\n\t}\n\n\t\n\tpublic readSaveBodyValidationAndGrids = (): { gridHash: SaveBodyValidation; grids: Grids } => {\n\n\t\tlet gridHash: SaveBodyValidation;\n\t\tlet grids: Grids;\n\t\tthis.expect(this.readInt32(), 0);\n\n\t\t// ingame map has version 6, custom maps have version 0 apparently\n\t\tconst version = this.readInt32(); \n\t\tif (version > 0) {\n\n\t\t\tthis.expect(this.readString(), 'None');\n\t\t\tthis.expect(this.readInt32(), 0);\n\n\t\t\tconst hash1 = Array.from(this.readBytes(4)) as ByteArray4; // some weird binary hash - 67 21 E7 F7 / DC 7E 81 48 / 59 E4 1E 1B -- changes not when collecting a slug or dismantling an object. Grids havent changed. So it must depend on grid-related things.\n\n\t\t\tthis.expect(this.readInt32(), 1);\n\t\t\tthis.expect(this.readString(), 'None');\n\n\t\t\tconst hash2 = Array.from(this.readBytes(4)) as ByteArray4; // no idea, changes somehow when level content changes. So we save it for now. -- 8B 08 EB 00\n\n\t\t\tgridHash = {\n\t\t\t\tversion,\n\t\t\t\thash1,\n\t\t\t\thash2\n\t\t\t};\n\t\t\tgrids = this.readGrids();\n\t\t} else {\n\t\t\tgridHash = { version, hash1: [0, 0, 0, 0], hash2: [0, 0, 0, 0] };\n\t\t\tgrids = {};\n\t\t}\n\n\t\treturn { gridHash, grids };\n\t};\n\n\tprivate readGrids = (): Grids => {\n\t\tconst grids: Grids = {};\n\n\t\tconst readGrid = () => {\n\t\t\tconst gridName = this.readString();\n\t\t\tconst cellSize = this.readInt32();\n\t\t\tconst gridHash = this.readUint32();\n\t\t\tgrids[gridName] = { children: {}, cellSize, gridHash };\n\n\t\t\tconst childrenCount = this.readUint32();\n\t\t\tfor (let i = 0; i < childrenCount; i++) {\n\t\t\t\tconst levelInstanceName = this.readString();\n\t\t\t\tconst cellHash = this.readUint32();\n\t\t\t\tgrids[gridName].children[levelInstanceName] = cellHash;\n\t\t\t}\n\t\t};\n\n\t\t// main grid\n\t\treadGrid();\n\n\t\t// landscape grid\n\t\treadGrid();\n\n\t\t// exploration grid\n\t\treadGrid();\n\n\t\t// foliage grid\n\t\treadGrid();\n\n\t\t// hlod0\n\t\treadGrid();\n\n\t\treturn grids;\n\t};\n\n\tpublic readLevels(): { [levelName: string]: Level; } {\n\n\t\tif (!this.context.saveVersion || !this.context.saveHeaderType) {\n\t\t\tthrow new ParserError('ParserError', 'Header and its context must be set before objects can be read.');\n\t\t}\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(this.context.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\tconst levels: { [levelName: string]: Level; } = {};\n\t\tconst levelCount = this.readInt32();\n\t\tthis.onProgressCallback(this.getBufferProgress(), `reading pack of ${levelCount + 1} levels.`);\n\n\t\tfor (let i = 0; i <= levelCount; i++) {\n\t\t\tlet levelSingleName = i === levelCount ? this.context.mapName! : this.readString();\n\t\t\tif (i % 500 === 0) {\n\t\t\t\tthis.onProgressCallback(this.getBufferProgress(), `reading level [${(i + 1)}/${(levelCount + 1)}] ${levelSingleName}`);\n\t\t\t}\n\n\t\t\tlevels[levelSingleName] = Level.ReadLevel(this, levelSingleName);\n\t\t}\n\n\t\treturn levels;\n\t}\n}\n\n\n"]}
|
|
1
|
+
{"version":3,"file":"save-reader.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-reader.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAkG;AAElG,mCAAgC;AAChC,yDAA0E;AAC1E,+DAA0D;AAI7C,QAAA,sCAAsC,GAAG,EAAE,CAAC;AAIzD,MAAa,UAAW,SAAQ,8BAAa;IAK5C,YAAY,UAA2B,EAAS,qBAA+D,GAAG,EAAE,GAAG,CAAC;QACvH,KAAK,CAAC,UAAU,EAAE,0BAAS,CAAC,aAAa,CAAC,CAAC;QADI,uBAAkB,GAAlB,kBAAkB,CAAsD;QAIjH,WAAM,GAAG,CAAC,KAAU,EAAE,QAAa,EAAQ,EAAE;YACnD,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACxB,OAAO,CAAC,IAAI,CAAC,gCAAgC,QAAQ,qBAAqB,KAAK,2FAA2F,CAAC,CAAC;YAC7K,CAAC;QACF,CAAC,CAAC;IANF,CAAC;IA0BM,aAAa;QAEnB,MAAM,MAAM,GAAG,iCAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAGxG,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC;QACjD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,QAAQ,CA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AArE,CAAsE;AAC7F,kCAAuB,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,aAAa,AAA1E,CAA2E;AAClG,qCAA0B,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,sBAAsB,AAAnF,CAAoF","sourcesContent":["import { Alignment } from '../../byte/alignment.enum';\nimport { ContextReader } from '../../context/context-reader';\nimport { CorruptSaveError, ParserError, UnsupportedVersionError } from '../../error/parser.error';\nimport { Grids } from '../types/structs/SaveBodyValidation';\nimport { Level } from './level';\nimport { ChunkCompressionInfo, SaveBodyChunks } from './save-body-chunks';\nimport { SaveCustomVersion } from './save-custom-version';\nimport { RoughSaveVersion } from './save.types';\n\n\nexport const DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE = 49;\n\n\n\nexport class SaveReader extends ContextReader {\n\n\t// the number of .net ticks at the unix epoch\n\tpublic static readonly EPOCH_TICKS = 621355968000000000n;\n\n\tconstructor(fileBuffer: ArrayBufferLike, public onProgressCallback: (progress: number, msg?: string) => void = () => { }) {\n\t\tsuper(fileBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic expect = (value: any, expected: any): void => {\n\t\tif (value !== expected) {\n\t\t\tconsole.warn(`Read a value that's usually '${expected}', but this time '${value}'. Meaning unclear. Especially if you use mods. Raise an issue or contact me if you want.`);\n\t\t}\n\t};\n\n\tpublic static GetRoughSaveVersion = (saveVersion: number): RoughSaveVersion => {\n\t\tif (SaveReader.IsGameVersionAtLeast_U1_1(saveVersion)) {\n\t\t\treturn 'U1.1+';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U1(saveVersion)) {\n\t\t\treturn 'U1.0';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U8(saveVersion)) {\n\t\t\treturn 'U8';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U6_U7(saveVersion)) {\n\t\t\treturn 'U6/U7';\n\t\t} else {\n\t\t\treturn '<U6';\n\t\t}\n\t};\n\tpublic static IsGameVersionAtLeast_U1_1 = (saveVersion: number) => saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion;\n\tpublic static IsGameVersionAtLeast_U1 = (saveVersion: number) => saveVersion >= SaveCustomVersion.Version1;\n\tpublic static IsGameVersionAtLeast_U8 = (saveVersion: number) => saveVersion >= SaveCustomVersion.UnrealEngine5;\t// Could be anywhere from UnrealEngine5 (37) to ResetBrokenBlueprintSplinnes (42)\n\tpublic static IsGameVersionAtLeast_U6_U7 = (saveVersion: number) => saveVersion >= SaveCustomVersion.AddedSublevelStreaming;\n\n\tpublic inflateChunks(): { compressionInfo: ChunkCompressionInfo } {\n\n\t\tconst result = SaveBodyChunks.DecompressChunks(this.fileBuffer.slice(this.currentByte), this.alignment);\n\n\t\t// reset on decompressed data.\n\t\tthis.currentByte = 0;\n\t\tthis.fileBuffer = result.uncompressedData.buffer;\n\t\tthis.maxByte = this.fileBuffer.byteLength;\n\t\tthis.bufferView = new DataView(this.fileBuffer);\n\n\t\tconst totalBodyRestSize = this.readInt32();\n\t\tif (result.uncompressedData.byteLength !== (totalBodyRestSize + (this.context.saveVersion >= SaveCustomVersion.UnrealEngine5 ? 8 : 4))) {\n\t\t\tthrow new CorruptSaveError(`Possibly corrupt. Indicated size of total save body (${totalBodyRestSize + 8}) does not match the uncompressed real size of ${result.uncompressedData.byteLength}.`);\n\t\t}\n\n\t\treturn {\n\t\t\tcompressionInfo: result.compressionInfo\n\t\t};\n\t}\n\n\tpublic readLevels(): { [levelName: string]: Level; } {\n\n\t\tif (!this.context.saveVersion || !this.context.saveHeaderType) {\n\t\t\tthrow new ParserError('ParserError', 'Header and its context must be set before objects can be read.');\n\t\t}\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(this.context.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\tconst levels: { [levelName: string]: Level; } = {};\n\t\tconst levelCount = this.readInt32();\n\t\tthis.onProgressCallback(this.getBufferProgress(), `reading pack of ${levelCount + 1} levels.`);\n\n\t\tfor (let i = 0; i <= levelCount; i++) {\n\t\t\tlet levelSingleName = i === levelCount ? this.context.mapName! : this.readString();\n\t\t\tif (i % 500 === 0) {\n\t\t\t\tthis.onProgressCallback(this.getBufferProgress(), `reading level [${(i + 1)}/${(levelCount + 1)}] ${levelSingleName}`);\n\t\t\t}\n\n\t\t\tlevels[levelSingleName] = Level.ReadLevel(this, levelSingleName);\n\t\t}\n\n\t\treturn levels;\n\t}\n}\n\n\n"]}
|
|
@@ -2,11 +2,8 @@ import { Alignment } from "../../byte/alignment.enum";
|
|
|
2
2
|
import { ContextWriter } from '../../context/context-writer';
|
|
3
3
|
import { SatisfactorySave } from "./satisfactory-save";
|
|
4
4
|
import { ChunkCompressionInfo, ChunkSummary } from "./save-body-chunks";
|
|
5
|
-
import { Grids, SaveBodyValidation } from './save-reader';
|
|
6
5
|
export declare class SaveWriter extends ContextWriter {
|
|
7
6
|
constructor();
|
|
8
|
-
static WriteSaveBodyHashAndGrids: (writer: ContextWriter, saveBodyValidation: SaveBodyValidation, grids: Grids) => void;
|
|
9
|
-
private static WriteGrids;
|
|
10
7
|
static WriteLevels(writer: ContextWriter, save: SatisfactorySave): void;
|
|
11
8
|
static GenerateCompressedChunksFromData(bufferArray: ArrayBuffer, compressionInfo: ChunkCompressionInfo, blueprintOrSave: 'blueprint' | 'save', onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onChunk: (chunk: Uint8Array) => void, alignment?: Alignment): ChunkSummary[];
|
|
12
9
|
generateChunks(compressionInfo: ChunkCompressionInfo, posAfterHeader: number, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-writer.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAkB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"save-writer.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAkB,MAAM,oBAAoB,CAAC;AAGxF,qBAAa,UAAW,SAAQ,aAAa;;WAM9B,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI;WAUhE,gCAAgC,CAC7C,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,oBAAoB,EACrC,eAAe,EAAE,WAAW,GAAG,MAAM,EACrC,yBAAyB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,EACxD,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EACpC,SAAS,GAAE,SAAmC,GAC5C,YAAY,EAAE;IAKV,cAAc,CACpB,eAAe,EAAE,oBAAoB,EACrC,cAAc,EAAE,MAAM,EAEtB,yBAAyB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,EACxD,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,EACtC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAClC,YAAY,EAAE;CAgBjB"}
|