LostHostOnClient() public method

This should be called on a client when it has lost its connection to the host.

public LostHostOnClient ( NetworkConnection conn ) : bool
conn NetworkConnection The connection of the client that was connected to the host.
return bool
コード例 #1
0
        internal void OnClientDisconnectInternal(NetworkMessage netMsg)
        {
            if (LogFilter.logDebug)
            {
                Debug.Log("NetworkManager:OnClientDisconnectInternal");
            }

#if ENABLE_UNET_HOST_MIGRATION
            if (m_MigrationManager != null)
            {
                if (m_MigrationManager.LostHostOnClient(netMsg.conn))
                {
                    // should OnClientDisconnect be called?
                    return;
                }
            }
#endif

            if (m_OfflineScene != "")
            {
                //ClientChangeScene(m_OfflineScene, false);
            }

            // If we have a valid connection here drop the client in the matchmaker before shutting down below
            if (matchMaker != null && matchInfo != null && matchInfo.networkId != NetworkID.Invalid && matchInfo.nodeId != NodeID.Invalid)
            {
                matchMaker.DropConnection(matchInfo.networkId, matchInfo.nodeId, matchInfo.domain, OnDropConnection);
            }

            OnClientDisconnect(netMsg.conn);
        }
コード例 #2
0
 internal void OnClientDisconnectInternal(NetworkMessage netMsg)
 {
     if (LogFilter.logDebug)
     {
         Debug.Log("NetworkManager:OnClientDisconnectInternal");
     }
     if (!(m_MigrationManager != null) || !m_MigrationManager.LostHostOnClient(netMsg.conn))
     {
         if (!string.IsNullOrEmpty(m_OfflineScene))
         {
             ClientChangeScene(m_OfflineScene, forceReload: false);
         }
         if (matchMaker != null && matchInfo != null && matchInfo.networkId != NetworkID.Invalid && matchInfo.nodeId != 0)
         {
             matchMaker.DropConnection(matchInfo.networkId, matchInfo.nodeId, matchInfo.domain, OnDropConnection);
         }
         OnClientDisconnect(netMsg.conn);
     }
 }
コード例 #3
0
        internal void OnClientDisconnectInternal(NetworkMessage netMsg)
        {
            if (LogFilter.logDebug)
            {
                Debug.Log("NetworkManager:OnClientDisconnectInternal");
            }

#if ENABLE_UNET_HOST_MIGRATION
            if (m_MigrationManager != null)
            {
                if (m_MigrationManager.LostHostOnClient(netMsg.conn))
                {
                    // should OnClientDisconnect be called?
                    return;
                }
            }
#endif

            if (m_OfflineScene != "")
            {
                ClientChangeScene(m_OfflineScene, false);
            }
            OnClientDisconnect(netMsg.conn);
        }