@etothepii/satisfactory-file-parser 0.0.32 → 0.0.34

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