@etothepii/satisfactory-file-parser 0.4.22 → 0.5.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/README.md +19 -1
- package/build/index.d.ts +5 -2
- package/build/index.js +5 -2
- package/build/parser/satisfactory/types/objects/SaveEntity.js +5 -5
- package/build/parser/satisfactory/types/objects/SaveObject.d.ts +2 -2
- package/build/parser/satisfactory/types/objects/SaveObject.js +19 -3
- package/build/parser/satisfactory/types/property/PropertiesList.d.ts +11 -0
- package/build/parser/satisfactory/types/property/PropertiesList.js +249 -0
- package/build/parser/satisfactory/types/property/generic/ArrayProperty.js +4 -4
- package/build/parser/satisfactory/types/property/generic/BoolProperty.js +1 -1
- package/build/parser/satisfactory/types/property/generic/EnumProperty.js +1 -1
- package/build/parser/satisfactory/types/property/generic/MapProperty.js +11 -5
- package/build/parser/satisfactory/types/property/generic/ObjectProperty.js +3 -7
- package/build/parser/satisfactory/types/property/generic/SetProperty.js +2 -2
- package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.d.ts +2 -0
- package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.js +6 -0
- package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts +2 -11
- package/build/parser/satisfactory/types/property/generic/StructProperty.js +14 -119
- package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts +1 -1
- package/build/parser/satisfactory/types/property/generic/TextProperty.js +5 -5
- package/build/parser/satisfactory/types/property/generic/Uint8Property.js +1 -1
- package/build/parser/satisfactory/types/property/special/SpecialAnyProperties.d.ts +54 -0
- package/build/parser/satisfactory/types/property/special/SpecialAnyProperties.js +2 -0
- package/build/parser/satisfactory/types/property/special/SpecialProperties.d.ts +7 -0
- package/build/parser/satisfactory/types/property/special/SpecialProperties.js +234 -0
- package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.d.ts +11 -0
- package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.js +37 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.d.ts +10 -0
- package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.js +16 -0
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BinaryReadable } from '../../../../byte/binary-readable.interface';
|
|
2
2
|
import { ByteWriter } from '../../../../byte/byte-writer.class';
|
|
3
3
|
import { col4 } from '../../structs/col4';
|
|
4
|
+
import { DynamicStructPropertyValue } from '../../structs/DynamicStructPropertyValue';
|
|
4
5
|
import { vec3 } from '../../structs/vec3';
|
|
5
6
|
import { vec4 } from '../../structs/vec4';
|
|
6
|
-
import { AbstractBaseProperty
|
|
7
|
+
import { AbstractBaseProperty } from './BasicProperty';
|
|
7
8
|
export type BasicMultipleStructPropertyValue = {
|
|
8
9
|
values: any;
|
|
9
10
|
};
|
|
@@ -36,10 +37,6 @@ export type FICFrameRangeStructPropertyValue = {
|
|
|
36
37
|
begin: string;
|
|
37
38
|
end: string;
|
|
38
39
|
};
|
|
39
|
-
export type DynamicStructPropertyValue = {
|
|
40
|
-
type: string;
|
|
41
|
-
properties: PropertiesMap;
|
|
42
|
-
};
|
|
43
40
|
export type ClientIdentityInfo = {
|
|
44
41
|
offlineId: string;
|
|
45
42
|
accountIds: Record<number, number[]>;
|
|
@@ -61,9 +58,3 @@ export declare class StructProperty extends AbstractBaseProperty {
|
|
|
61
58
|
static Serialize(writer: ByteWriter, property: StructProperty): void;
|
|
62
59
|
static SerializeValue(writer: ByteWriter, subtype: string, value: GENERIC_STRUCT_PROPERTY_VALUE): void;
|
|
63
60
|
}
|
|
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;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.StructProperty = exports.isStructProperty = void 0;
|
|
4
4
|
const parser_error_1 = require("../../../../error/parser.error");
|
|
5
5
|
const col4_1 = require("../../structs/col4");
|
|
6
|
-
const
|
|
6
|
+
const DynamicStructPropertyValue_1 = require("../../structs/DynamicStructPropertyValue");
|
|
7
|
+
const FICFrameRange_1 = require("../../structs/mods/FicsItCam/FICFrameRange");
|
|
7
8
|
const vec3_1 = require("../../structs/vec3");
|
|
8
9
|
const vec4_1 = require("../../structs/vec4");
|
|
9
|
-
const DataFields_1 = require("../DataFields");
|
|
10
10
|
const BasicProperty_1 = require("./BasicProperty");
|
|
11
11
|
const isStructProperty = (property) => property.type === 'StructProperty';
|
|
12
12
|
exports.isStructProperty = isStructProperty;
|
|
@@ -54,6 +54,9 @@ class StructProperty extends BasicProperty_1.AbstractBaseProperty {
|
|
|
54
54
|
case 'Color':
|
|
55
55
|
value = col4_1.col4.ParseBGRA(reader);
|
|
56
56
|
break;
|
|
57
|
+
case 'IntPoint':
|
|
58
|
+
value = reader.readInt64().toString();
|
|
59
|
+
break;
|
|
57
60
|
case 'LinearColor':
|
|
58
61
|
value = col4_1.col4.ParseRGBA(reader);
|
|
59
62
|
break;
|
|
@@ -144,27 +147,16 @@ class StructProperty extends BasicProperty_1.AbstractBaseProperty {
|
|
|
144
147
|
case 'DateTime':
|
|
145
148
|
value = reader.readInt64().toString();
|
|
146
149
|
break;
|
|
147
|
-
case 'FINNetworkTrace':
|
|
148
|
-
value = (0, exports.ReadFINNetworkTrace)(reader);
|
|
149
|
-
break;
|
|
150
|
-
case 'FINLuaProcessorStateStorage':
|
|
151
|
-
value = {
|
|
152
|
-
values: (0, exports.ReadFINLuaProcessorStateStorage)(reader, size)
|
|
153
|
-
};
|
|
154
|
-
break;
|
|
155
150
|
case 'FICFrameRange':
|
|
156
|
-
value =
|
|
157
|
-
begin: reader.readInt64().toString(),
|
|
158
|
-
end: reader.readInt64().toString(),
|
|
159
|
-
};
|
|
151
|
+
value = FICFrameRange_1.FICFrameRange.Parse(reader);
|
|
160
152
|
break;
|
|
161
153
|
default:
|
|
162
|
-
value =
|
|
154
|
+
value = DynamicStructPropertyValue_1.DynamicStructPropertyValue.read(reader, 0, subtype);
|
|
163
155
|
}
|
|
164
156
|
return value;
|
|
165
157
|
}
|
|
166
158
|
static CalcOverhead(property) {
|
|
167
|
-
return property.subtype.length + 5 +
|
|
159
|
+
return property.subtype.length + 5 + 4 + 4 + 4 + 4 + 1;
|
|
168
160
|
}
|
|
169
161
|
static Serialize(writer, property) {
|
|
170
162
|
writer.writeString(property.subtype);
|
|
@@ -181,6 +173,9 @@ class StructProperty extends BasicProperty_1.AbstractBaseProperty {
|
|
|
181
173
|
value = value;
|
|
182
174
|
col4_1.col4.SerializeBGRA(writer, value);
|
|
183
175
|
break;
|
|
176
|
+
case 'IntPoint':
|
|
177
|
+
writer.writeInt64(BigInt(value));
|
|
178
|
+
break;
|
|
184
179
|
case 'LinearColor':
|
|
185
180
|
value = value;
|
|
186
181
|
col4_1.col4.SerializeRGBA(writer, value);
|
|
@@ -252,114 +247,14 @@ class StructProperty extends BasicProperty_1.AbstractBaseProperty {
|
|
|
252
247
|
value = value;
|
|
253
248
|
writer.writeInt64(BigInt(value));
|
|
254
249
|
break;
|
|
255
|
-
case 'FINNetworkTrace':
|
|
256
|
-
value = value;
|
|
257
|
-
(0, exports.SerializeFINNetworkTrace)(writer, value);
|
|
258
|
-
break;
|
|
259
|
-
case 'FINLuaProcessorStateStorage':
|
|
260
|
-
value = value;
|
|
261
|
-
(0, exports.SerializeFINLuaProcessorStateStorage)(writer, value.values);
|
|
262
|
-
break;
|
|
263
250
|
case 'FICFrameRange':
|
|
264
251
|
value = value;
|
|
265
|
-
|
|
266
|
-
writer.writeInt64(BigInt(value.end));
|
|
252
|
+
FICFrameRange_1.FICFrameRange.Serialize(writer, value);
|
|
267
253
|
break;
|
|
268
254
|
default:
|
|
269
255
|
value = value;
|
|
270
|
-
|
|
256
|
+
DynamicStructPropertyValue_1.DynamicStructPropertyValue.write(writer, 0, value);
|
|
271
257
|
}
|
|
272
258
|
}
|
|
273
259
|
}
|
|
274
260
|
exports.StructProperty = StructProperty;
|
|
275
|
-
const ParseDynamicStructData = (reader, buildVersion, type) => {
|
|
276
|
-
const data = {
|
|
277
|
-
type, properties: {}
|
|
278
|
-
};
|
|
279
|
-
const pos = reader.getBufferPosition();
|
|
280
|
-
let propertyName = reader.readString();
|
|
281
|
-
while (propertyName !== 'None') {
|
|
282
|
-
const parsedProperty = DataFields_1.DataFields.ParseProperty(reader, buildVersion, propertyName);
|
|
283
|
-
if (data.properties[propertyName]) {
|
|
284
|
-
if (!Array.isArray(data.properties[propertyName])) {
|
|
285
|
-
data.properties[propertyName] = [data.properties[propertyName]];
|
|
286
|
-
}
|
|
287
|
-
data.properties[propertyName].push(parsedProperty);
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
data.properties[propertyName] = parsedProperty;
|
|
291
|
-
}
|
|
292
|
-
propertyName = reader.readString();
|
|
293
|
-
}
|
|
294
|
-
return data;
|
|
295
|
-
};
|
|
296
|
-
exports.ParseDynamicStructData = ParseDynamicStructData;
|
|
297
|
-
const SerializeDynamicStructData = (writer, buildVersion, data) => {
|
|
298
|
-
for (const key in data.properties) {
|
|
299
|
-
for (const prop of (Array.isArray(data.properties[key]) ? data.properties[key] : [data.properties[key]])) {
|
|
300
|
-
writer.writeString(key);
|
|
301
|
-
DataFields_1.DataFields.SerializeProperty(writer, prop, key, buildVersion);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
writer.writeString('None');
|
|
305
|
-
};
|
|
306
|
-
exports.SerializeDynamicStructData = SerializeDynamicStructData;
|
|
307
|
-
const ReadFINNetworkTrace = (reader) => {
|
|
308
|
-
const networkTrace = {};
|
|
309
|
-
networkTrace.ref = ObjectReference_1.ObjectReference.read(reader);
|
|
310
|
-
networkTrace.hasPrev = reader.readInt32();
|
|
311
|
-
if (networkTrace.hasPrev) {
|
|
312
|
-
networkTrace.prev = (0, exports.ReadFINNetworkTrace)(reader);
|
|
313
|
-
}
|
|
314
|
-
networkTrace.hasStep = reader.readInt32();
|
|
315
|
-
if (networkTrace.hasStep) {
|
|
316
|
-
networkTrace.step = reader.readString();
|
|
317
|
-
}
|
|
318
|
-
return networkTrace;
|
|
319
|
-
};
|
|
320
|
-
exports.ReadFINNetworkTrace = ReadFINNetworkTrace;
|
|
321
|
-
const SerializeFINNetworkTrace = (writer, obj) => {
|
|
322
|
-
const networkTrace = {};
|
|
323
|
-
ObjectReference_1.ObjectReference.write(writer, obj.ref);
|
|
324
|
-
writer.writeInt32(obj.hasPrev);
|
|
325
|
-
if (obj.hasPrev) {
|
|
326
|
-
(0, exports.SerializeFINNetworkTrace)(writer, obj.prev);
|
|
327
|
-
}
|
|
328
|
-
writer.writeInt32(obj.hasStep);
|
|
329
|
-
if (obj.hasStep) {
|
|
330
|
-
writer.writeString(obj.step);
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
exports.SerializeFINNetworkTrace = SerializeFINNetworkTrace;
|
|
334
|
-
const ReadFINLuaProcessorStateStorage = (reader, size) => {
|
|
335
|
-
const stateStorage = { traces: [], references: [], thread: '', globals: '', remainingStructData: {} };
|
|
336
|
-
const start = reader.getBufferPosition();
|
|
337
|
-
const traceCount = reader.readInt32();
|
|
338
|
-
for (let i = 0; i < traceCount; i++) {
|
|
339
|
-
stateStorage.traces.push((0, exports.ReadFINNetworkTrace)(reader));
|
|
340
|
-
}
|
|
341
|
-
const refCount = reader.readInt32();
|
|
342
|
-
for (let i = 0; i < refCount; i++) {
|
|
343
|
-
stateStorage.references.push(ObjectReference_1.ObjectReference.read(reader));
|
|
344
|
-
}
|
|
345
|
-
stateStorage.thread = reader.readString();
|
|
346
|
-
stateStorage.globals = reader.readString();
|
|
347
|
-
const remaining = size - (reader.getBufferPosition() - start);
|
|
348
|
-
stateStorage.remainingStructData = reader.readBytes(remaining);
|
|
349
|
-
return stateStorage;
|
|
350
|
-
};
|
|
351
|
-
exports.ReadFINLuaProcessorStateStorage = ReadFINLuaProcessorStateStorage;
|
|
352
|
-
const SerializeFINLuaProcessorStateStorage = (writer, stateStorage) => {
|
|
353
|
-
writer.writeInt32(stateStorage.traces.length);
|
|
354
|
-
for (const trace of stateStorage.traces) {
|
|
355
|
-
(0, exports.SerializeFINNetworkTrace)(writer, trace);
|
|
356
|
-
}
|
|
357
|
-
writer.writeInt32(stateStorage.references.length);
|
|
358
|
-
for (const ref of stateStorage.references) {
|
|
359
|
-
ObjectReference_1.ObjectReference.write(writer, ref);
|
|
360
|
-
}
|
|
361
|
-
writer.writeString(stateStorage.thread);
|
|
362
|
-
writer.writeString(stateStorage.globals);
|
|
363
|
-
writer.writeBytes(stateStorage.remainingStructData);
|
|
364
|
-
};
|
|
365
|
-
exports.SerializeFINLuaProcessorStateStorage = SerializeFINLuaProcessorStateStorage;
|
|
@@ -7,7 +7,7 @@ export declare class TextProperty extends BasicProperty {
|
|
|
7
7
|
value: TextPropertyValue;
|
|
8
8
|
constructor(value: TextPropertyValue, ueType?: string, guidInfo?: GUIDInfo, index?: number);
|
|
9
9
|
static Parse(reader: BinaryReadable, ueType: string, index?: number): TextProperty;
|
|
10
|
-
static
|
|
10
|
+
static ReadValue(reader: BinaryReadable): TextPropertyValue;
|
|
11
11
|
static CalcOverhead(property: TextProperty): number;
|
|
12
12
|
static Serialize(writer: ByteWriter, property: TextProperty): void;
|
|
13
13
|
static SerializeValue(writer: ByteWriter, value: TextPropertyValue): void;
|
|
@@ -12,10 +12,10 @@ class TextProperty extends BasicProperty_1.BasicProperty {
|
|
|
12
12
|
}
|
|
13
13
|
static Parse(reader, ueType, index = 0) {
|
|
14
14
|
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
15
|
-
const value = TextProperty.
|
|
15
|
+
const value = TextProperty.ReadValue(reader);
|
|
16
16
|
return new TextProperty(value, ueType, guidInfo, index);
|
|
17
17
|
}
|
|
18
|
-
static
|
|
18
|
+
static ReadValue(reader) {
|
|
19
19
|
const prop = {
|
|
20
20
|
flags: reader.readInt32(),
|
|
21
21
|
historyType: reader.readByte()
|
|
@@ -28,7 +28,7 @@ class TextProperty extends BasicProperty_1.BasicProperty {
|
|
|
28
28
|
break;
|
|
29
29
|
case 1:
|
|
30
30
|
case 3:
|
|
31
|
-
prop.sourceFmt = TextProperty.
|
|
31
|
+
prop.sourceFmt = TextProperty.ReadValue(reader);
|
|
32
32
|
const argumentsCount = reader.readInt32();
|
|
33
33
|
prop.arguments = [];
|
|
34
34
|
for (let i = 0; i < argumentsCount; i++) {
|
|
@@ -37,7 +37,7 @@ class TextProperty extends BasicProperty_1.BasicProperty {
|
|
|
37
37
|
currentArgumentsData.valueType = reader.readByte();
|
|
38
38
|
switch (currentArgumentsData.valueType) {
|
|
39
39
|
case 4:
|
|
40
|
-
currentArgumentsData.argumentValue = TextProperty.
|
|
40
|
+
currentArgumentsData.argumentValue = TextProperty.ReadValue(reader);
|
|
41
41
|
break;
|
|
42
42
|
default:
|
|
43
43
|
throw new Error('Unimplemented FormatArgumentType `' + currentArgumentsData.valueType);
|
|
@@ -46,7 +46,7 @@ class TextProperty extends BasicProperty_1.BasicProperty {
|
|
|
46
46
|
}
|
|
47
47
|
break;
|
|
48
48
|
case 10:
|
|
49
|
-
prop.sourceText = TextProperty.
|
|
49
|
+
prop.sourceText = TextProperty.ReadValue(reader);
|
|
50
50
|
prop.transformType = reader.readByte();
|
|
51
51
|
break;
|
|
52
52
|
case 255:
|
|
@@ -19,7 +19,7 @@ class Uint8Property extends BasicProperty_1.BasicProperty {
|
|
|
19
19
|
return reader.readUint8();
|
|
20
20
|
}
|
|
21
21
|
static CalcOverhead(property) {
|
|
22
|
-
|
|
22
|
+
return 1;
|
|
23
23
|
}
|
|
24
24
|
static Serialize(writer, property) {
|
|
25
25
|
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ObjectReference } from '../../structs/ObjectReference';
|
|
2
|
+
import { Transform } from '../../structs/Transform';
|
|
3
|
+
import { vec2 } from '../../structs/vec2';
|
|
4
|
+
import { vec3 } from '../../structs/vec3';
|
|
5
|
+
export type SpecialAnyProperties = EmptySpecialProperties | PowerLineSpecialProperties | PlayerSpecialProperties | ConveyorChainActorSpecialProperties | BuildableSubsystemSpecialProperties;
|
|
6
|
+
export type EmptySpecialProperties = {};
|
|
7
|
+
export type PowerLineSpecialProperties = {
|
|
8
|
+
source: ObjectReference;
|
|
9
|
+
target: ObjectReference;
|
|
10
|
+
sourceTranslation?: vec3;
|
|
11
|
+
targetTranslation?: vec3;
|
|
12
|
+
};
|
|
13
|
+
export type PlayerSpecialProperties = {
|
|
14
|
+
flag: number;
|
|
15
|
+
eosData?: string;
|
|
16
|
+
steamPlayerData?: string;
|
|
17
|
+
};
|
|
18
|
+
export type ConveyorItemSpecialProperties = {
|
|
19
|
+
position: number;
|
|
20
|
+
itemName: string;
|
|
21
|
+
};
|
|
22
|
+
export type ConveyorChainSegmentSpecialProperties = {
|
|
23
|
+
chainActorRef: ObjectReference;
|
|
24
|
+
beltRef: ObjectReference;
|
|
25
|
+
someCount: number;
|
|
26
|
+
unknownUseBytes: number[];
|
|
27
|
+
firstItemIndex: number;
|
|
28
|
+
lastItemIndex: number;
|
|
29
|
+
beltIndexInChain: number;
|
|
30
|
+
};
|
|
31
|
+
export type ConveyorChainActorSpecialProperties = {
|
|
32
|
+
firstBelt: ObjectReference;
|
|
33
|
+
lastBelt: ObjectReference;
|
|
34
|
+
beltsInChain: ConveyorChainSegmentSpecialProperties[];
|
|
35
|
+
unknownInts: [number, number];
|
|
36
|
+
firstChainItemIndex: number;
|
|
37
|
+
lastChainItemIndex: number;
|
|
38
|
+
items: ConveyorItemSpecialProperties[];
|
|
39
|
+
};
|
|
40
|
+
export type BuildableTypeInstance = {
|
|
41
|
+
transform: Transform;
|
|
42
|
+
unknownUseNumbers: [vec2, vec3];
|
|
43
|
+
swatchSlotTypePath: string;
|
|
44
|
+
paintFinishPath: string;
|
|
45
|
+
recipeTypePath: string;
|
|
46
|
+
patternPath: string;
|
|
47
|
+
blueprintProxy: ObjectReference;
|
|
48
|
+
};
|
|
49
|
+
export type BuildableSubsystemSpecialProperties = {
|
|
50
|
+
buildables: {
|
|
51
|
+
typePath: string;
|
|
52
|
+
instances: BuildableTypeInstance[];
|
|
53
|
+
}[];
|
|
54
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BinaryReadable } from '../../../../byte/binary-readable.interface';
|
|
2
|
+
import { ByteWriter } from '../../../../byte/byte-writer.class';
|
|
3
|
+
import { SpecialAnyProperties } from './SpecialAnyProperties';
|
|
4
|
+
export declare namespace SpecialProperties {
|
|
5
|
+
const ParseClassSpecificSpecialProperties: (reader: BinaryReadable, typePath: string, remainingLen: number) => SpecialAnyProperties;
|
|
6
|
+
const SerializeClassSpecificSpecialProperties: (writer: ByteWriter, typePath: string, property: SpecialAnyProperties) => void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpecialProperties = void 0;
|
|
4
|
+
const ObjectReference_1 = require("../../structs/ObjectReference");
|
|
5
|
+
const Transform_1 = require("../../structs/Transform");
|
|
6
|
+
const vec2_1 = require("../../structs/vec2");
|
|
7
|
+
const vec3_1 = require("../../structs/vec3");
|
|
8
|
+
var SpecialProperties;
|
|
9
|
+
(function (SpecialProperties) {
|
|
10
|
+
SpecialProperties.ParseClassSpecificSpecialProperties = (reader, typePath, remainingLen) => {
|
|
11
|
+
let property;
|
|
12
|
+
const start = reader.getBufferPosition();
|
|
13
|
+
switch (typePath) {
|
|
14
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk1/Build_ConveyorBeltMk1.Build_ConveyorBeltMk1_C':
|
|
15
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk2/Build_ConveyorBeltMk2.Build_ConveyorBeltMk2_C':
|
|
16
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk3/Build_ConveyorBeltMk3.Build_ConveyorBeltMk3_C':
|
|
17
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk4/Build_ConveyorBeltMk4.Build_ConveyorBeltMk4_C':
|
|
18
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk5/Build_ConveyorBeltMk5.Build_ConveyorBeltMk5_C':
|
|
19
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk6/Build_ConveyorBeltMk6.Build_ConveyorBeltMk6_C':
|
|
20
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk1/Build_ConveyorLiftMk1.Build_ConveyorLiftMk1_C':
|
|
21
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk2/Build_ConveyorLiftMk2.Build_ConveyorLiftMk2_C':
|
|
22
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk3/Build_ConveyorLiftMk3.Build_ConveyorLiftMk3_C':
|
|
23
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
|
|
24
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
|
|
25
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk6/Build_ConveyorLiftMk6.Build_ConveyorLiftMk6_C':
|
|
26
|
+
reader.readInt32();
|
|
27
|
+
property = {};
|
|
28
|
+
break;
|
|
29
|
+
case '/Script/FactoryGame.FGConveyorChainActor':
|
|
30
|
+
const lastBelt = ObjectReference_1.ObjectReference.read(reader);
|
|
31
|
+
const firstBelt = ObjectReference_1.ObjectReference.read(reader);
|
|
32
|
+
const countBeltsInChain = reader.readInt32();
|
|
33
|
+
const beltsInChain = [];
|
|
34
|
+
for (let i = 0; i < countBeltsInChain; i++) {
|
|
35
|
+
const chainActorRef = ObjectReference_1.ObjectReference.read(reader);
|
|
36
|
+
const beltRef = ObjectReference_1.ObjectReference.read(reader);
|
|
37
|
+
const someCount = reader.readInt32();
|
|
38
|
+
const unknownUseBytes = Array.from(reader.readBytes(someCount * 3 * 24 + 12));
|
|
39
|
+
const firstItemIndex = reader.readInt32();
|
|
40
|
+
const lastItemIndex = reader.readInt32();
|
|
41
|
+
const beltIndexInChain = reader.readInt32();
|
|
42
|
+
beltsInChain.push({
|
|
43
|
+
chainActorRef,
|
|
44
|
+
beltRef,
|
|
45
|
+
someCount,
|
|
46
|
+
unknownUseBytes,
|
|
47
|
+
firstItemIndex,
|
|
48
|
+
lastItemIndex,
|
|
49
|
+
beltIndexInChain
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const unknownInts = [reader.readInt32(), reader.readInt32()];
|
|
53
|
+
const firstChainItemIndex = reader.readInt32();
|
|
54
|
+
const lastChainItemIndex = reader.readInt32();
|
|
55
|
+
const countItemsInChain = reader.readInt32();
|
|
56
|
+
const items = [];
|
|
57
|
+
for (let n = 0; n < countItemsInChain; n++) {
|
|
58
|
+
reader.readInt32();
|
|
59
|
+
const itemName = reader.readString();
|
|
60
|
+
reader.readInt32();
|
|
61
|
+
const position = reader.readInt32();
|
|
62
|
+
items.push({ itemName, position });
|
|
63
|
+
}
|
|
64
|
+
property = {
|
|
65
|
+
firstBelt: firstBelt,
|
|
66
|
+
lastBelt: lastBelt,
|
|
67
|
+
beltsInChain,
|
|
68
|
+
unknownInts,
|
|
69
|
+
firstChainItemIndex,
|
|
70
|
+
lastChainItemIndex,
|
|
71
|
+
items
|
|
72
|
+
};
|
|
73
|
+
break;
|
|
74
|
+
case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
|
|
75
|
+
case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
|
|
76
|
+
property = {
|
|
77
|
+
source: ObjectReference_1.ObjectReference.read(reader),
|
|
78
|
+
target: ObjectReference_1.ObjectReference.read(reader)
|
|
79
|
+
};
|
|
80
|
+
if (remainingLen - (reader.getBufferPosition() - start) >= 24) {
|
|
81
|
+
property.sourceTranslation = vec3_1.vec3.ParseF(reader);
|
|
82
|
+
property.targetTranslation = vec3_1.vec3.ParseF(reader);
|
|
83
|
+
}
|
|
84
|
+
break;
|
|
85
|
+
case '/Game/FactoryGame/Character/Player/BP_PlayerState.BP_PlayerState_C':
|
|
86
|
+
property = {};
|
|
87
|
+
property.flag = reader.readByte();
|
|
88
|
+
switch (property.flag) {
|
|
89
|
+
case 248:
|
|
90
|
+
const eos = reader.readString();
|
|
91
|
+
property.eosData = reader.readString();
|
|
92
|
+
break;
|
|
93
|
+
case 25:
|
|
94
|
+
break;
|
|
95
|
+
default:
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
case '/Script/FactoryGame.FGLightweightBuildableSubsystem':
|
|
100
|
+
property = { buildables: [] };
|
|
101
|
+
const entriesCount = reader.readInt32();
|
|
102
|
+
if (entriesCount > 0) {
|
|
103
|
+
for (let i = 0; i < entriesCount; i++) {
|
|
104
|
+
reader.readInt32();
|
|
105
|
+
const typePath = reader.readString();
|
|
106
|
+
const count = reader.readInt32();
|
|
107
|
+
const instances = [];
|
|
108
|
+
for (let j = 0; j < count; j++) {
|
|
109
|
+
const transform = Transform_1.Transform.Parse(reader);
|
|
110
|
+
reader.readInt32();
|
|
111
|
+
const swatchSlotTypePath = reader.readString();
|
|
112
|
+
reader.readInt32();
|
|
113
|
+
reader.readInt64();
|
|
114
|
+
const patternPath = reader.readString();
|
|
115
|
+
const zeroes = vec2_1.vec2.Parse(reader);
|
|
116
|
+
const oneZeroOne = vec3_1.vec3.Parse(reader);
|
|
117
|
+
const unknownUseNumbers = [zeroes, oneZeroOne];
|
|
118
|
+
reader.readInt32();
|
|
119
|
+
const paintFinishPath = reader.readString();
|
|
120
|
+
reader.readInt32();
|
|
121
|
+
reader.readBytes(1);
|
|
122
|
+
const recipeTypePath = reader.readString();
|
|
123
|
+
const blueprintProxy = ObjectReference_1.ObjectReference.read(reader);
|
|
124
|
+
instances.push({
|
|
125
|
+
transform,
|
|
126
|
+
unknownUseNumbers,
|
|
127
|
+
swatchSlotTypePath,
|
|
128
|
+
paintFinishPath,
|
|
129
|
+
recipeTypePath,
|
|
130
|
+
patternPath,
|
|
131
|
+
blueprintProxy
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
property.buildables.push({
|
|
135
|
+
typePath,
|
|
136
|
+
instances
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
property = {};
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
return property;
|
|
146
|
+
};
|
|
147
|
+
SpecialProperties.SerializeClassSpecificSpecialProperties = (writer, typePath, property) => {
|
|
148
|
+
switch (typePath) {
|
|
149
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk1/Build_ConveyorBeltMk1.Build_ConveyorBeltMk1_C':
|
|
150
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk2/Build_ConveyorBeltMk2.Build_ConveyorBeltMk2_C':
|
|
151
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk3/Build_ConveyorBeltMk3.Build_ConveyorBeltMk3_C':
|
|
152
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk4/Build_ConveyorBeltMk4.Build_ConveyorBeltMk4_C':
|
|
153
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk5/Build_ConveyorBeltMk5.Build_ConveyorBeltMk5_C':
|
|
154
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk6/Build_ConveyorBeltMk6.Build_ConveyorBeltMk6_C':
|
|
155
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk1/Build_ConveyorLiftMk1.Build_ConveyorLiftMk1_C':
|
|
156
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk2/Build_ConveyorLiftMk2.Build_ConveyorLiftMk2_C':
|
|
157
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk3/Build_ConveyorLiftMk3.Build_ConveyorLiftMk3_C':
|
|
158
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
|
|
159
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
|
|
160
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk6/Build_ConveyorLiftMk6.Build_ConveyorLiftMk6_C':
|
|
161
|
+
writer.writeInt32(0);
|
|
162
|
+
break;
|
|
163
|
+
case '/Script/FactoryGame.FGConveyorChainActor':
|
|
164
|
+
ObjectReference_1.ObjectReference.write(writer, property.lastBelt);
|
|
165
|
+
ObjectReference_1.ObjectReference.write(writer, property.firstBelt);
|
|
166
|
+
writer.writeInt32(property.beltsInChain.length);
|
|
167
|
+
for (const belt of property.beltsInChain) {
|
|
168
|
+
ObjectReference_1.ObjectReference.write(writer, belt.chainActorRef);
|
|
169
|
+
ObjectReference_1.ObjectReference.write(writer, belt.beltRef);
|
|
170
|
+
writer.writeInt32(belt.someCount);
|
|
171
|
+
writer.writeBytesArray(belt.unknownUseBytes);
|
|
172
|
+
writer.writeInt32(belt.firstItemIndex);
|
|
173
|
+
writer.writeInt32(belt.lastItemIndex);
|
|
174
|
+
writer.writeInt32(belt.beltIndexInChain);
|
|
175
|
+
}
|
|
176
|
+
writer.writeInt32(property.unknownInts[0]);
|
|
177
|
+
writer.writeInt32(property.unknownInts[1]);
|
|
178
|
+
writer.writeInt32(property.firstChainItemIndex);
|
|
179
|
+
writer.writeInt32(property.lastChainItemIndex);
|
|
180
|
+
writer.writeInt32(property.items.length);
|
|
181
|
+
for (const item of property.items) {
|
|
182
|
+
writer.writeInt32(0);
|
|
183
|
+
writer.writeString(item.itemName);
|
|
184
|
+
writer.writeInt32(0);
|
|
185
|
+
writer.writeInt32(item.position);
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
|
|
189
|
+
case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
|
|
190
|
+
ObjectReference_1.ObjectReference.write(writer, property.source);
|
|
191
|
+
ObjectReference_1.ObjectReference.write(writer, property.target);
|
|
192
|
+
break;
|
|
193
|
+
case '/Game/FactoryGame/Character/Player/BP_PlayerState.BP_PlayerState_C':
|
|
194
|
+
writer.writeByte(property.flag);
|
|
195
|
+
switch (property.flag) {
|
|
196
|
+
case 248:
|
|
197
|
+
writer.writeString('EOS');
|
|
198
|
+
writer.writeString(property.eosData);
|
|
199
|
+
break;
|
|
200
|
+
case 25:
|
|
201
|
+
break;
|
|
202
|
+
default:
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
break;
|
|
206
|
+
case '/Script/FactoryGame.FGLightweightBuildableSubsystem':
|
|
207
|
+
writer.writeInt32(property.buildables.length);
|
|
208
|
+
if (property.buildables.length > 0) {
|
|
209
|
+
for (const buildable of property.buildables) {
|
|
210
|
+
writer.writeInt32(0);
|
|
211
|
+
writer.writeString(buildable.typePath);
|
|
212
|
+
writer.writeInt32(buildable.instances.length);
|
|
213
|
+
for (const instance of buildable.instances) {
|
|
214
|
+
Transform_1.Transform.Serialize(writer, instance.transform);
|
|
215
|
+
writer.writeInt32(0);
|
|
216
|
+
writer.writeString(instance.swatchSlotTypePath);
|
|
217
|
+
writer.writeInt32(0);
|
|
218
|
+
writer.writeInt64(0n);
|
|
219
|
+
writer.writeString(instance.patternPath);
|
|
220
|
+
vec2_1.vec2.Serialize(writer, instance.unknownUseNumbers[0]);
|
|
221
|
+
vec3_1.vec3.Serialize(writer, instance.unknownUseNumbers[1]);
|
|
222
|
+
writer.writeInt32(0);
|
|
223
|
+
writer.writeString(instance.paintFinishPath);
|
|
224
|
+
writer.writeInt32(0);
|
|
225
|
+
writer.writeByte(0);
|
|
226
|
+
writer.writeString(instance.recipeTypePath);
|
|
227
|
+
ObjectReference_1.ObjectReference.write(writer, instance.blueprintProxy);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
})(SpecialProperties || (exports.SpecialProperties = SpecialProperties = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BinaryReadable } from '../../../byte/binary-readable.interface';
|
|
2
|
+
import { ByteWriter } from '../../../byte/byte-writer.class';
|
|
3
|
+
import { PropertiesMap } from '../property/generic/BasicProperty';
|
|
4
|
+
export type DynamicStructPropertyValue = {
|
|
5
|
+
type: string;
|
|
6
|
+
properties: PropertiesMap;
|
|
7
|
+
};
|
|
8
|
+
export declare namespace DynamicStructPropertyValue {
|
|
9
|
+
const read: (reader: BinaryReadable, buildVersion: number, type: string) => DynamicStructPropertyValue;
|
|
10
|
+
const write: (writer: ByteWriter, buildVersion: number, data: DynamicStructPropertyValue) => void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamicStructPropertyValue = void 0;
|
|
4
|
+
const PropertiesList_1 = require("../property/PropertiesList");
|
|
5
|
+
var DynamicStructPropertyValue;
|
|
6
|
+
(function (DynamicStructPropertyValue) {
|
|
7
|
+
DynamicStructPropertyValue.read = (reader, buildVersion, type) => {
|
|
8
|
+
const data = {
|
|
9
|
+
type, properties: {}
|
|
10
|
+
};
|
|
11
|
+
let propertyName = reader.readString();
|
|
12
|
+
while (propertyName !== 'None') {
|
|
13
|
+
const parsedProperty = PropertiesList_1.PropertiesList.ParseSingleProperty(reader, buildVersion, propertyName);
|
|
14
|
+
if (data.properties[propertyName]) {
|
|
15
|
+
if (!Array.isArray(data.properties[propertyName])) {
|
|
16
|
+
data.properties[propertyName] = [data.properties[propertyName]];
|
|
17
|
+
}
|
|
18
|
+
data.properties[propertyName].push(parsedProperty);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
data.properties[propertyName] = parsedProperty;
|
|
22
|
+
}
|
|
23
|
+
propertyName = reader.readString();
|
|
24
|
+
}
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
DynamicStructPropertyValue.write = (writer, buildVersion, data) => {
|
|
28
|
+
for (const key in data.properties) {
|
|
29
|
+
for (const prop of (Array.isArray(data.properties[key]) ? data.properties[key] : [data.properties[key]])) {
|
|
30
|
+
writer.writeString(key);
|
|
31
|
+
PropertiesList_1.PropertiesList.SerializeSingleProperty(writer, prop, key, buildVersion);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
writer.writeString('None');
|
|
35
|
+
};
|
|
36
|
+
})(DynamicStructPropertyValue || (exports.DynamicStructPropertyValue = DynamicStructPropertyValue = {}));
|
|
37
|
+
;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BinaryReadable } from '../../../../../byte/binary-readable.interface';
|
|
2
|
+
import { ByteWriter } from '../../../../../byte/byte-writer.class';
|
|
3
|
+
export type FICFrameRange = {
|
|
4
|
+
begin: string;
|
|
5
|
+
end: string;
|
|
6
|
+
};
|
|
7
|
+
export declare namespace FICFrameRange {
|
|
8
|
+
const Parse: (reader: BinaryReadable) => FICFrameRange;
|
|
9
|
+
const Serialize: (writer: ByteWriter, value: FICFrameRange) => void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FICFrameRange = void 0;
|
|
4
|
+
var FICFrameRange;
|
|
5
|
+
(function (FICFrameRange) {
|
|
6
|
+
FICFrameRange.Parse = (reader) => {
|
|
7
|
+
return {
|
|
8
|
+
begin: reader.readInt64().toString(),
|
|
9
|
+
end: reader.readInt64().toString(),
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
FICFrameRange.Serialize = (writer, value) => {
|
|
13
|
+
writer.writeInt64(BigInt(value.begin));
|
|
14
|
+
writer.writeInt64(BigInt(value.end));
|
|
15
|
+
};
|
|
16
|
+
})(FICFrameRange || (exports.FICFrameRange = FICFrameRange = {}));
|