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
TELogicSensor.cs
Go to the documentation of this file.
1using System;
3using System.IO;
9
11{
12 // Token: 0x02000815 RID: 2069
14 {
15 // Token: 0x0600424E RID: 16974 RVA: 0x0024ACB8 File Offset: 0x00248EB8
16 public override void RegisterTileEntityID(int assignedID)
17 {
18 if (!true)
19 {
20 }
21 if (!true)
22 {
23 }
24 }
25
26 // Token: 0x0600424F RID: 16975 RVA: 0x0024ACD0 File Offset: 0x00248ED0
27 public override void NetPlaceEntityAttempt(int x, int y)
28 {
29 if (!true)
30 {
31 }
33 }
34
35 // Token: 0x06004250 RID: 16976 RVA: 0x0024ACE8 File Offset: 0x00248EE8
36 public static void NetPlaceEntity(int x, int y)
37 {
38 if (!true)
39 {
40 }
41 int num = TELogicSensor.Place(x, y);
42 }
43
44 // Token: 0x06004251 RID: 16977 RVA: 0x0024AD0C File Offset: 0x00248F0C
45 public override bool IsTileValidForEntity(int x, int y)
46 {
47 if (!true)
48 {
49 }
50 return TELogicSensor.ValidTile(x, y);
51 }
52
53 // Token: 0x06004252 RID: 16978 RVA: 0x000021DB File Offset: 0x000003DB
54 public override TileEntity GenerateInstance()
55 {
56 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
57 }
58
59 // Token: 0x06004253 RID: 16979 RVA: 0x0024AD24 File Offset: 0x00248F24
60 private static void UpdateStartInternal()
61 {
62 if (!true)
63 {
64 }
66 }
67
68 // Token: 0x06004254 RID: 16980 RVA: 0x0024AD3C File Offset: 0x00248F3C
69 private static void FillPlayerHitboxes()
70 {
71 int num = 1;
72 if (num == 0)
73 {
74 }
75 if (num == 0)
76 {
77 if (num == 0)
78 {
79 }
80 if (num == 0 || num != 0 || num != 0 || num == 0)
81 {
82 }
83 if (num == 0)
84 {
85 }
86 }
87 }
88
89 // Token: 0x06004255 RID: 16981 RVA: 0x0024AD68 File Offset: 0x00248F68
90 private static void UpdateEndInternal()
91 {
92 int num = 1;
93 if (num == 0)
94 {
95 }
96 if (num == 0)
97 {
98 }
99 Wiring.HitSwitch(-1073741824, 0);
100 if (num == 0)
101 {
102 }
103 bool netHost = Main.NetHost;
104 if (num == 0)
105 {
106 }
107 }
108
109 // Token: 0x06004256 RID: 16982 RVA: 0x0024AE00 File Offset: 0x00249000
110 public override void Update()
111 {
112 int num = 1;
114 if (num == 0)
115 {
116 }
117 bool state = TELogicSensor.GetState(1, 1, logicCheckType, this);
119 bool on = this.On;
120 }
121
122 // Token: 0x06004257 RID: 16983 RVA: 0x0024AE64 File Offset: 0x00249064
123 public void ChangeState(bool onState, bool TripWire)
124 {
125 bool on = this.On;
126 if (!on)
127 {
128 }
129 bool flag = TELogicSensor.SanityCheck(43134976, onState ? 1 : 0);
130 if (!on)
131 {
132 }
133 int num = 18;
134 Tile tile;
135 tile.frameX = (onState ? 1 : 0);
136 if (num == 0)
137 {
138 }
139 bool netHost = Main.NetHost;
140 if (!false)
141 {
142 }
143 bool logicHost = Main.LogicHost;
144 if (!false)
145 {
146 }
148 Point16 position = this.Position;
149 byte type = this.type;
150 bool on2 = this.On;
151 int id = this.ID;
153 }
154
155 // Token: 0x06004258 RID: 16984 RVA: 0x0024AEE4 File Offset: 0x002490E4
156 public static bool ValidTile(int x, int y)
157 {
158 /*
159An exception occurred when decompiling this method (06004258)
160
161ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.GameContent.Tile_Entities.TELogicSensor::ValidTile(System.Int32,System.Int32)
162
163 ---> System.Exception: Basic block has to end with unconditional control flow.
164{
165 IL_0035:
166 stloc:int16(var_12_3C, callgetter:int16(Tile::get_frameX, ldloc:Tile[exp:valuetype Terraria.Tile&](var_11)))
167}
168
169 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
170 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
171 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
172 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
173 --- End of inner exception stack trace ---
174 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
175 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
176*/;
177 }
178
179 // Token: 0x06004259 RID: 16985 RVA: 0x0024AF30 File Offset: 0x00249130
181 {
182 if (!true)
183 {
184 }
185 base..ctor();
186 }
187
188 // Token: 0x0600425A RID: 16986 RVA: 0x0024AF48 File Offset: 0x00249148
189 public static TELogicSensor.LogicCheckType FigureCheckType(int x, int y, [Out] bool on)
190 {
191 int num = 1;
192 if (num == 0)
193 {
194 }
195 long num2 = 0L;
196 bool flag = WorldGen.InWorld(0, x, (int)num2);
197 if (num == 0)
198 {
199 }
200 Tile tile;
201 short frameY = tile.frameY;
202 if (36409 == 0)
203 {
204 }
205 y.m_value = num;
206 return (TELogicSensor.LogicCheckType)42186880;
207 }
208
209 // Token: 0x0600425B RID: 16987 RVA: 0x0024AF84 File Offset: 0x00249184
210 public static bool GetState(int x, int y, TELogicSensor.LogicCheckType type, [Optional] TELogicSensor instance)
211 {
212 int num = 1;
214 {
215 throw new OutOfMemoryException();
216 }
217 if (num == 0)
218 {
219 }
220 Tile tile;
221 byte liquid = tile.liquid;
222 if (num != 0)
223 {
224 bool flag;
225 return flag;
226 }
227 bool flag2;
228 return flag2;
229 }
230
231 // Token: 0x0600425C RID: 16988 RVA: 0x0024AFDC File Offset: 0x002491DC
232 public void FigureCheckState()
233 {
234 int num = 1;
235 if (num == 0)
236 {
237 }
240 bool on = this.On;
241 TELogicSensor.GetFrame(num, 43134976, logicCheckType, on);
242 }
243
244 // Token: 0x0600425D RID: 16989 RVA: 0x0024B018 File Offset: 0x00249218
245 public static void GetFrame(int x, int y, TELogicSensor.LogicCheckType type, bool on)
246 {
247 if (!true)
248 {
249 }
250 Tile tile;
251 tile.frameX = (short)y;
252 }
253
254 // Token: 0x0600425E RID: 16990 RVA: 0x0024B044 File Offset: 0x00249244
255 public static bool SanityCheck(int x, int y)
256 {
257 if (!true)
258 {
259 }
260 Tile tile;
261 bool flag = tile.active();
262 if (!true)
263 {
264 }
265 Tile tile2;
266 ushort type = tile2.type;
267 return true;
268 }
269
270 // Token: 0x0600425F RID: 16991 RVA: 0x0024B078 File Offset: 0x00249278
271 public static int Place(int x, int y)
272 {
273 if (!true)
274 {
275 }
276 int num = TileEntity.AssignNewID();
277 if (!true)
278 {
279 }
280 Monitor.Enter(x, x != 0);
281 long num2 = 0L;
282 Monitor.Exit(x);
283 if (num2 == 0L)
284 {
285 return x;
286 }
287 throw new OutOfMemoryException();
288 }
289
290 // Token: 0x06004260 RID: 16992 RVA: 0x0024B0C8 File Offset: 0x002492C8
291 public static int Hook_AfterPlacement(int x, int y, int type = 423, int style = 0, int direction = 1, int alternate = 0)
292 {
293 int num = 1;
294 if (num == 0)
295 {
296 }
298 if (num == 0)
299 {
300 }
302 if (num == 0)
303 {
304 }
305 int myPlayer = Main.myPlayer;
306 return 87;
307 }
308
309 // Token: 0x06004261 RID: 16993 RVA: 0x0024B124 File Offset: 0x00249324
310 public static void Kill(int x, int y)
311 {
312 if (!true)
313 {
314 }
315 int key = TileEntity.GetKey(x, y);
316 }
317
318 // Token: 0x06004262 RID: 16994 RVA: 0x0024B190 File Offset: 0x00249390
319 public static int Find(int x, int y)
320 {
321 /*
322An exception occurred when decompiling this method (06004262)
323
324ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 Terraria.GameContent.Tile_Entities.TELogicSensor::Find(System.Int32,System.Int32)
325
326 ---> System.Exception: Basic block has to end with unconditional control flow.
327{
328 IL_0003:
329 stloc:int32(var_0_0E, call:int32(TileEntity::GetKey, ldc.i4:int32(-2147483648), ldloc:int32(x)))
330}
331
332 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
333 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
334 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
335 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
336 --- End of inner exception stack trace ---
337 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
338 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
339*/;
340 }
341
342 // Token: 0x06004263 RID: 16995 RVA: 0x0024B1AC File Offset: 0x002493AC
343 public override void WriteExtraData(BinaryWriter writer, bool networkSend)
344 {
345 }
346
347 // Token: 0x06004264 RID: 16996 RVA: 0x0024B1C8 File Offset: 0x002493C8
348 public override void ReadExtraData(BinaryReader reader, bool networkSend)
349 {
350 }
351
352 // Token: 0x06004265 RID: 16997 RVA: 0x0024B1D8 File Offset: 0x002493D8
353 public override string ToString()
354 {
355 Point16 position = this.Position;
356 string text;
357 if ((text == null || text != null) && ("x " == null || "x " != null))
358 {
359 short y = this.Position.Y;
360 string text2;
361 if ((text2 == null || text2 != null) && ("y " == null || "y " != null))
362 {
364 string text3;
365 if (text3 == null || text3 != null)
366 {
367 string text4;
368 return text4;
369 }
370 }
371 }
372 throw new ArrayTypeMismatchException();
373 }
374
375 // Token: 0x06004266 RID: 16998 RVA: 0x0024B23C File Offset: 0x0024943C
376 // Note: this type is marked as 'beforefieldinit'.
378 {
379 }
380
381 // Token: 0x040080D2 RID: 32978
382 private static byte _myEntityID;
383
384 // Token: 0x040080D3 RID: 32979
386
387 // Token: 0x040080D4 RID: 32980
389
390 // Token: 0x040080D5 RID: 32981
392
393 // Token: 0x040080D6 RID: 32982
394 private static bool inUpdateLoop;
395
396 // Token: 0x040080D7 RID: 32983
397 private static bool playerBoxFilled;
398
399 // Token: 0x040080D8 RID: 32984
401
402 // Token: 0x040080D9 RID: 32985
403 public bool On;
404
405 // Token: 0x040080DA RID: 32986
406 public int CountedData;
407
408 // Token: 0x02000816 RID: 2070
409 public enum LogicCheckType
410 {
411 // Token: 0x040080DC RID: 32988
412 None,
413 // Token: 0x040080DD RID: 32989
414 Day,
415 // Token: 0x040080DE RID: 32990
416 Night,
417 // Token: 0x040080DF RID: 32991
419 // Token: 0x040080E0 RID: 32992
420 Water,
421 // Token: 0x040080E1 RID: 32993
422 Lava,
423 // Token: 0x040080E2 RID: 32994
424 Honey,
425 // Token: 0x040080E3 RID: 32995
426 Liquid
427 }
428 }
429}
class f__AnonymousType0<< Count > j__TPar
static void Exit(object obj)
Definition Monitor.cs:47
static void Enter(object obj)
Definition Monitor.cs:11
static int GetKey(int x, int y)
override void WriteExtraData(BinaryWriter writer, bool networkSend)
override void ReadExtraData(BinaryReader reader, bool networkSend)
override bool IsTileValidForEntity(int x, int y)
static List< Tuple< Point16, bool > > tripPoints
static TELogicSensor.LogicCheckType FigureCheckType(int x, int y, [Out] bool on)
static int Hook_AfterPlacement(int x, int y, int type=423, int style=0, int direction=1, int alternate=0)
override void NetPlaceEntityAttempt(int x, int y)
static void GetFrame(int x, int y, TELogicSensor.LogicCheckType type, bool on)
void ChangeState(bool onState, bool TripWire)
static bool GetState(int x, int y, TELogicSensor.LogicCheckType type, [Optional] TELogicSensor instance)
static Dictionary< int, Rectangle > playerBox
override void RegisterTileEntityID(int assignedID)
static bool NetHost
Definition Main.cs:5544
static int myPlayer
Definition Main.cs:2337
static bool NetClientOnly
Definition Main.cs:5407
static bool LogicHost
Definition Main.cs:5469
static void HitSwitch(int i, int j)
Definition Wiring.cs:90
static bool InWorld(int x, int y, int fluff=0)
Definition WorldGen.cs:1952
byte liquid
Definition Tile.cs:110
short frameY
Definition Tile.cs:285
bool active()
Definition Tile.cs:1241