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
WorldMap.cs
Go to the documentation of this file.
1using System;
6using Terraria.IO;
7
8namespace Terraria.Map
9{
10 // Token: 0x020006C1 RID: 1729
11 public class WorldMap
12 {
13 // Token: 0x0600392A RID: 14634 RVA: 0x0022C9FC File Offset: 0x0022ABFC
15 {
16 for (;;)
17 {
19 WorldMapChunk[] chunks = this._chunks;
20 byte[] compressedData = chunks.CompressedData;
21 if (chunks == null)
22 {
23 return;
24 }
25 }
26 }
27
28 // Token: 0x0600392B RID: 14635 RVA: 0x0022CA24 File Offset: 0x0022AC24
30 {
31 /*
32An exception occurred when decompiling this method (0600392B)
33
34ICSharpCode.Decompiler.DecompilerException: Error decompiling Terraria.Map.MapTile* Terraria.Map.WorldMap::GetChunkTile(System.Int32,System.Int32,System.Boolean,Terraria.Map.WorldMapChunk)
35
36 ---> System.Exception: Basic block has to end with unconditional control flow.
37{
38 IL_0000:
39 stloc:int32(var_0_06, ldfld:int32(WorldMap::MaxChunkWidth, ldloc:WorldMap(this)))
40 stloc:class Terraria.Map.WorldMapChunk[](var_1_0D, ldfld:class Terraria.Map.WorldMapChunk[](WorldMap::_chunks, ldloc:WorldMap(this)))
41 stloc:uint8[](var_2_14, ldfld:uint8[](WorldMapChunk::CompressedData, ldloc:class Terraria.Map.WorldMapChunk[][exp:WorldMapChunk](var_1_0D)))
42 brtrue(IL_0000, ldloc:class Terraria.Map.WorldMapChunk[][exp:bool](var_1_0D))
43}
44
45 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
46 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
47 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
48 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
49 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
50 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
51 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
52 --- End of inner exception stack trace ---
53 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
54 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
55*/;
56 }
57
58 // Token: 0x170006DC RID: 1756
59 // (get) Token: 0x0600392C RID: 14636 RVA: 0x0022CA48 File Offset: 0x0022AC48
61 {
62 get
63 {
64 object lockObject = this.LockObject;
66 long num = 0L;
67 int size = tileChunksAvailable._size;
68 if (size != 0)
69 {
70 Monitor.Exit(lockObject);
71 }
72 if (num == 0L)
73 {
74 }
75 throw new OutOfMemoryException();
76 }
77 }
78
79 // Token: 0x0600392D RID: 14637 RVA: 0x000021DB File Offset: 0x000003DB
80 public void UnloadChunk()
81 {
82 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
83 }
84
85 // Token: 0x0600392E RID: 14638 RVA: 0x000021DB File Offset: 0x000003DB
87 {
88 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
89 }
90
91 // Token: 0x0600392F RID: 14639 RVA: 0x000021DB File Offset: 0x000003DB
93 {
94 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
95 }
96
97 // Token: 0x06003930 RID: 14640 RVA: 0x0022CA9C File Offset: 0x0022AC9C
98 public void UpdateChunks()
99 {
100 if (!true)
101 {
102 }
104 object lockObject = this.LockObject;
106 }
107
108 // Token: 0x06003931 RID: 14641 RVA: 0x000021DB File Offset: 0x000003DB
109 public void Allocate(int maxWidth, int maxHeight)
110 {
111 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
112 }
113
114 // Token: 0x06003932 RID: 14642 RVA: 0x0022CB2C File Offset: 0x0022AD2C
115 public unsafe void ConsumeUpdate(int x, int y)
116 {
117 MapTile* ptr;
118 byte extraData = ptr->_extraData;
119 ptr->_extraData = extraData;
120 }
121
122 // Token: 0x06003933 RID: 14643 RVA: 0x0022CB48 File Offset: 0x0022AD48
123 public unsafe void Update(int x, int y, byte light)
124 {
125 MapTile mapTile = MapHelper.CreateMapTile(x, y, light);
126 MapTile* ptr;
127 ptr->Type = mapTile;
128 }
129
130 // Token: 0x06003934 RID: 14644 RVA: 0x0022CB68 File Offset: 0x0022AD68
131 public void SetTile(int x, int y, MapTile tile)
132 {
133 }
134
135 // Token: 0x06003935 RID: 14645 RVA: 0x0022CB78 File Offset: 0x0022AD78
136 public bool IsRevealed(int x, int y)
137 {
138 /*
139An exception occurred when decompiling this method (06003935)
140
141ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.Map.WorldMap::IsRevealed(System.Int32,System.Int32)
142
143 ---> System.Exception: Basic block has to end with unconditional control flow.
144{
145 Block_0:
146 stloc:uint8(var_1_06, ldfld:uint8(MapTile::Light, ldloc:valuetype Terraria.Map.MapTile*[exp:valuetype Terraria.Map.MapTile&](var_0)))
147}
148
149 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
150 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
151 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
152 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
153 --- End of inner exception stack trace ---
154 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
155 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
156*/;
157 }
158
159 // Token: 0x06003936 RID: 14646 RVA: 0x0022CB8C File Offset: 0x0022AD8C
160 public unsafe bool UpdateLighting(int x, int y, byte light)
161 {
162 MapTile* ptr;
163 byte b = Math.Max(ptr->Light, light);
165 byte light2 = ptr->Light;
166 byte extraData = ptr->_extraData;
167 ptr->Type = mapTile;
168 return true;
169 }
170
171 // Token: 0x06003937 RID: 14647 RVA: 0x0022CBCC File Offset: 0x0022ADCC
172 public unsafe bool UpdateType(int x, int y)
173 {
174 MapTile* ptr;
175 byte light = ptr->Light;
176 if (!true)
177 {
178 }
179 MapTile mapTile = MapHelper.CreateMapTile(x, y, light);
180 byte light2 = ptr->Light;
181 byte extraData = ptr->_extraData;
182 ptr->Type = mapTile;
183 return true;
184 }
185
186 // Token: 0x06003938 RID: 14648 RVA: 0x0022CC08 File Offset: 0x0022AE08
187 public void UnlockMapSection(int sectionX, int sectionY)
188 {
189 }
190
191 // Token: 0x06003939 RID: 14649 RVA: 0x0022CC18 File Offset: 0x0022AE18
192 public void Load()
193 {
194 int num = 1;
195 if (num == 0)
196 {
197 }
198 Lighting.Clear();
199 if (num == 0)
200 {
201 }
204 Main.clearMap = true;
205 Main.loadMap = true;
206 Main.loadMapLock = true;
207 Main.refreshMap = false;
208 }
209
210 // Token: 0x0600393A RID: 14650 RVA: 0x0022CDE8 File Offset: 0x0022AFE8
211 public void Save(bool forceSave = false)
212 {
213 if (!true)
214 {
215 }
216 if (true)
217 {
218 return;
219 }
220 MapHelper.SaveMap(true);
221 }
222
223 // Token: 0x0600393B RID: 14651 RVA: 0x0022CE04 File Offset: 0x0022B004
224 public void Clear()
225 {
227 int maxChunkWidth = this.MaxChunkWidth;
228 WorldMapChunk[] chunks = this._chunks;
229 int maxChunkWidth2 = this.MaxChunkWidth;
231 }
232
233 // Token: 0x0600393C RID: 14652 RVA: 0x0022CE3C File Offset: 0x0022B03C
234 public void ClearEdges()
235 {
236 int maxWidth = this.MaxWidth;
237 int maxWidth2 = this.MaxWidth;
238 int maxHeight = this.MaxHeight;
239 int maxHeight2 = this.MaxHeight;
240 int maxWidth3 = this.MaxWidth;
241 }
242
243 // Token: 0x0600393D RID: 14653 RVA: 0x0022CEBC File Offset: 0x0022B0BC
244 public WorldMap()
245 {
246 }
247
248 // Token: 0x040079B7 RID: 31159
249 public int MaxWidth;
250
251 // Token: 0x040079B8 RID: 31160
252 public int MaxHeight;
253
254 // Token: 0x040079B9 RID: 31161
255 public int MaxChunkWidth;
256
257 // Token: 0x040079BA RID: 31162
258 public int MaxChunkHeight;
259
260 // Token: 0x040079BB RID: 31163
261 public const int BlackEdgeWidth = 40;
262
263 // Token: 0x040079BC RID: 31164
265
266 // Token: 0x040079BD RID: 31165
267 public int MaxChunkMapped = 320;
268
269 // Token: 0x040079BE RID: 31166
270 public const int ReservedForPlayer = 64;
271
272 // Token: 0x040079BF RID: 31167
274
275 // Token: 0x040079C0 RID: 31168
277
278 // Token: 0x040079C1 RID: 31169
279 public object LockObject;
280
281 // Token: 0x040079C2 RID: 31170
283
284 // Token: 0x040079C3 RID: 31171
286 }
287}
class f__AnonymousType0<< Count > j__TPar
static byte Max(byte val1, byte val2)
Definition Math.cs:111
static void Exit(object obj)
Definition Monitor.cs:47
static void Clear()
Definition Lighting.cs:414
static MapTile CreateMapTile(int i, int j, byte Light)
Definition MapHelper.cs:164
static void SaveMap(bool forceSave=false)
Definition MapHelper.cs:221
List< IntPtr > TileChunksAvailable
Definition WorldMap.cs:282
void ReleaseTileStorage(WorldMapChunk chunk)
Definition WorldMap.cs:92
unsafe bool UpdateType(int x, int y)
Definition WorldMap.cs:172
unsafe MapTile * GetTileStorage(WorldMapChunk chunk, bool utilLoad=false)
Definition WorldMap.cs:86
unsafe byte * TileCompressedData
Definition WorldMap.cs:276
const int ReservedForPlayer
Definition WorldMap.cs:270
const int BlackEdgeWidth
Definition WorldMap.cs:261
unsafe MapTile * GetChunkTile(int mapX, int mapY, [Out] WorldMapChunk chunk)
Definition WorldMap.cs:14
unsafe MapTile * GetChunkTile(int mapX, int mapY, bool utilLoad, [Out] WorldMapChunk chunk)
Definition WorldMap.cs:29
void SetTile(int x, int y, MapTile tile)
Definition WorldMap.cs:131
bool IsRevealed(int x, int y)
Definition WorldMap.cs:136
List< WorldMapChunk > TileChunksInUse
Definition WorldMap.cs:285
unsafe void ConsumeUpdate(int x, int y)
Definition WorldMap.cs:115
unsafe MapTile * TileData
Definition WorldMap.cs:273
WorldMapChunk[] _chunks
Definition WorldMap.cs:264
void Save(bool forceSave=false)
Definition WorldMap.cs:211
void UnlockMapSection(int sectionX, int sectionY)
Definition WorldMap.cs:187
unsafe bool UpdateLighting(int x, int y, byte light)
Definition WorldMap.cs:160
void Allocate(int maxWidth, int maxHeight)
Definition WorldMap.cs:109
unsafe void Update(int x, int y, byte light)
Definition WorldMap.cs:123
static void PerformCachedMapTileUpdates()