internal virtual void InitPeerBase() { this.SerializationProtocol = SerializationProtocolFactory.Create(this.photonPeer.SerializationProtocolType); this.photonPeer.InitializeTrafficStats(); this.ByteCountLastOperation = 0; this.ByteCountCurrentDispatch = 0; this.bytesIn = 0L; this.bytesOut = 0L; this.packetLossByCrc = 0; this.packetLossByChallenge = 0; this.networkSimulationSettings.LostPackagesIn = 0; this.networkSimulationSettings.LostPackagesOut = 0; LinkedList <SimulationItem> netSimListOutgoing = this.NetSimListOutgoing; lock (netSimListOutgoing) { this.NetSimListOutgoing.Clear(); } LinkedList <SimulationItem> netSimListIncoming = this.NetSimListIncoming; lock (netSimListIncoming) { this.NetSimListIncoming.Clear(); } this.peerConnectionState = ConnectionStateValue.Disconnected; this.timeBase = SupportClass.GetTickCount(); this.isEncryptionAvailable = false; this.ApplicationIsInitialized = false; this.roundTripTime = 200; this.roundTripTimeVariance = 5; this.serverTimeOffsetIsAvailable = false; this.serverTimeOffset = 0; }
internal virtual void InitPeerBase() { this.TrafficStatsIncoming = new TrafficStats(this.TrafficPackageHeaderSize); this.TrafficStatsOutgoing = new TrafficStats(this.TrafficPackageHeaderSize); this.TrafficStatsGameLevel = new TrafficStatsGameLevel(); this.ByteCountLastOperation = 0; this.ByteCountCurrentDispatch = 0; this.bytesIn = 0L; this.bytesOut = 0L; this.packetLossByCrc = 0; this.networkSimulationSettings.LostPackagesIn = 0; this.networkSimulationSettings.LostPackagesOut = 0; lock (this.NetSimListOutgoing) { this.NetSimListOutgoing.Clear(); } lock (this.NetSimListIncoming) { this.NetSimListIncoming.Clear(); } this.peerConnectionState = ConnectionStateValue.Disconnected; this.timeBase = SupportClass.GetTickCount(); this.isEncryptionAvailable = false; this.ApplicationIsInitialized = false; this.roundTripTime = 300; this.roundTripTimeVariance = 0; this.packetThrottleInterval = 0x1388; this.serverTimeOffsetIsAvailable = false; this.serverTimeOffset = 0; }
internal void InitCallback() { if (this.peerConnectionState == ConnectionStateValue.Connecting) { this.peerConnectionState = ConnectionStateValue.Connected; } this.ApplicationIsInitialized = true; this.FetchServerTimestamp(); this.Listener.OnStatusChanged(StatusCode.Connect); }