@etothepii/satisfactory-file-parser 0.1.26 → 0.1.28
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 -2
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataFields = void 0;
|
|
4
|
+
const util_types_1 = require("../structs/util.types");
|
|
5
|
+
const Property_1 = require("./Property");
|
|
6
|
+
class DataFields {
|
|
4
7
|
constructor() {
|
|
5
8
|
}
|
|
6
9
|
static ParseProperties(obj, length, reader, buildVersion, typePath) {
|
|
@@ -56,12 +59,12 @@ export class DataFields {
|
|
|
56
59
|
case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
|
|
57
60
|
case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
|
|
58
61
|
property = {
|
|
59
|
-
source: ObjectProperty.ReadValue(reader),
|
|
60
|
-
target: ObjectProperty.ReadValue(reader)
|
|
62
|
+
source: Property_1.ObjectProperty.ReadValue(reader),
|
|
63
|
+
target: Property_1.ObjectProperty.ReadValue(reader)
|
|
61
64
|
};
|
|
62
65
|
if (remainingLen - (reader.getBufferPosition() - start) >= 24) {
|
|
63
|
-
property.sourceTranslation = ParseVec3f(reader);
|
|
64
|
-
property.targetTranslation = ParseVec3f(reader);
|
|
66
|
+
property.sourceTranslation = (0, util_types_1.ParseVec3f)(reader);
|
|
67
|
+
property.targetTranslation = (0, util_types_1.ParseVec3f)(reader);
|
|
65
68
|
}
|
|
66
69
|
break;
|
|
67
70
|
case '/Game/FactoryGame/Character/Player/BP_PlayerState.BP_PlayerState_C':
|
|
@@ -93,76 +96,76 @@ export class DataFields {
|
|
|
93
96
|
let overhead = 0;
|
|
94
97
|
switch (propertyType) {
|
|
95
98
|
case 'BoolProperty':
|
|
96
|
-
currentProperty = BoolProperty.Parse(reader, propertyType, index);
|
|
97
|
-
overhead = BoolProperty.CalcOverhead(currentProperty);
|
|
99
|
+
currentProperty = Property_1.BoolProperty.Parse(reader, propertyType, index);
|
|
100
|
+
overhead = Property_1.BoolProperty.CalcOverhead(currentProperty);
|
|
98
101
|
break;
|
|
99
102
|
case 'ByteProperty':
|
|
100
|
-
currentProperty = ByteProperty.Parse(reader, propertyType, index);
|
|
101
|
-
overhead = ByteProperty.CalcOverhead(currentProperty);
|
|
103
|
+
currentProperty = Property_1.ByteProperty.Parse(reader, propertyType, index);
|
|
104
|
+
overhead = Property_1.ByteProperty.CalcOverhead(currentProperty);
|
|
102
105
|
break;
|
|
103
106
|
case 'Int8Property':
|
|
104
|
-
currentProperty = Int8Property.Parse(reader, propertyType, index);
|
|
105
|
-
overhead = Int8Property.CalcOverhead(currentProperty);
|
|
107
|
+
currentProperty = Property_1.Int8Property.Parse(reader, propertyType, index);
|
|
108
|
+
overhead = Property_1.Int8Property.CalcOverhead(currentProperty);
|
|
106
109
|
break;
|
|
107
110
|
case 'UInt8Property':
|
|
108
|
-
currentProperty = Uint8Property.Parse(reader, propertyType, index);
|
|
109
|
-
overhead = Uint8Property.CalcOverhead(currentProperty);
|
|
111
|
+
currentProperty = Property_1.Uint8Property.Parse(reader, propertyType, index);
|
|
112
|
+
overhead = Property_1.Uint8Property.CalcOverhead(currentProperty);
|
|
110
113
|
break;
|
|
111
114
|
case 'IntProperty':
|
|
112
115
|
case 'Int32Property':
|
|
113
|
-
currentProperty = Int32Property.Parse(reader, propertyType, index);
|
|
114
|
-
overhead = Int32Property.CalcOverhead(currentProperty);
|
|
116
|
+
currentProperty = Property_1.Int32Property.Parse(reader, propertyType, index);
|
|
117
|
+
overhead = Property_1.Int32Property.CalcOverhead(currentProperty);
|
|
115
118
|
break;
|
|
116
119
|
case 'UInt32Property':
|
|
117
|
-
currentProperty = Uint32Property.Parse(reader, propertyType, index);
|
|
118
|
-
overhead = Uint32Property.CalcOverhead(currentProperty);
|
|
120
|
+
currentProperty = Property_1.Uint32Property.Parse(reader, propertyType, index);
|
|
121
|
+
overhead = Property_1.Uint32Property.CalcOverhead(currentProperty);
|
|
119
122
|
break;
|
|
120
123
|
case 'Int64Property':
|
|
121
|
-
currentProperty = Int64Property.Parse(reader, propertyType, index);
|
|
122
|
-
overhead = Int64Property.CalcOverhead(currentProperty);
|
|
124
|
+
currentProperty = Property_1.Int64Property.Parse(reader, propertyType, index);
|
|
125
|
+
overhead = Property_1.Int64Property.CalcOverhead(currentProperty);
|
|
123
126
|
break;
|
|
124
127
|
case 'SingleProperty':
|
|
125
128
|
case 'FloatProperty':
|
|
126
|
-
currentProperty = FloatProperty.Parse(reader, propertyType, index);
|
|
127
|
-
overhead = FloatProperty.CalcOverhead(currentProperty);
|
|
129
|
+
currentProperty = Property_1.FloatProperty.Parse(reader, propertyType, index);
|
|
130
|
+
overhead = Property_1.FloatProperty.CalcOverhead(currentProperty);
|
|
128
131
|
break;
|
|
129
132
|
case 'DoubleProperty':
|
|
130
|
-
currentProperty = DoubleProperty.Parse(reader, propertyType, index);
|
|
131
|
-
overhead = DoubleProperty.CalcOverhead(currentProperty);
|
|
133
|
+
currentProperty = Property_1.DoubleProperty.Parse(reader, propertyType, index);
|
|
134
|
+
overhead = Property_1.DoubleProperty.CalcOverhead(currentProperty);
|
|
132
135
|
break;
|
|
133
136
|
case 'StrProperty':
|
|
134
137
|
case 'NameProperty':
|
|
135
|
-
currentProperty = StrProperty.Parse(reader, propertyType, index);
|
|
136
|
-
overhead = StrProperty.CalcOverhead(currentProperty);
|
|
138
|
+
currentProperty = Property_1.StrProperty.Parse(reader, propertyType, index);
|
|
139
|
+
overhead = Property_1.StrProperty.CalcOverhead(currentProperty);
|
|
137
140
|
break;
|
|
138
141
|
case 'ObjectProperty':
|
|
139
142
|
case 'InterfaceProperty':
|
|
140
|
-
currentProperty = ObjectProperty.Parse(reader, propertyType, index);
|
|
141
|
-
overhead = ObjectProperty.CalcOverhead(currentProperty);
|
|
143
|
+
currentProperty = Property_1.ObjectProperty.Parse(reader, propertyType, index);
|
|
144
|
+
overhead = Property_1.ObjectProperty.CalcOverhead(currentProperty);
|
|
142
145
|
break;
|
|
143
146
|
case 'EnumProperty':
|
|
144
|
-
currentProperty = EnumProperty.Parse(reader, propertyType, index);
|
|
145
|
-
overhead = EnumProperty.CalcOverhead(currentProperty);
|
|
147
|
+
currentProperty = Property_1.EnumProperty.Parse(reader, propertyType, index);
|
|
148
|
+
overhead = Property_1.EnumProperty.CalcOverhead(currentProperty);
|
|
146
149
|
break;
|
|
147
150
|
case 'StructProperty':
|
|
148
|
-
currentProperty = StructProperty.Parse(reader, propertyType, index, binarySize);
|
|
149
|
-
overhead = StructProperty.CalcOverhead(currentProperty);
|
|
151
|
+
currentProperty = Property_1.StructProperty.Parse(reader, propertyType, index, binarySize);
|
|
152
|
+
overhead = Property_1.StructProperty.CalcOverhead(currentProperty);
|
|
150
153
|
break;
|
|
151
154
|
case 'ArrayProperty':
|
|
152
|
-
currentProperty = ArrayProperty.Parse(reader, propertyType, index, propertyName);
|
|
153
|
-
overhead = ArrayProperty.CalcOverhead(currentProperty);
|
|
155
|
+
currentProperty = Property_1.ArrayProperty.Parse(reader, propertyType, index, propertyName);
|
|
156
|
+
overhead = Property_1.ArrayProperty.CalcOverhead(currentProperty);
|
|
154
157
|
break;
|
|
155
158
|
case 'MapProperty':
|
|
156
|
-
currentProperty = MapProperty.Parse(reader, propertyName, buildVersion, binarySize);
|
|
157
|
-
overhead = MapProperty.CalcOverhead(currentProperty);
|
|
159
|
+
currentProperty = Property_1.MapProperty.Parse(reader, propertyName, buildVersion, binarySize);
|
|
160
|
+
overhead = Property_1.MapProperty.CalcOverhead(currentProperty);
|
|
158
161
|
break;
|
|
159
162
|
case 'TextProperty':
|
|
160
|
-
currentProperty = TextProperty.Parse(reader, propertyType, index);
|
|
161
|
-
overhead = TextProperty.CalcOverhead(currentProperty);
|
|
163
|
+
currentProperty = Property_1.TextProperty.Parse(reader, propertyType, index);
|
|
164
|
+
overhead = Property_1.TextProperty.CalcOverhead(currentProperty);
|
|
162
165
|
break;
|
|
163
166
|
case 'SetProperty':
|
|
164
|
-
currentProperty = SetProperty.Parse(reader, propertyType, index, propertyName);
|
|
165
|
-
overhead = SetProperty.CalcOverhead(currentProperty);
|
|
167
|
+
currentProperty = Property_1.SetProperty.Parse(reader, propertyType, index, propertyName);
|
|
168
|
+
overhead = Property_1.SetProperty.CalcOverhead(currentProperty);
|
|
166
169
|
break;
|
|
167
170
|
default:
|
|
168
171
|
throw new Error(`Unimplemented type ${propertyType}`);
|
|
@@ -200,8 +203,8 @@ export class DataFields {
|
|
|
200
203
|
break;
|
|
201
204
|
case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
|
|
202
205
|
case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
|
|
203
|
-
ObjectProperty.SerializeValue(writer, property.source);
|
|
204
|
-
ObjectProperty.SerializeValue(writer, property.target);
|
|
206
|
+
Property_1.ObjectProperty.SerializeValue(writer, property.source);
|
|
207
|
+
Property_1.ObjectProperty.SerializeValue(writer, property.target);
|
|
205
208
|
break;
|
|
206
209
|
case '/Game/FactoryGame/Character/Player/BP_PlayerState.BP_PlayerState_C':
|
|
207
210
|
writer.writeByte(property.flag);
|
|
@@ -227,80 +230,80 @@ export class DataFields {
|
|
|
227
230
|
let overhead = 0;
|
|
228
231
|
switch (property.ueType) {
|
|
229
232
|
case 'BoolProperty':
|
|
230
|
-
overhead = BoolProperty.CalcOverhead(property);
|
|
231
|
-
BoolProperty.Serialize(writer, property);
|
|
233
|
+
overhead = Property_1.BoolProperty.CalcOverhead(property);
|
|
234
|
+
Property_1.BoolProperty.Serialize(writer, property);
|
|
232
235
|
break;
|
|
233
236
|
case 'ByteProperty':
|
|
234
|
-
overhead = ByteProperty.CalcOverhead(property);
|
|
235
|
-
ByteProperty.Serialize(writer, property);
|
|
237
|
+
overhead = Property_1.ByteProperty.CalcOverhead(property);
|
|
238
|
+
Property_1.ByteProperty.Serialize(writer, property);
|
|
236
239
|
break;
|
|
237
240
|
case 'Int8Property':
|
|
238
|
-
overhead = Int8Property.CalcOverhead(property);
|
|
239
|
-
Int8Property.Serialize(writer, property);
|
|
241
|
+
overhead = Property_1.Int8Property.CalcOverhead(property);
|
|
242
|
+
Property_1.Int8Property.Serialize(writer, property);
|
|
240
243
|
break;
|
|
241
244
|
case 'UInt8Property':
|
|
242
|
-
overhead = Uint8Property.CalcOverhead(property);
|
|
243
|
-
Uint8Property.Serialize(writer, property);
|
|
245
|
+
overhead = Property_1.Uint8Property.CalcOverhead(property);
|
|
246
|
+
Property_1.Uint8Property.Serialize(writer, property);
|
|
244
247
|
break;
|
|
245
248
|
case 'IntProperty':
|
|
246
249
|
case 'Int32Property':
|
|
247
|
-
overhead = Int32Property.CalcOverhead(property);
|
|
248
|
-
Int32Property.Serialize(writer, property);
|
|
250
|
+
overhead = Property_1.Int32Property.CalcOverhead(property);
|
|
251
|
+
Property_1.Int32Property.Serialize(writer, property);
|
|
249
252
|
break;
|
|
250
253
|
case 'UInt32Property':
|
|
251
|
-
overhead = Uint32Property.CalcOverhead(property);
|
|
252
|
-
Uint32Property.Serialize(writer, property);
|
|
254
|
+
overhead = Property_1.Uint32Property.CalcOverhead(property);
|
|
255
|
+
Property_1.Uint32Property.Serialize(writer, property);
|
|
253
256
|
break;
|
|
254
257
|
case 'Int64Property':
|
|
255
|
-
overhead = Int64Property.CalcOverhead(property);
|
|
256
|
-
Int64Property.Serialize(writer, property);
|
|
258
|
+
overhead = Property_1.Int64Property.CalcOverhead(property);
|
|
259
|
+
Property_1.Int64Property.Serialize(writer, property);
|
|
257
260
|
break;
|
|
258
261
|
case 'SingleProperty':
|
|
259
262
|
case 'FloatProperty':
|
|
260
|
-
overhead = FloatProperty.CalcOverhead(property);
|
|
261
|
-
FloatProperty.Serialize(writer, property);
|
|
263
|
+
overhead = Property_1.FloatProperty.CalcOverhead(property);
|
|
264
|
+
Property_1.FloatProperty.Serialize(writer, property);
|
|
262
265
|
break;
|
|
263
266
|
case 'DoubleProperty':
|
|
264
|
-
overhead = DoubleProperty.CalcOverhead(property);
|
|
265
|
-
DoubleProperty.Serialize(writer, property);
|
|
267
|
+
overhead = Property_1.DoubleProperty.CalcOverhead(property);
|
|
268
|
+
Property_1.DoubleProperty.Serialize(writer, property);
|
|
266
269
|
break;
|
|
267
270
|
case 'StrProperty':
|
|
268
271
|
case 'NameProperty':
|
|
269
|
-
overhead = StrProperty.CalcOverhead(property);
|
|
270
|
-
StrProperty.Serialize(writer, property);
|
|
272
|
+
overhead = Property_1.StrProperty.CalcOverhead(property);
|
|
273
|
+
Property_1.StrProperty.Serialize(writer, property);
|
|
271
274
|
break;
|
|
272
275
|
case 'ObjectProperty':
|
|
273
276
|
case 'InterfaceProperty':
|
|
274
|
-
overhead = ObjectProperty.CalcOverhead(property);
|
|
275
|
-
ObjectProperty.Serialize(writer, property);
|
|
277
|
+
overhead = Property_1.ObjectProperty.CalcOverhead(property);
|
|
278
|
+
Property_1.ObjectProperty.Serialize(writer, property);
|
|
276
279
|
break;
|
|
277
280
|
case 'EnumProperty':
|
|
278
|
-
overhead = EnumProperty.CalcOverhead(property);
|
|
279
|
-
EnumProperty.Serialize(writer, property);
|
|
281
|
+
overhead = Property_1.EnumProperty.CalcOverhead(property);
|
|
282
|
+
Property_1.EnumProperty.Serialize(writer, property);
|
|
280
283
|
break;
|
|
281
284
|
case 'ByteProperty':
|
|
282
|
-
overhead = ByteProperty.CalcOverhead(property);
|
|
283
|
-
ByteProperty.Serialize(writer, property);
|
|
285
|
+
overhead = Property_1.ByteProperty.CalcOverhead(property);
|
|
286
|
+
Property_1.ByteProperty.Serialize(writer, property);
|
|
284
287
|
break;
|
|
285
288
|
case 'StructProperty':
|
|
286
|
-
overhead = StructProperty.CalcOverhead(property);
|
|
287
|
-
StructProperty.Serialize(writer, property);
|
|
289
|
+
overhead = Property_1.StructProperty.CalcOverhead(property);
|
|
290
|
+
Property_1.StructProperty.Serialize(writer, property);
|
|
288
291
|
break;
|
|
289
292
|
case 'ArrayProperty':
|
|
290
|
-
overhead = ArrayProperty.CalcOverhead(property);
|
|
291
|
-
ArrayProperty.Serialize(writer, property, propertyName);
|
|
293
|
+
overhead = Property_1.ArrayProperty.CalcOverhead(property);
|
|
294
|
+
Property_1.ArrayProperty.Serialize(writer, property, propertyName);
|
|
292
295
|
break;
|
|
293
296
|
case 'MapProperty':
|
|
294
|
-
overhead = MapProperty.CalcOverhead(property);
|
|
295
|
-
MapProperty.Serialize(writer, property);
|
|
297
|
+
overhead = Property_1.MapProperty.CalcOverhead(property);
|
|
298
|
+
Property_1.MapProperty.Serialize(writer, property);
|
|
296
299
|
break;
|
|
297
300
|
case 'TextProperty':
|
|
298
|
-
overhead = TextProperty.CalcOverhead(property);
|
|
299
|
-
TextProperty.Serialize(writer, property);
|
|
301
|
+
overhead = Property_1.TextProperty.CalcOverhead(property);
|
|
302
|
+
Property_1.TextProperty.Serialize(writer, property);
|
|
300
303
|
break;
|
|
301
304
|
case 'SetProperty':
|
|
302
|
-
overhead = SetProperty.CalcOverhead(property);
|
|
303
|
-
SetProperty.Serialize(writer, property);
|
|
305
|
+
overhead = Property_1.SetProperty.CalcOverhead(property);
|
|
306
|
+
Property_1.SetProperty.Serialize(writer, property);
|
|
304
307
|
break;
|
|
305
308
|
default:
|
|
306
309
|
throw new Error(`Unimplemented type ${property.type}`);
|
|
@@ -308,3 +311,4 @@ export class DataFields {
|
|
|
308
311
|
writer.writeBinarySizeFromPosition(lenIndicator, start + overhead);
|
|
309
312
|
}
|
|
310
313
|
}
|
|
314
|
+
exports.DataFields = DataFields;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GUIDInfo = void 0;
|
|
4
|
+
const GUID_1 = require("./ue/GUID");
|
|
5
|
+
var GUIDInfo;
|
|
3
6
|
(function (GUIDInfo) {
|
|
4
7
|
GUIDInfo.read = (reader) => {
|
|
5
8
|
if (reader.readByte() === 1) {
|
|
6
|
-
return GUID.read(reader);
|
|
9
|
+
return GUID_1.GUID.read(reader);
|
|
7
10
|
}
|
|
8
11
|
else {
|
|
9
12
|
return undefined;
|
|
@@ -16,8 +19,8 @@ export var GUIDInfo;
|
|
|
16
19
|
}
|
|
17
20
|
else {
|
|
18
21
|
writer.writeByte(1);
|
|
19
|
-
GUID.write(writer, guid);
|
|
22
|
+
GUID_1.GUID.write(writer, guid);
|
|
20
23
|
}
|
|
21
24
|
};
|
|
22
|
-
})(GUIDInfo || (GUIDInfo = {}));
|
|
25
|
+
})(GUIDInfo = exports.GUIDInfo || (exports.GUIDInfo = {}));
|
|
23
26
|
;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObjectReference = void 0;
|
|
4
|
+
var ObjectReference;
|
|
2
5
|
(function (ObjectReference) {
|
|
3
6
|
ObjectReference.read = (reader) => {
|
|
4
7
|
return {
|
|
@@ -10,5 +13,5 @@ export var ObjectReference;
|
|
|
10
13
|
writer.writeString(ref.levelName);
|
|
11
14
|
writer.writeString(ref.pathName);
|
|
12
15
|
};
|
|
13
|
-
})(ObjectReference || (ObjectReference = {}));
|
|
16
|
+
})(ObjectReference = exports.ObjectReference || (exports.ObjectReference = {}));
|
|
14
17
|
;
|