示例#1
0
        private void OnNetworkChannelConnected(NetworkChannel networkChannel, object userData)
        {
            //派发网络连接成功事件
            NetworkConnectedEventArgs e = ReferencePool.Acquire <NetworkConnectedEventArgs>();

            m_EventManager.Fire(this, e.Fill(networkChannel, userData));
        }
        private void OnNetworkConnected(object sender, GlobalEventArgs e)
        {
            NetworkConnectedEventArgs ne = (NetworkConnectedEventArgs)e;

            if (ne.NetworkChannel != m_NetworkChannel)
            {
                return;
            }

            Debug.Log(string.Format("网络频道: {0} 连接完毕, 本地地址: {1}:{2} , 远程地址 {3}:{4}", ne.NetworkChannel.Name, ne.NetworkChannel.LocalIPAddress, ne.NetworkChannel.LocalPort.ToString(), ne.NetworkChannel.RemoteIPAddress, ne.NetworkChannel.RemotePort.ToString()));
        }