Class MessageS2CCharacterList

java.lang.Object
marauroa.common.net.message.Message
marauroa.common.net.message.MessageS2CCharacterList
All Implemented Interfaces:
Serializable

public class MessageS2CCharacterList extends Message
The CharacterListMessage is sent from server to client to inform client about the possible election of character to play with.
  • Constructor Details

    • MessageS2CCharacterList

      public MessageS2CCharacterList()
      Constructor for allowing creation of an empty message
    • MessageS2CCharacterList

      public MessageS2CCharacterList(Channel source, String[] characters)
      Constructor with a TCP/IP source/destination of the message and a list with the characters available to be played.
      Parameters:
      source - The TCP/IP address associated to this message
      characters - the list of characters of the player
    • MessageS2CCharacterList

      public MessageS2CCharacterList(Channel source, Map<String,​RPObject> characters)
      Constructor with a TCP/IP source/destination of the message and a list with the characters available to be played.
      Parameters:
      source - The TCP/IP address associated to this message
      characters - the list of characters of the player
  • Method Details

    • getCharacters

      public String[] getCharacters()
      This method returns the list of characters that the player owns
      Returns:
      the list of characters that the player owns
    • getCharacterDetails

      public HashMap<String,​RPObject> getCharacterDetails()
      This method returns the list of characters that the player owns
      Returns:
      the list of characters that the player owns
    • toString

      public String toString()
      This method returns a String that represent the object
      Overrides:
      toString in class Message
      Returns:
      a string representing the object.
    • readObject

      public void readObject(InputSerializer in) throws IOException
      Description copied from class: Message
      Serialize the object from an ObjectInput
      Specified by:
      readObject in interface Serializable
      Overrides:
      readObject in class Message
      Parameters:
      in - the input serializer
      Throws:
      IOException - if the serializations fails
    • writeObject

      public void writeObject(OutputSerializer out) throws IOException
      Description copied from class: Message
      Serialize the object into an ObjectOutput
      Specified by:
      writeObject in interface Serializable
      Overrides:
      writeObject in class Message
      Parameters:
      out - the output serializer.
      Throws:
      IOException - if the serializations fails
    • writeToJson

      public void writeToJson(StringBuilder out)
      Description copied from class: Message
      Serialize the object to json
      Overrides:
      writeToJson in class Message
      Parameters:
      out - output buffer