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
Netplay.cs
Go to the documentation of this file.
1using System;
2using System.Net;
9using Terraria.Net;
10using Terraria.UI;
11using UnityEngine;
12
13namespace Terraria
14{
15 // Token: 0x02000402 RID: 1026
16 public class Netplay
17 {
18 // Token: 0x1400002A RID: 42
19 // (add) Token: 0x060020EC RID: 8428 RVA: 0x000D1C70 File Offset: 0x000CFE70
20 // (remove) Token: 0x060020ED RID: 8429 RVA: 0x000D1C8C File Offset: 0x000CFE8C
21 public static event Action OnDisconnect
22 {
24 add
25 {
26 if (!true)
27 {
28 }
30 if (@delegate != null)
31 {
32 }
33 }
35 remove
36 {
37 if (!true)
38 {
39 }
41 if (@delegate != null)
42 {
43 }
44 }
45 }
46
47 // Token: 0x060020EE RID: 8430 RVA: 0x000D1CA8 File Offset: 0x000CFEA8
48 private static void OpenPort()
49 {
50 if (!true)
51 {
52 }
54 }
55
56 // Token: 0x060020EF RID: 8431 RVA: 0x000D1CC0 File Offset: 0x000CFEC0
57 public static void closePort()
58 {
59 }
60
61 // Token: 0x060020F0 RID: 8432 RVA: 0x000D1CD0 File Offset: 0x000CFED0
62 public static string GetLocalIPAddress()
63 {
64 int num = 1;
65 if (num == 0)
66 {
67 }
68 string hostName = Dns.GetHostName();
69 if (num == 0)
70 {
71 }
72 ushort[] numbers = Dns.GetHostEntry(hostName).addressList._numbers;
73 return "";
74 }
75
76 // Token: 0x060020F1 RID: 8433 RVA: 0x000D1D18 File Offset: 0x000CFF18
77 public static void ResetNetDiag()
78 {
79 if (!true)
80 {
81 }
83 }
84
85 // Token: 0x060020F2 RID: 8434 RVA: 0x000D1D34 File Offset: 0x000CFF34
86 public static void ResetSections()
87 {
88 int num = 1;
89 if (num == 0)
90 {
91 }
92 if (num == 0)
93 {
94 }
95 }
96
97 // Token: 0x060020F3 RID: 8435 RVA: 0x000D1D50 File Offset: 0x000CFF50
98 public static void AddBan(int plr)
99 {
100 if (!true)
101 {
102 }
103 if ("//" != null)
104 {
105 }
106 }
107
108 // Token: 0x060020F4 RID: 8436 RVA: 0x000D1D94 File Offset: 0x000CFF94
109 public static bool IsBanned(RemoteAddress address)
110 {
111 if (!true)
112 {
113 }
114 bool flag;
115 return flag;
116 }
117
118 // Token: 0x060020F5 RID: 8437 RVA: 0x000D1DCC File Offset: 0x000CFFCC
119 public static void AddCurrentServerToRecentList()
120 {
121 int num = 1;
122 if (num == 0)
123 {
124 }
125 if (num == 0)
126 {
127 }
128 if (num == 0)
129 {
130 }
131 if (num == 0)
132 {
133 if (num == 0)
134 {
135 }
136 string text;
137 string text2;
138 bool flag = text == text2;
139 return;
140 }
141 }
142
143 // Token: 0x060020F6 RID: 8438 RVA: 0x000D1E58 File Offset: 0x000D0058
144 public static void deleteDedicatedServer(string ip, int port)
145 {
146 int num = 1;
147 if (num == 0)
148 {
149 }
150 if (num != 0)
151 {
152 return;
153 }
154 if (num == 0)
155 {
156 }
157 if (num == 0)
158 {
159 }
160 string text = ip.ToLower();
161 string text2;
162 bool flag = text2 == text;
163 if ((text2 == null || text2 != null) && (text2 == null || text2 != null))
164 {
165 return;
166 }
167 throw new ArrayTypeMismatchException();
168 }
169
170 // Token: 0x060020F7 RID: 8439 RVA: 0x000D1EB0 File Offset: 0x000D00B0
171 public static void SocialClientLoop(object threadContext)
172 {
173 }
174
175 // Token: 0x060020F8 RID: 8440 RVA: 0x000D1EC0 File Offset: 0x000D00C0
176 public static void TcpLocalClientLoop(object threadContext)
177 {
178 int num = 1;
179 if (num == 0)
180 {
181 }
182 if (num == 0)
183 {
184 }
185 Main.menuMode = 14;
186 Thread.Sleep(200);
187 }
188
189 // Token: 0x060020F9 RID: 8441 RVA: 0x000D1F6C File Offset: 0x000D016C
190 public static void TcpClientLoop(object threadContext)
191 {
192 int num = 1;
193 if (num == 0)
194 {
195 }
196 if (num == 0)
197 {
198 }
199 Main.menuMode = 14;
200 if (num == 0)
201 {
202 }
204 Thread.Sleep(20);
205 }
206
207 // Token: 0x060020FA RID: 8442 RVA: 0x000D20E0 File Offset: 0x000D02E0
208 private static void ClientServerLoopSetup(RemoteAddress address)
209 {
210 int num = 1;
211 if (num == 0)
212 {
213 }
215 if (num == 0)
216 {
217 }
218 int myPlayer = Main.myPlayer;
219 int myPlayer2 = Main.myPlayer;
220 int myPlayer3 = Main.myPlayer;
221 int myPlayer4 = Main.myPlayer;
222 }
223
224 // Token: 0x060020FB RID: 8443 RVA: 0x000D2144 File Offset: 0x000D0344
225 private static void ClientLoopSetup(RemoteAddress address)
226 {
227 int num = 1;
228 if (num == 0)
229 {
230 }
231 if (num == 0)
232 {
233 }
235 int myPlayer = Main.myPlayer;
236 int myPlayer2 = Main.myPlayer;
237 int myPlayer3 = Main.myPlayer;
238 int myPlayer4 = Main.myPlayer;
239 }
240
241 // Token: 0x060020FC RID: 8444 RVA: 0x000D21D8 File Offset: 0x000D03D8
242 public static void ClientUpdateFrame()
243 {
244 if (!true)
245 {
246 }
247 }
248
249 // Token: 0x060020FD RID: 8445 RVA: 0x000D21F8 File Offset: 0x000D03F8
250 public static void ServerUpdateFrame()
251 {
252 int num = 1;
253 if (num == 0)
254 {
255 }
256 while (num != 0)
257 {
258 }
259 if (num == 0)
260 {
261 }
262 string text;
263 bool flag = TcpAddress.IsLocalHost(text);
266 }
267
268 // Token: 0x060020FE RID: 8446 RVA: 0x000D2248 File Offset: 0x000D0448
269 public static void UpdateClientNet()
270 {
271 int num = 1;
272 if (num == 0)
273 {
274 }
276 if (num == 0)
277 {
278 }
280 if (num == 0)
281 {
282 }
283 if (num != 0)
284 {
285 return;
286 }
288 }
289
290 // Token: 0x060020FF RID: 8447 RVA: 0x000D2284 File Offset: 0x000D0484
291 public static void ClientLoopFrameUpdate()
292 {
293 if (!true)
294 {
295 }
297 string textValue = Language.GetTextValue("Net.FoundServer");
298 if ("Net.FoundServer" == null)
299 {
300 }
301 if ("Net.FoundServer" == null)
302 {
303 }
304 int num = 1;
305 if ("Net.FoundServer" == null)
306 {
307 }
308 if (num == 0)
309 {
310 }
311 if (num == 0)
312 {
313 }
314 if (num == 0)
315 {
316 }
317 }
318
319 // Token: 0x06002100 RID: 8448 RVA: 0x000D23FC File Offset: 0x000D05FC
320 private static void InnerClientLoop()
321 {
322 if (!true)
323 {
324 }
325 Thread.Sleep(20);
326 }
327
328 // Token: 0x06002101 RID: 8449 RVA: 0x000021DB File Offset: 0x000003DB
329 private static int FindNextOpenClientSlot()
330 {
331 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
332 }
333
334 // Token: 0x06002102 RID: 8450 RVA: 0x000D24F0 File Offset: 0x000D06F0
335 private static void OnConnectionAccepted(int clientId)
336 {
337 if (!true)
338 {
339 }
340 string text;
341 Debug.Log(text + " is connecting...");
342 }
343
344 // Token: 0x06002103 RID: 8451 RVA: 0x000D2514 File Offset: 0x000D0714
345 private static bool StartListening()
346 {
347 if (!true)
348 {
349 }
350 bool flag;
351 return flag;
352 }
353
354 // Token: 0x06002104 RID: 8452 RVA: 0x000D2528 File Offset: 0x000D0728
355 private static void StopListening()
356 {
357 if (!true)
358 {
359 }
360 }
361
362 // Token: 0x06002105 RID: 8453 RVA: 0x000D2538 File Offset: 0x000D0738
363 private static void BroadcastThread()
364 {
365 int num = 1;
366 if (num == 0)
367 {
368 }
369 if (num == 0)
370 {
371 }
372 Debug.LogError("World name is bad");
373 if ("World name is bad" == null)
374 {
375 }
377 }
378
379 // Token: 0x06002106 RID: 8454 RVA: 0x000D2678 File Offset: 0x000D0878
380 public static void StartBroadCasting()
381 {
382 int num = 1;
383 if (num == 0)
384 {
385 }
386 if (num != 0)
387 {
388 if (num == 0)
389 {
390 }
392 }
394 }
395
396 // Token: 0x06002107 RID: 8455 RVA: 0x000D26C0 File Offset: 0x000D08C0
397 public static void StopBroadCasting()
398 {
399 if (!true)
400 {
401 }
402 if (!true)
403 {
404 }
405 }
406
407 // Token: 0x06002108 RID: 8456 RVA: 0x000D26D4 File Offset: 0x000D08D4
408 public static void ServerLoopUpdateFrame()
409 {
410 if (!true)
411 {
412 }
414 }
415
416 // Token: 0x06002109 RID: 8457 RVA: 0x000D2800 File Offset: 0x000D0A00
417 public static void ServerLoop(object threadContext)
418 {
419 int num = 1;
420 if (num == 0)
421 {
422 }
423 if (num == 0)
424 {
425 }
426 if (num == 0)
427 {
428 }
430 if (num == 0)
431 {
432 }
433 long ticks = DateTime.Now.Ticks;
434 if (3 == 0)
435 {
436 }
437 bool flag = Netplay.StartListening();
438 Main.menuMode = 14;
439 string textValue = Language.GetTextValue("Mobile.FailedToCreateSession");
440 int num2 = 1;
441 Debug.LogError(" Exception normal: Tried to run two servers on the same PC");
443 if (num2 != 0)
444 {
445 }
446 }
447
448 // Token: 0x0600210A RID: 8458 RVA: 0x000D293C File Offset: 0x000D0B3C
450 {
451 int num = 1;
452 if (num == 0)
453 {
454 }
455 if (num == 0)
456 {
457 }
458 }
459
460 // Token: 0x0600210B RID: 8459 RVA: 0x000D2954 File Offset: 0x000D0B54
461 public static void StartServer()
462 {
463 }
464
465 // Token: 0x0600210C RID: 8460 RVA: 0x000D2964 File Offset: 0x000D0B64
466 public static bool SetRemoteIP(string remoteAddress)
467 {
468 if (!true)
469 {
470 return;
471 }
472 }
473
474 // Token: 0x0600210D RID: 8461 RVA: 0x000D2980 File Offset: 0x000D0B80
475 public static void Initialize()
476 {
477 int num = 1;
478 if (num == 0)
479 {
480 }
481 if (num == 0)
482 {
483 }
484 }
485
486 // Token: 0x0600210E RID: 8462 RVA: 0x000021DB File Offset: 0x000003DB
487 public static int GetSectionX(int x)
488 {
489 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
490 }
491
492 // Token: 0x0600210F RID: 8463 RVA: 0x000021DB File Offset: 0x000003DB
493 public static int GetSectionY(int y)
494 {
495 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
496 }
497
498 // Token: 0x06002110 RID: 8464 RVA: 0x000D29A0 File Offset: 0x000D0BA0
499 public Netplay()
500 {
501 }
502
503 // Token: 0x06002111 RID: 8465 RVA: 0x000D29B4 File Offset: 0x000D0BB4
504 // Note: this type is marked as 'beforefieldinit'.
505 static Netplay()
506 {
507 }
508
509 // Token: 0x04002D00 RID: 11520
510 public static string BanFilePath;
511
512 // Token: 0x04002D01 RID: 11521
513 public static string ServerPassword;
514
515 // Token: 0x04002D02 RID: 11522
516 public static RemoteClient[] Clients;
517
518 // Token: 0x04002D03 RID: 11523
520
521 // Token: 0x04002D04 RID: 11524
522 public static RemoteServer Server;
523
524 // Token: 0x04002D05 RID: 11525
525 public static IPAddress ServerIP;
526
527 // Token: 0x04002D06 RID: 11526
528 public static string ServerIPText;
529
530 // Token: 0x04002D07 RID: 11527
531 public static int ListenPort;
532
533 // Token: 0x04002D08 RID: 11528
534 public static bool IsServerRunning;
535
536 // Token: 0x04002D09 RID: 11529
537 public static bool IsListening;
538
539 // Token: 0x04002D0A RID: 11530
540 public static bool UseUPNP;
541
542 // Token: 0x04002D0B RID: 11531
543 public static bool LostConnection;
544
545 // Token: 0x04002D0C RID: 11532
546 public static bool Disconnect;
547
548 // Token: 0x04002D0D RID: 11533
549 public static bool SpamCheck;
550
551 // Token: 0x04002D0E RID: 11534
552 public static bool HasClients;
553
554 // Token: 0x04002D0F RID: 11535
555 public static string portForwardIP;
556
557 // Token: 0x04002D10 RID: 11536
558 public static int portForwardPort;
559
560 // Token: 0x04002D11 RID: 11537
561 public static bool portForwardOpen;
562
563 // Token: 0x04002D12 RID: 11538
564 private static int oldState;
565
566 // Token: 0x04002D13 RID: 11539
568
569 // Token: 0x04002D14 RID: 11540
570 public static bool clientLoopRunning;
571
572 // Token: 0x04002D15 RID: 11541
574
575 // Token: 0x04002D16 RID: 11542
577
578 // Token: 0x04002D17 RID: 11543
579 public const int MaxConnections = 256;
580
581 // Token: 0x04002D18 RID: 11544
582 public const int NetBufferSize = 32768;
583
584 // Token: 0x04002D19 RID: 11545
586 private static Action OnDisconnect;
587
588 // Token: 0x04002D1A RID: 11546
590 }
591}
class f__AnonymousType0<< Count > j__TPar
static DrPlatform.DrPlatformType CurrentPlatform
Definition DrPlatform.cs:26
static IPHostEntry GetHostEntry(string hostNameOrAddress)
Definition Dns.cs:200
static string GetHostName()
Definition Dns.cs:232
readonly ushort[] _numbers
Definition IPAddress.cs:749
IPAddress[] addressList
static void Sleep(int millisecondsTimeout)
Definition Thread.cs:207
static string GetTextValue(string key)
Definition Language.cs:54
static int myPlayer
Definition Main.cs:2337
static bool NetClientOnly
Definition Main.cs:5407
static INetDiagnosticsUI ActiveNetDiagnosticsUI
Definition Main.cs:4592
static void BootPlayer(int plr, NetworkText msg)
static void SyncDisconnectedPlayer(int plr)
override bool IsLocalHost()
Definition TcpAddress.cs:49
static void InnerClientLoop()
Definition Netplay.cs:320
static void ServerUpdateFrame()
Definition Netplay.cs:250
const int MaxConnections
Definition Netplay.cs:579
static void ResetSections()
Definition Netplay.cs:86
static void SocialClientLoop(object threadContext)
Definition Netplay.cs:171
static string GetLocalIPAddress()
Definition Netplay.cs:62
static void ServerLoop(object threadContext)
Definition Netplay.cs:417
static bool Disconnect
Definition Netplay.cs:546
static void ClientLoopSetup(RemoteAddress address)
Definition Netplay.cs:225
static void Initialize()
Definition Netplay.cs:475
static string portForwardIP
Definition Netplay.cs:555
static IPAddress ServerIP
Definition Netplay.cs:525
static RemoteServer Server
Definition Netplay.cs:522
static AutoResetEvent disconnectEvent
Definition Netplay.cs:589
static bool UseUPNP
Definition Netplay.cs:540
static void UpdateClientNet()
Definition Netplay.cs:269
static void ResetNetDiag()
Definition Netplay.cs:77
static int oldState
Definition Netplay.cs:564
static bool HasClients
Definition Netplay.cs:552
static void deleteDedicatedServer(string ip, int port)
Definition Netplay.cs:144
static bool IsBanned(RemoteAddress address)
Definition Netplay.cs:109
static bool LostConnection
Definition Netplay.cs:543
static Action OnDisconnect
Definition Netplay.cs:22
static bool IsServerRunning
Definition Netplay.cs:534
static void StartTcpClient(bool connectingToLocalServer)
Definition Netplay.cs:449
static void TcpClientLoop(object threadContext)
Definition Netplay.cs:190
static void closePort()
Definition Netplay.cs:57
static void StopListening()
Definition Netplay.cs:355
static int portForwardPort
Definition Netplay.cs:558
static RemoteClient[] Clients
Definition Netplay.cs:516
static int FindNextOpenClientSlot()
Definition Netplay.cs:329
static void BroadcastThread()
Definition Netplay.cs:363
static bool SpamCheck
Definition Netplay.cs:549
static int GetSectionX(int x)
Definition Netplay.cs:487
static bool portForwardOpen
Definition Netplay.cs:561
static string ServerIPText
Definition Netplay.cs:528
static bool IsListening
Definition Netplay.cs:537
static void ServerLoopUpdateFrame()
Definition Netplay.cs:408
const int NetBufferSize
Definition Netplay.cs:582
static int GetSectionY(int y)
Definition Netplay.cs:493
static string BanFilePath
Definition Netplay.cs:510
static void OpenPort()
Definition Netplay.cs:48
static Netplay()
Definition Netplay.cs:505
static ManagedThread broadcastThread
Definition Netplay.cs:576
static string ServerPassword
Definition Netplay.cs:513
static void ClientLoopFrameUpdate()
Definition Netplay.cs:291
static bool clientLoopRunning
Definition Netplay.cs:570
static bool StartListening()
Definition Netplay.cs:345
static int ListenPort
Definition Netplay.cs:531
static void AddBan(int plr)
Definition Netplay.cs:98
static DateTime LastClientUpdateTime
Definition Netplay.cs:567
static void OnConnectionAccepted(int clientId)
Definition Netplay.cs:335
static void StopBroadCasting()
Definition Netplay.cs:397
static void StartServer()
Definition Netplay.cs:461
static void ClientUpdateFrame()
Definition Netplay.cs:242
static RemoteConnection Connection
Definition Netplay.cs:519
static void TcpLocalClientLoop(object threadContext)
Definition Netplay.cs:176
static void ClientServerLoopSetup(RemoteAddress address)
Definition Netplay.cs:208
static UdpClient BroadcastClient
Definition Netplay.cs:573
static void StartBroadCasting()
Definition Netplay.cs:380
static bool SetRemoteIP(string remoteAddress)
Definition Netplay.cs:466
static void AddCurrentServerToRecentList()
Definition Netplay.cs:119
static void Log(object message)
Definition Debug.cs:51
static void LogError(object message)
Definition Debug.cs:62
static PlatformUser CurrentUser
static DateTime Now
Definition DateTime.cs:530