@etothepii/satisfactory-file-parser 3.2.2 → 3.3.0
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 +16 -1
- package/README.md +16 -1
- package/build/index.d.ts +13 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +14 -6
- package/build/index.js.map +1 -1
- package/build/parser/byte/byte-writer.class.d.ts +2 -0
- package/build/parser/byte/byte-writer.class.d.ts.map +1 -1
- package/build/parser/byte/byte-writer.class.js +8 -0
- package/build/parser/byte/byte-writer.class.js.map +1 -1
- package/build/parser/context/context.d.ts +2 -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 +2 -0
- package/build/parser/parser.d.ts.map +1 -1
- package/build/parser/parser.js +2 -0
- package/build/parser/parser.js.map +1 -1
- package/build/parser/satisfactory/blueprint/blueprint-header.js +5 -5
- package/build/parser/satisfactory/blueprint/blueprint-header.js.map +1 -1
- package/build/parser/satisfactory/save/level.d.ts.map +1 -1
- package/build/parser/satisfactory/save/level.js +32 -17
- package/build/parser/satisfactory/save/level.js.map +1 -1
- package/build/parser/satisfactory/types/objects/SaveObject.d.ts.map +1 -1
- package/build/parser/satisfactory/types/objects/SaveObject.js +24 -5
- package/build/parser/satisfactory/types/objects/SaveObject.js.map +1 -1
- package/build/parser/satisfactory/types/property/PropertiesList.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/PropertiesList.js +118 -97
- package/build/parser/satisfactory/types/property/PropertiesList.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.d.ts +2 -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/ArrayProperty/ArrayProperty.d.ts +2 -2
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.js +3 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.js +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ByteProperty.d.ts +2 -2
- package/build/parser/satisfactory/types/property/generic/ByteProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ByteProperty.js +3 -4
- package/build/parser/satisfactory/types/property/generic/ByteProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/EnumProperty.d.ts +2 -2
- package/build/parser/satisfactory/types/property/generic/EnumProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/EnumProperty.js +3 -4
- package/build/parser/satisfactory/types/property/generic/EnumProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts +2 -2
- package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.js +8 -5
- package/build/parser/satisfactory/types/property/generic/MapProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.d.ts +2 -2
- package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.js +3 -4
- package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.js +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts +8 -7
- package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/StructProperty.js +71 -47
- package/build/parser/satisfactory/types/property/generic/StructProperty.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/GUIDInfo.d.ts +1 -1
- package/build/parser/satisfactory/types/structs/GUIDInfo.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/GUIDInfo.js +1 -1
- package/build/parser/satisfactory/types/structs/GUIDInfo.js.map +1 -1
- package/build/parser/satisfactory/types/structs/binary/FClientIdentityInfo.d.ts +11 -0
- package/build/parser/satisfactory/types/structs/binary/FClientIdentityInfo.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/binary/FClientIdentityInfo.js +31 -0
- package/build/parser/satisfactory/types/structs/binary/FClientIdentityInfo.js.map +1 -0
- package/build/parser/satisfactory/types/structs/binary/FColor.d.ts +9 -0
- package/build/parser/satisfactory/types/structs/binary/FColor.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/binary/FColor.js +14 -0
- package/build/parser/satisfactory/types/structs/binary/FColor.js.map +1 -0
- package/build/parser/satisfactory/types/structs/binary/FLinearColor.d.ts +9 -0
- package/build/parser/satisfactory/types/structs/binary/FLinearColor.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/binary/FLinearColor.js +14 -0
- package/build/parser/satisfactory/types/structs/binary/FLinearColor.js.map +1 -0
- package/build/parser/satisfactory/types/structs/binary/GUID.d.ts +8 -0
- package/build/parser/satisfactory/types/structs/binary/GUID.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/binary/GUID.js +22 -0
- package/build/parser/satisfactory/types/structs/binary/GUID.js.map +1 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.d.ts +2 -2
- package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.js +2 -2
- package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.js.map +1 -1
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINGPUT1BufferPixel.d.ts +13 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINGPUT1BufferPixel.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINGPUT1BufferPixel.js +21 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINGPUT1BufferPixel.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/satisfactory/types/structs/mods/FicsItNetworks/FINNetworkTrace.d.ts +13 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINNetworkTrace.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINNetworkTrace.js +35 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINNetworkTrace.js.map +1 -0
- package/build/parser/satisfactory/types/structs/mods/ModularLoadBalancers/FLBBalancerIndexing.d.ts +12 -0
- package/build/parser/satisfactory/types/structs/mods/ModularLoadBalancers/FLBBalancerIndexing.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/mods/ModularLoadBalancers/FLBBalancerIndexing.js +20 -0
- package/build/parser/satisfactory/types/structs/mods/ModularLoadBalancers/FLBBalancerIndexing.js.map +1 -0
- package/build/parser/stream/reworked/readable-stream-parser.d.ts.map +1 -1
- package/build/parser/stream/reworked/readable-stream-parser.js +6 -5
- package/build/parser/stream/reworked/readable-stream-parser.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/BlueprintReader.html +4 -4
- package/docs/classes/CompressionLibraryError.html +2 -2
- package/docs/classes/ContextReader.html +36 -0
- package/docs/classes/ContextWriter.html +41 -0
- package/docs/classes/CorruptBlueprintError.html +2 -2
- package/docs/classes/CorruptSaveError.html +2 -2
- package/docs/classes/Parser.html +8 -8
- 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 +6 -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/Alignment.html +3 -0
- 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/FClientIdentityInfo.read.html +1 -0
- package/docs/functions/FClientIdentityInfo.write.html +1 -0
- package/docs/functions/FColor.read.html +1 -0
- package/docs/functions/FColor.write.html +1 -0
- package/docs/functions/FGDynamicStruct.Parse.html +1 -1
- package/docs/functions/FGDynamicStruct.Serialize.html +1 -1
- package/docs/functions/FICFrameRange.read.html +1 -0
- package/docs/functions/FICFrameRange.write.html +1 -0
- package/docs/functions/FINGPUT1BufferPixel.read.html +1 -0
- package/docs/functions/FINGPUT1BufferPixel.write.html +1 -0
- package/docs/functions/FINItemStateFileSystem.IsFINItemStateFileSystem.html +1 -0
- package/docs/functions/FINItemStateFileSystem.read.html +1 -0
- package/docs/functions/FINItemStateFileSystem.write.html +1 -0
- package/docs/functions/FINNetworkTrace.read.html +1 -0
- package/docs/functions/FINNetworkTrace.write.html +1 -0
- package/docs/functions/FLBBalancerIndexing.read.html +1 -0
- package/docs/functions/FLBBalancerIndexing.write.html +1 -0
- package/docs/functions/FLinearColor.read.html +1 -0
- package/docs/functions/FLinearColor.write.html +1 -0
- 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/hierarchy.html +1 -1
- package/docs/index.html +17 -5
- 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/FClientIdentityInfo.html +3 -0
- package/docs/modules/FColor.html +3 -0
- package/docs/modules/FGDynamicStruct.html +1 -1
- package/docs/modules/FICFrameRange.html +3 -2
- package/docs/modules/FINGPUT1BufferPixel.html +4 -0
- package/docs/modules/FINItemStateFileSystem.html +5 -0
- package/docs/modules/FINNetworkTrace.html +4 -0
- package/docs/modules/FLBBalancerIndexing.html +3 -0
- package/docs/modules/FLinearColor.html +3 -0
- 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 +24 -7
- package/docs/types/AbstractBaseProperty-1.html +7 -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/BlueprintReaderWriterContext.html +2 -0
- 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/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/FClientIdentityInfo-1.html +2 -0
- package/docs/types/FColor-1.html +2 -0
- 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/FINGPUT1BufferPixel-1.html +1 -0
- package/docs/types/FINItemStateFileSystem-1.html +2 -0
- package/docs/types/FINNetworkTrace-1.html +1 -0
- package/docs/types/FLBBalancerIndexing-1.html +2 -0
- package/docs/types/FLinearColor-1.html +2 -0
- 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 -2
- 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/ReaderWriterContext.html +2 -0
- 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/SaveReaderWriterContext.html +3 -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/FINItemStateFileSystem.ExactStructReference.html +1 -0
- 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 +3 -3
- package/docs/classes/BlueprintConfigWriter.html +0 -39
- package/docs/classes/BlueprintWriter.html +0 -42
- package/docs/functions/FICFrameRange.Parse.html +0 -1
- package/docs/functions/FICFrameRange.Serialize.html +0 -1
- package/docs/types/ByteArray4.html +0 -1
- package/docs/types/ClientIdentityInfo.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,6 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
Make sure to use the same version, when parsing and serializing saves.
|
|
3
3
|
|
|
4
|
+
### [3.3.1] (2025-12-17)
|
|
5
|
+
#### Changed Behavior on Errors! see ([README.md](https://github.com/etothepii4/satisfactory-file-parser?tab=readme-ov-file#error-handling))
|
|
6
|
+
* The parser will no longer throw errors on encountering unknown properties or objects. Only if you explicitly specify `throwErrors: true` when calling the parser. Major errors on the overall save structure still get thrown.
|
|
7
|
+
* Made `AbstractBaseProperty` include `rawBytes`, in case properties can not be parsed. When you specify `throwErrors: false` when calling the parser, unparsed property data lands in there.
|
|
8
|
+
#### Bugfix
|
|
9
|
+
* Bugfix for Mods FicsItNetworks and Modular Load Balancers
|
|
10
|
+
* Some Internal types / functions got moved a bit
|
|
11
|
+
|
|
12
|
+
### [3.2.3] (2025-12-14)
|
|
13
|
+
#### Extending Mod Support
|
|
14
|
+
* Added FicsItNetworks mod support
|
|
15
|
+
#### Bugfix
|
|
16
|
+
* Made `AbstractBaseProperty` more robust, accepting any type extension.
|
|
17
|
+
#### Dependency Updates
|
|
18
|
+
|
|
4
19
|
### [3.2.2] (2025-11-29)
|
|
5
20
|
#### Bugfix
|
|
6
21
|
* Explicit return type for function
|
|
@@ -8,7 +23,7 @@ Make sure to use the same version, when parsing and serializing saves.
|
|
|
8
23
|
### [3.2.1] (2025-11-29)
|
|
9
24
|
#### SaveBodyValidation moved slightly
|
|
10
25
|
* `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.
|
|
11
|
-
####
|
|
26
|
+
#### MapProperty updated slightly
|
|
12
27
|
* 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.
|
|
13
28
|
#### Extending Mod Support
|
|
14
29
|
* Added support for Modular Load Balancer Mod and Alternates
|
package/README.md
CHANGED
|
@@ -159,10 +159,12 @@ fs.writeFileSync('./MyBlueprint.sbpcfg', new Uint8Array(summary.configFileBinary
|
|
|
159
159
|
## Additional Options on the Parser Methods
|
|
160
160
|
For every parser call, you can pass optional callbacks to receive additional info.
|
|
161
161
|
Like a callback on the decompressed save body. Parsing saves provides a callback for reporting progress [0,1] and an occasional message.
|
|
162
|
+
if `throwErrors` is set to true, the parser will abort immediately on unparseable data.
|
|
162
163
|
```js
|
|
163
164
|
const save = Parser.ParseSave('MySave', file.buffer, {
|
|
164
165
|
onDecompressedSaveBody: (body) => console.log('on decompressed body', body.byteLength),
|
|
165
|
-
onProgressCallback: (progress, msg) => console.log(progress, msg)
|
|
166
|
+
onProgressCallback: (progress, msg) => console.log(progress, msg),
|
|
167
|
+
throwErrors: false
|
|
166
168
|
});
|
|
167
169
|
```
|
|
168
170
|
```js
|
|
@@ -173,6 +175,7 @@ const { stream, startStreaming } = ReadableStreamParser.CreateReadableStreamFrom
|
|
|
173
175
|
```js
|
|
174
176
|
const blueprint = Parser.ParseBlueprintFiles('Myblueprint', file, configFile, {
|
|
175
177
|
onDecompressedBlueprintBody: (body) => console.log('on decompressed body', body.byteLength),
|
|
178
|
+
throwErrors: false
|
|
176
179
|
});
|
|
177
180
|
```
|
|
178
181
|
|
|
@@ -249,6 +252,18 @@ const firstStack = inventoryStacks.values[0];
|
|
|
249
252
|
// modify original save object
|
|
250
253
|
modifyObjects(inventory);
|
|
251
254
|
```
|
|
255
|
+
|
|
256
|
+
# Error Handling (From 3.3.1 on)
|
|
257
|
+
From version `3.3.1`, the parser will no longer throw every error by default.
|
|
258
|
+
Only if you explicitly specify `throwErrors: true` when calling the parser on saves/blueprints, the parser will immediately abort when unparseable data is encountered.
|
|
259
|
+
Else, `throwErrors: false` is the default.
|
|
260
|
+
|
|
261
|
+
When `throwErrors` is `false` the behavior is as follows:
|
|
262
|
+
- for unknown properties, their data lands in the `rawBytes` field of every property.
|
|
263
|
+
- if the error is more severe, affecting the overall property structure: objects have a `trailingData` field where data gets put.
|
|
264
|
+
- Else, objects on a whole scale might be corrupt and will be left out of the parsed JSON entirely.
|
|
265
|
+
- Errors on the broader save structure (order of header, body, structure of body) still get thrown no matter what. Then your save cant be interpreted no matter what.
|
|
266
|
+
|
|
252
267
|
# [Auto-Generated TypeDoc Reference](https://raw.githack.com/etothepii4/satisfactory-file-parser/main/docs/index.html).
|
|
253
268
|
|
|
254
269
|
# [Basic Guide](https://github.com/etothepii4/satisfactory-file-parser/blob/main/GUIDE.md).
|
package/build/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export * from './parser/byte/alignment.enum';
|
|
2
|
+
export * from './parser/context/context';
|
|
3
|
+
export * from './parser/context/context-reader';
|
|
4
|
+
export * from './parser/context/context-writer';
|
|
1
5
|
export * from './parser/satisfactory/blueprint/blueprint-config';
|
|
2
6
|
export * from './parser/satisfactory/blueprint/blueprint-config-version';
|
|
3
7
|
export * from './parser/satisfactory/blueprint/blueprint-header';
|
|
@@ -64,15 +68,22 @@ export * from './parser/satisfactory/types/property/special/runtime-buildable-in
|
|
|
64
68
|
export * from './parser/satisfactory/types/property/special/SpecialDroneActionProperties';
|
|
65
69
|
export * from './parser/satisfactory/types/property/special/SpecialProperties';
|
|
66
70
|
export * from './parser/satisfactory/types/property/special/VehicleSpecialProperties';
|
|
71
|
+
export * from './parser/satisfactory/types/structs/binary/FClientIdentityInfo';
|
|
72
|
+
export * from './parser/satisfactory/types/structs/binary/FColor';
|
|
73
|
+
export * from './parser/satisfactory/types/structs/binary/FLinearColor';
|
|
74
|
+
export * from './parser/satisfactory/types/structs/binary/GUID';
|
|
67
75
|
export * from './parser/satisfactory/types/structs/col4';
|
|
68
76
|
export * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';
|
|
69
77
|
export * from './parser/satisfactory/types/structs/FGDynamicStruct';
|
|
70
|
-
export * from './parser/satisfactory/types/structs/GUID';
|
|
71
78
|
export * from './parser/satisfactory/types/structs/GUIDInfo';
|
|
72
|
-
export * from './parser/satisfactory/types/structs/SaveBodyValidation';
|
|
73
79
|
export * from './parser/satisfactory/types/structs/MD5Hash';
|
|
74
80
|
export * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';
|
|
81
|
+
export * from './parser/satisfactory/types/structs/mods/FicsItNetworks/FINGPUT1BufferPixel';
|
|
82
|
+
export * from './parser/satisfactory/types/structs/mods/FicsItNetworks/FINItemStateFileSystem';
|
|
83
|
+
export * from './parser/satisfactory/types/structs/mods/FicsItNetworks/FINNetworkTrace';
|
|
84
|
+
export * from './parser/satisfactory/types/structs/mods/ModularLoadBalancers/FLBBalancerIndexing';
|
|
75
85
|
export * from './parser/satisfactory/types/structs/ObjectReference';
|
|
86
|
+
export * from './parser/satisfactory/types/structs/SaveBodyValidation';
|
|
76
87
|
export * from './parser/satisfactory/types/structs/SoftObjectReference';
|
|
77
88
|
export * from './parser/satisfactory/types/structs/Transform';
|
|
78
89
|
export * from './parser/satisfactory/types/structs/vec2';
|
|
@@ -80,7 +91,6 @@ export * from './parser/satisfactory/types/structs/vec3';
|
|
|
80
91
|
export * from './parser/satisfactory/types/structs/vec4';
|
|
81
92
|
export * from './parser/satisfactory/types/structs/VehiclePhysicsData';
|
|
82
93
|
export { BlueprintConfigReader, BlueprintReader } from './parser/satisfactory/blueprint/blueprint-reader';
|
|
83
|
-
export { BlueprintConfigWriter, BlueprintWriter } from './parser/satisfactory/blueprint/blueprint-writer';
|
|
84
94
|
export * from './parser/satisfactory/save/save-reader';
|
|
85
95
|
export { SaveWriter } from './parser/satisfactory/save/save-writer';
|
|
86
96
|
export { SaveStreamJsonStringifier } from './parser/stream/reworked/save-stream-json-stringifier';
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kDAAkD,CAAC;AACjE,cAAc,0DAA0D,CAAC;AACzE,cAAc,kDAAkD,CAAC;AACjE,cAAc,0DAA0D,CAAC;AACzE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,kCAAkC,CAAC;AACjD,cAAc,0DAA0D,CAAC;AACzE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qDAAqD,CAAC;AACpE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mEAAmE,CAAC;AAClF,cAAc,0EAA0E,CAAC;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C;AACxF,cAAc,mFAAmF,CAAC;AAClG,cAAc,qDAAqD,CAAC;AACpE,cAAc,wDAAwD,CAAC;AACvE,cAAc,yDAAyD,CAAC;AACxE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,wDAAwD,CAAC;AAGvE,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
|
@@ -14,7 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ReadableStreamParser = exports.Parser = exports.SaveStreamWriter = exports.SaveStreamJsonStringifier = exports.SaveWriter = exports.
|
|
17
|
+
exports.ReadableStreamParser = exports.Parser = exports.SaveStreamWriter = exports.SaveStreamJsonStringifier = exports.SaveWriter = exports.BlueprintReader = exports.BlueprintConfigReader = void 0;
|
|
18
|
+
__exportStar(require("./parser/byte/alignment.enum"), exports);
|
|
19
|
+
__exportStar(require("./parser/context/context"), exports);
|
|
20
|
+
__exportStar(require("./parser/context/context-reader"), exports);
|
|
21
|
+
__exportStar(require("./parser/context/context-writer"), exports);
|
|
18
22
|
__exportStar(require("./parser/satisfactory/blueprint/blueprint-config"), exports);
|
|
19
23
|
__exportStar(require("./parser/satisfactory/blueprint/blueprint-config-version"), exports);
|
|
20
24
|
__exportStar(require("./parser/satisfactory/blueprint/blueprint-header"), exports);
|
|
@@ -81,15 +85,22 @@ __exportStar(require("./parser/satisfactory/types/property/special/runtime-build
|
|
|
81
85
|
__exportStar(require("./parser/satisfactory/types/property/special/SpecialDroneActionProperties"), exports);
|
|
82
86
|
__exportStar(require("./parser/satisfactory/types/property/special/SpecialProperties"), exports);
|
|
83
87
|
__exportStar(require("./parser/satisfactory/types/property/special/VehicleSpecialProperties"), exports);
|
|
88
|
+
__exportStar(require("./parser/satisfactory/types/structs/binary/FClientIdentityInfo"), exports);
|
|
89
|
+
__exportStar(require("./parser/satisfactory/types/structs/binary/FColor"), exports);
|
|
90
|
+
__exportStar(require("./parser/satisfactory/types/structs/binary/FLinearColor"), exports);
|
|
91
|
+
__exportStar(require("./parser/satisfactory/types/structs/binary/GUID"), exports);
|
|
84
92
|
__exportStar(require("./parser/satisfactory/types/structs/col4"), exports);
|
|
85
93
|
__exportStar(require("./parser/satisfactory/types/structs/DynamicStructPropertyValue"), exports);
|
|
86
94
|
__exportStar(require("./parser/satisfactory/types/structs/FGDynamicStruct"), exports);
|
|
87
|
-
__exportStar(require("./parser/satisfactory/types/structs/GUID"), exports);
|
|
88
95
|
__exportStar(require("./parser/satisfactory/types/structs/GUIDInfo"), exports);
|
|
89
|
-
__exportStar(require("./parser/satisfactory/types/structs/SaveBodyValidation"), exports);
|
|
90
96
|
__exportStar(require("./parser/satisfactory/types/structs/MD5Hash"), exports);
|
|
91
97
|
__exportStar(require("./parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange"), exports);
|
|
98
|
+
__exportStar(require("./parser/satisfactory/types/structs/mods/FicsItNetworks/FINGPUT1BufferPixel"), exports);
|
|
99
|
+
__exportStar(require("./parser/satisfactory/types/structs/mods/FicsItNetworks/FINItemStateFileSystem"), exports);
|
|
100
|
+
__exportStar(require("./parser/satisfactory/types/structs/mods/FicsItNetworks/FINNetworkTrace"), exports);
|
|
101
|
+
__exportStar(require("./parser/satisfactory/types/structs/mods/ModularLoadBalancers/FLBBalancerIndexing"), exports);
|
|
92
102
|
__exportStar(require("./parser/satisfactory/types/structs/ObjectReference"), exports);
|
|
103
|
+
__exportStar(require("./parser/satisfactory/types/structs/SaveBodyValidation"), exports);
|
|
93
104
|
__exportStar(require("./parser/satisfactory/types/structs/SoftObjectReference"), exports);
|
|
94
105
|
__exportStar(require("./parser/satisfactory/types/structs/Transform"), exports);
|
|
95
106
|
__exportStar(require("./parser/satisfactory/types/structs/vec2"), exports);
|
|
@@ -99,9 +110,6 @@ __exportStar(require("./parser/satisfactory/types/structs/VehiclePhysicsData"),
|
|
|
99
110
|
var blueprint_reader_1 = require("./parser/satisfactory/blueprint/blueprint-reader");
|
|
100
111
|
Object.defineProperty(exports, "BlueprintConfigReader", { enumerable: true, get: function () { return blueprint_reader_1.BlueprintConfigReader; } });
|
|
101
112
|
Object.defineProperty(exports, "BlueprintReader", { enumerable: true, get: function () { return blueprint_reader_1.BlueprintReader; } });
|
|
102
|
-
var blueprint_writer_1 = require("./parser/satisfactory/blueprint/blueprint-writer");
|
|
103
|
-
Object.defineProperty(exports, "BlueprintConfigWriter", { enumerable: true, get: function () { return blueprint_writer_1.BlueprintConfigWriter; } });
|
|
104
|
-
Object.defineProperty(exports, "BlueprintWriter", { enumerable: true, get: function () { return blueprint_writer_1.BlueprintWriter; } });
|
|
105
113
|
__exportStar(require("./parser/satisfactory/save/save-reader"), exports);
|
|
106
114
|
var save_writer_1 = require("./parser/satisfactory/save/save-writer");
|
|
107
115
|
Object.defineProperty(exports, "SaveWriter", { enumerable: true, get: function () { return save_writer_1.SaveWriter; } });
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings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E;AACxE,gFAA8D;AAC9D,2EAAyD;AACzD,2EAAyD;AACzD,2EAAyD;AACzD,yFAAuE;AAGvE,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/byte/alignment.enum';\nexport * from './parser/context/context';\nexport * from './parser/context/context-reader';\nexport * from './parser/context/context-writer';\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/binary/FClientIdentityInfo';\nexport * from './parser/satisfactory/types/structs/binary/FColor';\nexport * from './parser/satisfactory/types/structs/binary/FLinearColor';\nexport * from './parser/satisfactory/types/structs/binary/GUID';\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/GUIDInfo';\nexport * from './parser/satisfactory/types/structs/MD5Hash';\nexport * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';\nexport * from './parser/satisfactory/types/structs/mods/FicsItNetworks/FINGPUT1BufferPixel';\nexport * from './parser/satisfactory/types/structs/mods/FicsItNetworks/FINItemStateFileSystem';\nexport * from './parser/satisfactory/types/structs/mods/FicsItNetworks/FINNetworkTrace';\nexport * from './parser/satisfactory/types/structs/mods/ModularLoadBalancers/FLBBalancerIndexing';\nexport * from './parser/satisfactory/types/structs/ObjectReference';\nexport * from './parser/satisfactory/types/structs/SaveBodyValidation';\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 * 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"]}
|
|
@@ -11,6 +11,8 @@ export declare abstract class ByteWriter implements BinaryWritable {
|
|
|
11
11
|
writeByte(value: number): void;
|
|
12
12
|
writeBytesArray(bytes: number[]): void;
|
|
13
13
|
writeBytes(bytes: Uint8Array): void;
|
|
14
|
+
hexStringRepresentationToBytes(hex: string, hexSeparator?: string): number[];
|
|
15
|
+
writeHex(hex: string, hexSeparator?: string): void;
|
|
14
16
|
writeInt8(value: number): void;
|
|
15
17
|
writeUint8(value: number): void;
|
|
16
18
|
writeInt16(value: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byte-writer.class.d.ts","sourceRoot":"","sources":["../../../src/parser/byte/byte-writer.class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,8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ferView.setUint8(this.currentByte++, byte));
|
|
35
35
|
}
|
|
36
|
+
hexStringRepresentationToBytes(hex, hexSeparator = ' ') {
|
|
37
|
+
const cleanHex = hex.split(hexSeparator).join('').replace(/\s+/g, '');
|
|
38
|
+
const bytes = Array.from({ length: cleanHex.length / 2 }, (_, i) => parseInt(cleanHex.slice(i * 2, i * 2 + 2), 16));
|
|
39
|
+
return bytes;
|
|
40
|
+
}
|
|
41
|
+
writeHex(hex, hexSeparator = ' ') {
|
|
42
|
+
this.writeBytesArray(this.hexStringRepresentationToBytes(hex, hexSeparator));
|
|
43
|
+
}
|
|
36
44
|
writeInt8(value) {
|
|
37
45
|
this.extendBufferIfNeeded(1);
|
|
38
46
|
this.bufferView.setInt8(this.currentByte, value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"byte-writer.class.js","sourceRoot":"","sources":["../../../src/parser/byte/byte-writer.class.ts"],"names":[],"mappings":";;;AACA,qDAA6C;AAI7C,MAAsB,UAAU;IAQ/B,YAAY,SAAoB,EAAE,aAAqB,GAAG;QA8GnD,sBAAiB,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;QAEnD,mBAAc,GAAG,CAAC,KAAa,EAAE,GAAY,EAAe,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAElG,oBAAe,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;QAE5D,sBAAiB,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;QAnHvF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,CA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CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;IACF,CAAC;IAES,cAAc;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAChE,CAAC;IAEM,UAAU;QAChB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAEM,MAAM,CAAC,OAAO,CAAC,GAAW;QAChC,OAAO,IAAI,UAAU,CAAC;YACrB,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,EAAE;YACxB,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,EAAE;YACxB,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC;YACvB,CAAC,GAAG,GAAG,UAAU,CAAC;SAClB,CAAC,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,OAAoB,EAAE,OAAoB;QACpE,IAAI,GAAG,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;QAClE,GAAG,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QACpC,GAAG,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QACrD,OAAO,GAAG,CAAC,MAAM,CAAC;IACnB,CAAC;IAAA,CAAC;;AAzKH,gCA0KC;AAtDc,4BAAiB,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,AAA3D,CAA4D","sourcesContent":["\nimport { Alignment } from \"./alignment.enum\";\nimport { BinaryWritable } from './binary-writable.interface';\n\n/** @public */\nexport abstract class ByteWriter implements BinaryWritable {\n\n\tpublic alignment: Alignment;\n\tprotected bufferArray: ArrayBuffer;\n\tprotected bufferView: DataView;\n\n\tprotected currentByte: number;\n\n\tconstructor(alignment: Alignment, bufferSize: number = 500) {\n\t\tthis.alignment = alignment;\n\t\tthis.bufferArray = new ArrayBuffer(bufferSize);\n\t\tthis.bufferView = new DataView(this.bufferArray);\n\t\tthis.currentByte = 0;\n\t}\n\n\t/*\n\t * Byte Manipulation\n\t */\n\tpublic skipBytes(count: number = 1): void {\n\t\tthis.extendBufferIfNeeded(count);\n\t\tthis.currentByte += count;\n\t}\n\tpublic jumpTo(pos: number): void {\n\t\tconst count = pos - this.getBufferPosition();\n\t\tthis.skipBytes(count);\n\t}\n\tpublic writeByte(value: number): void {\n\t\tthis.extendBufferIfNeeded(1);\n\t\tthis.bufferView.setUint8(this.currentByte, value);\n\t\tthis.currentByte += 1;\n\t}\n\tpublic writeBytesArray(bytes: number[]): void {\n\t\tthis.writeBytes(new Uint8Array(bytes));\n\t}\n\tpublic writeBytes(bytes: Uint8Array): void {\n\t\tthis.extendBufferIfNeeded(bytes.length);\n\t\tbytes.forEach(byte => this.bufferView.setUint8(this.currentByte++, byte));\n\t}\n\tpublic writeInt8(value: number): void {\n\t\tthis.extendBufferIfNeeded(1);\n\t\tthis.bufferView.setInt8(this.currentByte, value);\n\t\tthis.currentByte += 1;\n\t}\n\tpublic writeUint8(value: number): void {\n\t\tthis.writeByte(value);\n\t}\n\tpublic writeInt16(value: number): void {\n\t\tthis.extendBufferIfNeeded(2);\n\t\tthis.bufferView.setInt16(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 2;\n\t}\n\tpublic writeUint16(value: number): void {\n\t\tthis.extendBufferIfNeeded(2);\n\t\tthis.bufferView.setUint16(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 2;\n\t}\n\tpublic writeInt32(value: number): void {\n\t\tthis.extendBufferIfNeeded(4);\n\t\tthis.bufferView.setInt32(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t}\n\t/**\n\t * Writes an int32 and we dismiss it, because its always 0.\n\t */\n\tpublic writeInt32Zero(): void {\n\t\tthis.writeInt32(0);\n\t}\n\tpublic writeUint32(value: number): void {\n\t\tthis.extendBufferIfNeeded(4);\n\t\tthis.bufferView.setUint32(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t}\n\tpublic writeInt64(value: bigint): void {\n\t\tthis.extendBufferIfNeeded(8);\n\t\tthis.bufferView.setBigInt64(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t}\n\tpublic writeUint64(value: bigint): void {\n\t\tthis.extendBufferIfNeeded(8);\n\t\tthis.bufferView.setBigUint64(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t}\n\tpublic writeFloat32(value: number): void {\n\t\tthis.extendBufferIfNeeded(4);\n\t\tthis.bufferView.setFloat32(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t}\n\tpublic writeDouble(value: number): void {\n\t\tthis.extendBufferIfNeeded(8);\n\t\tthis.bufferView.setFloat64(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t}\n\tpublic writeString(value: string) {\n\t\tif (value.length === 0) {\n\t\t\tthis.writeInt32(0);\n\t\t\treturn;\n\t\t}\n\n\t\t// if it's safe to use ASCII, use UTF8.\n\t\tif (ByteWriter.IsASCIICompatible(value)) {\n\t\t\tthis.writeInt32(value.length + 1);\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tthis.writeByte(value.charCodeAt(i));\n\t\t\t}\n\t\t\tthis.writeUint8(0);\n\t\t}\n\t\t// write UTF16\n\t\telse {\n\t\t\tthis.writeInt32(-value.length - 1);\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tthis.writeUint16(value.charCodeAt(i));\n\t\t\t}\n\t\t\tthis.writeUint16(0);\n\t\t}\n\t}\n\n\tpublic static IsASCIICompatible = (value: string): boolean => /^[\\x00-\\x7F]*$/.test(value);\n\n\tpublic getBufferPosition = (): number => this.currentByte;\n\n\tpublic getBufferSlice = (start: number, end?: number): ArrayBuffer => this.bufferArray.slice(start, end);\n\n\tpublic getBufferLength = (): number => this.bufferArray.byteLength;\n\n\tpublic getBufferProgress = (): number => this.currentByte / this.bufferArray.byteLength;\n\n\tpublic writeBinarySizeFromPosition(lenIndicatorPos: number, start: number): void {\n\t\tconst after = this.getBufferPosition();\n\t\tconst writtenBytes = after - start;\n\t\tthis.jumpTo(lenIndicatorPos);\n\t\tthis.writeInt32(writtenBytes);\n\t\tthis.jumpTo(after);\n\t}\n\n\t/**\n\t * automatically extends the current buffer if the given space exceeds the available rest capacity of the current buffer.\n\t * @param countNeededBytes the needed space\n\t * @param factor how big the appended buffer should be in comparison to the current one. Values >= 1 make sense.\n\t */\n\tprotected extendBufferIfNeeded(countNeededBytes: number, factor: number = 1.5): void {\n\t\tif (this.currentByte + countNeededBytes > this.bufferView.byteLength) {\n\t\t\tthis.bufferArray = ByteWriter.AppendBuffer(this.bufferArray, new ArrayBuffer(factor * this.bufferArray.byteLength));\n\t\t\tthis.bufferView = new DataView(this.bufferArray);\n\t\t}\n\t}\n\n\tprotected truncateBuffer(): void {\n\t\tthis.bufferArray = this.bufferArray.slice(0, this.currentByte);\n\t}\n\n\tpublic endWriting(): ArrayBuffer {\n\t\tthis.truncateBuffer();\n\t\treturn this.bufferArray;\n\t}\n\n\tpublic static ToInt32(num: number): Uint8Array {\n\t\treturn new Uint8Array([\n\t\t\t(num & 0xff000000) >> 24,\n\t\t\t(num & 0x00ff0000) >> 16,\n\t\t\t(num & 0x0000ff00) >> 8,\n\t\t\t(num & 0x000000ff)\n\t\t]);\n\t}\n\n\tpublic static AppendBuffer(buffer1: ArrayBuffer, buffer2: ArrayBuffer): ArrayBuffer {\n\t\tvar tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);\n\t\ttmp.set(new Uint8Array(buffer1), 0);\n\t\ttmp.set(new Uint8Array(buffer2), buffer1.byteLength);\n\t\treturn tmp.buffer;\n\t};\n}"]}
|
|
1
|
+
{"version":3,"file":"byte-writer.class.js","sourceRoot":"","sources":["../../../src/parser/byte/byte-writer.class.ts"],"names":[],"mappings":";;;AACA,qDAA6C;AAI7C,MAAsB,UAAU;IAQ/B,YAAY,SAAoB,EAAE,aAAqB,GAAG;QAsHnD,sBAAiB,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;QAEnD,mBAAc,GAAG,CAAC,KAAa,EAAE,GAAY,EAAe,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAElG,oBAAe,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;QAE5D,sBAAiB,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC;QA3HvF,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACjD,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;IACtB,CAAC;IAKM,SAAS,CAAC,QAAgB,CAAC;QACjC,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACjC,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC;IAC3B,CAAC;IACM,MAAM,CAAC,GAAW;QACxB,MAAM,KAAK,GAAG,GAAG,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC7C,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACM,SAAS,CAAC,KAAa;QAC7B,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jLH,gCAkLC;AAtDc,4BAAiB,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,AAA3D,CAA4D","sourcesContent":["\nimport { Alignment } from \"./alignment.enum\";\nimport { BinaryWritable } from './binary-writable.interface';\n\n/** @public */\nexport abstract class ByteWriter implements BinaryWritable {\n\n\tpublic alignment: Alignment;\n\tprotected bufferArray: ArrayBuffer;\n\tprotected bufferView: DataView;\n\n\tprotected currentByte: number;\n\n\tconstructor(alignment: Alignment, bufferSize: number = 500) {\n\t\tthis.alignment = alignment;\n\t\tthis.bufferArray = new ArrayBuffer(bufferSize);\n\t\tthis.bufferView = new DataView(this.bufferArray);\n\t\tthis.currentByte = 0;\n\t}\n\n\t/*\n\t * Byte Manipulation\n\t */\n\tpublic skipBytes(count: number = 1): void {\n\t\tthis.extendBufferIfNeeded(count);\n\t\tthis.currentByte += count;\n\t}\n\tpublic jumpTo(pos: number): void {\n\t\tconst count = pos - this.getBufferPosition();\n\t\tthis.skipBytes(count);\n\t}\n\tpublic writeByte(value: number): void {\n\t\tthis.extendBufferIfNeeded(1);\n\t\tthis.bufferView.setUint8(this.currentByte, value);\n\t\tthis.currentByte += 1;\n\t}\n\tpublic writeBytesArray(bytes: number[]): void {\n\t\tthis.writeBytes(new Uint8Array(bytes));\n\t}\n\tpublic writeBytes(bytes: Uint8Array): void {\n\t\tthis.extendBufferIfNeeded(bytes.length);\n\t\tbytes.forEach(byte => this.bufferView.setUint8(this.currentByte++, byte));\n\t}\n\tpublic hexStringRepresentationToBytes(hex: string, hexSeparator: string = ' '): number[] {\n\t\tconst cleanHex = hex.split(hexSeparator).join('').replace(/\\s+/g, '');\n\t\tconst bytes = Array.from({ length: cleanHex.length / 2 }, (_, i) => parseInt(cleanHex.slice(i * 2, i * 2 + 2), 16));\n\t\treturn bytes;\n\t}\n\tpublic writeHex(hex: string, hexSeparator: string = ' '): void {\n\t\tthis.writeBytesArray(this.hexStringRepresentationToBytes(hex, hexSeparator));\n\t}\n\tpublic writeInt8(value: number): void {\n\t\tthis.extendBufferIfNeeded(1);\n\t\tthis.bufferView.setInt8(this.currentByte, value);\n\t\tthis.currentByte += 1;\n\t}\n\tpublic writeUint8(value: number): void {\n\t\tthis.writeByte(value);\n\t}\n\tpublic writeInt16(value: number): void {\n\t\tthis.extendBufferIfNeeded(2);\n\t\tthis.bufferView.setInt16(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 2;\n\t}\n\tpublic writeUint16(value: number): void {\n\t\tthis.extendBufferIfNeeded(2);\n\t\tthis.bufferView.setUint16(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 2;\n\t}\n\tpublic writeInt32(value: number): void {\n\t\tthis.extendBufferIfNeeded(4);\n\t\tthis.bufferView.setInt32(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t}\n\t/**\n\t * Writes an int32 and we dismiss it, because its always 0.\n\t */\n\tpublic writeInt32Zero(): void {\n\t\tthis.writeInt32(0);\n\t}\n\tpublic writeUint32(value: number): void {\n\t\tthis.extendBufferIfNeeded(4);\n\t\tthis.bufferView.setUint32(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t}\n\tpublic writeInt64(value: bigint): void {\n\t\tthis.extendBufferIfNeeded(8);\n\t\tthis.bufferView.setBigInt64(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t}\n\tpublic writeUint64(value: bigint): void {\n\t\tthis.extendBufferIfNeeded(8);\n\t\tthis.bufferView.setBigUint64(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t}\n\tpublic writeFloat32(value: number): void {\n\t\tthis.extendBufferIfNeeded(4);\n\t\tthis.bufferView.setFloat32(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t}\n\tpublic writeDouble(value: number): void {\n\t\tthis.extendBufferIfNeeded(8);\n\t\tthis.bufferView.setFloat64(this.currentByte, value, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t}\n\tpublic writeString(value: string) {\n\t\tif (value.length === 0) {\n\t\t\tthis.writeInt32(0);\n\t\t\treturn;\n\t\t}\n\n\t\t// if it's safe to use ASCII, use UTF8.\n\t\tif (ByteWriter.IsASCIICompatible(value)) {\n\t\t\tthis.writeInt32(value.length + 1);\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tthis.writeByte(value.charCodeAt(i));\n\t\t\t}\n\t\t\tthis.writeUint8(0);\n\t\t}\n\t\t// write UTF16\n\t\telse {\n\t\t\tthis.writeInt32(-value.length - 1);\n\t\t\tfor (let i = 0; i < value.length; i++) {\n\t\t\t\tthis.writeUint16(value.charCodeAt(i));\n\t\t\t}\n\t\t\tthis.writeUint16(0);\n\t\t}\n\t}\n\n\tpublic static IsASCIICompatible = (value: string): boolean => /^[\\x00-\\x7F]*$/.test(value);\n\n\tpublic getBufferPosition = (): number => this.currentByte;\n\n\tpublic getBufferSlice = (start: number, end?: number): ArrayBuffer => this.bufferArray.slice(start, end);\n\n\tpublic getBufferLength = (): number => this.bufferArray.byteLength;\n\n\tpublic getBufferProgress = (): number => this.currentByte / this.bufferArray.byteLength;\n\n\tpublic writeBinarySizeFromPosition(lenIndicatorPos: number, start: number): void {\n\t\tconst after = this.getBufferPosition();\n\t\tconst writtenBytes = after - start;\n\t\tthis.jumpTo(lenIndicatorPos);\n\t\tthis.writeInt32(writtenBytes);\n\t\tthis.jumpTo(after);\n\t}\n\n\t/**\n\t * automatically extends the current buffer if the given space exceeds the available rest capacity of the current buffer.\n\t * @param countNeededBytes the needed space\n\t * @param factor how big the appended buffer should be in comparison to the current one. Values >= 1 make sense.\n\t */\n\tprotected extendBufferIfNeeded(countNeededBytes: number, factor: number = 1.5): void {\n\t\tif (this.currentByte + countNeededBytes > this.bufferView.byteLength) {\n\t\t\tthis.bufferArray = ByteWriter.AppendBuffer(this.bufferArray, new ArrayBuffer(factor * this.bufferArray.byteLength));\n\t\t\tthis.bufferView = new DataView(this.bufferArray);\n\t\t}\n\t}\n\n\tprotected truncateBuffer(): void {\n\t\tthis.bufferArray = this.bufferArray.slice(0, this.currentByte);\n\t}\n\n\tpublic endWriting(): ArrayBuffer {\n\t\tthis.truncateBuffer();\n\t\treturn this.bufferArray;\n\t}\n\n\tpublic static ToInt32(num: number): Uint8Array {\n\t\treturn new Uint8Array([\n\t\t\t(num & 0xff000000) >> 24,\n\t\t\t(num & 0x00ff0000) >> 16,\n\t\t\t(num & 0x0000ff00) >> 8,\n\t\t\t(num & 0x000000ff)\n\t\t]);\n\t}\n\n\tpublic static AppendBuffer(buffer1: ArrayBuffer, buffer2: ArrayBuffer): ArrayBuffer {\n\t\tvar tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);\n\t\ttmp.set(new Uint8Array(buffer1), 0);\n\t\ttmp.set(new Uint8Array(buffer2), buffer1.byteLength);\n\t\treturn tmp.buffer;\n\t};\n}"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChunkCompressionInfo } from "../satisfactory/save/save-body-chunks";
|
|
2
2
|
export type ReaderWriterContext = SaveReaderWriterContext & BlueprintReaderWriterContext;
|
|
3
3
|
export type SaveReaderWriterContext = {
|
|
4
|
+
throwErrors: boolean;
|
|
4
5
|
saveHeaderType: number;
|
|
5
6
|
saveVersion: number;
|
|
6
7
|
buildVersion: number;
|
|
@@ -9,6 +10,7 @@ export type SaveReaderWriterContext = {
|
|
|
9
10
|
compressionInfo?: ChunkCompressionInfo;
|
|
10
11
|
};
|
|
11
12
|
export type BlueprintReaderWriterContext = {
|
|
13
|
+
throwErrors: boolean;
|
|
12
14
|
headerVersion: number;
|
|
13
15
|
saveVersion: number;
|
|
14
16
|
buildVersion: number;
|
|
@@ -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;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
|
+
{"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,WAAW,EAAE,OAAO,CAAC;IACrB,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,WAAW,EAAE,OAAO,CAAC;IACrB,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 * \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
|
+
{"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 throwErrors: boolean;\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 throwErrors: boolean;\n headerVersion: number;\n saveVersion: number;\n buildVersion: number;\n blueprintConfigVersion: number;\n}"]}
|
package/build/parser/parser.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare class Parser {
|
|
|
5
5
|
static ParseSave(name: string, bytes: ArrayBufferLike, options?: Partial<{
|
|
6
6
|
onDecompressedSaveBody: (buffer: ArrayBufferLike) => void;
|
|
7
7
|
onProgressCallback: (progress: number, msg?: string) => void;
|
|
8
|
+
throwErrors: boolean;
|
|
8
9
|
}>): SatisfactorySave;
|
|
9
10
|
static WriteSave(save: SatisfactorySave, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void, options?: Partial<{
|
|
10
11
|
onBinaryBeforeCompressing: (buffer: ArrayBuffer) => void;
|
|
@@ -17,6 +18,7 @@ export declare class Parser {
|
|
|
17
18
|
};
|
|
18
19
|
static ParseBlueprintFiles(name: string, blueprintFile: ArrayBufferLike, blueprintConfigFile: ArrayBufferLike, options?: Partial<{
|
|
19
20
|
onDecompressedBlueprintBody: (buffer: ArrayBufferLike) => void;
|
|
21
|
+
throwErrors: boolean;
|
|
20
22
|
}>): Blueprint;
|
|
21
23
|
static JSONStringifyModified: (obj: any, indent?: number) => string;
|
|
22
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AASpE,qBAAa,MAAM;WASJ,SAAS,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,sBAAsB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;QAC1D,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","s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e,EACpC,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,2BAA2B,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;QAC/D,WAAW,EAAE,OAAO,CAAC;KACrB,CAAC,GACA,SAAS;IAsCZ,OAAc,qBAAqB,QAAS,GAAG,WAAU,MAAM,KAAO,MAAM,CAQjE;CAEX"}
|
package/build/parser/parser.js
CHANGED
|
@@ -16,6 +16,7 @@ const SaveBodyValidation_1 = require("./satisfactory/types/structs/SaveBodyValid
|
|
|
16
16
|
class Parser {
|
|
17
17
|
static ParseSave(name, bytes, options) {
|
|
18
18
|
const reader = new save_reader_1.SaveReader(bytes, options?.onProgressCallback);
|
|
19
|
+
reader.context.throwErrors = options?.throwErrors !== undefined ? options.throwErrors : false;
|
|
19
20
|
const header = satisfactory_save_header_1.SatisfactorySaveHeader.Parse(reader);
|
|
20
21
|
const save = new satisfactory_save_1.SatisfactorySave(name, header);
|
|
21
22
|
const roughSaveVersion = save_reader_1.SaveReader.GetRoughSaveVersion(header.saveVersion);
|
|
@@ -96,6 +97,7 @@ class Parser {
|
|
|
96
97
|
const config = blueprint_config_1.BlueprintConfig.Parse(blueprintConfigReader);
|
|
97
98
|
const blueprintReader = new blueprint_reader_1.BlueprintReader(blueprintFile);
|
|
98
99
|
blueprintReader.context.blueprintConfigVersion = config.configVersion;
|
|
100
|
+
blueprintReader.context.throwErrors = options?.throwErrors !== undefined ? options.throwErrors : false;
|
|
99
101
|
const header = blueprint_header_1.BlueprintHeader.Parse(blueprintReader);
|
|
100
102
|
const inflateResult = blueprintReader.inflateChunks();
|
|
101
103
|
if (options?.onDecompressedBlueprintBody !== undefined) {
|
|
@@ -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,2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AC;QACtE,MAAM,MAAM,GAAG,kCAAe,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACtD,MAAM,aAAa,GAAG,eAAe,CAAC,aAAa,EAAE,CAAC;QAGtD,IAAI,OAAO,EAAE,2BAA2B,KAAK,SAAS,EAAE,CAAC;YACxD,OAAO,CAAC,2BAA2B,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,gBAAgB,GAAG,kCAAe,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QACvE,MAAM,SAAS,GAAc;YAC5B,IAAI;YACJ,eAAe,EAAE,eAAe,CAAC,eAAe;YAChD,MAAM,EAAE,MAAM;YACd,MAAM;YACN,OAAO,EAAE,gBAAgB;SACzB,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;;AA5MF,wBAgOC;AAVc,4BAAqB,GAAG,CAAC,GAAQ,EAAE,SAAiB,CAAC,EAAU,EAAE,CAC9E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,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';\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
|
+
{"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,M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AAC,sBAAsB,GAAG,MAAM,CAAC,aAAa,CAAC;QAEtE,eAAe,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;QACvG,MAAM,MAAM,GAAG,kCAAe,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACtD,MAAM,aAAa,GAAG,eAAe,CAAC,aAAa,EAAE,CAAC;QAGtD,IAAI,OAAO,EAAE,2BAA2B,KAAK,SAAS,EAAE,CAAC;YACxD,OAAO,CAAC,2BAA2B,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,gBAAgB,GAAG,kCAAe,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QACvE,MAAM,SAAS,GAAc;YAC5B,IAAI;YACJ,eAAe,EAAE,eAAe,CAAC,eAAe;YAChD,MAAM,EAAE,MAAM;YACd,MAAM;YACN,OAAO,EAAE,gBAAgB;SACzB,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;;AAjNF,wBAqOC;AAVc,4BAAqB,GAAG,CAAC,GAAQ,EAAE,SAAiB,CAAC,EAAU,EAAE,CAC9E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,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';\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\tthrowErrors: boolean\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes, options?.onProgressCallback);\n\t\treader.context.throwErrors = options?.throwErrors !== undefined ? options.throwErrors : false;\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\tthrowErrors: boolean;\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\n\t\tblueprintReader.context.throwErrors = options?.throwErrors !== undefined ? options.throwErrors : false;\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}"]}
|
|
@@ -9,7 +9,7 @@ var BlueprintHeader;
|
|
|
9
9
|
const headerVersion = reader.readInt32();
|
|
10
10
|
const saveVersion = reader.readInt32();
|
|
11
11
|
const buildVersion = reader.readInt32();
|
|
12
|
-
const
|
|
12
|
+
const designerDimension = vec3_1.vec3.ParseInt(reader);
|
|
13
13
|
reader.context.headerVersion = headerVersion;
|
|
14
14
|
reader.context.saveVersion = saveVersion;
|
|
15
15
|
reader.context.buildVersion = buildVersion;
|
|
@@ -21,17 +21,17 @@ var BlueprintHeader;
|
|
|
21
21
|
itemCosts[i] = [itemPathName, itemCount];
|
|
22
22
|
}
|
|
23
23
|
let recipeCount = reader.readInt32();
|
|
24
|
-
const
|
|
24
|
+
const recipeReferences = new Array(recipeCount).fill({ levelName: '', pathName: '' });
|
|
25
25
|
for (let i = 0; i < recipeCount; i++) {
|
|
26
26
|
const recipeName = ObjectReference_1.ObjectReference.read(reader);
|
|
27
|
-
|
|
27
|
+
recipeReferences[i] = recipeName;
|
|
28
28
|
}
|
|
29
29
|
return {
|
|
30
30
|
headerVersion,
|
|
31
31
|
saveVersion,
|
|
32
32
|
buildVersion,
|
|
33
|
-
designerDimension
|
|
34
|
-
recipeReferences
|
|
33
|
+
designerDimension,
|
|
34
|
+
recipeReferences,
|
|
35
35
|
itemCosts
|
|
36
36
|
};
|
|
37
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blueprint-header.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-header.ts"],"names":[],"mappings":";;;AAEA,sEAAmE;AACnE,gDAA6C;AAY7C,IAAiB,eAAe,CAyE/B;AAzED,WAAiB,eAAe;IAEf,qBAAK,GAAG,CAAC,MAAqB,EAAmB,EAAE;QAE5D,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,CAAC,S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UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAGjC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3C,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACtC,iCAAe,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC;QAGD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAClD,KAAK,MAAM,eAAe,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YACpD,iCAAe,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QACnD,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAzEgB,eAAe,+BAAf,eAAe,QAyE/B","sourcesContent":["import { ContextReader } from '../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { ObjectReference } from '../types/structs/ObjectReference';\nimport { vec3 } from '../types/structs/vec3';\n\n/** @public */\nexport type BlueprintHeader = {\n headerVersion: number,\n saveVersion: number,\n buildVersion: number,\n designerDimension?: vec3;\n itemCosts: [ObjectReference, number][];\n recipeReferences: ObjectReference[];\n}\n\nexport namespace BlueprintHeader {\n\n export const Parse = (reader: ContextReader): BlueprintHeader => {\n\n const headerVersion = reader.readInt32();\n const saveVersion = reader.readInt32();\n const buildVersion = reader.readInt32();\n const designerDimension = vec3.ParseInt(reader); // e.g. 4,4,4 - dimensions in foundation size\n\n // set context\n reader.context.headerVersion = headerVersion;\n reader.context.saveVersion = saveVersion;\n reader.context.buildVersion = buildVersion;\n\n\n // list of item costs.\n let itemTypeCount = reader.readInt32();\n const itemCosts = new Array<[ObjectReference, number]>(itemTypeCount).fill([{ levelName: '', pathName: '' }, 0]);\n for (let i = 0; i < itemTypeCount; i++) {\n let itemPathName = ObjectReference.read(reader);\n let itemCount = reader.readInt32();\n\n itemCosts[i] = [itemPathName, itemCount];\n }\n\n // list of recipes\n let recipeCount = reader.readInt32();\n const recipeReferences = new Array<ObjectReference>(recipeCount).fill({ levelName: '', pathName: '' });\n for (let i = 0; i < recipeCount; i++) {\n const recipeName = ObjectReference.read(reader);\n recipeReferences[i] = recipeName;\n }\n\n return {\n headerVersion,\n saveVersion,\n buildVersion,\n designerDimension,\n recipeReferences,\n itemCosts\n } satisfies BlueprintHeader;\n\n }\n\n export const Serialize = (writer: ContextWriter, header: BlueprintHeader): void => {\n\n writer.writeInt32(header.headerVersion);\n writer.writeInt32(header.saveVersion);\n writer.writeInt32(header.buildVersion);\n\n // we assume a minimum of 4 foundations dimensions, standard blueprint designer.\n let dimensions = [\n header.designerDimension?.x ?? 4,\n header.designerDimension?.y ?? 4,\n header.designerDimension?.z ?? 4,\n ].map(dim => dim < 4 ? 4 : dim);\n writer.writeInt32(dimensions[0]);\n writer.writeInt32(dimensions[1]);\n writer.writeInt32(dimensions[2]);\n\n // list of item costs.\n writer.writeInt32(header.itemCosts.length);\n for (const itemCost of header.itemCosts) {\n ObjectReference.write(writer, itemCost[0])\n writer.writeInt32(itemCost[1]);\n }\n\n // list of recipes.\n writer.writeInt32(header.recipeReferences.length);\n for (const recipeReference of header.recipeReferences) {\n ObjectReference.write(writer, recipeReference);\n }\n }\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/level.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAmB,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAgB,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MA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