@etothepii/satisfactory-file-parser 0.1.26 → 0.1.27
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/build/index.js +60 -25
- package/build/parser/byte/alignment.enum.js +5 -2
- package/build/parser/byte/binary-operable.interface.js +2 -1
- package/build/parser/byte/binary-readable.interface.js +2 -1
- package/build/parser/byte/byte-reader.class.js +14 -10
- package/build/parser/byte/byte-writer.class.js +13 -10
- package/build/parser/error/parser.error.js +15 -6
- package/build/parser/file.types.js +5 -2
- package/build/parser/parser.js +26 -23
- package/build/parser/satisfactory/blueprint/blueprint-reader.js +36 -28
- package/build/parser/satisfactory/blueprint/blueprint-writer.js +25 -20
- package/build/parser/satisfactory/blueprint/blueprint.types.js +2 -1
- package/build/parser/satisfactory/objects/DataFields.js +83 -79
- package/build/parser/satisfactory/objects/GUIDInfo.js +8 -5
- package/build/parser/satisfactory/objects/ObjectReference.js +5 -2
- package/build/parser/satisfactory/objects/Property.js +120 -91
- package/build/parser/satisfactory/objects/SaveComponent.js +11 -7
- package/build/parser/satisfactory/objects/SaveEntity.js +17 -13
- package/build/parser/satisfactory/objects/SaveObject.js +8 -4
- package/build/parser/satisfactory/objects/ue/GUID.js +5 -2
- package/build/parser/satisfactory/objects/ue/MD5Hash.js +5 -2
- package/build/parser/satisfactory/save/asynchronous-level.class.js +16 -12
- package/build/parser/satisfactory/save/level.class.js +28 -24
- package/build/parser/satisfactory/save/satisfactory-save.js +5 -1
- package/build/parser/satisfactory/save/save-reader.js +34 -28
- package/build/parser/satisfactory/save/save-writer.js +40 -34
- package/build/parser/satisfactory/save/save.types.js +2 -1
- package/build/parser/satisfactory/structs/util.types.js +63 -37
- package/build/parser/stream/byte-stream-reader.class.js +21 -17
- package/build/parser/stream/json-stream-state-writer.js +6 -2
- package/build/parser/stream/json-stream-writable.js +5 -1
- package/build/parser/stream/json-stream-writer.js +6 -2
- package/build/parser/stream/reworked/readable-stream-parser.js +24 -21
- package/build/parser/stream/reworked/stream-parser.js +20 -17
- package/build/parser/stream/save-stream-json-stringifier.js +7 -3
- package/build/parser/stream/save-stream-reader.class.js +24 -18
- package/build/parser/stream/save-stream-writer.class.js +5 -1
- package/build/parser/stream/stream-level.class.js +15 -11
- package/build/parser/stream/stream-parser.js +15 -11
- package/package.json +1 -1
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SerializeFINLuaProcessorStateStorage = exports.ReadFINLuaProcessorStateStorage = exports.SerializeFINNetworkTrace = exports.ReadFINNetworkTrace = exports.SerializeDynamicStructData = exports.ParseDynamicStructData = exports.MapProperty = exports.SetProperty = exports.ArrayProperty = exports.StructProperty = exports.TextProperty = exports.EnumProperty = exports.ObjectProperty = exports.StrProperty = exports.DoubleProperty = exports.FloatProperty = exports.Int64Property = exports.Uint32Property = exports.Int32Property = exports.Uint8Property = exports.Int8Property = exports.ByteProperty = exports.BoolProperty = exports.BasicProperty = exports.AbstractBaseProperty = exports.AbstractProperty = void 0;
|
|
4
|
+
const util_types_1 = require("../structs/util.types");
|
|
5
|
+
const DataFields_1 = require("./DataFields");
|
|
6
|
+
const GUIDInfo_1 = require("./GUIDInfo");
|
|
7
|
+
const ObjectReference_1 = require("./ObjectReference");
|
|
8
|
+
class AbstractProperty {
|
|
6
9
|
constructor(type, index) {
|
|
7
10
|
this.type = type;
|
|
8
11
|
this.index = index;
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
|
-
|
|
14
|
+
exports.AbstractProperty = AbstractProperty;
|
|
15
|
+
class AbstractBaseProperty extends AbstractProperty {
|
|
12
16
|
constructor(type, ueType, index) {
|
|
13
17
|
super(type, index && index !== 0 ? index : undefined);
|
|
14
18
|
this.ueType = ueType;
|
|
15
19
|
this.name = '';
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
|
-
|
|
22
|
+
exports.AbstractBaseProperty = AbstractBaseProperty;
|
|
23
|
+
class BasicProperty extends AbstractBaseProperty {
|
|
19
24
|
constructor(type, ueType, guidInfo, index = 0) {
|
|
20
25
|
super(type, ueType, index);
|
|
21
26
|
this.guidInfo = guidInfo;
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
|
-
|
|
29
|
+
exports.BasicProperty = BasicProperty;
|
|
30
|
+
class BoolProperty extends BasicProperty {
|
|
25
31
|
constructor(value, ueType = 'BoolProperty', guidInfo = undefined, index = 0) {
|
|
26
32
|
super('BoolProperty', ueType, guidInfo, index);
|
|
27
33
|
this.value = value;
|
|
28
34
|
}
|
|
29
35
|
static Parse(reader, ueType, index = 0) {
|
|
30
36
|
const value = BoolProperty.ReadValue(reader);
|
|
31
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
37
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
32
38
|
return new BoolProperty(value, ueType, guidInfo, index);
|
|
33
39
|
}
|
|
34
40
|
static ReadValue(reader) {
|
|
@@ -39,20 +45,21 @@ export class BoolProperty extends BasicProperty {
|
|
|
39
45
|
}
|
|
40
46
|
static Serialize(writer, property) {
|
|
41
47
|
BoolProperty.SerializeValue(writer, property.value);
|
|
42
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
48
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
43
49
|
}
|
|
44
50
|
static SerializeValue(writer, value) {
|
|
45
51
|
writer.writeByte(value ? 1 : 0);
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
|
-
|
|
54
|
+
exports.BoolProperty = BoolProperty;
|
|
55
|
+
class ByteProperty extends BasicProperty {
|
|
49
56
|
constructor(value, ueType = 'ByteProperty', guidInfo = undefined, index = 0) {
|
|
50
57
|
super('ByteProperty', ueType, guidInfo, index);
|
|
51
58
|
this.value = value;
|
|
52
59
|
}
|
|
53
60
|
static Parse(reader, ueType, index = 0) {
|
|
54
61
|
const type = reader.readString();
|
|
55
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
62
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
56
63
|
let value;
|
|
57
64
|
if (type === 'None') {
|
|
58
65
|
value = {
|
|
@@ -77,7 +84,7 @@ export class ByteProperty extends BasicProperty {
|
|
|
77
84
|
}
|
|
78
85
|
static Serialize(writer, property) {
|
|
79
86
|
writer.writeString(property.value.type);
|
|
80
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
87
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
81
88
|
if (property.value.type === 'None') {
|
|
82
89
|
ByteProperty.SerializeValue(writer, property.value.value);
|
|
83
90
|
}
|
|
@@ -89,13 +96,14 @@ export class ByteProperty extends BasicProperty {
|
|
|
89
96
|
writer.writeByte(value);
|
|
90
97
|
}
|
|
91
98
|
}
|
|
92
|
-
|
|
99
|
+
exports.ByteProperty = ByteProperty;
|
|
100
|
+
class Int8Property extends BasicProperty {
|
|
93
101
|
constructor(value, ueType = 'Int8Property', guidInfo = undefined, index = 0) {
|
|
94
102
|
super('Int8Property', ueType, guidInfo, index);
|
|
95
103
|
this.value = value;
|
|
96
104
|
}
|
|
97
105
|
static Parse(reader, ueType, index = 0) {
|
|
98
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
106
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
99
107
|
const value = Int8Property.ReadValue(reader);
|
|
100
108
|
return new Int8Property(value, ueType, guidInfo, index);
|
|
101
109
|
}
|
|
@@ -106,20 +114,21 @@ export class Int8Property extends BasicProperty {
|
|
|
106
114
|
return 1;
|
|
107
115
|
}
|
|
108
116
|
static Serialize(writer, property) {
|
|
109
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
117
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
110
118
|
Int8Property.SerializeValue(writer, property.value);
|
|
111
119
|
}
|
|
112
120
|
static SerializeValue(writer, value) {
|
|
113
121
|
writer.writeInt8(value);
|
|
114
122
|
}
|
|
115
123
|
}
|
|
116
|
-
|
|
124
|
+
exports.Int8Property = Int8Property;
|
|
125
|
+
class Uint8Property extends BasicProperty {
|
|
117
126
|
constructor(value, ueType = 'UInt8Property', guidInfo = undefined, index = 0) {
|
|
118
127
|
super('UInt8Property', ueType, guidInfo, index);
|
|
119
128
|
this.value = value;
|
|
120
129
|
}
|
|
121
130
|
static Parse(reader, ueType, index = 0) {
|
|
122
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
131
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
123
132
|
const value = Uint8Property.ReadValue(reader);
|
|
124
133
|
return new Uint8Property(value, ueType, guidInfo, index);
|
|
125
134
|
}
|
|
@@ -130,20 +139,21 @@ export class Uint8Property extends BasicProperty {
|
|
|
130
139
|
throw new Error('Unimplemented.');
|
|
131
140
|
}
|
|
132
141
|
static Serialize(writer, property) {
|
|
133
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
142
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
134
143
|
Uint8Property.SerializeValue(writer, property.value);
|
|
135
144
|
}
|
|
136
145
|
static SerializeValue(writer, value) {
|
|
137
146
|
writer.writeUint8(value);
|
|
138
147
|
}
|
|
139
148
|
}
|
|
140
|
-
|
|
149
|
+
exports.Uint8Property = Uint8Property;
|
|
150
|
+
class Int32Property extends BasicProperty {
|
|
141
151
|
constructor(value, ueType = 'IntProperty', guidInfo = undefined, index = 0) {
|
|
142
152
|
super('Int32Property', ueType, guidInfo, index);
|
|
143
153
|
this.value = value;
|
|
144
154
|
}
|
|
145
155
|
static Parse(reader, ueType, index = 0) {
|
|
146
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
156
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
147
157
|
const value = Int32Property.ReadValue(reader);
|
|
148
158
|
return new Int32Property(value, ueType, guidInfo, index);
|
|
149
159
|
}
|
|
@@ -154,20 +164,21 @@ export class Int32Property extends BasicProperty {
|
|
|
154
164
|
return 1;
|
|
155
165
|
}
|
|
156
166
|
static Serialize(writer, property) {
|
|
157
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
167
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
158
168
|
Int32Property.SerializeValue(writer, property.value);
|
|
159
169
|
}
|
|
160
170
|
static SerializeValue(writer, value) {
|
|
161
171
|
writer.writeInt32(value);
|
|
162
172
|
}
|
|
163
173
|
}
|
|
164
|
-
|
|
174
|
+
exports.Int32Property = Int32Property;
|
|
175
|
+
class Uint32Property extends BasicProperty {
|
|
165
176
|
constructor(value, ueType = 'UInt32Property', guidInfo = undefined, index = 0) {
|
|
166
177
|
super('UInt32Property', ueType, guidInfo, index);
|
|
167
178
|
this.value = value;
|
|
168
179
|
}
|
|
169
180
|
static Parse(reader, ueType, index = 0) {
|
|
170
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
181
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
171
182
|
const value = Uint32Property.ReadValue(reader);
|
|
172
183
|
return new Uint32Property(value, ueType, guidInfo, index);
|
|
173
184
|
}
|
|
@@ -178,20 +189,21 @@ export class Uint32Property extends BasicProperty {
|
|
|
178
189
|
return 1;
|
|
179
190
|
}
|
|
180
191
|
static Serialize(writer, property) {
|
|
181
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
192
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
182
193
|
Uint32Property.SerializeValue(writer, property.value);
|
|
183
194
|
}
|
|
184
195
|
static SerializeValue(writer, value) {
|
|
185
196
|
writer.writeUint32(value);
|
|
186
197
|
}
|
|
187
198
|
}
|
|
188
|
-
|
|
199
|
+
exports.Uint32Property = Uint32Property;
|
|
200
|
+
class Int64Property extends BasicProperty {
|
|
189
201
|
constructor(value, ueType = 'Int64Property', guidInfo = undefined, index = 0) {
|
|
190
202
|
super('Int64Property', ueType, guidInfo, index);
|
|
191
203
|
this.value = value;
|
|
192
204
|
}
|
|
193
205
|
static Parse(reader, ueType, index = 0) {
|
|
194
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
206
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
195
207
|
const value = Int64Property.ReadValue(reader);
|
|
196
208
|
return new Int64Property(value, ueType, guidInfo, index);
|
|
197
209
|
}
|
|
@@ -202,20 +214,21 @@ export class Int64Property extends BasicProperty {
|
|
|
202
214
|
return 1;
|
|
203
215
|
}
|
|
204
216
|
static Serialize(writer, property) {
|
|
205
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
217
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
206
218
|
Int64Property.SerializeValue(writer, property.value);
|
|
207
219
|
}
|
|
208
220
|
static SerializeValue(writer, value) {
|
|
209
221
|
writer.writeInt64(BigInt(value));
|
|
210
222
|
}
|
|
211
223
|
}
|
|
212
|
-
|
|
224
|
+
exports.Int64Property = Int64Property;
|
|
225
|
+
class FloatProperty extends BasicProperty {
|
|
213
226
|
constructor(value, ueType = 'FloatProperty', guidInfo = undefined, index = 0) {
|
|
214
227
|
super('FloatProperty', ueType, guidInfo, index);
|
|
215
228
|
this.value = value;
|
|
216
229
|
}
|
|
217
230
|
static Parse(reader, ueType, index = 0) {
|
|
218
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
231
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
219
232
|
const value = FloatProperty.ReadValue(reader);
|
|
220
233
|
return new FloatProperty(value, ueType, guidInfo, index);
|
|
221
234
|
}
|
|
@@ -226,20 +239,21 @@ export class FloatProperty extends BasicProperty {
|
|
|
226
239
|
return reader.readFloat32();
|
|
227
240
|
}
|
|
228
241
|
static Serialize(writer, property) {
|
|
229
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
242
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
230
243
|
FloatProperty.SerializeValue(writer, property.value);
|
|
231
244
|
}
|
|
232
245
|
static SerializeValue(writer, value) {
|
|
233
246
|
writer.writeFloat(value);
|
|
234
247
|
}
|
|
235
248
|
}
|
|
236
|
-
|
|
249
|
+
exports.FloatProperty = FloatProperty;
|
|
250
|
+
class DoubleProperty extends BasicProperty {
|
|
237
251
|
constructor(value, ueType = 'DoubleProperty', guidInfo = undefined, index = 0) {
|
|
238
252
|
super('DoubleProperty', ueType, guidInfo, index);
|
|
239
253
|
this.value = value;
|
|
240
254
|
}
|
|
241
255
|
static Parse(reader, ueType, index = 0) {
|
|
242
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
256
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
243
257
|
const value = DoubleProperty.ReadValue(reader);
|
|
244
258
|
return new DoubleProperty(value, ueType, guidInfo, index);
|
|
245
259
|
}
|
|
@@ -250,20 +264,21 @@ export class DoubleProperty extends BasicProperty {
|
|
|
250
264
|
return 1;
|
|
251
265
|
}
|
|
252
266
|
static Serialize(writer, property) {
|
|
253
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
267
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
254
268
|
DoubleProperty.SerializeValue(writer, property.value);
|
|
255
269
|
}
|
|
256
270
|
static SerializeValue(writer, value) {
|
|
257
271
|
writer.writeDouble(value);
|
|
258
272
|
}
|
|
259
273
|
}
|
|
260
|
-
|
|
274
|
+
exports.DoubleProperty = DoubleProperty;
|
|
275
|
+
class StrProperty extends BasicProperty {
|
|
261
276
|
constructor(value, ueType = 'StrProperty', guidInfo = undefined, index = 0) {
|
|
262
277
|
super('StrProperty', ueType, guidInfo, index);
|
|
263
278
|
this.value = value;
|
|
264
279
|
}
|
|
265
280
|
static Parse(reader, ueType, index = 0) {
|
|
266
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
281
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
267
282
|
const value = StrProperty.ReadValue(reader);
|
|
268
283
|
return new StrProperty(value, ueType, guidInfo, index);
|
|
269
284
|
}
|
|
@@ -274,20 +289,21 @@ export class StrProperty extends BasicProperty {
|
|
|
274
289
|
return 1;
|
|
275
290
|
}
|
|
276
291
|
static Serialize(writer, property) {
|
|
277
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
292
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
278
293
|
StrProperty.SerializeValue(writer, property.value);
|
|
279
294
|
}
|
|
280
295
|
static SerializeValue(writer, value) {
|
|
281
296
|
writer.writeString(value);
|
|
282
297
|
}
|
|
283
298
|
}
|
|
284
|
-
|
|
299
|
+
exports.StrProperty = StrProperty;
|
|
300
|
+
class ObjectProperty extends BasicProperty {
|
|
285
301
|
constructor(value, ueType = 'ObjectProperty', guidInfo = undefined, index = 0) {
|
|
286
302
|
super('ObjectProperty', ueType, guidInfo, index);
|
|
287
303
|
this.value = value;
|
|
288
304
|
}
|
|
289
305
|
static Parse(reader, ueType, index = 0) {
|
|
290
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
306
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
291
307
|
const value = ObjectProperty.ReadValue(reader);
|
|
292
308
|
return new ObjectProperty(value, ueType, guidInfo, index);
|
|
293
309
|
}
|
|
@@ -302,7 +318,7 @@ export class ObjectProperty extends BasicProperty {
|
|
|
302
318
|
return 1;
|
|
303
319
|
}
|
|
304
320
|
static Serialize(writer, property) {
|
|
305
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
321
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
306
322
|
ObjectProperty.SerializeValue(writer, property.value);
|
|
307
323
|
}
|
|
308
324
|
static SerializeValue(writer, value) {
|
|
@@ -310,14 +326,15 @@ export class ObjectProperty extends BasicProperty {
|
|
|
310
326
|
writer.writeString(value.pathName);
|
|
311
327
|
}
|
|
312
328
|
}
|
|
313
|
-
|
|
329
|
+
exports.ObjectProperty = ObjectProperty;
|
|
330
|
+
class EnumProperty extends BasicProperty {
|
|
314
331
|
constructor(value, ueType = 'EnumProperty', guidInfo = undefined, index = 0) {
|
|
315
332
|
super('EnumProperty', ueType, guidInfo, index);
|
|
316
333
|
this.value = value;
|
|
317
334
|
}
|
|
318
335
|
static Parse(reader, ueType, index = 0) {
|
|
319
336
|
let name = reader.readString();
|
|
320
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
337
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
321
338
|
const value = EnumProperty.ReadValue(reader);
|
|
322
339
|
const property = new EnumProperty({ name, value }, ueType, guidInfo, index);
|
|
323
340
|
return property;
|
|
@@ -330,20 +347,21 @@ export class EnumProperty extends BasicProperty {
|
|
|
330
347
|
}
|
|
331
348
|
static Serialize(writer, property) {
|
|
332
349
|
writer.writeString(property.value.name);
|
|
333
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
350
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
334
351
|
EnumProperty.SerializeValue(writer, property.value.value);
|
|
335
352
|
}
|
|
336
353
|
static SerializeValue(writer, value) {
|
|
337
354
|
writer.writeString(value);
|
|
338
355
|
}
|
|
339
356
|
}
|
|
340
|
-
|
|
357
|
+
exports.EnumProperty = EnumProperty;
|
|
358
|
+
class TextProperty extends BasicProperty {
|
|
341
359
|
constructor(value, ueType = 'TextProperty', guidInfo = undefined, index = 0) {
|
|
342
360
|
super('TextProperty', ueType, guidInfo, index);
|
|
343
361
|
this.value = value;
|
|
344
362
|
}
|
|
345
363
|
static Parse(reader, ueType, index = 0) {
|
|
346
|
-
const guidInfo = GUIDInfo.read(reader);
|
|
364
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
347
365
|
const value = TextProperty.ParseValue(reader);
|
|
348
366
|
return new TextProperty(value, ueType, guidInfo, index);
|
|
349
367
|
}
|
|
@@ -396,7 +414,7 @@ export class TextProperty extends BasicProperty {
|
|
|
396
414
|
return 1;
|
|
397
415
|
}
|
|
398
416
|
static Serialize(writer, property) {
|
|
399
|
-
GUIDInfo.write(writer, property.guidInfo);
|
|
417
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
400
418
|
TextProperty.SerializeValue(writer, property.value);
|
|
401
419
|
}
|
|
402
420
|
static SerializeValue(writer, value) {
|
|
@@ -440,7 +458,8 @@ export class TextProperty extends BasicProperty {
|
|
|
440
458
|
}
|
|
441
459
|
}
|
|
442
460
|
}
|
|
443
|
-
|
|
461
|
+
exports.TextProperty = TextProperty;
|
|
462
|
+
class StructProperty extends AbstractBaseProperty {
|
|
444
463
|
constructor(subtype, ueType = 'StructProperty', index = 0, guid = 0) {
|
|
445
464
|
super('StructProperty', ueType, index);
|
|
446
465
|
this.subtype = subtype;
|
|
@@ -477,29 +496,29 @@ export class StructProperty extends AbstractBaseProperty {
|
|
|
477
496
|
let value;
|
|
478
497
|
switch (subtype) {
|
|
479
498
|
case 'Color':
|
|
480
|
-
value = ParseCol4BGRA(reader);
|
|
499
|
+
value = (0, util_types_1.ParseCol4BGRA)(reader);
|
|
481
500
|
break;
|
|
482
501
|
case 'LinearColor':
|
|
483
|
-
value = ParseCol4RGBA(reader);
|
|
502
|
+
value = (0, util_types_1.ParseCol4RGBA)(reader);
|
|
484
503
|
break;
|
|
485
504
|
case 'Vector':
|
|
486
505
|
case 'Rotator':
|
|
487
506
|
case 'Vector2D':
|
|
488
|
-
value = (size === 12) ? ParseVec3f(reader) : ParseVec3(reader);
|
|
507
|
+
value = (size === 12) ? (0, util_types_1.ParseVec3f)(reader) : (0, util_types_1.ParseVec3)(reader);
|
|
489
508
|
break;
|
|
490
509
|
case 'Quat':
|
|
491
510
|
case 'Vector4':
|
|
492
511
|
case 'Vector4D':
|
|
493
|
-
value = (size === 16) ? ParseVec4f(reader) : ParseVec4(reader);
|
|
512
|
+
value = (size === 16) ? (0, util_types_1.ParseVec4f)(reader) : (0, util_types_1.ParseVec4)(reader);
|
|
494
513
|
break;
|
|
495
514
|
case 'Box':
|
|
496
515
|
value = (size === 25) ? {
|
|
497
|
-
min: ParseVec3f(reader),
|
|
498
|
-
max: ParseVec3f(reader),
|
|
516
|
+
min: (0, util_types_1.ParseVec3f)(reader),
|
|
517
|
+
max: (0, util_types_1.ParseVec3f)(reader),
|
|
499
518
|
isValid: reader.readByte() >= 1
|
|
500
519
|
} : {
|
|
501
|
-
min: ParseVec3(reader),
|
|
502
|
-
max: ParseVec3(reader),
|
|
520
|
+
min: (0, util_types_1.ParseVec3)(reader),
|
|
521
|
+
max: (0, util_types_1.ParseVec3)(reader),
|
|
503
522
|
isValid: reader.readByte() >= 1
|
|
504
523
|
};
|
|
505
524
|
break;
|
|
@@ -538,11 +557,11 @@ export class StructProperty extends AbstractBaseProperty {
|
|
|
538
557
|
value = reader.readInt64().toString();
|
|
539
558
|
break;
|
|
540
559
|
case 'FINNetworkTrace':
|
|
541
|
-
value = ReadFINNetworkTrace(reader);
|
|
560
|
+
value = (0, exports.ReadFINNetworkTrace)(reader);
|
|
542
561
|
break;
|
|
543
562
|
case 'FINLuaProcessorStateStorage':
|
|
544
563
|
value = {
|
|
545
|
-
values: ReadFINLuaProcessorStateStorage(reader, size)
|
|
564
|
+
values: (0, exports.ReadFINLuaProcessorStateStorage)(reader, size)
|
|
546
565
|
};
|
|
547
566
|
break;
|
|
548
567
|
case 'FICFrameRange':
|
|
@@ -552,7 +571,7 @@ export class StructProperty extends AbstractBaseProperty {
|
|
|
552
571
|
};
|
|
553
572
|
break;
|
|
554
573
|
default:
|
|
555
|
-
value = ParseDynamicStructData(reader, 0, subtype);
|
|
574
|
+
value = (0, exports.ParseDynamicStructData)(reader, 0, subtype);
|
|
556
575
|
}
|
|
557
576
|
return value;
|
|
558
577
|
}
|
|
@@ -572,28 +591,28 @@ export class StructProperty extends AbstractBaseProperty {
|
|
|
572
591
|
switch (subtype) {
|
|
573
592
|
case 'Color':
|
|
574
593
|
value = value;
|
|
575
|
-
SerializeCol4BGRA(writer, value);
|
|
594
|
+
(0, util_types_1.SerializeCol4BGRA)(writer, value);
|
|
576
595
|
break;
|
|
577
596
|
case 'LinearColor':
|
|
578
597
|
value = value;
|
|
579
|
-
SerializeCol4RGBA(writer, value);
|
|
598
|
+
(0, util_types_1.SerializeCol4RGBA)(writer, value);
|
|
580
599
|
break;
|
|
581
600
|
case 'Vector':
|
|
582
601
|
case 'Rotator':
|
|
583
602
|
case 'Vector2D':
|
|
584
603
|
value = value;
|
|
585
|
-
SerializeVec3(writer, value);
|
|
604
|
+
(0, util_types_1.SerializeVec3)(writer, value);
|
|
586
605
|
break;
|
|
587
606
|
case 'Quat':
|
|
588
607
|
case 'Vector4':
|
|
589
608
|
case 'Vector4D':
|
|
590
609
|
value = value;
|
|
591
|
-
SerializeVec4(writer, value);
|
|
610
|
+
(0, util_types_1.SerializeVec4)(writer, value);
|
|
592
611
|
break;
|
|
593
612
|
case 'Box':
|
|
594
613
|
value = value;
|
|
595
|
-
SerializeVec3(writer, value.min);
|
|
596
|
-
SerializeVec3(writer, value.max);
|
|
614
|
+
(0, util_types_1.SerializeVec3)(writer, value.min);
|
|
615
|
+
(0, util_types_1.SerializeVec3)(writer, value.max);
|
|
597
616
|
writer.writeByte(value.isValid ? 1 : 0);
|
|
598
617
|
break;
|
|
599
618
|
case 'RailroadTrackPosition':
|
|
@@ -632,11 +651,11 @@ export class StructProperty extends AbstractBaseProperty {
|
|
|
632
651
|
break;
|
|
633
652
|
case 'FINNetworkTrace':
|
|
634
653
|
value = value;
|
|
635
|
-
SerializeFINNetworkTrace(writer, value);
|
|
654
|
+
(0, exports.SerializeFINNetworkTrace)(writer, value);
|
|
636
655
|
break;
|
|
637
656
|
case 'FINLuaProcessorStateStorage':
|
|
638
657
|
value = value;
|
|
639
|
-
SerializeFINLuaProcessorStateStorage(writer, value.values);
|
|
658
|
+
(0, exports.SerializeFINLuaProcessorStateStorage)(writer, value.values);
|
|
640
659
|
break;
|
|
641
660
|
case 'FICFrameRange':
|
|
642
661
|
value = value;
|
|
@@ -645,11 +664,12 @@ export class StructProperty extends AbstractBaseProperty {
|
|
|
645
664
|
break;
|
|
646
665
|
default:
|
|
647
666
|
value = value;
|
|
648
|
-
SerializeDynamicStructData(writer, 0, value);
|
|
667
|
+
(0, exports.SerializeDynamicStructData)(writer, 0, value);
|
|
649
668
|
}
|
|
650
669
|
}
|
|
651
670
|
}
|
|
652
|
-
|
|
671
|
+
exports.StructProperty = StructProperty;
|
|
672
|
+
class ArrayProperty extends BasicProperty {
|
|
653
673
|
constructor(subtype, values, ueType = 'ArrayProperty', index = 0, structValueFields) {
|
|
654
674
|
super('ArrayProperty', ueType, undefined, index);
|
|
655
675
|
this.subtype = subtype;
|
|
@@ -795,7 +815,8 @@ export class ArrayProperty extends BasicProperty {
|
|
|
795
815
|
}
|
|
796
816
|
}
|
|
797
817
|
}
|
|
798
|
-
|
|
818
|
+
exports.ArrayProperty = ArrayProperty;
|
|
819
|
+
class SetProperty extends BasicProperty {
|
|
799
820
|
constructor(subtype, values, ueType, index) {
|
|
800
821
|
super('SetProperty', ueType, undefined, index);
|
|
801
822
|
this.subtype = subtype;
|
|
@@ -849,14 +870,15 @@ export class SetProperty extends BasicProperty {
|
|
|
849
870
|
property.values.forEach(v => StrProperty.SerializeValue(writer, v));
|
|
850
871
|
break;
|
|
851
872
|
case "StructProperty":
|
|
852
|
-
property.values.forEach(v => SerializeVec3f(writer, v));
|
|
873
|
+
property.values.forEach(v => (0, util_types_1.SerializeVec3f)(writer, v));
|
|
853
874
|
break;
|
|
854
875
|
default:
|
|
855
876
|
throw new Error(`Not Implemented SetProperty of ${property.subtype}.`);
|
|
856
877
|
}
|
|
857
878
|
}
|
|
858
879
|
}
|
|
859
|
-
|
|
880
|
+
exports.SetProperty = SetProperty;
|
|
881
|
+
class MapProperty extends BasicProperty {
|
|
860
882
|
constructor(keyType, valueType, ueType, index) {
|
|
861
883
|
super('MapProperty', ueType, undefined, index);
|
|
862
884
|
this.keyType = keyType;
|
|
@@ -883,7 +905,7 @@ export class MapProperty extends BasicProperty {
|
|
|
883
905
|
property.structKeyProxy = Array.from(reader.readBytes(12));
|
|
884
906
|
}
|
|
885
907
|
else {
|
|
886
|
-
key = ParseDynamicStructData(reader, 0, property.keyType);
|
|
908
|
+
key = (0, exports.ParseDynamicStructData)(reader, 0, property.keyType);
|
|
887
909
|
}
|
|
888
910
|
break;
|
|
889
911
|
case 'ObjectProperty':
|
|
@@ -908,7 +930,7 @@ export class MapProperty extends BasicProperty {
|
|
|
908
930
|
}
|
|
909
931
|
switch (property.valueType) {
|
|
910
932
|
case 'StructProperty':
|
|
911
|
-
value = ParseDynamicStructData(reader, 0, property.valueType);
|
|
933
|
+
value = (0, exports.ParseDynamicStructData)(reader, 0, property.valueType);
|
|
912
934
|
break;
|
|
913
935
|
case 'ObjectProperty':
|
|
914
936
|
value = ObjectProperty.ReadValue(reader);
|
|
@@ -950,7 +972,7 @@ export class MapProperty extends BasicProperty {
|
|
|
950
972
|
writer.writeBytesArray(property.structKeyProxy);
|
|
951
973
|
}
|
|
952
974
|
else {
|
|
953
|
-
SerializeDynamicStructData(writer, 0, entry[0]);
|
|
975
|
+
(0, exports.SerializeDynamicStructData)(writer, 0, entry[0]);
|
|
954
976
|
}
|
|
955
977
|
break;
|
|
956
978
|
case 'ObjectProperty':
|
|
@@ -975,7 +997,7 @@ export class MapProperty extends BasicProperty {
|
|
|
975
997
|
}
|
|
976
998
|
switch (property.valueType) {
|
|
977
999
|
case 'StructProperty':
|
|
978
|
-
SerializeDynamicStructData(writer, 0, entry[1]);
|
|
1000
|
+
(0, exports.SerializeDynamicStructData)(writer, 0, entry[1]);
|
|
979
1001
|
break;
|
|
980
1002
|
case 'ObjectProperty':
|
|
981
1003
|
ObjectProperty.SerializeValue(writer, entry[1]);
|
|
@@ -1000,14 +1022,15 @@ export class MapProperty extends BasicProperty {
|
|
|
1000
1022
|
}
|
|
1001
1023
|
}
|
|
1002
1024
|
}
|
|
1003
|
-
|
|
1025
|
+
exports.MapProperty = MapProperty;
|
|
1026
|
+
const ParseDynamicStructData = (reader, buildVersion, type) => {
|
|
1004
1027
|
const data = {
|
|
1005
1028
|
type, properties: {}
|
|
1006
1029
|
};
|
|
1007
1030
|
const pos = reader.getBufferPosition();
|
|
1008
1031
|
let propertyName = reader.readString();
|
|
1009
1032
|
while (propertyName !== 'None') {
|
|
1010
|
-
const parsedProperty = DataFields.ParseProperty(reader, buildVersion, propertyName);
|
|
1033
|
+
const parsedProperty = DataFields_1.DataFields.ParseProperty(reader, buildVersion, propertyName);
|
|
1011
1034
|
if (data.properties[propertyName]) {
|
|
1012
1035
|
if (!Array.isArray(data.properties[propertyName])) {
|
|
1013
1036
|
data.properties[propertyName] = [data.properties[propertyName]];
|
|
@@ -1021,21 +1044,23 @@ export const ParseDynamicStructData = (reader, buildVersion, type) => {
|
|
|
1021
1044
|
}
|
|
1022
1045
|
return data;
|
|
1023
1046
|
};
|
|
1024
|
-
|
|
1047
|
+
exports.ParseDynamicStructData = ParseDynamicStructData;
|
|
1048
|
+
const SerializeDynamicStructData = (writer, buildVersion, data) => {
|
|
1025
1049
|
for (const key in data.properties) {
|
|
1026
1050
|
for (const prop of (Array.isArray(data.properties[key]) ? data.properties[key] : [data.properties[key]])) {
|
|
1027
1051
|
writer.writeString(key);
|
|
1028
|
-
DataFields.SerializeProperty(writer, prop, key, buildVersion);
|
|
1052
|
+
DataFields_1.DataFields.SerializeProperty(writer, prop, key, buildVersion);
|
|
1029
1053
|
}
|
|
1030
1054
|
}
|
|
1031
1055
|
writer.writeString('None');
|
|
1032
1056
|
};
|
|
1033
|
-
|
|
1057
|
+
exports.SerializeDynamicStructData = SerializeDynamicStructData;
|
|
1058
|
+
const ReadFINNetworkTrace = (reader) => {
|
|
1034
1059
|
const networkTrace = {};
|
|
1035
|
-
networkTrace.ref = ObjectReference.read(reader);
|
|
1060
|
+
networkTrace.ref = ObjectReference_1.ObjectReference.read(reader);
|
|
1036
1061
|
networkTrace.hasPrev = reader.readInt32();
|
|
1037
1062
|
if (networkTrace.hasPrev) {
|
|
1038
|
-
networkTrace.prev = ReadFINNetworkTrace(reader);
|
|
1063
|
+
networkTrace.prev = (0, exports.ReadFINNetworkTrace)(reader);
|
|
1039
1064
|
}
|
|
1040
1065
|
networkTrace.hasStep = reader.readInt32();
|
|
1041
1066
|
if (networkTrace.hasStep) {
|
|
@@ -1043,28 +1068,30 @@ export const ReadFINNetworkTrace = (reader) => {
|
|
|
1043
1068
|
}
|
|
1044
1069
|
return networkTrace;
|
|
1045
1070
|
};
|
|
1046
|
-
|
|
1071
|
+
exports.ReadFINNetworkTrace = ReadFINNetworkTrace;
|
|
1072
|
+
const SerializeFINNetworkTrace = (writer, obj) => {
|
|
1047
1073
|
const networkTrace = {};
|
|
1048
|
-
ObjectReference.write(writer, obj.ref);
|
|
1074
|
+
ObjectReference_1.ObjectReference.write(writer, obj.ref);
|
|
1049
1075
|
writer.writeInt32(obj.hasPrev);
|
|
1050
1076
|
if (obj.hasPrev) {
|
|
1051
|
-
SerializeFINNetworkTrace(writer, obj.prev);
|
|
1077
|
+
(0, exports.SerializeFINNetworkTrace)(writer, obj.prev);
|
|
1052
1078
|
}
|
|
1053
1079
|
writer.writeInt32(obj.hasStep);
|
|
1054
1080
|
if (obj.hasStep) {
|
|
1055
1081
|
writer.writeString(obj.step);
|
|
1056
1082
|
}
|
|
1057
1083
|
};
|
|
1058
|
-
|
|
1084
|
+
exports.SerializeFINNetworkTrace = SerializeFINNetworkTrace;
|
|
1085
|
+
const ReadFINLuaProcessorStateStorage = (reader, size) => {
|
|
1059
1086
|
const stateStorage = { traces: [], references: [], thread: '', globals: '', remainingStructData: {} };
|
|
1060
1087
|
const start = reader.getBufferPosition();
|
|
1061
1088
|
const traceCount = reader.readInt32();
|
|
1062
1089
|
for (let i = 0; i < traceCount; i++) {
|
|
1063
|
-
stateStorage.traces.push(ReadFINNetworkTrace(reader));
|
|
1090
|
+
stateStorage.traces.push((0, exports.ReadFINNetworkTrace)(reader));
|
|
1064
1091
|
}
|
|
1065
1092
|
const refCount = reader.readInt32();
|
|
1066
1093
|
for (let i = 0; i < refCount; i++) {
|
|
1067
|
-
stateStorage.references.push(ObjectReference.read(reader));
|
|
1094
|
+
stateStorage.references.push(ObjectReference_1.ObjectReference.read(reader));
|
|
1068
1095
|
}
|
|
1069
1096
|
stateStorage.thread = reader.readString();
|
|
1070
1097
|
stateStorage.globals = reader.readString();
|
|
@@ -1072,16 +1099,18 @@ export const ReadFINLuaProcessorStateStorage = (reader, size) => {
|
|
|
1072
1099
|
stateStorage.remainingStructData = reader.readBytes(remaining);
|
|
1073
1100
|
return stateStorage;
|
|
1074
1101
|
};
|
|
1075
|
-
|
|
1102
|
+
exports.ReadFINLuaProcessorStateStorage = ReadFINLuaProcessorStateStorage;
|
|
1103
|
+
const SerializeFINLuaProcessorStateStorage = (writer, stateStorage) => {
|
|
1076
1104
|
writer.writeInt32(stateStorage.traces.length);
|
|
1077
1105
|
for (const trace of stateStorage.traces) {
|
|
1078
|
-
SerializeFINNetworkTrace(writer, trace);
|
|
1106
|
+
(0, exports.SerializeFINNetworkTrace)(writer, trace);
|
|
1079
1107
|
}
|
|
1080
1108
|
writer.writeInt32(stateStorage.references.length);
|
|
1081
1109
|
for (const ref of stateStorage.references) {
|
|
1082
|
-
ObjectReference.write(writer, ref);
|
|
1110
|
+
ObjectReference_1.ObjectReference.write(writer, ref);
|
|
1083
1111
|
}
|
|
1084
1112
|
writer.writeString(stateStorage.thread);
|
|
1085
1113
|
writer.writeString(stateStorage.globals);
|
|
1086
1114
|
writer.writeBytes(stateStorage.remainingStructData);
|
|
1087
1115
|
};
|
|
1116
|
+
exports.SerializeFINLuaProcessorStateStorage = SerializeFINLuaProcessorStateStorage;
|