Enum Class LogScope
- All Implemented Interfaces:
Serializable, Comparable<LogScope>, Constable
統一紀錄系統(
_acc_char_log)的「範圍」維度:一筆計數要綁定到單一角色,
還是整個帳號(同帳號所有角色共享)。
由 CharacterLogManager 的 setLog / getLog 與 MapleCharacter
上的同名委派使用,決定底層資料列的 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 取代。
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
-
Enum Constant Details
-
CHAR
以角色為單位:計數綁定單一角色(底層char_id= 角色 id)。 -
ACC
以帳號為單位:計數由同帳號所有角色共享(底層char_id= 哨兵0)。
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-