217 lines
5.8 KiB
C#
217 lines
5.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading;
|
|
|
|
namespace ExitGames.Client.Photon
|
|
{
|
|
// Token: 0x02000037 RID: 55
|
|
public class NetworkSimulationSet
|
|
{
|
|
// Token: 0x17000076 RID: 118
|
|
// (get) Token: 0x06000253 RID: 595 RVA: 0x00013108 File Offset: 0x00011308
|
|
// (set) Token: 0x06000254 RID: 596 RVA: 0x00013120 File Offset: 0x00011320
|
|
protected internal bool IsSimulationEnabled
|
|
{
|
|
get
|
|
{
|
|
return this.isSimulationEnabled;
|
|
}
|
|
set
|
|
{
|
|
ManualResetEvent netSimManualResetEvent = this.NetSimManualResetEvent;
|
|
lock (netSimManualResetEvent)
|
|
{
|
|
bool flag = value == this.isSimulationEnabled;
|
|
if (!flag)
|
|
{
|
|
bool flag2 = !value;
|
|
if (flag2)
|
|
{
|
|
LinkedList<SimulationItem> netSimListIncoming = this.peerBase.NetSimListIncoming;
|
|
lock (netSimListIncoming)
|
|
{
|
|
bool flag3 = this.peerBase.rt != null && this.peerBase.rt.Connected;
|
|
if (flag3)
|
|
{
|
|
foreach (SimulationItem simulationItem in this.peerBase.NetSimListIncoming)
|
|
{
|
|
this.peerBase.ReceiveIncomingCommands(simulationItem.DelayedData, simulationItem.DelayedData.Length);
|
|
}
|
|
}
|
|
this.peerBase.NetSimListIncoming.Clear();
|
|
}
|
|
LinkedList<SimulationItem> netSimListOutgoing = this.peerBase.NetSimListOutgoing;
|
|
lock (netSimListOutgoing)
|
|
{
|
|
bool flag4 = this.peerBase.rt != null && this.peerBase.rt.Connected;
|
|
if (flag4)
|
|
{
|
|
foreach (SimulationItem simulationItem2 in this.peerBase.NetSimListOutgoing)
|
|
{
|
|
this.peerBase.rt.Send(simulationItem2.DelayedData, simulationItem2.DelayedData.Length);
|
|
}
|
|
}
|
|
this.peerBase.NetSimListOutgoing.Clear();
|
|
}
|
|
}
|
|
this.isSimulationEnabled = value;
|
|
bool flag5 = this.isSimulationEnabled;
|
|
if (flag5)
|
|
{
|
|
bool flag6 = this.netSimThread == null;
|
|
if (flag6)
|
|
{
|
|
this.netSimThread = new Thread(new ThreadStart(this.peerBase.NetworkSimRun));
|
|
this.netSimThread.IsBackground = true;
|
|
this.netSimThread.Name = "netSim" + SupportClass.GetTickCount();
|
|
this.netSimThread.Start();
|
|
}
|
|
this.NetSimManualResetEvent.Set();
|
|
}
|
|
else
|
|
{
|
|
this.NetSimManualResetEvent.Reset();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000077 RID: 119
|
|
// (get) Token: 0x06000255 RID: 597 RVA: 0x000133E0 File Offset: 0x000115E0
|
|
// (set) Token: 0x06000256 RID: 598 RVA: 0x000133F8 File Offset: 0x000115F8
|
|
public int OutgoingLag
|
|
{
|
|
get
|
|
{
|
|
return this.outgoingLag;
|
|
}
|
|
set
|
|
{
|
|
this.outgoingLag = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000078 RID: 120
|
|
// (get) Token: 0x06000257 RID: 599 RVA: 0x00013404 File Offset: 0x00011604
|
|
// (set) Token: 0x06000258 RID: 600 RVA: 0x0001341C File Offset: 0x0001161C
|
|
public int OutgoingJitter
|
|
{
|
|
get
|
|
{
|
|
return this.outgoingJitter;
|
|
}
|
|
set
|
|
{
|
|
this.outgoingJitter = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x17000079 RID: 121
|
|
// (get) Token: 0x06000259 RID: 601 RVA: 0x00013428 File Offset: 0x00011628
|
|
// (set) Token: 0x0600025A RID: 602 RVA: 0x00013440 File Offset: 0x00011640
|
|
public int OutgoingLossPercentage
|
|
{
|
|
get
|
|
{
|
|
return this.outgoingLossPercentage;
|
|
}
|
|
set
|
|
{
|
|
this.outgoingLossPercentage = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007A RID: 122
|
|
// (get) Token: 0x0600025B RID: 603 RVA: 0x0001344C File Offset: 0x0001164C
|
|
// (set) Token: 0x0600025C RID: 604 RVA: 0x00013464 File Offset: 0x00011664
|
|
public int IncomingLag
|
|
{
|
|
get
|
|
{
|
|
return this.incomingLag;
|
|
}
|
|
set
|
|
{
|
|
this.incomingLag = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007B RID: 123
|
|
// (get) Token: 0x0600025D RID: 605 RVA: 0x00013470 File Offset: 0x00011670
|
|
// (set) Token: 0x0600025E RID: 606 RVA: 0x00013488 File Offset: 0x00011688
|
|
public int IncomingJitter
|
|
{
|
|
get
|
|
{
|
|
return this.incomingJitter;
|
|
}
|
|
set
|
|
{
|
|
this.incomingJitter = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007C RID: 124
|
|
// (get) Token: 0x0600025F RID: 607 RVA: 0x00013494 File Offset: 0x00011694
|
|
// (set) Token: 0x06000260 RID: 608 RVA: 0x000134AC File Offset: 0x000116AC
|
|
public int IncomingLossPercentage
|
|
{
|
|
get
|
|
{
|
|
return this.incomingLossPercentage;
|
|
}
|
|
set
|
|
{
|
|
this.incomingLossPercentage = value;
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007D RID: 125
|
|
// (get) Token: 0x06000261 RID: 609 RVA: 0x000134B6 File Offset: 0x000116B6
|
|
// (set) Token: 0x06000262 RID: 610 RVA: 0x000134BE File Offset: 0x000116BE
|
|
public int LostPackagesOut { get; internal set; }
|
|
|
|
// Token: 0x1700007E RID: 126
|
|
// (get) Token: 0x06000263 RID: 611 RVA: 0x000134C7 File Offset: 0x000116C7
|
|
// (set) Token: 0x06000264 RID: 612 RVA: 0x000134CF File Offset: 0x000116CF
|
|
public int LostPackagesIn { get; internal set; }
|
|
|
|
// Token: 0x06000265 RID: 613 RVA: 0x000134D8 File Offset: 0x000116D8
|
|
public override string ToString()
|
|
{
|
|
return string.Format("NetworkSimulationSet {6}. Lag in={0} out={1}. Jitter in={2} out={3}. Loss in={4} out={5}.", new object[] { this.incomingLag, this.outgoingLag, this.incomingJitter, this.outgoingJitter, this.incomingLossPercentage, this.outgoingLossPercentage, this.IsSimulationEnabled });
|
|
}
|
|
|
|
// Token: 0x04000155 RID: 341
|
|
private bool isSimulationEnabled = false;
|
|
|
|
// Token: 0x04000156 RID: 342
|
|
private int outgoingLag = 100;
|
|
|
|
// Token: 0x04000157 RID: 343
|
|
private int outgoingJitter = 0;
|
|
|
|
// Token: 0x04000158 RID: 344
|
|
private int outgoingLossPercentage = 1;
|
|
|
|
// Token: 0x04000159 RID: 345
|
|
private int incomingLag = 100;
|
|
|
|
// Token: 0x0400015A RID: 346
|
|
private int incomingJitter = 0;
|
|
|
|
// Token: 0x0400015B RID: 347
|
|
private int incomingLossPercentage = 1;
|
|
|
|
// Token: 0x0400015C RID: 348
|
|
internal PeerBase peerBase;
|
|
|
|
// Token: 0x0400015D RID: 349
|
|
private Thread netSimThread;
|
|
|
|
// Token: 0x0400015E RID: 350
|
|
public readonly ManualResetEvent NetSimManualResetEvent = new ManualResetEvent(false);
|
|
}
|
|
}
|