コード例 #1
0
        private void Update()
        {
            if (this.mState == MyPhoton.MyState.NOP)
            {
                return;
            }
            NetworkReachability internetReachability = Application.get_internetReachability();

            if (this.mState != MyPhoton.MyState.NOP && internetReachability != this.mNetworkReach && this.mNetworkReach != null)
            {
                this.LogWarning("internet reach change to " + (object)internetReachability + "\n" + this.GetTrafficState());
            }
            this.mNetworkReach = internetReachability;
            if (this.mState != MyPhoton.MyState.ROOM)
            {
                this.mDelaySec          = -1f;
                this.mSendRoomMessageID = 0;
            }
            else if ((double)(SupportClass.GetTickCount() - PhotonNetwork.networkingPeer.get_TimestampOfLastSocketReceive()) < (double)this.TimeOutSec * 1000.0)
            {
                this.mDelaySec = -1f;
            }
            else
            {
                if ((double)this.mDelaySec < 0.0)
                {
                    this.mDelaySec = 0.0f;
                    this.LogWarning(PhotonNetwork.NetworkStatisticsToString() + "\n" + this.GetTrafficState());
                }
                this.mDelaySec += Time.get_deltaTime();
                if ((double)this.mDelaySec < (double)this.TimeOutSec)
                {
                    return;
                }
                this.LogWarning("maybe connection lost.");
                this.LogWarning(PhotonNetwork.NetworkStatisticsToString() + "\n" + this.GetTrafficState());
                this.Disconnect();
                this.mError = MyPhoton.MyError.TIMEOUT2;
            }
        }
コード例 #2
0
 public string GetTrafficState()
 {
     return("lastrecv:" + (object)(SupportClass.GetTickCount() - PhotonNetwork.networkingPeer.get_TimestampOfLastSocketReceive()) + " og:" + PhotonNetwork.networkingPeer.get_TrafficStatsOutgoing().ToString() + " ic:" + PhotonNetwork.networkingPeer.get_TrafficStatsIncoming().ToString());
 }