ErrorCode.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_ActorTimeOut = 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_WebsocketPeerReset = 203001;
  30. public const int ERR_WebsocketMessageTooBig = 203002;
  31. public const int ERR_WebsocketError = 203003;
  32. public const int ERR_WebsocketConnectError = 203004;
  33. public const int ERR_WebsocketSendError = 203005;
  34. public const int ERR_WebsocketRecvError = 203006;
  35. public static bool IsRpcNeedThrowException(int error)
  36. {
  37. if (error == 0)
  38. {
  39. return false;
  40. }
  41. if (error > ERR_Exception)
  42. {
  43. return false;
  44. }
  45. return true;
  46. }
  47. }
  48. }