@etothepii/satisfactory-file-parser 2.1.2 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +125 -99
- package/LICENCE.md +1 -1
- package/README.md +36 -18
- package/build/index.d.ts +12 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +13 -3
- package/build/index.js.map +1 -1
- package/build/parser/byte/byte-reader.class.d.ts +7 -5
- package/build/parser/byte/byte-reader.class.d.ts.map +1 -1
- package/build/parser/byte/byte-reader.class.js +6 -4
- package/build/parser/byte/byte-reader.class.js.map +1 -1
- package/build/parser/byte/byte-writer.class.d.ts +1 -0
- package/build/parser/byte/byte-writer.class.d.ts.map +1 -1
- package/build/parser/byte/byte-writer.class.js +3 -0
- package/build/parser/byte/byte-writer.class.js.map +1 -1
- package/build/parser/context/context-reader.d.ts +6 -0
- package/build/parser/context/context-reader.d.ts.map +1 -0
- package/build/parser/context/context-reader.js +13 -0
- package/build/parser/context/context-reader.js.map +1 -0
- package/build/parser/context/context-writer.d.ts +6 -0
- package/build/parser/context/context-writer.d.ts.map +1 -0
- package/build/parser/context/context-writer.js +13 -0
- package/build/parser/context/context-writer.js.map +1 -0
- package/build/parser/context/context.d.ts +16 -0
- package/build/parser/context/context.d.ts.map +1 -0
- package/build/parser/context/context.js +3 -0
- package/build/parser/context/context.js.map +1 -0
- package/build/parser/error/parser.error.d.ts +3 -0
- package/build/parser/error/parser.error.d.ts.map +1 -1
- package/build/parser/error/parser.error.js +7 -1
- package/build/parser/error/parser.error.js.map +1 -1
- package/build/parser/parser.d.ts +5 -5
- package/build/parser/parser.d.ts.map +1 -1
- package/build/parser/parser.js +48 -22
- package/build/parser/parser.js.map +1 -1
- package/build/parser/satisfactory/blueprint/blueprint-config-version.d.ts +10 -0
- package/build/parser/satisfactory/blueprint/blueprint-config-version.d.ts.map +1 -0
- package/build/parser/satisfactory/blueprint/blueprint-config-version.js +14 -0
- package/build/parser/satisfactory/blueprint/blueprint-config-version.js.map +1 -0
- package/build/parser/satisfactory/blueprint/blueprint-config.d.ts +21 -0
- package/build/parser/satisfactory/blueprint/blueprint-config.d.ts.map +1 -0
- package/build/parser/satisfactory/blueprint/blueprint-config.js +56 -0
- package/build/parser/satisfactory/blueprint/blueprint-config.js.map +1 -0
- package/build/parser/satisfactory/blueprint/blueprint-header.d.ts +24 -0
- package/build/parser/satisfactory/blueprint/blueprint-header.d.ts.map +1 -0
- package/build/parser/satisfactory/blueprint/blueprint-header.js +61 -0
- package/build/parser/satisfactory/blueprint/blueprint-header.js.map +1 -0
- package/build/parser/satisfactory/blueprint/blueprint-reader.d.ts +11 -14
- package/build/parser/satisfactory/blueprint/blueprint-reader.d.ts.map +1 -1
- package/build/parser/satisfactory/blueprint/blueprint-reader.js +15 -99
- package/build/parser/satisfactory/blueprint/blueprint-reader.js.map +1 -1
- package/build/parser/satisfactory/blueprint/blueprint-writer.d.ts +6 -9
- package/build/parser/satisfactory/blueprint/blueprint-writer.d.ts.map +1 -1
- package/build/parser/satisfactory/blueprint/blueprint-writer.js +7 -39
- package/build/parser/satisfactory/blueprint/blueprint-writer.js.map +1 -1
- package/build/parser/satisfactory/blueprint/blueprint.types.d.ts +3 -16
- package/build/parser/satisfactory/blueprint/blueprint.types.d.ts.map +1 -1
- package/build/parser/satisfactory/blueprint/blueprint.types.js.map +1 -1
- package/build/parser/satisfactory/edit/edit-constants.d.ts +18 -0
- package/build/parser/satisfactory/edit/edit-constants.d.ts.map +1 -1
- package/build/parser/satisfactory/edit/edit-constants.js +18 -0
- package/build/parser/satisfactory/edit/edit-constants.js.map +1 -1
- package/build/parser/satisfactory/save/factory-game-custom-version.d.ts +34 -0
- package/build/parser/satisfactory/save/factory-game-custom-version.d.ts.map +1 -0
- package/build/parser/satisfactory/save/factory-game-custom-version.js +39 -0
- package/build/parser/satisfactory/save/factory-game-custom-version.js.map +1 -0
- package/build/parser/satisfactory/save/level.class.d.ts +17 -10
- package/build/parser/satisfactory/save/level.class.d.ts.map +1 -1
- package/build/parser/satisfactory/save/level.class.js +77 -21
- package/build/parser/satisfactory/save/level.class.js.map +1 -1
- package/build/parser/satisfactory/save/object-references-list.d.ts +4 -4
- package/build/parser/satisfactory/save/object-references-list.d.ts.map +1 -1
- package/build/parser/satisfactory/save/object-references-list.js.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save-header.d.ts +29 -0
- package/build/parser/satisfactory/save/satisfactory-save-header.d.ts.map +1 -0
- package/build/parser/satisfactory/save/satisfactory-save-header.js +111 -0
- package/build/parser/satisfactory/save/satisfactory-save-header.js.map +1 -0
- package/build/parser/satisfactory/save/satisfactory-save.d.ts +6 -4
- package/build/parser/satisfactory/save/satisfactory-save.d.ts.map +1 -1
- package/build/parser/satisfactory/save/satisfactory-save.js +4 -1
- package/build/parser/satisfactory/save/satisfactory-save.js.map +1 -1
- package/build/parser/satisfactory/save/save-body-chunks.d.ts +25 -0
- package/build/parser/satisfactory/save/save-body-chunks.d.ts.map +1 -0
- package/build/parser/satisfactory/save/save-body-chunks.js +118 -0
- package/build/parser/satisfactory/save/save-body-chunks.js.map +1 -0
- package/build/parser/satisfactory/save/save-custom-version.d.ts +57 -0
- package/build/parser/satisfactory/save/save-custom-version.d.ts.map +1 -0
- package/build/parser/satisfactory/save/save-custom-version.js +62 -0
- package/build/parser/satisfactory/save/save-custom-version.js.map +1 -0
- package/build/parser/satisfactory/save/save-header-type.d.ts +18 -0
- package/build/parser/satisfactory/save/save-header-type.d.ts.map +1 -0
- package/build/parser/satisfactory/save/save-header-type.js +22 -0
- package/build/parser/satisfactory/save/save-header-type.js.map +1 -0
- package/build/parser/satisfactory/save/save-reader.d.ts +14 -12
- package/build/parser/satisfactory/save/save-reader.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save-reader.js +32 -134
- package/build/parser/satisfactory/save/save-reader.js.map +1 -1
- package/build/parser/satisfactory/save/save-writer.d.ts +7 -9
- package/build/parser/satisfactory/save/save-writer.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save-writer.js +8 -95
- package/build/parser/satisfactory/save/save-writer.js.map +1 -1
- package/build/parser/satisfactory/save/save.types.d.ts +5 -25
- package/build/parser/satisfactory/save/save.types.d.ts.map +1 -1
- package/build/parser/satisfactory/save/save.types.js.map +1 -1
- package/build/parser/satisfactory/types/objects/SaveComponent.d.ts +6 -5
- package/build/parser/satisfactory/types/objects/SaveComponent.d.ts.map +1 -1
- package/build/parser/satisfactory/types/objects/SaveComponent.js +2 -2
- package/build/parser/satisfactory/types/objects/SaveComponent.js.map +1 -1
- package/build/parser/satisfactory/types/objects/SaveEntity.d.ts +7 -8
- package/build/parser/satisfactory/types/objects/SaveEntity.d.ts.map +1 -1
- package/build/parser/satisfactory/types/objects/SaveEntity.js +7 -10
- package/build/parser/satisfactory/types/objects/SaveEntity.js.map +1 -1
- package/build/parser/satisfactory/types/objects/SaveObject.d.ts +11 -9
- package/build/parser/satisfactory/types/objects/SaveObject.d.ts.map +1 -1
- package/build/parser/satisfactory/types/objects/SaveObject.js +17 -9
- package/build/parser/satisfactory/types/objects/SaveObject.js.map +1 -1
- package/build/parser/satisfactory/types/property/PropertiesList.d.ts +6 -6
- package/build/parser/satisfactory/types/property/PropertiesList.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/PropertiesList.js +7 -7
- package/build/parser/satisfactory/types/property/PropertiesList.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/BoolProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/BoolProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/BoolProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ByteProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/ByteProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ByteProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/DoubleProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/DoubleProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/DoubleProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/EnumProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/EnumProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/EnumProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/FloatProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/FloatProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/FloatProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Int32Property.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/Int32Property.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Int32Property.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Int64Property.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/Int64Property.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Int64Property.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Int8Property.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/Int8Property.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Int8Property.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.js +5 -5
- package/build/parser/satisfactory/types/property/generic/MapProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ObjectProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/ObjectProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/ObjectProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.js +4 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/StrSetProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/SetProperty/StrSetProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/StrSetProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.js +1 -2
- package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty.d.ts +4 -4
- package/build/parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/StrProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/StrProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/StrProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts +11 -15
- package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/StructProperty.js +29 -33
- package/build/parser/satisfactory/types/property/generic/StructProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/TextProperty.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Uint32Property.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/Uint32Property.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Uint32Property.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Uint64Property.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/Uint64Property.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Uint64Property.js.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Uint8Property.d.ts +6 -6
- package/build/parser/satisfactory/types/property/generic/Uint8Property.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/generic/Uint8Property.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.d.ts +25 -5
- package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.js +70 -44
- package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.js +2 -2
- package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/EmptySpecialProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/EmptySpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/EmptySpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.js +12 -3
- package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.js +4 -4
- package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/SpecialProperties.d.ts +4 -4
- package/build/parser/satisfactory/types/property/special/SpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/SpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.d.ts +6 -9
- package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.d.ts.map +1 -1
- package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.js +3 -8
- package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.js.map +1 -1
- package/build/parser/satisfactory/types/property/special/runtime-buildable-instance-data-version.d.ts +8 -0
- package/build/parser/satisfactory/types/property/special/runtime-buildable-instance-data-version.d.ts.map +1 -0
- package/build/parser/satisfactory/types/property/special/runtime-buildable-instance-data-version.js +12 -0
- package/build/parser/satisfactory/types/property/special/runtime-buildable-instance-data-version.js.map +1 -0
- package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.d.ts +4 -4
- package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.js +4 -4
- package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.js.map +1 -1
- package/build/parser/satisfactory/types/structs/FGDynamicStruct.d.ts +14 -0
- package/build/parser/satisfactory/types/structs/FGDynamicStruct.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/FGDynamicStruct.js +34 -0
- package/build/parser/satisfactory/types/structs/FGDynamicStruct.js.map +1 -0
- package/build/parser/satisfactory/types/structs/GUID.d.ts +4 -4
- 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 +4 -4
- 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 +4 -4
- 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 +5 -4
- package/build/parser/satisfactory/types/structs/ObjectReference.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/ObjectReference.js +1 -0
- package/build/parser/satisfactory/types/structs/ObjectReference.js.map +1 -1
- package/build/parser/satisfactory/types/structs/SoftObjectReference.d.ts +4 -4
- package/build/parser/satisfactory/types/structs/SoftObjectReference.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/SoftObjectReference.js.map +1 -1
- package/build/parser/satisfactory/types/structs/Transform.d.ts +6 -6
- 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/VehiclePhysicsData.d.ts +17 -0
- package/build/parser/satisfactory/types/structs/VehiclePhysicsData.d.ts.map +1 -0
- package/build/parser/satisfactory/types/structs/VehiclePhysicsData.js +26 -0
- package/build/parser/satisfactory/types/structs/VehiclePhysicsData.js.map +1 -0
- package/build/parser/satisfactory/types/structs/col4.d.ts +6 -6
- 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/mods/FicsItCam/FICFrameRange.d.ts +4 -4
- package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.d.ts.map +1 -1
- package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.js.map +1 -1
- package/build/parser/satisfactory/types/structs/vec2.d.ts +6 -6
- 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 +8 -8
- 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 +6 -6
- 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 +2 -2
- package/build/parser/stream/reworked/readable-stream-parser.d.ts.map +1 -1
- package/build/parser/stream/reworked/readable-stream-parser.js +62 -20
- package/build/parser/stream/reworked/readable-stream-parser.js.map +1 -1
- package/build/parser/stream/reworked/save-stream-json-stringifier.js +1 -1
- package/build/parser/stream/reworked/save-stream-json-stringifier.js.map +1 -1
- package/build/parser/stream/reworked/save-stream-writer.class.d.ts +2 -2
- package/build/parser/stream/reworked/save-stream-writer.class.d.ts.map +1 -1
- package/build/parser/stream/reworked/save-stream-writer.class.js.map +1 -1
- package/docs/assets/highlight.css +4 -4
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/BlueprintConfigReader.html +7 -6
- package/docs/classes/BlueprintConfigWriter.html +6 -4
- package/docs/classes/BlueprintReader.html +7 -5
- package/docs/classes/BlueprintWriter.html +6 -4
- package/docs/classes/CompressionLibraryError.html +2 -2
- package/docs/classes/CorruptBlueprintError.html +11 -0
- package/docs/classes/CorruptSaveError.html +2 -2
- package/docs/classes/Parser.html +13 -13
- package/docs/classes/ParserError.html +2 -2
- package/docs/classes/ReadableStreamParser.html +4 -4
- package/docs/classes/SatisfactorySave.html +3 -2
- package/docs/classes/SaveComponent.html +6 -5
- package/docs/classes/SaveEntity.html +6 -6
- package/docs/classes/SaveObject.html +6 -5
- package/docs/classes/SaveReader.html +11 -7
- package/docs/classes/SaveStreamJsonStringifier.html +2 -2
- package/docs/classes/SaveStreamWriter.html +2 -2
- package/docs/classes/SaveWriter.html +6 -4
- package/docs/classes/TimeoutError.html +2 -2
- package/docs/classes/UnimplementedError.html +2 -2
- package/docs/classes/UnsupportedVersionError.html +2 -2
- package/docs/enums/BlueprintConfigVersion.html +9 -0
- package/docs/enums/CompressionAlgorithmCode.html +2 -0
- package/docs/enums/FactoryGameCustomVersion.html +33 -0
- package/docs/enums/RuntimeBuildableInstanceDataVersion.html +7 -0
- package/docs/enums/SaveCustomVersion.html +64 -0
- package/docs/enums/SaveHeaderType.html +17 -0
- 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 -0
- package/docs/functions/BlueprintConfig.Serialize.html +1 -0
- package/docs/functions/BlueprintHeader.Parse.html +1 -0
- package/docs/functions/BlueprintHeader.Serialize.html +1 -0
- 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 -0
- package/docs/functions/BuildableTypeInstance.Serialize.html +1 -0
- 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 -0
- package/docs/functions/FGDynamicStruct.Serialize.html +1 -0
- 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/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 -0
- 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 -0
- package/docs/functions/SatisfactorySaveHeader.Serialize.html +1 -0
- package/docs/functions/SaveBodyChunks.CompressDataIntoChunks.html +1 -0
- package/docs/functions/SaveBodyChunks.DecompressChunks.html +1 -0
- package/docs/functions/SetProperty.CalcOverhead.html +1 -1
- package/docs/functions/SetProperty.Parse.html +1 -1
- package/docs/functions/SetProperty.Serialize.html +1 -1
- package/docs/functions/SoftObjectArrayProperty.Parse.html +1 -1
- package/docs/functions/SoftObjectArrayProperty.Serialize.html +1 -1
- package/docs/functions/SoftObjectReference.read.html +1 -1
- package/docs/functions/SoftObjectReference.write.html +1 -1
- package/docs/functions/SpecialDroneActionProperties.Parse.html +1 -1
- package/docs/functions/SpecialDroneActionProperties.Serialize.html +1 -1
- package/docs/functions/SpecialProperties.ParseClassSpecificSpecialProperties.html +1 -1
- package/docs/functions/SpecialProperties.SerializeClassSpecificSpecialProperties.html +1 -1
- package/docs/functions/StrArrayProperty.Parse.html +1 -1
- package/docs/functions/StrArrayProperty.Serialize.html +1 -1
- package/docs/functions/StrProperty.CalcOverhead.html +1 -1
- package/docs/functions/StrProperty.Parse.html +1 -1
- package/docs/functions/StrProperty.ReadValue.html +1 -1
- package/docs/functions/StrProperty.Serialize.html +1 -1
- package/docs/functions/StrProperty.SerializeValue.html +1 -1
- package/docs/functions/StrSetProperty.Parse.html +1 -1
- package/docs/functions/StrSetProperty.Serialize.html +1 -1
- package/docs/functions/StructArrayProperty.Parse.html +1 -1
- package/docs/functions/StructArrayProperty.Serialize.html +1 -1
- package/docs/functions/StructProperty.CalcOverhead.html +1 -1
- package/docs/functions/StructProperty.Parse.html +1 -1
- package/docs/functions/StructProperty.ParseValue.html +1 -1
- package/docs/functions/StructProperty.Serialize.html +1 -1
- package/docs/functions/StructProperty.SerializeValue.html +1 -1
- package/docs/functions/StructSetProperty.Parse.html +1 -1
- package/docs/functions/StructSetProperty.Serialize.html +1 -1
- package/docs/functions/TextArrayProperty.Parse.html +1 -1
- package/docs/functions/TextArrayProperty.Serialize.html +1 -1
- package/docs/functions/TextProperty.CalcOverhead.html +1 -1
- package/docs/functions/TextProperty.Parse.html +1 -1
- package/docs/functions/TextProperty.ReadValue.html +1 -1
- package/docs/functions/TextProperty.Serialize.html +1 -1
- package/docs/functions/TextProperty.SerializeValue.html +1 -1
- package/docs/functions/Transform.Parse.html +1 -1
- package/docs/functions/Transform.ParseF.html +1 -1
- package/docs/functions/Transform.Serialize.html +1 -1
- package/docs/functions/Transform.SerializeF.html +1 -1
- package/docs/functions/Uint32Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint32Property.Parse.html +1 -1
- package/docs/functions/Uint32Property.ReadValue.html +1 -1
- package/docs/functions/Uint32Property.Serialize.html +1 -1
- package/docs/functions/Uint32Property.SerializeValue.html +1 -1
- package/docs/functions/Uint32SetProperty.Parse.html +1 -1
- package/docs/functions/Uint32SetProperty.Serialize.html +1 -1
- package/docs/functions/Uint64Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint64Property.Parse.html +1 -1
- package/docs/functions/Uint64Property.ReadValue.html +1 -1
- package/docs/functions/Uint64Property.Serialize.html +1 -1
- package/docs/functions/Uint64Property.SerializeValue.html +1 -1
- package/docs/functions/Uint8Property.CalcOverhead.html +1 -1
- package/docs/functions/Uint8Property.Parse.html +1 -1
- package/docs/functions/Uint8Property.ReadValue.html +1 -1
- package/docs/functions/Uint8Property.Serialize.html +1 -1
- package/docs/functions/Uint8Property.SerializeValue.html +1 -1
- package/docs/functions/VehiclePhysicsData.Parse.html +1 -0
- package/docs/functions/VehiclePhysicsData.Serialize.html +1 -0
- package/docs/functions/VehicleSpecialProperties.Parse.html +1 -1
- package/docs/functions/VehicleSpecialProperties.Serialize.html +1 -1
- package/docs/functions/col4.ParseBGRA.html +1 -1
- package/docs/functions/col4.ParseRGBA.html +1 -1
- package/docs/functions/col4.SerializeBGRA.html +1 -1
- package/docs/functions/col4.SerializeRGBA.html +1 -1
- package/docs/functions/isArrayProperty.html +1 -1
- package/docs/functions/isBoolArrayProperty.html +1 -1
- package/docs/functions/isBoolProperty.html +1 -1
- package/docs/functions/isBuildableSubsystemSpecialProperties.html +1 -1
- package/docs/functions/isByteArrayProperty.html +1 -1
- package/docs/functions/isByteProperty.html +1 -1
- package/docs/functions/isCircuitSpecialProperties.html +1 -1
- package/docs/functions/isConveyorChainActorSpecialProperties.html +1 -1
- package/docs/functions/isConveyorSpecialProperties.html +1 -1
- package/docs/functions/isDoubleArrayProperty.html +1 -1
- package/docs/functions/isDoubleProperty.html +1 -1
- package/docs/functions/isEmptySpecialProperties.html +1 -1
- package/docs/functions/isEnumArrayProperty.html +1 -1
- package/docs/functions/isEnumProperty.html +1 -1
- package/docs/functions/isFloatArrayProperty.html +1 -1
- package/docs/functions/isFloatProperty.html +1 -1
- package/docs/functions/isInt32ArrayProperty.html +1 -1
- package/docs/functions/isInt32Property.html +1 -1
- package/docs/functions/isInt32SetProperty.html +1 -1
- package/docs/functions/isInt64ArrayProperty.html +1 -1
- package/docs/functions/isInt64Property.html +1 -1
- package/docs/functions/isInt8Property.html +1 -1
- package/docs/functions/isMapProperty.html +1 -1
- package/docs/functions/isObjectArrayProperty.html +1 -1
- package/docs/functions/isObjectProperty.html +1 -1
- package/docs/functions/isObjectSetProperty.html +1 -1
- package/docs/functions/isObjectsListSpecialProperties.html +1 -1
- package/docs/functions/isPlayerSpecialProperties.html +1 -1
- package/docs/functions/isPowerLineSpecialProperties.html +1 -1
- package/docs/functions/isSaveComponent.html +1 -1
- package/docs/functions/isSaveEntity.html +1 -1
- package/docs/functions/isSetProperty.html +1 -1
- package/docs/functions/isSoftObjectArrayProperty.html +1 -1
- package/docs/functions/isSpecialDroneActionProperties.html +1 -1
- package/docs/functions/isStrArrayProperty.html +1 -1
- package/docs/functions/isStrProperty.html +1 -1
- package/docs/functions/isStrSetProperty.html +1 -1
- package/docs/functions/isStructArrayProperty.html +1 -1
- package/docs/functions/isStructProperty.html +1 -1
- package/docs/functions/isStructSetProperty.html +1 -1
- package/docs/functions/isTextArrayProperty.html +1 -1
- package/docs/functions/isTextProperty.html +1 -1
- package/docs/functions/isUInt64Property.html +1 -1
- package/docs/functions/isUint32Property.html +1 -1
- package/docs/functions/isUint32SetProperty.html +1 -1
- package/docs/functions/isUint8Property.html +1 -1
- package/docs/functions/isVehicleSpecialProperties.html +1 -1
- package/docs/functions/vec2.Parse.html +1 -1
- package/docs/functions/vec2.ParseF.html +1 -1
- package/docs/functions/vec2.Serialize.html +1 -1
- package/docs/functions/vec2.SerializeF.html +1 -1
- package/docs/functions/vec3.Parse.html +1 -1
- package/docs/functions/vec3.ParseF.html +1 -1
- package/docs/functions/vec3.ParseInt.html +1 -1
- package/docs/functions/vec3.Serialize.html +1 -1
- package/docs/functions/vec3.SerializeF.html +1 -1
- package/docs/functions/vec3.SerializeInt.html +1 -1
- package/docs/functions/vec3.add.html +1 -1
- package/docs/functions/vec3.length.html +1 -1
- package/docs/functions/vec3.mult.html +1 -1
- package/docs/functions/vec3.norm.html +1 -1
- package/docs/functions/vec3.sub.html +1 -1
- package/docs/functions/vec4.Parse.html +1 -1
- package/docs/functions/vec4.ParseF.html +1 -1
- package/docs/functions/vec4.Serialize.html +1 -1
- package/docs/functions/vec4.SerializeF.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +34 -21
- package/docs/interfaces/Blueprint.html +2 -2
- package/docs/interfaces/BlueprintConfig-1.html +8 -0
- package/docs/interfaces/SaveComponentHeader.html +3 -2
- package/docs/interfaces/SaveEntityHeader.html +3 -2
- package/docs/interfaces/SaveObjectHeader.html +3 -2
- package/docs/modules/AbstractBaseProperty.html +1 -1
- package/docs/modules/ArrayProperty.html +1 -1
- package/docs/modules/BlueprintConfig.html +3 -0
- package/docs/modules/BlueprintHeader.html +3 -0
- 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 +3 -0
- 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 +3 -0
- 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/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 +2 -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 +3 -0
- package/docs/modules/SaveBodyChunks.html +5 -0
- package/docs/modules/SetProperty.html +1 -1
- package/docs/modules/SoftObjectArrayProperty.html +1 -1
- package/docs/modules/SoftObjectReference.html +1 -1
- package/docs/modules/SpecialDroneActionProperties.html +1 -1
- package/docs/modules/SpecialProperties.html +1 -1
- package/docs/modules/StrArrayProperty.html +1 -1
- package/docs/modules/StrProperty.html +1 -1
- package/docs/modules/StrSetProperty.html +1 -1
- package/docs/modules/StructArrayProperty.html +1 -1
- package/docs/modules/StructProperty.html +1 -1
- package/docs/modules/StructSetProperty.html +1 -1
- package/docs/modules/TextArrayProperty.html +1 -1
- package/docs/modules/TextProperty.html +1 -1
- package/docs/modules/Transform.html +1 -1
- package/docs/modules/Uint32Property.html +1 -1
- package/docs/modules/Uint32SetProperty.html +1 -1
- package/docs/modules/Uint64Property.html +1 -1
- package/docs/modules/Uint8Property.html +1 -1
- package/docs/modules/VehiclePhysicsData.html +3 -0
- package/docs/modules/VehicleSpecialProperties.html +1 -1
- package/docs/modules/col4.html +1 -1
- package/docs/modules/vec2.html +1 -1
- package/docs/modules/vec3.html +1 -1
- package/docs/modules/vec4.html +1 -1
- package/docs/modules.html +31 -7
- 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 -0
- package/docs/types/BoolArrayProperty-1.html +1 -1
- package/docs/types/BoolProperty-1.html +1 -1
- package/docs/types/BoxStructPropertyValue.html +1 -1
- package/docs/types/BuildableSubsystemSpecialProperties-1.html +1 -1
- package/docs/types/BuildableTypeInstance-1.html +1 -0
- package/docs/types/ByteArray4.html +1 -0
- 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 -0
- package/docs/types/ChunkSummary.html +1 -0
- 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 -0
- package/docs/types/FICFrameRange-1.html +1 -1
- package/docs/types/FICFrameRangeStructPropertyValue.html +1 -1
- package/docs/types/FloatArrayProperty-1.html +1 -1
- package/docs/types/FloatProperty-1.html +1 -1
- package/docs/types/GENERIC_MAP_KEY_TYPE.html +1 -1
- package/docs/types/GENERIC_MAP_VALUE_TYPE.html +1 -1
- package/docs/types/GENERIC_STRUCT_PROPERTY_VALUE.html +1 -1
- package/docs/types/GUID-1.html +1 -1
- package/docs/types/GUIDInfo-1.html +1 -1
- package/docs/types/Grids.html +1 -0
- 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 +3 -1
- package/docs/types/Levels.html +1 -0
- package/docs/types/MAP_STRUCT_KEY_PROXY.html +1 -1
- package/docs/types/MD5Hash-1.html +1 -1
- package/docs/types/MapProperty-1.html +1 -1
- package/docs/types/ModData.html +1 -0
- package/docs/types/ObjectArrayProperty-1.html +1 -1
- package/docs/types/ObjectProperty-1.html +1 -1
- package/docs/types/ObjectReference-1.html +1 -1
- package/docs/types/ObjectSetProperty-1.html +1 -1
- package/docs/types/ObjectsListSpecialProperties-1.html +1 -1
- package/docs/types/PlayerSpecialProperties-1.html +1 -1
- package/docs/types/PowerLineSpecialProperties-1.html +1 -1
- package/docs/types/PropertiesMap.html +1 -1
- package/docs/types/RailroadTrackPositionStructPropertyValue.html +1 -1
- package/docs/types/RoughSaveVersion.html +1 -1
- package/docs/types/SatisfactoryModMetadata.html +1 -0
- package/docs/types/SatisfactorySaveHeader-1.html +1 -0
- package/docs/types/SaveBodyChunks-1.html +1 -0
- package/docs/types/SaveBodyValidation.html +1 -0
- package/docs/types/SetProperty.AvailableSetPropertyTypes.html +1 -1
- package/docs/types/SoftObjectArrayProperty-1.html +1 -1
- package/docs/types/SoftObjectReference-1.html +1 -1
- package/docs/types/SpecialDroneAction.html +1 -1
- package/docs/types/SpecialDroneActionProperties-1.html +1 -1
- package/docs/types/SpecialProperties.AvailableSpecialPropertiesTypes.html +1 -1
- package/docs/types/StrArrayProperty-1.html +1 -1
- package/docs/types/StrProperty-1.html +1 -1
- package/docs/types/StrSetProperty-1.html +1 -1
- package/docs/types/StructArrayProperty-1.html +1 -1
- package/docs/types/StructProperty-1.html +1 -1
- package/docs/types/StructSetProperty-1.html +1 -1
- package/docs/types/TextArrayProperty-1.html +1 -1
- package/docs/types/TextProperty-1.html +1 -1
- package/docs/types/TextPropertyValue.html +1 -1
- package/docs/types/Transform-1.html +1 -1
- package/docs/types/Uint32Property-1.html +1 -1
- package/docs/types/Uint32SetProperty-1.html +1 -1
- package/docs/types/Uint64Property-1.html +1 -1
- package/docs/types/Uint8Property-1.html +1 -1
- package/docs/types/VehiclePhysicsData-1.html +1 -0
- package/docs/types/VehicleSpecialProperties-1.html +1 -1
- package/docs/types/col4-1.html +1 -1
- package/docs/types/vec2-1.html +1 -1
- package/docs/types/vec3-1.html +1 -1
- package/docs/types/vec4-1.html +1 -1
- package/docs/variables/DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE.html +1 -0
- package/docs/variables/EDIT.html +1 -1
- package/docs/variables/SaveBodyChunks.HEADER_V1.html +1 -0
- package/docs/variables/SaveBodyChunks.HEADER_V2.html +1 -0
- package/package.json +3 -1
- package/docs/interfaces/BlueprintConfig.html +0 -6
- package/docs/interfaces/ModData.html +0 -4
- package/docs/interfaces/SatisfactoryModMetadata.html +0 -4
- package/docs/interfaces/SatisfactorySaveHeader.html +0 -18
- package/docs/types/BlueprintHeader.html +0 -1
- package/docs/types/BuildableTypeInstance.html +0 -1
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.SaveReader = exports.DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE = void 0;
|
|
7
|
-
const pako_1 = __importDefault(require("pako"));
|
|
8
4
|
const alignment_enum_1 = require("../../byte/alignment.enum");
|
|
9
|
-
const
|
|
5
|
+
const context_reader_1 = require("../../context/context-reader");
|
|
10
6
|
const parser_error_1 = require("../../error/parser.error");
|
|
11
|
-
const MD5Hash_1 = require("../types/structs/MD5Hash");
|
|
12
7
|
const level_class_1 = require("./level.class");
|
|
8
|
+
const save_body_chunks_1 = require("./save-body-chunks");
|
|
9
|
+
const save_custom_version_1 = require("./save-custom-version");
|
|
13
10
|
exports.DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE = 49;
|
|
14
|
-
class SaveReader extends
|
|
11
|
+
class SaveReader extends context_reader_1.ContextReader {
|
|
15
12
|
constructor(fileBuffer, onProgressCallback = () => { }) {
|
|
16
13
|
super(fileBuffer, alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
17
14
|
this.onProgressCallback = onProgressCallback;
|
|
18
|
-
this.compressionInfo = {
|
|
19
|
-
packageFileTag: 0,
|
|
20
|
-
maxUncompressedChunkContentSize: 0,
|
|
21
|
-
chunkHeaderSize: exports.DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE
|
|
22
|
-
};
|
|
23
15
|
this.expect = (value, expected) => {
|
|
24
16
|
if (value !== expected) {
|
|
25
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.`);
|
|
@@ -50,8 +42,8 @@ class SaveReader extends byte_reader_class_1.ByteReader {
|
|
|
50
42
|
const childrenCount = this.readUint32();
|
|
51
43
|
for (let i = 0; i < childrenCount; i++) {
|
|
52
44
|
const levelInstanceName = this.readString();
|
|
53
|
-
const
|
|
54
|
-
grids[gridName].children[levelInstanceName] =
|
|
45
|
+
const cellHash = this.readUint32();
|
|
46
|
+
grids[gridName].children[levelInstanceName] = cellHash;
|
|
55
47
|
}
|
|
56
48
|
};
|
|
57
49
|
readGrid();
|
|
@@ -62,156 +54,62 @@ class SaveReader extends byte_reader_class_1.ByteReader {
|
|
|
62
54
|
return grids;
|
|
63
55
|
};
|
|
64
56
|
}
|
|
65
|
-
readHeader() {
|
|
66
|
-
this.header = {
|
|
67
|
-
saveHeaderType: 0,
|
|
68
|
-
saveVersion: 0,
|
|
69
|
-
buildVersion: 0,
|
|
70
|
-
mapName: "DEFAULT",
|
|
71
|
-
mapOptions: "",
|
|
72
|
-
sessionName: "",
|
|
73
|
-
playDurationSeconds: 0,
|
|
74
|
-
saveDateTime: "0",
|
|
75
|
-
sessionVisibility: 0
|
|
76
|
-
};
|
|
77
|
-
this.header.saveHeaderType = this.readInt32();
|
|
78
|
-
this.header.saveVersion = this.readInt32();
|
|
79
|
-
this.header.buildVersion = this.readInt32();
|
|
80
|
-
this.header.mapName = this.readString();
|
|
81
|
-
this.header.mapOptions = this.readString();
|
|
82
|
-
this.header.sessionName = this.readString();
|
|
83
|
-
this.header.playDurationSeconds = this.readInt32();
|
|
84
|
-
const rawSaveDateTimeInTicks = this.readLong();
|
|
85
|
-
const unixMilliseconds = (rawSaveDateTimeInTicks - SaveReader.EPOCH_TICKS) / 10000n;
|
|
86
|
-
this.header.saveDateTime = unixMilliseconds.toString();
|
|
87
|
-
this.header.sessionVisibility = this.readByte();
|
|
88
|
-
if (this.header.saveHeaderType >= 7) {
|
|
89
|
-
this.header.fEditorObjectVersion = this.readInt32();
|
|
90
|
-
}
|
|
91
|
-
if (this.header.saveHeaderType >= 8) {
|
|
92
|
-
this.header.rawModMetadataString = this.readString();
|
|
93
|
-
try {
|
|
94
|
-
this.header.modMetadata = JSON.parse(this.header.rawModMetadataString);
|
|
95
|
-
}
|
|
96
|
-
catch (error) {
|
|
97
|
-
}
|
|
98
|
-
this.header.isModdedSave = this.readInt32();
|
|
99
|
-
}
|
|
100
|
-
if (this.header.saveHeaderType >= 10) {
|
|
101
|
-
this.header.saveIdentifier = this.readString();
|
|
102
|
-
}
|
|
103
|
-
if (this.header.saveHeaderType >= 11) {
|
|
104
|
-
this.header.partitionEnabledFlag = this.readInt32() === 1;
|
|
105
|
-
}
|
|
106
|
-
if (this.header.saveHeaderType >= 12) {
|
|
107
|
-
this.header.consistencyHashBytes = MD5Hash_1.MD5Hash.read(this);
|
|
108
|
-
}
|
|
109
|
-
if (this.header.saveHeaderType >= 13) {
|
|
110
|
-
this.header.creativeModeEnabled = this.readInt32() == 1;
|
|
111
|
-
}
|
|
112
|
-
if (this.header.saveVersion >= 21) {
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
throw new parser_error_1.UnsupportedVersionError("The save version is too old to support encoding currently. Save in newer game version.");
|
|
116
|
-
}
|
|
117
|
-
return this.header;
|
|
118
|
-
}
|
|
119
57
|
inflateChunks() {
|
|
120
|
-
|
|
121
|
-
this.handledByte = 0;
|
|
58
|
+
const result = save_body_chunks_1.SaveBodyChunks.DecompressChunks(this.fileBuffer.slice(this.currentByte), this.alignment);
|
|
122
59
|
this.currentByte = 0;
|
|
60
|
+
this.fileBuffer = result.uncompressedData.buffer;
|
|
123
61
|
this.maxByte = this.fileBuffer.byteLength;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
this.currentByte = this.compressionInfo.chunkHeaderSize;
|
|
129
|
-
this.handledByte += this.compressionInfo.chunkHeaderSize;
|
|
130
|
-
if (this.compressionInfo.packageFileTag <= 0) {
|
|
131
|
-
this.compressionInfo.packageFileTag = chunkHeader.getUint32(0, this.alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
132
|
-
}
|
|
133
|
-
if (this.compressionInfo.maxUncompressedChunkContentSize <= 0) {
|
|
134
|
-
this.compressionInfo.maxUncompressedChunkContentSize = chunkHeader.getInt32(8, this.alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
135
|
-
}
|
|
136
|
-
const chunkCompressedLength = chunkHeader.getInt32(33, this.alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
137
|
-
const chunkUncompressedLength = chunkHeader.getInt32(25, this.alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
138
|
-
totalUncompressedBodySize += chunkUncompressedLength;
|
|
139
|
-
const currentChunkSize = chunkCompressedLength;
|
|
140
|
-
let currentChunk = this.fileBuffer.slice(this.currentByte, this.currentByte + currentChunkSize);
|
|
141
|
-
this.handledByte += currentChunkSize;
|
|
142
|
-
this.currentByte += currentChunkSize;
|
|
143
|
-
this.fileBuffer = this.fileBuffer.slice(this.currentByte);
|
|
144
|
-
this.currentByte = 0;
|
|
145
|
-
try {
|
|
146
|
-
let currentInflatedChunk = null;
|
|
147
|
-
currentInflatedChunk = pako_1.default.inflate(currentChunk);
|
|
148
|
-
currentChunks.push(currentInflatedChunk);
|
|
149
|
-
}
|
|
150
|
-
catch (err) {
|
|
151
|
-
throw new parser_error_1.CompressionLibraryError("Failed to inflate compressed save data. " + err);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
let newChunkLength = currentChunks.map(cc => cc.length).reduce((prev, cur) => prev + cur);
|
|
155
|
-
const bigWholeChunk = new Uint8Array(newChunkLength);
|
|
156
|
-
let currentLength = 0;
|
|
157
|
-
for (let i = 0; i < currentChunks.length; i++) {
|
|
158
|
-
bigWholeChunk.set(currentChunks[i], currentLength);
|
|
159
|
-
currentLength += currentChunks[i].length;
|
|
160
|
-
}
|
|
161
|
-
this.currentByte = 0;
|
|
162
|
-
this.maxByte = bigWholeChunk.buffer.byteLength;
|
|
163
|
-
this.bufferView = new DataView(bigWholeChunk.buffer);
|
|
164
|
-
const dataLength = this.readInt32();
|
|
165
|
-
if (totalUncompressedBodySize !== dataLength + 8) {
|
|
166
|
-
throw new parser_error_1.CorruptSaveError(`Possibly corrupt. Indicated size of total save body (${dataLength + 8}) does not match the uncompressed real size of ${totalUncompressedBodySize}.`);
|
|
62
|
+
this.bufferView = new DataView(this.fileBuffer);
|
|
63
|
+
const totalBodyRestSize = this.readInt32();
|
|
64
|
+
if (result.uncompressedData.byteLength !== (totalBodyRestSize + (this.context.saveVersion >= save_custom_version_1.SaveCustomVersion.UnrealEngine5 ? 8 : 4))) {
|
|
65
|
+
throw new parser_error_1.CorruptSaveError(`Possibly corrupt. Indicated size of total save body (${totalBodyRestSize + 8}) does not match the uncompressed real size of ${result.uncompressedData.byteLength}.`);
|
|
167
66
|
}
|
|
168
67
|
return {
|
|
169
|
-
|
|
170
|
-
numChunks: currentChunks.length
|
|
68
|
+
compressionInfo: result.compressionInfo
|
|
171
69
|
};
|
|
172
70
|
}
|
|
173
71
|
readLevels() {
|
|
174
|
-
if (!this.
|
|
175
|
-
throw new parser_error_1.ParserError('ParserError', 'Header must be set before objects can be read.');
|
|
72
|
+
if (!this.context.saveVersion || !this.context.saveHeaderType) {
|
|
73
|
+
throw new parser_error_1.ParserError('ParserError', 'Header and its context must be set before objects can be read.');
|
|
176
74
|
}
|
|
177
|
-
const roughSaveVersion = SaveReader.GetRoughSaveVersion(this.
|
|
75
|
+
const roughSaveVersion = SaveReader.GetRoughSaveVersion(this.context.saveVersion);
|
|
178
76
|
if (roughSaveVersion === '<U6') {
|
|
179
|
-
throw new parser_error_1.UnsupportedVersionError('Game Version < U6 is not supported.');
|
|
77
|
+
throw new parser_error_1.UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');
|
|
180
78
|
}
|
|
181
|
-
|
|
182
|
-
throw new parser_error_1.UnsupportedVersionError('Game Version U6/U7 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.0.34');
|
|
183
|
-
}
|
|
184
|
-
else if (roughSaveVersion === 'U8') {
|
|
185
|
-
throw new parser_error_1.UnsupportedVersionError('Game Version U8 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.3.7');
|
|
186
|
-
}
|
|
187
|
-
const levels = [];
|
|
79
|
+
const levels = {};
|
|
188
80
|
const levelCount = this.readInt32();
|
|
189
81
|
this.onProgressCallback(this.getBufferProgress(), `reading pack of ${levelCount + 1} levels.`);
|
|
190
82
|
for (let i = 0; i <= levelCount; i++) {
|
|
191
|
-
let levelSingleName = i === levelCount ? this.
|
|
83
|
+
let levelSingleName = i === levelCount ? this.context.mapName : this.readString();
|
|
192
84
|
if (i % 500 === 0) {
|
|
193
85
|
this.onProgressCallback(this.getBufferProgress(), `reading level [${(i + 1)}/${(levelCount + 1)}] ${levelSingleName}`);
|
|
194
86
|
}
|
|
195
|
-
levels
|
|
87
|
+
levels[levelSingleName] = level_class_1.Level.ReadLevel(this, levelSingleName);
|
|
196
88
|
}
|
|
197
|
-
this.onProgressCallback(this.getBufferProgress(), 'finished parsing.');
|
|
198
89
|
return levels;
|
|
199
90
|
}
|
|
200
91
|
}
|
|
201
92
|
exports.SaveReader = SaveReader;
|
|
202
93
|
SaveReader.EPOCH_TICKS = 621355968000000000n;
|
|
203
|
-
SaveReader.GetRoughSaveVersion = (saveVersion
|
|
204
|
-
if (saveVersion
|
|
205
|
-
return 'U1.
|
|
94
|
+
SaveReader.GetRoughSaveVersion = (saveVersion) => {
|
|
95
|
+
if (SaveReader.IsGameVersionAtLeast_U1_1(saveVersion)) {
|
|
96
|
+
return 'U1.1+';
|
|
97
|
+
}
|
|
98
|
+
else if (SaveReader.IsGameVersionAtLeast_U1(saveVersion)) {
|
|
99
|
+
return 'U1.0';
|
|
206
100
|
}
|
|
207
|
-
else if (
|
|
101
|
+
else if (SaveReader.IsGameVersionAtLeast_U8(saveVersion)) {
|
|
208
102
|
return 'U8';
|
|
209
103
|
}
|
|
210
|
-
else if (saveVersion
|
|
104
|
+
else if (SaveReader.IsGameVersionAtLeast_U6_U7(saveVersion)) {
|
|
211
105
|
return 'U6/U7';
|
|
212
106
|
}
|
|
213
107
|
else {
|
|
214
108
|
return '<U6';
|
|
215
109
|
}
|
|
216
110
|
};
|
|
111
|
+
SaveReader.IsGameVersionAtLeast_U1_1 = (saveVersion) => saveVersion >= save_custom_version_1.SaveCustomVersion.SerializePerStreamableLevelTOCVersion;
|
|
112
|
+
SaveReader.IsGameVersionAtLeast_U1 = (saveVersion) => saveVersion >= save_custom_version_1.SaveCustomVersion.Version1;
|
|
113
|
+
SaveReader.IsGameVersionAtLeast_U8 = (saveVersion) => saveVersion >= save_custom_version_1.SaveCustomVersion.UnrealEngine5;
|
|
114
|
+
SaveReader.IsGameVersionAtLeast_U6_U7 = (saveVersion) => saveVersion >= save_custom_version_1.SaveCustomVersion.AddedSublevelStreaming;
|
|
217
115
|
//# sourceMappingURL=save-reader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-reader.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-reader.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AACxB,8DAAsD;AACtD,oEAA0D;AAC1D,2DAA2H;AAE3H,sDAAmD;AACnD,+CAAsC;AAGzB,QAAA,sCAAsC,GAAG,EAAE,CAAC;AAoBzD,MAAa,UAAW,SAAQ,8BAAU;IAYzC,YAAY,UAAuB,EAAS,qBAA+D,GAAG,EAAE,GAAG,CAAC;QACnH,KAAK,CAAC,UAAU,EAAE,0BAAS,CAAC,aAAa,CAAC,CAAC;QADA,uBAAkB,GAAlB,kBAAkB,CAAsD;QAT7G,oBAAe,GAAyB;YAC9C,cAAc,EAAE,CAAC;YACjB,+BAA+B,EAAE,CAAC;YAClC,eAAe,EAAE,8CAAsC;SACvD,CAAC;QASK,WAAM,GAAG,CAAC,KAAU,EAAE,QAAa,EAAE,EAAE;YAC7C,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACxB,OAAO,CAAC,IAAI,CAAC,+BAA+B,QAAQ,mBAAmB,KAAK,8DAA8D,CAAC,CAAC;YAC7I,CAAC;QACF,CAAC,CAAC;QAkKK,qBAAgB,GAAG,GAAuB,EAAE;YAElD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;YAEjC,MAAM,yBAAyB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAEnD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,MAAM,CAAC,CAAC;YACvC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;YAGjC,MAAM,KAAK,GAAG,KAAK,CAAC,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;IACxG,IAAI,WAAW,IAAI,EAAE,EAAE,CAAC;QACvB,OAAO,OAAO,CAAC;IAChB,CAAC;SAAM,IAAI,iBAAiB,IAAI,EAAE,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACb,CAAC;SAAM,IAAI,WAAW,IAAI,EAAE,EAAE,CAAC;QAC9B,OAAO,OAAO,CAAC;IAChB,CAAC;SAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,AAVgC,CAUhC","sourcesContent":["\nimport Pako from \"pako\";\nimport { Alignment } from \"../../byte/alignment.enum\";\nimport { ByteReader } from \"../../byte/byte-reader.class\";\nimport { CompressionLibraryError, CorruptSaveError, ParserError, UnsupportedVersionError } from \"../../error/parser.error\";\nimport { ChunkCompressionInfo } from \"../../file.types\";\nimport { MD5Hash } from '../types/structs/MD5Hash';\nimport { Level } from './level.class';\nimport { RoughSaveVersion, SatisfactorySaveHeader } from \"./save.types\";\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};\n\nexport class SaveReader extends ByteReader {\n\n\tpublic header: SatisfactorySaveHeader | undefined;\n\tpublic compressionInfo: ChunkCompressionInfo = {\n\t\tpackageFileTag: 0,\n\t\tmaxUncompressedChunkContentSize: 0,\n\t\tchunkHeaderSize: DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE\n\t};\n\n\t// the number of .net ticks at the unix epoch\n\tpublic static readonly EPOCH_TICKS = 621355968000000000n;\n\n\tconstructor(fileBuffer: ArrayBuffer, public onProgressCallback: (progress: number, msg?: string) => void = () => { }) {\n\t\tsuper(fileBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic expect = (value: any, expected: any) => {\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 readHeader(): SatisfactorySaveHeader {\n\t\tthis.header = {\n\t\t\tsaveHeaderType: 0,\n\t\t\tsaveVersion: 0,\n\t\t\tbuildVersion: 0,\n\t\t\tmapName: \"DEFAULT\",\n\t\t\tmapOptions: \"\",\n\t\t\tsessionName: \"\",\n\t\t\tplayDurationSeconds: 0,\n\t\t\tsaveDateTime: \"0\",\n\t\t\tsessionVisibility: 0\n\t\t} as SatisfactorySaveHeader;\n\n\t\tthis.header.saveHeaderType = this.readInt32();\n\t\tthis.header.saveVersion = this.readInt32();\n\t\tthis.header.buildVersion = this.readInt32();\n\t\tthis.header.mapName = this.readString();\n\t\tthis.header.mapOptions = this.readString();\n\t\tthis.header.sessionName = this.readString();\n\t\tthis.header.playDurationSeconds = this.readInt32();\n\t\tconst rawSaveDateTimeInTicks = this.readLong();\t// in UTC it seems.\n\t\tconst unixMilliseconds = (rawSaveDateTimeInTicks - SaveReader.EPOCH_TICKS) / 10000n;\n\t\tthis.header.saveDateTime = unixMilliseconds.toString();\n\t\tthis.header.sessionVisibility = this.readByte();\n\n\t\tif (this.header.saveHeaderType >= 7) {\n\t\t\tthis.header.fEditorObjectVersion = this.readInt32();\n\t\t}\n\t\tif (this.header.saveHeaderType >= 8) {\n\t\t\tthis.header.rawModMetadataString = this.readString();\n\t\t\ttry {\n\t\t\t\tthis.header.modMetadata = JSON.parse(this.header.rawModMetadataString);\n\t\t\t} catch (error) {\n\t\t\t\t// ignore.\n\t\t\t}\n\t\t\tthis.header.isModdedSave = this.readInt32();\n\t\t}\n\n\t\t//10 is U7\n\t\tif (this.header.saveHeaderType >= 10) {\n\t\t\tthis.header.saveIdentifier = this.readString();\n\t\t}\n\n\t\t// U8 jumped directly to 13.\n\t\tif (this.header.saveHeaderType >= 11) {\n\t\t\tthis.header.partitionEnabledFlag = this.readInt32() === 1;\n\t\t}\n\n\t\tif (this.header.saveHeaderType >= 12) {\n\t\t\tthis.header.consistencyHashBytes = MD5Hash.read(this);\n\t\t}\n\n\t\t// 13 is U8 Experimental, Also First 1.0 Release\n\t\tif (this.header.saveHeaderType >= 13) {\n\t\t\tthis.header.creativeModeEnabled = this.readInt32() == 1;\n\t\t}\n\n\t\tif (this.header.saveVersion >= 21) {\n\t\t\t// all good, ready to read chunks now.\n\t\t} else {\n\t\t\tthrow new UnsupportedVersionError(\"The save version is too old to support encoding currently. Save in newer game version.\");\n\t\t}\n\n\t\treturn this.header;\n\t}\n\n\tpublic static GetRoughSaveVersion = (saveVersion: number, headerTypeVersion: number): RoughSaveVersion => {\n\t\tif (saveVersion >= 46) {\n\t\t\treturn 'U1.0+';\n\t\t} else if (headerTypeVersion >= 13) {\n\t\t\treturn 'U8';\n\t\t} else if (saveVersion >= 29) {\n\t\t\treturn 'U6/U7';\n\t\t} else {\n\t\t\treturn '<U6';\n\t\t}\n\t}\n\n\tpublic inflateChunks(): { concatenatedChunkLength: number, numChunks: number } {\n\n\t\t// free memory\n\t\tthis.fileBuffer = this.fileBuffer.slice(this.currentByte);\n\n\t\tthis.handledByte = 0;\n\t\tthis.currentByte = 0;\n\t\tthis.maxByte = this.fileBuffer.byteLength;\n\n\n\t\tlet currentChunks = [];\n\t\tlet totalUncompressedBodySize = 0;\n\n\t\t// read while we can handle\n\t\twhile (this.handledByte < this.maxByte) {\n\n\t\t\t// Read chunk info size...\n\t\t\tlet chunkHeader = new DataView(this.fileBuffer.slice(0, this.compressionInfo.chunkHeaderSize));\n\t\t\tthis.currentByte = this.compressionInfo.chunkHeaderSize;\n\t\t\tthis.handledByte += this.compressionInfo.chunkHeaderSize;\n\n\n\t\t\tif (this.compressionInfo.packageFileTag <= 0) {\n\t\t\t\t// Should always be 0xC1832A9E in LE\n\t\t\t\tthis.compressionInfo.packageFileTag = chunkHeader.getUint32(0, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\t\t}\n\t\t\tif (this.compressionInfo.maxUncompressedChunkContentSize <= 0) {\n\t\t\t\t// should always be 0x00000200 in LE\n\t\t\t\tthis.compressionInfo.maxUncompressedChunkContentSize = chunkHeader.getInt32(8, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\t\t}\n\n\t\t\tconst chunkCompressedLength = chunkHeader.getInt32(33, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tconst chunkUncompressedLength = chunkHeader.getInt32(25, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\t\ttotalUncompressedBodySize += chunkUncompressedLength;\n\n\t\t\tconst currentChunkSize = chunkCompressedLength;\n\t\t\tlet currentChunk = this.fileBuffer.slice(this.currentByte, this.currentByte + currentChunkSize);\n\t\t\tthis.handledByte += currentChunkSize;\n\t\t\tthis.currentByte += currentChunkSize;\n\n\n\t\t\t// Free memory from previous chunk...\n\t\t\tthis.fileBuffer = this.fileBuffer.slice(this.currentByte);\n\t\t\tthis.currentByte = 0;\n\n\t\t\t// unzip current chunk\n\t\t\ttry {\n\t\t\t\tlet currentInflatedChunk = null;\n\t\t\t\tcurrentInflatedChunk = Pako.inflate(currentChunk);\n\t\t\t\tcurrentChunks.push(currentInflatedChunk);\n\t\t\t}\n\t\t\tcatch (err: any) {\n\t\t\t\tthrow new CompressionLibraryError(\"Failed to inflate compressed save data. \" + err);\n\t\t\t}\n\t\t}\n\n\t\t//TODO we can get rid of file buffer here.\n\n\t\t// Create one big chunk out of the little chunks\n\t\tlet newChunkLength = currentChunks.map<number>(cc => cc.length).reduce((prev, cur) => prev + cur);\n\t\tconst bigWholeChunk = new Uint8Array(newChunkLength);\n\t\tlet currentLength = 0;\n\t\tfor (let i = 0; i < currentChunks.length; i++) {\n\t\t\tbigWholeChunk.set(currentChunks[i], currentLength);\n\t\t\tcurrentLength += currentChunks[i].length;\n\t\t}\n\n\t\tthis.currentByte = 0;\n\t\tthis.maxByte = bigWholeChunk.buffer.byteLength;\n\t\tthis.bufferView = new DataView(bigWholeChunk.buffer);\n\n\t\tconst dataLength = this.readInt32();\n\t\tif (totalUncompressedBodySize !== dataLength + 8) {\n\t\t\tthrow new CorruptSaveError(`Possibly corrupt. Indicated size of total save body (${dataLength + 8}) does not match the uncompressed real size of ${totalUncompressedBodySize}.`);\n\t\t}\n\n\t\treturn {\n\t\t\tconcatenatedChunkLength: newChunkLength,\n\t\t\tnumChunks: currentChunks.length\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();\t// 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\t// binary len maybe? But its not binary length of just grids, must be grids + levels?\n\t\tconst hash1 = Array.from(this.readBytes(4)) as ByteArray4;\t// 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;\t// 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 cellBinHex = this.readUint32();\n\t\t\t\tgrids[gridName].children[levelInstanceName] = cellBinHex;\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(): Level[] {\n\n\t\tif (!this.header) {\n\t\t\tthrow new ParserError('ParserError', 'Header 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.header.saveVersion, this.header.saveHeaderType);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported.');\n\t\t} else if (roughSaveVersion === 'U6/U7') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U6/U7 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.0.34');\n\t\t} else if (roughSaveVersion === 'U8') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U8 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.3.7');\n\t\t}\n\n\t\tconst levels: 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.header.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.push(Level.ReadLevel(this, levelSingleName, this.header.buildVersion));\n\t\t}\n\n\t\tthis.onProgressCallback(this.getBufferProgress(), 'finished parsing.');\n\n\t\treturn levels;\n\t}\n}\n\n\n\n"]}
|
|
1
|
+
{"version":3,"file":"save-reader.js","sourceRo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C;IACd,CAAC;AACF,CAAC,AAZgC,CAY/B;AACY,oCAAyB,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,qCAAqC,AAAlG,CAAmG;AAC5H,kCAAuB,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,QAAQ,AAArE,CAAsE;AAC7F,kCAAuB,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,aAAa,AAA1E,CAA2E;AAClG,qCAA0B,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,WAAW,IAAI,uCAAiB,CAAC,sBAAsB,AAAnF,CAAoF","sourcesContent":["import { Alignment } from '../../byte/alignment.enum';\nimport { ContextReader } from '../../context/context-reader';\nimport { CorruptSaveError, ParserError, UnsupportedVersionError } from '../../error/parser.error';\nimport { Level } from './level.class';\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) => {\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,15 +1,13 @@
|
|
|
1
1
|
import { Alignment } from "../../byte/alignment.enum";
|
|
2
|
-
import {
|
|
3
|
-
import { ChunkCompressionInfo, ChunkSummary } from "../../file.types";
|
|
2
|
+
import { ContextWriter } from '../../context/context-writer';
|
|
4
3
|
import { SatisfactorySave } from "./satisfactory-save";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
export declare class SaveWriter extends
|
|
4
|
+
import { ChunkCompressionInfo, ChunkSummary } from "./save-body-chunks";
|
|
5
|
+
import { Grids, SaveBodyValidation } from './save-reader';
|
|
6
|
+
export declare class SaveWriter extends ContextWriter {
|
|
8
7
|
constructor();
|
|
9
|
-
static
|
|
10
|
-
static
|
|
11
|
-
static
|
|
12
|
-
static WriteLevels(writer: ByteWriter, save: SatisfactorySave, buildVersion: number): void;
|
|
8
|
+
static WriteSaveBodyHash: (writer: ContextWriter, saveBodyValidation: SaveBodyValidation) => void;
|
|
9
|
+
static WriteGrids: (writer: ContextWriter, grids: Grids) => void;
|
|
10
|
+
static WriteLevels(writer: ContextWriter, save: SatisfactorySave): void;
|
|
13
11
|
static GenerateCompressedChunksFromData(bufferArray: ArrayBuffer, compressionInfo: ChunkCompressionInfo, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onChunk: (chunk: Uint8Array) => void, alignment?: Alignment): ChunkSummary[];
|
|
14
12
|
generateChunks(compressionInfo: ChunkCompressionInfo, posAfterHeader: number, onBinaryBeforeCompressing: (binary: ArrayBuffer) => void, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void): ChunkSummary[];
|
|
15
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-writer.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-writer.ts"],"names":[],"mappings":"
|
|
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,iBAAiB,WAAY,aAAa,sBAAsB,kBAAkB,KAAG,IAAI,CAStG;IAED,OAAc,UAAU,WAAY,aAAa,SAAS,KAAK,KAAG,IAAI,CAYpE;WAEY,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI;WAUhE,gCAAgC,CAC7C,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,oBAAoB,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"}
|
|
@@ -1,113 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.SaveWriter = void 0;
|
|
7
|
-
const pako_1 = __importDefault(require("pako"));
|
|
8
4
|
const alignment_enum_1 = require("../../byte/alignment.enum");
|
|
9
|
-
const
|
|
5
|
+
const context_writer_1 = require("../../context/context-writer");
|
|
10
6
|
const parser_error_1 = require("../../error/parser.error");
|
|
11
|
-
const file_types_1 = require("../../file.types");
|
|
12
|
-
const MD5Hash_1 = require("../types/structs/MD5Hash");
|
|
13
7
|
const level_class_1 = require("./level.class");
|
|
14
|
-
const
|
|
15
|
-
class SaveWriter extends
|
|
8
|
+
const save_body_chunks_1 = require("./save-body-chunks");
|
|
9
|
+
class SaveWriter extends context_writer_1.ContextWriter {
|
|
16
10
|
constructor() {
|
|
17
11
|
super(alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
18
12
|
}
|
|
19
|
-
static
|
|
20
|
-
writer.writeInt32(
|
|
21
|
-
|
|
22
|
-
writer.writeInt32(header.buildVersion);
|
|
23
|
-
writer.writeString(header.mapName);
|
|
24
|
-
writer.writeString(header.mapOptions);
|
|
25
|
-
writer.writeString(header.sessionName);
|
|
26
|
-
writer.writeInt32(header.playDurationSeconds);
|
|
27
|
-
writer.writeInt64(BigInt(header.saveDateTime) * 10000n + save_reader_1.SaveReader.EPOCH_TICKS);
|
|
28
|
-
writer.writeByte(header.sessionVisibility);
|
|
29
|
-
if (header.saveHeaderType >= 7) {
|
|
30
|
-
writer.writeInt32(header.fEditorObjectVersion);
|
|
31
|
-
}
|
|
32
|
-
if (header.saveHeaderType >= 8) {
|
|
33
|
-
if (header.modMetadata) {
|
|
34
|
-
writer.writeString(JSON.stringify(header.modMetadata));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
writer.writeString(header.rawModMetadataString);
|
|
38
|
-
}
|
|
39
|
-
writer.writeInt32(header.isModdedSave);
|
|
40
|
-
}
|
|
41
|
-
if (header.saveHeaderType >= 10) {
|
|
42
|
-
writer.writeString(header.saveIdentifier);
|
|
43
|
-
}
|
|
44
|
-
if (header.saveHeaderType >= 11) {
|
|
45
|
-
writer.writeInt32(header.partitionEnabledFlag ? 1 : 0);
|
|
46
|
-
}
|
|
47
|
-
if (header.saveHeaderType >= 12) {
|
|
48
|
-
MD5Hash_1.MD5Hash.write(writer, header.consistencyHashBytes);
|
|
49
|
-
}
|
|
50
|
-
if (header.saveHeaderType >= 13) {
|
|
51
|
-
writer.writeInt32(header.creativeModeEnabled ? 1 : 0);
|
|
52
|
-
}
|
|
53
|
-
if (header.saveVersion >= 21) {
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
throw new parser_error_1.UnsupportedVersionError("The save version is too old to be supported currently.");
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
static WriteLevels(writer, save, buildVersion) {
|
|
60
|
-
writer.writeInt32(save.levels.length - 1);
|
|
61
|
-
for (const level of save.levels) {
|
|
13
|
+
static WriteLevels(writer, save) {
|
|
14
|
+
writer.writeInt32(Object.keys(save.levels).length - 1);
|
|
15
|
+
for (const level of Object.values(save.levels)) {
|
|
62
16
|
if (level.name !== save.header.mapName) {
|
|
63
17
|
writer.writeString(level.name);
|
|
64
18
|
}
|
|
65
|
-
level_class_1.Level.SerializeLevel(writer, level
|
|
19
|
+
level_class_1.Level.SerializeLevel(writer, level);
|
|
66
20
|
}
|
|
67
21
|
}
|
|
68
22
|
static GenerateCompressedChunksFromData(bufferArray, compressionInfo, onBinaryBeforeCompressing, onChunk, alignment = alignment_enum_1.Alignment.LITTLE_ENDIAN) {
|
|
69
|
-
|
|
70
|
-
const saveBody = new Uint8Array(bufferArray.byteLength + 8);
|
|
71
|
-
saveBody.set(new Uint8Array(bufferArray), 4);
|
|
72
|
-
const miniView = new DataView(saveBody.buffer);
|
|
73
|
-
miniView.setInt32(0, totalUncompressedSize, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
74
|
-
onBinaryBeforeCompressing(saveBody.buffer);
|
|
75
|
-
let handledByte = 0;
|
|
76
|
-
const chunkSummary = [];
|
|
77
|
-
while (handledByte < saveBody.byteLength) {
|
|
78
|
-
const uncompressedContentSize = Math.min(compressionInfo.maxUncompressedChunkContentSize, saveBody.byteLength - handledByte);
|
|
79
|
-
const uncompressedChunk = saveBody.buffer.slice(handledByte, handledByte + uncompressedContentSize);
|
|
80
|
-
let compressedChunk = new Uint8Array(0);
|
|
81
|
-
try {
|
|
82
|
-
compressedChunk = pako_1.default.deflate(uncompressedChunk);
|
|
83
|
-
}
|
|
84
|
-
catch (err) {
|
|
85
|
-
throw new parser_error_1.CompressionLibraryError("Could not compress save data. " + err);
|
|
86
|
-
}
|
|
87
|
-
const chunk = new Uint8Array(compressionInfo.chunkHeaderSize + compressedChunk.byteLength);
|
|
88
|
-
chunk.set(compressedChunk, compressionInfo.chunkHeaderSize);
|
|
89
|
-
const view = new DataView(chunk.buffer);
|
|
90
|
-
view.setInt32(0, compressionInfo.packageFileTag, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
91
|
-
view.setInt32(4, 0x22222222, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
92
|
-
view.setInt32(8, compressionInfo.maxUncompressedChunkContentSize, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
93
|
-
view.setInt32(12, 0, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
94
|
-
view.setUint8(16, file_types_1.CompressionAlgorithmCode.ZLIB);
|
|
95
|
-
view.setInt32(17, compressedChunk.byteLength, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
96
|
-
view.setInt32(21, 0, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
97
|
-
view.setInt32(25, uncompressedContentSize, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
98
|
-
view.setInt32(29, 0, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
99
|
-
view.setInt32(33, compressedChunk.byteLength, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
100
|
-
view.setInt32(37, 0, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
101
|
-
view.setInt32(41, uncompressedContentSize, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
102
|
-
view.setInt32(45, 0, alignment === alignment_enum_1.Alignment.LITTLE_ENDIAN);
|
|
103
|
-
onChunk(chunk);
|
|
104
|
-
chunkSummary.push({
|
|
105
|
-
uncompressedSize: uncompressedContentSize + compressionInfo.chunkHeaderSize,
|
|
106
|
-
compressedSize: compressedChunk.byteLength + compressionInfo.chunkHeaderSize
|
|
107
|
-
});
|
|
108
|
-
handledByte += uncompressedContentSize;
|
|
109
|
-
}
|
|
110
|
-
return chunkSummary;
|
|
23
|
+
return save_body_chunks_1.SaveBodyChunks.CompressDataIntoChunks(bufferArray, compressionInfo, onBinaryBeforeCompressing, onChunk, alignment);
|
|
111
24
|
}
|
|
112
25
|
generateChunks(compressionInfo, posAfterHeader, onBinaryBeforeCompressing, onHeader, onChunk) {
|
|
113
26
|
if (posAfterHeader <= 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-writer.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save-writer.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,8DAAsD;AACtD,oEAA0D;AAC1D,2DAAyG;AACzG,iDAAgG;AAChG,sDAAmD;AACnD,+CAAsC;AAEtC,+CAAsE;AAItE,MAAa,UAAW,SAAQ,8BAAU;IAEzC;QACC,KAAK,CAAC,0BAAS,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,MAAkB,EAAE,MAA8B;QAE3E,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACzC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACtC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACvC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACnC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QACtC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAC9C,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,GAAG,wBAAU,CAAC,WAAW,CAAC,CAAC;QACjF,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAE3C,IAAI,MAAM,CAAC,cAAc,IAAI,CAAC,EAAE,CAAC;YAChC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,oBAAqB,CAAC,CAAC;QACjD,CAAC;QACD,IAAI,MAAM,CAAC,cAAc,IA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C,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 Pako from \"pako\";\nimport { Alignment } from \"../../byte/alignment.enum\";\nimport { ByteWriter } from \"../../byte/byte-writer.class\";\nimport { CompressionLibraryError, ParserError, UnsupportedVersionError } from \"../../error/parser.error\";\nimport { ChunkCompressionInfo, ChunkSummary, CompressionAlgorithmCode } from \"../../file.types\";\nimport { MD5Hash } from '../types/structs/MD5Hash';\nimport { Level } from './level.class';\nimport { SatisfactorySave } from \"./satisfactory-save\";\nimport { Grids, SaveBodyValidation, SaveReader } from \"./save-reader\";\nimport { SatisfactorySaveHeader } from \"./save.types\";\n\n\nexport class SaveWriter extends ByteWriter {\n\n\tconstructor() {\n\t\tsuper(Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic static WriteHeader(writer: ByteWriter, header: SatisfactorySaveHeader): void {\n\n\t\twriter.writeInt32(header.saveHeaderType);\n\t\twriter.writeInt32(header.saveVersion);\n\t\twriter.writeInt32(header.buildVersion);\n\t\twriter.writeString(header.mapName);\n\t\twriter.writeString(header.mapOptions);\n\t\twriter.writeString(header.sessionName);\n\t\twriter.writeInt32(header.playDurationSeconds);\n\t\twriter.writeInt64(BigInt(header.saveDateTime) * 10000n + SaveReader.EPOCH_TICKS);\n\t\twriter.writeByte(header.sessionVisibility);\n\n\t\tif (header.saveHeaderType >= 7) {\n\t\t\twriter.writeInt32(header.fEditorObjectVersion!);\n\t\t}\n\t\tif (header.saveHeaderType >= 8) {\n\t\t\tif (header.modMetadata) {\n\t\t\t\twriter.writeString(JSON.stringify(header.modMetadata));\n\t\t\t} else {\n\t\t\t\twriter.writeString(header.rawModMetadataString!);\n\t\t\t}\n\t\t\twriter.writeInt32(header.isModdedSave!);\n\t\t}\n\t\tif (header.saveHeaderType >= 10) {\n\t\t\twriter.writeString(header.saveIdentifier!);\n\t\t}\n\n\t\t// U8 jumped directly to 13.\n\t\tif (header.saveHeaderType >= 11) {\n\t\t\twriter.writeInt32(header.partitionEnabledFlag ? 1 : 0);\n\t\t}\n\n\t\tif (header.saveHeaderType >= 12) {\n\t\t\tMD5Hash.write(writer, header.consistencyHashBytes!);\n\t\t}\n\n\t\t// 13 is U8 Experimental First Release\n\t\tif (header.saveHeaderType >= 13) {\n\t\t\twriter.writeInt32(header.creativeModeEnabled ? 1 : 0);\n\t\t}\n\n\t\tif (header.saveVersion >= 21) {\n\t\t\t// ready to write levels now.\n\t\t} else {\n\t\t\tthrow new UnsupportedVersionError(\"The save version is too old to be supported currently.\");\n\t\t}\n\t}\n\n\tpublic static WriteSaveBodyHash = (writer: ByteWriter, saveBodyValidation: SaveBodyValidation): void => {\n\t\twriter.writeInt32(0);\n\t\twriter.writeInt32(saveBodyValidation.version);\n\t\twriter.writeString('None');\n\t\twriter.writeInt32(0);\n\t\twriter.writeBytesArray(saveBodyValidation.hash1);\n\t\twriter.writeInt32(1);\n\t\twriter.writeString('None');\n\t\twriter.writeBytesArray(saveBodyValidation.hash2);\n\t}\n\n\tpublic static WriteGrids = (writer: ByteWriter, 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: ByteWriter, save: SatisfactorySave, buildVersion: number): void {\n\t\twriter.writeInt32(save.levels.length - 1);\n\t\tfor (const level of 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, buildVersion);\n\t\t}\n\t}\n\n\tpublic static GenerateCompressedChunksFromData(\n\t\tbufferArray: ArrayBuffer,\n\t\tcompressionInfo: ChunkCompressionInfo,\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\tconst totalUncompressedSize = bufferArray.byteLength;\n\n\t\tconst saveBody = new Uint8Array(bufferArray.byteLength + 8);\n\t\tsaveBody.set(new Uint8Array(bufferArray), 4);\n\t\tconst miniView = new DataView(saveBody.buffer);\n\t\tminiView.setInt32(0, totalUncompressedSize, alignment === Alignment.LITTLE_ENDIAN);\n\t\tonBinaryBeforeCompressing(saveBody.buffer);\n\n\t\t// collect slices of chunks with help of compression info for max chunk size\n\t\tlet handledByte = 0;\n\t\tconst chunkSummary: {\n\t\t\tuncompressedSize: number,\n\t\t\tcompressedSize: number\n\t\t}[] = [];\n\t\twhile (handledByte < saveBody.byteLength) {\n\n\t\t\t// create uncompressed chunk.\n\t\t\tconst uncompressedContentSize = Math.min(compressionInfo.maxUncompressedChunkContentSize, saveBody.byteLength - handledByte);\n\t\t\tconst uncompressedChunk = saveBody.buffer.slice(handledByte, handledByte + uncompressedContentSize);\n\n\t\t\t// deflate chunk while we're at it.\n\t\t\tlet compressedChunk: Uint8Array = new Uint8Array(0);\n\t\t\ttry {\n\t\t\t\tcompressedChunk = Pako.deflate(uncompressedChunk);\n\t\t\t}\n\t\t\tcatch (err) {\n\t\t\t\tthrow new CompressionLibraryError(\"Could not compress save data. \" + err);\n\t\t\t}\n\n\t\t\tconst chunk = new Uint8Array(compressionInfo.chunkHeaderSize + compressedChunk.byteLength);\n\t\t\tchunk.set(compressedChunk, compressionInfo.chunkHeaderSize);\n\n\t\t\t// write header\n\t\t\tconst view = new DataView(chunk.buffer);\n\t\t\tview.setInt32(0, compressionInfo.packageFileTag, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setInt32(4, 0x22222222, alignment === Alignment.LITTLE_ENDIAN);\t\t//v1 header is 0x00000000, v2 is 0x22222222\n\t\t\tview.setInt32(8, compressionInfo.maxUncompressedChunkContentSize, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setInt32(12, 0, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setUint8(16, CompressionAlgorithmCode.ZLIB);\t// compression algo, came with U8, only present if header v2. Which means the header is actually 48 bytes long if header is not v2\n\t\t\tview.setInt32(17, compressedChunk.byteLength, alignment === Alignment.LITTLE_ENDIAN); // E0 3A 00 00 / 03 78 64 00\n\t\t\tview.setInt32(21, 0, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setInt32(25, uncompressedContentSize, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setInt32(29, 0, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setInt32(33, compressedChunk.byteLength, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setInt32(37, 0, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setInt32(41, uncompressedContentSize, alignment === Alignment.LITTLE_ENDIAN);\n\t\t\tview.setInt32(45, 0, alignment === Alignment.LITTLE_ENDIAN);\n\n\t\t\tonChunk(chunk);\n\t\t\tchunkSummary.push({\n\t\t\t\tuncompressedSize: uncompressedContentSize + compressionInfo.chunkHeaderSize,\n\t\t\t\tcompressedSize: compressedChunk.byteLength + compressionInfo.chunkHeaderSize\n\t\t\t});\n\t\t\thandledByte += uncompressedContentSize;\n\t\t}\n\n\t\treturn chunkSummary;\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, onBinaryBeforeCompressing, onChunk, this.alignment);\n\n\t\treturn chunkSummary;\n\t}\n}\n"]}
|
|
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,+CAAsC;AAEtC,yDAAwF;AAIxF,MAAa,UAAW,SAAQ,8BAAa;IAE5C;QACC,KAAK,CAAC,0BAAS,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;IA2BM,MAAM,CAAC,WAAW,CAAC,MAAqB,EAAE,IAAsB;QACtE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAChD,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACxC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChC,CAAC;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,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC,CAAA;AAEa,qBAAU,GAAG,CAAC,MAAqB,EAAE,KAAY,EAAQ,EAAE;IACxE,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.class';\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 WriteSaveBodyHash = (writer: ContextWriter, saveBodyValidation: SaveBodyValidation): void => {\n\t\twriter.writeInt32(0);\n\t\twriter.writeInt32(saveBodyValidation.version);\n\t\twriter.writeString('None');\n\t\twriter.writeInt32(0);\n\t\twriter.writeBytesArray(saveBodyValidation.hash1);\n\t\twriter.writeInt32(1);\n\t\twriter.writeString('None');\n\t\twriter.writeBytesArray(saveBodyValidation.hash2);\n\t}\n\n\tpublic 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\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, 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, onBinaryBeforeCompressing, onChunk, this.alignment);\n\n\t\treturn chunkSummary;\n\t}\n}\n"]}
|
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
export interface ModData {
|
|
1
|
+
export type ModData = {
|
|
3
2
|
Reference: string;
|
|
4
3
|
Name: string;
|
|
5
4
|
Version: string;
|
|
6
|
-
}
|
|
7
|
-
export
|
|
5
|
+
};
|
|
6
|
+
export type SatisfactoryModMetadata = {
|
|
8
7
|
Version: number;
|
|
9
8
|
FullMapName: string;
|
|
10
9
|
Mods: ModData[];
|
|
11
|
-
}
|
|
12
|
-
export
|
|
13
|
-
saveHeaderType: number;
|
|
14
|
-
saveVersion: number;
|
|
15
|
-
buildVersion: number;
|
|
16
|
-
mapName: string;
|
|
17
|
-
mapOptions: string;
|
|
18
|
-
sessionName: string;
|
|
19
|
-
playDurationSeconds: number;
|
|
20
|
-
saveDateTime: string;
|
|
21
|
-
sessionVisibility: number;
|
|
22
|
-
rawModMetadataString?: string;
|
|
23
|
-
modMetadata?: SatisfactoryModMetadata;
|
|
24
|
-
isModdedSave?: number;
|
|
25
|
-
saveIdentifier?: string;
|
|
26
|
-
fEditorObjectVersion?: number;
|
|
27
|
-
partitionEnabledFlag?: boolean;
|
|
28
|
-
consistencyHashBytes?: MD5Hash;
|
|
29
|
-
creativeModeEnabled?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export type RoughSaveVersion = '<U6' | 'U6/U7' | 'U8' | 'U1.0+';
|
|
10
|
+
};
|
|
11
|
+
export type RoughSaveVersion = '<U6' | 'U6/U7' | 'U8' | 'U1.0' | 'U1.1+';
|
|
32
12
|
//# sourceMappingURL=save.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save.types.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"save.types.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save.types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GAAG;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAGD,MAAM,MAAM,uBAAuB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,EAAE,CAAC;CACnB,CAAA;AAGD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save.types.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"save.types.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/save.types.ts"],"names":[],"mappings":"","sourcesContent":["\n/** @public */\nexport type ModData = {\n Reference: string;\n Name: string;\n Version: string;\n}\n\n/** @public */\nexport type SatisfactoryModMetadata = {\n Version: number;\n FullMapName: string;\n Mods: ModData[];\n}\n\n/** @public */\nexport type RoughSaveVersion = '<U6' | 'U6/U7' | 'U8' | 'U1.0' | 'U1.1+';"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ByteReader } from '../../../byte/byte-reader.class';
|
|
2
|
+
import { ContextReader } from '../../../context/context-reader';
|
|
3
|
+
import { ContextWriter } from '../../../context/context-writer';
|
|
3
4
|
import { SaveObject, SaveObjectHeader } from "./SaveObject";
|
|
4
5
|
export declare const isSaveComponent: (obj: any) => obj is SaveComponent;
|
|
5
6
|
export interface SaveComponentHeader extends SaveObjectHeader {
|
|
@@ -13,8 +14,8 @@ export declare class SaveComponent extends SaveObject implements SaveComponentHe
|
|
|
13
14
|
static readonly TypeID = 0;
|
|
14
15
|
readonly type = "SaveComponent";
|
|
15
16
|
constructor(typePath: string, rootObject: string, instanceName: string, parentEntityName?: string);
|
|
16
|
-
static ParseHeader(reader:
|
|
17
|
-
static SerializeHeader(writer:
|
|
18
|
-
static ParseData(component: SaveComponent, length: number, reader:
|
|
17
|
+
static ParseHeader(reader: ByteReader, obj: SaveComponent): void;
|
|
18
|
+
static SerializeHeader(writer: ContextWriter, component: SaveComponent): void;
|
|
19
|
+
static ParseData(component: SaveComponent, length: number, reader: ContextReader, typePath: string): void;
|
|
19
20
|
}
|
|
20
21
|
//# sourceMappingURL=SaveComponent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveComponent.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SaveComponent.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE5D,eAAO,MAAM,eAAe,QAAS,GAAG,KAAG,GAAG,IAAI,aAEjD,CAAA;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC5D,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,aAAc,SAAQ,UAAW,YAAW,mBAAmB;IAKxD,QAAQ,EAAE,MAAM;IAAS,UAAU,EAAE,MAAM;IAAS,YAAY,EAAE,MAAM;IAAS,gBAAgB;IAJpH,gBAAuB,MAAM,KAAK;IAElC,SAAgB,IAAI,mBAAmB;gBAEpB,QAAQ,EAAE,MAAM,EAAS,UAAU,EAAE,MAAM,EAAS,YAAY,EAAE,MAAM,EAAS,gBAAgB,SAAK;WAI3G,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI;WAKzD,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa;WAK/D,SAAS,CAAC,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAGhH"}
|
|
@@ -23,8 +23,8 @@ class SaveComponent extends SaveObject_1.SaveObject {
|
|
|
23
23
|
SaveObject_1.SaveObject.SerializeHeader(writer, component);
|
|
24
24
|
writer.writeString(component.parentEntityName);
|
|
25
25
|
}
|
|
26
|
-
static ParseData(component, length, reader,
|
|
27
|
-
SaveObject_1.SaveObject.ParseData(component, length, reader,
|
|
26
|
+
static ParseData(component, length, reader, typePath) {
|
|
27
|
+
SaveObject_1.SaveObject.ParseData(component, length, reader, typePath);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.SaveComponent = SaveComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveComponent.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveComponent.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SaveComponent.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveComponent.ts"],"names":[],"mappings":";;;AAGA,6CAA4D;AAErD,MAAM,eAAe,GAAG,CAAC,GAAQ,EAAwB,EAAE;IACjE,OAAO,GAAG,CAAC,IAAI,KAAK,eAAe,CAAC;AACrC,CAAC,CAAA;AAFY,QAAA,eAAe,mBAE3B;AAMD,MAAa,aAAc,SAAQ,uBAAU;IAK5C,YAAmB,QAAgB,EAAS,UAAkB,EAAS,YAAoB,EAAS,mBAAmB,EAAE;QACxH,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QADxB,aAAQ,GAAR,QAAQ,CAAQ;QAAS,eAAU,GAAV,UAAU,CAAQ;QAAS,iBAAY,GAAZ,YAAY,CAAQ;QAAS,qBAAgB,GAAhB,gBAAgB,CAAK;QAFzG,SAAI,GAAG,eAAe,CAAC;IAIvC,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,MAAkB,EAAE,GAAkB;QAC/D,uBAAU,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACpC,GAAG,CAAC,gBAAgB,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAC5C,CAAC;IAEM,MAAM,CAAC,eAAe,CAAC,MAAqB,EAAE,SAAwB;QAC5E,uBAAU,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAChD,CAAC;IAEM,MAAM,CAAC,SAAS,CAAC,SAAwB,EAAE,MAAc,EAAE,MAAqB,EAAE,QAAgB;QACxG,uBAAU,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;;AArBF,sCAsBC;AArBuB,oBAAM,GAAG,CAAC,AAAJ,CAAK","sourcesContent":["import { ByteReader } from '../../../byte/byte-reader.class';\nimport { ContextReader } from '../../../context/context-reader';\nimport { ContextWriter } from '../../../context/context-writer';\nimport { SaveObject, SaveObjectHeader } from \"./SaveObject\";\n\nexport const isSaveComponent = (obj: any): obj is SaveComponent => {\n\treturn obj.type === 'SaveComponent';\n}\n\nexport interface SaveComponentHeader extends SaveObjectHeader {\n\tparentEntityName: string;\n}\n\nexport class SaveComponent extends SaveObject implements SaveComponentHeader {\n\tpublic static readonly TypeID = 0;\n\n\tpublic readonly type = 'SaveComponent';\n\n\tconstructor(public typePath: string, public rootObject: string, public instanceName: string, public parentEntityName = '') {\n\t\tsuper(typePath, rootObject, instanceName);\n\t}\n\n\tpublic static ParseHeader(reader: ByteReader, obj: SaveComponent): void {\n\t\tSaveObject.ParseHeader(reader, obj);\n\t\tobj.parentEntityName = reader.readString();\n\t}\n\n\tpublic static SerializeHeader(writer: ContextWriter, component: SaveComponent) {\n\t\tSaveObject.SerializeHeader(writer, component);\n\t\twriter.writeString(component.parentEntityName);\n\t}\n\n\tpublic static ParseData(component: SaveComponent, length: number, reader: ContextReader, typePath: string): void {\n\t\tSaveObject.ParseData(component, length, reader, typePath);\n\t}\n}"]}
|