ErrorCode.cs 1.2 KB

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