ErrorCode.cs 1.7 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. // 100000 以上,避免跟SocketError冲突
  8. public const int ERR_MyErrorCode = 100000;
  9. // 小于这个Rpc会抛异常
  10. public const int ERR_Exception = 200000;
  11. public const int ERR_NotFoundActor = 200002;
  12. public const int ERR_ActorNoMailBoxComponent = 200003;
  13. public const int ERR_ActorRemove = 200004;
  14. public const int ERR_PacketParserError = 200005;
  15. public const int ERR_AccountOrPasswordError = 200102;
  16. public const int ERR_SessionActorError = 200103;
  17. public const int ERR_NotFoundUnit = 200104;
  18. public const int ERR_ConnectGateKeyError = 200105;
  19. public const int ERR_RpcFail = 202001;
  20. public const int ERR_SocketDisconnected = 202002;
  21. public const int ERR_ReloadFail = 202003;
  22. public const int ERR_ActorLocationNotFound = 202004;
  23. public const int ERR_KcpCantConnect = 202005;
  24. public const int ERR_KcpChannelTimeout = 202006;
  25. public const int ERR_KcpRemoteDisconnect = 202007;
  26. public const int ERR_PeerDisconnect = 202008;
  27. public const int ERR_SocketCantSend = 202009;
  28. public const int ERR_SocketError = 202010;
  29. public const int ERR_KcpWaitSendSizeTooLarge = 202011;
  30. public const int ERR_WebsocketPeerReset = 203001;
  31. public const int ERR_WebsocketMessageTooBig = 203002;
  32. public const int ERR_WebsocketError = 203003;
  33. public const int ERR_WebsocketConnectError = 203004;
  34. public const int ERR_WebsocketSendError = 203005;
  35. public const int ERR_WebsocketRecvError = 203006;
  36. public static bool IsRpcNeedThrowException(int error)
  37. {
  38. if (error == 0)
  39. {
  40. return false;
  41. }
  42. if (error > ERR_Exception)
  43. {
  44. return false;
  45. }
  46. return true;
  47. }
  48. }
  49. }