UnityEngine.Networking.NetworkMigrationManager.LostHostOnHost C# (CSharp) Method

LostHostOnHost() public method

This should be called on a host when it has has been shutdown.

public LostHostOnHost ( ) : void
return void
        public void LostHostOnHost()
        {
            if (LogFilter.logDebug)
            {
                Debug.Log("NetworkMigrationManager LostHostOnHost");
            }
            if (Application.platform == RuntimePlatform.WebGLPlayer)
            {
                if (LogFilter.logError)
                {
                    Debug.LogError("LostHostOnHost: Host migration not supported on WebGL");
                }
            }
            else
            {
                this.OnServerHostShutdown();
                if (this.m_Peers == null)
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("NetworkMigrationManager LostHostOnHost no peers");
                    }
                }
                else if (this.m_Peers.Length != 1)
                {
                    this.m_HostWasShutdown = true;
                }
            }
        }

Usage Example

コード例 #1
0
        public void StopHost()
        {
            bool active = NetworkServer.active;

            OnStopHost();
            StopServer();
            StopClient();
            if (m_MigrationManager != null && active)
            {
                m_MigrationManager.LostHostOnHost();
            }
        }
All Usage Examples Of UnityEngine.Networking.NetworkMigrationManager::LostHostOnHost