@etothepii/satisfactory-file-parser 3.2.3 → 3.3.1
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/.vscode/settings.json +6 -0
- package/CHANGELOG.md +15 -1
- package/README.md +18 -1
- package/build/index.d.ts +14 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +15 -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 +11 -7
- 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 +1 -0
- 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 +9 -7
- package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/StructProperty.js +81 -47
- package/build/parser/satisfactory/types/property/generic/StructProperty.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/FINLuaRuntimePersistenceState.d.ts +22 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINLuaRuntimePersistenceState.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINLuaRuntimePersistenceState.js +40 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItNetworks/FINLuaRuntimePersistenceState.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 +14 -11
- 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 +27 -6
- package/docs/classes/ContextReader.html +36 -0
- package/docs/classes/ContextWriter.html +41 -0
- package/docs/classes/CorruptBlueprintError.html +27 -6
- package/docs/classes/CorruptSaveError.html +27 -6
- package/docs/classes/Parser.html +8 -8
- package/docs/classes/ParserError.html +27 -6
- package/docs/classes/ReadableStreamParser.html +2 -2
- package/docs/classes/SatisfactorySave.html +2 -2
- 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 -4
- package/docs/classes/SaveStreamJsonStringifier.html +2 -2
- package/docs/classes/SaveStreamWriter.html +2 -2
- package/docs/classes/SaveWriter.html +6 -4
- package/docs/classes/TimeoutError.html +27 -6
- package/docs/classes/UnimplementedError.html +27 -6
- package/docs/classes/UnsupportedVersionError.html +27 -6
- 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 -1
- package/docs/functions/SaveBodyValidation.Serialize.html +1 -1
- 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/SoftObjectProperty.CalcOverhead.html +1 -0
- package/docs/functions/SoftObjectProperty.Parse.html +1 -0
- package/docs/functions/SoftObjectProperty.ReadValue.html +1 -0
- package/docs/functions/SoftObjectProperty.Serialize.html +1 -0
- package/docs/functions/SoftObjectProperty.SerializeValue.html +1 -0
- 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/isSoftObjectProperty.html +1 -0
- 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 +16 -4
- 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 +1 -1
- package/docs/modules/SetProperty.html +1 -1
- package/docs/modules/SoftObjectArrayProperty.html +1 -1
- package/docs/modules/SoftObjectProperty.html +6 -0
- 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 -4
- 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 +1 -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 -1
- 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 -1
- 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/SoftObjectProperty-1.html +1 -0
- 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 +6 -5
- package/tsconfig.test.json +13 -0
- 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/ClientIdentityInfo.html +0 -1
|
@@ -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,SAAS,EAAE,CAAC;QACvC,MAAM,YAAY,GAAG,MAAM,CA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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,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,M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,MAAM,KAAK,IAAI,KAAG,IAmBzK,CAAA;IAEM,MAAM,mBAAmB,WAAY,aAAa,SAAS,MAAM,WAAW,UAAU,EAAE,qBAAoB,MAAM,KAAO,IAiC/H,CAAA;IAEM,MAAM,0BAA0B,WAAY,aAAa,WAAW,CAAC,UAAU,GAAG,aAAa,CAAC,EAAE,aAAa,MAAM,KAAG,IA6B9H,CAAA;IAEM,MAAM,oBAAoB,WAAY,aAAa,eAAe,UAAU,EAAE,KAAG,IAUvF,CAAA;IAEM,MAAM,kBAAkB,WAAY,aAAa,SAAS,MAAM,KAAG,CAAC,UAAU,GAAG,aAAa,CAAC,EAsBrG,CAAA;IAEM,MAAM,yBAAyB,WAAY,aAAa,WAAW,CAAC,UAAU,GAAG,aAAa,CAAC,EAAE,KAAG,IAkB1G,CAAA;CACD"}
|
|
@@ -15,6 +15,7 @@ var Level;
|
|
|
15
15
|
objects: [],
|
|
16
16
|
collectables: []
|
|
17
17
|
};
|
|
18
|
+
const isPersistentLevel = reader.context.mapName === levelName;
|
|
18
19
|
const headersBinLen = reader.readInt32();
|
|
19
20
|
if (reader.context.saveVersion >= save_custom_version_1.SaveCustomVersion.UnrealEngine5) {
|
|
20
21
|
reader.readInt32Zero();
|
|
@@ -23,7 +24,7 @@ var Level;
|
|
|
23
24
|
Level.ReadAllObjectHeaders(reader, level.objects);
|
|
24
25
|
let remainingSize = headersBinLen - (reader.getBufferPosition() - posBeforeHeaders);
|
|
25
26
|
if (remainingSize > 0) {
|
|
26
|
-
if (
|
|
27
|
+
if (isPersistentLevel) {
|
|
27
28
|
level.destroyedActorsMap = level_to_destroyed_actors_map_1.LevelToDestroyedActorsMap.read(reader);
|
|
28
29
|
}
|
|
29
30
|
else {
|
|
@@ -42,16 +43,17 @@ var Level;
|
|
|
42
43
|
}
|
|
43
44
|
const posBeforeContents = reader.getBufferPosition();
|
|
44
45
|
Level.ReadAllObjectContents(levelName, reader, level.objects, reader.onProgressCallback);
|
|
46
|
+
level.objects = level.objects.filter(Boolean);
|
|
45
47
|
const posAfterContents = reader.getBufferPosition();
|
|
46
48
|
if (posAfterContents - posBeforeContents !== objectContentsBinLen) {
|
|
47
|
-
console.warn(
|
|
49
|
+
console.warn(`save seems corrupt. Level ${level.name} is not even obeying the object count checksum.`, level.name);
|
|
48
50
|
}
|
|
49
|
-
if (
|
|
51
|
+
if (!isPersistentLevel) {
|
|
50
52
|
if (reader.context.saveVersion >= save_custom_version_1.SaveCustomVersion.SerializePerStreamableLevelTOCVersion) {
|
|
51
53
|
level.saveCustomVersion = reader.readInt32();
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
if (
|
|
56
|
+
if (isPersistentLevel) {
|
|
55
57
|
level.destroyedActorsMap = level_to_destroyed_actors_map_1.LevelToDestroyedActorsMap.read(reader);
|
|
56
58
|
}
|
|
57
59
|
else {
|
|
@@ -60,26 +62,27 @@ var Level;
|
|
|
60
62
|
return level;
|
|
61
63
|
};
|
|
62
64
|
Level.SerializeLevel = (writer, level) => {
|
|
65
|
+
const isPersistentLevel = level.name === writer.context.mapName;
|
|
63
66
|
const lenIndicatorHeaderAndDestroyedEntitiesSize = writer.getBufferPosition();
|
|
64
67
|
writer.writeInt32(0);
|
|
65
68
|
if (writer.context.saveVersion >= save_custom_version_1.SaveCustomVersion.UnrealEngine5) {
|
|
66
69
|
writer.writeInt32Zero();
|
|
67
70
|
}
|
|
68
71
|
Level.SerializeAllObjectHeaders(writer, level.objects);
|
|
69
|
-
if (
|
|
72
|
+
if (isPersistentLevel && level.destroyedActorsMap !== undefined && Object.keys(level.destroyedActorsMap).length > 0) {
|
|
70
73
|
level_to_destroyed_actors_map_1.LevelToDestroyedActorsMap.write(writer, level.destroyedActorsMap);
|
|
71
74
|
}
|
|
72
|
-
else if (
|
|
75
|
+
else if (!isPersistentLevel && level.collectables.length > 0) {
|
|
73
76
|
object_references_list_1.ObjectReferencesList.SerializeList(writer, level.collectables);
|
|
74
77
|
}
|
|
75
78
|
writer.writeBinarySizeFromPosition(lenIndicatorHeaderAndDestroyedEntitiesSize, lenIndicatorHeaderAndDestroyedEntitiesSize + 8);
|
|
76
79
|
Level.SerializeAllObjectContents(writer, level.objects, level.name);
|
|
77
|
-
if (
|
|
80
|
+
if (!isPersistentLevel) {
|
|
78
81
|
if (writer.context.saveVersion >= save_custom_version_1.SaveCustomVersion.SerializePerStreamableLevelTOCVersion) {
|
|
79
82
|
writer.writeInt32(level.saveCustomVersion ?? save_custom_version_1.SaveCustomVersion.SerializePerStreamableLevelTOCVersion);
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
|
-
if (
|
|
85
|
+
if (isPersistentLevel) {
|
|
83
86
|
level_to_destroyed_actors_map_1.LevelToDestroyedActorsMap.write(writer, level.destroyedActorsMap ?? {});
|
|
84
87
|
}
|
|
85
88
|
else {
|
|
@@ -113,15 +116,27 @@ var Level;
|
|
|
113
116
|
}
|
|
114
117
|
const binarySize = reader.readInt32();
|
|
115
118
|
const before = reader.getBufferPosition();
|
|
116
|
-
|
|
117
|
-
SaveEntity_1.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
try {
|
|
120
|
+
if ((0, SaveEntity_1.isSaveEntity)(objects[i + objectListOffset])) {
|
|
121
|
+
SaveEntity_1.SaveEntity.ParseData(objects[i + objectListOffset], binarySize, reader, objects[i + objectListOffset].typePath);
|
|
122
|
+
}
|
|
123
|
+
else if ((0, SaveComponent_1.isSaveComponent)(objects[i + objectListOffset])) {
|
|
124
|
+
SaveComponent_1.SaveComponent.ParseData(objects[i + objectListOffset], binarySize, reader, objects[i + objectListOffset].typePath);
|
|
125
|
+
}
|
|
126
|
+
const after = reader.getBufferPosition();
|
|
127
|
+
if (after - before !== binarySize) {
|
|
128
|
+
throw new parser_error_1.CorruptSaveError(`Could not read entity ${objects[i + objectListOffset].instanceName}, as ${after - before} bytes were read, but ${binarySize} bytes were indicated.`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
if (reader.context.throwErrors) {
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
console.warn(`Could not read object ${objects[i + objectListOffset].instanceName} of type ${objects[i + objectListOffset].typePath} as a whole. will be removed from level's object list.`);
|
|
137
|
+
reader.skipBytes(before - reader.getBufferPosition() + binarySize);
|
|
138
|
+
objects[i + objectListOffset] = null;
|
|
139
|
+
}
|
|
125
140
|
}
|
|
126
141
|
}
|
|
127
142
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"level.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/level.ts"],"names":[],"mappings":";;;AAGA,2DAAgF;AAChF,kEAAgF;AAChF,4DAAuE;AAGvE,mFAA4E;AAC5E,qEAAgE;AAChE,+DAA0D;AAgB1D,IAAiB,KAAK,CAsPrB;AAtPD,WAAiB,KAAK;IAER,eAAS,GAAG,CAAC,MAAkB,EAAE,SAAiB,EAAS,EAAE;QACzE,MAAM,KAAK,GAAU;YACpB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,EAAE;YACX,YAAY,EAAE,EAAE;SAChB,CAAA;QAGD,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QACzC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,IAAI,uCAAiB,CAAC,aAAa,EAAE,CAAC;YACnE,MAAM,CAAC,aAAa,EAAE,CAAC;QACxB,CAAC;QAGD,MAAM,gBAAgB,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC;QACpD,MAAA,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAG5C,IAAI,aAAa,GAAG,aAAa,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE,GAAG,gBAAgB,CAAC,CAAC;QACpF,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YAEvB,IAAI,SAAS,KAAK,MAA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AI,EAAE,CAAC;gBAClB,KAAK,YAAY;oBAChB,MAAM,CAAC,UAAU,CAAC,uBAAU,CAAC,MAAM,CAAC,CAAC;oBACrC,uBAAU,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;oBACxC,MAAM;gBACP,KAAK,eAAe;oBACnB,MAAM,CAAC,UAAU,CAAC,6BAAa,CAAC,MAAM,CAAC,CAAC;oBACxC,6BAAa,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;oBAC3C,MAAM;gBACP;oBACC,MAAM,IAAI,iCAAkB,CAAC,uBAAwB,GAAsB,CAAC,IAAI,oBAAoB,CAAC,CAAC;oBACtG,MAAM;YACR,CAAC;QACF,CAAC;IACF,CAAC,CAAA;AACF,CAAC,EAtPgB,KAAK,qBAAL,KAAK,QAsPrB","sourcesContent":["\nimport { ContextReader } from '../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { CorruptSaveError, UnimplementedError } from '../../error/parser.error';\nimport { SaveComponent, isSaveComponent } from \"../types/objects/SaveComponent\";\nimport { SaveEntity, isSaveEntity } from \"../types/objects/SaveEntity\";\nimport { SaveObject } from \"../types/objects/SaveObject\";\nimport { ObjectReference } from \"../types/structs/ObjectReference\";\nimport { LevelToDestroyedActorsMap } from './level-to-destroyed-actors-map';\nimport { ObjectReferencesList } from './object-references-list';\nimport { SaveCustomVersion } from './save-custom-version';\nimport { SaveReader } from './save-reader';\n\n/**\n * type for levels\n * @param fiftyOne Use unclear. Added in Update 1.1\n */\nexport type Level = {\n\tname: string;\n\tobjects: (SaveEntity | SaveComponent)[];\n\tcollectables: ObjectReference[];\n\tsaveCustomVersion?: number;\n\tdestroyedActorsMap?: LevelToDestroyedActorsMap\n}\nexport type Levels = { [levelName: string]: Level };\n\nexport namespace Level {\n\n\texport const ReadLevel = (reader: SaveReader, levelName: string): Level => {\n\t\tconst level: Level = {\n\t\t\tname: levelName,\n\t\t\tobjects: [],\n\t\t\tcollectables: []\n\t\t}\n\n\t\t// checksum object headers.\n\t\tconst headersBinLen = reader.readInt32(); // object headers + binary length\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\treader.readInt32Zero();\n\t\t}\n\n\t\t// object headers\n\t\tconst posBeforeHeaders = reader.getBufferPosition();\n\t\tReadAllObjectHeaders(reader, level.objects);\n\n\t\t// for persistent level, we have LevelToDestroyedActorsMap, else collectibles. Only listed here since U8.\n\t\tlet remainingSize = headersBinLen - (reader.getBufferPosition() - posBeforeHeaders);\n\t\tif (remainingSize > 0) {\n\n\t\t\tif (levelName === reader.context.mapName) {\n\t\t\t\tlevel.destroyedActorsMap = LevelToDestroyedActorsMap.read(reader);\n\t\t\t} else {\n\t\t\t\tlevel.collectables = ObjectReferencesList.ReadList(reader);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// its perfectly possible for ported saves to have nothing here.\n\t\t}\n\n\n\t\tremainingSize = headersBinLen - (reader.getBufferPosition() - posBeforeHeaders);\n\t\tif (remainingSize !== 0) {\n\t\t\tconsole.warn(`remaining size ${remainingSize} not 0 in level ${levelName}. Save may be corrupt.`);\n\t\t}\n\n\t\t// checksum for object content size\n\t\tconst objectContentsBinLen = reader.readInt32();\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\treader.readInt32Zero();\n\t\t}\n\n\t\t// objects contents\n\t\tconst posBeforeContents = reader.getBufferPosition();\n\t\tReadAllObjectContents(levelName, reader, level.objects, reader.onProgressCallback);\n\t\tconst posAfterContents = reader.getBufferPosition();\n\t\tif (posAfterContents - posBeforeContents !== objectContentsBinLen) {\n\t\t\t//WARNING\n\t\t\tconsole.warn('save seems corrupt.', level.name);\n\t\t}\n\n\n\t\t// only NOT in the persistent level, we have saveVersion\n\t\tif (levelName !== reader.context.mapName) {\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion) {\n\t\t\t\tlevel.saveCustomVersion = reader.readInt32();\n\t\t\t}\n\t\t}\n\n\t\t// 2nd time.\n\t\t// for persistent level, we have LevelToDestroyedActorsMap, else collectibles\n\t\t// Listed here since < U8 and in U8 as well. So this is the best list you can rely on.\n\t\tif (levelName === reader.context.mapName) {\n\t\t\tlevel.destroyedActorsMap = LevelToDestroyedActorsMap.read(reader);\n\t\t} else {\n\t\t\tlevel.collectables = ObjectReferencesList.ReadList(reader);\n\t\t}\n\n\t\treturn level;\n\t}\n\n\texport const SerializeLevel = (writer: ContextWriter, level: Level): void => {\n\t\tconst lenIndicatorHeaderAndDestroyedEntitiesSize = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\t// len indicator\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\twriter.writeInt32Zero();\n\t\t}\n\n\t\tSerializeAllObjectHeaders(writer, level.objects);\n\n\t\t// <--- destroyed actors is the same as collectables list. Seems like its not there if count 0.\n\t\tif (level.name === writer.context.mapName && level.destroyedActorsMap !== undefined && Object.keys(level.destroyedActorsMap).length > 0) {\n\t\t\tLevelToDestroyedActorsMap.write(writer, level.destroyedActorsMap);\n\t\t} else if (level.name !== writer.context.mapName && level.collectables.length > 0) {\n\t\t\tObjectReferencesList.SerializeList(writer, level.collectables);\n\t\t}\n\n\t\t// replace binary size from earlier for - object headers + collectables\n\t\twriter.writeBinarySizeFromPosition(lenIndicatorHeaderAndDestroyedEntitiesSize, lenIndicatorHeaderAndDestroyedEntitiesSize + 8);\n\n\t\t// write entities\n\t\tSerializeAllObjectContents(writer, level.objects, level.name);\n\n\n\t\t// only NOT in the persistent level, we have saveVersion\n\t\tif (level.name !== writer.context.mapName) {\n\t\t\tif (writer.context.saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion) {\n\t\t\t\twriter.writeInt32(level.saveCustomVersion ?? SaveCustomVersion.SerializePerStreamableLevelTOCVersion);\n\t\t\t}\n\t\t}\n\n\t\t// 2nd time.\n\t\t// for persistent level, we have LevelToDestroyedActorsMap, else collectibles\n\t\tif (level.name === writer.context.mapName) {\n\t\t\tLevelToDestroyedActorsMap.write(writer, level.destroyedActorsMap ?? {});\n\t\t} else {\n\t\t\tObjectReferencesList.SerializeList(writer, level.collectables);\n\t\t}\n\t}\n\n\texport const ReadAllObjectContents = (levelName: string, reader: ContextReader, objectsList: SaveObject[], onProgressCallback: (progress: number, msg?: string) => void): void => {\n\t\tconst countEntities = reader.readInt32();\n\t\tif (countEntities !== objectsList.length) {\n\t\t\tthrow new Error(`possibly corrupt. entity count ${countEntities} does not equal object count of ${objectsList.length}`);\n\t\t}\n\n\t\t// read in batches\n\t\tconst batchSize = 10000;\n\t\tlet readObjectsCount = 0;\n\t\tlet lastProgressReport = 0;\n\t\twhile (readObjectsCount < countEntities) {\n\t\t\tReadNObjectContents(reader, Math.min(batchSize, countEntities - readObjectsCount), objectsList, readObjectsCount);\n\t\t\treadObjectsCount += Math.min(batchSize, countEntities - readObjectsCount);\n\n\t\t\tif (readObjectsCount - lastProgressReport > batchSize) {\n\t\t\t\tonProgressCallback(reader.getBufferProgress(), `read object count [${(readObjectsCount)}/${(countEntities)}] in level ${levelName}`);\n\t\t\t\tlastProgressReport = readObjectsCount;\n\t\t\t}\n\t\t}\n\t}\n\n\texport const ReadNObjectContents = (reader: ContextReader, count: number, objects: SaveObject[], objectListOffset: number = 0): void => {\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\tobjects[i + objectListOffset].saveCustomVersion = reader.readInt32();\n\t\t\t}\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\tobjects[i + objectListOffset].shouldMigrateObjectRefsToPersistent = reader.readInt32() >= 1;\n\t\t\t}\n\n\t\t\tconst binarySize = reader.readInt32();\n\n\t\t\tconst before = reader.getBufferPosition();\n\t\t\tif (isSaveEntity(objects[i + objectListOffset])) {\n\t\t\t\tSaveEntity.ParseData(objects[i + objectListOffset] as SaveEntity, binarySize, reader, objects[i + objectListOffset].typePath);\n\t\t\t} else if (isSaveComponent(objects[i + objectListOffset])) {\n\t\t\t\tSaveComponent.ParseData(objects[i + objectListOffset] as SaveComponent, binarySize, reader, objects[i + objectListOffset].typePath);\n\t\t\t}\n\n\t\t\tconst after = reader.getBufferPosition();\n\t\t\tif (after - before !== binarySize) {\n\t\t\t\tthrow new CorruptSaveError(`Could not read entity ${objects[i + objectListOffset].instanceName}, as ${after - before} bytes were read, but ${binarySize} bytes were indicated.`);\n\t\t\t}\n\t\t}\n\t}\n\n\texport const SerializeAllObjectContents = (writer: ContextWriter, objects: (SaveEntity | SaveComponent)[], levelName: string): void => {\n\t\tconst lenIndicatorEntities = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\twriter.writeInt32Zero();\n\t\t}\n\n\t\twriter.writeInt32(objects.length);\n\t\tfor (const obj of objects) {\n\n\t\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\twriter.writeInt32(obj.saveCustomVersion);\n\t\t\t}\n\t\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\twriter.writeInt32(obj.shouldMigrateObjectRefsToPersistent ? 1 : 0);\n\t\t\t}\n\t\t\tconst lenReplacementPosition = writer.getBufferPosition();\n\t\t\twriter.writeInt32(0);\n\n\t\t\tif (isSaveEntity(obj)) {\n\t\t\t\tSaveEntity.SerializeData(writer, obj);\n\t\t\t} else if (isSaveComponent(obj)) {\n\t\t\t\tSaveComponent.SerializeData(writer, obj);\n\t\t\t}\n\n\t\t\twriter.writeBinarySizeFromPosition(lenReplacementPosition, lenReplacementPosition + 4);\n\t\t}\n\t\twriter.writeBinarySizeFromPosition(lenIndicatorEntities, lenIndicatorEntities + 8);\n\t}\n\n\texport const ReadAllObjectHeaders = (reader: ContextReader, objectsList: SaveObject[]): void => {\n\t\tlet countObjectHeaders = reader.readInt32();\n\n\t\t// read in batches\n\t\tconst batchSize = 10000;\n\t\tlet readObjectHeadersCount = 0;\n\t\twhile (readObjectHeadersCount < countObjectHeaders) {\n\t\t\tobjectsList.push(...ReadNObjectHeaders(reader, Math.min(batchSize, countObjectHeaders - readObjectHeadersCount)));\n\t\t\treadObjectHeadersCount += Math.min(batchSize, countObjectHeaders - readObjectHeadersCount);\n\t\t}\n\t}\n\n\texport const ReadNObjectHeaders = (reader: ContextReader, count: number): (SaveEntity | SaveComponent)[] => {\n\t\tlet objects: (SaveEntity | SaveComponent)[] = [];\n\t\tlet objectsRead = 0;\n\t\tfor (; objectsRead < count; objectsRead++) {\n\n\t\t\tlet obj: SaveEntity | SaveComponent;\n\t\t\tlet objectType = reader.readInt32();\n\t\t\tswitch (objectType) {\n\t\t\t\tcase SaveEntity.TypeID:\n\t\t\t\t\tobj = new SaveEntity('', '', '', '');\n\t\t\t\t\tSaveEntity.ParseHeader(reader, obj);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SaveComponent.TypeID:\n\t\t\t\t\tobj = new SaveComponent('', '', '', '');\n\t\t\t\t\tSaveComponent.ParseHeader(reader, obj);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new CorruptSaveError('Unknown object type' + objectType);\n\t\t\t}\n\t\t\tobjects.push(obj);\n\t\t}\n\t\treturn objects;\n\t}\n\n\texport const SerializeAllObjectHeaders = (writer: ContextWriter, objects: (SaveEntity | SaveComponent)[]): void => {\n\t\twriter.writeInt32(objects.length);\n\t\tfor (const obj of objects) {\n\n\t\t\tswitch (obj.type) {\n\t\t\t\tcase 'SaveEntity':\n\t\t\t\t\twriter.writeInt32(SaveEntity.TypeID);\n\t\t\t\t\tSaveEntity.SerializeHeader(writer, obj);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'SaveComponent':\n\t\t\t\t\twriter.writeInt32(SaveComponent.TypeID);\n\t\t\t\t\tSaveComponent.SerializeHeader(writer, obj);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new UnimplementedError(`Unknown object type ${(obj as unknown as any).type}. Not implemented.`);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}"]}
|
|
1
|
+
{"version":3,"file":"level.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/level.ts"],"names":[],"mappings":";;;AAGA,2DAAgF;AAChF,kEAAgF;AAChF,4DAAuE;AAGvE,mFAA4E;AAC5E,qEAAgE;AAChE,+DAA0D;AAe1D,IAAiB,KAAK,CAkQrB;AAlQD,WAAiB,KAAK;IAER,eAAS,GAAG,CAAC,MAAkB,EAAE,SAAiB,EAAS,EAAE;QACzE,MAAM,KAAK,GAAU;YACpB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,EAAE;YACX,YAAY,EAAE,EAAE;SAChB,CAAA;QACD,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC;QAG/D,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QACzC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,IAAI,uCAAiB,CAAC,aAAa,EAAE,CAAC;YACnE,MAAM,CAAC,aAAa,EAAE,CAAC;QACxB,CAAC;QAGD,MAAM,gBAAgB,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC;QACpD,MAAA,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAG5C,IAAI,aAAa,GAAG,aAAa,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE,GAAG,gBAAgB,CAAC,CAAC;QACpF,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YAEvB,IAAI,iBAAiB,EAAE,CAAC;gBACvB,KAAK,CAAC,kBAAkB,GAAG,yDAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACnE,CAAC;iBAAM,CAAC;gBACP,KAAK,CAAC,YAA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AC,CAAC;YACjE,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC,CAAA;IAEY,+BAAyB,GAAG,CAAC,MAAqB,EAAE,OAAuC,EAAQ,EAAE;QACjH,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClC,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAE3B,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;gBAClB,KAAK,YAAY;oBAChB,MAAM,CAAC,UAAU,CAAC,uBAAU,CAAC,MAAM,CAAC,CAAC;oBACrC,uBAAU,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;oBACxC,MAAM;gBACP,KAAK,eAAe;oBACnB,MAAM,CAAC,UAAU,CAAC,6BAAa,CAAC,MAAM,CAAC,CAAC;oBACxC,6BAAa,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;oBAC3C,MAAM;gBACP;oBACC,MAAM,IAAI,iCAAkB,CAAC,uBAAwB,GAAsB,CAAC,IAAI,oBAAoB,CAAC,CAAC;oBACtG,MAAM;YACR,CAAC;QACF,CAAC;IACF,CAAC,CAAA;AACF,CAAC,EAlQgB,KAAK,qBAAL,KAAK,QAkQrB","sourcesContent":["\nimport { ContextReader } from '../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { CorruptSaveError, UnimplementedError } from '../../error/parser.error';\nimport { SaveComponent, isSaveComponent } from \"../types/objects/SaveComponent\";\nimport { SaveEntity, isSaveEntity } from \"../types/objects/SaveEntity\";\nimport { SaveObject } from \"../types/objects/SaveObject\";\nimport { ObjectReference } from \"../types/structs/ObjectReference\";\nimport { LevelToDestroyedActorsMap } from './level-to-destroyed-actors-map';\nimport { ObjectReferencesList } from './object-references-list';\nimport { SaveCustomVersion } from './save-custom-version';\nimport { SaveReader } from './save-reader';\n\n/**\n * type for levels\n */\nexport type Level = {\n\tname: string;\n\tobjects: (SaveEntity | SaveComponent)[];\n\tcollectables: ObjectReference[];\n\tsaveCustomVersion?: number;\n\tdestroyedActorsMap?: LevelToDestroyedActorsMap;\n}\nexport type Levels = { [levelName: string]: Level };\n\nexport namespace Level {\n\n\texport const ReadLevel = (reader: SaveReader, levelName: string): Level => {\n\t\tconst level: Level = {\n\t\t\tname: levelName,\n\t\t\tobjects: [],\n\t\t\tcollectables: []\n\t\t}\n\t\tconst isPersistentLevel = reader.context.mapName === levelName;\n\n\t\t// checksum object headers.\n\t\tconst headersBinLen = reader.readInt32(); // object headers + binary length\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\treader.readInt32Zero();\n\t\t}\n\n\t\t// object headers\n\t\tconst posBeforeHeaders = reader.getBufferPosition();\n\t\tReadAllObjectHeaders(reader, level.objects);\n\n\t\t// for persistent level, we have LevelToDestroyedActorsMap, else collectibles. Only listed here since U8.\n\t\tlet remainingSize = headersBinLen - (reader.getBufferPosition() - posBeforeHeaders);\n\t\tif (remainingSize > 0) {\n\n\t\t\tif (isPersistentLevel) {\n\t\t\t\tlevel.destroyedActorsMap = LevelToDestroyedActorsMap.read(reader);\n\t\t\t} else {\n\t\t\t\tlevel.collectables = ObjectReferencesList.ReadList(reader);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// its perfectly possible for ported saves to have nothing here.\n\t\t}\n\n\n\t\tremainingSize = headersBinLen - (reader.getBufferPosition() - posBeforeHeaders);\n\t\tif (remainingSize !== 0) {\n\t\t\tconsole.warn(`remaining size ${remainingSize} not 0 in level ${levelName}. Save may be corrupt.`);\n\t\t}\n\n\t\t// checksum for object content size\n\t\tconst objectContentsBinLen = reader.readInt32();\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\treader.readInt32Zero();\n\t\t}\n\n\t\t// objects contents\n\t\tconst posBeforeContents = reader.getBufferPosition();\n\t\tReadAllObjectContents(levelName, reader, level.objects, reader.onProgressCallback);\n\t\tlevel.objects = level.objects.filter(Boolean);\n\t\tconst posAfterContents = reader.getBufferPosition();\n\t\tif (posAfterContents - posBeforeContents !== objectContentsBinLen) {\n\t\t\tconsole.warn(`save seems corrupt. Level ${level.name} is not even obeying the object count checksum.`, level.name);\n\t\t}\n\n\n\t\t// only NOT in the persistent level, we have saveVersion\n\t\tif (!isPersistentLevel) {\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion) {\n\t\t\t\tlevel.saveCustomVersion = reader.readInt32();\n\t\t\t}\n\t\t}\n\n\t\t// 2nd time.\n\t\t// for persistent level, we have LevelToDestroyedActorsMap, else collectibles\n\t\t// Listed here since < U8 and in U8 as well. So this is the best list you can rely on.\n\t\tif (isPersistentLevel) {\n\t\t\tlevel.destroyedActorsMap = LevelToDestroyedActorsMap.read(reader);\n\t\t} else {\n\t\t\tlevel.collectables = ObjectReferencesList.ReadList(reader);\n\t\t}\n\n\t\treturn level;\n\t}\n\n\texport const SerializeLevel = (writer: ContextWriter, level: Level): void => {\n\t\tconst isPersistentLevel = level.name === writer.context.mapName;\n\t\tconst lenIndicatorHeaderAndDestroyedEntitiesSize = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\t// len indicator\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\twriter.writeInt32Zero();\n\t\t}\n\n\t\tSerializeAllObjectHeaders(writer, level.objects);\n\n\t\t// <--- destroyed actors is the same as collectables list. Seems like its not there if count 0.\n\t\tif (isPersistentLevel && level.destroyedActorsMap !== undefined && Object.keys(level.destroyedActorsMap).length > 0) {\n\t\t\tLevelToDestroyedActorsMap.write(writer, level.destroyedActorsMap);\n\t\t} else if (!isPersistentLevel && level.collectables.length > 0) {\n\t\t\tObjectReferencesList.SerializeList(writer, level.collectables);\n\t\t}\n\n\t\t// replace binary size from earlier for - object headers + collectables\n\t\twriter.writeBinarySizeFromPosition(lenIndicatorHeaderAndDestroyedEntitiesSize, lenIndicatorHeaderAndDestroyedEntitiesSize + 8);\n\n\t\t// write entities\n\t\tSerializeAllObjectContents(writer, level.objects, level.name);\n\n\n\t\t// only NOT in the persistent level, we have saveVersion\n\t\tif (!isPersistentLevel) {\n\t\t\tif (writer.context.saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion) {\n\t\t\t\twriter.writeInt32(level.saveCustomVersion ?? SaveCustomVersion.SerializePerStreamableLevelTOCVersion);\n\t\t\t}\n\t\t}\n\n\t\t// 2nd time.\n\t\t// for persistent level, we have LevelToDestroyedActorsMap, else collectibles\n\t\tif (isPersistentLevel) {\n\t\t\tLevelToDestroyedActorsMap.write(writer, level.destroyedActorsMap ?? {});\n\t\t} else {\n\t\t\tObjectReferencesList.SerializeList(writer, level.collectables);\n\t\t}\n\t}\n\n\texport const ReadAllObjectContents = (levelName: string, reader: ContextReader, objectsList: SaveObject[], onProgressCallback: (progress: number, msg?: string) => void): void => {\n\t\tconst countEntities = reader.readInt32();\n\t\tif (countEntities !== objectsList.length) {\n\t\t\tthrow new Error(`possibly corrupt. entity count ${countEntities} does not equal object count of ${objectsList.length}`);\n\t\t}\n\n\t\t// read in batches\n\t\tconst batchSize = 10000;\n\t\tlet readObjectsCount = 0;\n\t\tlet lastProgressReport = 0;\n\t\twhile (readObjectsCount < countEntities) {\n\t\t\tReadNObjectContents(reader, Math.min(batchSize, countEntities - readObjectsCount), objectsList, readObjectsCount);\n\t\t\treadObjectsCount += Math.min(batchSize, countEntities - readObjectsCount);\n\n\t\t\tif (readObjectsCount - lastProgressReport > batchSize) {\n\t\t\t\tonProgressCallback(reader.getBufferProgress(), `read object count [${(readObjectsCount)}/${(countEntities)}] in level ${levelName}`);\n\t\t\t\tlastProgressReport = readObjectsCount;\n\t\t\t}\n\t\t}\n\t}\n\n\texport const ReadNObjectContents = (reader: ContextReader, count: number, objects: SaveObject[], objectListOffset: number = 0): void => {\n\t\tfor (let i = 0; i < count; i++) {\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\tobjects[i + objectListOffset].saveCustomVersion = reader.readInt32();\n\t\t\t}\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\tobjects[i + objectListOffset].shouldMigrateObjectRefsToPersistent = reader.readInt32() >= 1;\n\t\t\t}\n\n\t\t\tconst binarySize = reader.readInt32();\n\t\t\tconst before = reader.getBufferPosition();\n\n\t\t\ttry {\n\t\t\t\tif (isSaveEntity(objects[i + objectListOffset])) {\n\t\t\t\t\tSaveEntity.ParseData(objects[i + objectListOffset] as SaveEntity, binarySize, reader, objects[i + objectListOffset].typePath);\n\t\t\t\t} else if (isSaveComponent(objects[i + objectListOffset])) {\n\t\t\t\t\tSaveComponent.ParseData(objects[i + objectListOffset] as SaveComponent, binarySize, reader, objects[i + objectListOffset].typePath);\n\t\t\t\t}\n\n\t\t\t\tconst after = reader.getBufferPosition();\n\t\t\t\tif (after - before !== binarySize) {\n\t\t\t\t\tthrow new CorruptSaveError(`Could not read entity ${objects[i + objectListOffset].instanceName}, as ${after - before} bytes were read, but ${binarySize} bytes were indicated.`);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (reader.context.throwErrors) {\n\t\t\t\t\tthrow error;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn(`Could not read object ${objects[i + objectListOffset].instanceName} of type ${objects[i + objectListOffset].typePath} as a whole. will be removed from level's object list.`);\n\t\t\t\t\treader.skipBytes(before - reader.getBufferPosition() + binarySize);\n\t\t\t\t\tobjects[i + objectListOffset] = null as unknown as SaveObject;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\texport const SerializeAllObjectContents = (writer: ContextWriter, objects: (SaveEntity | SaveComponent)[], levelName: string): void => {\n\t\tconst lenIndicatorEntities = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\twriter.writeInt32Zero();\n\t\t}\n\n\t\twriter.writeInt32(objects.length);\n\t\tfor (const obj of objects) {\n\n\t\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\twriter.writeInt32(obj.saveCustomVersion);\n\t\t\t}\n\t\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\twriter.writeInt32(obj.shouldMigrateObjectRefsToPersistent ? 1 : 0);\n\t\t\t}\n\t\t\tconst lenReplacementPosition = writer.getBufferPosition();\n\t\t\twriter.writeInt32(0);\n\n\t\t\tif (isSaveEntity(obj)) {\n\t\t\t\tSaveEntity.SerializeData(writer, obj);\n\t\t\t} else if (isSaveComponent(obj)) {\n\t\t\t\tSaveComponent.SerializeData(writer, obj);\n\t\t\t}\n\n\t\t\twriter.writeBinarySizeFromPosition(lenReplacementPosition, lenReplacementPosition + 4);\n\t\t}\n\t\twriter.writeBinarySizeFromPosition(lenIndicatorEntities, lenIndicatorEntities + 8);\n\t}\n\n\texport const ReadAllObjectHeaders = (reader: ContextReader, objectsList: SaveObject[]): void => {\n\t\tlet countObjectHeaders = reader.readInt32();\n\n\t\t// read in batches\n\t\tconst batchSize = 10000;\n\t\tlet readObjectHeadersCount = 0;\n\t\twhile (readObjectHeadersCount < countObjectHeaders) {\n\t\t\tobjectsList.push(...ReadNObjectHeaders(reader, Math.min(batchSize, countObjectHeaders - readObjectHeadersCount)));\n\t\t\treadObjectHeadersCount += Math.min(batchSize, countObjectHeaders - readObjectHeadersCount);\n\t\t}\n\t}\n\n\texport const ReadNObjectHeaders = (reader: ContextReader, count: number): (SaveEntity | SaveComponent)[] => {\n\t\tlet objects: (SaveEntity | SaveComponent)[] = [];\n\t\tlet objectsRead = 0;\n\t\tfor (; objectsRead < count; objectsRead++) {\n\n\t\t\tlet obj: SaveEntity | SaveComponent;\n\t\t\tlet objectType = reader.readInt32();\n\t\t\tswitch (objectType) {\n\t\t\t\tcase SaveEntity.TypeID:\n\t\t\t\t\tobj = new SaveEntity('', '', '', '');\n\t\t\t\t\tSaveEntity.ParseHeader(reader, obj);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SaveComponent.TypeID:\n\t\t\t\t\tobj = new SaveComponent('', '', '', '');\n\t\t\t\t\tSaveComponent.ParseHeader(reader, obj);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new CorruptSaveError('Unknown object type' + objectType);\n\t\t\t}\n\t\t\tobjects.push(obj);\n\t\t}\n\t\treturn objects;\n\t}\n\n\texport const SerializeAllObjectHeaders = (writer: ContextWriter, objects: (SaveEntity | SaveComponent)[]): void => {\n\t\twriter.writeInt32(objects.length);\n\t\tfor (const obj of objects) {\n\n\t\t\tswitch (obj.type) {\n\t\t\t\tcase 'SaveEntity':\n\t\t\t\t\twriter.writeInt32(SaveEntity.TypeID);\n\t\t\t\t\tSaveEntity.SerializeHeader(writer, obj);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'SaveComponent':\n\t\t\t\t\twriter.writeInt32(SaveComponent.TypeID);\n\t\t\t\t\tSaveComponent.SerializeHeader(writer, obj);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new UnimplementedError(`Unknown object type ${(obj as unknown as any).type}. Not implemented.`);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveObject.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhE,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAChC,Q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EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,8BAAsB,UAAW,YAAW,gBAAgB;IASxC,QAAQ,EAAE,MAAM;IAAS,UAAU,EAAE,MAAM;IAAS,YAAY,EAAE,MAAM;IAAS,KAAK,CAAC,EAAE,MAAM;IAP3G,UAAU,EAAE,aAAa,CAAM;IAC/B,iBAAiB,EAAE,iBAAiB,CAAC,+BAA+B,CAAsC;IAC1G,YAAY,EAAE,MAAM,EAAE,CAAM;IAE5B,iBAAiB,EAAE,MAAM,CAAK;IAC9B,mCAAmC,EAAE,OAAO,CAAS;gBAEzC,QAAQ,EAAE,MAAM,EAAS,UAAU,EAAE,MAAM,EAAS,YAAY,EAAE,MAAM,EAAS,KAAK,CAAC,EAAE,MAAM,YAAA;IAIlH,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;IAU1E,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;WAUhE,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;WAiCzF,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;CAM/D"}
|
|
@@ -35,16 +35,35 @@ class SaveObject {
|
|
|
35
35
|
}
|
|
36
36
|
static ParseData(obj, length, reader, typePath) {
|
|
37
37
|
const start = reader.getBufferPosition();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
let remainingSize = length;
|
|
39
|
+
try {
|
|
40
|
+
obj.properties = PropertiesList_1.PropertiesList.ParseList(reader);
|
|
41
|
+
reader.readInt32Zero();
|
|
42
|
+
remainingSize = length - (reader.getBufferPosition() - start);
|
|
43
|
+
obj.specialProperties = SpecialProperties_1.SpecialProperties.ParseClassSpecificSpecialProperties(reader, typePath, remainingSize);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (reader.context.throwErrors) {
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
console.warn(error);
|
|
51
|
+
console.warn(`data of object ${obj.instanceName} could not be read fully. Trailing data will be filled with raw bytes.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
42
54
|
remainingSize = length - (reader.getBufferPosition() - start);
|
|
43
55
|
if (remainingSize > 0) {
|
|
44
56
|
obj.trailingData = Array.from(reader.readBytes(remainingSize));
|
|
45
57
|
}
|
|
46
58
|
else if (remainingSize < 0) {
|
|
47
|
-
|
|
59
|
+
const error = new parser_error_1.ParserError('ParserError', `Unexpected. Read more bytes than are indicated for entity ${obj.instanceName}. bytes left to read is ${remainingSize}`);
|
|
60
|
+
if (reader.context.throwErrors) {
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
console.warn(error);
|
|
65
|
+
reader.skipBytes(-remainingSize);
|
|
66
|
+
}
|
|
48
67
|
}
|
|
49
68
|
}
|
|
50
69
|
static SerializeData(writer, obj) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveObject.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveObject.ts"],"names":[],"mappings":";;;AAEA,8DAA0D;AAC1D,wEAAmE;AAEnE,+DAA4D;AAC5D,6EAA0E;AAS1E,MAAsB,UAAU;IAS/B,YAAmB,QAAgB,EAAS,UAAkB,EAAS,YAAoB,EAAS,KAAc;QAA/F,aAAQ,GAAR,QAAQ,CAAQ;QAAS,eAAU,GAAV,UAAU,CAAQ;QAAS,iBAAY,GAAZ,YAAY,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAS;QAP3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AAa,EAAE,CAAC,CAAC;YACtK,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;gBAChC,MAAM,KAAK,CAAC;YACb,CAAC;iBAAM,CAAC;gBACP,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACpB,MAAM,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;YAClC,CAAC;QACF,CAAC;IACF,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,MAAW,EAAE,GAAe;QACvD,+BAAc,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;QACrD,MAAM,CAAC,cAAc,EAAE,CAAC;QACxB,qCAAiB,CAAC,uCAAuC,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACvG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;CACD;AAxED,gCAwEC","sourcesContent":["import { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\nimport { ParserError } from '../../../error/parser.error';\nimport { SaveCustomVersion } from '../../save/save-custom-version';\nimport { PropertiesMap } from \"../property/generic/AbstractBaseProperty\";\nimport { PropertiesList } from '../property/PropertiesList';\nimport { SpecialProperties } from '../property/special/SpecialProperties';\n\nexport interface SaveObjectHeader {\n\ttypePath: string;\n\trootObject: string;\n\tinstanceName: string;\n\tflags?: number;\n}\n\nexport abstract class SaveObject implements SaveObjectHeader {\n\n\tpublic properties: PropertiesMap = {};\n\tpublic specialProperties: SpecialProperties.AvailableSpecialPropertiesTypes = { type: 'EmptySpecialProperties' };\n\tpublic trailingData: number[] = [];\n\n\tpublic saveCustomVersion: number = 0;\n\tpublic shouldMigrateObjectRefsToPersistent: boolean = false;\n\n\tconstructor(public typePath: string, public rootObject: string, public instanceName: string, public flags?: number) {\n\n\t}\n\n\tprotected static ParseHeader(reader: ContextReader, obj: SaveObject): void {\n\t\tobj.typePath = reader.readString();\n\t\tobj.rootObject = reader.readString();\n\t\tobj.instanceName = reader.readString();\n\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.SerializeObjectFlags) {\n\t\t\tobj.flags = reader.readUint32();\n\t\t}\n\t}\n\n\tprotected static SerializeHeader(writer: ContextWriter, obj: SaveObject): void {\n\t\twriter.writeString(obj.typePath);\n\t\twriter.writeString(obj.rootObject);\n\t\twriter.writeString(obj.instanceName);\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.SerializeObjectFlags) {\n\t\t\twriter.writeUint32(obj.flags ?? 0);\n\t\t}\n\t}\n\n\tpublic static ParseData(obj: SaveObject, length: number, reader: ContextReader, typePath: string): void {\n\t\tconst start = reader.getBufferPosition();\n\t\tlet remainingSize = length;\n\n\t\ttry {\n\t\t\tobj.properties = PropertiesList.ParseList(reader);\n\t\t\treader.readInt32Zero();\n\n\t\t\tremainingSize = length - (reader.getBufferPosition() - start);\n\t\t\tobj.specialProperties = SpecialProperties.ParseClassSpecificSpecialProperties(reader, typePath, remainingSize);\n\t\t} catch (error) {\n\t\t\tif (reader.context.throwErrors) {\n\t\t\t\tthrow error;\n\t\t\t} else {\n\t\t\t\tconsole.warn(error);\n\t\t\t\tconsole.warn(`data of object ${obj.instanceName} could not be read fully. Trailing data will be filled with raw bytes.`);\n\t\t\t}\n\t\t}\n\n\t\tremainingSize = length - (reader.getBufferPosition() - start);\n\t\tif (remainingSize > 0) {\n\t\t\tobj.trailingData = Array.from(reader.readBytes(remainingSize));\n\t\t} else if (remainingSize < 0) {\n\t\t\tconst error = new ParserError('ParserError', `Unexpected. Read more bytes than are indicated for entity ${obj.instanceName}. bytes left to read is ${remainingSize}`);\n\t\t\tif (reader.context.throwErrors) {\n\t\t\t\tthrow error;\n\t\t\t} else {\n\t\t\t\tconsole.warn(error);\n\t\t\t\treader.skipBytes(-remainingSize);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic static SerializeData(writer: any, obj: SaveObject): void {\n\t\tPropertiesList.SerializeList(writer, obj.properties);\n\t\twriter.writeInt32Zero();\n\t\tSpecialProperties.SerializeClassSpecificSpecialProperties(writer, obj.typePath, obj.specialProperties);\n\t\twriter.writeBytesArray(obj.trailingData);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertiesList.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/property/PropertiesList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAsBrF,yBAAiB,cAAc,CAAC;IAExB,MAAM,SAAS,WAAY,aAAa,KAAG,
|
|
1
|
+
{"version":3,"file":"PropertiesList.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/property/PropertiesList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAsBrF,yBAAiB,cAAc,CAAC;IAExB,MAAM,SAAS,WAAY,aAAa,KAAG,aAsBjD,CAAA;IAEM,MAAM,aAAa,WAAY,aAAa,cAAc,aAAa,KAAG,IAMhF,CAAA;IAEM,MAAM,mBAAmB,WAAY,aAAa,gBAAgB,MAAM,KAAG,oBAmJjF,CAAA;IAEM,MAAM,uBAAuB,WAAY,aAAa,YAAY,oBAAoB,KAAG,IA6H/F,CAAA;CACD"}
|
|
@@ -55,98 +55,123 @@ var PropertiesList;
|
|
|
55
55
|
const index = reader.readInt32();
|
|
56
56
|
const before = reader.getBufferPosition();
|
|
57
57
|
let overhead = 0;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
58
|
+
let subtype = '';
|
|
59
|
+
try {
|
|
60
|
+
switch (propertyType) {
|
|
61
|
+
case 'BoolProperty':
|
|
62
|
+
overhead = BoolProperty_1.BoolProperty.CalcOverhead(currentProperty);
|
|
63
|
+
currentProperty = BoolProperty_1.BoolProperty.Parse(reader, propertyType, index);
|
|
64
|
+
break;
|
|
65
|
+
case 'ByteProperty':
|
|
66
|
+
const type = reader.readString();
|
|
67
|
+
overhead = ByteProperty_1.ByteProperty.CalcOverhead(currentProperty, type);
|
|
68
|
+
currentProperty = ByteProperty_1.ByteProperty.Parse(reader, propertyType, index, type);
|
|
69
|
+
break;
|
|
70
|
+
case 'Int8Property':
|
|
71
|
+
overhead = Int8Property_1.Int8Property.CalcOverhead(currentProperty);
|
|
72
|
+
currentProperty = Int8Property_1.Int8Property.Parse(reader, propertyType, index);
|
|
73
|
+
break;
|
|
74
|
+
case 'UInt8Property':
|
|
75
|
+
overhead = Uint8Property_1.Uint8Property.CalcOverhead(currentProperty);
|
|
76
|
+
currentProperty = Uint8Property_1.Uint8Property.Parse(reader, propertyType, index);
|
|
77
|
+
break;
|
|
78
|
+
case 'IntProperty':
|
|
79
|
+
case 'Int32Property':
|
|
80
|
+
overhead = Int32Property_1.Int32Property.CalcOverhead(currentProperty);
|
|
81
|
+
currentProperty = Int32Property_1.Int32Property.Parse(reader, propertyType, index);
|
|
82
|
+
break;
|
|
83
|
+
case 'UInt32Property':
|
|
84
|
+
overhead = Uint32Property_1.Uint32Property.CalcOverhead(currentProperty);
|
|
85
|
+
currentProperty = Uint32Property_1.Uint32Property.Parse(reader, propertyType, index);
|
|
86
|
+
break;
|
|
87
|
+
case 'Int64Property':
|
|
88
|
+
overhead = Int64Property_1.Int64Property.CalcOverhead(currentProperty);
|
|
89
|
+
currentProperty = Int64Property_1.Int64Property.Parse(reader, propertyType, index);
|
|
90
|
+
break;
|
|
91
|
+
case 'UInt64Property':
|
|
92
|
+
overhead = Uint64Property_1.Uint64Property.CalcOverhead(currentProperty);
|
|
93
|
+
currentProperty = Uint64Property_1.Uint64Property.Parse(reader, propertyType, index);
|
|
94
|
+
break;
|
|
95
|
+
case 'SingleProperty':
|
|
96
|
+
case 'FloatProperty':
|
|
97
|
+
overhead = FloatProperty_1.FloatProperty.CalcOverhead(currentProperty);
|
|
98
|
+
currentProperty = FloatProperty_1.FloatProperty.Parse(reader, propertyType, index);
|
|
99
|
+
break;
|
|
100
|
+
case 'DoubleProperty':
|
|
101
|
+
overhead = DoubleProperty_1.DoubleProperty.CalcOverhead(currentProperty);
|
|
102
|
+
currentProperty = DoubleProperty_1.DoubleProperty.Parse(reader, propertyType, index);
|
|
103
|
+
break;
|
|
104
|
+
case 'StrProperty':
|
|
105
|
+
case 'NameProperty':
|
|
106
|
+
overhead = StrProperty_1.StrProperty.CalcOverhead(currentProperty);
|
|
107
|
+
currentProperty = StrProperty_1.StrProperty.Parse(reader, propertyType, index);
|
|
108
|
+
break;
|
|
109
|
+
case 'ObjectProperty':
|
|
110
|
+
case 'InterfaceProperty':
|
|
111
|
+
overhead = ObjectProperty_1.ObjectProperty.CalcOverhead(currentProperty);
|
|
112
|
+
currentProperty = ObjectProperty_1.ObjectProperty.Parse(reader, propertyType, index);
|
|
113
|
+
break;
|
|
114
|
+
case 'SoftObjectProperty':
|
|
115
|
+
overhead = SoftObjectProperty_1.SoftObjectProperty.CalcOverhead(currentProperty);
|
|
116
|
+
currentProperty = SoftObjectProperty_1.SoftObjectProperty.Parse(reader, propertyType, index);
|
|
117
|
+
break;
|
|
118
|
+
case 'EnumProperty':
|
|
119
|
+
const name = reader.readString();
|
|
120
|
+
overhead = EnumProperty_1.EnumProperty.CalcOverhead(currentProperty, name);
|
|
121
|
+
currentProperty = EnumProperty_1.EnumProperty.Parse(reader, propertyType, name, index);
|
|
122
|
+
break;
|
|
123
|
+
case 'StructProperty':
|
|
124
|
+
subtype = reader.readString();
|
|
125
|
+
overhead = StructProperty_1.StructProperty.CalcOverhead(currentProperty, subtype);
|
|
126
|
+
currentProperty = StructProperty_1.StructProperty.Parse(reader, propertyType, index, binarySize, subtype);
|
|
127
|
+
break;
|
|
128
|
+
case 'ArrayProperty':
|
|
129
|
+
subtype = reader.readString();
|
|
130
|
+
overhead = ArrayProperty_1.ArrayProperty.CalcOverhead(currentProperty, subtype);
|
|
131
|
+
currentProperty = ArrayProperty_1.ArrayProperty.Parse(reader, propertyType, index, binarySize, subtype);
|
|
132
|
+
break;
|
|
133
|
+
case 'MapProperty':
|
|
134
|
+
const keyType = reader.readString();
|
|
135
|
+
const valueType = reader.readString();
|
|
136
|
+
overhead = MapProperty_1.MapProperty.CalcOverhead(currentProperty, keyType, valueType);
|
|
137
|
+
currentProperty = MapProperty_1.MapProperty.Parse(reader, propertyName, binarySize, keyType, valueType);
|
|
138
|
+
break;
|
|
139
|
+
case 'TextProperty':
|
|
140
|
+
overhead = TextProperty_1.TextProperty.CalcOverhead(currentProperty);
|
|
141
|
+
currentProperty = TextProperty_1.TextProperty.Parse(reader, propertyType, index);
|
|
142
|
+
break;
|
|
143
|
+
case 'SetProperty':
|
|
144
|
+
subtype = reader.readString();
|
|
145
|
+
overhead = SetProperty_1.SetProperty.CalcOverhead(currentProperty, subtype);
|
|
146
|
+
currentProperty = SetProperty_1.SetProperty.Parse(reader, propertyType, index, propertyName, subtype);
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
throw new Error(`Unimplemented type ${propertyType}, at byte position ${reader.getBufferPosition()}`);
|
|
150
|
+
}
|
|
151
|
+
currentProperty.name = propertyName;
|
|
152
|
+
const readBytes = reader.getBufferPosition() - before - overhead;
|
|
153
|
+
if (readBytes !== binarySize) {
|
|
154
|
+
throw new parser_error_1.ParserError('ParserError', `Property possibly corrupt. Read ${readBytes} bytes for ${propertyType} ${propertyName}, but ${binarySize} bytes were indicated.`);
|
|
155
|
+
}
|
|
140
156
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
157
|
+
catch (error) {
|
|
158
|
+
if (reader.context.throwErrors) {
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
console.warn(error);
|
|
163
|
+
console.warn(`property ${propertyName} of type ${propertyType} is therefore dumped as raw bytes.`);
|
|
164
|
+
reader.skipBytes(before - reader.getBufferPosition());
|
|
165
|
+
currentProperty.rawBytes = Array.from(reader.readBytes(binarySize + overhead));
|
|
166
|
+
}
|
|
146
167
|
}
|
|
147
168
|
return currentProperty;
|
|
148
169
|
};
|
|
149
170
|
PropertiesList.SerializeSingleProperty = (writer, property) => {
|
|
171
|
+
if (property.rawBytes !== undefined) {
|
|
172
|
+
writer.writeBytesArray(property.rawBytes);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
150
175
|
writer.writeString(property.ueType);
|
|
151
176
|
const lenIndicator = writer.getBufferPosition();
|
|
152
177
|
writer.writeInt32(0);
|
|
@@ -159,7 +184,7 @@ var PropertiesList;
|
|
|
159
184
|
BoolProperty_1.BoolProperty.Serialize(writer, property);
|
|
160
185
|
break;
|
|
161
186
|
case 'ByteProperty':
|
|
162
|
-
overhead = ByteProperty_1.ByteProperty.CalcOverhead(property);
|
|
187
|
+
overhead = ByteProperty_1.ByteProperty.CalcOverhead(property, property.value.type);
|
|
163
188
|
ByteProperty_1.ByteProperty.Serialize(writer, property);
|
|
164
189
|
break;
|
|
165
190
|
case 'Int8Property':
|
|
@@ -211,23 +236,19 @@ var PropertiesList;
|
|
|
211
236
|
SoftObjectProperty_1.SoftObjectProperty.Serialize(writer, property);
|
|
212
237
|
break;
|
|
213
238
|
case 'EnumProperty':
|
|
214
|
-
overhead = EnumProperty_1.EnumProperty.CalcOverhead(property);
|
|
239
|
+
overhead = EnumProperty_1.EnumProperty.CalcOverhead(property, property.value.name);
|
|
215
240
|
EnumProperty_1.EnumProperty.Serialize(writer, property);
|
|
216
241
|
break;
|
|
217
|
-
case 'ByteProperty':
|
|
218
|
-
overhead = ByteProperty_1.ByteProperty.CalcOverhead(property);
|
|
219
|
-
ByteProperty_1.ByteProperty.Serialize(writer, property);
|
|
220
|
-
break;
|
|
221
242
|
case 'StructProperty':
|
|
222
|
-
overhead = StructProperty_1.StructProperty.CalcOverhead(property);
|
|
243
|
+
overhead = StructProperty_1.StructProperty.CalcOverhead(property, property.subtype);
|
|
223
244
|
StructProperty_1.StructProperty.Serialize(writer, property);
|
|
224
245
|
break;
|
|
225
246
|
case 'ArrayProperty':
|
|
226
|
-
overhead = ArrayProperty_1.ArrayProperty.CalcOverhead(property);
|
|
247
|
+
overhead = ArrayProperty_1.ArrayProperty.CalcOverhead(property, property.subtype);
|
|
227
248
|
ArrayProperty_1.ArrayProperty.Serialize(writer, property);
|
|
228
249
|
break;
|
|
229
250
|
case 'MapProperty':
|
|
230
|
-
overhead = MapProperty_1.MapProperty.CalcOverhead(property);
|
|
251
|
+
overhead = MapProperty_1.MapProperty.CalcOverhead(property, property.keyType, property.valueType);
|
|
231
252
|
MapProperty_1.MapProperty.Serialize(writer, property);
|
|
232
253
|
break;
|
|
233
254
|
case 'TextProperty':
|
|
@@ -235,7 +256,7 @@ var PropertiesList;
|
|
|
235
256
|
TextProperty_1.TextProperty.Serialize(writer, property);
|
|
236
257
|
break;
|
|
237
258
|
case 'SetProperty':
|
|
238
|
-
overhead = SetProperty_1.SetProperty.CalcOverhead(property);
|
|
259
|
+
overhead = SetProperty_1.SetProperty.CalcOverhead(property, property.subtype);
|
|
239
260
|
SetProperty_1.SetProperty.Serialize(writer, property);
|
|
240
261
|
break;
|
|
241
262
|
default:
|