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
NetManager.cs
Go to the documentation of this file.
1using System;
3using System.IO;
5using Terraria.UI;
6
7namespace Terraria.Net
8{
9 // Token: 0x0200069D RID: 1693
10 public class NetManager
11 {
12 // Token: 0x06003875 RID: 14453 RVA: 0x00225C78 File Offset: 0x00223E78
13 private NetManager()
14 {
15 }
16
17 // Token: 0x06003876 RID: 14454 RVA: 0x00225C8C File Offset: 0x00223E8C
18 public void Register<T>() where T : NetModule, new()
19 {
20 int num = 1;
21 ushort moduleCount = this._moduleCount;
24 ushort moduleCount2 = this._moduleCount;
25 ushort moduleCount3 = this._moduleCount;
27 }
28
29 // Token: 0x06003877 RID: 14455 RVA: 0x000021DB File Offset: 0x000003DB
31 {
32 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
33 }
34
35 // Token: 0x06003878 RID: 14456 RVA: 0x000021DB File Offset: 0x000003DB
36 public ushort GetId<T>() where T : NetModule
37 {
38 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
39 }
40
41 // Token: 0x06003879 RID: 14457 RVA: 0x00225CC8 File Offset: 0x00223EC8
48
49 // Token: 0x0600387A RID: 14458 RVA: 0x00225CEC File Offset: 0x00223EEC
50 public void Broadcast(NetPacket packet, int ignoreClient = -1)
51 {
52 if (!true)
53 {
54 }
55 this.SendToClient(packet, ignoreClient);
56 }
57
58 // Token: 0x0600387B RID: 14459 RVA: 0x00225D08 File Offset: 0x00223F08
60 {
61 if (!true)
62 {
63 }
64 }
65
66 // Token: 0x0600387C RID: 14460 RVA: 0x00225D1C File Offset: 0x00223F1C
72
73 // Token: 0x0600387D RID: 14461 RVA: 0x00225D3C File Offset: 0x00223F3C
75 {
76 if (!true)
77 {
78 }
79 bool netHost = Main.NetHost;
80 }
81
82 // Token: 0x0600387E RID: 14462 RVA: 0x00225D68 File Offset: 0x00223F68
84 {
85 if (!true)
86 {
87 }
89 }
90
91 // Token: 0x0600387F RID: 14463 RVA: 0x00225D94 File Offset: 0x00223F94
93 {
94 if (!true)
95 {
96 }
97 }
98
99 // Token: 0x06003880 RID: 14464 RVA: 0x00225DB0 File Offset: 0x00223FB0
101 {
102 }
103
104 // Token: 0x06003881 RID: 14465 RVA: 0x00225DC0 File Offset: 0x00223FC0
106 {
107 int num = 1;
108 if (num == 0)
109 {
110 }
111 if (num != 0)
112 {
113 if (num == 0)
114 {
115 }
116 return;
117 }
118 if (num == 0)
119 {
120 }
121 if (num != 0)
122 {
123 this.SendToServerOrLoopback(packet);
124 return;
125 }
126 }
127
128 // Token: 0x06003882 RID: 14466 RVA: 0x00225E08 File Offset: 0x00224008
129 public static void SendCallback(object state)
130 {
131 }
132
133 // Token: 0x06003883 RID: 14467 RVA: 0x00225E1C File Offset: 0x0022401C
134 // Note: this type is marked as 'beforefieldinit'.
135 static NetManager()
136 {
137 }
138
139 // Token: 0x04007937 RID: 31031
140 public static NetManager Instance;
141
142 // Token: 0x04007938 RID: 31032
144
145 // Token: 0x04007939 RID: 31033
146 private ushort _moduleCount;
147
148 // Token: 0x0400793A RID: 31034
149 public static bool LoopbackClientSends;
150
151 // Token: 0x0200069E RID: 1694
152 private class PacketTypeStorage<T> where T : NetModule
153 {
154 // Token: 0x06003884 RID: 14468 RVA: 0x00225E2C File Offset: 0x0022402C
156 {
157 }
158
159 // Token: 0x0400793B RID: 31035
160 public static ushort Id;
161
162 // Token: 0x0400793C RID: 31036
163 public static T Module;
164 }
165
166 // Token: 0x0200069F RID: 1695
168 {
169 // Token: 0x06003885 RID: 14469 RVA: 0x00225E40 File Offset: 0x00224040
170 public BroadcastCondition(object @object, IntPtr method)
171 {
173 this.m_target = @object;
175 this.method_code = this;
176 }
177
178 // Token: 0x06003886 RID: 14470 RVA: 0x00225E94 File Offset: 0x00224094
179 public bool Invoke(int clientIndex)
180 {
181 /*
182An exception occurred when decompiling this method (06003886)
183
184ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.Net.NetManager/BroadcastCondition::Invoke(System.Int32)
185
186 ---> System.Exception: Basic block has to end with unconditional control flow.
187{
188 Block_0:
189 stloc:native int(var_0_06, ldfld:native int(Delegate::method_code, ldloc:BroadcastCondition[exp:Delegate](this)))
190 stloc:native int(var_1_0D, ldfld:native int(Delegate::invoke_impl, ldloc:BroadcastCondition[exp:Delegate](this)))
191 stloc:native int(var_2_14, ldfld:native int(Delegate::method, ldloc:BroadcastCondition[exp:Delegate](this)))
192}
193
194 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
195 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
196 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
197 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
198 --- End of inner exception stack trace ---
199 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
200 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
201*/;
202 }
203
204 // Token: 0x06003887 RID: 14471 RVA: 0x000021DB File Offset: 0x000003DB
205 public IAsyncResult BeginInvoke(int clientIndex, AsyncCallback callback, object @object)
206 {
207 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
208 }
209
210 // Token: 0x06003888 RID: 14472 RVA: 0x000021DB File Offset: 0x000003DB
211 public bool EndInvoke(IAsyncResult result)
212 {
213 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
214 }
215 }
216 }
217}
class f__AnonymousType0<< Count > j__TPar
static bool NetHost
Definition Main.cs:5544
static int myPlayer
Definition Main.cs:2337
static bool NetClientOnly
Definition Main.cs:5407
static INetDiagnosticsUI ActiveNetDiagnosticsUI
Definition Main.cs:4592
IAsyncResult BeginInvoke(int clientIndex, AsyncCallback callback, object @object)
BroadcastCondition(object @object, IntPtr method)
bool EndInvoke(IAsyncResult result)
void SendToServer(NetPacket packet)
void BroadcastOrLoopback(NetPacket packet)
Definition NetManager.cs:74
NetModule GetModule< T >()
Definition NetManager.cs:30
void Broadcast(NetPacket packet, int ignoreClient=-1)
Definition NetManager.cs:50
static NetManager Instance
Dictionary< ushort, NetModule > _modules
void Read(BinaryReader reader, int userId, int readLength)
Definition NetManager.cs:42
void SendToSelf(NetPacket packet)
Definition NetManager.cs:67
static bool LoopbackClientSends
void Broadcast(NetPacket packet, NetManager.BroadcastCondition conditionToBroadcast, int ignoreClient=-1)
Definition NetManager.cs:59
static void SendCallback(object state)
void SendToClient(NetPacket packet, int clientId)
void SendToServerOrLoopback(NetPacket packet)
Definition NetManager.cs:83
void SendToServerAndSelf(NetPacket packet)
Definition NetManager.cs:92