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
WorldMapChunk.cs
Go to the documentation of this file.
1using System;
4using Ionic.Zlib;
5using UnityEngine;
6
7namespace Terraria.Map
8{
9 // Token: 0x020006C2 RID: 1730
10 public class WorldMapChunk
11 {
12 // Token: 0x0600393E RID: 14654 RVA: 0x0022CEDC File Offset: 0x0022B0DC
14 {
15 this.Map = map;
16 }
17
18 // Token: 0x170006DD RID: 1757
19 // (get) Token: 0x0600393F RID: 14655 RVA: 0x0022CEF8 File Offset: 0x0022B0F8
20 public bool Loaded
21 {
22 get
23 {
24 /*
25An exception occurred when decompiling this method (0600393F)
26
27ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.Map.WorldMapChunk::get_Loaded()
28
29 ---> System.Exception: Basic block has to end with unconditional control flow.
30{
31 Block_0:
32 stloc:valuetype Terraria.Map.MapTile*(var_0_06, ldfld:valuetype Terraria.Map.MapTile*(WorldMapChunk::TileData, ldloc:WorldMapChunk(this)))
33}
34
35 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
36 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
37 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
38 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
39 --- End of inner exception stack trace ---
40 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
41 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
42*/;
43 }
44 }
45
46 // Token: 0x06003940 RID: 14656 RVA: 0x0022CF0C File Offset: 0x0022B10C
47 public void SaveCompressed()
48 {
49 if (this.TileData != null)
50 {
51 bool flag = this.dirty;
52 if (!flag || !flag)
53 {
54 }
55 }
56 }
57
58 // Token: 0x06003941 RID: 14657 RVA: 0x0022CF30 File Offset: 0x0022B130
59 public unsafe void LoadTiles(bool utilLoad = false)
60 {
61 long num = 0L;
62 Monitor.Enter(this, utilLoad);
64 if (tileData != null)
65 {
66 return;
67 }
68 MapTile* tileStorage = this.Map.GetTileStorage(this, num != 0L);
71 if (compressedDataLength != 0L)
72 {
73 byte[] compressedData = this.CompressedData;
74 if (tileData == null)
75 {
76 }
77 return;
78 }
79 if (tileData == null)
80 {
81 }
82 long num2 = 0L;
83 if (tileData != null)
84 {
85 Monitor.Exit(this);
86 }
87 if (num2 == 0L)
88 {
89 return;
90 }
91 throw new OutOfMemoryException();
92 }
93
94 // Token: 0x06003942 RID: 14658 RVA: 0x0022CFBC File Offset: 0x0022B1BC
95 public unsafe void Reset()
96 {
98 if (tileData != null)
99 {
100 this.Map.ReleaseTileStorage(this);
101 long num = 0L;
102 if (tileData != null)
103 {
104 Monitor.Exit(this);
105 }
106 if (num != 0L)
107 {
108 throw new OutOfMemoryException();
109 }
110 }
111 }
112
113 // Token: 0x06003943 RID: 14659 RVA: 0x0022D00C File Offset: 0x0022B20C
114 public unsafe void Compress(byte* srcData, long srcLength, [Out] long resultLength)
115 {
116 int num = 1;
117 if (num == 0)
118 {
119 }
120 if (num == 0)
121 {
122 }
123 if (num == 0)
124 {
125 }
126 byte[] compressedData = this.CompressedData;
127 int num2;
128 byte[] compressedData3;
129 long num3;
130 if (num2 == 0)
131 {
133 if (num2 == 0)
134 {
135 byte[] compressedData2 = this.CompressedData;
136 if (compressedData == null)
137 {
138 }
139 Debug.LogWarning("Failed resizing buffer");
141 return;
142 }
143 }
144 else
145 {
146 if (compressedData3 == null)
147 {
148 }
149 Debug.LogError("Failed");
150 num3 = 0L;
151 }
152 if (compressedData3 != null)
153 {
154 }
155 if (num3 == 0L)
156 {
157 return;
158 }
159 throw new OutOfMemoryException();
160 }
161
162 // Token: 0x06003944 RID: 14660 RVA: 0x0022D09C File Offset: 0x0022B29C
163 public unsafe void Decompress(byte[] srcData, long srcLength, byte* dstData, long dstLength, [Out] long resultLength)
164 {
165 int num = 1;
166 if (num == 0)
167 {
168 }
169 if (num == 0)
170 {
171 }
172 int x = this.X;
173 if (this.Y == 0)
174 {
175 }
176 string text;
178 }
179
180 // Token: 0x06003945 RID: 14661 RVA: 0x0022D124 File Offset: 0x0022B324
181 // Note: this type is marked as 'beforefieldinit'.
183 {
184 }
185
186 // Token: 0x040079C4 RID: 31172
187 public const int InitialChunkCompressedSize = 2048;
188
189 // Token: 0x040079C5 RID: 31173
190 public const int MapChunkSize = 64;
191
192 // Token: 0x040079C6 RID: 31174
193 public static int MapChunkTileSize;
194
195 // Token: 0x040079C7 RID: 31175
197
198 // Token: 0x040079C8 RID: 31176
200
201 // Token: 0x040079C9 RID: 31177
202 public byte[] CompressedData;
203
204 // Token: 0x040079CA RID: 31178
206
207 // Token: 0x040079CB RID: 31179
209
210 // Token: 0x040079CC RID: 31180
211 public int X;
212
213 // Token: 0x040079CD RID: 31181
214 public int Y;
215
216 // Token: 0x040079CE RID: 31182
217 public bool dirty;
218
219 // Token: 0x040079CF RID: 31183
220 public int frameAge;
221
222 // Token: 0x040079D0 RID: 31184
223 public int referenceCount;
224
225 // Token: 0x040079D1 RID: 31185
226 private static byte[] ClearData;
227
228 // Token: 0x040079D2 RID: 31186
229 private static byte[] resetData;
230
231 // Token: 0x040079D3 RID: 31187
232 private static byte[] CopyBuffer;
233
234 // Token: 0x040079D4 RID: 31188
235 private static byte[] CompressBuffer;
236
237 // Token: 0x040079D5 RID: 31189
238 private static byte[] BlockBuffer;
239
240 // Token: 0x040079D6 RID: 31190
241 private static ZlibCodec zlibCompress;
242
243 // Token: 0x040079D7 RID: 31191
244 private static ZlibCodec zlibDecompress;
245
246 // Token: 0x040079D8 RID: 31192
247 private static long biggestChunk;
248 }
249}
class f__AnonymousType0<< Count > j__TPar
static void Exit(object obj)
Definition Monitor.cs:47
static void Enter(object obj)
Definition Monitor.cs:11
unsafe void Decompress(byte[] srcData, long srcLength, byte *dstData, long dstLength, [Out] long resultLength)
static ZlibCodec zlibDecompress
static ZlibCodec zlibCompress
unsafe WorldMapChunk(WorldMap map, byte *compressedData)
unsafe void Compress(byte *srcData, long srcLength, [Out] long resultLength)
unsafe void LoadTiles(bool utilLoad=false)
static void LogWarning(object message)
Definition Debug.cs:117
static void LogError(object message)
Definition Debug.cs:62