@etothepii/satisfactory-file-parser 0.4.20 → 0.4.22

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.
Files changed (86) hide show
  1. package/README.md +11 -4
  2. package/build/index.d.ts +35 -36
  3. package/build/index.js +36 -40
  4. package/build/parser/satisfactory/blueprint/blueprint-reader.d.ts +2 -2
  5. package/build/parser/satisfactory/blueprint/blueprint-reader.js +12 -10
  6. package/build/parser/satisfactory/blueprint/blueprint-writer.d.ts +2 -2
  7. package/build/parser/satisfactory/blueprint/blueprint-writer.js +6 -6
  8. package/build/parser/satisfactory/blueprint/blueprint.types.d.ts +6 -5
  9. package/build/parser/satisfactory/save/level.class.d.ts +6 -6
  10. package/build/parser/satisfactory/save/level.class.js +22 -22
  11. package/build/parser/satisfactory/save/save-reader.js +1 -1
  12. package/build/parser/satisfactory/save/save-writer.js +2 -2
  13. package/build/parser/satisfactory/save/save.types.d.ts +1 -1
  14. package/build/parser/satisfactory/types/objects/SaveComponent.d.ts +19 -0
  15. package/build/parser/satisfactory/types/objects/SaveComponent.js +31 -0
  16. package/build/parser/satisfactory/types/objects/SaveEntity.d.ts +30 -0
  17. package/build/parser/satisfactory/types/objects/SaveEntity.js +66 -0
  18. package/build/parser/satisfactory/types/objects/SaveObject.d.ts +24 -0
  19. package/build/parser/satisfactory/types/objects/SaveObject.js +33 -0
  20. package/build/parser/satisfactory/types/property/DataFields.d.ts +15 -0
  21. package/build/parser/satisfactory/types/property/DataFields.js +493 -0
  22. package/build/parser/satisfactory/types/property/generic/ArrayProperty.d.ts +22 -0
  23. package/build/parser/satisfactory/types/property/generic/ArrayProperty.js +171 -0
  24. package/build/parser/satisfactory/types/property/generic/BasicProperty.d.ts +25 -0
  25. package/build/parser/satisfactory/types/property/generic/BasicProperty.js +28 -0
  26. package/build/parser/satisfactory/types/property/generic/BoolProperty.d.ts +14 -0
  27. package/build/parser/satisfactory/types/property/generic/BoolProperty.js +32 -0
  28. package/build/parser/satisfactory/types/property/generic/ByteProperty.d.ts +18 -0
  29. package/build/parser/satisfactory/types/property/generic/ByteProperty.js +52 -0
  30. package/build/parser/satisfactory/types/property/generic/DoubleProperty.d.ts +14 -0
  31. package/build/parser/satisfactory/types/property/generic/DoubleProperty.js +32 -0
  32. package/build/parser/satisfactory/types/property/generic/EnumProperty.d.ts +20 -0
  33. package/build/parser/satisfactory/types/property/generic/EnumProperty.js +35 -0
  34. package/build/parser/satisfactory/types/property/generic/FloatProperty.d.ts +14 -0
  35. package/build/parser/satisfactory/types/property/generic/FloatProperty.js +32 -0
  36. package/build/parser/satisfactory/types/property/generic/Int32Property.d.ts +14 -0
  37. package/build/parser/satisfactory/types/property/generic/Int32Property.js +32 -0
  38. package/build/parser/satisfactory/types/property/generic/Int64Property.d.ts +14 -0
  39. package/build/parser/satisfactory/types/property/generic/Int64Property.js +32 -0
  40. package/build/parser/satisfactory/types/property/generic/Int8Property.d.ts +14 -0
  41. package/build/parser/satisfactory/types/property/generic/Int8Property.js +32 -0
  42. package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts +22 -0
  43. package/build/parser/satisfactory/types/property/generic/MapProperty.js +162 -0
  44. package/build/parser/satisfactory/types/property/generic/ObjectProperty.d.ts +15 -0
  45. package/build/parser/satisfactory/types/property/generic/ObjectProperty.js +37 -0
  46. package/build/parser/satisfactory/types/property/generic/SetProperty.d.ts +12 -0
  47. package/build/parser/satisfactory/types/property/generic/SetProperty.js +94 -0
  48. package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.d.ts +13 -0
  49. package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.js +27 -0
  50. package/build/parser/satisfactory/types/property/generic/StrProperty.d.ts +14 -0
  51. package/build/parser/satisfactory/types/property/generic/StrProperty.js +32 -0
  52. package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts +69 -0
  53. package/build/parser/satisfactory/types/property/generic/StructProperty.js +365 -0
  54. package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts +30 -0
  55. package/build/parser/satisfactory/types/property/generic/TextProperty.js +111 -0
  56. package/build/parser/satisfactory/types/property/generic/Uint32Property.d.ts +14 -0
  57. package/build/parser/satisfactory/types/property/generic/Uint32Property.js +32 -0
  58. package/build/parser/satisfactory/types/property/generic/Uint64Property.d.ts +14 -0
  59. package/build/parser/satisfactory/types/property/generic/Uint64Property.js +32 -0
  60. package/build/parser/satisfactory/types/property/generic/Uint8Property.d.ts +14 -0
  61. package/build/parser/satisfactory/types/property/generic/Uint8Property.js +32 -0
  62. package/build/parser/satisfactory/types/property/special/SpecialAnyProperty.d.ts +54 -0
  63. package/build/parser/satisfactory/types/property/special/SpecialAnyProperty.js +2 -0
  64. package/build/parser/satisfactory/types/structs/GUID.d.ts +7 -0
  65. package/build/parser/satisfactory/types/structs/GUID.js +21 -0
  66. package/build/parser/satisfactory/types/structs/GUIDInfo.d.ts +8 -0
  67. package/build/parser/satisfactory/types/structs/GUIDInfo.js +26 -0
  68. package/build/parser/satisfactory/types/structs/MD5Hash.d.ts +10 -0
  69. package/build/parser/satisfactory/types/structs/MD5Hash.js +21 -0
  70. package/build/parser/satisfactory/types/structs/ObjectReference.d.ts +10 -0
  71. package/build/parser/satisfactory/types/structs/ObjectReference.js +17 -0
  72. package/build/parser/satisfactory/types/structs/SoftObjectReference.d.ts +11 -0
  73. package/build/parser/satisfactory/types/structs/SoftObjectReference.js +19 -0
  74. package/build/parser/satisfactory/types/structs/Transform.d.ts +15 -0
  75. package/build/parser/satisfactory/types/structs/Transform.js +32 -0
  76. package/build/parser/satisfactory/types/structs/col4.d.ts +14 -0
  77. package/build/parser/satisfactory/types/structs/col4.js +34 -0
  78. package/build/parser/satisfactory/types/structs/vec2.d.ts +12 -0
  79. package/build/parser/satisfactory/types/structs/vec2.js +26 -0
  80. package/build/parser/satisfactory/types/structs/vec3.d.ts +19 -0
  81. package/build/parser/satisfactory/types/structs/vec3.js +44 -0
  82. package/build/parser/satisfactory/types/structs/vec4.d.ts +12 -0
  83. package/build/parser/satisfactory/types/structs/vec4.js +27 -0
  84. package/build/parser/stream/reworked/readable-stream-parser.js +3 -3
  85. package/build/parser/stream/reworked/save-stream-writer.class.d.ts +2 -2
  86. package/package.json +1 -1
@@ -0,0 +1,22 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { ObjectReference } from '../../structs/ObjectReference';
4
+ import { BasicProperty } from './BasicProperty';
5
+ import { GENERIC_STRUCT_PROPERTY_VALUE } from './StructProperty';
6
+ export type MAP_STRUCT_KEY_PROXY = [number, number, number, number, number, number, number, number, number, number, number, number];
7
+ export type GENERIC_MAP_KEY_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE | MAP_STRUCT_KEY_PROXY;
8
+ export type GENERIC_MAP_VALUE_TYPE = number | ObjectReference | boolean | GENERIC_STRUCT_PROPERTY_VALUE;
9
+ export declare const isMapProperty: (property: BasicProperty) => property is MapProperty;
10
+ export declare class MapProperty extends BasicProperty {
11
+ keyType: string;
12
+ valueType: string;
13
+ modeType: number;
14
+ modeUnk1: string | undefined;
15
+ modeUnk2: string;
16
+ modeUnk3: string;
17
+ values: [key: GENERIC_MAP_KEY_TYPE, value: GENERIC_MAP_VALUE_TYPE][];
18
+ constructor(keyType: string, valueType: string, ueType: string, index: number);
19
+ static Parse(reader: BinaryReadable, propertyName: string, buildVersion: number, size: number, ueType?: string, index?: number): MapProperty;
20
+ static CalcOverhead(property: MapProperty): number;
21
+ static Serialize(writer: ByteWriter, property: MapProperty): void;
22
+ }
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MapProperty = exports.isMapProperty = void 0;
4
+ const BasicProperty_1 = require("./BasicProperty");
5
+ const ByteProperty_1 = require("./ByteProperty");
6
+ const EnumProperty_1 = require("./EnumProperty");
7
+ const Int32Property_1 = require("./Int32Property");
8
+ const Int64Property_1 = require("./Int64Property");
9
+ const ObjectProperty_1 = require("./ObjectProperty");
10
+ const StrProperty_1 = require("./StrProperty");
11
+ const StructProperty_1 = require("./StructProperty");
12
+ const isMapProperty = (property) => property.type === 'MapProperty';
13
+ exports.isMapProperty = isMapProperty;
14
+ class MapProperty extends BasicProperty_1.BasicProperty {
15
+ constructor(keyType, valueType, ueType, index) {
16
+ super({ type: 'MapProperty', ueType, index });
17
+ this.keyType = keyType;
18
+ this.valueType = valueType;
19
+ this.modeType = 0;
20
+ this.modeUnk2 = '';
21
+ this.modeUnk3 = '';
22
+ this.values = [];
23
+ }
24
+ static Parse(reader, propertyName, buildVersion, size, ueType = 'MapProperty', index = 0) {
25
+ const start = reader.getBufferPosition();
26
+ const property = new MapProperty(reader.readString(), reader.readString(), ueType, index);
27
+ const unk = reader.readByte();
28
+ property.modeType = reader.readInt32();
29
+ const elementCount = reader.readInt32();
30
+ for (let i = 0; i < elementCount; i++) {
31
+ let key;
32
+ let value;
33
+ switch (property.keyType) {
34
+ case 'StructProperty':
35
+ if (propertyName === 'mSaveData' || propertyName === 'mUnresolvedSaveData') {
36
+ key = Array.from(reader.readBytes(12));
37
+ }
38
+ else {
39
+ key = (0, StructProperty_1.ParseDynamicStructData)(reader, 0, property.keyType);
40
+ }
41
+ break;
42
+ case 'ObjectProperty':
43
+ key = ObjectProperty_1.ObjectProperty.ReadValue(reader);
44
+ break;
45
+ case 'StrProperty':
46
+ case 'NameProperty':
47
+ key = StrProperty_1.StrProperty.ReadValue(reader);
48
+ break;
49
+ case 'EnumProperty':
50
+ key = EnumProperty_1.EnumProperty.ReadValue(reader);
51
+ break;
52
+ case 'IntProperty':
53
+ case 'Int32Property':
54
+ key = Int32Property_1.Int32Property.ReadValue(reader);
55
+ break;
56
+ case 'ByteProperty':
57
+ key = ByteProperty_1.ByteProperty.ReadValue(reader);
58
+ break;
59
+ default:
60
+ throw new Error(`not implemented map key type ${property.keyType}`);
61
+ }
62
+ switch (property.valueType) {
63
+ case 'StructProperty':
64
+ value = (0, StructProperty_1.ParseDynamicStructData)(reader, 0, property.valueType);
65
+ break;
66
+ case 'ObjectProperty':
67
+ value = ObjectProperty_1.ObjectProperty.ReadValue(reader);
68
+ break;
69
+ case 'StrProperty':
70
+ case 'NameProperty':
71
+ value = StrProperty_1.StrProperty.ReadValue(reader);
72
+ break;
73
+ case 'EnumProperty':
74
+ value = EnumProperty_1.EnumProperty.ReadValue(reader);
75
+ break;
76
+ case 'IntProperty':
77
+ case 'Int32Property':
78
+ value = Int32Property_1.Int32Property.ReadValue(reader);
79
+ break;
80
+ case 'Int64Property':
81
+ value = Int64Property_1.Int64Property.ReadValue(reader);
82
+ break;
83
+ case 'ByteProperty':
84
+ value = ByteProperty_1.ByteProperty.ReadValue(reader);
85
+ break;
86
+ default:
87
+ throw new Error(`not implemented map value type ${property.valueType}`);
88
+ }
89
+ property.values.push([key, value]);
90
+ }
91
+ return property;
92
+ }
93
+ static CalcOverhead(property) {
94
+ return property.keyType.length + 5 + property.valueType.length + 5 + 1;
95
+ }
96
+ static Serialize(writer, property) {
97
+ writer.writeString(property.keyType);
98
+ writer.writeString(property.valueType);
99
+ writer.writeByte(0);
100
+ writer.writeInt32(property.modeType);
101
+ writer.writeInt32(property.values.length);
102
+ for (const entry of property.values) {
103
+ switch (property.keyType) {
104
+ case 'StructProperty':
105
+ if (property.name === 'mSaveData' || property.name === 'mUnresolvedSaveData') {
106
+ writer.writeBytesArray(entry[0]);
107
+ }
108
+ else {
109
+ (0, StructProperty_1.SerializeDynamicStructData)(writer, 0, entry[0]);
110
+ }
111
+ break;
112
+ case 'ObjectProperty':
113
+ ObjectProperty_1.ObjectProperty.SerializeValue(writer, entry[0]);
114
+ break;
115
+ case 'StrProperty':
116
+ case 'NameProperty':
117
+ StrProperty_1.StrProperty.SerializeValue(writer, entry[0]);
118
+ break;
119
+ case 'EnumProperty':
120
+ EnumProperty_1.EnumProperty.SerializeValue(writer, entry[0]);
121
+ break;
122
+ case 'IntProperty':
123
+ case 'Int32Property':
124
+ Int32Property_1.Int32Property.SerializeValue(writer, entry[0]);
125
+ break;
126
+ case 'ByteProperty':
127
+ ByteProperty_1.ByteProperty.SerializeValue(writer, entry[0]);
128
+ break;
129
+ default:
130
+ throw new Error(`not implemented map key type ${property.valueType}`);
131
+ }
132
+ switch (property.valueType) {
133
+ case 'StructProperty':
134
+ (0, StructProperty_1.SerializeDynamicStructData)(writer, 0, entry[1]);
135
+ break;
136
+ case 'ObjectProperty':
137
+ ObjectProperty_1.ObjectProperty.SerializeValue(writer, entry[1]);
138
+ break;
139
+ case 'StrProperty':
140
+ case 'NameProperty':
141
+ StrProperty_1.StrProperty.SerializeValue(writer, entry[1]);
142
+ break;
143
+ case 'EnumProperty':
144
+ EnumProperty_1.EnumProperty.SerializeValue(writer, entry[1]);
145
+ break;
146
+ case 'IntProperty':
147
+ case 'Int32Property':
148
+ Int32Property_1.Int32Property.SerializeValue(writer, entry[1]);
149
+ break;
150
+ case 'Int64Property':
151
+ Int64Property_1.Int64Property.SerializeValue(writer, entry[1]);
152
+ break;
153
+ case 'ByteProperty':
154
+ ByteProperty_1.ByteProperty.SerializeValue(writer, entry[1]);
155
+ break;
156
+ default:
157
+ throw new Error(`not implemented map value type ${property.valueType}`);
158
+ }
159
+ }
160
+ }
161
+ }
162
+ exports.MapProperty = MapProperty;
@@ -0,0 +1,15 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { ObjectReference } from '../../structs/ObjectReference';
5
+ import { BasicProperty } from './BasicProperty';
6
+ export declare const isObjectProperty: (property: BasicProperty) => property is ObjectProperty;
7
+ export declare class ObjectProperty extends BasicProperty {
8
+ value: ObjectReference;
9
+ constructor(value: ObjectReference, ueType?: string, guidInfo?: GUIDInfo, index?: number);
10
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): ObjectProperty;
11
+ static ReadValue(reader: BinaryReadable): ObjectReference;
12
+ static CalcOverhead(property: ObjectProperty): number;
13
+ static Serialize(writer: ByteWriter, property: ObjectProperty): void;
14
+ static SerializeValue(writer: ByteWriter, value: ObjectReference): void;
15
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObjectProperty = exports.isObjectProperty = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isObjectProperty = (property) => property.type === 'ObjectProperty';
7
+ exports.isObjectProperty = isObjectProperty;
8
+ class ObjectProperty extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'ObjectProperty', guidInfo = undefined, index = 0) {
10
+ super({ type: 'ObjectProperty', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
15
+ const value = ObjectProperty.ReadValue(reader);
16
+ return new ObjectProperty(value, ueType, guidInfo, index);
17
+ }
18
+ static ReadValue(reader) {
19
+ const x = {
20
+ levelName: reader.readString(),
21
+ pathName: reader.readString()
22
+ };
23
+ return x;
24
+ }
25
+ static CalcOverhead(property) {
26
+ return 1;
27
+ }
28
+ static Serialize(writer, property) {
29
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
30
+ ObjectProperty.SerializeValue(writer, property.value);
31
+ }
32
+ static SerializeValue(writer, value) {
33
+ writer.writeString(value.levelName);
34
+ writer.writeString(value.pathName);
35
+ }
36
+ }
37
+ exports.ObjectProperty = ObjectProperty;
@@ -0,0 +1,12 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { BasicProperty } from './BasicProperty';
4
+ export declare const isSetProperty: (property: BasicProperty) => property is SetProperty<any>;
5
+ export declare class SetProperty<T> extends BasicProperty {
6
+ subtype: string;
7
+ values: T[];
8
+ constructor(subtype: string, values: T[], ueType: string, index: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index: number, propertyName: string): SetProperty<any>;
10
+ static CalcOverhead(property: SetProperty<any>): number;
11
+ static Serialize(writer: ByteWriter, property: SetProperty<any>): void;
12
+ }
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetProperty = exports.isSetProperty = void 0;
4
+ const GUID_1 = require("../../structs/GUID");
5
+ const vec3_1 = require("../../structs/vec3");
6
+ const BasicProperty_1 = require("./BasicProperty");
7
+ const Int32Property_1 = require("./Int32Property");
8
+ const ObjectProperty_1 = require("./ObjectProperty");
9
+ const StrProperty_1 = require("./StrProperty");
10
+ const Uint32Property_1 = require("./Uint32Property");
11
+ const isSetProperty = (property) => property.type === 'SetProperty';
12
+ exports.isSetProperty = isSetProperty;
13
+ class SetProperty extends BasicProperty_1.BasicProperty {
14
+ constructor(subtype, values, ueType, index) {
15
+ super({ type: 'SetProperty', ueType, index });
16
+ this.subtype = subtype;
17
+ this.values = values;
18
+ }
19
+ static Parse(reader, ueType, index, propertyName) {
20
+ const subtype = reader.readString();
21
+ const unk2 = reader.skipBytes(1);
22
+ const unk3 = reader.skipBytes(4);
23
+ const elementCount = reader.readInt32();
24
+ let property;
25
+ switch (subtype) {
26
+ case "UInt32Property":
27
+ property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => Uint32Property_1.Uint32Property.ReadValue(reader)), ueType, index);
28
+ break;
29
+ case "IntProperty":
30
+ property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => Int32Property_1.Int32Property.ReadValue(reader)), ueType, index);
31
+ break;
32
+ case "ObjectProperty":
33
+ property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => ObjectProperty_1.ObjectProperty.ReadValue(reader)), ueType, index);
34
+ break;
35
+ case "NameProperty":
36
+ property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => StrProperty_1.StrProperty.ReadValue(reader)), ueType, index);
37
+ break;
38
+ case "StructProperty":
39
+ if (propertyName === 'mRemovalLocations') {
40
+ property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => vec3_1.vec3.ParseF(reader)), ueType, index);
41
+ }
42
+ if (propertyName === 'mDestroyedPickups' || propertyName === 'mLootedDropPods') {
43
+ property = new SetProperty(subtype, new Array(elementCount).fill(0).map(() => GUID_1.GUID.read(reader)), ueType, index);
44
+ }
45
+ else {
46
+ throw new Error(`Not Implemented SetProperty of StructProperty for property ${propertyName}.`);
47
+ }
48
+ break;
49
+ default:
50
+ throw new Error(`Not Implemented SetProperty of ${subtype}.`);
51
+ }
52
+ return property;
53
+ }
54
+ static CalcOverhead(property) {
55
+ return property.subtype.length + 5 + 1;
56
+ }
57
+ static Serialize(writer, property) {
58
+ writer.writeString(property.subtype);
59
+ writer.writeByte(0);
60
+ writer.writeInt32(0);
61
+ writer.writeInt32(property.values.length);
62
+ switch (property.subtype) {
63
+ case "IntProperty":
64
+ case "Int32Property":
65
+ property.values.forEach(v => Int32Property_1.Int32Property.SerializeValue(writer, v));
66
+ break;
67
+ case "UIntProperty":
68
+ case "UInt32Property":
69
+ property.values.forEach(v => Uint32Property_1.Uint32Property.SerializeValue(writer, v));
70
+ break;
71
+ case "ObjectProperty":
72
+ property.values.forEach(v => ObjectProperty_1.ObjectProperty.SerializeValue(writer, v));
73
+ break;
74
+ case "NameProperty":
75
+ property.values.forEach(v => StrProperty_1.StrProperty.SerializeValue(writer, v));
76
+ break;
77
+ case "StructProperty":
78
+ if (property.name === 'mRemovalLocations') {
79
+ console.warn('serializing mRemovalLocations, this is still under investigation.');
80
+ property.values.forEach(v => vec3_1.vec3.SerializeF(writer, v));
81
+ }
82
+ else if (property.name === 'mDestroyedPickups' || property.name === 'mLootedDropPods') {
83
+ property.values.forEach(v => GUID_1.GUID.write(writer, v));
84
+ }
85
+ else {
86
+ throw new Error(`Not Implemented serializing SetProperty of StructProperty for property ${property.name}.`);
87
+ }
88
+ break;
89
+ default:
90
+ throw new Error(`Not Implemented SetProperty of ${property.subtype}.`);
91
+ }
92
+ }
93
+ }
94
+ exports.SetProperty = SetProperty;
@@ -0,0 +1,13 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { SoftObjectReference } from '../../structs/SoftObjectReference';
5
+ import { BasicProperty } from './BasicProperty';
6
+ export declare const isSoftObjectProperty: (property: BasicProperty) => property is SoftObjectProperty;
7
+ export declare class SoftObjectProperty extends BasicProperty {
8
+ value: SoftObjectReference;
9
+ constructor(value: SoftObjectReference, ueType?: string, guidInfo?: GUIDInfo, index?: number);
10
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): SoftObjectProperty;
11
+ static CalcOverhead(property: SoftObjectProperty): number;
12
+ static Serialize(writer: ByteWriter, property: SoftObjectProperty): void;
13
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SoftObjectProperty = exports.isSoftObjectProperty = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const SoftObjectReference_1 = require("../../structs/SoftObjectReference");
6
+ const BasicProperty_1 = require("./BasicProperty");
7
+ const isSoftObjectProperty = (property) => property.type === 'SoftObjectProperty';
8
+ exports.isSoftObjectProperty = isSoftObjectProperty;
9
+ class SoftObjectProperty extends BasicProperty_1.BasicProperty {
10
+ constructor(value, ueType = 'SoftObjectProperty', guidInfo = undefined, index = 0) {
11
+ super({ type: 'SoftObjectProperty', ueType, guidInfo, index });
12
+ this.value = value;
13
+ }
14
+ static Parse(reader, ueType, index = 0) {
15
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
16
+ const value = SoftObjectReference_1.SoftObjectReference.read(reader);
17
+ return new SoftObjectProperty(value, ueType, guidInfo, index);
18
+ }
19
+ static CalcOverhead(property) {
20
+ return 1;
21
+ }
22
+ static Serialize(writer, property) {
23
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
24
+ SoftObjectReference_1.SoftObjectReference.write(writer, property.value);
25
+ }
26
+ }
27
+ exports.SoftObjectProperty = SoftObjectProperty;
@@ -0,0 +1,14 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isStrProperty: (property: BasicProperty) => property is StrProperty;
6
+ export declare class StrProperty extends BasicProperty {
7
+ value: string;
8
+ constructor(value: string, ueType?: string, guidInfo?: GUIDInfo, index?: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): StrProperty;
10
+ static ReadValue(reader: BinaryReadable): string;
11
+ static CalcOverhead(property: StrProperty): number;
12
+ static Serialize(writer: ByteWriter, property: StrProperty): void;
13
+ static SerializeValue(writer: ByteWriter, value: string): void;
14
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StrProperty = exports.isStrProperty = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isStrProperty = (property) => property.type === 'StrProperty';
7
+ exports.isStrProperty = isStrProperty;
8
+ class StrProperty extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'StrProperty', guidInfo = undefined, index = 0) {
10
+ super({ type: 'StrProperty', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
15
+ const value = StrProperty.ReadValue(reader);
16
+ return new StrProperty(value, ueType, guidInfo, index);
17
+ }
18
+ static ReadValue(reader) {
19
+ return reader.readString();
20
+ }
21
+ static CalcOverhead(property) {
22
+ return 1;
23
+ }
24
+ static Serialize(writer, property) {
25
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
26
+ StrProperty.SerializeValue(writer, property.value);
27
+ }
28
+ static SerializeValue(writer, value) {
29
+ writer.writeString(value);
30
+ }
31
+ }
32
+ exports.StrProperty = StrProperty;
@@ -0,0 +1,69 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { col4 } from '../../structs/col4';
4
+ import { vec3 } from '../../structs/vec3';
5
+ import { vec4 } from '../../structs/vec4';
6
+ import { AbstractBaseProperty, PropertiesMap } from './BasicProperty';
7
+ export type BasicMultipleStructPropertyValue = {
8
+ values: any;
9
+ };
10
+ export type BasicStructPropertyValue = {
11
+ value: any;
12
+ };
13
+ export type BoxStructPropertyValue = {
14
+ min: vec3;
15
+ max: vec3;
16
+ isValid: boolean;
17
+ };
18
+ export type RailroadTrackPositionStructPropertyValue = {
19
+ root: string;
20
+ instanceName: string;
21
+ offset: number;
22
+ forward: number;
23
+ };
24
+ export type InventoryItemStructPropertyValue = {
25
+ unk1: number;
26
+ itemName: string;
27
+ hasItemState: number;
28
+ itemState?: {
29
+ unk: number;
30
+ pathName: string;
31
+ binarySize: number;
32
+ itemStateRaw: number[];
33
+ };
34
+ };
35
+ export type FICFrameRangeStructPropertyValue = {
36
+ begin: string;
37
+ end: string;
38
+ };
39
+ export type DynamicStructPropertyValue = {
40
+ type: string;
41
+ properties: PropertiesMap;
42
+ };
43
+ export type ClientIdentityInfo = {
44
+ offlineId: string;
45
+ accountIds: Record<number, number[]>;
46
+ };
47
+ export type GENERIC_STRUCT_PROPERTY_VALUE = BasicMultipleStructPropertyValue | BasicStructPropertyValue | BoxStructPropertyValue | RailroadTrackPositionStructPropertyValue | InventoryItemStructPropertyValue | FICFrameRangeStructPropertyValue | ClientIdentityInfo | DynamicStructPropertyValue | col4 | vec3 | vec4 | string;
48
+ export declare const isStructProperty: (property: AbstractBaseProperty) => property is StructProperty;
49
+ export declare class StructProperty extends AbstractBaseProperty {
50
+ subtype: string;
51
+ guid: number;
52
+ value: GENERIC_STRUCT_PROPERTY_VALUE;
53
+ unk1?: number;
54
+ unk2?: number;
55
+ unk3?: number;
56
+ unk4?: number;
57
+ constructor(subtype: string, ueType?: string, index?: number, guid?: number);
58
+ static Parse(reader: BinaryReadable, ueType: string, index: number, size: number): StructProperty;
59
+ static ParseValue(reader: BinaryReadable, subtype: string, size: number): GENERIC_STRUCT_PROPERTY_VALUE;
60
+ static CalcOverhead(property: StructProperty): number;
61
+ static Serialize(writer: ByteWriter, property: StructProperty): void;
62
+ static SerializeValue(writer: ByteWriter, subtype: string, value: GENERIC_STRUCT_PROPERTY_VALUE): void;
63
+ }
64
+ export declare const ParseDynamicStructData: (reader: BinaryReadable, buildVersion: number, type: string) => DynamicStructPropertyValue;
65
+ export declare const SerializeDynamicStructData: (writer: ByteWriter, buildVersion: number, data: DynamicStructPropertyValue) => void;
66
+ export declare const ReadFINNetworkTrace: (reader: BinaryReadable) => any;
67
+ export declare const SerializeFINNetworkTrace: (writer: ByteWriter, obj: any) => void;
68
+ export declare const ReadFINLuaProcessorStateStorage: (reader: BinaryReadable, size: number) => any;
69
+ export declare const SerializeFINLuaProcessorStateStorage: (writer: ByteWriter, stateStorage: any) => void;