Esempio n. 1
0
        /// <summary>
        /// 创建网络连接成功事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的网络连接成功事件。</returns>
        public static NetworkConnectedEventArgs Create(GameFramework.Network.NetworkConnectedEventArgs e)
        {
            NetworkConnectedEventArgs networkConnectedEventArgs = ReferencePool.Acquire <NetworkConnectedEventArgs>();

            networkConnectedEventArgs.NetworkChannel = e.NetworkChannel;
            networkConnectedEventArgs.UserData       = e.UserData;
            return(networkConnectedEventArgs);
        }
    private void OnNetworkConnected(object sender, GameFramework.Event.GameEventArgs e)
    {
        UnityGameFramework.Runtime.NetworkConnectedEventArgs ne = (UnityGameFramework.Runtime.NetworkConnectedEventArgs)e;
        if (ne.NetworkChannel != m_NetworkChannel)
        {
            return;
        }

        Log.Info("NetworkChannel {0} is connected. IP: {1}", ne.NetworkChannel.Name, ne.NetworkChannel.RemoteIPAddress.ToString());
    }
    private void OnNetworkConnected(object sender, GameEventArgs e)
    {
        UnityGameFramework.Runtime.NetworkConnectedEventArgs ne = (UnityGameFramework.Runtime.NetworkConnectedEventArgs)e;
        if (ne.NetworkChannel != m_NetworkChannel)
        {
            return;
        }

        Log.Info("Network channel '{0}' connected, local address '{1}', remote address '{2}'.", ne.NetworkChannel.Name, ne.NetworkChannel.Socket.LocalEndPoint.ToString(), ne.NetworkChannel.Socket.RemoteEndPoint.ToString());
    }
    private void OnNetworkConnected(object sender, GameEventArgs e)
    {
        UnityGameFramework.Runtime.NetworkConnectedEventArgs ne = (UnityGameFramework.Runtime.NetworkConnectedEventArgs)e;
        if (ne.NetworkChannel != m_NetworkChannel)
        {
            return;
        }

        //Log.Info("Network channel '{0}' connected, local address '{1}:{2}', remote address '{3}:{4}'.", ne.NetworkChannel.Name, ne.NetworkChannel.LocalIPAddress, ne.NetworkChannel.LocalPort.ToString(), ne.NetworkChannel.RemoteIPAddress, ne.NetworkChannel.RemotePort.ToString());
    }
    private void OnConnected(object sender, GameEventArgs e)
    {
        NetworkConnectedEventArgs ne = (NetworkConnectedEventArgs)e;

        // 发送消息给服务端
        //m_Channel.Send(new CSHello()
        //{
        //    Name = "服务器你好吗?",
        //});
    }
Esempio n. 6
0
        private void OnNetworkConnected(object sender, GameEventArgs e)
        {
            UnityGameFramework.Runtime.NetworkConnectedEventArgs ne = (UnityGameFramework.Runtime.NetworkConnectedEventArgs)e;
            if (ne.NetworkChannel != m_NetworkChannel)
            {
                return;
            }

            Log.Info("Network channel '{0}' connected  .", ne.NetworkChannel.Name);
        }
Esempio n. 7
0
    private void OnNetworkConnected(object sender, GameEventArgs e)
    {
        UnityGameFramework.Runtime.NetworkConnectedEventArgs ne = (UnityGameFramework.Runtime.NetworkConnectedEventArgs)e;
        if (ne.NetworkChannel != StarForce.GameEntry.Network.GetNetworkChannel("socket0"))
        {
            return;
        }

        Debug.Log("Ready to Send... =>");
        CSHeartBeat p = new CSHeartBeat();

        ne.NetworkChannel.Send <CSHeartBeat>(p);
    }
Esempio n. 8
0
 private void OnNetworkConnected(object sender, GameFramework.Network.NetworkConnectedEventArgs e)
 {
     m_EventComponent.Fire(this, NetworkConnectedEventArgs.Create(e));
 }