ErrorCode.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 const int ERR_KcpRemoteDisconnect = 202007;
  25. public static bool IsRpcNeedThrowException(int error)
  26. {
  27. if (error == 0)
  28. {
  29. return false;
  30. }
  31. if (error > ERR_Exception)
  32. {
  33. return false;
  34. }
  35. return true;
  36. }
  37. }
  38. }