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
UnityInputDeviceManager.cs
Go to the documentation of this file.
1using System;
3using System.IO;
7using UnityEngine;
8
9namespace InControl
10{
11 // Token: 0x0200005D RID: 93
13 {
14 // Token: 0x06000449 RID: 1097 RVA: 0x0000E258 File Offset: 0x0000C458
28
29 // Token: 0x0600044A RID: 1098 RVA: 0x0000E2A4 File Offset: 0x0000C4A4
30 public override void Update(ulong updateTick, float deltaTime)
31 {
32 float num = this.deviceRefreshTimer;
34 this.QueryJoystickInfo();
35 int num2 = this.joystickHash;
36 int num3 = this.lastJoystickHash;
37 int num4 = this.joystickCount;
38 int num5 = this.lastJoystickCount;
39 }
40
41 // Token: 0x0600044B RID: 1099 RVA: 0x0000E2FC File Offset: 0x0000C4FC
42 private void QueryJoystickInfo()
43 {
44 string[] array = Input.GetJoystickNames();
46 int num = this.joystickCount;
47 string[] array2 = this.joystickNames;
48 }
49
50 // Token: 0x1700014A RID: 330
51 // (get) Token: 0x0600044C RID: 1100 RVA: 0x0000E328 File Offset: 0x0000C528
53 {
54 get
55 {
56 int num = this.joystickHash;
57 int num2 = this.lastJoystickHash;
58 int num3 = this.joystickCount;
59 int num4 = this.lastJoystickCount;
60 return true;
61 }
62 }
63
64 // Token: 0x0600044D RID: 1101 RVA: 0x0000E354 File Offset: 0x0000C554
65 private void AttachDevices()
66 {
67 string[] array = this.joystickNames;
68 }
69
70 // Token: 0x0600044E RID: 1102 RVA: 0x000025E1 File Offset: 0x000007E1
71 private void DetachDevices()
72 {
73 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
74 }
75
76 // Token: 0x0600044F RID: 1103 RVA: 0x0000E38C File Offset: 0x0000C58C
77 public void ReloadDevices()
78 {
79 this.QueryJoystickInfo();
80 this.DetachDevices();
81 this.AttachDevices();
82 }
83
84 // Token: 0x06000450 RID: 1104 RVA: 0x000025E1 File Offset: 0x000007E1
85 private void AttachDevice(UnityInputDevice device)
86 {
87 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
88 }
89
90 // Token: 0x06000451 RID: 1105 RVA: 0x0000E3AC File Offset: 0x0000C5AC
92 {
93 /*
94An exception occurred when decompiling this method (06000451)
95
96ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean InControl.UnityInputDeviceManager::HasAttachedDeviceWithJoystickId(System.Int32)
97
98 ---> System.Exception: Basic block has to end with unconditional control flow.
99{
100 IL_0013:
101 stloc:class [mscorlib]System.Collections.Generic.List`1<class InControl.InputDevice>(var_3_19, ldfld:class [mscorlib]System.Collections.Generic.List`1<class InControl.InputDevice>(InputDeviceManager::devices, ldloc:UnityInputDeviceManager[exp:InputDeviceManager](this)))
102}
103
104 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
105 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
106 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
107 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
108 --- End of inner exception stack trace ---
109 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
110 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
111*/;
112 }
113
114 // Token: 0x06000452 RID: 1106 RVA: 0x0000E3D8 File Offset: 0x0000C5D8
116 {
117 bool flag = this.HasAttachedDeviceWithJoystickId(unityJoystickId);
118 int num = unityJoystickName.IndexOf("webcam", StringComparison.OrdinalIgnoreCase);
119 }
120
121 // Token: 0x06000453 RID: 1107 RVA: 0x0000E5C0 File Offset: 0x0000C7C0
123 {
124 /*
125An exception occurred when decompiling this method (06000453)
126
127ICSharpCode.Decompiler.DecompilerException: Error decompiling InControl.InputDeviceProfile InControl.UnityInputDeviceManager::DetectDevice(System.String)
128
129 ---> System.Exception: Basic block has to end with unconditional control flow.
130{
131 IL_0018:
132 stloc:class [mscorlib]System.Collections.Generic.List`1<class InControl.InputDeviceProfile>(var_0_1E, ldfld:class [mscorlib]System.Collections.Generic.List`1<class InControl.InputDeviceProfile>(UnityInputDeviceManager::systemDeviceProfiles, ldloc:UnityInputDeviceManager(this)))
133}
134
135 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
136 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
137 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
138 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
139 --- End of inner exception stack trace ---
140 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
141 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
142*/;
143 }
144
145 // Token: 0x06000454 RID: 1108 RVA: 0x000025E1 File Offset: 0x000007E1
147 {
148 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
149 }
150
151 // Token: 0x06000455 RID: 1109 RVA: 0x0000E5EC File Offset: 0x0000C7EC
153 {
154 if (!true)
155 {
156 }
158 this.AddSystemDeviceProfile(inputDeviceProfile);
159 }
160
161 // Token: 0x06000456 RID: 1110 RVA: 0x000025E1 File Offset: 0x000007E1
163 {
164 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
165 }
166
167 // Token: 0x06000457 RID: 1111 RVA: 0x0000E608 File Offset: 0x0000C808
168 public void LoadDeviceProfiles()
169 {
171 this.LoadDeviceProfilesFromPath(customProfileFolder);
172 }
173
174 // Token: 0x06000458 RID: 1112 RVA: 0x0000E624 File Offset: 0x0000C824
175 public void LoadDeviceProfile(string data)
176 {
178 this.AddDeviceProfile(customInputDeviceProfile);
179 }
180
181 // Token: 0x06000459 RID: 1113 RVA: 0x0000E640 File Offset: 0x0000C840
187
188 // Token: 0x0600045A RID: 1114 RVA: 0x0000E65C File Offset: 0x0000C85C
190 {
191 bool flag = Directory.Exists(rootPath);
192 string[] array;
194 this.AddDeviceProfile(customInputDeviceProfile);
195 }
196
197 // Token: 0x1700014B RID: 331
198 // (get) Token: 0x0600045B RID: 1115 RVA: 0x0000E680 File Offset: 0x0000C880
199 public static string SavePath
200 {
201 get
202 {
203 if (Application.persistentDataPath._stringLength == 0)
204 {
205 Debug.Log("SetupPaths: Unity path is empty. Trying native method...");
206 return;
207 }
208 }
209 }
210
211 // Token: 0x1700014C RID: 332
212 // (get) Token: 0x0600045C RID: 1116 RVA: 0x0000E6A4 File Offset: 0x0000C8A4
213 public static string CustomProfileFolder
214 {
215 get
216 {
217 return UnityInputDeviceManager.SavePath + "/ControllerProfiles";
218 }
219 }
220
221 // Token: 0x040003D4 RID: 980
222 private const float deviceRefreshInterval = 1f;
223
224 // Token: 0x040003D5 RID: 981
225 private float deviceRefreshTimer;
226
227 // Token: 0x040003D6 RID: 982
229
230 // Token: 0x040003D7 RID: 983
232
233 // Token: 0x040003D8 RID: 984
234 private string[] joystickNames;
235
236 // Token: 0x040003D9 RID: 985
237 private int lastJoystickCount;
238
239 // Token: 0x040003DA RID: 986
240 private int lastJoystickHash;
241
242 // Token: 0x040003DB RID: 987
243 private int joystickCount;
244
245 // Token: 0x040003DC RID: 988
246 private int joystickHash;
247
248 // Token: 0x040003DD RID: 989
249 public static string _savePath;
250
251 // Token: 0x0200005E RID: 94
253 private sealed class <>c__DisplayClass20_0
254 {
255 // Token: 0x0600045D RID: 1117 RVA: 0x0000E6C0 File Offset: 0x0000C8C0
257 {
258 }
259
260 // Token: 0x0600045E RID: 1118 RVA: 0x0000E6D4 File Offset: 0x0000C8D4
262 {
263 string serialNumber = this.deviceInfo.serialNumber;
264 string name = this.deviceInfo.name;
265 bool flag;
266 return flag;
267 }
268
269 // Token: 0x0600045F RID: 1119 RVA: 0x0000E6FC File Offset: 0x0000C8FC
271 {
272 string serialNumber = this.deviceInfo.serialNumber;
273 string name = this.deviceInfo.name;
274 bool flag;
275 return flag;
276 }
277
278 // Token: 0x06000460 RID: 1120 RVA: 0x0000E724 File Offset: 0x0000C924
280 {
281 string serialNumber = this.deviceInfo.serialNumber;
282 string name = this.deviceInfo.name;
283 bool flag;
284 return flag;
285 }
286
287 // Token: 0x06000461 RID: 1121 RVA: 0x0000E74C File Offset: 0x0000C94C
289 {
290 string serialNumber = this.deviceInfo.serialNumber;
291 string name = this.deviceInfo.name;
292 bool flag;
293 return flag;
294 }
295
296 // Token: 0x040003DE RID: 990
298 }
299 }
300}
class f__AnonymousType0<< Count > j__TPar
static CustomInputDeviceProfile Load(string data)
static CustomInputDeviceProfile LoadFromFile(string filePath)
InputDeviceProfile DetectDevice(string unityJoystickName)
void AttachDevice(UnityInputDevice device)
readonly List< InputDeviceProfile > customDeviceProfiles
void AddSystemDeviceProfile(InputDeviceProfile deviceProfile)
readonly List< InputDeviceProfile > systemDeviceProfiles
void AddDeviceProfile(CustomInputDeviceProfile deviceProfile)
void DetectJoystickDevice(int unityJoystickId, string unityJoystickName)
bool HasAttachedDeviceWithJoystickId(int unityJoystickId)
override void Update(ulong updateTick, float deltaTime)
static bool Exists(string path)
Definition Directory.cs:64
static DirectoryInfo CreateDirectory(string path)
Definition Directory.cs:40
static string persistentDataPath
static void Log(object message)
Definition Debug.cs:51
static string[] GetJoystickNames()
Definition Input.cs:72