Enum Class LogScope

All Implemented Interfaces:
Serializable, Comparable<LogScope>, Constable

public enum LogScope extends Enum<LogScope>
統一紀錄系統(_acc_char_log)的「範圍」維度:一筆計數要綁定到單一角色, 還是整個帳號(同帳號所有角色共享)。

CharacterLogManagersetLog / getLogMapleCharacter 上的同名委派使用,決定底層資料列的 char_id 欄位如何填寫:CHAR 寫入實際角色 id; ACC 寫入哨兵值 0,使同帳號所有角色共享同一筆計數。

為何 ACC 用 0 而非 NULL_acc_char_log(acc_id, char_id, scope, reset_type, event_name)UNIQUE 鍵驅動 UPSERT; MySQL 的唯一索引會把每個 NULL 視為相異,若 ACC 範圍填 NULL 則每次寫入都會 新增一列而非就地累加,UPSERT 形同失效。故以具體哨兵 0 取代。

  • Enum Constant Details

    • CHAR

      public static final LogScope CHAR
      角色為單位:計數綁定單一角色(底層 char_id = 角色 id)。
    • ACC

      public static final LogScope ACC
      帳號為單位:計數由同帳號所有角色共享(底層 char_id = 哨兵 0)。
  • Method Details

    • values

      public static LogScope[] 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 LogScope 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