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
PlayerManager.cs
Go to the documentation of this file.
1using System;
4using InControl;
5using UnityEngine;
6
8{
9 // Token: 0x02000007 RID: 7
11 {
12 // Token: 0x0600001C RID: 28 RVA: 0x00002788 File Offset: 0x00000988
23
24 // Token: 0x0600001D RID: 29 RVA: 0x000027B4 File Offset: 0x000009B4
25 private void OnDisable()
26 {
27 if (!true)
28 {
29 }
32 }
33
34 // Token: 0x0600001E RID: 30 RVA: 0x000027DC File Offset: 0x000009DC
35 private void Update()
36 {
37 PlayerActions playerActions = this.joystickListener;
39 bool flag = this.ThereIsNoPlayerUsingJoystick(activeDevice);
40 Player player = this.CreatePlayer(activeDevice);
43 }
44
45 // Token: 0x0600001F RID: 31 RVA: 0x0000281C File Offset: 0x00000A1C
47 {
48 bool wasPressed = actions.Green.WasPressed;
49 bool wasPressed2 = actions.Red.WasPressed;
50 bool wasPressed3 = actions.Blue.WasPressed;
51 return true;
52 }
53
54 // Token: 0x06000020 RID: 32 RVA: 0x0000285C File Offset: 0x00000A5C
56 {
57 /*
58An exception occurred when decompiling this method (06000020)
59
60ICSharpCode.Decompiler.DecompilerException: Error decompiling MultiplayerWithBindingsExample.Player MultiplayerWithBindingsExample.PlayerManager::FindPlayerUsingJoystick(InControl.InputDevice)
61
62 ---> System.Exception: Basic block has to end with unconditional control flow.
63{
64 Block_0:
65 stloc:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>(var_0_06, ldfld:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>(PlayerManager::players, ldloc:PlayerManager(this)))
66 stloc:int32(var_1_0D, ldfld:int32(List`1::_size, ldloc:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>[exp:List`1](var_0_06)))
67 stloc:int32(var_2_14, ldfld:int32(List`1::_size, ldloc:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>[exp:List`1](var_0_06)))
68 stloc:int32(var_4_22, ldfld:int32(List`1::_size, ldfld:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>[exp:List`1](PlayerManager::players, ldloc:PlayerManager(this))))
69}
70
71 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
72 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
73 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
74 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
75 --- End of inner exception stack trace ---
76 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
77 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
78*/;
79 }
80
81 // Token: 0x06000021 RID: 33 RVA: 0x00002890 File Offset: 0x00000A90
82 private bool ThereIsNoPlayerUsingJoystick(InputDevice inputDevice)
83 {
84 Player player = this.FindPlayerUsingJoystick(inputDevice);
85 bool flag;
86 return flag;
87 }
88
89 // Token: 0x06000022 RID: 34 RVA: 0x000028A8 File Offset: 0x00000AA8
91 {
92 /*
93An exception occurred when decompiling this method (06000022)
94
95ICSharpCode.Decompiler.DecompilerException: Error decompiling MultiplayerWithBindingsExample.Player MultiplayerWithBindingsExample.PlayerManager::FindPlayerUsingKeyboard()
96
97 ---> System.Exception: Basic block has to end with unconditional control flow.
98{
99 Block_0:
100 stloc:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>(var_0_06, ldfld:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>(PlayerManager::players, ldloc:PlayerManager(this)))
101 stloc:int32(var_1_0D, ldfld:int32(List`1::_size, ldloc:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>[exp:List`1](var_0_06)))
102 stloc:int32(var_2_14, ldfld:int32(List`1::_size, ldloc:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>[exp:List`1](var_0_06)))
103 stloc:PlayerActions(var_3_1B, ldfld:PlayerActions(PlayerManager::keyboardListener, ldloc:PlayerManager(this)))
104 stloc:int32(var_5_2A, ldfld:int32(List`1::_size, ldfld:class [mscorlib]System.Collections.Generic.List`1<class MultiplayerWithBindingsExample.Player>[exp:List`1](PlayerManager::players, ldloc:PlayerManager(this))))
105 stloc:PlayerActions(var_6_32, ldfld:PlayerActions(PlayerManager::keyboardListener, ldloc:PlayerManager(this)))
106}
107
108 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
109 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
110 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
111 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
112 --- End of inner exception stack trace ---
113 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
114 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
115*/;
116 }
117
118 // Token: 0x06000023 RID: 35 RVA: 0x000028EC File Offset: 0x00000AEC
120 {
121 Player player = this.FindPlayerUsingKeyboard();
122 bool flag;
123 return flag;
124 }
125
126 // Token: 0x06000024 RID: 36 RVA: 0x00002904 File Offset: 0x00000B04
127 private void OnDeviceDetached(InputDevice inputDevice)
128 {
129 Player player = this.FindPlayerUsingJoystick(inputDevice);
130 this.RemovePlayer(player);
131 }
132
133 // Token: 0x06000025 RID: 37 RVA: 0x00002295 File Offset: 0x00000495
134 private Player CreatePlayer(InputDevice inputDevice)
135 {
136 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
137 }
138
139 // Token: 0x06000026 RID: 38 RVA: 0x00002924 File Offset: 0x00000B24
140 private void RemovePlayer(Player player)
141 {
143 Vector3 position = player.transform.position;
145 global::UnityEngine.Object.Destroy(player.gameObject);
146 }
147
148 // Token: 0x06000027 RID: 39 RVA: 0x00002958 File Offset: 0x00000B58
149 private void OnGUI()
150 {
151 int size = this.players._size;
152 string text2;
153 string text3;
154 string text = "Active players: " + text2 + "/" + text3;
155 if (16896 == 0)
156 {
157 }
158 int size2 = this.players._size;
159 if (16896 == 0)
160 {
161 }
162 }
163
164 // Token: 0x06000028 RID: 40 RVA: 0x000029A0 File Offset: 0x00000BA0
166 {
167 }
168
169 // Token: 0x04000016 RID: 22
171
172 // Token: 0x04000017 RID: 23
173 private const int maxPlayers = 4;
174
175 // Token: 0x04000018 RID: 24
177
178 // Token: 0x04000019 RID: 25
180
181 // Token: 0x0400001A RID: 26
183
184 // Token: 0x0400001B RID: 27
186 }
187}
class f__AnonymousType0<< Count > j__TPar
static InputDevice ActiveDevice
static PlayerActions CreateWithKeyboardBindings()
static PlayerActions CreateWithJoystickBindings()
Player CreatePlayer(InputDevice inputDevice)
bool ThereIsNoPlayerUsingJoystick(InputDevice inputDevice)
Player FindPlayerUsingJoystick(InputDevice inputDevice)
void OnDeviceDetached(InputDevice inputDevice)
bool JoinButtonWasPressedOnListener(PlayerActions actions)
GameObject gameObject
Definition Component.cs:31