@etothepii/satisfactory-file-parser 0.1.10 → 0.1.11

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/README.md CHANGED
@@ -19,7 +19,7 @@ U8 has only read support so far and only for save files, not for blueprint files
19
19
  |:--------------:|:-----------------------------|
20
20
  | <= U5 | ❌ |
21
21
  | U6 + U7 | ✅ 0.0.1 - 0.0.34 |
22
- | U8 | ⚠️ >= 0.1.9 (Reading only) |
22
+ | U8 | ⚠️ >= 0.1.11 (Reading only) |
23
23
 
24
24
 
25
25
  ## Installation via npm
@@ -844,11 +844,14 @@ class SetProperty extends BasicProperty {
844
844
  }
845
845
  static Parse(reader, ueType, index, propertyName) {
846
846
  const subtype = reader.readString();
847
- reader.skipBytes(1);
848
- reader.skipBytes(4);
847
+ const unk2 = reader.skipBytes(1);
848
+ const unk3 = reader.skipBytes(4);
849
849
  const elementCount = reader.readInt32();
850
850
  let property;
851
851
  switch (subtype) {
852
+ case "UInt32Property":
853
+ property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => Uint32Property.ReadValue(reader)), ueType, index);
854
+ break;
852
855
  case "IntProperty":
853
856
  property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => Int32Property.ReadValue(reader)), ueType, index);
854
857
  break;
@@ -858,11 +861,6 @@ class SetProperty extends BasicProperty {
858
861
  case "NameProperty":
859
862
  property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => StrProperty.ReadValue(reader)), ueType, index);
860
863
  break;
861
- case "StructProperty":
862
- if (propertyName === 'mRemovalLocations') {
863
- property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => (0, util_types_1.ParseVec3f)(reader)), ueType, index);
864
- }
865
- break;
866
864
  default:
867
865
  throw new Error('Not Implemented.');
868
866
  }
@@ -909,9 +907,66 @@ class MapProperty extends BasicProperty {
909
907
  static Parse(reader, propertyName, buildVersion, size, ueType = 'MapProperty', index = 0) {
910
908
  const start = reader.getBufferPosition();
911
909
  const property = new MapProperty(reader.readString(), reader.readString(), ueType, index);
912
- reader.skipBytes(1);
910
+ const unk = reader.readByte();
913
911
  property.modeType = reader.readInt32();
914
- property.remainingData = Array.from(reader.readBytes(size - 4));
912
+ const elementCount = reader.readInt32();
913
+ for (let i = 0; i < elementCount; i++) {
914
+ let key;
915
+ let value;
916
+ switch (property.keyType) {
917
+ case 'StructProperty':
918
+ if (propertyName === 'mSaveData' || propertyName === 'mUnresolvedSaveData') {
919
+ key = reader.readBytes(12);
920
+ }
921
+ else {
922
+ key = (0, exports.ParseDynamicStructData)(reader, 0, 'MapPropertyKey-' + property.keyType);
923
+ }
924
+ break;
925
+ case 'ObjectProperty':
926
+ key = ObjectProperty.ReadValue(reader);
927
+ break;
928
+ case 'StrProperty':
929
+ case 'NameProperty':
930
+ key = StrProperty.ReadValue(reader);
931
+ break;
932
+ case 'EnumProperty':
933
+ key = EnumProperty.ReadValue(reader);
934
+ break;
935
+ case 'IntProperty':
936
+ case 'Int32Property':
937
+ key = Int32Property.ReadValue(reader);
938
+ break;
939
+ case 'ByteProperty':
940
+ key = ByteProperty.ReadValue(reader);
941
+ break;
942
+ default:
943
+ throw new Error(`not implemented map key type ${property.keyType}`);
944
+ }
945
+ switch (property.valueType) {
946
+ case 'StructProperty':
947
+ value = (0, exports.ParseDynamicStructData)(reader, 0, 'MapPropertyValue-' + property.valueType);
948
+ break;
949
+ case 'ObjectProperty':
950
+ value = ObjectProperty.ReadValue(reader);
951
+ break;
952
+ case 'StrProperty':
953
+ case 'NameProperty':
954
+ value = StrProperty.ReadValue(reader);
955
+ break;
956
+ case 'EnumProperty':
957
+ value = EnumProperty.ReadValue(reader);
958
+ break;
959
+ case 'IntProperty':
960
+ case 'Int32Property':
961
+ value = Int32Property.ReadValue(reader);
962
+ break;
963
+ case 'ByteProperty':
964
+ value = ByteProperty.ReadValue(reader);
965
+ break;
966
+ default:
967
+ throw new Error(`not implemented map value type ${property.valueType}`);
968
+ }
969
+ }
915
970
  return property;
916
971
  }
917
972
  static CalcOverhead(property) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@etothepii/satisfactory-file-parser",
3
3
  "author": "etothepii",
4
- "version": "0.1.10",
4
+ "version": "0.1.11",
5
5
  "description": "A file parser for satisfactory files. Includes save files and blueprint files.",
6
6
  "types": "./build/index.d.ts",
7
7
  "main": "./build/index.js",