ConnectAsNetworkHost() private method

private ConnectAsNetworkHost ( int hostId, string address, int port, NetworkID network, SourceID source, NodeID node, byte &error ) : void
hostId int
address string
port int
network NetworkID
source SourceID
node NodeID
error byte
return void
Esempio n. 1
0
        public void ListenRelay(string relayIp, int relayPort, NetworkID netGuid, SourceID sourceId, NodeID nodeId)
        {
            Initialize();

            m_ServerHostId = NetworkTransport.AddHost(m_HostTopology, listenPort);
            if (LogFilter.logDebug)
            {
                Debug.Log("Server Host Slot Id: " + m_ServerHostId);
            }

            Update();

            byte error;

            NetworkTransport.ConnectAsNetworkHost(
                m_ServerHostId,
                relayIp,
                relayPort,
                netGuid,
                sourceId,
                nodeId,
                out error);

            m_RelaySlotId = 0;
            if (LogFilter.logDebug)
            {
                Debug.Log("Relay Slot Id: " + m_RelaySlotId);
            }
        }
        /// <summary>
        /// <para>Starts a server using a Relay server. This is the manual way of using the Relay server, as the regular NetworkServer.Connect() will automatically use the Relay server if a match exists.</para>
        /// </summary>
        /// <param name="relayIp">Relay server IP Address.</param>
        /// <param name="relayPort">Relay server port.</param>
        /// <param name="netGuid">GUID of the network to create.</param>
        /// <param name="sourceId">This server's sourceId.</param>
        /// <param name="nodeId">The node to join the network with.</param>
        public void ListenRelay(string relayIp, int relayPort, NetworkID netGuid, SourceID sourceId, NodeID nodeId)
        {
            byte num;

            this.Initialize();
            this.m_ServerHostId = NetworkTransport.AddHost(this.m_HostTopology, this.listenPort);
            if (LogFilter.logDebug)
            {
                Debug.Log("Server Host Slot Id: " + this.m_ServerHostId);
            }
            this.Update();
            NetworkTransport.ConnectAsNetworkHost(this.m_ServerHostId, relayIp, relayPort, netGuid, sourceId, nodeId, out num);
            this.m_RelaySlotId = 0;
            if (LogFilter.logDebug)
            {
                Debug.Log("Relay Slot Id: " + this.m_RelaySlotId);
            }
        }
 public void ConnectAsNetworkHost(int hostId, string address, int port, NetworkID network, SourceID source, NodeID node, out byte error)
 {
     NetworkTransport.ConnectAsNetworkHost(hostId, address, port, network, source, node, out error);
 }