/// <summary>
        /// 填充网络心跳包丢失事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>网络心跳包丢失事件。</returns>
        public NetworkMissHeartBeatEventArgs Fill(GameFramework.Network.NetworkMissHeartBeatEventArgs e)
        {
            NetworkChannel = e.NetworkChannel;
            MissCount      = e.MissCount;

            return(this);
        }
        /// <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);
        }
 private void OnNetworkChannelMissHeartBeat(NetworkChannelBase networkChannel, int missHeartBeatCount)
 {
     if (m_NetworkMissHeartBeatEventHandler != null)
     {
         lock (m_NetworkMissHeartBeatEventHandler)
         {
             NetworkMissHeartBeatEventArgs networkMissHeartBeatEventArgs = NetworkMissHeartBeatEventArgs.Create(networkChannel, missHeartBeatCount);
             m_NetworkMissHeartBeatEventHandler(this, networkMissHeartBeatEventArgs);
             ReferencePool.Release(networkMissHeartBeatEventArgs);
         }
     }
 }
Beispiel #4
0
 private void OnNetworkMissHeartBeat(object sender, GameFramework.Network.NetworkMissHeartBeatEventArgs e)
 {
     m_EventComponent.Fire(this, NetworkMissHeartBeatEventArgs.Create(e));
 }
 private void OnNetworkMissHeartBeat(object sender, GameFramework.Network.NetworkMissHeartBeatEventArgs e)
 {
     this.m_EventComponent.Fire(this, ReferencePool.Acquire <NetworkMissHeartBeatEventArgs>().Fill(e));
 }
 /// <summary>
 /// 初始化网络心跳包丢失事件的新实例。
 /// </summary>
 /// <param name="e">内部事件。</param>
 public NetworkMissHeartBeatEventArgs(GameFramework.Network.NetworkMissHeartBeatEventArgs e)
 {
     NetworkChannel = e.NetworkChannel;
     MissCount      = e.MissCount;
 }