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_OldConsole.cs
Go to the documentation of this file.
1using System;
2using System.IO;
6using Terraria;
9using Terraria.IO;
11
12// Token: 0x020002E0 RID: 736
14{
15 // Token: 0x060010DD RID: 4317 RVA: 0x00053794 File Offset: 0x00051994
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 (num3 != 0)
46 {
47 }
48 if (num7 != 0L)
49 {
50 throw new OutOfMemoryException();
51 }
52 if (num3 != 0)
53 {
54 }
55 if (num7 != 0L)
56 {
57 throw new OutOfMemoryException();
58 }
59 }
60
61 // Token: 0x060010DE RID: 4318 RVA: 0x0005388C File Offset: 0x00051A8C
62 public static byte[] DecompressData(byte[] srcData)
63 {
64 if (!false)
65 {
66 if (!false)
67 {
68 }
69 throw new OutOfMemoryException();
70 }
71 throw new OutOfMemoryException();
72 }
73
74 // Token: 0x060010DF RID: 4319 RVA: 0x000538E0 File Offset: 0x00051AE0
75 public static bool LoadSaveData(byte[] srcData)
76 {
77 if (!true)
78 {
79 }
80 long num = 0L;
81 int num2 = 4;
82 if (num == 0L)
83 {
84 long num3 = 0L;
85 if (num2 == 0)
86 {
87 }
88 if (num3 == 0L)
89 {
90 int num4;
91 if (num4 != 0)
92 {
93 }
95 }
96 throw new OutOfMemoryException();
97 }
98 throw new OutOfMemoryException();
99 }
100
101 // Token: 0x060010E0 RID: 4320 RVA: 0x00053948 File Offset: 0x00051B48
102 private static void CleanItemsStoredInTiles()
103 {
104 int num = 1;
105 long num2 = 0L;
106 if (num == 0)
107 {
108 }
109 long num3 = 0L;
110 if (num == 0)
111 {
112 }
113 Tile tile;
114 ushort type = tile.type;
116 }
117
118 // Token: 0x060010E1 RID: 4321 RVA: 0x0005397C File Offset: 0x00051B7C
119 private static void CheckWeaponsRack(int i, int j)
120 {
121 int num = 1;
122 if (num == 0)
123 {
124 }
125 Tile tile;
126 short frameY = tile.frameY;
127 if (num == 0)
128 {
129 }
130 Tile tile2;
131 short frameY2 = tile2.frameY;
132 if (num == 0)
133 {
134 }
135 Tile tile3;
136 short frameY3 = tile3.frameY;
137 if (num == 0)
138 {
139 }
140 Tile tile4;
141 short frameX = tile4.frameX;
142 if (36409 == 0)
143 {
144 }
145 Tile tile5;
146 short frameX2 = tile5.frameX;
147 Tile tile6;
148 if (tile6.frameX == 0)
149 {
150 }
151 long num2 = 0L;
152 Tile tile7;
153 tile7.SetFrameX((short)num2);
154 int num3 = 18;
155 Tile tile8;
156 tile8.SetFrameY((short)num3);
157 }
158
159 // Token: 0x060010E2 RID: 4322 RVA: 0x00053A0C File Offset: 0x00051C0C
160 public static bool ItemFitsWeaponRack(Item i)
161 {
162 if (!true || true)
163 {
164 return;
165 }
166 }
167
168 // Token: 0x060010E3 RID: 4323 RVA: 0x00053A20 File Offset: 0x00051C20
169 public static void PlaceWeapon(int x, int y, Item item)
170 {
171 int num = 1;
172 if (num == 0)
173 {
174 }
175 Tile tile;
176 bool flag = tile.active();
177 if (num == 0)
178 {
179 }
180 Tile tile2;
181 ushort type = tile2.type;
182 if (num == 0)
183 {
184 }
185 Tile tile3;
186 short frameY = tile3.frameY;
187 if (num == 0)
188 {
189 }
190 Tile tile4;
191 short frameY2 = tile4.frameY;
192 if (num == 0)
193 {
194 }
195 Tile tile5;
196 short frameY3 = tile5.frameY;
197 if (num == 0)
198 {
199 }
200 Tile tile6;
201 short frameX = tile6.frameX;
202 if (36409 == 0)
203 {
204 }
205 Tile tile7;
206 short frameX2 = tile7.frameX;
207 int netID = item.netID;
208 Tile tile8;
209 tile8.SetFrameX((short)x);
210 byte prefix = item.prefix;
211 Tile tile9;
212 tile9.SetFrameX((short)x);
213 }
214
215 // Token: 0x060010E4 RID: 4324 RVA: 0x00053AAC File Offset: 0x00051CAC
216 private static void CheckMannequin(int i, int j)
217 {
218 int num = 1;
219 if (num == 0)
220 {
221 }
222 Tile tile;
223 short frameX = tile.frameX;
224 int num2 = 34079;
225 if (num == 0)
226 {
227 }
228 Tile tile2;
229 bool flag = ItemConversion_OldConsole.ModifyBodySlot((int)tile2.frameY);
230 if (num2 == 0)
231 {
232 }
233 }
234
235 // Token: 0x060010E5 RID: 4325 RVA: 0x00053B54 File Offset: 0x00051D54
236 private static int LoadWorld_Version2(BinaryReader reader)
237 {
238 int num;
239 return num;
240 }
241
242 // Token: 0x060010E6 RID: 4326 RVA: 0x00053B64 File Offset: 0x00051D64
243 private static void LoadWeightedPressurePlates(BinaryReader reader)
244 {
245 if (!true)
246 {
247 }
249 }
250
251 // Token: 0x060010E7 RID: 4327 RVA: 0x00053B7C File Offset: 0x00051D7C
252 private static void LoadTownManager(BinaryReader reader)
253 {
254 if (!true)
255 {
256 }
257 }
258
259 // Token: 0x060010E8 RID: 4328 RVA: 0x00053B8C File Offset: 0x00051D8C
260 private static void LoadTileEntities(BinaryReader reader)
261 {
262 if (!true)
263 {
264 }
266 long num = 0L;
267 long num2 = 0L;
268 TileEntity tileEntity = TileEntity.Read(reader, num2 != 0L);
269 tileEntity.ID = (int)num;
270 int positionKey = tileEntity.PositionKey;
271 int positionKey2 = tileEntity.PositionKey;
272 }
273
274 // Token: 0x060010E9 RID: 4329 RVA: 0x00053C4C File Offset: 0x00051E4C
275 private static bool LoadFileFormatHeader(BinaryReader reader, [Out] bool[] importance, [Out] int[] positions)
276 {
277 /*
278An exception occurred when decompiling this method (060010E9)
279
280ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean WorldFile_OldConsole::LoadFileFormatHeader(System.IO.BinaryReader,System.Boolean[],System.Int32[])
281
282 ---> System.Exception: Basic block has to end with unconditional control flow.
283{
284 Block_0:
285 call:void(Console::WriteLine, call:string(Language::GetTextValue, ldstr:string("Error.UnableToLoadWorld")))
286}
287
288 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
289 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
290 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
291 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
292 --- End of inner exception stack trace ---
293 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
294 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
295*/;
296 }
297
298 // Token: 0x060010EA RID: 4330 RVA: 0x00053C78 File Offset: 0x00051E78
299 private static void LoadHeader(BinaryReader reader)
300 {
301 Guid guid = Guid.NewGuid();
302 }
303
304 // Token: 0x060010EB RID: 4331 RVA: 0x00053EB0 File Offset: 0x000520B0
305 private static void LoadWorldTiles(BinaryReader reader, bool[] importance)
306 {
307 int num = 1;
308 if (num == 0)
309 {
310 }
311 if (num == 0)
312 {
313 }
314 int num2 = 32768;
315 string text2;
316 string text = text2 + " " + text2 + "%";
317 if (num2 == 0)
318 {
319 }
320 }
321
322 // Token: 0x060010EC RID: 4332 RVA: 0x00053FC8 File Offset: 0x000521C8
323 private static void LoadChests(BinaryReader reader)
324 {
325 int num = WorldFile_OldConsole.ReadItemID(reader);
326 }
327
328 // Token: 0x060010ED RID: 4333 RVA: 0x00054024 File Offset: 0x00052224
329 private static void FixDresserChests()
330 {
331 int num = 1;
332 long num2 = 0L;
333 if (num == 0)
334 {
335 }
336 long num3 = 0L;
337 if (num == 0)
338 {
339 }
340 Tile tile;
341 bool flag = tile.active();
342 int num4 = Chest.CreateChest((int)num2, (int)num3, (int)num3);
343 }
344
345 // Token: 0x060010EE RID: 4334 RVA: 0x00054054 File Offset: 0x00052254
346 private static void LoadSigns(BinaryReader reader)
347 {
348 Tile tile;
349 bool flag = tile.active();
350 }
351
352 // Token: 0x060010EF RID: 4335 RVA: 0x00054088 File Offset: 0x00052288
353 private static void LoadDummies(BinaryReader reader)
354 {
355 }
356
357 // Token: 0x060010F0 RID: 4336 RVA: 0x00054098 File Offset: 0x00052298
358 private static void LoadNPCs(BinaryReader reader)
359 {
360 Vector2 vector = reader.ReadVector2();
361 }
362
363 // Token: 0x060010F1 RID: 4337 RVA: 0x000540AC File Offset: 0x000522AC
364 private static int LoadFooter(BinaryReader reader)
365 {
366 return 6;
367 }
368
369 // Token: 0x060010F2 RID: 4338 RVA: 0x000540BC File Offset: 0x000522BC
371 {
372 if (!true)
373 {
374 }
375 int num = 257;
376 if (num == 0)
377 {
378 }
379 if (num == 0)
380 {
381 }
382 Main.GameMode = 0;
384 long num2 = 0L;
385 WorldGen.RandomizeMoonState(genRand, num2 != 0L);
386 return 1;
387 }
388
389 // Token: 0x060010F3 RID: 4339 RVA: 0x000021DB File Offset: 0x000003DB
390 private static int ReadItemID(BinaryReader fileIO)
391 {
392 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
393 }
394
395 // Token: 0x060010F4 RID: 4340 RVA: 0x00054494 File Offset: 0x00052694
397 {
398 }
399
400 // Token: 0x040020C3 RID: 8387
401 public const int WorldVersion_AddGUID = 1000;
402
403 // Token: 0x040020C4 RID: 8388
404 public const int WorldVersion_CompressWorld = 1001;
405
406 // Token: 0x040020C5 RID: 8389
408
409 // Token: 0x040020C6 RID: 8390
410 public const int WorldVersion_1_3_2 = 1003;
411
412 // Token: 0x040020C7 RID: 8391
413 public const int WorldVersion_1_3_3 = 1004;
414
415 // Token: 0x040020C8 RID: 8392
416 public const int WorldVersion_1_3_4 = 1005;
417
418 // Token: 0x040020C9 RID: 8393
420
421 // Token: 0x040020CA RID: 8394
422 public const int WorldVersionOneMaxRelease = 87;
423
424 // Token: 0x040020CB RID: 8395
425 public const int WorldFileVersion = 1006;
426
427 // Token: 0x040020CC RID: 8396
428 public const int ApproximateWriteSize = 7000000;
429
430 // Token: 0x040020CD RID: 8397
431 public const int MaximumWriteSize = 16777216;
432
433 // Token: 0x040020CE RID: 8398
434 private static int versionNumber;
435}
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 Read(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 LoadTileEntities(BinaryReader reader)
static bool ItemFitsWeaponRack(Item i)
static void LoadHeader(BinaryReader reader)
static byte[] DecompressData(byte[] srcData)
static void LoadChests(BinaryReader reader)
static WorldFileData GetAllMetadata(string file)
static int LoadWorld_Version1(BinaryReader fileIO)
static void LoadDummies(BinaryReader reader)
static bool LoadSaveData(byte[] srcData)
static void LoadWeightedPressurePlates(BinaryReader reader)
static void LoadSigns(BinaryReader reader)
static void CheckWeaponsRack(int i, int j)
static void PlaceWeapon(int x, int y, Item item)
static int LoadWorld_Version2(BinaryReader reader)
static void LoadTownManager(BinaryReader reader)
static bool LoadFileFormatHeader(BinaryReader reader, [Out] bool[] importance, [Out] int[] positions)
const int WorldVersion_RemapConsoleSpecificItems
static void LoadNPCs(BinaryReader reader)
static int LoadFooter(BinaryReader reader)
static void LoadWorldTiles(BinaryReader reader, bool[] importance)
static int ReadItemID(BinaryReader fileIO)
static void CleanItemsStoredInTiles()
static void CheckMannequin(int i, int j)
const int WorldVersion_StoreFrameAsRowsAndColumnsInsteadOfPixels
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