Пример #1
0
        /// <summary>
        /// 填充网络错误事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>网络错误事件。</returns>
        public NetworkErrorEventArgs Fill(GameFramework.Network.NetworkErrorEventArgs e)
        {
            NetworkChannel = e.NetworkChannel;
            ErrorCode      = e.ErrorCode;
            ErrorMessage   = e.ErrorMessage;

            return(this);
        }
Пример #2
0
        /// <summary>
        /// 创建网络错误事件。
        /// </summary>
        /// <param name="networkChannel">网络频道。</param>
        /// <param name="errorCode">错误码。</param>
        /// <param name="socketErrorCode">Socket 错误码。</param>
        /// <param name="errorMessage">错误信息。</param>
        /// <returns>创建的网络错误事件。</returns>
        public static NetworkErrorEventArgs Create(INetworkChannel networkChannel, NetworkErrorCode errorCode, SocketError socketErrorCode, string errorMessage)
        {
            NetworkErrorEventArgs networkErrorEventArgs = ReferencePool.Acquire <NetworkErrorEventArgs>();

            networkErrorEventArgs.NetworkChannel  = networkChannel;
            networkErrorEventArgs.ErrorCode       = errorCode;
            networkErrorEventArgs.SocketErrorCode = socketErrorCode;
            networkErrorEventArgs.ErrorMessage    = errorMessage;
            return(networkErrorEventArgs);
        }
Пример #3
0
        /// <summary>
        /// 创建网络错误事件。
        /// </summary>
        /// <param name="e">内部事件。</param>
        /// <returns>创建的网络错误事件。</returns>
        public static NetworkErrorEventArgs Create(GameFramework.Network.NetworkErrorEventArgs e)
        {
            NetworkErrorEventArgs networkErrorEventArgs = ReferencePool.Acquire <NetworkErrorEventArgs>();

            networkErrorEventArgs.NetworkChannel  = e.NetworkChannel;
            networkErrorEventArgs.ErrorCode       = e.ErrorCode;
            networkErrorEventArgs.SocketErrorCode = e.SocketErrorCode;
            networkErrorEventArgs.ErrorMessage    = e.ErrorMessage;
            return(networkErrorEventArgs);
        }
Пример #4
0
 private void OnNetworkChannelError(NetworkChannelBase networkChannel, NetworkErrorCode errorCode, SocketError socketErrorCode, string errorMessage)
 {
     if (m_NetworkErrorEventHandler != null)
     {
         lock (m_NetworkErrorEventHandler)
         {
             NetworkErrorEventArgs networkErrorEventArgs = NetworkErrorEventArgs.Create(networkChannel, errorCode, socketErrorCode, errorMessage);
             m_NetworkErrorEventHandler(this, networkErrorEventArgs);
             ReferencePool.Release(networkErrorEventArgs);
         }
     }
 }
Пример #5
0
 private void OnNetworkError(object sender, GameFramework.Network.NetworkErrorEventArgs e)
 {
     m_EventComponent.Fire(this, NetworkErrorEventArgs.Create(e));
 }
Пример #6
0
 private void OnNetworkError(object sender, GameFramework.Network.NetworkErrorEventArgs e)
 {
     this.m_EventComponent.Fire(this, ReferencePool.Acquire <NetworkErrorEventArgs>().Fill(e));
 }
Пример #7
0
 private void OnNetworkError(object sender, GameFramework.Network.NetworkErrorEventArgs e)
 {
     Log.Warning(e.ErrorMessage);
     m_EventComponent.Fire(this, ReferencePool.Acquire <NetworkErrorEventArgs>().Fill(e));
 }
Пример #8
0
 /// <summary>
 /// 初始化网络错误事件的新实例。
 /// </summary>
 /// <param name="e">内部事件。</param>
 public NetworkErrorEventArgs(GameFramework.Network.NetworkErrorEventArgs e)
 {
     NetworkChannel = e.NetworkChannel;
     ErrorCode      = e.ErrorCode;
     ErrorMessage   = e.ErrorMessage;
 }