Interface PluginMessage


public interface PluginMessage
A message received on a channel, from the client of a player or from the proxy on its connection.
Since:
0.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the channel the message was sent on.
    byte[]
    Gets the content of the message.
    Gets the player whose connection carried the message.
    void
    reply(byte[] data)
    Answers on the same channel, through the same connection.
  • Method Details

    • player

      Player player()
      Gets the player whose connection carried the message.
      Returns:
      the player
      Since:
      0.1.0
    • channel

      Key channel()
      Gets the channel the message was sent on.
      Returns:
      the channel
      Since:
      0.1.0
    • data

      byte[] data()
      Gets the content of the message.
      Returns:
      a copy of the content, at most PluginMessenger.MAX_RECEIVED_SIZE bytes
      Since:
      0.1.0
    • reply

      void reply(byte[] data)
      Answers on the same channel, through the same connection.
      Parameters:
      data - the content of the answer, at most PluginMessenger.MAX_SENT_SIZE bytes
      Throws:
      IllegalArgumentException - if data is null or too large
      Since:
      0.1.0
      See Also: