terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
WorldFile_OldSwitch.cs
Go to the documentation of this file.
1using System;
2using System.IO;
6using Terraria;
9using Terraria.IO;
11
12// Token: 0x020002E2 RID: 738
13internal class WorldFile_OldSwitch
14{
15 // Token: 0x060010FA RID: 4346 RVA: 0x000546DC File Offset: 0x000528DC
16 public static WorldFileData GetAllMetadata(string file)
17 {
18 long num = 0L;
19 byte[] array;
20 int num2 = BitConverter.ToInt32(array, (int)num);
21 int num3 = 16384;
22 long num4 = 0L;
23 int num5 = 5;
24 if (num3 != 0)
25 {
26 }
28 if (num4 != 0L)
29 {
30 throw new OutOfMemoryException();
31 }
32 if (num5 == 0)
33 {
34 }
35 long num6 = 0L;
36 if (num3 != 0)
37 {
38 }
39 if (num6 != 0L)
40 {
41 throw new OutOfMemoryException();
42 }
44 long num7 = 0L;
45 if (num7 != 0L)
46 {
47 throw new OutOfMemoryException();
48 }
49 if (num7 != 0L)
50 {
51 throw new OutOfMemoryException();
52 }
53 throw new OutOfMemoryException();
54 }
55
56 // Token: 0x060010FB RID: 4347 RVA: 0x000547B8 File Offset: 0x000529B8
57 public static byte[] DecompressData(byte[] srcData)
58 {
59 if (!false)
60 {
61 if (!false)
62 {
63 }
64 throw new OutOfMemoryException();
65 }
66 throw new OutOfMemoryException();
67 }
68
69 // Token: 0x060010FC RID: 4348 RVA: 0x0005480C File Offset: 0x00052A0C
70 public static bool LoadSaveData(byte[] srcData)
71 {
72 if (!true)
73 {
74 }
75 long num = 0L;
76 int num2 = 4;
77 if (num == 0L)
78 {
79 long num3 = 0L;
80 if (num2 == 0)
81 {
82 }
83 if (num3 == 0L)
84 {
85 int num4;
86 if (num4 != 0)
87 {
88 }
90 }
91 throw new OutOfMemoryException();
92 }
93 throw new OutOfMemoryException();
94 }
95
96 // Token: 0x060010FD RID: 4349 RVA: 0x00054874 File Offset: 0x00052A74
97 private static void CleanItemsStoredInTiles()
98 {
99 int num = 1;
100 long num2 = 0L;
101 if (num == 0)
102 {
103 }
104 long num3 = 0L;
105 if (num == 0)
106 {
107 }
108 Tile tile;
109 ushort type = tile.type;
111 }
112
113 // Token: 0x060010FE RID: 4350 RVA: 0x000548A8 File Offset: 0x00052AA8
114 private static void CheckWeaponsRack(int i, int j)
115 {
116 int num = 1;
117 if (num == 0)
118 {
119 }
120 Tile tile;
121 short frameY = tile.frameY;
122 if (num == 0)
123 {
124 }
125 Tile tile2;
126 short frameY2 = tile2.frameY;
127 if (num == 0)
128 {
129 }
130 Tile tile3;
131 short frameY3 = tile3.frameY;
132 if (num == 0)
133 {
134 }
135 Tile tile4;
136 short frameX = tile4.frameX;
137 int num2 = 36409;
138 if (num2 == 0)
139 {
140 }
141 Tile tile5;
142 short frameX2 = tile5.frameX;
143 if (num2 == 0)
144 {
145 }
146 Tile tile6;
147 short frameX3 = tile6.frameX;
148 long num3 = 0L;
149 Tile tile7;
150 tile7.SetFrameX((short)num3);
151 int num4 = 18;
152 Tile tile8;
153 tile8.SetFrameY((short)num4);
154 }
155
156 // Token: 0x060010FF RID: 4351 RVA: 0x0005493C File Offset: 0x00052B3C
157 public static bool ItemFitsWeaponRack(Item i)
158 {
159 if (!true || true)
160 {
161 return;
162 }
163 }
164
165 // Token: 0x06001100 RID: 4352 RVA: 0x00054950 File Offset: 0x00052B50
166 public static void PlaceWeapon(int x, int y, Item item)
167 {
168 int num = 1;
169 if (num == 0)
170 {
171 }
172 Tile tile;
173 bool flag = tile.active();
174 if (num == 0)
175 {
176 }
177 Tile tile2;
178 ushort type = tile2.type;
179 if (num == 0)
180 {
181 }
182 Tile tile3;
183 short frameY = tile3.frameY;
184 if (num == 0)
185 {
186 }
187 Tile tile4;
188 short frameY2 = tile4.frameY;
189 if (num == 0)
190 {
191 }
192 Tile tile5;
193 short frameY3 = tile5.frameY;
194 if (num == 0)
195 {
196 }
197 Tile tile6;
198 short frameX = tile6.frameX;
199 if (36409 == 0)
200 {
201 }
202 Tile tile7;
203 short frameX2 = tile7.frameX;
204 int netID = item.netID;
205 Tile tile8;
206 tile8.SetFrameX((short)x);
207 byte prefix = item.prefix;
208 Tile tile9;
209 tile9.SetFrameX((short)x);
210 }
211
212 // Token: 0x06001101 RID: 4353 RVA: 0x000549DC File Offset: 0x00052BDC
213 private static void CheckMannequin(int i, int j)
214 {
215 int num = 1;
216 if (num == 0)
217 {
218 }
219 Tile tile;
220 short frameX = tile.frameX;
221 if (num == 0)
222 {
223 }
224 Tile tile2;
225 short frameY = tile2.frameY;
226 if (num == 0)
227 {
228 }
229 }
230
231 // Token: 0x06001102 RID: 4354 RVA: 0x00054A54 File Offset: 0x00052C54
232 private static int LoadWorld_Version2(BinaryReader reader)
233 {
234 return 5;
235 }
236
237 // Token: 0x06001103 RID: 4355 RVA: 0x00054A74 File Offset: 0x00052C74
238 private static void LoadWeightedPressurePlates(BinaryReader reader)
239 {
240 if (!true)
241 {
242 }
244 }
245
246 // Token: 0x06001104 RID: 4356 RVA: 0x00054A8C File Offset: 0x00052C8C
247 private static void LoadTownManager(BinaryReader reader)
248 {
249 if (!true)
250 {
251 }
252 }
253
254 // Token: 0x06001105 RID: 4357 RVA: 0x00054A9C File Offset: 0x00052C9C
255 private static void LoadTileEntities(BinaryReader reader)
256 {
257 if (!true)
258 {
259 }
261 long num = 0L;
262 long num2 = 0L;
264 tileEntity.ID = (int)num;
265 int positionKey = tileEntity.PositionKey;
266 int positionKey2 = tileEntity.PositionKey;
267 }
268
269 // Token: 0x06001106 RID: 4358 RVA: 0x00054B5C File Offset: 0x00052D5C
270 private static bool LoadFileFormatHeader(BinaryReader reader, [Out] bool[] importance, [Out] int[] positions)
271 {
272 /*
273An exception occurred when decompiling this method (06001106)
274
275ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean WorldFile_OldSwitch::LoadFileFormatHeader(System.IO.BinaryReader,System.Boolean[],System.Int32[])
276
277 ---> System.Exception: Basic block has to end with unconditional control flow.
278{
279 Block_0:
280 call:void(Console::WriteLine, call:string(Language::GetTextValue, ldstr:string("Error.UnableToLoadWorld")))
281}
282
283 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
284 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
285 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
286 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
287 --- End of inner exception stack trace ---
288 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
289 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
290*/;
291 }
292
293 // Token: 0x06001107 RID: 4359 RVA: 0x00054B88 File Offset: 0x00052D88
294 private static void LoadHeader(BinaryReader reader)
295 {
296 Guid guid = Guid.NewGuid();
297 }
298
299 // Token: 0x06001108 RID: 4360 RVA: 0x00054D40 File Offset: 0x00052F40
300 private static void LoadWorldTiles(BinaryReader reader, bool[] importance)
301 {
302 if (!true)
303 {
304 }
305 int num = 32768;
306 string text2;
307 string text = text2 + " " + text2 + "%";
308 if (num == 0)
309 {
310 }
311 }
312
313 // Token: 0x06001109 RID: 4361 RVA: 0x00054E38 File Offset: 0x00053038
314 private static void LoadChests(BinaryReader reader)
315 {
316 }
317
318 // Token: 0x0600110A RID: 4362 RVA: 0x00054E7C File Offset: 0x0005307C
319 private static void FixDresserChests()
320 {
321 int num = 1;
322 long num2 = 0L;
323 if (num == 0)
324 {
325 }
326 long num3 = 0L;
327 if (num == 0)
328 {
329 }
330 Tile tile;
331 bool flag = tile.active();
332 int num4 = Chest.CreateChest((int)num2, (int)num3, (int)num3);
333 }
334
335 // Token: 0x0600110B RID: 4363 RVA: 0x00054EAC File Offset: 0x000530AC
336 private static void LoadSigns(BinaryReader reader)
337 {
338 Tile tile;
339 bool flag = tile.active();
340 }
341
342 // Token: 0x0600110C RID: 4364 RVA: 0x00054EE0 File Offset: 0x000530E0
343 private static void LoadDummies(BinaryReader reader)
344 {
345 }
346
347 // Token: 0x0600110D RID: 4365 RVA: 0x00054EF0 File Offset: 0x000530F0
348 private static void LoadNPCs(BinaryReader reader)
349 {
350 Vector2 vector = reader.ReadVector2();
351 }
352
353 // Token: 0x0600110E RID: 4366 RVA: 0x00054F04 File Offset: 0x00053104
354 private static int LoadFooter(BinaryReader reader)
355 {
356 return 6;
357 }
358
359 // Token: 0x0600110F RID: 4367 RVA: 0x00054F14 File Offset: 0x00053114
361 {
362 if (!true)
363 {
364 }
365 int num = 257;
366 if (num == 0)
367 {
368 }
369 if (num == 0)
370 {
371 }
372 Main.GameMode = 0;
374 long num2 = 0L;
375 WorldGen.RandomizeMoonState(genRand, num2 != 0L);
376 return 1;
377 }
378
379 // Token: 0x06001110 RID: 4368 RVA: 0x000021DB File Offset: 0x000003DB
380 private static int ReadItemID(BinaryReader fileIO)
381 {
382 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
383 }
384
385 // Token: 0x06001111 RID: 4369 RVA: 0x000552EC File Offset: 0x000534EC
387 {
388 }
389
390 // Token: 0x040020D5 RID: 8405
391 public const int WorldVersion_AddGUID = 1000;
392
393 // Token: 0x040020D6 RID: 8406
394 public const int WorldVersion_CompressWorld = 1001;
395
396 // Token: 0x040020D7 RID: 8407
398
399 // Token: 0x040020D8 RID: 8408
400 public const int WorldVersion_RemoveSectionPointers = 1003;
401
402 // Token: 0x040020D9 RID: 8409
403 public const int WorldVersion_1_3_2 = 1004;
404
405 // Token: 0x040020DA RID: 8410
406 public const int WorldVersion_1_3_3 = 1005;
407
408 // Token: 0x040020DB RID: 8411
409 public const int WorldVersion_1_3_4 = 1007;
410
411 // Token: 0x040020DC RID: 8412
413
414 // Token: 0x040020DD RID: 8413
415 public const int WorldVersionOneMaxRelease = 87;
416
417 // Token: 0x040020DE RID: 8414
418 public const int WorldFileVersion = 1008;
419
420 // Token: 0x040020DF RID: 8415
421 public const int ApproximateWriteSize = 7000000;
422
423 // Token: 0x040020E0 RID: 8416
424 public const int MaximumWriteSize = 16777216;
425
426 // Token: 0x040020E1 RID: 8417
427 private static int versionNumber;
428}
class f__AnonymousType0<< Count > j__TPar
static int ToInt32(byte[] value, int startIndex)
static int CreateChest(int X, int Y, int id=-1)
Definition Chest.cs:366
static TileEntity ReadPos32(BinaryReader reader, bool networkSend=false)
static UnifiedRandom genRand
Definition WorldGen.cs:38
static void RandomizeMoonState(UnifiedRandom random, bool garenteeNewStyle=false)
Definition WorldGen.cs:1501
static void LoadChests(BinaryReader reader)
static void LoadSigns(BinaryReader reader)
static void LoadTileEntities(BinaryReader reader)
static void LoadWeightedPressurePlates(BinaryReader reader)
const int WorldVersion_StoreFrameAsRowsAndColumnsInsteadOfPixels
const int WorldVersion_RemapConsoleSpecificItems
static byte[] DecompressData(byte[] srcData)
static WorldFileData GetAllMetadata(string file)
static int ReadItemID(BinaryReader fileIO)
static void CleanItemsStoredInTiles()
static void LoadTownManager(BinaryReader reader)
static void LoadNPCs(BinaryReader reader)
static void CheckWeaponsRack(int i, int j)
static int LoadWorld_Version2(BinaryReader reader)
static void PlaceWeapon(int x, int y, Item item)
static int LoadWorld_Version1(BinaryReader fileIO)
static void LoadHeader(BinaryReader reader)
const int WorldVersion_RemoveSectionPointers
static bool ItemFitsWeaponRack(Item i)
static bool LoadFileFormatHeader(BinaryReader reader, [Out] bool[] importance, [Out] int[] positions)
static int LoadFooter(BinaryReader reader)
static void LoadDummies(BinaryReader reader)
static void LoadWorldTiles(BinaryReader reader, bool[] importance)
static void CheckMannequin(int i, int j)
static bool LoadSaveData(byte[] srcData)
static DateTime Now
Definition DateTime.cs:530
static Guid NewGuid()
Definition Guid.cs:15
void SetFrameY(short value)
Definition Tile.cs:299
short frameY
Definition Tile.cs:285
ushort type
Definition Tile.cs:58
short frameX
Definition Tile.cs:244
bool active()
Definition Tile.cs:1241
void SetFrameX(short value)
Definition Tile.cs:258