59 lines
2.5 KiB
C#
59 lines
2.5 KiB
C#
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;
|
||
}
|
||
} |