/// <summary>
        /// 创建网络心跳包丢失事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的网络心跳包丢失事件。</returns>
        public static NetworkMissHeartBeatEventArgs Create(GameFramework.Network.NetworkMissHeartBeatEventArgs e)
        {
            NetworkMissHeartBeatEventArgs networkMissHeartBeatEventArgs = ReferencePool.Acquire <NetworkMissHeartBeatEventArgs>();

            networkMissHeartBeatEventArgs.NetworkChannel = e.NetworkChannel;
            networkMissHeartBeatEventArgs.MissCount      = e.MissCount;
            return(networkMissHeartBeatEventArgs);
        }
Exemplo n.º 2
0
        private void OnNetworkMissHeartBeat(object sender, GameEventArgs e)
        {
            UnityGameFramework.Runtime.NetworkMissHeartBeatEventArgs ne = (UnityGameFramework.Runtime.NetworkMissHeartBeatEventArgs)e;
            Log.Info("Network channel '{0}' miss heart beat '{1}' times.", ne.NetworkChannel.Name, ne.MissCount.ToString());

            if (ne.MissCount < 2)
            {
                return;
            }

            ne.NetworkChannel.Close();
        }
Exemplo n.º 3
0
    private void OnNetworkMissHeartBeat(object sender, GameFramework.Event.GameEventArgs e)
    {
        UnityGameFramework.Runtime.NetworkMissHeartBeatEventArgs ne = (UnityGameFramework.Runtime.NetworkMissHeartBeatEventArgs)e;
        if (ne.NetworkChannel != m_NetworkChannel)
        {
            return;
        }

        if (ne.MissCount > 2)
        {
            ne.NetworkChannel.Close();
        }
    }
Exemplo n.º 4
0
 private void OnNetworkMissHeartBeat(object sender, GameFramework.Network.NetworkMissHeartBeatEventArgs e)
 {
     m_EventComponent.Fire(this, NetworkMissHeartBeatEventArgs.Create(e));
 }