Class WSClientRoute

java.lang.Object
me.autobot.lib.server.WSClientRoute

public class WSClientRoute extends Object
A class representing a route for the WSClient. This class can be used to handle messages from the WSClient.
  • Constructor Details

    • WSClientRoute

      public WSClientRoute()
      Creates a new WSClientRoute and adds it to the WSClient.
  • Method Details

    • getRoutePrefix

      public int[] getRoutePrefix()
      What the message prefix should be (should be unique).
      Returns:
      The message prefix.
    • getType

      public WSClient.ClientType getType()
      Gets the type of the route (whether that be passive, speaker, or listener).
      Returns:
      The type of the route.
    • addToWSClient

      protected void addToWSClient()
      Adds the route to the WSClient.
    • removeFromWSClient

      public void removeFromWSClient()
      Removes the route from the WSClient.
    • onMessage

      public void onMessage(WSClient client, int[] message)
      Called when a message is received from the WSClient.
      Parameters:
      client - The client that sent the message.
      message - The message that was sent.