@etothepii/satisfactory-file-parser 3.1.1 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish-jsr.yml +1 -2
- package/.github/workflows/tests.yml +1 -1
- package/CHANGELOG.md +14 -0
- package/GUIDE.md +7 -1
- package/README.md +3 -0
- 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/save-reader.d.ts +5 -2
- package/build/parser/satisfactory/save/save-reader.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save-reader.js +24 -14
- package/build/parser/satisfactory/save/save-reader.js.map +1 -1
- package/build/parser/satisfactory/save/save-writer.d.ts +2 -2
- package/build/parser/satisfactory/save/save-writer.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save-writer.js +10 -7
- package/build/parser/satisfactory/save/save-writer.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts +2 -0
- package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/TextProperty.js +9 -1
- package/build/parser/satisfactory/types/property/generic/TextProperty.js.map +1 -1
- package/build/parser/satisfactory/types/structs/GUID.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/GUID.js.map +1 -1
- package/build/parser/satisfactory/types/structs/GUIDInfo.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/GUIDInfo.js.map +1 -1
- package/build/parser/satisfactory/types/structs/MD5Hash.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/MD5Hash.js.map +1 -1
- package/build/parser/satisfactory/types/structs/ObjectReference.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/ObjectReference.js.map +1 -1
- package/build/parser/satisfactory/types/structs/Transform.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/Transform.js.map +1 -1
- package/build/parser/satisfactory/types/structs/col4.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/col4.js.map +1 -1
- package/build/parser/satisfactory/types/structs/vec2.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/vec2.js.map +1 -1
- package/build/parser/satisfactory/types/structs/vec3.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/vec3.js.map +1 -1
- package/build/parser/satisfactory/types/structs/vec4.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/vec4.js.map +1 -1
- package/build/parser/stream/reworked/readable-stream-parser.d.ts.map +1 -1
- package/build/parser/stream/reworked/readable-stream-parser.js +3 -2
- package/build/parser/stream/reworked/readable-stream-parser.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 +2 -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 +2 -1
- package/docs/types/GUIDInfo-1.html +2 -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 +2 -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 +2 -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 +2 -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 +2 -1
- package/docs/types/vec2-1.html +2 -1
- package/docs/types/vec3-1.html +2 -1
- package/docs/types/vec4-1.html +2 -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
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
### [3.1.3] (2025-10-01)
|
|
3
|
+
#### Extending Mod Support
|
|
4
|
+
* Added Support for Mods that have custom levels/maps. Like the Platform Expansion Program
|
|
5
|
+
|
|
6
|
+
### [3.1.2] (2025-08-30)
|
|
7
|
+
#### Extending Mod Support
|
|
8
|
+
* Added Support for Circuitry Mod
|
|
9
|
+
|
|
10
|
+
### [3.1.1] (2025-08-24)
|
|
11
|
+
#### Bugfix for writing Blueprints
|
|
12
|
+
* Fixed a bug where serialized blueprints would have 4 bytes too much and would cause issues when reading again.
|
|
13
|
+
#### Internal Cleanup
|
|
14
|
+
* provided complete enums for custom versions `BlueprintHeaderVersion`, `SaveCustomVersion`, `SaveHeaderType`
|
|
15
|
+
|
|
2
16
|
### [3.0.3] (2025-08-08)
|
|
3
17
|
#### Internal Cleanup
|
|
4
18
|
* Renamed sample test saves to not include whitespaces.
|
package/GUIDE.md
CHANGED
|
@@ -78,4 +78,10 @@ Objects without any special properties, will always have `EmptySpecialProperties
|
|
|
78
78
|
## Collectibles (Slugs, Mercer Spheres, Somersloops, ...)
|
|
79
79
|
Collectibles in Satisfactory are only stored as objects in the save file, once they are visible to you.
|
|
80
80
|
If you collected them, they are instead in the `collectibles` array of a level.
|
|
81
|
-
So therefore you CAN NOT know the total list of collectibles alone from the save file, unless you uncovered everything in your save.
|
|
81
|
+
So therefore you CAN NOT know the total list of collectibles alone from the save file, unless you uncovered everything in your save.
|
|
82
|
+
|
|
83
|
+
## FAQ on Game Object Values
|
|
84
|
+
- `Where do i find buildables?` - They are just an object like every other object. Most objects are in the `Persistent_Level`.
|
|
85
|
+
- `Where does a buildable hold the selected recipe?` - Pretty much every producing buildable has `mCurrentRecipe` as the property name, to hold a reference to the specific recipe that is selected.
|
|
86
|
+
- `Where does a buildable hold power shards?` - In the `mInventoryPotential` property. Which in turn references just an InventoryComponent, you would have to search for it by `instanceName`
|
|
87
|
+
- `Where does a buildable hold somersloops?` - In the `mCurrentProductionBoost` property. Which is a float, representing the amount of somer-slooping the producing building does.
|
package/README.md
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
# Satisfactory File Parser
|
|
2
|
+
|
|
3
|
+
[](https://github.com/etothepii4/satisfactory-file-parser/actions/workflows/tests.yml)
|
|
4
|
+
|
|
2
5
|
This is a TypeScript [github project](https://github.com/etothepii4/satisfactory-file-parser) to parse Satisfactory Saves/Blueprints. Satisfactory is a game released by Coffee Stain Studios.
|
|
3
6
|
The reporitory is written entirely in TypeScript and is bundled on [NPM](https://www.npmjs.com/package/@etothepii/satisfactory-file-parser).
|
|
4
7
|
The examples listed here are Node.js. Should work in browser as well.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAQpE,qBAAa,MAAM;WASJ,SAAS,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,sBAAsB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;QAC1D,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAC5D,CAAC,GACA,gBAAgB;
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAQpE,qBAAa,MAAM;WASJ,SAAS,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,sBAAsB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;QAC1D,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAC5D,CAAC,GACA,gBAAgB;WAuDL,SAAS,CAAC,IAAI,EAAE,gBAAgB,EAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,EACtC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EACpC,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,yBAAyB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;KACzD,CAAC,GACA,YAAY,EAAE;WAsCH,mBAAmB,CAChC,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,EAC9C,eAAe,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,iCAAiC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;KACjE,CAAC,GACA;QACF,oBAAoB,EAAE,YAAY,EAAE,CAAC;QACrC,gBAAgB,EAAE,WAAW,CAAA;KAC7B;WA+Ca,mBAAmB,CAChC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,eAAe,EAC9B,mBAAmB,EAAE,eAAe,EACpC,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,2BAA2B,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAA;KAC9D,CAAC,GACA,SAAS;IAoCZ,OAAc,qBAAqB,QAAS,GAAG,WAAU,MAAM,KAAO,MAAM,CAQjE;CAEX"}
|
package/build/parser/parser.js
CHANGED
|
@@ -27,8 +27,9 @@ class Parser {
|
|
|
27
27
|
options.onDecompressedSaveBody(reader.getBuffer());
|
|
28
28
|
}
|
|
29
29
|
if (reader.context.saveVersion >= save_custom_version_1.SaveCustomVersion.IntroducedWorldPartition) {
|
|
30
|
-
|
|
31
|
-
save.
|
|
30
|
+
const { gridHash, grids } = reader.readSaveBodyValidationAndGrids();
|
|
31
|
+
save.gridHash = gridHash;
|
|
32
|
+
save.grids = grids;
|
|
32
33
|
}
|
|
33
34
|
save.levels = reader.readLevels();
|
|
34
35
|
const countUnresolvedWorldSaveData = reader.readInt32();
|
|
@@ -50,8 +51,7 @@ class Parser {
|
|
|
50
51
|
satisfactory_save_header_1.SatisfactorySaveHeader.Serialize(writer, save.header);
|
|
51
52
|
const posAfterHeader = writer.getBufferPosition();
|
|
52
53
|
if (writer.context.saveVersion >= save_custom_version_1.SaveCustomVersion.IntroducedWorldPartition) {
|
|
53
|
-
save_writer_1.SaveWriter.
|
|
54
|
-
save_writer_1.SaveWriter.WriteGrids(writer, save.grids);
|
|
54
|
+
save_writer_1.SaveWriter.WriteSaveBodyHashAndGrids(writer, save.gridHash, save.grids);
|
|
55
55
|
}
|
|
56
56
|
save_writer_1.SaveWriter.WriteLevels(writer, save);
|
|
57
57
|
if (save.unresolvedWorldSaveData && save.unresolvedWorldSaveData.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAC/D,gFAA4E;AAC5E,gFAA4E;AAC5E,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,2FAAsF;AAEtF,iFAA4E;AAC5E,iEAA6D;AAC7D,iEAA6D;AAC7D,kFAA+E;AAI/E,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAsB,EACtB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,iDAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,gBAAgB,KAAK,KAAK,EA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AAC,GAAG,EAAE,KAAK,EAAE,EAAE;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;SAAM,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { UnsupportedVersionError } from './error/parser.error';\nimport { BlueprintConfig } from './satisfactory/blueprint/blueprint-config';\nimport { BlueprintHeader } from './satisfactory/blueprint/blueprint-header';\nimport { BlueprintConfigReader, BlueprintReader } from \"./satisfactory/blueprint/blueprint-reader\";\nimport { BlueprintConfigWriter, BlueprintWriter } from \"./satisfactory/blueprint/blueprint-writer\";\nimport { Blueprint } from \"./satisfactory/blueprint/blueprint.types\";\nimport { SatisfactorySave } from \"./satisfactory/save/satisfactory-save\";\nimport { SatisfactorySaveHeader } from './satisfactory/save/satisfactory-save-header';\nimport { ChunkSummary } from './satisfactory/save/save-body-chunks';\nimport { SaveCustomVersion } from './satisfactory/save/save-custom-version';\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\nimport { ObjectReference } from './satisfactory/types/structs/ObjectReference';\n\n\n/** @public */\nexport class Parser {\n\n\t/**\n\t * Parses a given binary buffer as {@link SatisfactorySave}\n\t * @param name the save name. It won't be serialized, so it does not matter how you name it.\n\t * @param bytes the actual binary buffer\n\t * @param options provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.\n\t * @returns \n\t */\n\tpublic static ParseSave(\n\t\tname: string,\n\t\tbytes: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBufferLike) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes, options?.onProgressCallback);\n\n\t\tconst header = SatisfactorySaveHeader.Parse(reader);\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = inflateResult.compressionInfo;\n\n\t\t// call callback on decompressed save body\n\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t}\n\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\n\t\t\t// save body validation hash\n\t\t\tsave.gridHash = reader.readSaveBodyHash();\n\n\t\t\t// parse grids\n\t\t\tsave.grids = reader.readGrids();\n\t\t}\n\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\t// unresolved data, probably not even useful.\n\t\tconst countUnresolvedWorldSaveData = reader.readInt32();\n\t\tif (countUnresolvedWorldSaveData) {\n\t\t\tsave.unresolvedWorldSaveData = [];\n\t\t\tfor (let i = 0; i < countUnresolvedWorldSaveData; i++) {\n\t\t\t\tsave.unresolvedWorldSaveData.push(ObjectReference.read(reader));\n\t\t\t}\n\t\t}\n\n\t\treader.onProgressCallback(reader.getBufferProgress(), 'finished parsing.');\n\n\n\t\treturn save;\n\t}\n\n\t/**\n\t * serializes a {@link SatisfactorySave} into binary and reports back on individual callbacks.\n\t * @param save the {@link SatisfactorySave} to serialize into binary.\n\t * @param options provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed.\n\t * onHeader gets called on the binary save header, which is always uncompressed.\n\t * onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.\n\t * @returns a summary of the generated chunks.\n\t */\n\tpublic static WriteSave(save: SatisfactorySave,\n\t\tonHeader: (header: Uint8Array) => void,\n\t\tonChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonBinaryBeforeCompressing: (buffer: ArrayBuffer) => void,\n\t\t}>\n\t): ChunkSummary[] {\n\n\t\tconst writer = new SaveWriter();\n\t\twriter.context.saveHeaderType = save.header.saveHeaderType;\n\t\twriter.context.saveVersion = save.header.saveVersion;\n\t\twriter.context.buildVersion = save.header.buildVersion;\n\t\twriter.context.mapName = save.header.mapName;\n\n\t\tSatisfactorySaveHeader.Serialize(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tSaveWriter.WriteSaveBodyHash(writer, save.gridHash);\n\t\t\tSaveWriter.WriteGrids(writer, save.grids);\n\t\t}\n\n\t\tSaveWriter.WriteLevels(writer, save);\n\n\t\t// unresolved data\n\t\t// TODO: check if we ever encounter it.\n\t\tif (save.unresolvedWorldSaveData && save.unresolvedWorldSaveData.length > 0) {\n\t\t\twriter.writeInt32(save.unresolvedWorldSaveData?.length ?? 0);\n\t\t\tfor (const actor of save.unresolvedWorldSaveData ?? []) {\n\t\t\t\tObjectReference.write(writer, actor);\n\t\t\t}\n\t\t}\n\n\t\twriter.endWriting();\n\t\tconst chunkSummary = writer.generateChunks(save.compressionInfo!, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);\n\t\treturn chunkSummary;\n\t}\n\n\t/**\n\t * Writes a {@link Blueprint} object to binary. And reports back on individual callbacks.\n\t * @param blueprint the blueprint to be written\n\t * @param options onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing.\n\t * onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.\n\t * @returns a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.\n\t */\n\tpublic static WriteBlueprintFiles(\n\t\tblueprint: Blueprint,\n\t\tonMainFileHeader: (header: Uint8Array) => void,\n\t\tonMainFileChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\t}>\n\t): {\n\t\tmainFileChunkSummary: ChunkSummary[],\n\t\tconfigFileBinary: ArrayBuffer\n\t} {\n\n\t\t// write main blueprint file\n\t\tconst blueprintWriter = new BlueprintWriter();\n\t\tblueprintWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintHeader.Serialize(blueprintWriter, blueprint.header);\n\t\tconst saveBodyPos = blueprintWriter.getBufferPosition();\n\t\tBlueprintWriter.SerializeObjects(blueprintWriter, blueprint.objects);\n\t\tblueprintWriter.endWriting();\n\t\tlet binaryChunks: Uint8Array[] = [];\n\t\tlet binaryHeader: Uint8Array;\n\t\tconst mainFileChunkSummary = blueprintWriter.generateChunks(\n\t\t\tblueprint.compressionInfo,\n\t\t\tsaveBodyPos,\n\t\t\t{\n\t\t\t\tonBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),\n\t\t\t\tonHeader: onMainFileHeader,\n\t\t\t\tonChunk: onMainFileChunk\n\t\t\t}\n\t\t);\n\n\t\t// write config as well.\n\t\tconst configWriter = new BlueprintConfigWriter();\n\t\tconfigWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintConfig.Serialize(configWriter, blueprint.config);\n\t\tconst configFileBinary = configWriter.endWriting();\n\n\t\treturn {\n\t\t\tmainFileChunkSummary,\n\t\t\tconfigFileBinary\n\t\t}\n\t}\n\n\t/**\n\t * Parses two buffers (main blueprint file + config file) into a {@link Blueprint object}\n\t * @param name the name of the blueprint, since it is not part of the binary data and has to be passed.\n\t * @param blueprintFile the main blueprint file \".sbp\"\n\t * @param blueprintConfigFile the config blueprint file \".sbpcfg\"\n\t * @param options provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.\n\t * @returns \n\t */\n\tpublic static ParseBlueprintFiles(\n\t\tname: string,\n\t\tblueprintFile: ArrayBufferLike,\n\t\tblueprintConfigFile: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBufferLike) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(blueprintConfigFile);\n\t\tconst config = BlueprintConfig.Parse(blueprintConfigReader);\n\n\t\t// read actual blueprint file. with context from config\n\t\tconst blueprintReader = new BlueprintReader(blueprintFile);\n\t\tblueprintReader.context.blueprintConfigVersion = config.configVersion;\n\t\tconst header = BlueprintHeader.Parse(blueprintReader);\n\t\tconst inflateResult = blueprintReader.inflateChunks();\n\n\t\t// call back on decompressed body.\n\t\tif (options?.onDecompressedBlueprintBody !== undefined) {\n\t\t\toptions.onDecompressedBlueprintBody(inflateResult.inflatedData);\n\t\t}\n\n\t\tconst blueprintObjects = BlueprintReader.ParseObjects(blueprintReader);\n\t\tconst blueprint: Blueprint = {\n\t\t\tname,\n\t\t\tcompressionInfo: blueprintReader.compressionInfo,\n\t\t\theader: header,\n\t\t\tconfig,\n\t\t\tobjects: blueprintObjects\n\t\t};\n\t\treturn blueprint;\n\t}\n\n\t/**\n\t * It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems:\n\t * 1. it cannot stringify bigints. So we help out by converting it into a string.\n\t * 2. It cannot distinguish between 0 and -0. But a float32 is encoded in a uint8Array for 0 to be [0,0,0,0] (0x00000000) and -0 to be [0,0,0,128] (0x00000080) in little endian.\n\t * @param obj basically anything that can be stringified\n\t * @param indent the indentation, just like with the real JSON stringify.\n\t * @returns a string that is safely stringified.\n\t */\n\tpublic static JSONStringifyModified = (obj: any, indent: number = 0): string =>\n\t\tJSON.stringify(obj, (key, value) => {\n\t\t\tif (typeof value === 'bigint') {\n\t\t\t\treturn value.toString();\n\t\t\t} else if (value === 0 && 1 / value < 0) {\t// -0\n\t\t\t\treturn '-0';\n\t\t\t}\n\t\t\treturn value;\n\t\t}, indent)\n\n}"]}
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAC/D,gFAA4E;AAC5E,gFAA4E;AAC5E,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,2FAAsF;AAEtF,iFAA4E;AAC5E,iEAA6D;AAC7D,iEAA6D;AAC7D,kFAA+E;AAI/E,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAsB,EACtB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,iDAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;YAChC,MAAM,IAAI,sCAAuB,CAAC,iGAAiG,CAAC,CAAC;QACtI,CAAC;QAGD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC7C,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;QAGrD,IAAI,OAAO,EAAE,sBAAsB,KAAK,SAAS,EAAE,CAAC;YACnD,OAAO,CAAC,sBAAsB,CAAC,M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CAAC,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { UnsupportedVersionError } from './error/parser.error';\nimport { BlueprintConfig } from './satisfactory/blueprint/blueprint-config';\nimport { BlueprintHeader } from './satisfactory/blueprint/blueprint-header';\nimport { BlueprintConfigReader, BlueprintReader } from \"./satisfactory/blueprint/blueprint-reader\";\nimport { BlueprintConfigWriter, BlueprintWriter } from \"./satisfactory/blueprint/blueprint-writer\";\nimport { Blueprint } from \"./satisfactory/blueprint/blueprint.types\";\nimport { SatisfactorySave } from \"./satisfactory/save/satisfactory-save\";\nimport { SatisfactorySaveHeader } from './satisfactory/save/satisfactory-save-header';\nimport { ChunkSummary } from './satisfactory/save/save-body-chunks';\nimport { SaveCustomVersion } from './satisfactory/save/save-custom-version';\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\nimport { ObjectReference } from './satisfactory/types/structs/ObjectReference';\n\n\n/** @public */\nexport class Parser {\n\n\t/**\n\t * Parses a given binary buffer as {@link SatisfactorySave}\n\t * @param name the save name. It won't be serialized, so it does not matter how you name it.\n\t * @param bytes the actual binary buffer\n\t * @param options provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.\n\t * @returns \n\t */\n\tpublic static ParseSave(\n\t\tname: string,\n\t\tbytes: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBufferLike) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes, options?.onProgressCallback);\n\n\t\tconst header = SatisfactorySaveHeader.Parse(reader);\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = inflateResult.compressionInfo;\n\n\t\t// call callback on decompressed save body\n\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t}\n\n\t\t// world partition\n\t\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tconst {gridHash, grids} = reader.readSaveBodyValidationAndGrids();\n\t\t\tsave.gridHash = gridHash;\n\t\t\tsave.grids = grids;\n\t\t}\n\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\t// unresolved data, probably not even useful.\n\t\tconst countUnresolvedWorldSaveData = reader.readInt32();\n\t\tif (countUnresolvedWorldSaveData) {\n\t\t\tsave.unresolvedWorldSaveData = [];\n\t\t\tfor (let i = 0; i < countUnresolvedWorldSaveData; i++) {\n\t\t\t\tsave.unresolvedWorldSaveData.push(ObjectReference.read(reader));\n\t\t\t}\n\t\t}\n\n\t\treader.onProgressCallback(reader.getBufferProgress(), 'finished parsing.');\n\n\t\treturn save;\n\t}\n\n\t/**\n\t * serializes a {@link SatisfactorySave} into binary and reports back on individual callbacks.\n\t * @param save the {@link SatisfactorySave} to serialize into binary.\n\t * @param options provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed.\n\t * onHeader gets called on the binary save header, which is always uncompressed.\n\t * onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.\n\t * @returns a summary of the generated chunks.\n\t */\n\tpublic static WriteSave(save: SatisfactorySave,\n\t\tonHeader: (header: Uint8Array) => void,\n\t\tonChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonBinaryBeforeCompressing: (buffer: ArrayBuffer) => void,\n\t\t}>\n\t): ChunkSummary[] {\n\n\t\tconst writer = new SaveWriter();\n\t\twriter.context.saveHeaderType = save.header.saveHeaderType;\n\t\twriter.context.saveVersion = save.header.saveVersion;\n\t\twriter.context.buildVersion = save.header.buildVersion;\n\t\twriter.context.mapName = save.header.mapName;\n\n\t\tSatisfactorySaveHeader.Serialize(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tSaveWriter.WriteSaveBodyHashAndGrids(writer, save.gridHash, save.grids);\n\t\t}\n\n\t\tSaveWriter.WriteLevels(writer, save);\n\n\t\t// unresolved data\n\t\t// TODO: check if we ever encounter it.\n\t\tif (save.unresolvedWorldSaveData && save.unresolvedWorldSaveData.length > 0) {\n\t\t\twriter.writeInt32(save.unresolvedWorldSaveData?.length ?? 0);\n\t\t\tfor (const actor of save.unresolvedWorldSaveData ?? []) {\n\t\t\t\tObjectReference.write(writer, actor);\n\t\t\t}\n\t\t}\n\n\t\twriter.endWriting();\n\t\tconst chunkSummary = writer.generateChunks(save.compressionInfo!, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);\n\t\treturn chunkSummary;\n\t}\n\n\t/**\n\t * Writes a {@link Blueprint} object to binary. And reports back on individual callbacks.\n\t * @param blueprint the blueprint to be written\n\t * @param options onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing.\n\t * onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.\n\t * @returns a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.\n\t */\n\tpublic static WriteBlueprintFiles(\n\t\tblueprint: Blueprint,\n\t\tonMainFileHeader: (header: Uint8Array) => void,\n\t\tonMainFileChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\t}>\n\t): {\n\t\tmainFileChunkSummary: ChunkSummary[],\n\t\tconfigFileBinary: ArrayBuffer\n\t} {\n\n\t\t// write main blueprint file\n\t\tconst blueprintWriter = new BlueprintWriter();\n\t\tblueprintWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintHeader.Serialize(blueprintWriter, blueprint.header);\n\t\tconst saveBodyPos = blueprintWriter.getBufferPosition();\n\t\tBlueprintWriter.SerializeObjects(blueprintWriter, blueprint.objects);\n\t\tblueprintWriter.endWriting();\n\t\tlet binaryChunks: Uint8Array[] = [];\n\t\tlet binaryHeader: Uint8Array;\n\t\tconst mainFileChunkSummary = blueprintWriter.generateChunks(\n\t\t\tblueprint.compressionInfo,\n\t\t\tsaveBodyPos,\n\t\t\t{\n\t\t\t\tonBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),\n\t\t\t\tonHeader: onMainFileHeader,\n\t\t\t\tonChunk: onMainFileChunk\n\t\t\t}\n\t\t);\n\n\t\t// write config as well.\n\t\tconst configWriter = new BlueprintConfigWriter();\n\t\tconfigWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintConfig.Serialize(configWriter, blueprint.config);\n\t\tconst configFileBinary = configWriter.endWriting();\n\n\t\treturn {\n\t\t\tmainFileChunkSummary,\n\t\t\tconfigFileBinary\n\t\t}\n\t}\n\n\t/**\n\t * Parses two buffers (main blueprint file + config file) into a {@link Blueprint object}\n\t * @param name the name of the blueprint, since it is not part of the binary data and has to be passed.\n\t * @param blueprintFile the main blueprint file \".sbp\"\n\t * @param blueprintConfigFile the config blueprint file \".sbpcfg\"\n\t * @param options provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.\n\t * @returns \n\t */\n\tpublic static ParseBlueprintFiles(\n\t\tname: string,\n\t\tblueprintFile: ArrayBufferLike,\n\t\tblueprintConfigFile: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBufferLike) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(blueprintConfigFile);\n\t\tconst config = BlueprintConfig.Parse(blueprintConfigReader);\n\n\t\t// read actual blueprint file. with context from config\n\t\tconst blueprintReader = new BlueprintReader(blueprintFile);\n\t\tblueprintReader.context.blueprintConfigVersion = config.configVersion;\n\t\tconst header = BlueprintHeader.Parse(blueprintReader);\n\t\tconst inflateResult = blueprintReader.inflateChunks();\n\n\t\t// call back on decompressed body.\n\t\tif (options?.onDecompressedBlueprintBody !== undefined) {\n\t\t\toptions.onDecompressedBlueprintBody(inflateResult.inflatedData);\n\t\t}\n\n\t\tconst blueprintObjects = BlueprintReader.ParseObjects(blueprintReader);\n\t\tconst blueprint: Blueprint = {\n\t\t\tname,\n\t\t\tcompressionInfo: blueprintReader.compressionInfo,\n\t\t\theader: header,\n\t\t\tconfig,\n\t\t\tobjects: blueprintObjects\n\t\t};\n\t\treturn blueprint;\n\t}\n\n\t/**\n\t * It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems:\n\t * 1. it cannot stringify bigints. So we help out by converting it into a string.\n\t * 2. It cannot distinguish between 0 and -0. But a float32 is encoded in a uint8Array for 0 to be [0,0,0,0] (0x00000000) and -0 to be [0,0,0,128] (0x00000080) in little endian.\n\t * @param obj basically anything that can be stringified\n\t * @param indent the indentation, just like with the real JSON stringify.\n\t * @returns a string that is safely stringified.\n\t */\n\tpublic static JSONStringifyModified = (obj: any, indent: number = 0): string =>\n\t\tJSON.stringify(obj, (key, value) => {\n\t\t\tif (typeof value === 'bigint') {\n\t\t\t\treturn value.toString();\n\t\t\t} else if (value === 0 && 1 / value < 0) {\t// -0\n\t\t\t\treturn '-0';\n\t\t\t}\n\t\t\treturn value;\n\t\t}, indent)\n\n}"]}
|
|
@@ -31,8 +31,11 @@ export declare class SaveReader extends ContextReader {
|
|
|
31
31
|
inflateChunks(): {
|
|
32
32
|
compressionInfo: ChunkCompressionInfo;
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
readSaveBodyValidationAndGrids: () => {
|
|
35
|
+
gridHash: SaveBodyValidation;
|
|
36
|
+
grids: Grids;
|
|
37
|
+
};
|
|
38
|
+
private readGrids;
|
|
36
39
|
readLevels(): {
|
|
37
40
|
[levelName: string]: Level;
|
|
38
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-reader.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-reader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAkB,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAEzD,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;CAClB,CAAA;AAED,MAAM,MAAM,KAAK,GAAG;IACnB,CAAC,UAAU,EAAE,MAAM,GAAG;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE;YACT,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;SACvB,CAAA;KACD,CAAA;CACD,CAAC;AACF,qBAAa,UAAW,SAAQ,aAAa;IAKI,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,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AE,MAAM,GAAG,MAAM,CAAC;SACvB,CAAA;KACD,CAAA;CACD,CAAC;AACF,qBAAa,UAAW,SAAQ,aAAa;IAKI,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI;IAF5G,gBAAuB,WAAW,uBAAuB;gBAE7C,UAAU,EAAE,eAAe,EAAS,kBAAkB,GAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAgB;IAIjH,MAAM,UAAW,GAAG,YAAY,GAAG,KAAG,IAAI,CAI/C;IAEF,OAAc,mBAAmB,gBAAiB,MAAM,KAAG,gBAAgB,CAYzE;IACF,OAAc,yBAAyB,gBAAiB,MAAM,aAA4E;IAC1I,OAAc,uBAAuB,gBAAiB,MAAM,aAA+C;IAC3G,OAAc,uBAAuB,gBAAiB,MAAM,aAAoD;IAChH,OAAc,0BAA0B,gBAAiB,MAAM,aAA6D;IAErH,aAAa,IAAI;QAAE,eAAe,EAAE,oBAAoB,CAAA;KAAE;IAqB1D,8BAA8B,QAAO;QAAE,QAAQ,EAAE,kBAAkB,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAgCxF;IAEF,OAAO,CAAC,SAAS,CAiCf;IAEK,UAAU,IAAI;QAAE,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC;KAAE;CA2BpD"}
|
|
@@ -14,23 +14,33 @@ class SaveReader extends context_reader_1.ContextReader {
|
|
|
14
14
|
this.onProgressCallback = onProgressCallback;
|
|
15
15
|
this.expect = (value, expected) => {
|
|
16
16
|
if (value !== expected) {
|
|
17
|
-
console.warn(`Read a value that's usually ${expected}, but this time ${value}. Meaning unclear. Raise an issue or contact me if you want.`);
|
|
17
|
+
console.warn(`Read a value that's usually '${expected}', but this time '${value}'. Meaning unclear. Especially if you use mods. Raise an issue or contact me if you want.`);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
this.
|
|
20
|
+
this.readSaveBodyValidationAndGrids = () => {
|
|
21
|
+
let gridHash;
|
|
22
|
+
let grids;
|
|
21
23
|
this.expect(this.readInt32(), 0);
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
const version = this.readInt32();
|
|
25
|
+
if (version > 0) {
|
|
26
|
+
this.expect(this.readString(), 'None');
|
|
27
|
+
this.expect(this.readInt32(), 0);
|
|
28
|
+
const hash1 = Array.from(this.readBytes(4));
|
|
29
|
+
this.expect(this.readInt32(), 1);
|
|
30
|
+
this.expect(this.readString(), 'None');
|
|
31
|
+
const hash2 = Array.from(this.readBytes(4));
|
|
32
|
+
gridHash = {
|
|
33
|
+
version,
|
|
34
|
+
hash1,
|
|
35
|
+
hash2
|
|
36
|
+
};
|
|
37
|
+
grids = this.readGrids();
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
gridHash = { version, hash1: [0, 0, 0, 0], hash2: [0, 0, 0, 0] };
|
|
41
|
+
grids = {};
|
|
42
|
+
}
|
|
43
|
+
return { gridHash, grids };
|
|
34
44
|
};
|
|
35
45
|
this.readGrids = () => {
|
|
36
46
|
const grids = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-reader.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-reader.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAkG;AAClG,mCAAgC;AAChC,yDAA0E;AAC1E,+DAA0D;AAI7C,QAAA,sCAAsC,GAAG,EAAE,CAAC;AAmBzD,MAAa,UAAW,SAAQ,8BAAa;IAK5C,YAAY,UAA2B,EAAS,qBAA+D,GAAG,EAAE,GAAG,CAAC;QACvH,KAAK,CAAC,UAAU,EAAE,0BAAS,CAAC,aAAa,CAAC,CAAC;QADI,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AA0B,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,sBAAsB,AAAnF,CAAoF","sourcesContent":["import { Alignment } from '../../byte/alignment.enum';\nimport { ContextReader } from '../../context/context-reader';\nimport { CorruptSaveError, ParserError, UnsupportedVersionError } from '../../error/parser.error';\nimport { Level } from './level';\nimport { ChunkCompressionInfo, SaveBodyChunks } from './save-body-chunks';\nimport { SaveCustomVersion } from './save-custom-version';\nimport { RoughSaveVersion } from './save.types';\n\n\nexport const DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE = 49;\n\nexport type ByteArray4 = [number, number, number, number];\n\nexport type SaveBodyValidation = {\n\tversion: number;\n\thash1: ByteArray4;\n\thash2: ByteArray4;\n}\n\nexport type Grids = {\n\t[parentName: string]: {\n\t\tcellSize: number;\n\t\tgridHash: number;\n\t\tchildren: {\n\t\t\t[name: string]: number;\t// children object contains names and their binary size.\n\t\t}\n\t}\n};\nexport class SaveReader extends ContextReader {\n\n\t// the number of .net ticks at the unix epoch\n\tpublic static readonly EPOCH_TICKS = 621355968000000000n;\n\n\tconstructor(fileBuffer: ArrayBufferLike, public onProgressCallback: (progress: number, msg?: string) => void = () => { }) {\n\t\tsuper(fileBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic expect = (value: any, expected: any): void => {\n\t\tif (value !== expected) {\n\t\t\tconsole.warn(`Read a value that's usually ${expected}, but this time ${value}. Meaning unclear. Raise an issue or contact me if you want.`);\n\t\t}\n\t};\n\n\tpublic static GetRoughSaveVersion = (saveVersion: number): RoughSaveVersion => {\n\t\tif (SaveReader.IsGameVersionAtLeast_U1_1(saveVersion)) {\n\t\t\treturn 'U1.1+';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U1(saveVersion)) {\n\t\t\treturn 'U1.0';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U8(saveVersion)) {\n\t\t\treturn 'U8';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U6_U7(saveVersion)) {\n\t\t\treturn 'U6/U7';\n\t\t} else {\n\t\t\treturn '<U6';\n\t\t}\n\t};\n\tpublic static IsGameVersionAtLeast_U1_1 = (saveVersion: number) => saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion;\n\tpublic static IsGameVersionAtLeast_U1 = (saveVersion: number) => saveVersion >= SaveCustomVersion.Version1;\n\tpublic static IsGameVersionAtLeast_U8 = (saveVersion: number) => saveVersion >= SaveCustomVersion.UnrealEngine5;\t// Could be anywhere from UnrealEngine5 (37) to ResetBrokenBlueprintSplinnes (42)\n\tpublic static IsGameVersionAtLeast_U6_U7 = (saveVersion: number) => saveVersion >= SaveCustomVersion.AddedSublevelStreaming;\n\n\tpublic inflateChunks(): { compressionInfo: ChunkCompressionInfo } {\n\n\t\tconst result = SaveBodyChunks.DecompressChunks(this.fileBuffer.slice(this.currentByte), this.alignment);\n\n\t\t// reset on decompressed data.\n\t\tthis.currentByte = 0;\n\t\tthis.fileBuffer = result.uncompressedData.buffer;\n\t\tthis.maxByte = this.fileBuffer.byteLength;\n\t\tthis.bufferView = new DataView(this.fileBuffer);\n\n\t\tconst totalBodyRestSize = this.readInt32();\n\t\tif (result.uncompressedData.byteLength !== (totalBodyRestSize + (this.context.saveVersion >= SaveCustomVersion.UnrealEngine5 ? 8 : 4))) {\n\t\t\tthrow new CorruptSaveError(`Possibly corrupt. Indicated size of total save body (${totalBodyRestSize + 8}) does not match the uncompressed real size of ${result.uncompressedData.byteLength}.`);\n\t\t}\n\n\t\treturn {\n\t\t\tcompressionInfo: result.compressionInfo\n\t\t};\n\t}\n\n\tpublic readSaveBodyHash = (): SaveBodyValidation => {\n\n\t\tthis.expect(this.readInt32(), 0);\n\n\t\tconst saveBodyValidationVersion = this.readInt32(); // seems constant, always 06 00 00 00\n\n\t\tthis.expect(this.readString(), 'None');\n\t\tthis.expect(this.readInt32(), 0);\n\n\t\tconst hash1 = Array.from(this.readBytes(4)) as ByteArray4; // some weird binary hash - 67 21 E7 F7 / DC 7E 81 48 / 59 E4 1E 1B -- changes not when collecting a slug or dismantling an object. Grids havent changed. So it must depend on grid-related things.\n\n\t\tthis.expect(this.readInt32(), 1);\n\t\tthis.expect(this.readString(), 'None');\n\n\t\t// TODO: check\n\t\tconst hash2 = Array.from(this.readBytes(4)) as ByteArray4; // no idea, changes somehow when level content changes. So we save it for now. -- 8B 08 EB 00\n\n\t\treturn {\n\t\t\tversion: saveBodyValidationVersion,\n\t\t\thash1,\n\t\t\thash2\n\t\t} satisfies SaveBodyValidation;\n\t};\n\n\tpublic readGrids = (): Grids => {\n\t\tconst grids: Grids = {};\n\n\t\tconst readGrid = () => {\n\t\t\tconst gridName = this.readString();\n\t\t\tconst cellSize = this.readInt32();\n\t\t\tconst gridHash = this.readUint32();\n\t\t\tgrids[gridName] = { children: {}, cellSize, gridHash };\n\n\t\t\tconst childrenCount = this.readUint32();\n\t\t\tfor (let i = 0; i < childrenCount; i++) {\n\t\t\t\tconst levelInstanceName = this.readString();\n\t\t\t\tconst cellHash = this.readUint32();\n\t\t\t\tgrids[gridName].children[levelInstanceName] = cellHash;\n\t\t\t}\n\t\t};\n\n\t\t// main grid\n\t\treadGrid();\n\n\t\t// landscape grid\n\t\treadGrid();\n\n\t\t// exploration grid\n\t\treadGrid();\n\n\t\t// foliage grid\n\t\treadGrid();\n\n\t\t// hlod0\n\t\treadGrid();\n\n\t\treturn grids;\n\t};\n\n\tpublic readLevels(): { [levelName: string]: Level; } {\n\n\t\tif (!this.context.saveVersion || !this.context.saveHeaderType) {\n\t\t\tthrow new ParserError('ParserError', 'Header and its context must be set before objects can be read.');\n\t\t}\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(this.context.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\tconst levels: { [levelName: string]: Level; } = {};\n\t\tconst levelCount = this.readInt32();\n\t\tthis.onProgressCallback(this.getBufferProgress(), `reading pack of ${levelCount + 1} levels.`);\n\n\t\tfor (let i = 0; i <= levelCount; i++) {\n\t\t\tlet levelSingleName = i === levelCount ? this.context.mapName! : this.readString();\n\t\t\tif (i % 500 === 0) {\n\t\t\t\tthis.onProgressCallback(this.getBufferProgress(), `reading level [${(i + 1)}/${(levelCount + 1)}] ${levelSingleName}`);\n\t\t\t}\n\n\t\t\tlevels[levelSingleName] = Level.ReadLevel(this, levelSingleName);\n\t\t}\n\n\t\treturn levels;\n\t}\n}\n\n\n"]}
|
|
1
|
+
{"version":3,"file":"save-reader.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-reader.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAkG;AAClG,mCAAgC;AAChC,yDAA0E;AAC1E,+DAA0D;AAI7C,QAAA,sCAAsC,GAAG,EAAE,CAAC;AAmBzD,MAAa,UAAW,SAAQ,8BAAa;IAK5C,YAAY,UAA2B,EAAS,qBAA+D,GAAG,EAAE,GAAG,CAAC;QACvH,KAAK,CAAC,UAAU,EAAE,0BAAS,CAAC,aAAa,CAAC,CAAC;QADI,uBAAkB,GAAlB,kBAAkB,CAAsD;QAIjH,WAAM,GAAG,CAAC,KAAU,EAAE,QAAa,EAAQ,EAAE;YACnD,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACxB,OAAO,CAAC,IAAI,CAAC,gCAAgC,QAAQ,qBAAqB,KAAK,2FAA2F,CAAC,CAAC;YAC7K,CAAC;QACF,CAAC,CAAC;QAyCK,mCAA8B,GAAG,GAAmD,EAAE;YAE5F,IAAI,QAA4B,CAAC;YACjC,IAAI,KAAY,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;YAGjC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YACjC,IAAI,OAAO,GAAG,CAAC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W,IAAI,uCAAiB,CAAC,sBAAsB,AAAnF,CAAoF","sourcesContent":["import { Alignment } from '../../byte/alignment.enum';\nimport { ContextReader } from '../../context/context-reader';\nimport { CorruptSaveError, ParserError, UnsupportedVersionError } from '../../error/parser.error';\nimport { Level } from './level';\nimport { ChunkCompressionInfo, SaveBodyChunks } from './save-body-chunks';\nimport { SaveCustomVersion } from './save-custom-version';\nimport { RoughSaveVersion } from './save.types';\n\n\nexport const DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE = 49;\n\nexport type ByteArray4 = [number, number, number, number];\n\nexport type SaveBodyValidation = {\n\tversion: number;\n\thash1: ByteArray4;\n\thash2: ByteArray4;\n}\n\nexport type Grids = {\n\t[parentName: string]: {\n\t\tcellSize: number;\n\t\tgridHash: number;\n\t\tchildren: {\n\t\t\t[name: string]: number;\t// children object contains names and their binary size.\n\t\t}\n\t}\n};\nexport class SaveReader extends ContextReader {\n\n\t// the number of .net ticks at the unix epoch\n\tpublic static readonly EPOCH_TICKS = 621355968000000000n;\n\n\tconstructor(fileBuffer: ArrayBufferLike, public onProgressCallback: (progress: number, msg?: string) => void = () => { }) {\n\t\tsuper(fileBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic expect = (value: any, expected: any): void => {\n\t\tif (value !== expected) {\n\t\t\tconsole.warn(`Read a value that's usually '${expected}', but this time '${value}'. Meaning unclear. Especially if you use mods. Raise an issue or contact me if you want.`);\n\t\t}\n\t};\n\n\tpublic static GetRoughSaveVersion = (saveVersion: number): RoughSaveVersion => {\n\t\tif (SaveReader.IsGameVersionAtLeast_U1_1(saveVersion)) {\n\t\t\treturn 'U1.1+';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U1(saveVersion)) {\n\t\t\treturn 'U1.0';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U8(saveVersion)) {\n\t\t\treturn 'U8';\n\t\t} else if (SaveReader.IsGameVersionAtLeast_U6_U7(saveVersion)) {\n\t\t\treturn 'U6/U7';\n\t\t} else {\n\t\t\treturn '<U6';\n\t\t}\n\t};\n\tpublic static IsGameVersionAtLeast_U1_1 = (saveVersion: number) => saveVersion >= SaveCustomVersion.SerializePerStreamableLevelTOCVersion;\n\tpublic static IsGameVersionAtLeast_U1 = (saveVersion: number) => saveVersion >= SaveCustomVersion.Version1;\n\tpublic static IsGameVersionAtLeast_U8 = (saveVersion: number) => saveVersion >= SaveCustomVersion.UnrealEngine5;\t// Could be anywhere from UnrealEngine5 (37) to ResetBrokenBlueprintSplinnes (42)\n\tpublic static IsGameVersionAtLeast_U6_U7 = (saveVersion: number) => saveVersion >= SaveCustomVersion.AddedSublevelStreaming;\n\n\tpublic inflateChunks(): { compressionInfo: ChunkCompressionInfo } {\n\n\t\tconst result = SaveBodyChunks.DecompressChunks(this.fileBuffer.slice(this.currentByte), this.alignment);\n\n\t\t// reset on decompressed data.\n\t\tthis.currentByte = 0;\n\t\tthis.fileBuffer = result.uncompressedData.buffer;\n\t\tthis.maxByte = this.fileBuffer.byteLength;\n\t\tthis.bufferView = new DataView(this.fileBuffer);\n\n\t\tconst totalBodyRestSize = this.readInt32();\n\t\tif (result.uncompressedData.byteLength !== (totalBodyRestSize + (this.context.saveVersion >= SaveCustomVersion.UnrealEngine5 ? 8 : 4))) {\n\t\t\tthrow new CorruptSaveError(`Possibly corrupt. Indicated size of total save body (${totalBodyRestSize + 8}) does not match the uncompressed real size of ${result.uncompressedData.byteLength}.`);\n\t\t}\n\n\t\treturn {\n\t\t\tcompressionInfo: result.compressionInfo\n\t\t};\n\t}\n\n\t\n\tpublic readSaveBodyValidationAndGrids = (): { gridHash: SaveBodyValidation; grids: Grids } => {\n\n\t\tlet gridHash: SaveBodyValidation;\n\t\tlet grids: Grids;\n\t\tthis.expect(this.readInt32(), 0);\n\n\t\t// ingame map has version 6, custom maps have version 0 apparently\n\t\tconst version = this.readInt32(); \n\t\tif (version > 0) {\n\n\t\t\tthis.expect(this.readString(), 'None');\n\t\t\tthis.expect(this.readInt32(), 0);\n\n\t\t\tconst hash1 = Array.from(this.readBytes(4)) as ByteArray4; // some weird binary hash - 67 21 E7 F7 / DC 7E 81 48 / 59 E4 1E 1B -- changes not when collecting a slug or dismantling an object. Grids havent changed. So it must depend on grid-related things.\n\n\t\t\tthis.expect(this.readInt32(), 1);\n\t\t\tthis.expect(this.readString(), 'None');\n\n\t\t\tconst hash2 = Array.from(this.readBytes(4)) as ByteArray4; // no idea, changes somehow when level content changes. So we save it for now. -- 8B 08 EB 00\n\n\t\t\tgridHash = {\n\t\t\t\tversion,\n\t\t\t\thash1,\n\t\t\t\thash2\n\t\t\t};\n\t\t\tgrids = this.readGrids();\n\t\t} else {\n\t\t\tgridHash = { version, hash1: [0, 0, 0, 0], hash2: [0, 0, 0, 0] };\n\t\t\tgrids = {};\n\t\t}\n\n\t\treturn { gridHash, grids };\n\t};\n\n\tprivate readGrids = (): Grids => {\n\t\tconst grids: Grids = {};\n\n\t\tconst readGrid = () => {\n\t\t\tconst gridName = this.readString();\n\t\t\tconst cellSize = this.readInt32();\n\t\t\tconst gridHash = this.readUint32();\n\t\t\tgrids[gridName] = { children: {}, cellSize, gridHash };\n\n\t\t\tconst childrenCount = this.readUint32();\n\t\t\tfor (let i = 0; i < childrenCount; i++) {\n\t\t\t\tconst levelInstanceName = this.readString();\n\t\t\t\tconst cellHash = this.readUint32();\n\t\t\t\tgrids[gridName].children[levelInstanceName] = cellHash;\n\t\t\t}\n\t\t};\n\n\t\t// main grid\n\t\treadGrid();\n\n\t\t// landscape grid\n\t\treadGrid();\n\n\t\t// exploration grid\n\t\treadGrid();\n\n\t\t// foliage grid\n\t\treadGrid();\n\n\t\t// hlod0\n\t\treadGrid();\n\n\t\treturn grids;\n\t};\n\n\tpublic readLevels(): { [levelName: string]: Level; } {\n\n\t\tif (!this.context.saveVersion || !this.context.saveHeaderType) {\n\t\t\tthrow new ParserError('ParserError', 'Header and its context must be set before objects can be read.');\n\t\t}\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(this.context.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\tconst levels: { [levelName: string]: Level; } = {};\n\t\tconst levelCount = this.readInt32();\n\t\tthis.onProgressCallback(this.getBufferProgress(), `reading pack of ${levelCount + 1} levels.`);\n\n\t\tfor (let i = 0; i <= levelCount; i++) {\n\t\t\tlet levelSingleName = i === levelCount ? this.context.mapName! : this.readString();\n\t\t\tif (i % 500 === 0) {\n\t\t\t\tthis.onProgressCallback(this.getBufferProgress(), `reading level [${(i + 1)}/${(levelCount + 1)}] ${levelSingleName}`);\n\t\t\t}\n\n\t\t\tlevels[levelSingleName] = Level.ReadLevel(this, levelSingleName);\n\t\t}\n\n\t\treturn levels;\n\t}\n}\n\n\n"]}
|
|
@@ -5,8 +5,8 @@ import { ChunkCompressionInfo, ChunkSummary } from "./save-body-chunks";
|
|
|
5
5
|
import { Grids, SaveBodyValidation } from './save-reader';
|
|
6
6
|
export declare class SaveWriter extends ContextWriter {
|
|
7
7
|
constructor();
|
|
8
|
-
static
|
|
9
|
-
static WriteGrids
|
|
8
|
+
static WriteSaveBodyHashAndGrids: (writer: ContextWriter, saveBodyValidation: SaveBodyValidation, grids: Grids) => void;
|
|
9
|
+
private static WriteGrids;
|
|
10
10
|
static WriteLevels(writer: ContextWriter, save: SatisfactorySave): void;
|
|
11
11
|
static GenerateCompressedChunksFromData(bufferArray: ArrayBuffer, compressionInfo: ChunkCompressionInfo, blueprintOrSave: 'blueprint' | 'save', onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onChunk: (chunk: Uint8Array) => void, alignment?: Alignment): ChunkSummary[];
|
|
12
12
|
generateChunks(compressionInfo: ChunkCompressionInfo, posAfterHeader: number, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-writer.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAkB,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG1D,qBAAa,UAAW,SAAQ,aAAa;;IAM5C,OAAc,
|
|
1
|
+
{"version":3,"file":"save-writer.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAkB,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG1D,qBAAa,UAAW,SAAQ,aAAa;;IAM5C,OAAc,yBAAyB,WAAY,aAAa,sBAAsB,kBAAkB,SAAS,KAAK,KAAG,IAAI,CAc5H;IAED,OAAO,CAAC,MAAM,CAAC,UAAU,CAYvB;WAEY,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI;WAUhE,gCAAgC,CAC7C,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,oBAAoB,EACrC,eAAe,EAAE,WAAW,GAAG,MAAM,EACrC,yBAAyB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,EACxD,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,EACpC,SAAS,GAAE,SAAmC,GAC5C,YAAY,EAAE;IAKV,cAAc,CACpB,eAAe,EAAE,oBAAoB,EACrC,cAAc,EAAE,MAAM,EAEtB,yBAAyB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,EACxD,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,EACtC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAClC,YAAY,EAAE;CAgBjB"}
|
|
@@ -34,15 +34,18 @@ class SaveWriter extends context_writer_1.ContextWriter {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.SaveWriter = SaveWriter;
|
|
37
|
-
SaveWriter.
|
|
37
|
+
SaveWriter.WriteSaveBodyHashAndGrids = (writer, saveBodyValidation, grids) => {
|
|
38
38
|
writer.writeInt32(0);
|
|
39
39
|
writer.writeInt32(saveBodyValidation.version);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
if (saveBodyValidation.version > 0) {
|
|
41
|
+
writer.writeString('None');
|
|
42
|
+
writer.writeInt32(0);
|
|
43
|
+
writer.writeBytesArray(saveBodyValidation.hash1);
|
|
44
|
+
writer.writeInt32(1);
|
|
45
|
+
writer.writeString('None');
|
|
46
|
+
writer.writeBytesArray(saveBodyValidation.hash2);
|
|
47
|
+
SaveWriter.WriteGrids(writer, grids);
|
|
48
|
+
}
|
|
46
49
|
};
|
|
47
50
|
SaveWriter.WriteGrids = (writer, grids) => {
|
|
48
51
|
for (const gridEntry of Object.entries(grids)) {
|
|
@@ -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,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AAqB,EAAE,KAAY,EAAQ,EAAE;IACzE,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE1C,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;QAChE,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3D,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;AACF,CAAC,CAAC","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\";\nimport { Grids, SaveBodyValidation } from './save-reader';\n\n\nexport class SaveWriter extends ContextWriter {\n\n\tconstructor() {\n\t\tsuper(Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic static WriteSaveBodyHashAndGrids = (writer: ContextWriter, saveBodyValidation: SaveBodyValidation, grids: Grids): void => {\n\t\twriter.writeInt32(0);\n\t\twriter.writeInt32(saveBodyValidation.version);\n\n\t\tif (saveBodyValidation.version > 0) {\n\t\t\twriter.writeString('None');\n\t\t\twriter.writeInt32(0);\n\t\t\twriter.writeBytesArray(saveBodyValidation.hash1);\n\t\t\twriter.writeInt32(1);\n\t\t\twriter.writeString('None');\n\t\t\twriter.writeBytesArray(saveBodyValidation.hash2);\n\n\t\t\tSaveWriter.WriteGrids(writer, grids);\n\t\t}\n\t}\n\n\tprivate static WriteGrids = (writer: ContextWriter, grids: Grids): void => {\n\t\tfor (const gridEntry of Object.entries(grids)) {\n\t\t\twriter.writeString(gridEntry[0]);\n\t\t\twriter.writeInt32(gridEntry[1].cellSize);\n\t\t\twriter.writeUint32(gridEntry[1].gridHash);\n\n\t\t\twriter.writeUint32(Object.values(gridEntry[1].children).length);\n\t\t\tfor (const child of Object.entries(gridEntry[1].children)) {\n\t\t\t\twriter.writeString(child[0]);\n\t\t\t\twriter.writeUint32(child[1]);\n\t\t\t}\n\t\t}\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextProperty.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/satisfactory/types/property/generic/TextProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,eAAO,MAAM,cAAc,aAAc,GAAG,KAAG,QAAQ,IAAI,YAA4E,CAAC;AAExI,MAAM,MAAM,YAAY,GAAG,oBAAoB,GAAG;IAC9C,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,yBAAiB,YAAY,CAAC;IAEnB,MAAM,KAAK,WAAY,aAAa,UAAU,MAAM,UAAS,MAAM,KAAO,YAShF,CAAA;IAEM,MAAM,SAAS,WAAY,aAAa,KAAG,
|
|
1
|
+
{"version":3,"file":"TextProperty.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/satisfactory/types/property/generic/TextProperty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aA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|
prop.sourceText = TextProperty.ReadValue(reader);
|
|
51
51
|
prop.transformType = reader.readByte();
|
|
52
52
|
break;
|
|
53
|
+
case 11:
|
|
54
|
+
prop.tableId = reader.readString();
|
|
55
|
+
prop.textKey = reader.readString();
|
|
56
|
+
break;
|
|
53
57
|
case 255:
|
|
54
58
|
prop.hasCultureInvariantString = reader.readInt32() === 1;
|
|
55
59
|
if (prop.hasCultureInvariantString) {
|
|
@@ -57,7 +61,7 @@ var TextProperty;
|
|
|
57
61
|
}
|
|
58
62
|
break;
|
|
59
63
|
default:
|
|
60
|
-
throw new Error('Unimplemented historyType
|
|
64
|
+
throw new Error('Unimplemented TextProperty historyType ' + prop.historyType);
|
|
61
65
|
}
|
|
62
66
|
return prop;
|
|
63
67
|
};
|
|
@@ -98,6 +102,10 @@ var TextProperty;
|
|
|
98
102
|
TextProperty.SerializeValue(writer, value.sourceText);
|
|
99
103
|
writer.writeByte(value.transformType);
|
|
100
104
|
break;
|
|
105
|
+
case 11:
|
|
106
|
+
writer.writeString(value.tableId);
|
|
107
|
+
writer.writeString(value.textKey);
|
|
108
|
+
break;
|
|
101
109
|
case 255:
|
|
102
110
|
writer.writeInt32(value.hasCultureInvariantString ? 1 : 0);
|
|
103
111
|
if (value.hasCultureInvariantString) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextProperty.js","sourceRoot":"","sources":["../../../../../../src/parser/satisfactory/types/property/generic/TextProperty.ts"],"names":[],"mappings":";;;AAEA,qDAAkD;AAClD,iEAA8D;AAEvD,MAAM,cAAc,GAAG,CAAC,QAAa,EAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC;AAA3H,QAAA,cAAc,kBAA6G;AAOxI,IAAiB,YAAY,CA4I5B;AA5ID,WAAiB,YAAY;IAEZ,kBAAK,GAAG,CAAC,MAAqB,EAAE,MAAc,EAAE,QAAgB,CAAC,EA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KAAK,GAAG;gBAGJ,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAE3D,IAAI,KAAK,CAAC,yBAAyB,EAAE,CAAC;oBAClC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,KAAM,CAAC,CAAC;gBACrC,CAAC;gBACD,MAAM;YACV;gBACI,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;QAC3E,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EA5IgB,YAAY,4BAAZ,YAAY,QA4I5B","sourcesContent":["import { ContextReader } from '../../../../context/context-reader';\nimport { ContextWriter } from '../../../../context/context-writer';\nimport { GUIDInfo } from '../../structs/GUIDInfo';\nimport { AbstractBaseProperty } from './AbstractBaseProperty';\n\nexport const isTextProperty = (property: any): property is TextProperty => !Array.isArray(property) && property.type === 'TextProperty';\n\nexport type TextProperty = AbstractBaseProperty & {\n type: 'TextProperty';\n value: TextPropertyValue;\n};\n\nexport namespace TextProperty {\n\n export const Parse = (reader: ContextReader, ueType: string, index: number = 0): TextProperty => {\n const guidInfo = GUIDInfo.read(reader);\n const value = TextProperty.ReadValue(reader);\n\n return {\n ...AbstractBaseProperty.Create({ index, ueType, guidInfo, type: '' }),\n type: 'TextProperty',\n value,\n } satisfies TextProperty;\n }\n\n export const ReadValue = (reader: ContextReader): TextPropertyValue => {\n const prop: TextPropertyValue = {\n flags: reader.readInt32(),\n historyType: reader.readByte()\n };\n\n switch (prop.historyType) {\n // HISTORYTYPE_BASE\n case 0:\n prop.namespace = reader.readString();\n prop.key = reader.readString();\n prop.value = reader.readString();\n break;\n // HISTORYTYPE_NAMEDFORMAT\n case 1:\n // HISTORYTYPE_ARGUMENTFORMAT\n case 3:\n prop.sourceFmt = ReadValue(reader);\n\n const argumentsCount = reader.readInt32();\n prop.arguments = [];\n\n for (let i = 0; i < argumentsCount; i++) {\n let currentArgumentsData: any = {};\n currentArgumentsData.name = reader.readString();\n currentArgumentsData.valueType = reader.readByte();\n\n switch (currentArgumentsData.valueType) {\n case 4:\n currentArgumentsData.argumentValue = ReadValue(reader);\n break;\n default:\n\n throw new Error('Unimplemented FormatArgumentType `' + currentArgumentsData.valueType);\n }\n\n prop.arguments.push(currentArgumentsData);\n }\n break;\n // see https://github.com/EpicGames/UnrealEngine/blob/4.25/Engine/Source/Runtime/Core/Private/Internationalization/TextHistory.cpp#L2268\n // HISTORYTYPE_TRANSFORM\n case 10:\n prop.sourceText = ReadValue(reader);\n prop.transformType = reader.readByte();\n break;\n // HISTORYTYPE_NONE\n case 255:\n // See: https://github.com/EpicGames/UnrealEngine/blob/4.25/Engine/Source/Runtime/Core/Private/Internationalization/Text.cpp#L894\n\n prop.hasCultureInvariantString = reader.readInt32() === 1;\n\n if (prop.hasCultureInvariantString) {\n prop.value = reader.readString();\n }\n break;\n\n default:\n throw new Error('Unimplemented historyType `' + prop.historyType);\n }\n\n return prop;\n }\n\n export const CalcOverhead = (property: TextProperty): number => {\n return 1;\n }\n\n export const Serialize = (writer: ContextWriter, property: TextProperty): void => {\n GUIDInfo.write(writer, property.guidInfo);\n SerializeValue(writer, property.value);\n }\n\n export const SerializeValue = (writer: ContextWriter, value: TextPropertyValue): void => {\n writer.writeInt32(value.flags);\n writer.writeByte(value.historyType);\n\n\n switch (value.historyType) {\n // HISTORYTYPE_BASE\n case 0:\n writer.writeString(value.namespace!);\n writer.writeString(value.key!);\n writer.writeString(value.value!);\n break;\n // HISTORYTYPE_NAMEDFORMAT\n case 1:\n // HISTORYTYPE_ARGUMENTFORMAT\n case 3:\n SerializeValue(writer, value.sourceFmt!);\n\n writer.writeInt32(value.arguments!.length);\n\n for (const arg of value.arguments!) {\n let currentArgumentsData: any = {};\n writer.writeString(arg.name);\n writer.writeByte(arg.valueType);\n\n switch (arg.valueType) {\n case 4:\n SerializeValue(writer, arg.argumentValue!);\n break;\n default:\n\n throw new Error('Unimplemented FormatArgumentType `' + currentArgumentsData.valueType);\n }\n }\n break;\n // see https://github.com/EpicGames/UnrealEngine/blob/4.25/Engine/Source/Runtime/Core/Private/Internationalization/TextHistory.cpp#L2268\n // HISTORYTYPE_TRANSFORM\n case 10:\n SerializeValue(writer, value.sourceText!);\n writer.writeByte(value.transformType!);\n break;\n // HISTORYTYPE_NONE\n case 255:\n // See: https://github.com/EpicGames/UnrealEngine/blob/4.25/Engine/Source/Runtime/Core/Private/Internationalization/Text.cpp#L894\n\n writer.writeInt32(value.hasCultureInvariantString ? 1 : 0);\n\n if (value.hasCultureInvariantString) {\n writer.writeString(value.value!);\n }\n break;\n default:\n throw new Error('Unimplemented historyType `' + value.historyType);\n }\n }\n}\n\nexport type TextPropertyValue = {\n flags: number;\n historyType: number;\n\n // flag 0\n namespace?: string;\n key?: string;\n value?: string;\n\n // flag 1 + 3\n sourceFmt?: TextPropertyValue;\n arguments?: { name: string; valueType: number; argumentValue: TextPropertyValue; }[];\n\n // flag 10\n sourceText?: TextPropertyValue;\n transformType?: number;\n\n // flag 255, reusing value\n hasCultureInvariantString?: boolean;\n};\n\n"]}
|
|
1
|
+
{"version":3,"file":"TextProperty.js","sourceRoot":"","sources":["../../../../../../src/parser/satisfactory/types/property/generic/TextProperty.ts"],"names":[],"mappings":";;;AAEA,qDAAkD;AAClD,iEAA8D;AAEvD,MAAM,cAAc,GAAG,CAAC,QAAa,EAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC;AAA3H,QAAA,cAAc,kBAA6G;AAOxI,IAAiB,YAAY,CAsJ5B;AAtJD,WAAiB,YAAY;IAEZ,kBAAK,GAAG,CAAC,MAAqB,EAAE,MAAc,EAAE,QAAgB,CAAC,EAAgB,EAAE;QAC5F,MAAM,QAAQ,GAAG,mBAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,KAA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AAC,KAAK,CAAC,aAAc,CAAC,CAAC;gBACvC,MAAM;YAEV,KAAK,EAAE;gBACH,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,OAAQ,CAAC,CAAC;gBACnC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,OAAQ,CAAC,CAAC;gBACnC,MAAM;YAEV,KAAK,GAAG;gBAGJ,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAE3D,IAAI,KAAK,CAAC,yBAAyB,EAAE,CAAC;oBAClC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,KAAM,CAAC,CAAC;gBACrC,CAAC;gBACD,MAAM;YACV;gBACI,MAAM,IAAI,KAAK,CAAC,6BAA6B,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;QAC3E,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAtJgB,YAAY,4BAAZ,YAAY,QAsJ5B","sourcesContent":["import { ContextReader } from '../../../../context/context-reader';\nimport { ContextWriter } from '../../../../context/context-writer';\nimport { GUIDInfo } from '../../structs/GUIDInfo';\nimport { AbstractBaseProperty } from './AbstractBaseProperty';\n\nexport const isTextProperty = (property: any): property is TextProperty => !Array.isArray(property) && property.type === 'TextProperty';\n\nexport type TextProperty = AbstractBaseProperty & {\n type: 'TextProperty';\n value: TextPropertyValue;\n};\n\nexport namespace TextProperty {\n\n export const Parse = (reader: ContextReader, ueType: string, index: number = 0): TextProperty => {\n const guidInfo = GUIDInfo.read(reader);\n const value = TextProperty.ReadValue(reader);\n\n return {\n ...AbstractBaseProperty.Create({ index, ueType, guidInfo, type: '' }),\n type: 'TextProperty',\n value,\n } satisfies TextProperty;\n }\n\n export const ReadValue = (reader: ContextReader): TextPropertyValue => {\n const prop: TextPropertyValue = {\n flags: reader.readInt32(),\n historyType: reader.readByte()\n };\n\n switch (prop.historyType) {\n // HISTORYTYPE_BASE\n case 0:\n prop.namespace = reader.readString();\n prop.key = reader.readString();\n prop.value = reader.readString();\n break;\n // HISTORYTYPE_NAMEDFORMAT\n case 1:\n // HISTORYTYPE_ARGUMENTFORMAT\n case 3:\n prop.sourceFmt = ReadValue(reader);\n\n const argumentsCount = reader.readInt32();\n prop.arguments = [];\n\n for (let i = 0; i < argumentsCount; i++) {\n let currentArgumentsData: any = {};\n currentArgumentsData.name = reader.readString();\n currentArgumentsData.valueType = reader.readByte();\n\n switch (currentArgumentsData.valueType) {\n case 4:\n currentArgumentsData.argumentValue = ReadValue(reader);\n break;\n default:\n\n throw new Error('Unimplemented FormatArgumentType `' + currentArgumentsData.valueType);\n }\n\n prop.arguments.push(currentArgumentsData);\n }\n break;\n // see https://github.com/EpicGames/UnrealEngine/blob/4.25/Engine/Source/Runtime/Core/Private/Internationalization/TextHistory.cpp#L2268\n // HISTORYTYPE_TRANSFORM\n case 10:\n prop.sourceText = ReadValue(reader);\n prop.transformType = reader.readByte();\n break;\n // HISTORYTYPE_STRING_TABLE_ENTRY\n case 11:\n prop.tableId = reader.readString();\n prop.textKey = reader.readString();\n break;\n // HISTORYTYPE_NONE\n case 255:\n // See: https://github.com/EpicGames/UnrealEngine/blob/4.25/Engine/Source/Runtime/Core/Private/Internationalization/Text.cpp#L894\n\n prop.hasCultureInvariantString = reader.readInt32() === 1;\n\n if (prop.hasCultureInvariantString) {\n prop.value = reader.readString();\n }\n break;\n\n default:\n throw new Error('Unimplemented TextProperty historyType ' + prop.historyType);\n }\n\n return prop;\n }\n\n export const CalcOverhead = (property: TextProperty): number => {\n return 1;\n }\n\n export const Serialize = (writer: ContextWriter, property: TextProperty): void => {\n GUIDInfo.write(writer, property.guidInfo);\n SerializeValue(writer, property.value);\n }\n\n export const SerializeValue = (writer: ContextWriter, value: TextPropertyValue): void => {\n writer.writeInt32(value.flags);\n writer.writeByte(value.historyType);\n\n\n switch (value.historyType) {\n // HISTORYTYPE_BASE\n case 0:\n writer.writeString(value.namespace!);\n writer.writeString(value.key!);\n writer.writeString(value.value!);\n break;\n // HISTORYTYPE_NAMEDFORMAT\n case 1:\n // HISTORYTYPE_ARGUMENTFORMAT\n case 3:\n SerializeValue(writer, value.sourceFmt!);\n\n writer.writeInt32(value.arguments!.length);\n\n for (const arg of value.arguments!) {\n let currentArgumentsData: any = {};\n writer.writeString(arg.name);\n writer.writeByte(arg.valueType);\n\n switch (arg.valueType) {\n case 4:\n SerializeValue(writer, arg.argumentValue!);\n break;\n default:\n\n throw new Error('Unimplemented FormatArgumentType `' + currentArgumentsData.valueType);\n }\n }\n break;\n // see https://github.com/EpicGames/UnrealEngine/blob/4.25/Engine/Source/Runtime/Core/Private/Internationalization/TextHistory.cpp#L2268\n // HISTORYTYPE_TRANSFORM\n case 10:\n SerializeValue(writer, value.sourceText!);\n writer.writeByte(value.transformType!);\n break;\n // HISTORYTYPE_STRING_TABLE_ENTRY\n case 11:\n writer.writeString(value.tableId!);\n writer.writeString(value.textKey!);\n break;\n // HISTORYTYPE_NONE\n case 255:\n // See: https://github.com/EpicGames/UnrealEngine/blob/4.25/Engine/Source/Runtime/Core/Private/Internationalization/Text.cpp#L894\n\n writer.writeInt32(value.hasCultureInvariantString ? 1 : 0);\n\n if (value.hasCultureInvariantString) {\n writer.writeString(value.value!);\n }\n break;\n default:\n throw new Error('Unimplemented historyType `' + value.historyType);\n }\n }\n}\n\nexport type TextPropertyValue = {\n flags: number;\n historyType: number;\n\n // flag 0\n namespace?: string;\n key?: string;\n value?: string;\n\n // flag 1 + 3\n sourceFmt?: TextPropertyValue;\n arguments?: { name: string; valueType: number; argumentValue: TextPropertyValue; }[];\n\n // flag 10\n sourceText?: TextPropertyValue;\n transformType?: number;\n\n // flag 11\n tableId?: string;\n textKey?: string;\n\n // flag 255, reusing value\n hasCultureInvariantString?: boolean;\n};\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUID.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/GUID.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"GUID.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/GUID.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAKhE,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpD,yBAAiB,IAAI,CAAC;IACX,MAAM,IAAI,WAAY,aAAa,KAAG,IAO5C,CAAA;IAEM,MAAM,KAAK,WAAY,aAAa,QAAQ,IAAI,KAAG,IAKzD,CAAA;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUID.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/GUID.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"GUID.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/GUID.ts"],"names":[],"mappings":";;;AAQA,IAAiB,IAAI,CAgBpB;AAhBD,WAAiB,IAAI;IACJ,SAAI,GAAG,CAAC,MAAqB,EAAQ,EAAE;QAChD,OAAO;YACH,MAAM,CAAC,UAAU,EAAE;YACnB,MAAM,CAAC,UAAU,EAAE;YACnB,MAAM,CAAC,UAAU,EAAE;YACnB,MAAM,CAAC,UAAU,EAAE;SACtB,CAAC;IACN,CAAC,CAAA;IAEY,UAAK,GAAG,CAAC,MAAqB,EAAE,IAAU,EAAQ,EAAE;QAC7D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAA;AACL,CAAC,EAhBgB,IAAI,oBAAJ,IAAI,QAgBpB;AAAA,CAAC","sourcesContent":["import { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\n\n/**\n * UE Guid structure, 4 uints.\n */\nexport type GUID = [number, number, number, number];\n\nexport namespace GUID {\n export const read = (reader: ContextReader): GUID => {\n return [\n reader.readUint32(),\n reader.readUint32(),\n reader.readUint32(),\n reader.readUint32(),\n ];\n }\n\n export const write = (writer: ContextWriter, guid: GUID): void => {\n writer.writeUint32(guid[0]);\n writer.writeUint32(guid[1]);\n writer.writeUint32(guid[2]);\n writer.writeUint32(guid[3]);\n }\n};"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUIDInfo.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/GUIDInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"GUIDInfo.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/GUIDInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAM9B,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC;AAExC,yBAAiB,QAAQ,CAAC;IACf,MAAM,IAAI,WAAY,aAAa,KAAG,QAO5C,CAAA;IAEM,MAAM,KAAK,WAAY,aAAa,QAAQ,QAAQ,KAAG,IAQ7D,CAAA;CACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GUIDInfo.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/GUIDInfo.ts"],"names":[],"mappings":";;;AAEA,iCAA8B;
|
|
1
|
+
{"version":3,"file":"GUIDInfo.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/GUIDInfo.ts"],"names":[],"mappings":";;;AAEA,iCAA8B;AAQ9B,IAAiB,QAAQ,CAmBxB;AAnBD,WAAiB,QAAQ;IACR,aAAI,GAAG,CAAC,MAAqB,EAAY,EAAE;QAEpD,IAAI,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,WAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACJ,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC,CAAA;IAEY,cAAK,GAAG,CAAC,MAAqB,EAAE,IAAc,EAAQ,EAAE;QACjE,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACrB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACpB,OAAO;QACX,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACpB,WAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC7B,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAnBgB,QAAQ,wBAAR,QAAQ,QAmBxB;AAAA,CAAC","sourcesContent":["import { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\nimport { GUID } from './GUID';\n\n\n/**\n * contains a flag whether the Guid is valid, and the Guid itself if valid.\n */\nexport type GUIDInfo = undefined | GUID;\n\nexport namespace GUIDInfo {\n export const read = (reader: ContextReader): GUIDInfo => {\n // means whether it has guid.\n if (reader.readByte() === 1) {\n return GUID.read(reader);\n } else {\n return undefined;\n }\n }\n\n export const write = (writer: ContextWriter, guid: GUIDInfo): void => {\n if (guid === undefined) {\n writer.writeByte(0);\n return;\n } else {\n writer.writeByte(1);\n GUID.write(writer, guid);\n }\n }\n};"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MD5Hash.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/MD5Hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"MD5Hash.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/MD5Hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAKhE,MAAM,MAAM,OAAO,GAAG;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,yBAAiB,OAAO,CAAC;IACd,MAAM,IAAI,WAAY,aAAa,KAAG,OAO5C,CAAC;IAEK,MAAM,KAAK,WAAY,aAAa,WAAW,OAAO,KAAG,IAK/D,CAAC;CACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MD5Hash.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/MD5Hash.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"MD5Hash.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/MD5Hash.ts"],"names":[],"mappings":";;;AAWA,IAAiB,OAAO,CAgBvB;AAhBD,WAAiB,OAAO;IACP,YAAI,GAAG,CAAC,MAAqB,EAAW,EAAE;QACnD,MAAM,OAAO,GAAY,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5C,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC3C,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC,CAAC;IAEW,aAAK,GAAG,CAAC,MAAqB,EAAE,OAAgB,EAAQ,EAAE;QACnE,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,IAAK,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC,CAAC;AACN,CAAC,EAhBgB,OAAO,uBAAP,OAAO,QAgBvB;AAAA,CAAC","sourcesContent":["import { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\n\n/**\n * a UE MD5 hash. consists of 16 bytes and a validity byte.\n */\nexport type MD5Hash = {\n isValid: boolean;\n hash?: number[];\n};\n\nexport namespace MD5Hash {\n export const read = (reader: ContextReader): MD5Hash => {\n const md5Hash: MD5Hash = { isValid: false };\n md5Hash.isValid = reader.readInt32() === 1;\n if (md5Hash.isValid) {\n md5Hash.hash = Array.from(reader.readBytes(16));\n }\n return md5Hash;\n };\n\n export const write = (writer: ContextWriter, md5Hash: MD5Hash): void => {\n writer.writeInt32(md5Hash.isValid ? 1 : 0);\n if (md5Hash.isValid) {\n writer.writeBytesArray(md5Hash.hash!);\n }\n };\n};"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectReference.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/ObjectReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ObjectReference.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/ObjectReference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAMhE,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,yBAAiB,eAAe,CAAC;IACzB,MAAM,IAAI,WAAY,aAAa,KAAG,eAK5C,CAAC;IAEK,MAAM,KAAK,WAAY,aAAa,OAAO,eAAe,KAAG,IAGnE,CAAC;IAEK,MAAM,OAAO,SAAU,eAAe,QAAQ,eAAe,YAAyE,CAAC;CAC9I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectReference.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/ObjectReference.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ObjectReference.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/ObjectReference.ts"],"names":[],"mappings":";;;AAYA,IAAiB,eAAe,CAc/B;AAdD,WAAiB,eAAe;IAClB,oBAAI,GAAG,CAAC,MAAqB,EAAmB,EAAE;QAC9D,OAAO;YACN,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE;YAC9B,QAAQ,EAAE,MAAM,CAAC,UAAU,EAAE;SAC7B,CAAC;IACH,CAAC,CAAC;IAEW,qBAAK,GAAG,CAAC,MAAqB,EAAE,GAAoB,EAAQ,EAAE;QAC1E,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAClC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC,CAAC;IAEW,uBAAO,GAAG,CAAC,IAAqB,EAAE,IAAqB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,CAAC;AAC/I,CAAC,EAdgB,eAAe,+BAAf,eAAe,QAc/B;AAAA,CAAC","sourcesContent":["import { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\n\n\n/**\n * Reference to an object in saves/blueprints.\n */\nexport type ObjectReference = {\n\tlevelName: string;\n\tpathName: string;\n};\n\nexport namespace ObjectReference {\n\texport const read = (reader: ContextReader): ObjectReference => {\n\t\treturn {\n\t\t\tlevelName: reader.readString(),\n\t\t\tpathName: reader.readString()\n\t\t};\n\t};\n\n\texport const write = (writer: ContextWriter, ref: ObjectReference): void => {\n\t\twriter.writeString(ref.levelName);\n\t\twriter.writeString(ref.pathName);\n\t};\n\n\texport const IsEqual = (ref1: ObjectReference, ref2: ObjectReference) => ref1.levelName === ref2.levelName && ref1.pathName === ref2.pathName;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/Transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Transform.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/Transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAK9B,MAAM,MAAM,SAAS,GAAG;IACpB,QAAQ,EAAE,IAAI,CAAC;IACf,WAAW,EAAE,IAAI,CAAC;IAClB,OAAO,EAAE,IAAI,CAAC;CACjB,CAAC;AAKF,yBAAiB,SAAS,CAAC;IAChB,MAAM,MAAM,WAAY,aAAa,KAAG,SAM9C,CAAC;IAEK,MAAM,KAAK,WAAY,aAAa,KAAG,SAM7C,CAAC;IAEK,MAAM,SAAS,WAAY,aAAa,aAAa,SAAS,KAAG,IAIvE,CAAC;IAEK,MAAM,UAAU,WAAY,aAAa,aAAa,SAAS,KAAG,IAIxE,CAAC;CACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/Transform.ts"],"names":[],"mappings":";;;AAEA,iCAA8B;AAC9B,iCAA8B;
|
|
1
|
+
{"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/structs/Transform.ts"],"names":[],"mappings":";;;AAEA,iCAA8B;AAC9B,iCAA8B;AAc9B,IAAiB,SAAS,CA4BzB;AA5BD,WAAiB,SAAS;IACT,gBAAM,GAAG,CAAC,MAAqB,EAAa,EAAE;QACvD,OAAO;YACH,QAAQ,EAAE,WAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YAC7B,WAAW,EAAE,WAAI,CAAC,MAAM,CAAC,MAAM,CAAC;YAChC,OAAO,EAAE,WAAI,CAAC,MAAM,CAAC,MAAM,CAAC;SAC/B,CAAC;IACN,CAAC,CAAC;IAEW,eAAK,GAAG,CAAC,MAAqB,EAAa,EAAE;QACtD,OAAO;YACH,QAAQ,EAAE,WAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YAC5B,WAAW,EAAE,WAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YAC/B,OAAO,EAAE,WAAI,CAAC,KAAK,CAAC,MAAM,CAAC;SAC9B,CAAC;IACN,CAAC,CAAC;IAEW,mBAAS,GAAG,CAAC,MAAqB,EAAE,SAAoB,EAAQ,EAAE;QAC3E,WAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC3C,WAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;QAC9C,WAAI,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC,CAAC;IAEW,oBAAU,GAAG,CAAC,MAAqB,EAAE,SAAoB,EAAQ,EAAE;QAC5E,WAAI,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC5C,WAAI,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;QAC/C,WAAI,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC,CAAC;AACN,CAAC,EA5BgB,SAAS,yBAAT,SAAS,QA4BzB","sourcesContent":["import { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\nimport { vec3 } from './vec3';\nimport { vec4 } from './vec4';\n\n/**\n * An object's transform in saves/blueprints.\n */\nexport type Transform = {\n rotation: vec4;\n translation: vec3;\n scale3d: vec3;\n};\n\n/**\n * An object's transform in saves/blueprints.\n */\nexport namespace Transform {\n export const ParseF = (reader: ContextReader): Transform => {\n return {\n rotation: vec4.ParseF(reader),\n translation: vec3.ParseF(reader),\n scale3d: vec3.ParseF(reader),\n };\n };\n\n export const Parse = (reader: ContextReader): Transform => {\n return {\n rotation: vec4.Parse(reader),\n translation: vec3.Parse(reader),\n scale3d: vec3.Parse(reader),\n };\n };\n\n export const Serialize = (writer: ContextWriter, transform: Transform): void => {\n vec4.Serialize(writer, transform.rotation);\n vec3.Serialize(writer, transform.translation);\n vec3.Serialize(writer, transform.scale3d);\n };\n\n export const SerializeF = (writer: ContextWriter, transform: Transform): void => {\n vec4.SerializeF(writer, transform.rotation);\n vec3.SerializeF(writer, transform.translation);\n vec3.SerializeF(writer, transform.scale3d);\n };\n}\n"]}
|