ConnectToNetworkPeer() public static method

public static ConnectToNetworkPeer ( int hostId, string address, int port, int exceptionConnectionId, int relaySlotId, NetworkID network, SourceID source, NodeID node, byte &error ) : int
hostId int
address string
port int
exceptionConnectionId int
relaySlotId int
network NetworkID
source SourceID
node NodeID
error byte
return int
コード例 #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);
            }
        }
コード例 #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));
        }
コード例 #3
0
 public static int ConnectToNetworkPeer(int hostId, string address, int port, int exceptionConnectionId, int relaySlotId, NetworkID network, SourceID source, NodeID node, out byte error)
 {
     return(NetworkTransport.ConnectToNetworkPeer(hostId, address, port, exceptionConnectionId, relaySlotId, network, source, node, 0, 0.0f, out error));
 }