Enum Class CheatingOffense

java.lang.Object
java.lang.Enum<CheatingOffense>
client.anticheat.CheatingOffense
All Implemented Interfaces:
Serializable, Comparable<CheatingOffense>, Constable

public enum CheatingOffense extends Enum<CheatingOffense>
定義所有可被伺服器偵測的作弊違規種類及其懲處參數。

每個列舉常數攜帶三個維度的配置:

  • points:本違規累計一次所增加的風險點數,供 GM 檢視摘要使用。
  • validityDuration:單筆 CheatingOffenseEntry 的有效期(毫秒), 逾期後由 CheatTrackerInvalidationTask 自動清除。
  • autobancountbantype:觸發自動處置的累計閾值與動作類型 (0 = 停用、1 = 自動封禁、2 = 強制斷線)。

違規常數涵蓋超速攻擊(FASTATTACK)、怪物移動封包異常 (MOVE_MONSTERS)、道具吸取(ITEMVAC_CLIENT)、 傷害超出上限(EXCEED_DAMAGE_CAP)等。由 CheatTracker.registerOffense(CheatingOffense) 呼叫,啟用狀態可在執行期由 setEnabled(boolean) 動態切換。

  • Enum Constant Details

  • Method Details

    • values

      public static CheatingOffense[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CheatingOffense valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPoints

      public final int getPoints()
    • getValidityDuration

      public final long getValidityDuration()
    • shouldAutoban

      public final boolean shouldAutoban(int count)
    • getBanType

      public final int getBanType()
    • setEnabled

      public final void setEnabled(boolean enabled)
    • isEnabled

      public final boolean isEnabled()