ErrorCode.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. namespace ETModel
  2. {
  3. public static class ErrorCode
  4. {
  5. public const int ERR_Success = 0;
  6. // 100000 以上,避免跟SocketError冲突
  7. public const int ERR_MyErrorCode = 100000;
  8. // 小于这个Rpc会抛异常
  9. public const int ERR_Exception = 200000;
  10. public const int ERR_NotFoundActor = 200002;
  11. public const int ERR_ActorNoMailBoxComponent = 200003;
  12. public const int ERR_ActorTimeOut = 200004;
  13. public const int ERR_PacketParserError = 200005;
  14. public const int ERR_AccountOrPasswordError = 200102;
  15. public const int ERR_SessionActorError = 200103;
  16. public const int ERR_NotFoundUnit = 200104;
  17. public const int ERR_ConnectGateKeyError = 200105;
  18. public const int ERR_RpcFail = 202001;
  19. public const int ERR_SocketDisconnected = 202002;
  20. public const int ERR_ReloadFail = 202003;
  21. public const int ERR_ActorLocationNotFound = 202004;
  22. public const int ERR_KcpConnectFail = 202005;
  23. public const int ERR_KcpTimeout = 202006;
  24. public static bool IsRpcNeedThrowException(int error)
  25. {
  26. if (error == 0)
  27. {
  28. return false;
  29. }
  30. if (error > ERR_Exception)
  31. {
  32. return false;
  33. }
  34. return true;
  35. }
  36. }
  37. }