@etothepii/satisfactory-file-parser 0.0.33 → 0.1.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.
Files changed (38) hide show
  1. package/README.md +12 -8
  2. package/build/index.js +41 -51
  3. package/build/parser/byte/alignment.enum.js +8 -18
  4. package/build/parser/byte/binary-operable.interface.js +2 -12
  5. package/build/parser/byte/binary-readable.interface.js +2 -12
  6. package/build/parser/byte/byte-reader.class.js +122 -132
  7. package/build/parser/byte/byte-writer.class.js +133 -143
  8. package/build/parser/error/parser.error.js +40 -50
  9. package/build/parser/file.types.js +2 -12
  10. package/build/parser/parser.js +84 -95
  11. package/build/parser/satisfactory/blueprint/blueprint-reader.js +109 -119
  12. package/build/parser/satisfactory/blueprint/blueprint-writer.js +56 -66
  13. package/build/parser/satisfactory/blueprint/blueprint.types.js +2 -12
  14. package/build/parser/satisfactory/objects/DataFields.js +306 -307
  15. package/build/parser/satisfactory/objects/ObjectReference.js +14 -24
  16. package/build/parser/satisfactory/objects/Property.js +974 -977
  17. package/build/parser/satisfactory/objects/SaveComponent.js +28 -38
  18. package/build/parser/satisfactory/objects/SaveEntity.js +69 -75
  19. package/build/parser/satisfactory/objects/SaveObject.js +26 -36
  20. package/build/parser/satisfactory/save/asynchronous-level.class.js +60 -70
  21. package/build/parser/satisfactory/save/level.class.d.ts +1 -1
  22. package/build/parser/satisfactory/save/level.class.js +147 -128
  23. package/build/parser/satisfactory/save/satisfactory-save.js +10 -20
  24. package/build/parser/satisfactory/save/save-reader.d.ts +2 -2
  25. package/build/parser/satisfactory/save/save-reader.js +209 -171
  26. package/build/parser/satisfactory/save/save-writer.js +97 -107
  27. package/build/parser/satisfactory/save/save.types.js +2 -12
  28. package/build/parser/satisfactory/structs/util.types.d.ts +6 -0
  29. package/build/parser/satisfactory/structs/util.types.js +122 -96
  30. package/build/parser/stream/byte-stream-reader.class.js +217 -227
  31. package/build/parser/stream/json-stream-state-writer.js +15 -25
  32. package/build/parser/stream/json-stream-writable.js +72 -82
  33. package/build/parser/stream/json-stream-writer.js +122 -132
  34. package/build/parser/stream/save-stream-json-stringifier.js +29 -39
  35. package/build/parser/stream/save-stream-reader.class.js +106 -116
  36. package/build/parser/stream/save-stream-writer.class.js +90 -100
  37. package/build/parser/stream/stream-level.class.js +93 -103
  38. package/package.json +2 -2
@@ -1,317 +1,316 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
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 {
7
+ constructor() {
8
+ this.properties = [];
9
+ this.specialProperties = {};
10
+ this.trailingData = [];
11
+ this.shouldBeNulled = false;
5
12
  }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../structs/util.types", "./Property"], factory);
13
+ static Parse(length, reader, buildVersion, typePath) {
14
+ const start = reader.getBufferPosition();
15
+ const fields = new DataFields();
16
+ if (length === 0) {
17
+ fields.shouldBeNulled = true;
18
+ return fields;
19
+ }
20
+ let propertyName = reader.readString();
21
+ while (propertyName !== 'None') {
22
+ const property = DataFields.ParseProperty(reader, buildVersion, propertyName);
23
+ fields.properties.push(property);
24
+ propertyName = reader.readString();
25
+ }
26
+ let int1 = reader.readInt32();
27
+ if (int1 !== 0) {
28
+ }
29
+ const remainingLen = length - (reader.getBufferPosition() - start);
30
+ const oldRemainingLen = start + length - reader.getBufferPosition() - 4;
31
+ fields.specialProperties = DataFields.ParseAdditionalSpecialProperties(reader, typePath, remainingLen);
32
+ const end = reader.getBufferPosition();
33
+ const newWayOfCalculatingReminingSize = length - (end - start);
34
+ if (newWayOfCalculatingReminingSize > 0) {
35
+ reader.readBytes(newWayOfCalculatingReminingSize);
36
+ }
37
+ else if (newWayOfCalculatingReminingSize < 0) {
38
+ console.warn(`Unexpected. Did i read too much or is save corrupt !? bytes left to read is ${newWayOfCalculatingReminingSize}`);
39
+ }
40
+ return fields;
8
41
  }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DataFields = void 0;
13
- const util_types_1 = require("../structs/util.types");
14
- const Property_1 = require("./Property");
15
- class DataFields {
16
- constructor() {
17
- this.properties = [];
18
- this.specialProperties = {};
19
- this.trailingData = [];
20
- this.shouldBeNulled = false;
42
+ static ParseAdditionalSpecialProperties(reader, typePath, remainingLen) {
43
+ let property;
44
+ const start = reader.getBufferPosition();
45
+ switch (typePath) {
46
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk1/Build_ConveyorBeltMk1.Build_ConveyorBeltMk1_C':
47
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk2/Build_ConveyorBeltMk2.Build_ConveyorBeltMk2_C':
48
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk3/Build_ConveyorBeltMk3.Build_ConveyorBeltMk3_C':
49
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk4/Build_ConveyorBeltMk4.Build_ConveyorBeltMk4_C':
50
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk5/Build_ConveyorBeltMk5.Build_ConveyorBeltMk5_C':
51
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk1/Build_ConveyorLiftMk1.Build_ConveyorLiftMk1_C':
52
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk2/Build_ConveyorLiftMk2.Build_ConveyorLiftMk2_C':
53
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk3/Build_ConveyorLiftMk3.Build_ConveyorLiftMk3_C':
54
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
55
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
56
+ property = {};
57
+ break;
58
+ case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
59
+ case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
60
+ property = {
61
+ source: Property_1.ObjectProperty.ReadValue(reader),
62
+ target: Property_1.ObjectProperty.ReadValue(reader)
63
+ };
64
+ if (remainingLen - (reader.getBufferPosition() - start) >= 24) {
65
+ property.sourceTranslation = (0, util_types_1.ParseVec3f)(reader);
66
+ property.targetTranslation = (0, util_types_1.ParseVec3f)(reader);
67
+ }
68
+ break;
69
+ case '/Game/FactoryGame/Character/Player/BP_PlayerState.BP_PlayerState_C':
70
+ property = {};
71
+ property.flag = reader.readByte();
72
+ switch (property.flag) {
73
+ case 248:
74
+ const eos = reader.readString();
75
+ property.eosData = reader.readString();
76
+ break;
77
+ case 25:
78
+ break;
79
+ default:
80
+ break;
81
+ }
82
+ break;
83
+ default:
84
+ property = {};
85
+ break;
21
86
  }
22
- static Parse(length, reader, buildVersion, typePath) {
23
- const start = reader.getBufferPosition();
24
- const fields = new DataFields();
25
- if (length === 0) {
26
- fields.shouldBeNulled = true;
27
- return fields;
28
- }
29
- let propertyName = reader.readString();
30
- while (propertyName !== 'None') {
31
- const property = DataFields.ParseProperty(reader, buildVersion, propertyName);
32
- fields.properties.push(property);
33
- propertyName = reader.readString();
34
- }
35
- let int1 = reader.readInt32();
36
- if (int1 !== 0) {
37
- }
38
- fields.specialProperties = DataFields.ParseAdditionalSpecialProperties(reader, typePath, start + length - reader.getBufferPosition() - 4);
39
- const end = reader.getBufferPosition();
40
- let remainingBytes = start + length - end;
41
- fields.trailingData = Array.from(reader.readBytes(remainingBytes));
42
- return fields;
87
+ return property;
88
+ }
89
+ static ParseProperty(reader, buildVersion, propertyName) {
90
+ let currentProperty = {};
91
+ if (currentProperty.name === 'None') {
92
+ return null;
43
93
  }
44
- static ParseAdditionalSpecialProperties(reader, typePath, remainingLen) {
45
- let property;
46
- switch (typePath) {
47
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk1/Build_ConveyorBeltMk1.Build_ConveyorBeltMk1_C':
48
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk2/Build_ConveyorBeltMk2.Build_ConveyorBeltMk2_C':
49
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk3/Build_ConveyorBeltMk3.Build_ConveyorBeltMk3_C':
50
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk4/Build_ConveyorBeltMk4.Build_ConveyorBeltMk4_C':
51
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk5/Build_ConveyorBeltMk5.Build_ConveyorBeltMk5_C':
52
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk1/Build_ConveyorLiftMk1.Build_ConveyorLiftMk1_C':
53
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk2/Build_ConveyorLiftMk2.Build_ConveyorLiftMk2_C':
54
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk3/Build_ConveyorLiftMk3.Build_ConveyorLiftMk3_C':
55
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
56
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
57
- property = {};
58
- break;
59
- case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
60
- case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
61
- property = {
62
- source: Property_1.ObjectProperty.ReadValue(reader),
63
- target: Property_1.ObjectProperty.ReadValue(reader)
64
- };
65
- if (remainingLen >= 24) {
66
- property.sourceTranslation = (0, util_types_1.ParseVec3)(reader);
67
- property.targetTranslation = (0, util_types_1.ParseVec3)(reader);
68
- }
69
- break;
70
- case '/Game/FactoryGame/Character/Player/BP_PlayerState.BP_PlayerState_C':
71
- property = {};
72
- property.flag = reader.readByte();
73
- switch (property.flag) {
74
- case 248:
75
- const eos = reader.readString();
76
- property.eosData = reader.readString();
77
- break;
78
- case 25:
79
- break;
80
- default:
81
- break;
82
- }
83
- break;
84
- default:
85
- property = {};
86
- break;
87
- }
88
- return property;
94
+ const propertyType = reader.readString();
95
+ const binarySize = reader.readInt32();
96
+ const index = reader.readInt32();
97
+ const before = reader.getBufferPosition();
98
+ let overhead = 0;
99
+ switch (propertyType) {
100
+ case 'BoolProperty':
101
+ currentProperty = Property_1.BoolProperty.Parse(reader, propertyType, index);
102
+ overhead = Property_1.BoolProperty.CalcOverhead(currentProperty);
103
+ break;
104
+ case 'ByteProperty':
105
+ currentProperty = Property_1.ByteProperty.Parse(reader, propertyType, index);
106
+ overhead = Property_1.ByteProperty.CalcOverhead(currentProperty);
107
+ break;
108
+ case 'Int8Property':
109
+ currentProperty = Property_1.Int8Property.Parse(reader, propertyType, index);
110
+ overhead = Property_1.Int8Property.CalcOverhead(currentProperty);
111
+ break;
112
+ case 'UInt8Property':
113
+ currentProperty = Property_1.Uint8Property.Parse(reader, propertyType, index);
114
+ overhead = Property_1.Uint8Property.CalcOverhead(currentProperty);
115
+ break;
116
+ case 'IntProperty':
117
+ case 'Int32Property':
118
+ currentProperty = Property_1.Int32Property.Parse(reader, propertyType, index);
119
+ overhead = Property_1.Int32Property.CalcOverhead(currentProperty);
120
+ break;
121
+ case 'UInt32Property':
122
+ currentProperty = Property_1.Uint32Property.Parse(reader, propertyType, index);
123
+ overhead = Property_1.Uint32Property.CalcOverhead(currentProperty);
124
+ break;
125
+ case 'Int64Property':
126
+ currentProperty = Property_1.Int64Property.Parse(reader, propertyType, index);
127
+ overhead = Property_1.Int64Property.CalcOverhead(currentProperty);
128
+ break;
129
+ case 'SingleProperty':
130
+ case 'FloatProperty':
131
+ currentProperty = Property_1.FloatProperty.Parse(reader, propertyType, index);
132
+ overhead = Property_1.FloatProperty.CalcOverhead(currentProperty);
133
+ break;
134
+ case 'DoubleProperty':
135
+ currentProperty = Property_1.DoubleProperty.Parse(reader, propertyType, index);
136
+ overhead = Property_1.DoubleProperty.CalcOverhead(currentProperty);
137
+ break;
138
+ case 'StrProperty':
139
+ case 'NameProperty':
140
+ currentProperty = Property_1.StrProperty.Parse(reader, propertyType, index);
141
+ overhead = Property_1.StrProperty.CalcOverhead(currentProperty);
142
+ break;
143
+ case 'ObjectProperty':
144
+ case 'InterfaceProperty':
145
+ currentProperty = Property_1.ObjectProperty.Parse(reader, propertyType, index);
146
+ overhead = Property_1.ObjectProperty.CalcOverhead(currentProperty);
147
+ break;
148
+ case 'EnumProperty':
149
+ currentProperty = Property_1.EnumProperty.Parse(reader, propertyType, index);
150
+ overhead = Property_1.EnumProperty.CalcOverhead(currentProperty);
151
+ break;
152
+ case 'StructProperty':
153
+ currentProperty = Property_1.StructProperty.Parse(reader, propertyType, index, binarySize);
154
+ overhead = Property_1.StructProperty.CalcOverhead(currentProperty);
155
+ break;
156
+ case 'ArrayProperty':
157
+ currentProperty = Property_1.ArrayProperty.Parse(reader, propertyType, index, propertyName);
158
+ overhead = Property_1.ArrayProperty.CalcOverhead(currentProperty);
159
+ break;
160
+ case 'MapProperty':
161
+ currentProperty = Property_1.MapProperty.Parse(reader, propertyName, buildVersion, binarySize);
162
+ overhead = Property_1.MapProperty.CalcOverhead(currentProperty);
163
+ break;
164
+ case 'TextProperty':
165
+ currentProperty = Property_1.TextProperty.Parse(reader, propertyType, index);
166
+ overhead = Property_1.TextProperty.CalcOverhead(currentProperty);
167
+ break;
168
+ case 'SetProperty':
169
+ currentProperty = Property_1.SetProperty.Parse(reader, propertyType, index, propertyName);
170
+ overhead = Property_1.SetProperty.CalcOverhead(currentProperty);
171
+ break;
172
+ default:
173
+ throw new Error(`Unimplemented type ${propertyType}`);
89
174
  }
90
- static ParseProperty(reader, buildVersion, propertyName) {
91
- let currentProperty = {};
92
- if (currentProperty.name === 'None') {
93
- return null;
94
- }
95
- const propertyType = reader.readString();
96
- const binarySize = reader.readInt32();
97
- const index = reader.readInt32();
98
- const before = reader.getBufferPosition();
99
- let overhead = 0;
100
- switch (propertyType) {
101
- case 'BoolProperty':
102
- currentProperty = Property_1.BoolProperty.Parse(reader, propertyType, index);
103
- overhead = Property_1.BoolProperty.CalcOverhead(currentProperty);
104
- break;
105
- case 'ByteProperty':
106
- currentProperty = Property_1.ByteProperty.Parse(reader, propertyType, index);
107
- overhead = Property_1.ByteProperty.CalcOverhead(currentProperty);
108
- break;
109
- case 'Int8Property':
110
- currentProperty = Property_1.Int8Property.Parse(reader, propertyType, index);
111
- overhead = Property_1.Int8Property.CalcOverhead(currentProperty);
112
- break;
113
- case 'UInt8Property':
114
- currentProperty = Property_1.Uint8Property.Parse(reader, propertyType, index);
115
- overhead = Property_1.Uint8Property.CalcOverhead(currentProperty);
116
- break;
117
- case 'IntProperty':
118
- case 'Int32Property':
119
- currentProperty = Property_1.Int32Property.Parse(reader, propertyType, index);
120
- overhead = Property_1.Int32Property.CalcOverhead(currentProperty);
121
- break;
122
- case 'UInt32Property':
123
- currentProperty = Property_1.Uint32Property.Parse(reader, propertyType, index);
124
- overhead = Property_1.Uint32Property.CalcOverhead(currentProperty);
125
- break;
126
- case 'Int64Property':
127
- currentProperty = Property_1.Int64Property.Parse(reader, propertyType, index);
128
- overhead = Property_1.Int64Property.CalcOverhead(currentProperty);
129
- break;
130
- case 'SingleProperty':
131
- case 'FloatProperty':
132
- currentProperty = Property_1.FloatProperty.Parse(reader, propertyType, index);
133
- overhead = Property_1.FloatProperty.CalcOverhead(currentProperty);
134
- break;
135
- case 'DoubleProperty':
136
- currentProperty = Property_1.DoubleProperty.Parse(reader, propertyType, index);
137
- overhead = Property_1.DoubleProperty.CalcOverhead(currentProperty);
138
- break;
139
- case 'StrProperty':
140
- case 'NameProperty':
141
- currentProperty = Property_1.StrProperty.Parse(reader, propertyType, index);
142
- overhead = Property_1.StrProperty.CalcOverhead(currentProperty);
143
- break;
144
- case 'ObjectProperty':
145
- case 'InterfaceProperty':
146
- currentProperty = Property_1.ObjectProperty.Parse(reader, propertyType, index);
147
- overhead = Property_1.ObjectProperty.CalcOverhead(currentProperty);
148
- break;
149
- case 'EnumProperty':
150
- currentProperty = Property_1.EnumProperty.Parse(reader, propertyType, index);
151
- overhead = Property_1.EnumProperty.CalcOverhead(currentProperty);
152
- break;
153
- case 'StructProperty':
154
- currentProperty = Property_1.StructProperty.Parse(reader, propertyType, index, binarySize);
155
- overhead = Property_1.StructProperty.CalcOverhead(currentProperty);
156
- break;
157
- case 'ArrayProperty':
158
- currentProperty = Property_1.ArrayProperty.Parse(reader, propertyType, index, propertyName);
159
- overhead = Property_1.ArrayProperty.CalcOverhead(currentProperty);
160
- break;
161
- case 'MapProperty':
162
- currentProperty = Property_1.MapProperty.Parse(reader, propertyName, buildVersion, binarySize);
163
- overhead = Property_1.MapProperty.CalcOverhead(currentProperty);
164
- break;
165
- case 'TextProperty':
166
- currentProperty = Property_1.TextProperty.Parse(reader, propertyType, index);
167
- overhead = Property_1.TextProperty.CalcOverhead(currentProperty);
168
- break;
169
- case 'SetProperty':
170
- currentProperty = Property_1.SetProperty.Parse(reader, propertyType, index, propertyName);
171
- overhead = Property_1.SetProperty.CalcOverhead(currentProperty);
172
- break;
173
- default:
174
- throw new Error(`Unimplemented type ${propertyType}`);
175
- }
176
- currentProperty.name = propertyName;
177
- const readBytes = reader.getBufferPosition() - before - overhead;
178
- if (readBytes !== binarySize) {
179
- throw new Error(`possibly corrupt. Read ${readBytes} for ${propertyType} ${propertyName}, but ${binarySize} were indicated.`);
180
- }
181
- return currentProperty;
175
+ currentProperty.name = propertyName;
176
+ const readBytes = reader.getBufferPosition() - before - overhead;
177
+ if (readBytes !== binarySize) {
178
+ console.warn(`possibly corrupt. Read ${readBytes} for ${propertyType} ${propertyName}, but ${binarySize} were indicated.`);
179
+ throw new Error(`possibly corrupt. Read ${readBytes} for ${propertyType} ${propertyName}, but ${binarySize} were indicated.`);
182
180
  }
183
- static Serialize(writer, fields, buildVersion, typePath) {
184
- for (const property of fields.properties) {
185
- writer.writeString(property.name);
186
- DataFields.SerializeProperty(writer, property, property.name, buildVersion);
187
- }
188
- writer.writeString('None');
189
- writer.writeInt32(0);
190
- DataFields.SerializeAdditionalSpecialProperties(writer, typePath, fields.specialProperties);
191
- writer.writeBytesArray(fields.trailingData);
181
+ return currentProperty;
182
+ }
183
+ static Serialize(writer, fields, buildVersion, typePath) {
184
+ for (const property of fields.properties) {
185
+ writer.writeString(property.name);
186
+ DataFields.SerializeProperty(writer, property, property.name, buildVersion);
192
187
  }
193
- static SerializeAdditionalSpecialProperties(writer, typePath, property) {
194
- switch (typePath) {
195
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk1/Build_ConveyorBeltMk1.Build_ConveyorBeltMk1_C':
196
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk2/Build_ConveyorBeltMk2.Build_ConveyorBeltMk2_C':
197
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk3/Build_ConveyorBeltMk3.Build_ConveyorBeltMk3_C':
198
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk4/Build_ConveyorBeltMk4.Build_ConveyorBeltMk4_C':
199
- case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk5/Build_ConveyorBeltMk5.Build_ConveyorBeltMk5_C':
200
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk1/Build_ConveyorLiftMk1.Build_ConveyorLiftMk1_C':
201
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk2/Build_ConveyorLiftMk2.Build_ConveyorLiftMk2_C':
202
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk3/Build_ConveyorLiftMk3.Build_ConveyorLiftMk3_C':
203
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
204
- case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
205
- break;
206
- case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
207
- case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
208
- Property_1.ObjectProperty.SerializeValue(writer, property.source);
209
- Property_1.ObjectProperty.SerializeValue(writer, property.target);
210
- break;
211
- case '/Game/FactoryGame/Character/Player/BP_PlayerState.BP_PlayerState_C':
212
- writer.writeByte(property.flag);
213
- switch (property.flag) {
214
- case 248:
215
- writer.writeString('EOS');
216
- writer.writeString(property.eosData);
217
- break;
218
- case 25:
219
- break;
220
- default:
221
- break;
222
- }
223
- break;
224
- }
188
+ writer.writeString('None');
189
+ writer.writeInt32(0);
190
+ DataFields.SerializeAdditionalSpecialProperties(writer, typePath, fields.specialProperties);
191
+ writer.writeBytesArray(fields.trailingData);
192
+ }
193
+ static SerializeAdditionalSpecialProperties(writer, typePath, property) {
194
+ switch (typePath) {
195
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk1/Build_ConveyorBeltMk1.Build_ConveyorBeltMk1_C':
196
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk2/Build_ConveyorBeltMk2.Build_ConveyorBeltMk2_C':
197
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk3/Build_ConveyorBeltMk3.Build_ConveyorBeltMk3_C':
198
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk4/Build_ConveyorBeltMk4.Build_ConveyorBeltMk4_C':
199
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk5/Build_ConveyorBeltMk5.Build_ConveyorBeltMk5_C':
200
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk1/Build_ConveyorLiftMk1.Build_ConveyorLiftMk1_C':
201
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk2/Build_ConveyorLiftMk2.Build_ConveyorLiftMk2_C':
202
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk3/Build_ConveyorLiftMk3.Build_ConveyorLiftMk3_C':
203
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
204
+ case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
205
+ break;
206
+ case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
207
+ case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
208
+ Property_1.ObjectProperty.SerializeValue(writer, property.source);
209
+ Property_1.ObjectProperty.SerializeValue(writer, property.target);
210
+ break;
211
+ case '/Game/FactoryGame/Character/Player/BP_PlayerState.BP_PlayerState_C':
212
+ writer.writeByte(property.flag);
213
+ switch (property.flag) {
214
+ case 248:
215
+ writer.writeString('EOS');
216
+ writer.writeString(property.eosData);
217
+ break;
218
+ case 25:
219
+ break;
220
+ default:
221
+ break;
222
+ }
223
+ break;
225
224
  }
226
- static SerializeProperty(writer, property, propertyName, buildVersion) {
227
- writer.writeString(property.ueType);
228
- const lenIndicator = writer.getBufferPosition();
229
- writer.writeInt32(0);
230
- writer.writeInt32(property.index ?? 0);
231
- const start = writer.getBufferPosition();
232
- let overhead = 0;
233
- switch (property.ueType) {
234
- case 'BoolProperty':
235
- overhead = Property_1.BoolProperty.CalcOverhead(property);
236
- Property_1.BoolProperty.Serialize(writer, property);
237
- break;
238
- case 'ByteProperty':
239
- overhead = Property_1.ByteProperty.CalcOverhead(property);
240
- Property_1.ByteProperty.Serialize(writer, property);
241
- break;
242
- case 'Int8Property':
243
- overhead = Property_1.Int8Property.CalcOverhead(property);
244
- Property_1.Int8Property.Serialize(writer, property);
245
- break;
246
- case 'UInt8Property':
247
- overhead = Property_1.Uint8Property.CalcOverhead(property);
248
- Property_1.Uint8Property.Serialize(writer, property);
249
- break;
250
- case 'IntProperty':
251
- case 'Int32Property':
252
- overhead = Property_1.Int32Property.CalcOverhead(property);
253
- Property_1.Int32Property.Serialize(writer, property);
254
- break;
255
- case 'UInt32Property':
256
- overhead = Property_1.Uint32Property.CalcOverhead(property);
257
- Property_1.Uint32Property.Serialize(writer, property);
258
- break;
259
- case 'Int64Property':
260
- overhead = Property_1.Int64Property.CalcOverhead(property);
261
- Property_1.Int64Property.Serialize(writer, property);
262
- break;
263
- case 'SingleProperty':
264
- case 'FloatProperty':
265
- overhead = Property_1.FloatProperty.CalcOverhead(property);
266
- Property_1.FloatProperty.Serialize(writer, property);
267
- break;
268
- case 'DoubleProperty':
269
- overhead = Property_1.DoubleProperty.CalcOverhead(property);
270
- Property_1.DoubleProperty.Serialize(writer, property);
271
- break;
272
- case 'StrProperty':
273
- case 'NameProperty':
274
- overhead = Property_1.StrProperty.CalcOverhead(property);
275
- Property_1.StrProperty.Serialize(writer, property);
276
- break;
277
- case 'ObjectProperty':
278
- case 'InterfaceProperty':
279
- overhead = Property_1.ObjectProperty.CalcOverhead(property);
280
- Property_1.ObjectProperty.Serialize(writer, property);
281
- break;
282
- case 'EnumProperty':
283
- overhead = Property_1.EnumProperty.CalcOverhead(property);
284
- Property_1.EnumProperty.Serialize(writer, property);
285
- break;
286
- case 'ByteProperty':
287
- overhead = Property_1.ByteProperty.CalcOverhead(property);
288
- Property_1.ByteProperty.Serialize(writer, property);
289
- break;
290
- case 'StructProperty':
291
- overhead = Property_1.StructProperty.CalcOverhead(property);
292
- Property_1.StructProperty.Serialize(writer, property);
293
- break;
294
- case 'ArrayProperty':
295
- overhead = Property_1.ArrayProperty.CalcOverhead(property);
296
- Property_1.ArrayProperty.Serialize(writer, property, propertyName);
297
- break;
298
- case 'MapProperty':
299
- overhead = Property_1.MapProperty.CalcOverhead(property);
300
- Property_1.MapProperty.Serialize(writer, property);
301
- break;
302
- case 'TextProperty':
303
- overhead = Property_1.TextProperty.CalcOverhead(property);
304
- Property_1.TextProperty.Serialize(writer, property);
305
- break;
306
- case 'SetProperty':
307
- overhead = Property_1.SetProperty.CalcOverhead(property);
308
- Property_1.SetProperty.Serialize(writer, property);
309
- break;
310
- default:
311
- throw new Error(`Unimplemented type ${property.type}`);
312
- }
313
- writer.writeBinarySizeFromPosition(lenIndicator, start + overhead);
225
+ }
226
+ static SerializeProperty(writer, property, propertyName, buildVersion) {
227
+ writer.writeString(property.ueType);
228
+ const lenIndicator = writer.getBufferPosition();
229
+ writer.writeInt32(0);
230
+ writer.writeInt32(property.index ?? 0);
231
+ const start = writer.getBufferPosition();
232
+ let overhead = 0;
233
+ switch (property.ueType) {
234
+ case 'BoolProperty':
235
+ overhead = Property_1.BoolProperty.CalcOverhead(property);
236
+ Property_1.BoolProperty.Serialize(writer, property);
237
+ break;
238
+ case 'ByteProperty':
239
+ overhead = Property_1.ByteProperty.CalcOverhead(property);
240
+ Property_1.ByteProperty.Serialize(writer, property);
241
+ break;
242
+ case 'Int8Property':
243
+ overhead = Property_1.Int8Property.CalcOverhead(property);
244
+ Property_1.Int8Property.Serialize(writer, property);
245
+ break;
246
+ case 'UInt8Property':
247
+ overhead = Property_1.Uint8Property.CalcOverhead(property);
248
+ Property_1.Uint8Property.Serialize(writer, property);
249
+ break;
250
+ case 'IntProperty':
251
+ case 'Int32Property':
252
+ overhead = Property_1.Int32Property.CalcOverhead(property);
253
+ Property_1.Int32Property.Serialize(writer, property);
254
+ break;
255
+ case 'UInt32Property':
256
+ overhead = Property_1.Uint32Property.CalcOverhead(property);
257
+ Property_1.Uint32Property.Serialize(writer, property);
258
+ break;
259
+ case 'Int64Property':
260
+ overhead = Property_1.Int64Property.CalcOverhead(property);
261
+ Property_1.Int64Property.Serialize(writer, property);
262
+ break;
263
+ case 'SingleProperty':
264
+ case 'FloatProperty':
265
+ overhead = Property_1.FloatProperty.CalcOverhead(property);
266
+ Property_1.FloatProperty.Serialize(writer, property);
267
+ break;
268
+ case 'DoubleProperty':
269
+ overhead = Property_1.DoubleProperty.CalcOverhead(property);
270
+ Property_1.DoubleProperty.Serialize(writer, property);
271
+ break;
272
+ case 'StrProperty':
273
+ case 'NameProperty':
274
+ overhead = Property_1.StrProperty.CalcOverhead(property);
275
+ Property_1.StrProperty.Serialize(writer, property);
276
+ break;
277
+ case 'ObjectProperty':
278
+ case 'InterfaceProperty':
279
+ overhead = Property_1.ObjectProperty.CalcOverhead(property);
280
+ Property_1.ObjectProperty.Serialize(writer, property);
281
+ break;
282
+ case 'EnumProperty':
283
+ overhead = Property_1.EnumProperty.CalcOverhead(property);
284
+ Property_1.EnumProperty.Serialize(writer, property);
285
+ break;
286
+ case 'ByteProperty':
287
+ overhead = Property_1.ByteProperty.CalcOverhead(property);
288
+ Property_1.ByteProperty.Serialize(writer, property);
289
+ break;
290
+ case 'StructProperty':
291
+ overhead = Property_1.StructProperty.CalcOverhead(property);
292
+ Property_1.StructProperty.Serialize(writer, property);
293
+ break;
294
+ case 'ArrayProperty':
295
+ overhead = Property_1.ArrayProperty.CalcOverhead(property);
296
+ Property_1.ArrayProperty.Serialize(writer, property, propertyName);
297
+ break;
298
+ case 'MapProperty':
299
+ overhead = Property_1.MapProperty.CalcOverhead(property);
300
+ Property_1.MapProperty.Serialize(writer, property);
301
+ break;
302
+ case 'TextProperty':
303
+ overhead = Property_1.TextProperty.CalcOverhead(property);
304
+ Property_1.TextProperty.Serialize(writer, property);
305
+ break;
306
+ case 'SetProperty':
307
+ overhead = Property_1.SetProperty.CalcOverhead(property);
308
+ Property_1.SetProperty.Serialize(writer, property);
309
+ break;
310
+ default:
311
+ throw new Error(`Unimplemented type ${property.type}`);
314
312
  }
313
+ writer.writeBinarySizeFromPosition(lenIndicator, start + overhead);
315
314
  }
316
- exports.DataFields = DataFields;
317
- });
315
+ }
316
+ exports.DataFields = DataFields;