Class ChatBase

java.lang.Object
zombie.chat.ChatBase
Direct Known Subclasses:
AdminChat, FactionChat, GeneralChat, RangeBasedChat, SafehouseChat, ServerChat, WhisperChat

public abstract class ChatBase extends Object
  • Field Details

  • Constructor Details

    • ChatBase

      protected ChatBase(ChatType chatType)
    • ChatBase

      public ChatBase(ByteBuffer bb, ChatType _type, ChatTab tab, IsoPlayer owner)
      Should called only on client side of chat system
      Parameters:
      bb - package from server that describe how chat should look and work
      _type - meta information about chat. Many parameters depends on that
      tab - tab where chat should show their info
      owner - actual player instance
    • ChatBase

      public ChatBase(int _id, ChatType _type, ChatTab tab)
      Should be called only on server side of chat system
      Parameters:
      _id - unique id of chat. It will be used to identify chat in client-server communication
      _type - meta information about chat. Many parameters depends on that
      tab - this tab will transferred to clients when it will connecting
  • Method Details

    • isEnabled

      public boolean isEnabled()
    • getChatOwnerName

      protected String getChatOwnerName()
    • getChatOwner

      protected IsoPlayer getChatOwner()
    • getMode

      public ChatMode getMode()
    • getType

      public ChatType getType()
    • getID

      public int getID()
    • getTitleID

      public String getTitleID()
    • getColor

      public Color getColor()
    • getTabID

      public short getTabID()
    • getRange

      public float getRange()
    • isSendingToRadio

      public boolean isSendingToRadio()
    • getZombieAttractionRange

      public float getZombieAttractionRange()
    • setSettings

      public void setSettings(ChatSettings _settings)
    • setFontSize

      public void setFontSize(String fontSize)
    • setShowTimestamp

      public void setShowTimestamp(boolean showTimestamp)
    • setShowTitle

      public void setShowTitle(boolean showTitle)
    • isCustomSettings

      protected boolean isCustomSettings()
    • isAllowImages

      protected boolean isAllowImages()
    • isAllowChatIcons

      protected boolean isAllowChatIcons()
    • isAllowColors

      protected boolean isAllowColors()
    • isAllowFonts

      protected boolean isAllowFonts()
    • isAllowBBcode

      protected boolean isAllowBBcode()
    • isEqualizeLineHeights

      protected boolean isEqualizeLineHeights()
    • isShowAuthor

      protected boolean isShowAuthor()
    • isShowTimestamp

      protected boolean isShowTimestamp()
    • isShowTitle

      protected boolean isShowTitle()
    • getFontSize

      protected String getFontSize()
    • getTitle

      protected String getTitle()
    • close

      public void close()
    • packChat

      protected void packChat(ByteBufferWriter byteBufferWriter)
    • unpackMessage

      public ChatMessage unpackMessage(ByteBuffer bb)
    • packMessage

      public void packMessage(ByteBufferWriter b, ChatMessage msg)
    • createMessage

      public ChatMessage createMessage(String text)
      Message creator. Every chat know how to create its own message
      Parameters:
      text - text of the message
      Returns:
      corresponding object to message
    • createServerMessage

      public ServerChatMessage createServerMessage(String text)
    • showMessage

      public void showMessage(String text, String author)
    • showMessage

      public void showMessage(ChatMessage msg)
    • getMessageTextWithPrefix

      public String getMessageTextWithPrefix(ChatMessage msg)
    • sendMessageToChatMembers

      public void sendMessageToChatMembers(ChatMessage msg)
    • sendMessageToChatMembers

      public void sendMessageToChatMembers(ServerChatMessage msg)
    • sendMessageToPlayer

      public void sendMessageToPlayer(UdpConnection connection, ChatMessage msg)
    • sendMessageToPlayer

      public void sendMessageToPlayer(short playerID, ChatMessage msg)
    • getMessagePrefix

      public String getMessagePrefix(ChatMessage msg)
    • getColorTag

      protected String getColorTag()
    • getColorTag

      protected String getColorTag(Color color)
    • getFontSizeTag

      protected String getFontSizeTag()
    • getChatSettingsTags

      protected String getChatSettingsTags()
    • addMember

      public void addMember(short playerID)
    • leaveMember

      public void leaveMember(Short playerID)
    • removeMember

      public void removeMember(Short playerID)
    • syncMembersByUsernames

      public void syncMembersByUsernames(ArrayList<String> players)
    • getJustAddedMembers

      public ArrayList<Short> getJustAddedMembers()
    • getJustRemovedMembers

      public ArrayList<Short> getJustRemovedMembers()
    • sendPlayerJoinChatPacket

      public void sendPlayerJoinChatPacket(UdpConnection playerConnection)
    • sendPlayerLeaveChatPacket

      public void sendPlayerLeaveChatPacket(short playerID)
    • sendPlayerLeaveChatPacket

      public void sendPlayerLeaveChatPacket(UdpConnection connection)
    • sendToServer

      public void sendToServer(ChatMessage msg, DeviceData deviceData)
    • hasChatTab

      protected boolean hasChatTab()