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