NetworkStatisticsToString() public static method

Only available when NetworkStatisticsEnabled was used to gather some stats.
public static NetworkStatisticsToString ( ) : string
return string
Ejemplo n.º 1
0
 public void LogStats()
 {
     if (this.LogTrafficStats)
     {
         Debug.Log("SupportLogger " + PhotonNetwork.NetworkStatisticsToString());
     }
 }
 // Token: 0x0600C2B8 RID: 49848 RVA: 0x0046DD14 File Offset: 0x0046BF14
 public void ANKNFCMMJHD()
 {
     if (this.LogTrafficStats)
     {
         Debug.Log("<command>" + PhotonNetwork.NetworkStatisticsToString());
     }
 }
Ejemplo n.º 3
0
    private void OnGUI()
    {
        //接続状態及びリージョンの表示
        string region = PhotonNetwork.CloudRegion ?? "";

        GUILayout.Label(PhotonNetwork.NetworkStatisticsToString() + "\n" + region, uStyle);
    }
 // Token: 0x0600C2C6 RID: 49862 RVA: 0x0046DF1D File Offset: 0x0046C11D
 public void EAGBMGICBHE()
 {
     if (this.LogTrafficStats)
     {
         Debug.Log("_BlurVector" + PhotonNetwork.NetworkStatisticsToString());
     }
 }
 // Token: 0x0600C2C2 RID: 49858 RVA: 0x0046DE3D File Offset: 0x0046C03D
 public void MIEMJDALBCF()
 {
     if (this.LogTrafficStats)
     {
         Debug.Log("_Value3" + PhotonNetwork.NetworkStatisticsToString());
     }
 }
Ejemplo n.º 6
0
 public void LogStats()
 {
     if (!this.LogTrafficStats)
     {
         return;
     }
     Debug.Log((object)("SupportLogger " + PhotonNetwork.NetworkStatisticsToString()));
 }
    /// <summary>
    /// the function will try to connect to the photon network,
    /// </summary>
    private void Connect()
    {
        // we check if we are connected or not,
        if (PhotonNetwork.IsConnected)
        {
            // reset connection
            PhotonNetwork.Disconnect();
        }

        PhotonNetwork.ConnectUsingSettings();
        PhotonNetwork.GameVersion = gameVersion;
        Debug.Log(PhotonNetwork.NetworkStatisticsToString());

        // Expecting OnConnectedToMaster while in this state
        this.state = ConnectionState.CONNECTING;
    }
Ejemplo n.º 8
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;
            }
        }
Ejemplo n.º 9
0
        public void PhotonWindowCallback(int windowID)
        {
            try {
                GUILayout.Label($"State: {PhotonNetwork.NetworkClientState}");

                if (GUILayout.Button("Toggle Offline Mode"))
                {
                    PhotonNetwork.OfflineMode = !PhotonNetwork.OfflineMode;
                }

                if (PhotonNetwork.IsConnected && GUILayout.Button("Disconnect"))
                {
                    PhotonNetwork.Disconnect();
                }

                if (!PhotonNetwork.IsConnected && GUILayout.Button("Reconnect to Photon Cloud"))
                {
                    //_hostedMode = false;
                    PhotonNetwork.OfflineMode = false;
                    FindObjectOfType <SteamAuth>().ConnectViaSteamAuthenticator();
                }

                /*
                 * _hostedMode = GUILayout.Toggle(_hostedMode, "Use Custom Photon Network");
                 *
                 * if (_hostedMode && !PhotonNetwork.connected && !PhotonNetwork.connecting) {
                 * GUILayout.Label("Server Address:");
                 * PhotonNetwork.PhotonServerSettings.ServerAddress
                 *  = GUILayout.TextField(PhotonNetwork.PhotonServerSettings.ServerAddress);
                 * GUILayout.Label("Server Port:");
                 * PhotonNetwork.PhotonServerSettings.ServerPort
                 *  = ushort.TryParse(GUILayout.TextField(
                 *    PhotonNetwork.PhotonServerSettings.ServerPort.ToString()), out var serverPort)
                 *    ? serverPort
                 *    : 5055;
                 * GUILayout.Label("Voice Server Port:");
                 * PhotonNetwork.PhotonServerSettings.VoiceServerPort
                 *  = ushort.TryParse(GUILayout.TextField(
                 *    PhotonNetwork.PhotonServerSettings.VoiceServerPort.ToString()), out var voiceServerPort)
                 *    ? voiceServerPort
                 *    : 5055;
                 * if (!PhotonNetwork.offlineMode && !PhotonNetwork.connected && !PhotonNetwork.connecting) {
                 *  if (GUILayout.Button("Connect")) {
                 *    PhotonNetwork.offlineMode = false;
                 *    PhotonNetwork.PhotonServerSettings.HostType = ServerSettings.HostingOption.SelfHosted;
                 *    PhotonNetwork.PhotonServerSettings.PunLogging = PhotonLogLevel.Full;
                 *    PhotonNetwork.PhotonServerSettings.NetworkLogging = DebugLevel.ALL;
                 *    FindObjectOfType<SteamAuth>().ConnectViaSteamAuthenticator();
                 *  }
                 * }
                 * }
                 */

                GUILayout.BeginHorizontal();
                GUILayout.Label("Network Stats");
                var statsStr = PhotonNetwork.NetworkStatisticsToString()
                               .Replace(". ", ".\n");
                var boxMaxWidth = 500;
                var height      = GUI.skin.box.CalcHeight(new GUIContent(statsStr), boxMaxWidth);
                GUILayout.Box(
                    statsStr,
                    GUILayout.Width(boxMaxWidth),
                    GUILayout.Height(height)
                    );
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Reset Stats"))
                {
                    PhotonNetwork.NetworkStatisticsReset();
                }
                GUILayout.EndHorizontal();

                if (GUI.changed)
                {
                    photonWindowRect.height = 100f;
                }
            }
            catch {
                // ok
            }

            GUI.DragWindow();
        }
Ejemplo n.º 10
0
 // Update is called once per frame
 void Update() => stausText.text = PhotonNetwork.NetworkStatisticsToString();