2023-04-03 11:04:31 +08:00

59 lines
2.5 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace BF
{
/// <summary>
/// SocketError -1 ~ 11004,
/// our custom error code start with 20000
/// </summary>
public static class NetErrorCode
{
//SocketError -1 ~ 11004
//our custom error code from 20000
/// <summary>
/// 抛出未知异常收到此消息可以调用NetClient.Close()断开当前连接
/// </summary>
public const int ExceptionError = 20000;
/// <summary>
/// 第一次创建连接时socket连接失败收到此消息调用NetClient.Close()断开当前连接
/// </summary>
public const int ConnectFailed = 20010;
/// <summary>
/// 接受socket数据的buffer出错项目可以根据是否容忍部分数据出错做处理重新登录或忽略
/// </summary>
public const int ReceiveBufferError = 20001;
/// <summary>
/// socket发送数据出错不包含socket error项目可以根据是否容忍部分数据出错做处理重新登录或忽略
/// </summary>
public const int BeginSendError = 20002;
/// <summary>
/// Disconnect really, please application layer close and reconnect
/// </summary>
public const int PeerDisconnect = 20003;
/// <summary>
/// 如果项目不允许接受/发送数据解析失败监听此消息调用NetClient.Close()断开当前连接
/// </summary>
public const int DataParseError = 20004;
/// <summary>
/// 创建连接阶段,域名解析错误,应该直接断开连接
/// </summary>
public const int DNSParseDomainNameError = 20005;
/// <summary>
/// 连接超时
/// </summary>
//public const int PeerConnectTimeout = 20006;
/// <summary>
/// 服务器拒绝客户端的重连请求,需要关闭连接,重新登录
/// </summary>
public const int ServerRefuseReconnect = 20007;
/// <summary>
/// 服务端需要强制踢玩家下线时会向客户端发送该消息客户端在收到该消息时应该主动断开tcp连接
/// </summary>
public const int ServerKickNtfClient = 20008;
/// <summary>
/// 其他人登陆同角色时,老的连接会收到挤号消息并主动断开连接。客户端在收到该消息后应提示玩家并返回登陆界面
/// </summary>
public const int OtherDeviceLogin = 20009;
}
}