Enum Class ChatLogType

java.lang.Object
java.lang.Enum<ChatLogType>
server.chat.ChatLogType
All Implemented Interfaces:
Serializable, Comparable<ChatLogType>, Constable

public enum ChatLogType extends Enum<ChatLogType>
玩家聊天記錄(chatlog 資料表)的頻道型別代碼。

資料庫只存 code()TINYINT),中文名(label())僅供 GUI/日誌顯示, 此 enum 為「代碼 ↔ 中文名」的單一來源。新增頻道型別時在此追加即可。

ChatLogService 與各聊天 handler(ChatHandlerPlayerInteractionHandler)使用。

  • Enum Constant Details

    • GENERAL

      public static final ChatLogType GENERAL
      公開(地圖普通聊天)。
    • WHISPER

      public static final ChatLogType WHISPER
      密語(私訊)。
    • PARTY

      public static final ChatLogType PARTY
      組隊聊天。
    • GUILD

      public static final ChatLogType GUILD
      公會聊天。
    • ALLIANCE

      public static final ChatLogType ALLIANCE
      聯盟(家族)聊天。
    • TRADE

      public static final ChatLogType TRADE
      交易視窗聊天。
    • MESSENGER

      public static final ChatLogType MESSENGER
      聊天室(Messenger)。
    • BUDDY

      public static final ChatLogType BUDDY
      好友聊天。
    • EXPEDITION

      public static final ChatLogType EXPEDITION
      遠征隊聊天。
    • SHOP

      public static final ChatLogType SHOP
      玩家商店/僱傭商人聊天。
    • COMMAND

      public static final ChatLogType COMMAND
      !@ 指令字串(於可下指令的頻道輸入)。
  • Method Details

    • values

      public static ChatLogType[] 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 ChatLogType 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
    • code

      public int code()
      資料庫儲存用的數字代碼。
    • label

      public String label()
      顯示用的中文名。
    • fromOthersType

      public static ChatLogType fromOthersType(int othersType)
      ChatHandler.Others 封包的 type byte 對應到本 enum。
      Parameters:
      othersType - 0=好友、1=組隊、2=公會、3=聯盟、4=遠征隊
      Returns:
      對應型別;未知(偽造封包)值回 null(record() 會據此略過、不寫入被誤標的記錄)
    • fromCode

      public static ChatLogType fromCode(int code)
      由數字代碼反查 enum。
      Parameters:
      code - code()
      Returns:
      對應型別;查無則回 null