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