Package me.autobot.lib.server
Class WSClientRoute
java.lang.Object
me.autobot.lib.server.WSClientRoute
A class representing a route for the WSClient.
This class can be used to handle messages from the WSClient.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the route to the WSClient.int[]
What the message prefix should be (should be unique).getType()
Gets the type of the route (whether that be passive, speaker, or listener).void
Called when a message is received from the WSClient.void
Removes the route 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
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
Called when a message is received from the WSClient.- Parameters:
client
- The client that sent the message.message
- The message that was sent.
-