SetBroadcastCredentials() private method

private SetBroadcastCredentials ( int hostId, int key, int version, int subversion, byte &error ) : void
hostId int
key int
version int
subversion int
error byte
return void
コード例 #1
0
 public bool StartAsClient()
 {
     if (m_HostId != -1 || m_Running)
     {
         if (LogFilter.logWarn)
         {
             Debug.LogWarning("NetworkDiscovery StartAsClient already started");
         }
         return(false);
     }
     m_HostId = NetworkTransport.AddHost(m_DefaultTopology, m_BroadcastPort);
     if (m_HostId == -1)
     {
         if (LogFilter.logError)
         {
             Debug.LogError("NetworkDiscovery StartAsClient - addHost failed");
         }
         return(false);
     }
     NetworkTransport.SetBroadcastCredentials(m_HostId, m_BroadcastKey, m_BroadcastVersion, m_BroadcastSubVersion, out byte _);
     m_Running  = true;
     m_IsClient = true;
     if (LogFilter.logDebug)
     {
         Debug.Log("StartAsClient Discovery listening");
     }
     return(true);
 }
コード例 #2
0
        /// <summary>
        ///   <para>Starts listening for broadcasts messages.</para>
        /// </summary>
        /// <returns>
        ///   <para>True is able to listen.</para>
        /// </returns>
        public bool StartAsClient()
        {
            if (this.m_HostId != -1 || this.m_Running)
            {
                if (LogFilter.logWarn)
                {
                    Debug.LogWarning((object)"NetworkDiscovery StartAsClient already started");
                }
                return(false);
            }
            this.m_HostId = NetworkTransport.AddHost(this.m_DefaultTopology, this.m_BroadcastPort);
            if (this.m_HostId == -1)
            {
                if (LogFilter.logError)
                {
                    Debug.LogError((object)"NetworkDiscovery StartAsClient - addHost failed");
                }
                return(false);
            }
            byte error;

            NetworkTransport.SetBroadcastCredentials(this.m_HostId, this.m_BroadcastKey, this.m_BroadcastVersion, this.m_BroadcastSubVersion, out error);
            this.m_Running  = true;
            this.m_IsClient = true;
            if (LogFilter.logDebug)
            {
                Debug.Log((object)"StartAsClient Discovery listening");
            }
            return(true);
        }
コード例 #3
0
        public bool StartAsClient()
        {
            bool result;

            if (this.m_HostId != -1 || this.m_Running)
            {
                if (LogFilter.logWarn)
                {
                    Debug.LogWarning("NetworkDiscovery StartAsClient already started");
                }
                result = false;
            }
            else if (this.m_MsgInBuffer == null)
            {
                if (LogFilter.logError)
                {
                    Debug.LogError("NetworkDiscovery StartAsClient, NetworkDiscovery is not initialized");
                }
                result = false;
            }
            else
            {
                this.m_HostId = NetworkTransport.AddHost(this.m_DefaultTopology, this.m_BroadcastPort);
                if (this.m_HostId == -1)
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("NetworkDiscovery StartAsClient - addHost failed");
                    }
                    result = false;
                }
                else
                {
                    byte b;
                    NetworkTransport.SetBroadcastCredentials(this.m_HostId, this.m_BroadcastKey, this.m_BroadcastVersion, this.m_BroadcastSubVersion, out b);
                    this.m_Running  = true;
                    this.m_IsClient = true;
                    if (LogFilter.logDebug)
                    {
                        Debug.Log("StartAsClient Discovery listening");
                    }
                    result = true;
                }
            }
            return(result);
        }
コード例 #4
0
 public void SetBroadcastCredentials(int hostId, int key, int version, int subversion, out byte error)
 {
     NetworkTransport.SetBroadcastCredentials(hostId, key, version, subversion, out error);
 }