ErrorCode.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. namespace KYFramework.Network
  2. {
  3. public static class ErrorCode
  4. {
  5. public const int ERR_Success = 0;
  6. // 1-11004 是SocketError请看SocketError定义
  7. //-----------------------------------
  8. // 100000 以上,避免跟SocketError冲突
  9. public const int ERR_MyErrorCode = 100000;
  10. public const int ERR_PacketParserError = 100005;
  11. public const int ERR_PeerDisconnect = 102008;
  12. public const int ERR_SocketCantSend = 102009;
  13. public const int ERR_SocketError = 102010;
  14. public const int ERR_RpcFail = 102001;
  15. //-----------------------------------
  16. // 小于这个Rpc会抛异常,大于这个异常的error需要自己判断处理,也就是说需要处理的错误应该要大于该值
  17. public const int ERR_Exception = 200000;
  18. public const int ERR_NotFoundActor = 200002;
  19. public const int ERR_AccountOrPasswordError = 200102;
  20. //-----------------------------------
  21. public static bool IsRpcNeedThrowException(int error)
  22. {
  23. if (error == 0)
  24. {
  25. return false;
  26. }
  27. if (error > ERR_Exception)
  28. {
  29. return false;
  30. }
  31. return true;
  32. }
  33. }
  34. }