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
PlayerSleepingHelper.cs
Go to the documentation of this file.
1using System;
5
7{
8 // Token: 0x020007E5 RID: 2021
9 public struct PlayerSleepingHelper
10 {
11 // Token: 0x170007BE RID: 1982
12 // (get) Token: 0x0600410B RID: 16651 RVA: 0x00244768 File Offset: 0x00242968
14 {
15 get
16 {
17 /*
18An exception occurred when decompiling this method (0600410B)
19
20ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.GameContent.PlayerSleepingHelper::get_FullyFallenAsleep()
21
22 ---> System.Exception: Basic block has to end with unconditional control flow.
23{
24 Block_0:
25 stloc:int32(var_0_06, ldfld:int32(PlayerSleepingHelper::timeSleeping, ldloc:valuetype Terraria.GameContent.PlayerSleepingHelper&(this)))
26}
27
28 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
29 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
30 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
31 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
32 --- End of inner exception stack trace ---
33 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
34 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
35*/;
36 }
37 }
38
39 // Token: 0x0600410C RID: 16652 RVA: 0x00244780 File Offset: 0x00242980
40 public void GetSleepingOffsetInfo(Player player, [Out] Vector2 posOffset)
41 {
42 float x = this.visualOffsetOfBedBase.X;
43 float y = this.visualOffsetOfBedBase.Y;
45 int num = this.sleepingIndex;
46 float gravDir = player.gravDir;
47 posOffset.X = (float)num;
48 posOffset.Y = gravDir;
49 }
50
51 // Token: 0x0600410D RID: 16653 RVA: 0x002447DC File Offset: 0x002429DC
53 {
54 if (!true)
55 {
56 }
57 long num = 0L;
58 bool flag = NPC.AnyDanger(true, num != 0L);
59 if (!true)
60 {
61 }
62 if (!true || !true)
63 {
64 }
65 return true;
66 }
67
68 // Token: 0x0600410E RID: 16654 RVA: 0x0024480C File Offset: 0x00242A0C
70 {
71 int direction = player.direction;
72 }
73
74 // Token: 0x0600410F RID: 16655 RVA: 0x000021DB File Offset: 0x000003DB
75 public void UpdateState(Player player)
76 {
77 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
78 }
79
80 // Token: 0x06004110 RID: 16656 RVA: 0x00244824 File Offset: 0x00242A24
81 public void StopSleeping(Player player, bool multiplayerBroadcast = true)
82 {
83 int myPlayer = Main.myPlayer;
84 int whoAmI = player.whoAmI;
85 }
86
87 // Token: 0x06004111 RID: 16657 RVA: 0x00244840 File Offset: 0x00242A40
88 public void StartSleeping(Player player, int x, int y)
89 {
90 int num = 1;
91 Vector2 bottom = player.Bottom;
92 if (num == 0)
93 {
94 }
95 if (num == 0)
96 {
97 }
98 if (num == 0)
99 {
100 }
101 if (num == 0)
102 {
103 }
104 Vector2 bottom2 = player.Bottom;
105 int num2 = 1;
106 this.StopSleeping(player, num2 != 0);
107 }
108
109 // Token: 0x06004112 RID: 16658 RVA: 0x0024490C File Offset: 0x00242B0C
110 public static bool GetSleepingTargetInfo(int x, int y, [Out] int targetDirection, [Out] Vector2 anchorPosition, [Out] Vector2 visualoffset)
111 {
112 /*
113An exception occurred when decompiling this method (06004112)
114
115ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.GameContent.PlayerSleepingHelper::GetSleepingTargetInfo(System.Int32,System.Int32,System.Int32,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)
116
117 ---> System.Exception: Basic block has to end with unconditional control flow.
118{
119 IL_0036:
120 stloc:Vector2(var_13_3D, call:Vector2(PlayerSleepingHelper::SetOffsetbyBed, ldloc:int16[exp:int32](var_12)))
121}
122
123 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
124 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
125 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
126 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
127 --- End of inner exception stack trace ---
128 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
129 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
130*/;
131 }
132
133 // Token: 0x06004113 RID: 16659 RVA: 0x0024495C File Offset: 0x00242B5C
134 private static Vector2 SetOffsetbyBed(int bedStyle)
135 {
136 Vector2 vector;
137 return vector;
138 }
139
140 // Token: 0x04007EC1 RID: 32449
141 public const int BedSleepingMaxDistance = 96;
142
143 // Token: 0x04007EC2 RID: 32450
144 public const int TimeToFullyFallAsleep = 120;
145
146 // Token: 0x04007EC3 RID: 32451
147 public bool isSleeping;
148
149 // Token: 0x04007EC4 RID: 32452
150 public int sleepingIndex;
151
152 // Token: 0x04007EC5 RID: 32453
153 public int timeSleeping;
154
155 // Token: 0x04007EC6 RID: 32454
157 }
158}
class f__AnonymousType0<< Count > j__TPar
Vector2 Bottom
Definition Entity.cs:318
static int myPlayer
Definition Main.cs:2337
static bool AnyDanger(bool quickBossNPCCheck=false, bool ignorePillarsAndMoonlordCountdown=false)
Definition NPC.cs:6409
Microsoft.Xna.Framework.Vector2 Directions
Definition Player.cs:1168
void StartSleeping(Player player, int x, int y)
void GetSleepingOffsetInfo(Player player, [Out] Vector2 posOffset)
void StopSleeping(Player player, bool multiplayerBroadcast=true)
static bool GetSleepingTargetInfo(int x, int y, [Out] int targetDirection, [Out] Vector2 anchorPosition, [Out] Vector2 visualoffset)
void SetIsSleepingAndAdjustPlayerRotation(Player player, bool state)