private void OnNetworkError(object sender, GameEventArgs e) { UnityGameFramework.Runtime.NetworkErrorEventArgs ne = (UnityGameFramework.Runtime.NetworkErrorEventArgs)e; Log.Info("Network channel '{0}' error, error code is '{1}', error message is '{2}'.", ne.NetworkChannel.Name, ne.ErrorCode.ToString(), ne.ErrorMessage); ne.NetworkChannel.Close(); }
private void OnNetworkError(object sender, GameFramework.Event.GameEventArgs e) { UnityGameFramework.Runtime.NetworkErrorEventArgs ne = (UnityGameFramework.Runtime.NetworkErrorEventArgs)e; if (ne.NetworkChannel != m_NetworkChannel) { return; } Log.Error("Network Packet {0} Error : {1}.", ne.Id, ne.ErrorMessage); }
/// <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); }
private void OnNetworkError(object sender, GameFramework.Network.NetworkErrorEventArgs e) { m_EventComponent.Fire(this, NetworkErrorEventArgs.Create(e)); }