GetSourceID() public static method

Utility function to get the client's SourceID for unique identification.

public static GetSourceID ( ) : SourceID
return SourceID
Esempio n. 1
0
        void ConnectWithRelay(MatchInfo info)
        {
            m_AsyncConnect = ConnectState.Connecting;

            Update();

            byte error;

            m_ClientConnectionId = NetworkTransport.ConnectToNetworkPeer(
                m_ClientId,
                info.address,
                info.port,
                0,
                0,
                info.networkId,
                Utility.GetSourceID(),
                info.nodeId,
                out error);

            m_Connection = (NetworkConnection)Activator.CreateInstance(m_NetworkConnectionClass);
            m_Connection.SetHandlers(m_MessageHandlers);
            m_Connection.Initialize(info.address, m_ClientId, m_ClientConnectionId, m_HostTopology);

            if (error != 0)
            {
                Debug.LogError("ConnectToNetworkPeer Error: " + error);
            }
        }
Esempio n. 2
0
        private void ConnectWithRelay(MatchInfo info)
        {
            this.m_AsyncConnect = NetworkClient.ConnectState.Connecting;
            this.Update();
            byte error;

            this.m_ClientConnectionId = NetworkTransport.ConnectToNetworkPeer(this.m_ClientId, info.address, info.port, 0, 0, info.networkId, Utility.GetSourceID(), info.nodeId, out error);
            this.m_Connection         = (NetworkConnection)Activator.CreateInstance(this.m_NetworkConnectionClass);
            this.m_Connection.SetHandlers(this.m_MessageHandlers);
            this.m_Connection.Initialize(info.address, this.m_ClientId, this.m_ClientConnectionId, this.m_HostTopology);
            if ((int)error == 0)
            {
                return;
            }
            Debug.LogError((object)("ConnectToNetworkPeer Error: " + (object)error));
        }