Class PersonCommunicationService

Object
PersonCommunicationService
All Implemented Interfaces:
CommunicationService

public class PersonCommunicationService extends Object implements CommunicationService
Author:
maartenl
  • Method Details

    • clearLog

      public void clearLog() throws MudException
      Clears the log.
      Throws:
      MudException
    • writeMessage

      public void writeMessage(String aMessage) throws MudException
      writes a message to the log file of the character that contains all communication and messages. The sentence will start with a capital.

      Important! : Use this method only for Environmental communication or personal communication , as it does not check the Ignore Flag. Use the writeMessage(Person, String) for specific communication between users.

      Parameters:
      aMessage - the message to be written to the logfile.
      Throws:
      MudException
      See Also:
    • writeMessage

      public void writeMessage(Person aSource, Person aTarget, String aMessage) throws MudException
      writes a message to the log file of the character that contains all communication and messages. The message will be interpreted by replacing the following values by the following other values:
      REPLACE WITH (if target) WITH (if not target)
      %TNAME you name
      %TNAMESELF yourself name
      %THISHER your his/her
      %THIMHER you him/her
      %THESHE you he/she
      %TISARE are is
      %THASHAVE have has
      %TYOUPOSS your name + s
      Parameters:
      aSource - the source of the message, the thing originating the message.
      aTarget - the target of the message, could be null if there is not target for this specific message.
      aMessage - the message to be written to the logfile.
      Throws:
      MudException
      See Also:
    • writeMessage

      public void writeMessage(Person aSource, String aMessage) throws MudException
      writes a message to the log file of the character that contains all communication and messages. The message will be interpreted by replacing the following values by the following other values:
      REPLACE WITH (if source) WITH (if not source)
      %SNAME you name
      %SNAMESELF yourself name
      %SHISHER your his/her
      %SHIMHER you him/her
      %SHESHE you he/she
      %SISARE are is
      %SHASHAVE have has
      %SYOUPOSS your name + s
      %VERB1 es
      %VERB2 s
      Parameters:
      aSource - the source of the message, the thing originating the message.
      aMessage - the message to be written to the logfile.
      Throws:
      MudException
      See Also:
    • getLogSize

      public long getLogSize()
    • getLog

      public PrivateLog getLog(Long offset) throws MudException
      Returns the log starting from the offset, or an empty string if the offset is past the length of the log. Can also contain the empty string, if the log happens to be empty.
      Parameters:
      offset - the offset from whence to read the log. Offset starts with 0 and is inclusive.
      Returns:
      a String, part of the Log.
      Throws:
      MudException - in case of accidents with reading the log, or a negative offset.
    • getDescriptionOfMoney

      public String getDescriptionOfMoney()
      Returns the amount of money that you are carrying.
      Returns:
      String description of the amount of money.
    • sendChatBubble

      public void sendChatBubble(User person, Person from, String aMessage)