@etothepii/satisfactory-file-parser 3.1.2 → 3.2.2
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/.github/workflows/tests.yml +1 -1
- package/CHANGELOG.md +18 -0
- package/GUIDE.md +7 -1
- package/README.md +4 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/parser/context/context.d.ts +1 -0
- package/build/parser/context/context.d.ts.map +1 -1
- package/build/parser/context/context.js.map +1 -1
- package/build/parser/parser.d.ts.map +1 -1
- package/build/parser/parser.js +4 -4
- package/build/parser/parser.js.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save-header.d.ts.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save-header.js +4 -3
- package/build/parser/satisfactory/save/satisfactory-save-header.js.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save.d.ts +2 -3
- package/build/parser/satisfactory/save/satisfactory-save.d.ts.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save.js +1 -2
- package/build/parser/satisfactory/save/satisfactory-save.js.map +1 -1
- package/build/parser/satisfactory/save/save-reader.d.ts +0 -17
- package/build/parser/satisfactory/save/save-reader.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save-reader.js +1 -37
- package/build/parser/satisfactory/save/save-reader.js.map +1 -1
- package/build/parser/satisfactory/save/save-writer.d.ts +0 -3
- package/build/parser/satisfactory/save/save-writer.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save-writer.js +0 -22
- package/build/parser/satisfactory/save/save-writer.js.map +1 -1
- package/build/parser/satisfactory/types/property/PropertiesList.js +1 -1
- package/build/parser/satisfactory/types/property/PropertiesList.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts +3 -3
- package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.js +12 -2
- package/build/parser/satisfactory/types/property/generic/MapProperty.js.map +1 -1
- package/build/parser/satisfactory/types/structs/SaveBodyValidation.d.ts +19 -0
- package/build/parser/satisfactory/types/structs/SaveBodyValidation.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/SaveBodyValidation.js +41 -0
- package/build/parser/satisfactory/types/structs/SaveBodyValidation.js.map +1 -0
- package/build/parser/stream/reworked/readable-stream-parser.d.ts +1 -1
- package/build/parser/stream/reworked/readable-stream-parser.d.ts.map +1 -1
- package/build/parser/stream/reworked/readable-stream-parser.js +6 -7
- package/build/parser/stream/reworked/readable-stream-parser.js.map +1 -1
- package/build/parser/stream/reworked/save-stream-json-stringifier.d.ts.map +1 -1
- package/build/parser/stream/reworked/save-stream-json-stringifier.js +1 -2
- package/build/parser/stream/reworked/save-stream-json-stringifier.js.map +1 -1
- package/build/parser/stream/reworked/save-stream-writer.class.d.ts +2 -3
- package/build/parser/stream/reworked/save-stream-writer.class.d.ts.map +1 -1
- package/build/parser/stream/reworked/save-stream-writer.class.js +4 -7
- package/build/parser/stream/reworked/save-stream-writer.class.js.map +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/BlueprintConfigReader.html +4 -4
- package/docs/classes/BlueprintConfigWriter.html +4 -4
- package/docs/classes/BlueprintReader.html +4 -4
- package/docs/classes/BlueprintWriter.html +4 -4
- package/docs/classes/CompressionLibraryError.html +2 -2
- package/docs/classes/CorruptBlueprintError.html +2 -2
- package/docs/classes/CorruptSaveError.html +2 -2
- package/docs/classes/Parser.html +6 -6
- package/docs/classes/ParserError.html +2 -2
- package/docs/classes/ReadableStreamParser.html +2 -2
- package/docs/classes/SatisfactorySave.html +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 +5 -6
- package/docs/classes/SaveStreamJsonStringifier.html +2 -2
- package/docs/classes/SaveStreamWriter.html +2 -2
- package/docs/classes/SaveWriter.html +5 -6
- package/docs/classes/TimeoutError.html +2 -2
- package/docs/classes/UnimplementedError.html +2 -2
- package/docs/classes/UnsupportedVersionError.html +2 -2
- package/docs/enums/BlueprintConfigVersion.html +2 -2
- package/docs/enums/BlueprintHeaderVersion.html +2 -2
- package/docs/enums/CompressionAlgorithmCode.html +2 -2
- package/docs/enums/FactoryGameCustomVersion.html +2 -2
- package/docs/enums/RuntimeBuildableInstanceDataVersion.html +2 -2
- package/docs/enums/SaveCustomVersion.html +10 -10
- package/docs/enums/SaveHeaderType.html +2 -2
- package/docs/functions/AbstractBaseProperty.Create.html +1 -1
- package/docs/functions/ArrayProperty.CalcOverhead.html +1 -1
- package/docs/functions/ArrayProperty.Parse.html +1 -1
- package/docs/functions/ArrayProperty.Serialize.html +1 -1
- package/docs/functions/BlueprintConfig.Parse.html +1 -1
- package/docs/functions/BlueprintConfig.Serialize.html +1 -1
- package/docs/functions/BlueprintHeader.Parse.html +1 -1
- package/docs/functions/BlueprintHeader.Serialize.html +1 -1
- package/docs/functions/BoolArrayProperty.Parse.html +1 -1
- package/docs/functions/BoolArrayProperty.Serialize.html +1 -1
- package/docs/functions/BoolProperty.CalcOverhead.html +1 -1
- package/docs/functions/BoolProperty.Parse.html +1 -1
- package/docs/functions/BoolProperty.ReadValue.html +1 -1
- package/docs/functions/BoolProperty.Serialize.html +1 -1
- package/docs/functions/BoolProperty.SerializeValue.html +1 -1
- package/docs/functions/BuildableSubsystemSpecialProperties.Parse.html +1 -1
- package/docs/functions/BuildableSubsystemSpecialProperties.Serialize.html +1 -1
- package/docs/functions/BuildableTypeInstance.Parse.html +1 -1
- package/docs/functions/BuildableTypeInstance.Serialize.html +1 -1
- package/docs/functions/ByteArrayProperty.Parse.html +1 -1
- package/docs/functions/ByteArrayProperty.Serialize.html +1 -1
- package/docs/functions/ByteProperty.CalcOverhead.html +1 -1
- package/docs/functions/ByteProperty.Parse.html +1 -1
- package/docs/functions/ByteProperty.ReadValue.html +1 -1
- package/docs/functions/ByteProperty.Serialize.html +1 -1
- package/docs/functions/ByteProperty.SerializeValue.html +1 -1
- package/docs/functions/CircuitSpecialProperties.Parse.html +1 -1
- package/docs/functions/CircuitSpecialProperties.Serialize.html +1 -1
- package/docs/functions/ConveyorChainActorSpecialProperties.Parse.html +1 -1
- package/docs/functions/ConveyorChainActorSpecialProperties.Serialize.html +1 -1
- package/docs/functions/ConveyorSpecialProperties.Parse.html +1 -1
- package/docs/functions/ConveyorSpecialProperties.Serialize.html +1 -1
- package/docs/functions/DoubleArrayProperty.Parse.html +1 -1
- package/docs/functions/DoubleArrayProperty.Serialize.html +1 -1
- package/docs/functions/DoubleProperty.CalcOverhead.html +1 -1
- package/docs/functions/DoubleProperty.Parse.html +1 -1
- package/docs/functions/DoubleProperty.ReadValue.html +1 -1
- package/docs/functions/DoubleProperty.Serialize.html +1 -1
- package/docs/functions/DoubleProperty.SerializeValue.html +1 -1
- package/docs/functions/DynamicStructPropertyValue.read.html +1 -1
- package/docs/functions/DynamicStructPropertyValue.write.html +1 -1
- package/docs/functions/EmptySpecialProperties.Parse.html +1 -1
- package/docs/functions/EmptySpecialProperties.Serialize.html +1 -1
- package/docs/functions/EnumArrayProperty.Parse.html +1 -1
- package/docs/functions/EnumArrayProperty.Serialize.html +1 -1
- package/docs/functions/EnumProperty.CalcOverhead.html +1 -1
- package/docs/functions/EnumProperty.Parse.html +1 -1
- package/docs/functions/EnumProperty.ReadValue.html +1 -1
- package/docs/functions/EnumProperty.Serialize.html +1 -1
- package/docs/functions/EnumProperty.SerializeValue.html +1 -1
- package/docs/functions/FGDynamicStruct.Parse.html +1 -1
- package/docs/functions/FGDynamicStruct.Serialize.html +1 -1
- package/docs/functions/FICFrameRange.Parse.html +1 -1
- package/docs/functions/FICFrameRange.Serialize.html +1 -1
- package/docs/functions/FloatArrayProperty.Parse.html +1 -1
- package/docs/functions/FloatArrayProperty.Serialize.html +1 -1
- package/docs/functions/FloatProperty.CalcOverhead.html +1 -1
- package/docs/functions/FloatProperty.Parse.html +1 -1
- package/docs/functions/FloatProperty.ReadValue.html +1 -1
- package/docs/functions/FloatProperty.Serialize.html +1 -1
- package/docs/functions/FloatProperty.SerializeValue.html +1 -1
- package/docs/functions/GUID.read.html +1 -1
- package/docs/functions/GUID.write.html +1 -1
- package/docs/functions/GUIDInfo.read.html +1 -1
- package/docs/functions/GUIDInfo.write.html +1 -1
- package/docs/functions/Int32ArrayProperty.Parse.html +1 -1
- package/docs/functions/Int32ArrayProperty.Serialize.html +1 -1
- package/docs/functions/Int32Property.CalcOverhead.html +1 -1
- package/docs/functions/Int32Property.Parse.html +1 -1
- package/docs/functions/Int32Property.ReadValue.html +1 -1
- package/docs/functions/Int32Property.Serialize.html +1 -1
- package/docs/functions/Int32Property.SerializeValue.html +1 -1
- package/docs/functions/Int32SetProperty.Parse.html +1 -1
- package/docs/functions/Int32SetProperty.Serialize.html +1 -1
- package/docs/functions/Int64ArrayProperty.Parse.html +1 -1
- package/docs/functions/Int64ArrayProperty.Serialize.html +1 -1
- package/docs/functions/Int64Property.CalcOverhead.html +1 -1
- package/docs/functions/Int64Property.Parse.html +1 -1
- package/docs/functions/Int64Property.ReadValue.html +1 -1
- package/docs/functions/Int64Property.Serialize.html +1 -1
- package/docs/functions/Int64Property.SerializeValue.html +1 -1
- package/docs/functions/Int8Property.CalcOverhead.html +1 -1
- package/docs/functions/Int8Property.Parse.html +1 -1
- package/docs/functions/Int8Property.ReadValue.html +1 -1
- package/docs/functions/Int8Property.Serialize.html +1 -1
- package/docs/functions/Int8Property.SerializeValue.html +1 -1
- package/docs/functions/Level.ReadAllObjectContents.html +1 -1
- package/docs/functions/Level.ReadAllObjectHeaders.html +1 -1
- package/docs/functions/Level.ReadLevel.html +1 -1
- package/docs/functions/Level.ReadNObjectContents.html +1 -1
- package/docs/functions/Level.ReadNObjectHeaders.html +1 -1
- package/docs/functions/Level.SerializeAllObjectContents.html +1 -1
- package/docs/functions/Level.SerializeAllObjectHeaders.html +1 -1
- package/docs/functions/Level.SerializeLevel.html +1 -1
- package/docs/functions/LevelToDestroyedActorsMap.read.html +1 -1
- package/docs/functions/LevelToDestroyedActorsMap.write.html +1 -1
- package/docs/functions/MD5Hash.read.html +1 -1
- package/docs/functions/MD5Hash.write.html +1 -1
- package/docs/functions/MapProperty.CalcOverhead.html +1 -1
- package/docs/functions/MapProperty.Parse.html +1 -1
- package/docs/functions/MapProperty.Serialize.html +1 -1
- package/docs/functions/ObjectArrayProperty.Parse.html +1 -1
- package/docs/functions/ObjectArrayProperty.Serialize.html +1 -1
- package/docs/functions/ObjectProperty.CalcOverhead.html +1 -1
- package/docs/functions/ObjectProperty.Parse.html +1 -1
- package/docs/functions/ObjectProperty.ReadValue.html +1 -1
- package/docs/functions/ObjectProperty.Serialize.html +1 -1
- package/docs/functions/ObjectProperty.SerializeValue.html +1 -1
- package/docs/functions/ObjectReference.IsEqual.html +1 -1
- package/docs/functions/ObjectReference.read.html +1 -1
- package/docs/functions/ObjectReference.write.html +1 -1
- package/docs/functions/ObjectSetProperty.Parse.html +1 -1
- package/docs/functions/ObjectSetProperty.Serialize.html +1 -1
- package/docs/functions/ObjectsListSpecialProperties.Parse.html +1 -1
- package/docs/functions/ObjectsListSpecialProperties.Serialize.html +1 -1
- package/docs/functions/PlayerSpecialProperties.Parse.html +1 -1
- package/docs/functions/PlayerSpecialProperties.Serialize.html +1 -1
- package/docs/functions/PowerLineSpecialProperties.Parse.html +1 -1
- package/docs/functions/PowerLineSpecialProperties.Serialize.html +1 -1
- package/docs/functions/PropertiesList.ParseList.html +1 -1
- package/docs/functions/PropertiesList.ParseSingleProperty.html +1 -1
- package/docs/functions/PropertiesList.SerializeList.html +1 -1
- package/docs/functions/PropertiesList.SerializeSingleProperty.html +1 -1
- package/docs/functions/SatisfactorySaveHeader.Parse.html +1 -1
- package/docs/functions/SatisfactorySaveHeader.Serialize.html +1 -1
- package/docs/functions/SaveBodyChunks.CompressDataIntoChunks.html +1 -1
- package/docs/functions/SaveBodyChunks.DecompressChunks.html +1 -1
- package/docs/functions/SetProperty.CalcOverhead.html +1 -1
- package/docs/functions/SetProperty.Parse.html +1 -1
- package/docs/functions/SetProperty.Serialize.html +1 -1
- package/docs/functions/SoftObjectArrayProperty.Parse.html +1 -1
- package/docs/functions/SoftObjectArrayProperty.Serialize.html +1 -1
- package/docs/functions/SoftObjectReference.read.html +1 -1
- package/docs/functions/SoftObjectReference.write.html +1 -1
- package/docs/functions/SpecialDroneActionProperties.Parse.html +1 -1
- package/docs/functions/SpecialDroneActionProperties.Serialize.html +1 -1
- package/docs/functions/SpecialProperties.ParseClassSpecificSpecialProperties.html +1 -1
- package/docs/functions/SpecialProperties.SerializeClassSpecificSpecialProperties.html +1 -1
- package/docs/functions/StrArrayProperty.Parse.html +1 -1
- package/docs/functions/StrArrayProperty.Serialize.html +1 -1
- package/docs/functions/StrProperty.CalcOverhead.html +1 -1
- package/docs/functions/StrProperty.Parse.html +1 -1
- package/docs/functions/StrProperty.ReadValue.html +1 -1
- package/docs/functions/StrProperty.Serialize.html +1 -1
- package/docs/functions/StrProperty.SerializeValue.html +1 -1
- package/docs/functions/StrSetProperty.Parse.html +1 -1
- package/docs/functions/StrSetProperty.Serialize.html +1 -1
- package/docs/functions/StructArrayProperty.Parse.html +1 -1
- package/docs/functions/StructArrayProperty.Serialize.html +1 -1
- package/docs/functions/StructProperty.CalcOverhead.html +1 -1
- package/docs/functions/StructProperty.Parse.html +1 -1
- package/docs/functions/StructProperty.ParseValue.html +1 -1
- package/docs/functions/StructProperty.Serialize.html +1 -1
- package/docs/functions/StructProperty.SerializeValue.html +1 -1
- package/docs/functions/StructSetProperty.Parse.html +1 -1
- package/docs/functions/StructSetProperty.Serialize.html +1 -1
- package/docs/functions/TextArrayProperty.Parse.html +1 -1
- package/docs/functions/TextArrayProperty.Serialize.html +1 -1
- package/docs/functions/TextProperty.CalcOverhead.html +1 -1
- package/docs/functions/TextProperty.Parse.html +1 -1
- package/docs/functions/TextProperty.ReadValue.html +1 -1
- package/docs/functions/TextProperty.Serialize.html +1 -1
- package/docs/functions/TextProperty.SerializeValue.html +1 -1
- package/docs/functions/Transform.Parse.html +1 -1
- package/docs/functions/Transform.ParseF.html +1 -1
- package/docs/functions/Transform.Serialize.html +1 -1
- package/docs/functions/Transform.SerializeF.html +1 -1
- package/docs/functions/Uint32Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint32Property.Parse.html +1 -1
- package/docs/functions/Uint32Property.ReadValue.html +1 -1
- package/docs/functions/Uint32Property.Serialize.html +1 -1
- package/docs/functions/Uint32Property.SerializeValue.html +1 -1
- package/docs/functions/Uint32SetProperty.Parse.html +1 -1
- package/docs/functions/Uint32SetProperty.Serialize.html +1 -1
- package/docs/functions/Uint64Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint64Property.Parse.html +1 -1
- package/docs/functions/Uint64Property.ReadValue.html +1 -1
- package/docs/functions/Uint64Property.Serialize.html +1 -1
- package/docs/functions/Uint64Property.SerializeValue.html +1 -1
- package/docs/functions/Uint8Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint8Property.Parse.html +1 -1
- package/docs/functions/Uint8Property.ReadValue.html +1 -1
- package/docs/functions/Uint8Property.Serialize.html +1 -1
- package/docs/functions/Uint8Property.SerializeValue.html +1 -1
- package/docs/functions/VehiclePhysicsData.Parse.html +1 -1
- package/docs/functions/VehiclePhysicsData.Serialize.html +1 -1
- package/docs/functions/VehicleSpecialProperties.Parse.html +1 -1
- package/docs/functions/VehicleSpecialProperties.Serialize.html +1 -1
- package/docs/functions/col4.ParseBGRA.html +1 -1
- package/docs/functions/col4.ParseRGBA.html +1 -1
- package/docs/functions/col4.SerializeBGRA.html +1 -1
- package/docs/functions/col4.SerializeRGBA.html +1 -1
- package/docs/functions/isArrayProperty.html +1 -1
- package/docs/functions/isBoolArrayProperty.html +1 -1
- package/docs/functions/isBoolProperty.html +1 -1
- package/docs/functions/isBuildableSubsystemSpecialProperties.html +1 -1
- package/docs/functions/isByteArrayProperty.html +1 -1
- package/docs/functions/isByteProperty.html +1 -1
- package/docs/functions/isCircuitSpecialProperties.html +1 -1
- package/docs/functions/isConveyorChainActorSpecialProperties.html +1 -1
- package/docs/functions/isConveyorSpecialProperties.html +1 -1
- package/docs/functions/isDoubleArrayProperty.html +1 -1
- package/docs/functions/isDoubleProperty.html +1 -1
- package/docs/functions/isEmptySpecialProperties.html +1 -1
- package/docs/functions/isEnumArrayProperty.html +1 -1
- package/docs/functions/isEnumProperty.html +1 -1
- package/docs/functions/isFloatArrayProperty.html +1 -1
- package/docs/functions/isFloatProperty.html +1 -1
- package/docs/functions/isInt32ArrayProperty.html +1 -1
- package/docs/functions/isInt32Property.html +1 -1
- package/docs/functions/isInt32SetProperty.html +1 -1
- package/docs/functions/isInt64ArrayProperty.html +1 -1
- package/docs/functions/isInt64Property.html +1 -1
- package/docs/functions/isInt8Property.html +1 -1
- package/docs/functions/isMapProperty.html +1 -1
- package/docs/functions/isObjectArrayProperty.html +1 -1
- package/docs/functions/isObjectProperty.html +1 -1
- package/docs/functions/isObjectSetProperty.html +1 -1
- package/docs/functions/isObjectsListSpecialProperties.html +1 -1
- package/docs/functions/isPlayerSpecialProperties.html +1 -1
- package/docs/functions/isPowerLineSpecialProperties.html +1 -1
- package/docs/functions/isSaveComponent.html +1 -1
- package/docs/functions/isSaveEntity.html +1 -1
- package/docs/functions/isSetProperty.html +1 -1
- package/docs/functions/isSoftObjectArrayProperty.html +1 -1
- package/docs/functions/isSpecialDroneActionProperties.html +1 -1
- package/docs/functions/isStrArrayProperty.html +1 -1
- package/docs/functions/isStrProperty.html +1 -1
- package/docs/functions/isStrSetProperty.html +1 -1
- package/docs/functions/isStructArrayProperty.html +1 -1
- package/docs/functions/isStructProperty.html +1 -1
- package/docs/functions/isStructSetProperty.html +1 -1
- package/docs/functions/isTextArrayProperty.html +1 -1
- package/docs/functions/isTextProperty.html +1 -1
- package/docs/functions/isUInt64Property.html +1 -1
- package/docs/functions/isUint32Property.html +1 -1
- package/docs/functions/isUint32SetProperty.html +1 -1
- package/docs/functions/isUint8Property.html +1 -1
- package/docs/functions/isVehicleSpecialProperties.html +1 -1
- package/docs/functions/vec2.Parse.html +1 -1
- package/docs/functions/vec2.ParseF.html +1 -1
- package/docs/functions/vec2.Serialize.html +1 -1
- package/docs/functions/vec2.SerializeF.html +1 -1
- package/docs/functions/vec3.Parse.html +1 -1
- package/docs/functions/vec3.ParseF.html +1 -1
- package/docs/functions/vec3.ParseInt.html +1 -1
- package/docs/functions/vec3.Serialize.html +1 -1
- package/docs/functions/vec3.SerializeF.html +1 -1
- package/docs/functions/vec3.SerializeInt.html +1 -1
- package/docs/functions/vec3.add.html +1 -1
- package/docs/functions/vec3.length.html +1 -1
- package/docs/functions/vec3.mult.html +1 -1
- package/docs/functions/vec3.norm.html +1 -1
- package/docs/functions/vec3.sub.html +1 -1
- package/docs/functions/vec4.Parse.html +1 -1
- package/docs/functions/vec4.ParseF.html +1 -1
- package/docs/functions/vec4.Serialize.html +1 -1
- package/docs/functions/vec4.SerializeF.html +1 -1
- package/docs/index.html +2 -1
- package/docs/interfaces/Blueprint.html +2 -2
- package/docs/interfaces/BlueprintConfig-1.html +2 -2
- package/docs/interfaces/SaveComponentHeader.html +2 -2
- package/docs/interfaces/SaveEntityHeader.html +2 -2
- package/docs/interfaces/SaveObjectHeader.html +2 -2
- package/docs/modules/AbstractBaseProperty.html +1 -1
- package/docs/modules/ArrayProperty.html +1 -1
- package/docs/modules/BlueprintConfig.html +1 -1
- package/docs/modules/BlueprintHeader.html +1 -1
- package/docs/modules/BoolArrayProperty.html +1 -1
- package/docs/modules/BoolProperty.html +1 -1
- package/docs/modules/BuildableSubsystemSpecialProperties.html +1 -1
- package/docs/modules/BuildableTypeInstance.html +1 -1
- package/docs/modules/ByteArrayProperty.html +1 -1
- package/docs/modules/ByteProperty.html +1 -1
- package/docs/modules/CircuitSpecialProperties.html +1 -1
- package/docs/modules/ConveyorChainActorSpecialProperties.html +1 -1
- package/docs/modules/ConveyorSpecialProperties.html +1 -1
- package/docs/modules/DoubleArrayProperty.html +1 -1
- package/docs/modules/DoubleProperty.html +1 -1
- package/docs/modules/DynamicStructPropertyValue.html +1 -1
- package/docs/modules/EmptySpecialProperties.html +1 -1
- package/docs/modules/EnumArrayProperty.html +1 -1
- package/docs/modules/EnumProperty.html +1 -1
- package/docs/modules/FGDynamicStruct.html +1 -1
- package/docs/modules/FICFrameRange.html +1 -1
- package/docs/modules/FloatArrayProperty.html +1 -1
- package/docs/modules/FloatProperty.html +1 -1
- package/docs/modules/GUID.html +1 -1
- package/docs/modules/GUIDInfo.html +1 -1
- package/docs/modules/Int32ArrayProperty.html +1 -1
- package/docs/modules/Int32Property.html +1 -1
- package/docs/modules/Int32SetProperty.html +1 -1
- package/docs/modules/Int64ArrayProperty.html +1 -1
- package/docs/modules/Int64Property.html +1 -1
- package/docs/modules/Int8Property.html +1 -1
- package/docs/modules/Level.html +1 -1
- package/docs/modules/LevelToDestroyedActorsMap.html +1 -1
- package/docs/modules/MD5Hash.html +1 -1
- package/docs/modules/MapProperty.html +1 -1
- package/docs/modules/ObjectArrayProperty.html +1 -1
- package/docs/modules/ObjectProperty.html +1 -1
- package/docs/modules/ObjectReference.html +1 -1
- package/docs/modules/ObjectSetProperty.html +1 -1
- package/docs/modules/ObjectsListSpecialProperties.html +1 -1
- package/docs/modules/PlayerSpecialProperties.html +1 -1
- package/docs/modules/PowerLineSpecialProperties.html +1 -1
- package/docs/modules/PropertiesList.html +1 -1
- package/docs/modules/SatisfactorySaveHeader.html +1 -1
- package/docs/modules/SaveBodyChunks.html +1 -1
- package/docs/modules/SetProperty.html +1 -1
- package/docs/modules/SoftObjectArrayProperty.html +1 -1
- package/docs/modules/SoftObjectReference.html +1 -1
- package/docs/modules/SpecialDroneActionProperties.html +1 -1
- package/docs/modules/SpecialProperties.html +1 -1
- package/docs/modules/StrArrayProperty.html +1 -1
- package/docs/modules/StrProperty.html +1 -1
- package/docs/modules/StrSetProperty.html +1 -1
- package/docs/modules/StructArrayProperty.html +1 -1
- package/docs/modules/StructProperty.html +1 -1
- package/docs/modules/StructSetProperty.html +1 -1
- package/docs/modules/TextArrayProperty.html +1 -1
- package/docs/modules/TextProperty.html +1 -1
- package/docs/modules/Transform.html +1 -1
- package/docs/modules/Uint32Property.html +1 -1
- package/docs/modules/Uint32SetProperty.html +1 -1
- package/docs/modules/Uint64Property.html +1 -1
- package/docs/modules/Uint8Property.html +1 -1
- package/docs/modules/VehiclePhysicsData.html +1 -1
- package/docs/modules/VehicleSpecialProperties.html +1 -1
- package/docs/modules/col4.html +1 -1
- package/docs/modules/vec2.html +1 -1
- package/docs/modules/vec3.html +1 -1
- package/docs/modules/vec4.html +1 -1
- package/docs/types/AbstractBaseProperty-1.html +1 -1
- package/docs/types/ArrayProperty.AvailableArrayPropertyTypes.html +1 -1
- package/docs/types/ArrayPropertyStructValueFields.html +1 -1
- package/docs/types/BasicMultipleStructPropertyValue.html +1 -1
- package/docs/types/BasicStructPropertyValue.html +1 -1
- package/docs/types/BlueprintHeader-1.html +1 -1
- package/docs/types/BoolArrayProperty-1.html +1 -1
- package/docs/types/BoolProperty-1.html +1 -1
- package/docs/types/BoxStructPropertyValue.html +1 -1
- package/docs/types/BuildableSubsystemSpecialProperties-1.html +1 -1
- package/docs/types/BuildableTypeInstance-1.html +1 -1
- package/docs/types/ByteArray4.html +1 -1
- package/docs/types/ByteArrayProperty-1.html +1 -1
- package/docs/types/ByteProperty-1.html +1 -1
- package/docs/types/BytePropertyValue.html +1 -1
- package/docs/types/ChunkCompressionInfo.html +1 -1
- package/docs/types/ChunkSummary.html +1 -1
- package/docs/types/CircuitSpecialProperties-1.html +1 -1
- package/docs/types/ClientIdentityInfo.html +1 -1
- package/docs/types/ConveyorChainActorSpecialProperties-1.html +1 -1
- package/docs/types/ConveyorChainSegmentSpecialProperties.html +1 -1
- package/docs/types/ConveyorItemSpecialProperties.html +1 -1
- package/docs/types/ConveyorSpecialProperties-1.html +1 -1
- package/docs/types/DoubleArrayProperty-1.html +1 -1
- package/docs/types/DoubleProperty-1.html +1 -1
- package/docs/types/DynamicStructPropertyValue-1.html +1 -1
- package/docs/types/EmptySpecialProperties-1.html +1 -1
- package/docs/types/EnumArrayProperty-1.html +1 -1
- package/docs/types/EnumProperty-1.html +1 -1
- package/docs/types/FGDynamicStruct-1.html +1 -1
- package/docs/types/FICFrameRange-1.html +1 -1
- package/docs/types/FICFrameRangeStructPropertyValue.html +1 -1
- package/docs/types/FloatArrayProperty-1.html +1 -1
- package/docs/types/FloatProperty-1.html +1 -1
- package/docs/types/GENERIC_MAP_KEY_TYPE.html +1 -1
- package/docs/types/GENERIC_MAP_VALUE_TYPE.html +1 -1
- package/docs/types/GENERIC_STRUCT_PROPERTY_VALUE.html +1 -1
- package/docs/types/GUID-1.html +1 -1
- package/docs/types/GUIDInfo-1.html +1 -1
- package/docs/types/Grids.html +1 -1
- package/docs/types/Int32ArrayProperty-1.html +1 -1
- package/docs/types/Int32Property-1.html +1 -1
- package/docs/types/Int32SetProperty-1.html +1 -1
- package/docs/types/Int64ArrayProperty-1.html +1 -1
- package/docs/types/Int64Property-1.html +1 -1
- package/docs/types/Int8Property-1.html +1 -1
- package/docs/types/InventoryItemStructPropertyValue.html +1 -1
- package/docs/types/Level-1.html +1 -1
- package/docs/types/LevelToDestroyedActorsMap-1.html +1 -1
- package/docs/types/Levels.html +1 -1
- package/docs/types/MAP_STRUCT_KEY_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/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.html +1 -1
- package/docs/types/SetProperty.AvailableSetPropertyTypes.html +1 -1
- package/docs/types/SoftObjectArrayProperty-1.html +1 -1
- package/docs/types/SoftObjectReference-1.html +1 -1
- package/docs/types/SpecialDroneAction.html +1 -1
- package/docs/types/SpecialDroneActionProperties-1.html +1 -1
- package/docs/types/SpecialProperties.AvailableSpecialPropertiesTypes.html +1 -1
- package/docs/types/StrArrayProperty-1.html +1 -1
- package/docs/types/StrProperty-1.html +1 -1
- package/docs/types/StrSetProperty-1.html +1 -1
- package/docs/types/StructArrayProperty-1.html +1 -1
- package/docs/types/StructProperty-1.html +1 -1
- package/docs/types/StructSetProperty-1.html +1 -1
- package/docs/types/TextArrayProperty-1.html +1 -1
- package/docs/types/TextProperty-1.html +1 -1
- package/docs/types/TextPropertyValue.html +1 -1
- package/docs/types/Transform-1.html +1 -1
- package/docs/types/Uint32Property-1.html +1 -1
- package/docs/types/Uint32SetProperty-1.html +1 -1
- package/docs/types/Uint64Property-1.html +1 -1
- package/docs/types/Uint8Property-1.html +1 -1
- package/docs/types/VehiclePhysicsData-1.html +1 -1
- package/docs/types/VehicleSpecialProperties-1.html +1 -1
- package/docs/types/col4-1.html +1 -1
- package/docs/types/vec2-1.html +1 -1
- package/docs/types/vec3-1.html +1 -1
- package/docs/types/vec4-1.html +1 -1
- package/docs/variables/DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE.html +1 -1
- package/docs/variables/EDIT.html +1 -1
- package/docs/variables/SaveBodyChunks.HEADER_V1.html +1 -1
- package/docs/variables/SaveBodyChunks.HEADER_V2.html +1 -1
- package/jsr.json +5 -5
- package/package.json +1 -2
|
@@ -34,26 +34,4 @@ class SaveWriter extends context_writer_1.ContextWriter {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.SaveWriter = SaveWriter;
|
|
37
|
-
SaveWriter.WriteSaveBodyHash = (writer, saveBodyValidation) => {
|
|
38
|
-
writer.writeInt32(0);
|
|
39
|
-
writer.writeInt32(saveBodyValidation.version);
|
|
40
|
-
writer.writeString('None');
|
|
41
|
-
writer.writeInt32(0);
|
|
42
|
-
writer.writeBytesArray(saveBodyValidation.hash1);
|
|
43
|
-
writer.writeInt32(1);
|
|
44
|
-
writer.writeString('None');
|
|
45
|
-
writer.writeBytesArray(saveBodyValidation.hash2);
|
|
46
|
-
};
|
|
47
|
-
SaveWriter.WriteGrids = (writer, grids) => {
|
|
48
|
-
for (const gridEntry of Object.entries(grids)) {
|
|
49
|
-
writer.writeString(gridEntry[0]);
|
|
50
|
-
writer.writeInt32(gridEntry[1].cellSize);
|
|
51
|
-
writer.writeUint32(gridEntry[1].gridHash);
|
|
52
|
-
writer.writeUint32(Object.values(gridEntry[1].children).length);
|
|
53
|
-
for (const child of Object.entries(gridEntry[1].children)) {
|
|
54
|
-
writer.writeString(child[0]);
|
|
55
|
-
writer.writeUint32(child[1]);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
37
|
//# sourceMappingURL=save-writer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-writer.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-writer.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAuD;AACvD,mCAAgC;AAEhC,yDAAwF;
|
|
1
|
+
{"version":3,"file":"save-writer.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-writer.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAuD;AACvD,mCAAgC;AAEhC,yDAAwF;AAGxF,MAAa,UAAW,SAAQ,8BAAa;IAE5C;QACC,KAAK,CAAC,0BAAS,CAAC,a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AAY,GAAG,UAAU,CAAC,gCAAgC,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,yBAAyB,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAEhK,OAAO,YAAY,CAAC;IACrB,CAAC;CACD;AAnDD,gCAmDC","sourcesContent":["import { Alignment } from \"../../byte/alignment.enum\";\nimport { ContextWriter } from '../../context/context-writer';\nimport { ParserError } from \"../../error/parser.error\";\nimport { Level } from './level';\nimport { SatisfactorySave } from \"./satisfactory-save\";\nimport { ChunkCompressionInfo, ChunkSummary, SaveBodyChunks } from \"./save-body-chunks\";\n\n\nexport class SaveWriter extends ContextWriter {\n\n\tconstructor() {\n\t\tsuper(Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic static WriteLevels(writer: ContextWriter, save: SatisfactorySave): void {\n\t\twriter.writeInt32(Object.keys(save.levels).length - 1);\n\t\tfor (const level of Object.values(save.levels)) {\n\t\t\tif (level.name !== save.header.mapName) {\n\t\t\t\twriter.writeString(level.name);\n\t\t\t}\n\t\t\tLevel.SerializeLevel(writer, level);\n\t\t}\n\t}\n\n\tpublic static GenerateCompressedChunksFromData(\n\t\tbufferArray: ArrayBuffer,\n\t\tcompressionInfo: ChunkCompressionInfo,\n\t\tblueprintOrSave: 'blueprint' | 'save',\n\t\tonBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\tonChunk: (chunk: Uint8Array) => void,\n\t\talignment: Alignment = Alignment.LITTLE_ENDIAN\n\t): ChunkSummary[] {\n\n\t\treturn SaveBodyChunks.CompressDataIntoChunks(bufferArray, compressionInfo, blueprintOrSave, onBinaryBeforeCompressing, onChunk, alignment);\n\t}\n\n\tpublic generateChunks(\n\t\tcompressionInfo: ChunkCompressionInfo,\n\t\tposAfterHeader: number,\n\n\t\tonBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\tonHeader: (header: Uint8Array) => void,\n\t\tonChunk: (chunk: Uint8Array) => void\n\t): ChunkSummary[] {\n\n\t\tif (posAfterHeader <= 0) {\n\t\t\tthrow new ParserError('ParserError', 'Seems like this buffer has no header. Please write the header first before you can generate chunks.');\n\t\t}\n\n\t\t// send plain header first.\n\t\tconst header = new Uint8Array(this.bufferArray.slice(0, posAfterHeader));\n\t\tonHeader(header);\n\n\t\t// create save body\n\t\tthis.bufferArray = this.bufferArray.slice(posAfterHeader);\n\t\tconst chunkSummary = SaveWriter.GenerateCompressedChunksFromData(this.bufferArray, compressionInfo, 'save', onBinaryBeforeCompressing, onChunk, this.alignment);\n\n\t\treturn chunkSummary;\n\t}\n}\n"]}
|
|
@@ -136,7 +136,7 @@ var PropertiesList;
|
|
|
136
136
|
overhead = SetProperty_1.SetProperty.CalcOverhead(currentProperty);
|
|
137
137
|
break;
|
|
138
138
|
default:
|
|
139
|
-
throw new Error(`Unimplemented type ${propertyType}`);
|
|
139
|
+
throw new Error(`Unimplemented type ${propertyType}, at byte position ${reader.getBufferPosition()}`);
|
|
140
140
|
}
|
|
141
141
|
currentProperty.name = propertyName;
|
|
142
142
|
const readBytes = reader.getBufferPosition() - before - overhead;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertiesList.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/property/PropertiesList.ts"],"names":[],"mappings":";;;AAEA,8DAA0D;AAE1D,yEAAsE;AACtE,yDAAsD;AACtD,yDAAsD;AACtD,6DAA0D;AAC1D,yDAAsD;AACtD,2DAAwD;AACxD,2DAAwD;AACxD,2DAAwD;AACxD,yDAAsD;AACtD,uDAAoD;AACpD,6DAA0D;AAC1D,mEAAgE;AAChE,qEAAkE;AAClE,uDAAoD;AACpD,6DAA0D;AAC1D,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,2DAAwD;AAGxD,IAAiB,cAAc,CA4R9B;AA5RD,WAAiB,cAAc;IAEjB,wBAAS,GAAG,CAAC,MAAqB,EAAiB,EAAE;QAEjE,MAAM,UAAU,GAAk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QAAQ,GAAG,+BAAc,CAAC,YAAY,CAAC,QAA0B,CAAC,CAAC;gBACnE,+BAAc,CAAC,SAAS,CAAC,MAAM,EAAE,QAA0B,CAAC,CAAC;gBAC7D,MAAM;YAEP,KAAK,eAAe;gBACnB,QAAQ,GAAG,6BAAa,CAAC,YAAY,CAAC,QAAqD,CAAC,CAAC;gBAC7F,6BAAa,CAAC,SAAS,CAAC,MAAM,EAAE,QAAqD,CAAC,CAAC;gBACvF,MAAM;YAEP,KAAK,aAAa;gBACjB,QAAQ,GAAG,yBAAW,CAAC,YAAY,CAAC,QAAuB,CAAC,CAAC;gBAC7D,yBAAW,CAAC,SAAS,CAAC,MAAM,EAAE,QAAuB,CAAC,CAAC;gBACvD,MAAM;YAEP,KAAK,cAAc;gBAClB,QAAQ,GAAG,2BAAY,CAAC,YAAY,CAAC,QAAwB,CAAC,CAAC;gBAC/D,2BAAY,CAAC,SAAS,CAAC,MAAM,EAAE,QAAwB,CAAC,CAAC;gBACzD,MAAM;YAEP,KAAK,aAAa;gBACjB,QAAQ,GAAG,yBAAW,CAAC,YAAY,CAAC,QAAiD,CAAC,CAAC;gBACvF,yBAAW,CAAC,SAAS,CAAC,MAAM,EAAE,QAAiD,CAAC,CAAC;gBACjF,MAAM;YAEP;gBACC,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,CAAC;QAGD,MAAM,CAAC,2BAA2B,CAAC,YAAY,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;IACpE,CAAC,CAAA;AACF,CAAC,EA5RgB,cAAc,8BAAd,cAAc,QA4R9B","sourcesContent":["import { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\nimport { ParserError } from '../../../error/parser.error';\nimport { AbstractBaseProperty, PropertiesMap } from './generic/AbstractBaseProperty';\nimport { ArrayProperty } from './generic/ArrayProperty/ArrayProperty';\nimport { BoolProperty } from './generic/BoolProperty';\nimport { ByteProperty } from './generic/ByteProperty';\nimport { DoubleProperty } from './generic/DoubleProperty';\nimport { EnumProperty } from './generic/EnumProperty';\nimport { FloatProperty } from './generic/FloatProperty';\nimport { Int32Property } from './generic/Int32Property';\nimport { Int64Property } from './generic/Int64Property';\nimport { Int8Property } from './generic/Int8Property';\nimport { MapProperty } from './generic/MapProperty';\nimport { ObjectProperty } from './generic/ObjectProperty';\nimport { SetProperty } from './generic/SetProperty/SetProperty';\nimport { SoftObjectProperty } from './generic/SoftObjectProperty';\nimport { StrProperty } from './generic/StrProperty';\nimport { StructProperty } from './generic/StructProperty';\nimport { TextProperty } from './generic/TextProperty';\nimport { Uint32Property } from './generic/Uint32Property';\nimport { Uint64Property } from './generic/Uint64Property';\nimport { Uint8Property } from './generic/Uint8Property';\n\n\nexport namespace PropertiesList {\n\n\texport const ParseList = (reader: ContextReader): PropertiesMap => {\n\n\t\tconst properties: PropertiesMap = {};\n\t\tlet propertyName: string = reader.readString();\n\t\twhile (propertyName !== 'None') {\n\t\t\tconst parsedProperty = PropertiesList.ParseSingleProperty(reader, propertyName);\n\n\t\t\t// if it already exists, make it an array.\n\t\t\tif (properties[propertyName]) {\n\t\t\t\tif (!Array.isArray(properties[propertyName])) {\n\t\t\t\t\tproperties[propertyName] = [properties[propertyName] as AbstractBaseProperty];\n\t\t\t\t}\n\t\t\t\t(properties[propertyName] as AbstractBaseProperty[]).push(parsedProperty);\n\t\t\t} else {\n\t\t\t\tproperties[propertyName] = parsedProperty;\n\t\t\t}\n\n\t\t\tpropertyName = reader.readString();\n\t\t}\n\n\t\treturn properties;\n\t}\n\n\texport const SerializeList = (writer: ContextWriter, properties: PropertiesMap): void => {\n\t\tfor (const property of Object.values(properties).flatMap(val => Array.isArray(val) ? val : [val])) {\n\t\t\twriter.writeString(property.name);\n\t\t\tPropertiesList.SerializeSingleProperty(writer, property);\n\t\t}\n\t\twriter.writeString('None');\n\t}\n\n\texport const ParseSingleProperty = (reader: ContextReader, propertyName: string): AbstractBaseProperty => {\n\t\tlet currentProperty: any = {};\n\n\t\t//TODO assign type and index after parsing.\n\t\tconst propertyType = reader.readString();\n\t\tconst binarySize = reader.readInt32();\n\n\t\tconst index = reader.readInt32();\n\t\tconst before = reader.getBufferPosition();\n\n\t\tlet overhead = 0;\n\t\tswitch (propertyType) {\n\t\t\tcase 'BoolProperty':\n\t\t\t\tcurrentProperty = BoolProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = BoolProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\tcurrentProperty = ByteProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = ByteProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int8Property':\n\t\t\t\tcurrentProperty = Int8Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int8Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'UInt8Property':\n\t\t\t\tcurrentProperty = Uint8Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Uint8Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IntProperty':\n\t\t\tcase 'Int32Property':\n\t\t\t\tcurrentProperty = Int32Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int32Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt32Property':\n\t\t\t\tcurrentProperty = Uint32Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Uint32Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int64Property':\n\t\t\t\tcurrentProperty = Int64Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int64Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt64Property':\n\t\t\t\tcurrentProperty = Uint64Property.Parse(reader, propertyType, index);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SingleProperty':\n\t\t\tcase 'FloatProperty':\n\t\t\t\tcurrentProperty = FloatProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = FloatProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DoubleProperty':\n\t\t\t\tcurrentProperty = DoubleProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = DoubleProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StrProperty':\n\t\t\tcase 'NameProperty':\n\t\t\t\tcurrentProperty = StrProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = StrProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ObjectProperty':\n\t\t\tcase 'InterfaceProperty':\n\t\t\t\tcurrentProperty = ObjectProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = ObjectProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SoftObjectProperty':\n\t\t\t\tcurrentProperty = SoftObjectProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = SoftObjectProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'EnumProperty':\n\t\t\t\tcurrentProperty = EnumProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = EnumProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StructProperty':\n\t\t\t\tcurrentProperty = StructProperty.Parse(reader, propertyType, index, binarySize);\n\t\t\t\toverhead = StructProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrayProperty':\n\t\t\t\tcurrentProperty = ArrayProperty.Parse(reader, propertyType, index, binarySize);\n\t\t\t\toverhead = ArrayProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'MapProperty':\n\t\t\t\tcurrentProperty = MapProperty.Parse(reader, propertyName, binarySize);\n\t\t\t\toverhead = MapProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TextProperty':\n\t\t\t\tcurrentProperty = TextProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = TextProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetProperty':\n\t\t\t\tcurrentProperty = SetProperty.Parse(reader, propertyType, index, propertyName);\n\t\t\t\toverhead = SetProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unimplemented type ${propertyType}`);\n\t\t}\n\n\t\tcurrentProperty.name = propertyName;\n\n\t\tconst readBytes = reader.getBufferPosition() - before - overhead;\n\t\tif (readBytes !== binarySize) {\n\t\t\tconsole.warn(`possibly corrupt. Read ${readBytes} for ${propertyType} ${propertyName}, but ${binarySize} were indicated.`);\n\t\t\tthrow new ParserError('ParserError', `possibly corrupt. Read ${readBytes} bytes for ${propertyType} ${propertyName}, but ${binarySize} bytes were indicated.`);\n\t\t}\n\n\t\treturn currentProperty;\n\t}\n\n\texport const SerializeSingleProperty = (writer: ContextWriter, property: AbstractBaseProperty): void => {\n\n\t\twriter.writeString(property.ueType);\n\n\t\t// binary length indicator\n\t\tconst lenIndicator = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\n\t\t// write index if it is not 0. Since it normally is.\n\t\twriter.writeInt32(property.index ?? 0);\n\n\t\tconst start = writer.getBufferPosition();\n\t\tlet overhead = 0;\n\t\tswitch (property.ueType) {\n\t\t\tcase 'BoolProperty':\n\t\t\t\toverhead = BoolProperty.CalcOverhead(property as BoolProperty);\n\t\t\t\tBoolProperty.Serialize(writer, property as BoolProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\toverhead = ByteProperty.CalcOverhead(property as ByteProperty);\n\t\t\t\tByteProperty.Serialize(writer, property as ByteProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int8Property':\n\t\t\t\toverhead = Int8Property.CalcOverhead(property as Int8Property);\n\t\t\t\tInt8Property.Serialize(writer, property as Int8Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt8Property':\n\t\t\t\toverhead = Uint8Property.CalcOverhead(property as Uint8Property);\n\t\t\t\tUint8Property.Serialize(writer, property as Uint8Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IntProperty':\n\t\t\tcase 'Int32Property':\n\t\t\t\toverhead = Int32Property.CalcOverhead(property as Int32Property);\n\t\t\t\tInt32Property.Serialize(writer, property as Int32Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt32Property':\n\t\t\t\toverhead = Uint32Property.CalcOverhead(property as Uint32Property);\n\t\t\t\tUint32Property.Serialize(writer, property as Uint32Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int64Property':\n\t\t\t\toverhead = Int64Property.CalcOverhead(property as Int64Property);\n\t\t\t\tInt64Property.Serialize(writer, property as Int64Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt64PRoperty':\n\t\t\t\toverhead = Uint64Property.CalcOverhead(property as Uint64Property);\n\t\t\t\tUint64Property.Serialize(writer, property as Uint64Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SingleProperty':\n\t\t\tcase 'FloatProperty':\n\t\t\t\toverhead = FloatProperty.CalcOverhead(property as FloatProperty);\n\t\t\t\tFloatProperty.Serialize(writer, property as FloatProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DoubleProperty':\n\t\t\t\toverhead = DoubleProperty.CalcOverhead(property as DoubleProperty);\n\t\t\t\tDoubleProperty.Serialize(writer, property as DoubleProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StrProperty':\n\t\t\tcase 'NameProperty':\n\t\t\t\toverhead = StrProperty.CalcOverhead(property as StrProperty);\n\t\t\t\tStrProperty.Serialize(writer, property as StrProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ObjectProperty':\n\t\t\tcase 'InterfaceProperty':\n\t\t\t\toverhead = ObjectProperty.CalcOverhead(property as ObjectProperty);\n\t\t\t\tObjectProperty.Serialize(writer, property as ObjectProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SoftObjectProperty':\n\t\t\t\toverhead = SoftObjectProperty.CalcOverhead(property as SoftObjectProperty);\n\t\t\t\tSoftObjectProperty.Serialize(writer, property as SoftObjectProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'EnumProperty':\n\t\t\t\toverhead = EnumProperty.CalcOverhead(property as EnumProperty);\n\t\t\t\tEnumProperty.Serialize(writer, property as EnumProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\toverhead = ByteProperty.CalcOverhead(property as ByteProperty);\n\t\t\t\tByteProperty.Serialize(writer, property as ByteProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StructProperty':\n\t\t\t\toverhead = StructProperty.CalcOverhead(property as StructProperty);\n\t\t\t\tStructProperty.Serialize(writer, property as StructProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrayProperty':\n\t\t\t\toverhead = ArrayProperty.CalcOverhead(property as ArrayProperty.AvailableArrayPropertyTypes);\n\t\t\t\tArrayProperty.Serialize(writer, property as ArrayProperty.AvailableArrayPropertyTypes);\n\t\t\t\tbreak;\n\n\t\t\tcase 'MapProperty':\n\t\t\t\toverhead = MapProperty.CalcOverhead(property as MapProperty);\n\t\t\t\tMapProperty.Serialize(writer, property as MapProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TextProperty':\n\t\t\t\toverhead = TextProperty.CalcOverhead(property as TextProperty);\n\t\t\t\tTextProperty.Serialize(writer, property as TextProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetProperty':\n\t\t\t\toverhead = SetProperty.CalcOverhead(property as SetProperty.AvailableSetPropertyTypes);\n\t\t\t\tSetProperty.Serialize(writer, property as SetProperty.AvailableSetPropertyTypes);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unimplemented type ${property.type}`);\n\t\t}\n\n\t\t// replace len indicator.\n\t\twriter.writeBinarySizeFromPosition(lenIndicator, start + overhead);\n\t}\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"PropertiesList.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/property/PropertiesList.ts"],"names":[],"mappings":";;;AAEA,8DAA0D;AAE1D,yEAAsE;AACtE,yDAAsD;AACtD,yDAAsD;AACtD,6DAA0D;AAC1D,yDAAsD;AACtD,2DAAwD;AACxD,2DAAwD;AACxD,2DAAwD;AACxD,yDAAsD;AACtD,uDAAoD;AACpD,6DAA0D;AAC1D,mEAAgE;AAChE,qEAAkE;AAClE,uDAAoD;AACpD,6DAA0D;AAC1D,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,2DAAwD;AAGxD,IAAiB,cAAc,CA4R9B;AA5RD,WAAiB,cAAc;IAEjB,wBAAS,GAAG,CAAC,MAAqB,EAAiB,EAAE;QAEjE,MAAM,UAAU,GAAkB,EAAE,CAAC;QACrC,IAAI,YAAY,GAAW,MAAM,CAAC,UAAU,EAAE,CAAC;QAC/C,OAAO,YAAY,KAAK,MAAM,EAAE,CAAC;YAChC,MAAM,cAAc,GAAG,cAAc,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAGhF,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;oBAC9C,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAAyB,CAAC,CAAC;gBAC/E,CAAC;gBACA,UAAU,CAAC,YAAY,CAA4B,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAC3E,CAAC;iBAAM,CAAC;gBACP,UAAU,CAAC,YAAY,CAAC,GAAG,cAAc,CAAC;YAC3C,CAAC;YAED,YAAY,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACp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AAC,CAAC;gBACzD,MAAM;YAEP,KAAK,aAAa;gBACjB,QAAQ,GAAG,yBAAW,CAAC,YAAY,CAAC,QAAiD,CAAC,CAAC;gBACvF,yBAAW,CAAC,SAAS,CAAC,MAAM,EAAE,QAAiD,CAAC,CAAC;gBACjF,MAAM;YAEP;gBACC,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,CAAC;QAGD,MAAM,CAAC,2BAA2B,CAAC,YAAY,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;IACpE,CAAC,CAAA;AACF,CAAC,EA5RgB,cAAc,8BAAd,cAAc,QA4R9B","sourcesContent":["import { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\nimport { ParserError } from '../../../error/parser.error';\nimport { AbstractBaseProperty, PropertiesMap } from './generic/AbstractBaseProperty';\nimport { ArrayProperty } from './generic/ArrayProperty/ArrayProperty';\nimport { BoolProperty } from './generic/BoolProperty';\nimport { ByteProperty } from './generic/ByteProperty';\nimport { DoubleProperty } from './generic/DoubleProperty';\nimport { EnumProperty } from './generic/EnumProperty';\nimport { FloatProperty } from './generic/FloatProperty';\nimport { Int32Property } from './generic/Int32Property';\nimport { Int64Property } from './generic/Int64Property';\nimport { Int8Property } from './generic/Int8Property';\nimport { MapProperty } from './generic/MapProperty';\nimport { ObjectProperty } from './generic/ObjectProperty';\nimport { SetProperty } from './generic/SetProperty/SetProperty';\nimport { SoftObjectProperty } from './generic/SoftObjectProperty';\nimport { StrProperty } from './generic/StrProperty';\nimport { StructProperty } from './generic/StructProperty';\nimport { TextProperty } from './generic/TextProperty';\nimport { Uint32Property } from './generic/Uint32Property';\nimport { Uint64Property } from './generic/Uint64Property';\nimport { Uint8Property } from './generic/Uint8Property';\n\n\nexport namespace PropertiesList {\n\n\texport const ParseList = (reader: ContextReader): PropertiesMap => {\n\n\t\tconst properties: PropertiesMap = {};\n\t\tlet propertyName: string = reader.readString();\n\t\twhile (propertyName !== 'None') {\n\t\t\tconst parsedProperty = PropertiesList.ParseSingleProperty(reader, propertyName);\n\n\t\t\t// if it already exists, make it an array.\n\t\t\tif (properties[propertyName]) {\n\t\t\t\tif (!Array.isArray(properties[propertyName])) {\n\t\t\t\t\tproperties[propertyName] = [properties[propertyName] as AbstractBaseProperty];\n\t\t\t\t}\n\t\t\t\t(properties[propertyName] as AbstractBaseProperty[]).push(parsedProperty);\n\t\t\t} else {\n\t\t\t\tproperties[propertyName] = parsedProperty;\n\t\t\t}\n\n\t\t\tpropertyName = reader.readString();\n\t\t}\n\n\t\treturn properties;\n\t}\n\n\texport const SerializeList = (writer: ContextWriter, properties: PropertiesMap): void => {\n\t\tfor (const property of Object.values(properties).flatMap(val => Array.isArray(val) ? val : [val])) {\n\t\t\twriter.writeString(property.name);\n\t\t\tPropertiesList.SerializeSingleProperty(writer, property);\n\t\t}\n\t\twriter.writeString('None');\n\t}\n\n\texport const ParseSingleProperty = (reader: ContextReader, propertyName: string): AbstractBaseProperty => {\n\t\tlet currentProperty: any = {};\n\n\t\t//TODO assign type and index after parsing.\n\t\tconst propertyType = reader.readString();\n\t\tconst binarySize = reader.readInt32();\n\n\t\tconst index = reader.readInt32();\n\t\tconst before = reader.getBufferPosition();\n\n\t\tlet overhead = 0;\n\t\tswitch (propertyType) {\n\t\t\tcase 'BoolProperty':\n\t\t\t\tcurrentProperty = BoolProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = BoolProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\tcurrentProperty = ByteProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = ByteProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int8Property':\n\t\t\t\tcurrentProperty = Int8Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int8Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'UInt8Property':\n\t\t\t\tcurrentProperty = Uint8Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Uint8Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IntProperty':\n\t\t\tcase 'Int32Property':\n\t\t\t\tcurrentProperty = Int32Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int32Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt32Property':\n\t\t\t\tcurrentProperty = Uint32Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Uint32Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int64Property':\n\t\t\t\tcurrentProperty = Int64Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int64Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt64Property':\n\t\t\t\tcurrentProperty = Uint64Property.Parse(reader, propertyType, index);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SingleProperty':\n\t\t\tcase 'FloatProperty':\n\t\t\t\tcurrentProperty = FloatProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = FloatProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DoubleProperty':\n\t\t\t\tcurrentProperty = DoubleProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = DoubleProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StrProperty':\n\t\t\tcase 'NameProperty':\n\t\t\t\tcurrentProperty = StrProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = StrProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ObjectProperty':\n\t\t\tcase 'InterfaceProperty':\n\t\t\t\tcurrentProperty = ObjectProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = ObjectProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SoftObjectProperty':\n\t\t\t\tcurrentProperty = SoftObjectProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = SoftObjectProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'EnumProperty':\n\t\t\t\tcurrentProperty = EnumProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = EnumProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StructProperty':\n\t\t\t\tcurrentProperty = StructProperty.Parse(reader, propertyType, index, binarySize);\n\t\t\t\toverhead = StructProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrayProperty':\n\t\t\t\tcurrentProperty = ArrayProperty.Parse(reader, propertyType, index, binarySize);\n\t\t\t\toverhead = ArrayProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'MapProperty':\n\t\t\t\tcurrentProperty = MapProperty.Parse(reader, propertyName, binarySize);\n\t\t\t\toverhead = MapProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TextProperty':\n\t\t\t\tcurrentProperty = TextProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = TextProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetProperty':\n\t\t\t\tcurrentProperty = SetProperty.Parse(reader, propertyType, index, propertyName);\n\t\t\t\toverhead = SetProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unimplemented type ${propertyType}, at byte position ${reader.getBufferPosition()}`);\n\t\t}\n\n\t\tcurrentProperty.name = propertyName;\n\n\t\tconst readBytes = reader.getBufferPosition() - before - overhead;\n\t\tif (readBytes !== binarySize) {\n\t\t\tconsole.warn(`possibly corrupt. Read ${readBytes} for ${propertyType} ${propertyName}, but ${binarySize} were indicated.`);\n\t\t\tthrow new ParserError('ParserError', `possibly corrupt. Read ${readBytes} bytes for ${propertyType} ${propertyName}, but ${binarySize} bytes were indicated.`);\n\t\t}\n\n\t\treturn currentProperty;\n\t}\n\n\texport const SerializeSingleProperty = (writer: ContextWriter, property: AbstractBaseProperty): void => {\n\n\t\twriter.writeString(property.ueType);\n\n\t\t// binary length indicator\n\t\tconst lenIndicator = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\n\t\t// write index if it is not 0. Since it normally is.\n\t\twriter.writeInt32(property.index ?? 0);\n\n\t\tconst start = writer.getBufferPosition();\n\t\tlet overhead = 0;\n\t\tswitch (property.ueType) {\n\t\t\tcase 'BoolProperty':\n\t\t\t\toverhead = BoolProperty.CalcOverhead(property as BoolProperty);\n\t\t\t\tBoolProperty.Serialize(writer, property as BoolProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\toverhead = ByteProperty.CalcOverhead(property as ByteProperty);\n\t\t\t\tByteProperty.Serialize(writer, property as ByteProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int8Property':\n\t\t\t\toverhead = Int8Property.CalcOverhead(property as Int8Property);\n\t\t\t\tInt8Property.Serialize(writer, property as Int8Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt8Property':\n\t\t\t\toverhead = Uint8Property.CalcOverhead(property as Uint8Property);\n\t\t\t\tUint8Property.Serialize(writer, property as Uint8Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IntProperty':\n\t\t\tcase 'Int32Property':\n\t\t\t\toverhead = Int32Property.CalcOverhead(property as Int32Property);\n\t\t\t\tInt32Property.Serialize(writer, property as Int32Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt32Property':\n\t\t\t\toverhead = Uint32Property.CalcOverhead(property as Uint32Property);\n\t\t\t\tUint32Property.Serialize(writer, property as Uint32Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int64Property':\n\t\t\t\toverhead = Int64Property.CalcOverhead(property as Int64Property);\n\t\t\t\tInt64Property.Serialize(writer, property as Int64Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt64PRoperty':\n\t\t\t\toverhead = Uint64Property.CalcOverhead(property as Uint64Property);\n\t\t\t\tUint64Property.Serialize(writer, property as Uint64Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SingleProperty':\n\t\t\tcase 'FloatProperty':\n\t\t\t\toverhead = FloatProperty.CalcOverhead(property as FloatProperty);\n\t\t\t\tFloatProperty.Serialize(writer, property as FloatProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DoubleProperty':\n\t\t\t\toverhead = DoubleProperty.CalcOverhead(property as DoubleProperty);\n\t\t\t\tDoubleProperty.Serialize(writer, property as DoubleProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StrProperty':\n\t\t\tcase 'NameProperty':\n\t\t\t\toverhead = StrProperty.CalcOverhead(property as StrProperty);\n\t\t\t\tStrProperty.Serialize(writer, property as StrProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ObjectProperty':\n\t\t\tcase 'InterfaceProperty':\n\t\t\t\toverhead = ObjectProperty.CalcOverhead(property as ObjectProperty);\n\t\t\t\tObjectProperty.Serialize(writer, property as ObjectProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SoftObjectProperty':\n\t\t\t\toverhead = SoftObjectProperty.CalcOverhead(property as SoftObjectProperty);\n\t\t\t\tSoftObjectProperty.Serialize(writer, property as SoftObjectProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'EnumProperty':\n\t\t\t\toverhead = EnumProperty.CalcOverhead(property as EnumProperty);\n\t\t\t\tEnumProperty.Serialize(writer, property as EnumProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\toverhead = ByteProperty.CalcOverhead(property as ByteProperty);\n\t\t\t\tByteProperty.Serialize(writer, property as ByteProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StructProperty':\n\t\t\t\toverhead = StructProperty.CalcOverhead(property as StructProperty);\n\t\t\t\tStructProperty.Serialize(writer, property as StructProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrayProperty':\n\t\t\t\toverhead = ArrayProperty.CalcOverhead(property as ArrayProperty.AvailableArrayPropertyTypes);\n\t\t\t\tArrayProperty.Serialize(writer, property as ArrayProperty.AvailableArrayPropertyTypes);\n\t\t\t\tbreak;\n\n\t\t\tcase 'MapProperty':\n\t\t\t\toverhead = MapProperty.CalcOverhead(property as MapProperty);\n\t\t\t\tMapProperty.Serialize(writer, property as MapProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TextProperty':\n\t\t\t\toverhead = TextProperty.CalcOverhead(property as TextProperty);\n\t\t\t\tTextProperty.Serialize(writer, property as TextProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetProperty':\n\t\t\t\toverhead = SetProperty.CalcOverhead(property as SetProperty.AvailableSetPropertyTypes);\n\t\t\t\tSetProperty.Serialize(writer, property as SetProperty.AvailableSetPropertyTypes);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unimplemented type ${property.type}`);\n\t\t}\n\n\t\t// replace len indicator.\n\t\twriter.writeBinarySizeFromPosition(lenIndicator, start + overhead);\n\t}\n}\n\n"]}
|
|
@@ -3,9 +3,9 @@ import { ContextWriter } from '../../../../context/context-writer';
|
|
|
3
3
|
import { ObjectReference } from '../../structs/ObjectReference';
|
|
4
4
|
import { AbstractBaseProperty } from './AbstractBaseProperty';
|
|
5
5
|
import { GENERIC_STRUCT_PROPERTY_VALUE } from './StructProperty';
|
|
6
|
-
export type
|
|
7
|
-
export type GENERIC_MAP_KEY_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE |
|
|
8
|
-
export type GENERIC_MAP_VALUE_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE;
|
|
6
|
+
export type MAP_STRUCT_PROXY = [number, number, number, number, number, number, number, number, number, number, number, number];
|
|
7
|
+
export type GENERIC_MAP_KEY_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE | MAP_STRUCT_PROXY;
|
|
8
|
+
export type GENERIC_MAP_VALUE_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE | MAP_STRUCT_PROXY;
|
|
9
9
|
export declare const isMapProperty: (property: any) => property is MapProperty;
|
|
10
10
|
export type MapProperty = AbstractBaseProperty & {
|
|
11
11
|
type: 'MapProperty';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapProperty.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/satisfactory/types/property/generic/MapProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAGjE,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"MapProperty.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/satisfactory/types/property/generic/MapProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAGjE,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAChI,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,eAAe,GAAG,OAAO,GAAG,6BAA6B,GAAG,gBAAgB,CAAC;AACzH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,eAAe,GAAG,OAAO,GAAG,6BAA6B,GAAG,gBAAgB,CAAC;AAE3H,eAAO,MAAM,aAAa,aAAc,GAAG,KAAG,QAAQ,IAAI,WAA0E,CAAC;AAErI,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG;IAC7C,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,CAAC,GAAG,EAAE,oBAAoB,EAAE,KAAK,EAAE,sBAAsB,CAAC,EAAE,CAAC;CACxE,CAAC;AAGF,yBAAiB,WAAW,CAAC;IAElB,MAAM,KAAK,WAAY,aAAa,gBAAgB,MAAM,QAAQ,MAAM,WAAU,MAAM,UAAyB,MAAM,KAAO,WAoGpI,CAAA;IAEM,MAAM,YAAY,aAAc,WAAW,KAAG,MAEpD,CAAA;IAEM,MAAM,SAAS,WAAY,aAAa,YAAY,WAAW,KAAG,IA+ExE,CAAA;CACJ"}
|
|
@@ -67,7 +67,12 @@ var MapProperty;
|
|
|
67
67
|
}
|
|
68
68
|
switch (property.valueType) {
|
|
69
69
|
case 'StructProperty':
|
|
70
|
-
|
|
70
|
+
if (propertyName === 'mIndexMapping' && reader.context.mods.MLBAlternates !== undefined) {
|
|
71
|
+
value = Array.from(reader.readBytes(12));
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
value = DynamicStructPropertyValue_1.DynamicStructPropertyValue.read(reader, property.valueType);
|
|
75
|
+
}
|
|
71
76
|
break;
|
|
72
77
|
case 'ObjectProperty':
|
|
73
78
|
value = ObjectProperty_1.ObjectProperty.ReadValue(reader);
|
|
@@ -140,7 +145,12 @@ var MapProperty;
|
|
|
140
145
|
}
|
|
141
146
|
switch (property.valueType) {
|
|
142
147
|
case 'StructProperty':
|
|
143
|
-
|
|
148
|
+
if (property.name === 'mIndexMapping' && writer.context.mods.MLBAlternates !== undefined) {
|
|
149
|
+
writer.writeBytesArray(entry[1]);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
DynamicStructPropertyValue_1.DynamicStructPropertyValue.write(writer, entry[1]);
|
|
153
|
+
}
|
|
144
154
|
break;
|
|
145
155
|
case 'ObjectProperty':
|
|
146
156
|
ObjectProperty_1.ObjectProperty.SerializeValue(writer, entry[1]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapProperty.js","sourceRoot":"","sources":["../../../../../../src/parser/satisfactory/types/property/generic/MapProperty.ts"],"names":[],"mappings":";;;AAEA,yFAAsF;AAEtF,iEAA8D;AAC9D,iDAA8C;AAC9C,iDAA8C;AAC9C,mDAAgD;AAChD,mDAAgD;AAChD,qDAAkD;AAClD,+CAA4C;AAQrC,MAAM,aAAa,GAAG,CAAC,QAAa,EAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,KAAK,aAAa,CAAC;AAAxH,QAAA,aAAa,iBAA2G;AAcrI,IAAiB,WAAW,CAkL3B;AAlLD,WAAiB,WAAW;IAEX,iBAAK,GAAG,CAAC,MAAqB,EAAE,YAAoB,EAAE,IAAY,EAAE,SAAiB,aAAa,EAAE,QAAgB,CAAC,EAAe,EAAE;QAC/I,MAAM,KAAK,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAgB;YAC1B,GAAG,2CAAoB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;YAC3D,IA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AAK,CAAC,CAAC,CAAW,CAAC,CAAC;oBACxD,MAAM;gBACV,KAAK,aAAa,CAAC;gBACnB,KAAK,eAAe;oBAChB,6BAAa,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAW,CAAC,CAAC;oBACzD,MAAM;gBACV,KAAK,eAAe;oBAChB,6BAAa,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAW,CAAC,CAAC;oBACzD,MAAM;gBACV,KAAK,cAAc;oBACf,2BAAY,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAW,CAAC,CAAC;oBACxD,MAAM;gBACV;oBACI,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;YAChF,CAAC;QACL,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAlLgB,WAAW,2BAAX,WAAW,QAkL3B","sourcesContent":["import { ContextReader } from '../../../../context/context-reader';\nimport { ContextWriter } from '../../../../context/context-writer';\nimport { DynamicStructPropertyValue } from '../../structs/DynamicStructPropertyValue';\nimport { ObjectReference } from '../../structs/ObjectReference';\nimport { AbstractBaseProperty } from './AbstractBaseProperty';\nimport { ByteProperty } from './ByteProperty';\nimport { EnumProperty } from './EnumProperty';\nimport { Int32Property } from './Int32Property';\nimport { Int64Property } from './Int64Property';\nimport { ObjectProperty } from './ObjectProperty';\nimport { StrProperty } from './StrProperty';\nimport { GENERIC_STRUCT_PROPERTY_VALUE } from './StructProperty';\n\n\nexport type MAP_STRUCT_KEY_PROXY = [number, number, number, number, number, number, number, number, number, number, number, number];\nexport type GENERIC_MAP_KEY_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE | MAP_STRUCT_KEY_PROXY;\nexport type GENERIC_MAP_VALUE_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE;\n\nexport const isMapProperty = (property: any): property is MapProperty => !Array.isArray(property) && property.type === 'MapProperty';\n\nexport type MapProperty = AbstractBaseProperty & {\n type: 'MapProperty';\n keyType: string;\n valueType: string;\n modeType: number;\n modeUnk1: string | undefined;\n modeUnk2: string;\n modeUnk3: string;\n values: [key: GENERIC_MAP_KEY_TYPE, value: GENERIC_MAP_VALUE_TYPE][];\n};\n\n\nexport namespace MapProperty {\n\n export const Parse = (reader: ContextReader, propertyName: string, size: number, ueType: string = 'MapProperty', index: number = 0): MapProperty => {\n const start = reader.getBufferPosition();\n const property: MapProperty = {\n ...AbstractBaseProperty.Create({ index, ueType, type: '' }),\n type: 'MapProperty',\n keyType: reader.readString(),\n valueType: reader.readString(),\n guidInfo: undefined,\n modeType: 0,\n values: [],\n modeUnk1: undefined,\n modeUnk2: '',\n modeUnk3: ''\n };\n\n reader.readByte(); //0\n property.modeType = reader.readInt32(); //0\n\n const elementCount = reader.readInt32();\n for (let i = 0; i < elementCount; i++) {\n let key: GENERIC_MAP_KEY_TYPE;\n let value: GENERIC_MAP_VALUE_TYPE;\n switch (property.keyType) {\n case 'StructProperty':\n\n // TODO use buildversion or saveversion to differentiate\n\n // TODO: extra for properties like mSaveData, the structure is specific here\n // don'T ask me why this has this weird form. But maybe it is for maps in general that have Struct as key? So far we only see this in those 2 properties.\n // F4 FF FF FF 26 00 00 00 FF FF FF FF - Save in Release 1.0\n // F5 FF FF FF 27 00 00 00 FF FF FF FF - Save started in U8\n // FD FF FF FF 2B 00 00 00 FF FF FF FF - another Save started in U8\n // 11 00 00 00 EF FF FF FF 02 00 00 00 - Save ported from U5 -> U8\n if (propertyName === 'mSaveData' || propertyName === 'mUnresolvedSaveData') {\n key = Array.from(reader.readBytes(12)) as MAP_STRUCT_KEY_PROXY;\n } else {\n key = DynamicStructPropertyValue.read(reader, property.keyType);\n }\n\n break;\n case 'ObjectProperty':\n key = ObjectProperty.ReadValue(reader);\n break;\n case 'StrProperty':\n case 'NameProperty':\n key = StrProperty.ReadValue(reader);\n break;\n case 'EnumProperty':\n key = EnumProperty.ReadValue(reader);\n break;\n case 'IntProperty':\n case 'Int32Property':\n key = Int32Property.ReadValue(reader);\n break;\n case 'Int64Property':\n key = Int64Property.ReadValue(reader);\n break;\n case 'ByteProperty':\n key = ByteProperty.ReadValue(reader);\n break;\n default:\n throw new Error(`not implemented map key type ${property.keyType}`);\n }\n\n switch (property.valueType) {\n case 'StructProperty':\n value = DynamicStructPropertyValue.read(reader, property.valueType);\n break;\n case 'ObjectProperty':\n value = ObjectProperty.ReadValue(reader);\n break;\n case 'StrProperty':\n case 'NameProperty':\n value = StrProperty.ReadValue(reader);\n break;\n case 'EnumProperty':\n value = EnumProperty.ReadValue(reader);\n break;\n case 'IntProperty':\n case 'Int32Property':\n value = Int32Property.ReadValue(reader);\n break;\n case 'Int64Property':\n value = Int64Property.ReadValue(reader);\n break;\n case 'ByteProperty':\n value = ByteProperty.ReadValue(reader);\n break;\n default:\n throw new Error(`not implemented map value type ${property.valueType}`);\n }\n\n property.values.push([key, value]);\n }\n\n return property;\n }\n\n export const CalcOverhead = (property: MapProperty): number => {\n return property.keyType.length + 5 + property.valueType.length + 5 + 1;\n }\n\n export const Serialize = (writer: ContextWriter, property: MapProperty): void => {\n\n writer.writeString(property.keyType);\n writer.writeString(property.valueType);\n\n writer.writeByte(0);\n writer.writeInt32(property.modeType);\n\n writer.writeInt32(property.values.length);\n for (const entry of property.values) {\n\n switch (property.keyType) {\n case 'StructProperty':\n\n if (property.name === 'mSaveData' || property.name === 'mUnresolvedSaveData') {\n writer.writeBytesArray(entry[0] as MAP_STRUCT_KEY_PROXY);\n } else {\n DynamicStructPropertyValue.write(writer, entry[0] as DynamicStructPropertyValue);\n }\n\n break;\n case 'ObjectProperty':\n ObjectProperty.SerializeValue(writer, entry[0] as ObjectReference);\n break;\n case 'StrProperty':\n case 'NameProperty':\n StrProperty.SerializeValue(writer, entry[0] as string);\n break;\n case 'EnumProperty':\n EnumProperty.SerializeValue(writer, entry[0] as string);\n break;\n case 'IntProperty':\n case 'Int32Property':\n Int32Property.SerializeValue(writer, entry[0] as number);\n break;\n case 'Int64Property':\n Int64Property.SerializeValue(writer, entry[0] as string);\n break;\n case 'ByteProperty':\n ByteProperty.SerializeValue(writer, entry[0] as number);\n break;\n default:\n throw new Error(`not implemented map key type ${property.valueType}`);\n }\n\n switch (property.valueType) {\n case 'StructProperty':\n DynamicStructPropertyValue.write(writer, entry[1] as DynamicStructPropertyValue);\n break;\n case 'ObjectProperty':\n ObjectProperty.SerializeValue(writer, entry[1] as ObjectReference);\n break;\n case 'StrProperty':\n case 'NameProperty':\n StrProperty.SerializeValue(writer, entry[1] as string);\n break;\n case 'EnumProperty':\n EnumProperty.SerializeValue(writer, entry[1] as string);\n break;\n case 'IntProperty':\n case 'Int32Property':\n Int32Property.SerializeValue(writer, entry[1] as number);\n break;\n case 'Int64Property':\n Int64Property.SerializeValue(writer, entry[1] as string);\n break;\n case 'ByteProperty':\n ByteProperty.SerializeValue(writer, entry[1] as number);\n break;\n default:\n throw new Error(`not implemented map value type ${property.valueType}`);\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MapProperty.js","sourceRoot":"","sources":["../../../../../../src/parser/satisfactory/types/property/generic/MapProperty.ts"],"names":[],"mappings":";;;AAEA,yFAAsF;AAEtF,iEAA8D;AAC9D,iDAA8C;AAC9C,iDAA8C;AAC9C,mDAAgD;AAChD,mDAAgD;AAChD,qDAAkD;AAClD,+CAA4C;AAQrC,MAAM,aAAa,GAAG,CAAC,QAAa,EAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,KAAK,aAAa,CAAC;AAAxH,QAAA,aAAa,iBAA2G;AAcrI,IAAiB,WAAW,CA4L3B;AA5LD,WAAiB,WAAW;IAEX,iBAAK,GAAG,CAAC,MAAqB,EAAE,YAAoB,EAAE,IAAY,EAAE,SAAiB,aAAa,EAAE,QAAgB,CAAC,EAAe,EAAE;QAC/I,MAAM,KAAK,GAAG,MAAM,C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\nimport { ContextWriter } from '../../../../context/context-writer';\nimport { DynamicStructPropertyValue } from '../../structs/DynamicStructPropertyValue';\nimport { ObjectReference } from '../../structs/ObjectReference';\nimport { AbstractBaseProperty } from './AbstractBaseProperty';\nimport { ByteProperty } from './ByteProperty';\nimport { EnumProperty } from './EnumProperty';\nimport { Int32Property } from './Int32Property';\nimport { Int64Property } from './Int64Property';\nimport { ObjectProperty } from './ObjectProperty';\nimport { StrProperty } from './StrProperty';\nimport { GENERIC_STRUCT_PROPERTY_VALUE } from './StructProperty';\n\n\nexport type MAP_STRUCT_PROXY = [number, number, number, number, number, number, number, number, number, number, number, number];\nexport type GENERIC_MAP_KEY_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE | MAP_STRUCT_PROXY;\nexport type GENERIC_MAP_VALUE_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE | MAP_STRUCT_PROXY;\n\nexport const isMapProperty = (property: any): property is MapProperty => !Array.isArray(property) && property.type === 'MapProperty';\n\nexport type MapProperty = AbstractBaseProperty & {\n type: 'MapProperty';\n keyType: string;\n valueType: string;\n modeType: number;\n modeUnk1: string | undefined;\n modeUnk2: string;\n modeUnk3: string;\n values: [key: GENERIC_MAP_KEY_TYPE, value: GENERIC_MAP_VALUE_TYPE][];\n};\n\n\nexport namespace MapProperty {\n\n export const Parse = (reader: ContextReader, propertyName: string, size: number, ueType: string = 'MapProperty', index: number = 0): MapProperty => {\n const start = reader.getBufferPosition();\n const property: MapProperty = {\n ...AbstractBaseProperty.Create({ index, ueType, type: '' }),\n type: 'MapProperty',\n keyType: reader.readString(),\n valueType: reader.readString(),\n guidInfo: undefined,\n modeType: 0,\n values: [],\n modeUnk1: undefined,\n modeUnk2: '',\n modeUnk3: ''\n };\n\n reader.readByte(); //0\n property.modeType = reader.readInt32(); //0\n\n const elementCount = reader.readInt32();\n for (let i = 0; i < elementCount; i++) {\n let key: GENERIC_MAP_KEY_TYPE;\n let value: GENERIC_MAP_VALUE_TYPE;\n switch (property.keyType) {\n case 'StructProperty':\n\n // TODO use buildversion or saveversion to differentiate\n\n // TODO: extra for properties like mSaveData, the structure is specific here\n // don'T ask me why this has this weird form. But maybe it is for maps in general that have Struct as key? So far we only see this in those 2 properties.\n // F4 FF FF FF 26 00 00 00 FF FF FF FF - Save in Release 1.0\n // F5 FF FF FF 27 00 00 00 FF FF FF FF - Save started in U8\n // FD FF FF FF 2B 00 00 00 FF FF FF FF - another Save started in U8\n // 11 00 00 00 EF FF FF FF 02 00 00 00 - Save ported from U5 -> U8\n if (propertyName === 'mSaveData' || propertyName === 'mUnresolvedSaveData') {\n key = Array.from(reader.readBytes(12)) as MAP_STRUCT_PROXY;\n } else {\n key = DynamicStructPropertyValue.read(reader, property.keyType);\n }\n\n break;\n case 'ObjectProperty':\n key = ObjectProperty.ReadValue(reader);\n break;\n case 'StrProperty':\n case 'NameProperty':\n key = StrProperty.ReadValue(reader);\n break;\n case 'EnumProperty':\n key = EnumProperty.ReadValue(reader);\n break;\n case 'IntProperty':\n case 'Int32Property':\n key = Int32Property.ReadValue(reader);\n break;\n case 'Int64Property':\n key = Int64Property.ReadValue(reader);\n break;\n case 'ByteProperty':\n key = ByteProperty.ReadValue(reader);\n break;\n default:\n throw new Error(`not implemented map key type ${property.keyType}`);\n }\n\n switch (property.valueType) {\n case 'StructProperty':\n if (propertyName === 'mIndexMapping' && reader.context.mods.MLBAlternates !== undefined) {\n value = Array.from(reader.readBytes(12)) as MAP_STRUCT_PROXY;\n } else {\n value = DynamicStructPropertyValue.read(reader, property.valueType);\n }\n break;\n case 'ObjectProperty':\n value = ObjectProperty.ReadValue(reader);\n break;\n case 'StrProperty':\n case 'NameProperty':\n value = StrProperty.ReadValue(reader);\n break;\n case 'EnumProperty':\n value = EnumProperty.ReadValue(reader);\n break;\n case 'IntProperty':\n case 'Int32Property':\n value = Int32Property.ReadValue(reader);\n break;\n case 'Int64Property':\n value = Int64Property.ReadValue(reader);\n break;\n case 'ByteProperty':\n value = ByteProperty.ReadValue(reader);\n break;\n default:\n throw new Error(`not implemented map value type ${property.valueType}`);\n }\n\n property.values.push([key, value]);\n }\n\n return property;\n }\n\n export const CalcOverhead = (property: MapProperty): number => {\n return property.keyType.length + 5 + property.valueType.length + 5 + 1;\n }\n\n export const Serialize = (writer: ContextWriter, property: MapProperty): void => {\n\n writer.writeString(property.keyType);\n writer.writeString(property.valueType);\n\n writer.writeByte(0);\n writer.writeInt32(property.modeType);\n\n writer.writeInt32(property.values.length);\n for (const entry of property.values) {\n\n switch (property.keyType) {\n case 'StructProperty':\n\n if (property.name === 'mSaveData' || property.name === 'mUnresolvedSaveData') {\n writer.writeBytesArray(entry[0] as MAP_STRUCT_PROXY);\n } else {\n DynamicStructPropertyValue.write(writer, entry[0] as DynamicStructPropertyValue);\n }\n\n break;\n case 'ObjectProperty':\n ObjectProperty.SerializeValue(writer, entry[0] as ObjectReference);\n break;\n case 'StrProperty':\n case 'NameProperty':\n StrProperty.SerializeValue(writer, entry[0] as string);\n break;\n case 'EnumProperty':\n EnumProperty.SerializeValue(writer, entry[0] as string);\n break;\n case 'IntProperty':\n case 'Int32Property':\n Int32Property.SerializeValue(writer, entry[0] as number);\n break;\n case 'Int64Property':\n Int64Property.SerializeValue(writer, entry[0] as string);\n break;\n case 'ByteProperty':\n ByteProperty.SerializeValue(writer, entry[0] as number);\n break;\n default:\n throw new Error(`not implemented map key type ${property.valueType}`);\n }\n\n switch (property.valueType) {\n case 'StructProperty':\n\n if (property.name === 'mIndexMapping' && writer.context.mods.MLBAlternates !== undefined) {\n writer.writeBytesArray(entry[1] as MAP_STRUCT_PROXY);\n } else {\n DynamicStructPropertyValue.write(writer, entry[1] as DynamicStructPropertyValue);\n }\n\n break;\n case 'ObjectProperty':\n ObjectProperty.SerializeValue(writer, entry[1] as ObjectReference);\n break;\n case 'StrProperty':\n case 'NameProperty':\n StrProperty.SerializeValue(writer, entry[1] as string);\n break;\n case 'EnumProperty':\n EnumProperty.SerializeValue(writer, entry[1] as string);\n break;\n case 'IntProperty':\n case 'Int32Property':\n Int32Property.SerializeValue(writer, entry[1] as number);\n break;\n case 'Int64Property':\n Int64Property.SerializeValue(writer, entry[1] as string);\n break;\n case 'ByteProperty':\n ByteProperty.SerializeValue(writer, entry[1] as number);\n break;\n default:\n throw new Error(`not implemented map value type ${property.valueType}`);\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ContextReader } from "../../../context/context-reader";
|
|
2
|
+
import { ContextWriter } from "../../../context/context-writer";
|
|
3
|
+
export type SaveBodyValidation = {
|
|
4
|
+
grids: Grids;
|
|
5
|
+
};
|
|
6
|
+
export type Grids = {
|
|
7
|
+
[parentName: string]: {
|
|
8
|
+
cellSize: number;
|
|
9
|
+
gridHash: number;
|
|
10
|
+
children: {
|
|
11
|
+
[name: string]: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare namespace SaveBodyValidation {
|
|
16
|
+
const Parse: (reader: ContextReader) => SaveBodyValidation;
|
|
17
|
+
const Serialize: (writer: ContextWriter, saveBodyValidation: SaveBodyValidation) => void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=SaveBodyValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveBodyValidation.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/SaveBodyValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAIhE,MAAM,MAAM,kBAAkB,GAAG;IAC7B,KAAK,EAAE,KAAK,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAChB,CAAC,UAAU,EAAE,MAAM,GAAG;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE;YACN,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;SAC1B,CAAA;KACJ,CAAA;CACJ,CAAC;AAOF,yBAAiB,kBAAkB,CAAC;IACzB,MAAM,KAAK,WAAY,aAAa,KAAG,kBAyB7C,CAAA;IAEM,MAAM,SAAS,WAAY,aAAa,sBAAsB,kBAAkB,KAAG,IAczF,CAAA;CACJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SaveBodyValidation = void 0;
|
|
4
|
+
var SaveBodyValidation;
|
|
5
|
+
(function (SaveBodyValidation) {
|
|
6
|
+
SaveBodyValidation.Parse = (reader) => {
|
|
7
|
+
reader.readInt32Zero();
|
|
8
|
+
const grids = {};
|
|
9
|
+
const count = reader.readInt32();
|
|
10
|
+
for (let i = 0; i < count; i++) {
|
|
11
|
+
const gridName = reader.readString();
|
|
12
|
+
const cellSize = reader.readInt32();
|
|
13
|
+
const gridHash = reader.readUint32();
|
|
14
|
+
grids[gridName] = { children: {}, cellSize, gridHash };
|
|
15
|
+
const childrenCount = reader.readUint32();
|
|
16
|
+
for (let i = 0; i < childrenCount; i++) {
|
|
17
|
+
const levelInstanceName = reader.readString();
|
|
18
|
+
const cellHash = reader.readUint32();
|
|
19
|
+
grids[gridName].children[levelInstanceName] = cellHash;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
grids
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
SaveBodyValidation.Serialize = (writer, saveBodyValidation) => {
|
|
27
|
+
writer.writeInt32(0);
|
|
28
|
+
writer.writeInt32(Object.entries(saveBodyValidation.grids).length);
|
|
29
|
+
for (const gridEntry of Object.entries(saveBodyValidation.grids)) {
|
|
30
|
+
writer.writeString(gridEntry[0]);
|
|
31
|
+
writer.writeInt32(gridEntry[1].cellSize);
|
|
32
|
+
writer.writeUint32(gridEntry[1].gridHash);
|
|
33
|
+
writer.writeUint32(Object.values(gridEntry[1].children).length);
|
|
34
|
+
for (const child of Object.entries(gridEntry[1].children)) {
|
|
35
|
+
writer.writeString(child[0]);
|
|
36
|
+
writer.writeUint32(child[1]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
})(SaveBodyValidation || (exports.SaveBodyValidation = SaveBodyValidation = {}));
|
|
41
|
+
//# sourceMappingURL=SaveBodyValidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SaveBodyValidation.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/SaveBodyValidation.ts"],"names":[],"mappings":";;;AAwBA,IAAiB,kBAAkB,CA2ClC;AA3CD,WAAiB,kBAAkB;IAClB,wBAAK,GAAG,CAAC,MAAqB,EAAsB,EAAE;QAE/D,MAAM,CAAC,aAAa,EAAE,CAAC;QACvB,MAAM,KAAK,GAAU,EAAE,CAAC;QAGxB,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;YAErC,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;YACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;YACrC,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;YAEvD,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;YAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC;gBACrC,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;gBAC9C,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/context-reader\";\nimport { ContextWriter } from \"../../../context/context-writer\";\n\n\n\nexport type SaveBodyValidation = {\n grids: Grids;\n};\n\nexport type Grids = {\n [parentName: string]: {\n cellSize: number;\n gridHash: number;\n children: {\n [name: string]: number;\t// children object contains names and their binary size.\n }\n }\n};\n\n/**\n * Relates to FWorldPartitionValidationData in FWPSaveDataMigrationContext.h\n * so far has grids (WPActorCellMapping)\n * Is very static for normal game map.\n */\nexport namespace SaveBodyValidation {\n export const Parse = (reader: ContextReader): SaveBodyValidation => {\n\n reader.readInt32Zero();\n const grids: Grids = {};\n\n // normal game map has 6 grids: None, main grid, landscape grid, exploration grid, foliage grid, hlod0\n const count = reader.readInt32();\n for (let i = 0; i < count; i++) {\n const gridName = reader.readString();\n\n const cellSize = reader.readInt32();\n const gridHash = reader.readUint32();\n grids[gridName] = { children: {}, cellSize, gridHash };\n\n const childrenCount = reader.readUint32();\n for (let i = 0; i < childrenCount; i++) {\n const levelInstanceName = reader.readString();\n const cellHash = reader.readUint32();\n grids[gridName].children[levelInstanceName] = cellHash;\n }\n }\n\n return {\n grids\n } satisfies SaveBodyValidation;\n }\n\n export const Serialize = (writer: ContextWriter, saveBodyValidation: SaveBodyValidation): void => {\n writer.writeInt32(0);\n writer.writeInt32(Object.entries(saveBodyValidation.grids).length);\n for (const gridEntry of Object.entries(saveBodyValidation.grids)) {\n writer.writeString(gridEntry[0]);\n writer.writeInt32(gridEntry[1].cellSize);\n writer.writeUint32(gridEntry[1].gridHash);\n\n writer.writeUint32(Object.values(gridEntry[1].children).length);\n for (const child of Object.entries(gridEntry[1].children)) {\n writer.writeString(child[0]);\n writer.writeUint32(child[1]);\n }\n }\n }\n}"]}
|
|
@@ -8,7 +8,7 @@ export declare class ReadableStreamParser {
|
|
|
8
8
|
stream: ReadableStream<string>;
|
|
9
9
|
startStreaming: () => Promise<void>;
|
|
10
10
|
};
|
|
11
|
-
private static
|
|
11
|
+
private static WriteHeaderAndSaveBodyValidation;
|
|
12
12
|
private static ReadWriteLevels;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=readable-stream-parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readable-stream-parser.d.ts","sourceRoot":"","sources":["../../../../src/parser/stream/reworked/readable-stream-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,cAAc,EAAmC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"readable-stream-parser.d.ts","sourceRoot":"","sources":["../../../../src/parser/stream/reworked/readable-stream-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,cAAc,EAAmC,MAAM,YAAY,CAAC;AAyD9F,qBAAa,oBAAoB;IAEhC,OAAO,CAAC,MAAM,CAAC,kCAAkC,CAgC/C;IAUF,OAAc,kCAAkC,SACzC,MAAM,SACL,eAAe,YACZ,OAAO,CAAC;QACjB,sBAAsB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;QAC1D,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KACxD,CAAC,KACA;QAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;QAAC,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;KAAE,CA2FzE;IAGD,OAAO,CAAC,MAAM,CAAC,gCAAgC,CAQ9C;mBAEoB,eAAe;CAyIpC"}
|
|
@@ -12,6 +12,7 @@ const satisfactory_save_header_1 = require("../../satisfactory/save/satisfactory
|
|
|
12
12
|
const save_custom_version_1 = require("../../satisfactory/save/save-custom-version");
|
|
13
13
|
const save_reader_1 = require("../../satisfactory/save/save-reader");
|
|
14
14
|
const ObjectReference_1 = require("../../satisfactory/types/structs/ObjectReference");
|
|
15
|
+
const SaveBodyValidation_1 = require("../../satisfactory/types/structs/SaveBodyValidation");
|
|
15
16
|
const DEFAULT_BYTE_HIGHWATERMARK = 1024 * 1024 * 200;
|
|
16
17
|
const createStringLengthQueuingStrategy = (highWaterMark = DEFAULT_BYTE_HIGHWATERMARK / 4) => ({
|
|
17
18
|
highWaterMark,
|
|
@@ -195,13 +196,11 @@ ReadableStreamParser.CreateReadableStreamFromSaveToJson = (name, bytes, options)
|
|
|
195
196
|
if (options?.onDecompressedSaveBody !== undefined) {
|
|
196
197
|
options.onDecompressedSaveBody(reader.getBuffer());
|
|
197
198
|
}
|
|
198
|
-
let
|
|
199
|
-
let grids = save.grids;
|
|
199
|
+
let saveBodyValidation = save.saveBodyValidation;
|
|
200
200
|
if (reader.context.saveVersion >= save_custom_version_1.SaveCustomVersion.IntroducedWorldPartition) {
|
|
201
|
-
|
|
202
|
-
grids = reader.readGrids();
|
|
201
|
+
saveBodyValidation = SaveBodyValidation_1.SaveBodyValidation.Parse(reader);
|
|
203
202
|
}
|
|
204
|
-
await _a.
|
|
203
|
+
await _a.WriteHeaderAndSaveBodyValidation(write, name, inflateResult.compressionInfo, header, saveBodyValidation);
|
|
205
204
|
await _a.ReadWriteLevels(write, reader, save.header.mapName, save.header.buildVersion);
|
|
206
205
|
await write(`}`, false);
|
|
207
206
|
const countUnresolvedWorldSaveData = reader.readInt32();
|
|
@@ -223,7 +222,7 @@ ReadableStreamParser.CreateReadableStreamFromSaveToJson = (name, bytes, options)
|
|
|
223
222
|
};
|
|
224
223
|
return { stream, startStreaming };
|
|
225
224
|
};
|
|
226
|
-
ReadableStreamParser.
|
|
227
|
-
return write(`{"header": ${JSON.stringify(header)}, "name": "${name}", "compressionInfo": ${JSON.stringify(compressionInfo)}, "
|
|
225
|
+
ReadableStreamParser.WriteHeaderAndSaveBodyValidation = async (write, name, compressionInfo, header, saveBodyValidation) => {
|
|
226
|
+
return write(`{"header": ${JSON.stringify(header)}, "name": "${name}", "compressionInfo": ${JSON.stringify(compressionInfo)}, "saveBodyValidation": ${JSON.stringify(saveBodyValidation)}, "levels": {`, false);
|
|
228
227
|
};
|
|
229
228
|
//# sourceMappingURL=readable-stream-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readable-stream-parser.js","sourceRoot":"","sources":["../../../../src/parser/stream/reworked/readable-stream-parser.ts"],"names":[],"mappings":";;;;AAAA,oCAA8F;AAC9F,2DAAmE;AACnE,yDAAsD;AACtD,yGAAkG;AAClG,2FAAsF;AACtF,iFAA6E;AAC7E,+FAA0F;AAE1F,qFAAgF;AAChF,qEAA4F;AAC5F,sFAAmF;AAEnF,MAAM,0BAA0B,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC;AACrD,MAAM,iCAAiC,GAAG,CAAC,gBAAwB,0BAA0B,GAAG,CAAC,EAA2B,EAAE,CAAC,CAAC;IAC/H,aAAa;IACb,IAAI,EAAE,CAAC,KAAyB,EAAE,EAAE;QACnC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,CAAC,CAAC;QACV,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;CACD,CAAC,CAAC;AAEH,MAAM,yBAAyB;IAA/B;QACC,WAAM,GAAY,KAAK,CAAC;QACxB,iCAA4B,GAAY,KAAK,CAAC;QAC9C,gBAAW,GAA6B,SAAS,CAAC;IAyBnD,CAAC;IApBO,IAAI,CAAC,WAAuB;QAClC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACf,CAAC;IACF,CAAC;IAKM,MAAM;QACZ,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC9B,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,4BAA4B,GAAG,IAAI,CAAC;QAC1C,CAAC;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IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YACjE,CAAC;YACD,MAAM,KAAK,CAAC,gCAAgC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrG,CAAC;QAED,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,KAAK,CAAC,cAAc,IAAI,CAAC,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QAED,IAAI,OAAO,EAAE,UAAU,KAAK,SAAS,EAAE,CAAC;YACvC,OAAO,CAAC,UAAU,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;QAC5C,CAAC;QAGD,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACvB,MAAM,EAAE,CAAC;IACV,CAAC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AACnC,CAAC,AAvG+C,CAuG/C;AAGc,wCAAmB,GAAG,KAAK,EACzC,KAA6E,EAC7E,IAAY,EACZ,eAAqC,EACrC,MAA8B,EAC9B,KAAY,EACZ,QAA4B,EAC3B,EAAE;IACH,OAAO,KAAK,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,IAAI,yBAAyB,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AAChO,CAAC,AATiC,CASjC","sourcesContent":["import { QueuingStrategy, ReadableStream, ReadableStreamDefaultController } from \"stream/web\";\nimport { UnsupportedVersionError } from '../../error/parser.error';\nimport { Level } from '../../satisfactory/save/level';\nimport { LevelToDestroyedActorsMap } from '../../satisfactory/save/level-to-destroyed-actors-map';\nimport { ObjectReferencesList } from '../../satisfactory/save/object-references-list';\nimport { SatisfactorySave } from \"../../satisfactory/save/satisfactory-save\";\nimport { SatisfactorySaveHeader } from '../../satisfactory/save/satisfactory-save-header';\nimport { ChunkCompressionInfo } from \"../../satisfactory/save/save-body-chunks\";\nimport { SaveCustomVersion } from '../../satisfactory/save/save-custom-version';\nimport { Grids, SaveBodyValidation, SaveReader } from '../../satisfactory/save/save-reader';\nimport { ObjectReference } from '../../satisfactory/types/structs/ObjectReference';\n\nconst DEFAULT_BYTE_HIGHWATERMARK = 1024 * 1024 * 200;\t// 200MiB\nconst createStringLengthQueuingStrategy = (highWaterMark: number = DEFAULT_BYTE_HIGHWATERMARK / 4): QueuingStrategy<string> => ({\n\thighWaterMark,\n\tsize: (chunk: string | undefined) => {\n\t\tif (chunk === undefined) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn chunk.length;\n\t}\n});\n\nclass SimpleWaitForConsumerLock {\n\tlocked: boolean = false;\n\tunlockWasCalledInTheMeantime: boolean = false;\n\texecutionFn: (() => void) | undefined = undefined;\n\n\t/** activate lock and set function to execute on unlock.\n\t * If at least 1 unlock was called before this call, immediately unlock.\n\t */\n\tpublic lock(executionFn: () => void) {\n\t\tthis.executionFn = executionFn;\n\t\tthis.locked = true;\n\t\tif (this.unlockWasCalledInTheMeantime) {\n\t\t\tthis.unlock();\n\t\t}\n\t}\n\n\t/**\n\t * unlock and execute stored function if present.\n\t */\n\tpublic unlock() {\n\t\tthis.locked = false;\n\t\tif (this.executionFn) {\n\t\t\tthis.executionFn();\n\t\t\tthis.executionFn = undefined;\n\t\t} else {\n\t\t\tthis.unlockWasCalledInTheMeantime = true;\n\t\t}\n\t}\n};\n\n/**\n * Creates a ReadableStream from Binary file, that actually waits until the reading operator has caught up before it pushes more.\n */\nexport class ReadableStreamParser {\n\n\tprivate static CreateReadableStreamForParsingSave = (\n\t\tonStart: (controller: ReadableStreamDefaultController<string>) => void,\n\t\tonCancel: (reason: any) => void,\n\t\tonPullRequest: (desiredSize: number) => void,\n\t\thighWaterMark = DEFAULT_BYTE_HIGHWATERMARK / 4\n\t) => {\n\t\tlet ourController: ReadableStreamDefaultController<string> | null = null;\n\t\tconst stream = new ReadableStream<string>({\n\t\t\tstart: (controller: ReadableStreamDefaultController<string>) => {\n\t\t\t\tourController = controller;\n\t\t\t\tonStart(ourController);\n\t\t\t},\n\t\t\tpull: (controller: ReadableStreamDefaultController<string>) => {\n\t\t\t\tonPullRequest(ourController!.desiredSize ?? 1);\n\t\t\t},\n\t\t\tcancel: (reason) => {\n\t\t\t\tconsole.warn('parsing stream was canceled!', reason);\n\t\t\t\tif (ourController !== null) {\n\t\t\t\t\tourController.close();\n\t\t\t\t}\n\t\t\t\tonCancel(reason);\n\t\t\t}\n\t\t}, createStringLengthQueuingStrategy(highWaterMark));\n\n\t\t// create handle to close source.\n\t\tconst finish = () => {\n\t\t\tif (ourController !== null) {\n\t\t\t\tourController?.close();\n\t\t\t}\n\t\t}\n\n\t\treturn { stream, controller: ourController!, finish };\n\t};\n\n\t/**\n\t * the more elegant way to parse saves, instead of using the plain ParseSave. Since streaming will not hold the converted JSON in memory at once.\n\t * @param name the save name\n\t * @param bytes the save file as UInt8Array\n\t * @param onDecompressedSaveBody a callback to report back on the decompressed binary save body.\n\t * @param onProgress a callback to report back on the parsing progress. Optionally contains a message.\n\t * @returns a WHATWG compliant readable stream of strings (They are valid JSON and represent a {@link SatisfactorySave} object). And a method to actually start the streaming for more precise control.\n\t */\n\tpublic static CreateReadableStreamFromSaveToJson = (\n\t\tname: string,\n\t\tbytes: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBufferLike) => void,\n\t\t\tonProgress: (progress: number, message?: string) => void\n\t\t}>\n\t): { stream: ReadableStream<string>, startStreaming: () => Promise<void> } => {\n\n\t\t// create a simple lock to sync with consumer of the stream. Aka handle backpressure.\n\t\tconst waitForConsumerLock = new SimpleWaitForConsumerLock();\n\t\tconst waitForConsumer = async () => {\n\t\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\t\twaitForConsumerLock.lock(resolve);\n\t\t\t});\n\t\t}\n\n\t\tconst { stream, controller, finish } = ReadableStreamParser.CreateReadableStreamForParsingSave(\n\t\t\t(controller) => {\n\t\t\t\t//startStreaming();\n\t\t\t},\n\t\t\t(reason) => { },\n\t\t\t(desiredSize) => {\n\t\t\t\t// consumer (to be more correct, the internal buffer!) is ready, unlock syncing lock.\n\t\t\t\twaitForConsumerLock.unlock();\n\t\t\t},\n\t\t);\n\n\t\t/**\n\t\t * pushes a value into the readable stream. Optionally waits for the \"pull\" signal of the stream before writing.\n\t\t * @param value the value to write\n\t\t * @param waitForConsumerToBeReady whether the process should wait until the \"pull\" signal of the stream.\n\t\t */\n\t\tconst write = async (value: string, waitForConsumerToBeReady = true): Promise<void> => {\n\t\t\tif (waitForConsumerToBeReady) {\n\t\t\t\tawait waitForConsumer();\n\t\t\t}\n\t\t\tcontroller.enqueue(value);\n\t\t}\n\n\t\tconst startStreaming = async (): Promise<void> => {\n\n\t\t\tconst reader = new SaveReader(bytes, options?.onProgress);\n\n\t\t\t// read header\n\t\t\tconst header = SatisfactorySaveHeader.Parse(reader);\n\t\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t\t// guard save version\n\t\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion);\n\t\t\tif (roughSaveVersion === '<U6') {\n\t\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t\t}\n\n\t\t\t// inflate chunks\n\t\t\tconst inflateResult = reader.inflateChunks();\n\t\t\tsave.compressionInfo = inflateResult.compressionInfo;\n\n\t\t\t// call callback on decompressed save body\n\t\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t\t}\n\n\t\t\tlet gridHash = save.gridHash;\n\t\t\tlet grids = save.grids;\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\t// grid hash i guess\n\t\t\t\tgridHash = reader.readSaveBodyHash();\n\n\t\t\t\t// parse grids\n\t\t\t\tgrids = reader.readGrids();\n\t\t\t}\n\n\t\t\tawait ReadableStreamParser.WriteHeaderAndGrids(write, name, inflateResult.compressionInfo, header, grids, gridHash);\n\n\t\t\t// parse levels\n\t\t\tawait ReadableStreamParser.ReadWriteLevels(write, reader, save.header.mapName, save.header.buildVersion);\n\t\t\tawait write(`}`, false);\n\n\t\t\t// unresolved data\n\t\t\tconst countUnresolvedWorldSaveData = reader.readInt32();\n\t\t\tif (countUnresolvedWorldSaveData) {\n\t\t\t\tsave.unresolvedWorldSaveData = [];\n\t\t\t\tfor (let i = 0; i < countUnresolvedWorldSaveData; i++) {\n\t\t\t\t\tsave.unresolvedWorldSaveData.push(ObjectReference.read(reader));\n\t\t\t\t}\n\t\t\t\tawait write(`, \"unresolvedWorldSaveData\": ${JSON.stringify(save.unresolvedWorldSaveData)} `, false);\n\t\t\t}\n\n\t\t\tif (save.name !== undefined) {\n\t\t\t\tawait write(`, \"name\": \"${save.name}\" `, false);\n\t\t\t}\n\n\t\t\tif (options?.onProgress !== undefined) {\n\t\t\t\toptions.onProgress(1, 'finished parsing.');\n\t\t\t}\n\n\t\t\t// close save object.\n\t\t\tawait write(`}`, true);\n\t\t\tfinish();\n\t\t};\n\n\t\treturn { stream, startStreaming };\n\t}\n\n\n\tprivate static WriteHeaderAndGrids = async (\n\t\twrite: (value: string, waitTilConsumingEndIsReady?: boolean) => Promise<void>,\n\t\tname: string,\n\t\tcompressionInfo: ChunkCompressionInfo,\n\t\theader: SatisfactorySaveHeader,\n\t\tgrids: Grids,\n\t\tgridHash: SaveBodyValidation\n\t) => {\n\t\treturn write(`{\"header\": ${JSON.stringify(header)}, \"name\": \"${name}\", \"compressionInfo\": ${JSON.stringify(compressionInfo)}, \"gridHash\": ${JSON.stringify(gridHash)}, \"grids\": ${JSON.stringify(grids)}, \"levels\": {`, false);\n\t}\n\n\tprivate static async ReadWriteLevels(\n\t\twrite: (value: string, waitTilConsumingEndIsReady?: boolean) => Promise<void>,\n\t\treader: SaveReader,\n\t\tmapName: string,\n\t\tbuildVersion: number,\n\t): Promise<void> {\n\n\t\tconst batchingSizeOfObjects = 1000;\n\t\tconst thresholdOfWrittenObjectsUntilWaitingForConsumerAgain = 3 * batchingSizeOfObjects;\n\n\t\tconst levelCount = reader.readInt32();\n\t\treader.onProgressCallback(reader.getBufferProgress(), `reading pack of ${levelCount + 1} levels.`);\n\n\t\tlet writtenTotalObjectsSinceConsumerSync = 0;\n\t\tlet collectables: ObjectReference[] = [];\n\t\tlet destroyedActorsMap: LevelToDestroyedActorsMap = {};\n\t\tfor (let j = 0; j <= levelCount; j++) {\n\t\t\tlet levelName = (j === levelCount) ? '' + mapName : reader.readString();\n\n\t\t\tif (j % 500 === 0) {\n\t\t\t\treader.onProgressCallback(reader.getBufferProgress(), `reading level [${(j + 1)}/${(levelCount + 1)}] ${levelName}`);\n\t\t\t}\n\n\t\t\t// we will intentionally NOT wait for next pull request, since these few characters don't make waiting useful.\n\t\t\tawait write(`${j > 0 ? ', ' : ''}\"${levelName}\": {\"name\": \"${levelName}\", \"objects\": [`, false);\n\n\n\t\t\t// object headers\n\t\t\tconst headersBinLen = reader.readInt32(); // object headers + destroyed colelctables\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\t\treader.readInt32Zero();\n\t\t\t}\n\n\t\t\tconst posBeforeHeaders = reader.getBufferPosition();\n\t\t\tconst afterAllHeaders = posBeforeHeaders + headersBinLen;\n\t\t\tlet countObjectHeaders = reader.readInt32();\n\n\t\t\tlet totalReadObjectsInLevel = 0;\n\t\t\tlet writtenObjectsInLevel = 0;\n\t\t\tlet afterHeadersOfBatch = reader.getBufferPosition();\t// at first no batch is read.\n\t\t\tlet afterObjectsOfBatch = -1;\n\n\t\t\tdo {\n\n\t\t\t\t// jump to after last read batch\n\t\t\t\treader.skipBytes(afterHeadersOfBatch - reader.getBufferPosition());\n\n\t\t\t\t// read batch\n\t\t\t\tconst objectCountToRead = Math.min(countObjectHeaders - totalReadObjectsInLevel, batchingSizeOfObjects);\n\t\t\t\tconst objects = Level.ReadNObjectHeaders(reader, objectCountToRead);\n\n\t\t\t\tafterHeadersOfBatch = reader.getBufferPosition();\n\n\n\t\t\t\t// after headers, there MAY be destroyed entities. don't have to.\n\t\t\t\t// But either way, we can safely ignore them.\n\t\t\t\tif (countObjectHeaders === totalReadObjectsInLevel + objects.length) {\n\t\t\t\t\tconst bytesLeft = afterAllHeaders - reader.getBufferPosition();\n\t\t\t\t\tif (bytesLeft > 0) {\n\t\t\t\t\t\tif (levelName === reader.context.mapName) {\n\t\t\t\t\t\t\tdestroyedActorsMap = LevelToDestroyedActorsMap.read(reader);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcollectables = ObjectReferencesList.ReadList(reader);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\tif (totalReadObjectsInLevel === 0) {\n\n\t\t\t\t\t// jump to after all headers\n\t\t\t\t\treader.skipBytes(afterAllHeaders - reader.getBufferPosition());\n\n\t\t\t\t\tconst objectContentsBinLen = reader.readInt32();\n\t\t\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\t\t\t\treader.readInt32Zero();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst posBeforeContents = reader.getBufferPosition();\n\t\t\t\t\tconst countEntities = reader.readInt32();\n\t\t\t\t\tafterObjectsOfBatch = reader.getBufferPosition();\t// at first no batch is read.\n\t\t\t\t} else {\n\t\t\t\t\treader.skipBytes(afterObjectsOfBatch - reader.getBufferPosition());\n\t\t\t\t}\n\n\t\t\t\tLevel.ReadNObjectContents(reader, objectCountToRead, objects, 0);\n\t\t\t\tafterObjectsOfBatch = reader.getBufferPosition();\n\n\t\t\t\ttotalReadObjectsInLevel += objectCountToRead;\n\t\t\t\tif (countObjectHeaders > 10000 && totalReadObjectsInLevel % 10000 === 0) {\n\t\t\t\t\treader.onProgressCallback(reader.getBufferProgress(), `read object count [${(totalReadObjectsInLevel + 1)}/${(countObjectHeaders + 1)}] in level ${levelName}`);\n\t\t\t\t}\n\n\t\t\t\t// we should wait even if the objects of many levels accumulate to several hundred.\n\t\t\t\tlet shouldWait = false;\n\t\t\t\tif (writtenTotalObjectsSinceConsumerSync >= thresholdOfWrittenObjectsUntilWaitingForConsumerAgain) {\n\t\t\t\t\t// will wait til consumer catches up. Because we wrote ${writtenTotalObjectsSinceConsumerSync} objects without waiting.\n\t\t\t\t\tshouldWait = true;\n\t\t\t\t\twrittenTotalObjectsSinceConsumerSync = 0;\n\t\t\t\t}\n\t\t\t\tawait write(`${writtenObjectsInLevel > 0 ? ', ' : ''}${objects.map(obj => JSON.stringify(obj)).join(', ')}`, shouldWait);\n\t\t\t\twrittenTotalObjectsSinceConsumerSync += objectCountToRead;\n\t\t\t\twrittenObjectsInLevel += objectCountToRead;\n\n\t\t\t} while (totalReadObjectsInLevel < countObjectHeaders)\n\n\n\t\t\tawait write('], ', false);\n\n\t\t\t// only NOT in the persistent level, we have saveVersion\n\t\t\tif (levelName !== reader.context.mapName) {\n\t\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion) {\n\t\t\t\t\tconst saveCustomVersion = reader.readInt32();\n\t\t\t\t\tawait write(`\"saveCustomVersion\": ${saveCustomVersion}, `, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// only in persistent level, we have LevelToDestroyedActorsMap\n\t\t\tif (levelName === reader.context.mapName) {\n\t\t\t\tdestroyedActorsMap = LevelToDestroyedActorsMap.read(reader);\n\t\t\t\tawait write(`\"destroyedActorsMap\": ${JSON.stringify(destroyedActorsMap)}, `, false);\n\t\t\t}\n\n\t\t\tawait write('\"collectables\": [', false);\n\n\t\t\t// only NOT in the persistent level, we have 2nd collectables.\n\t\t\tif (levelName !== reader.context.mapName) {\n\t\t\t\tcollectables = ObjectReferencesList.ReadList(reader);\n\t\t\t}\n\n\t\t\tawait write(`${collectables.map(obj => JSON.stringify(obj)).join(', ')}`, true);\n\n\t\t\tawait write(']', false);\n\t\t\tawait write('}', false);\n\t\t}\n\t}\n}"]}
|
|
1
|
+
{"version":3,"file":"readable-stream-parser.js","sourceRoot":"","sources":["../../../../src/parser/stream/reworked/readable-stream-parser.ts"],"names":[],"mappings":";;;;AAAA,oCAA8F;AAC9F,2DAAmE;AACnE,yDAAsD;AACtD,yGAAkG;AAClG,2FAAsF;AACtF,iFAA6E;AAC7E,+FAA0F;AAE1F,qFAAgF;AAChF,qEAAiE;AACjE,sFAAmF;AACnF,4FAAyF;AAEzF,MAAM,0BAA0B,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC;AACrD,MAAM,iCAAiC,GAAG,CAAC,gBAAwB,0BAA0B,GAAG,CAAC,EAA2B,EAAE,CAAC,CAAC;IAC/H,aAAa;IACb,IAAI,EAAE,CAAC,KAAyB,EAAE,EAAE;QACnC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO,CAAC,CAAC;QACV,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,CAAC;IACrB,CAAC;CACD,CAAC,CAAC;AAEH,MAAM,yBAAyB;IAA/B;QACC,WAAM,GAAY,KAAK,CAAC;QACxB,iCAA4B,GAAY,KAAK,CAAC;QAC9C,gBAAW,GAA6B,SAAS,CAAC;IAyBnD,CAAC;IApBO,IAAI,CAAC,WAAuB;QAClC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACf,CAAC;IACF,CAAC;IAKM,MAAM;QACZ,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,EAAE,CAA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CAAC,IAAI,CAAC,iCAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YACjE,CAAC;YACD,MAAM,KAAK,CAAC,gCAAgC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACrG,CAAC;QAED,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,KAAK,CAAC,cAAc,IAAI,CAAC,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;QAED,IAAI,OAAO,EAAE,UAAU,KAAK,SAAS,EAAE,CAAC;YACvC,OAAO,CAAC,UAAU,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC;QAC5C,CAAC;QAGD,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACvB,MAAM,EAAE,CAAC;IACV,CAAC,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AACnC,CAAC,AAlG+C,CAkG/C;AAGc,qDAAgC,GAAG,KAAK,EACtD,KAA6E,EAC7E,IAAY,EACZ,eAAqC,EACrC,MAA8B,EAC9B,kBAAsC,EACrC,EAAE;IACH,OAAO,KAAK,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,IAAI,yBAAyB,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AACjN,CAAC,AAR8C,CAQ9C","sourcesContent":["import { QueuingStrategy, ReadableStream, ReadableStreamDefaultController } from \"stream/web\";\nimport { UnsupportedVersionError } from '../../error/parser.error';\nimport { Level } from '../../satisfactory/save/level';\nimport { LevelToDestroyedActorsMap } from '../../satisfactory/save/level-to-destroyed-actors-map';\nimport { ObjectReferencesList } from '../../satisfactory/save/object-references-list';\nimport { SatisfactorySave } from \"../../satisfactory/save/satisfactory-save\";\nimport { SatisfactorySaveHeader } from '../../satisfactory/save/satisfactory-save-header';\nimport { ChunkCompressionInfo } from \"../../satisfactory/save/save-body-chunks\";\nimport { SaveCustomVersion } from '../../satisfactory/save/save-custom-version';\nimport { SaveReader } from '../../satisfactory/save/save-reader';\nimport { ObjectReference } from '../../satisfactory/types/structs/ObjectReference';\nimport { SaveBodyValidation } from \"../../satisfactory/types/structs/SaveBodyValidation\";\n\nconst DEFAULT_BYTE_HIGHWATERMARK = 1024 * 1024 * 200;\t// 200MiB\nconst createStringLengthQueuingStrategy = (highWaterMark: number = DEFAULT_BYTE_HIGHWATERMARK / 4): QueuingStrategy<string> => ({\n\thighWaterMark,\n\tsize: (chunk: string | undefined) => {\n\t\tif (chunk === undefined) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn chunk.length;\n\t}\n});\n\nclass SimpleWaitForConsumerLock {\n\tlocked: boolean = false;\n\tunlockWasCalledInTheMeantime: boolean = false;\n\texecutionFn: (() => void) | undefined = undefined;\n\n\t/** activate lock and set function to execute on unlock.\n\t * If at least 1 unlock was called before this call, immediately unlock.\n\t */\n\tpublic lock(executionFn: () => void) {\n\t\tthis.executionFn = executionFn;\n\t\tthis.locked = true;\n\t\tif (this.unlockWasCalledInTheMeantime) {\n\t\t\tthis.unlock();\n\t\t}\n\t}\n\n\t/**\n\t * unlock and execute stored function if present.\n\t */\n\tpublic unlock() {\n\t\tthis.locked = false;\n\t\tif (this.executionFn) {\n\t\t\tthis.executionFn();\n\t\t\tthis.executionFn = undefined;\n\t\t} else {\n\t\t\tthis.unlockWasCalledInTheMeantime = true;\n\t\t}\n\t}\n};\n\n/**\n * Creates a ReadableStream from Binary file, that actually waits until the reading operator has caught up before it pushes more.\n */\nexport class ReadableStreamParser {\n\n\tprivate static CreateReadableStreamForParsingSave = (\n\t\tonStart: (controller: ReadableStreamDefaultController<string>) => void,\n\t\tonCancel: (reason: any) => void,\n\t\tonPullRequest: (desiredSize: number) => void,\n\t\thighWaterMark = DEFAULT_BYTE_HIGHWATERMARK / 4\n\t) => {\n\t\tlet ourController: ReadableStreamDefaultController<string> | null = null;\n\t\tconst stream = new ReadableStream<string>({\n\t\t\tstart: (controller: ReadableStreamDefaultController<string>) => {\n\t\t\t\tourController = controller;\n\t\t\t\tonStart(ourController);\n\t\t\t},\n\t\t\tpull: (controller: ReadableStreamDefaultController<string>) => {\n\t\t\t\tonPullRequest(ourController!.desiredSize ?? 1);\n\t\t\t},\n\t\t\tcancel: (reason) => {\n\t\t\t\tconsole.warn('parsing stream was canceled!', reason);\n\t\t\t\tif (ourController !== null) {\n\t\t\t\t\tourController.close();\n\t\t\t\t}\n\t\t\t\tonCancel(reason);\n\t\t\t}\n\t\t}, createStringLengthQueuingStrategy(highWaterMark));\n\n\t\t// create handle to close source.\n\t\tconst finish = () => {\n\t\t\tif (ourController !== null) {\n\t\t\t\tourController?.close();\n\t\t\t}\n\t\t}\n\n\t\treturn { stream, controller: ourController!, finish };\n\t};\n\n\t/**\n\t * the more elegant way to parse saves, instead of using the plain ParseSave. Since streaming will not hold the converted JSON in memory at once.\n\t * @param name the save name\n\t * @param bytes the save file as UInt8Array\n\t * @param onDecompressedSaveBody a callback to report back on the decompressed binary save body.\n\t * @param onProgress a callback to report back on the parsing progress. Optionally contains a message.\n\t * @returns a WHATWG compliant readable stream of strings (They are valid JSON and represent a {@link SatisfactorySave} object). And a method to actually start the streaming for more precise control.\n\t */\n\tpublic static CreateReadableStreamFromSaveToJson = (\n\t\tname: string,\n\t\tbytes: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBufferLike) => void,\n\t\t\tonProgress: (progress: number, message?: string) => void\n\t\t}>\n\t): { stream: ReadableStream<string>, startStreaming: () => Promise<void> } => {\n\n\t\t// create a simple lock to sync with consumer of the stream. Aka handle backpressure.\n\t\tconst waitForConsumerLock = new SimpleWaitForConsumerLock();\n\t\tconst waitForConsumer = async () => {\n\t\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\t\twaitForConsumerLock.lock(resolve);\n\t\t\t});\n\t\t}\n\n\t\tconst { stream, controller, finish } = ReadableStreamParser.CreateReadableStreamForParsingSave(\n\t\t\t(controller) => {\n\t\t\t\t//startStreaming();\n\t\t\t},\n\t\t\t(reason) => { },\n\t\t\t(desiredSize) => {\n\t\t\t\t// consumer (to be more correct, the internal buffer!) is ready, unlock syncing lock.\n\t\t\t\twaitForConsumerLock.unlock();\n\t\t\t},\n\t\t);\n\n\t\t/**\n\t\t * pushes a value into the readable stream. Optionally waits for the \"pull\" signal of the stream before writing.\n\t\t * @param value the value to write\n\t\t * @param waitForConsumerToBeReady whether the process should wait until the \"pull\" signal of the stream.\n\t\t */\n\t\tconst write = async (value: string, waitForConsumerToBeReady = true): Promise<void> => {\n\t\t\tif (waitForConsumerToBeReady) {\n\t\t\t\tawait waitForConsumer();\n\t\t\t}\n\t\t\tcontroller.enqueue(value);\n\t\t}\n\n\t\tconst startStreaming = async (): Promise<void> => {\n\n\t\t\tconst reader = new SaveReader(bytes, options?.onProgress);\n\n\t\t\t// read header\n\t\t\tconst header = SatisfactorySaveHeader.Parse(reader);\n\t\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t\t// guard save version\n\t\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion);\n\t\t\tif (roughSaveVersion === '<U6') {\n\t\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t\t}\n\n\t\t\t// inflate chunks\n\t\t\tconst inflateResult = reader.inflateChunks();\n\t\t\tsave.compressionInfo = inflateResult.compressionInfo;\n\n\t\t\t// call callback on decompressed save body\n\t\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t\t}\n\n\t\t\tlet saveBodyValidation = save.saveBodyValidation;\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\t\tsaveBodyValidation = SaveBodyValidation.Parse(reader);\n\t\t\t}\n\n\t\t\tawait ReadableStreamParser.WriteHeaderAndSaveBodyValidation(write, name, inflateResult.compressionInfo, header, saveBodyValidation);\n\n\t\t\t// parse levels\n\t\t\tawait ReadableStreamParser.ReadWriteLevels(write, reader, save.header.mapName, save.header.buildVersion);\n\t\t\tawait write(`}`, false);\n\n\t\t\t// unresolved data\n\t\t\tconst countUnresolvedWorldSaveData = reader.readInt32();\n\t\t\tif (countUnresolvedWorldSaveData) {\n\t\t\t\tsave.unresolvedWorldSaveData = [];\n\t\t\t\tfor (let i = 0; i < countUnresolvedWorldSaveData; i++) {\n\t\t\t\t\tsave.unresolvedWorldSaveData.push(ObjectReference.read(reader));\n\t\t\t\t}\n\t\t\t\tawait write(`, \"unresolvedWorldSaveData\": ${JSON.stringify(save.unresolvedWorldSaveData)} `, false);\n\t\t\t}\n\n\t\t\tif (save.name !== undefined) {\n\t\t\t\tawait write(`, \"name\": \"${save.name}\" `, false);\n\t\t\t}\n\n\t\t\tif (options?.onProgress !== undefined) {\n\t\t\t\toptions.onProgress(1, 'finished parsing.');\n\t\t\t}\n\n\t\t\t// close save object.\n\t\t\tawait write(`}`, true);\n\t\t\tfinish();\n\t\t};\n\n\t\treturn { stream, startStreaming };\n\t}\n\n\n\tprivate static WriteHeaderAndSaveBodyValidation = async (\n\t\twrite: (value: string, waitTilConsumingEndIsReady?: boolean) => Promise<void>,\n\t\tname: string,\n\t\tcompressionInfo: ChunkCompressionInfo,\n\t\theader: SatisfactorySaveHeader,\n\t\tsaveBodyValidation: SaveBodyValidation\n\t) => {\n\t\treturn write(`{\"header\": ${JSON.stringify(header)}, \"name\": \"${name}\", \"compressionInfo\": ${JSON.stringify(compressionInfo)}, \"saveBodyValidation\": ${JSON.stringify(saveBodyValidation)}, \"levels\": {`, false);\n\t}\n\n\tprivate static async ReadWriteLevels(\n\t\twrite: (value: string, waitTilConsumingEndIsReady?: boolean) => Promise<void>,\n\t\treader: SaveReader,\n\t\tmapName: string,\n\t\tbuildVersion: number,\n\t): Promise<void> {\n\n\t\tconst batchingSizeOfObjects = 1000;\n\t\tconst thresholdOfWrittenObjectsUntilWaitingForConsumerAgain = 3 * batchingSizeOfObjects;\n\n\t\tconst levelCount = reader.readInt32();\n\t\treader.onProgressCallback(reader.getBufferProgress(), `reading pack of ${levelCount + 1} levels.`);\n\n\t\tlet writtenTotalObjectsSinceConsumerSync = 0;\n\t\tlet collectables: ObjectReference[] = [];\n\t\tlet destroyedActorsMap: LevelToDestroyedActorsMap = {};\n\t\tfor (let j = 0; j <= levelCount; j++) {\n\t\t\tlet levelName = (j === levelCount) ? '' + mapName : reader.readString();\n\n\t\t\tif (j % 500 === 0) {\n\t\t\t\treader.onProgressCallback(reader.getBufferProgress(), `reading level [${(j + 1)}/${(levelCount + 1)}] ${levelName}`);\n\t\t\t}\n\n\t\t\t// we will intentionally NOT wait for next pull request, since these few characters don't make waiting useful.\n\t\t\tawait write(`${j > 0 ? ', ' : ''}\"${levelName}\": {\"name\": \"${levelName}\", \"objects\": [`, false);\n\n\n\t\t\t// object headers\n\t\t\tconst headersBinLen = reader.readInt32(); // object headers + destroyed colelctables\n\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\t\treader.readInt32Zero();\n\t\t\t}\n\n\t\t\tconst posBeforeHeaders = reader.getBufferPosition();\n\t\t\tconst afterAllHeaders = posBeforeHeaders + headersBinLen;\n\t\t\tlet countObjectHeaders = reader.readInt32();\n\n\t\t\tlet totalReadObjectsInLevel = 0;\n\t\t\tlet writtenObjectsInLevel = 0;\n\t\t\tlet afterHeadersOfBatch = reader.getBufferPosition();\t// at first no batch is read.\n\t\t\tlet afterObjectsOfBatch = -1;\n\n\t\t\tdo {\n\n\t\t\t\t// jump to after last read batch\n\t\t\t\treader.skipBytes(afterHeadersOfBatch - reader.getBufferPosition());\n\n\t\t\t\t// read batch\n\t\t\t\tconst objectCountToRead = Math.min(countObjectHeaders - totalReadObjectsInLevel, batchingSizeOfObjects);\n\t\t\t\tconst objects = Level.ReadNObjectHeaders(reader, objectCountToRead);\n\n\t\t\t\tafterHeadersOfBatch = reader.getBufferPosition();\n\n\n\t\t\t\t// after headers, there MAY be destroyed entities. don't have to.\n\t\t\t\t// But either way, we can safely ignore them.\n\t\t\t\tif (countObjectHeaders === totalReadObjectsInLevel + objects.length) {\n\t\t\t\t\tconst bytesLeft = afterAllHeaders - reader.getBufferPosition();\n\t\t\t\t\tif (bytesLeft > 0) {\n\t\t\t\t\t\tif (levelName === reader.context.mapName) {\n\t\t\t\t\t\t\tdestroyedActorsMap = LevelToDestroyedActorsMap.read(reader);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcollectables = ObjectReferencesList.ReadList(reader);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\tif (totalReadObjectsInLevel === 0) {\n\n\t\t\t\t\t// jump to after all headers\n\t\t\t\t\treader.skipBytes(afterAllHeaders - reader.getBufferPosition());\n\n\t\t\t\t\tconst objectContentsBinLen = reader.readInt32();\n\t\t\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.UnrealEngine5) {\n\t\t\t\t\t\treader.readInt32Zero();\n\t\t\t\t\t}\n\n\t\t\t\t\tconst posBeforeContents = reader.getBufferPosition();\n\t\t\t\t\tconst countEntities = reader.readInt32();\n\t\t\t\t\tafterObjectsOfBatch = reader.getBufferPosition();\t// at first no batch is read.\n\t\t\t\t} else {\n\t\t\t\t\treader.skipBytes(afterObjectsOfBatch - reader.getBufferPosition());\n\t\t\t\t}\n\n\t\t\t\tLevel.ReadNObjectContents(reader, objectCountToRead, objects, 0);\n\t\t\t\tafterObjectsOfBatch = reader.getBufferPosition();\n\n\t\t\t\ttotalReadObjectsInLevel += objectCountToRead;\n\t\t\t\tif (countObjectHeaders > 10000 && totalReadObjectsInLevel % 10000 === 0) {\n\t\t\t\t\treader.onProgressCallback(reader.getBufferProgress(), `read object count [${(totalReadObjectsInLevel + 1)}/${(countObjectHeaders + 1)}] in level ${levelName}`);\n\t\t\t\t}\n\n\t\t\t\t// we should wait even if the objects of many levels accumulate to several hundred.\n\t\t\t\tlet shouldWait = false;\n\t\t\t\tif (writtenTotalObjectsSinceConsumerSync >= thresholdOfWrittenObjectsUntilWaitingForConsumerAgain) {\n\t\t\t\t\t// will wait til consumer catches up. Because we wrote ${writtenTotalObjectsSinceConsumerSync} objects without waiting.\n\t\t\t\t\tshouldWait = true;\n\t\t\t\t\twrittenTotalObjectsSinceConsumerSync = 0;\n\t\t\t\t}\n\t\t\t\tawait write(`${writtenObjectsInLevel > 0 ? ', ' : ''}${objects.map(obj => JSON.stringify(obj)).join(', ')}`, shouldWait);\n\t\t\t\twrittenTotalObjectsSinceConsumerSync += objectCountToRead;\n\t\t\t\twrittenObjectsInLevel += objectCountToRead;\n\n\t\t\t} while (totalReadObjectsInLevel < countObjectHeaders)\n\n\n\t\t\tawait write('], ', false);\n\n\t\t\t// only NOT in the persistent level, we have saveVersion\n\t\t\tif (levelName !== reader.context.mapName) {\n\t\t\t\tif (reader.context.saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion) {\n\t\t\t\t\tconst saveCustomVersion = reader.readInt32();\n\t\t\t\t\tawait write(`\"saveCustomVersion\": ${saveCustomVersion}, `, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// only in persistent level, we have LevelToDestroyedActorsMap\n\t\t\tif (levelName === reader.context.mapName) {\n\t\t\t\tdestroyedActorsMap = LevelToDestroyedActorsMap.read(reader);\n\t\t\t\tawait write(`\"destroyedActorsMap\": ${JSON.stringify(destroyedActorsMap)}, `, false);\n\t\t\t}\n\n\t\t\tawait write('\"collectables\": [', false);\n\n\t\t\t// only NOT in the persistent level, we have 2nd collectables.\n\t\t\tif (levelName !== reader.context.mapName) {\n\t\t\t\tcollectables = ObjectReferencesList.ReadList(reader);\n\t\t\t}\n\n\t\t\tawait write(`${collectables.map(obj => JSON.stringify(obj)).join(', ')}`, true);\n\n\t\t\tawait write(']', false);\n\t\t\tawait write('}', false);\n\t\t}\n\t}\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-stream-json-stringifier.d.ts","sourceRoot":"","sources":["../../../../src/parser/stream/reworked/save-stream-json-stringifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"save-stream-json-stringifier.d.ts","sourceRoot":"","sources":["../../../../src/parser/stream/reworked/save-stream-json-stringifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAO7E,qBAAa,yBAAyB;WACjB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAqC9G"}
|
|
@@ -10,8 +10,7 @@ class SaveStreamJsonStringifier {
|
|
|
10
10
|
if (save.compressionInfo) {
|
|
11
11
|
await writer.writeCompressionInfo(save.compressionInfo);
|
|
12
12
|
}
|
|
13
|
-
await writer.
|
|
14
|
-
await writer.writeGrids(save.grids);
|
|
13
|
+
await writer.writeSaveBodyValidation(save.saveBodyValidation);
|
|
15
14
|
await writer.openLevels();
|
|
16
15
|
const objectBatchSize = 10000;
|
|
17
16
|
for (const level of Object.values(save.levels)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-stream-json-stringifier.js","sourceRoot":"","sources":["../../../../src/parser/stream/reworked/save-stream-json-stringifier.ts"],"names":[],"mappings":";;;AAEA,yEAA8D;
|
|
1
|
+
{"version":3,"file":"save-stream-json-stringifier.js","sourceRoot":"","sources":["../../../../src/parser/stream/reworked/save-stream-json-stringifier.ts"],"names":[],"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AAI,eAAe,EAAE,CAAC;gBAC7D,MAAM,MAAM,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,eAAe,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC1H,CAAC;YAED,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;QACzB,CAAC;QACD,MAAM,MAAM,CAAC,SAAS,EAAE,CAAC;QACzB,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACvB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CAED;AAtCD,8DAsCC","sourcesContent":["import { WritableStream } from \"stream/web\";\nimport { SatisfactorySave } from '../../satisfactory/save/satisfactory-save';\nimport { SaveStreamWriter } from \"./save-stream-writer.class\";\n\n/**\n * @deprecated use ReadableStreamParser instead.\n * simply streams a whole satisfactorySave without backpressure to Json.\n */\nexport class SaveStreamJsonStringifier {\n\tpublic static async StreamStringifySave(save: SatisfactorySave, output: WritableStream<string>): Promise<void> {\n\t\tconst writer = new SaveStreamWriter(output.getWriter());\n\n\t\tawait writer.beginSave();\n\t\tawait writer.writeHeader(save.header);\n\t\tif (save.compressionInfo) {\n\t\t\tawait writer.writeCompressionInfo(save.compressionInfo);\n\t\t}\n\n\t\t// save body validation\n\t\tawait writer.writeSaveBodyValidation(save.saveBodyValidation);\n\n\t\t// stream level objects in batches.\n\t\tawait writer.openLevels();\n\t\tconst objectBatchSize = 10000;\n\t\tfor (const level of Object.values(save.levels)) {\n\t\t\tawait writer.openLevel(level.name);\n\n\t\t\tlet i = 0;\n\t\t\tfor (i; i < level.objects.length; i += objectBatchSize) {\n\t\t\t\tawait writer.writeObjects(...level.objects.slice(i, Math.min(i + objectBatchSize, level.objects.length)));\n\t\t\t}\n\n\t\t\tawait writer.switchInLevelToCollectables();\n\n\t\t\ti = 0;\n\t\t\tfor (i; i < level.collectables.length; i += objectBatchSize) {\n\t\t\t\tawait writer.writeCollectables(...level.collectables.slice(i, Math.min(i + objectBatchSize, level.collectables.length)));\n\t\t\t}\n\n\t\t\tawait writer.endLevel();\n\t\t}\n\t\tawait writer.endLevels();\n\t\tawait writer.endSave();\n\t\tawait writer.close();\n\t}\n\n}"]}
|