ErrorCode.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. namespace ETModel
  2. {
  3. public static class ErrorCode
  4. {
  5. public const int ERR_Success = 0;
  6. // 1-11004 是SocketError请看SocketError定义
  7. //-----------------------------------
  8. // 100000 以上,避免跟SocketError冲突
  9. public const int ERR_MyErrorCode = 100000;
  10. public const int ERR_NotFoundActor = 100002;
  11. public const int ERR_ActorNoMailBoxComponent = 100003;
  12. public const int ERR_ActorRemove = 100004;
  13. public const int ERR_PacketParserError = 100005;
  14. public const int ERR_ConnectGateKeyError = 100006;
  15. public const int ERR_RpcFail = 102001;
  16. public const int ERR_ReloadFail = 102003;
  17. public const int ERR_ActorLocationNotFound = 102004;
  18. public const int ERR_KcpCantConnect = 102005;
  19. public const int ERR_KcpChannelTimeout = 102006;
  20. public const int ERR_KcpRemoteDisconnect = 102007;
  21. public const int ERR_PeerDisconnect = 102008;
  22. public const int ERR_SocketCantSend = 102009;
  23. public const int ERR_SocketError = 102010;
  24. public const int ERR_KcpWaitSendSizeTooLarge = 102011;
  25. public const int ERR_ActorNotOnline = 102012;
  26. public const int ERR_ActorTimeout = 102013;
  27. public const int ERR_SessionSendOrRecvTimeout = 102014;
  28. public const int ERR_WebsocketPeerReset = 103001;
  29. public const int ERR_WebsocketMessageTooBig = 103002;
  30. public const int ERR_WebsocketError = 103003;
  31. public const int ERR_WebsocketConnectError = 103004;
  32. public const int ERR_WebsocketSendError = 103005;
  33. public const int ERR_WebsocketRecvError = 103006;
  34. //-----------------------------------
  35. // 小于这个Rpc会抛异常,大于这个异常的error需要自己判断处理,也就是说需要处理的错误应该要大于该值
  36. public const int ERR_Exception = 200000;
  37. public const int ERR_AccountOrPasswordError = 200102;
  38. //-----------------------------------
  39. public static bool IsRpcNeedThrowException(int error)
  40. {
  41. if (error == 0)
  42. {
  43. return false;
  44. }
  45. if (error > ERR_Exception)
  46. {
  47. return false;
  48. }
  49. return true;
  50. }
  51. }
  52. }