java.lang.Object
net.ME1312.SubServers.Client.Common.Network.API.RemotePlayer
Direct Known Subclasses:
CachedPlayer

public class RemotePlayer extends Object
Simplified RemotePlayer Data Class
  • Field Details

  • Constructor Details

    • RemotePlayer

      public RemotePlayer(ObjectMap<String> raw)
      Create an API representation of a Remote Player
      Parameters:
      raw - Raw representation of the Remote Player
    • RemotePlayer

      protected RemotePlayer(DataClient client, ObjectMap<String> raw)
      Create an API representation of a Remote Player
      Parameters:
      client - SubData connection
      raw - Raw representation of the Remote Player
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • refresh

      public void refresh()
      Download a new copy of the data from SubData
    • getUniqueId

      public UUID getUniqueId()
      Get the UUID of this player.
      Returns:
      the UUID
    • getName

      public String getName()
      Get the unique name of this player.
      Returns:
      the player's username
    • getAddress

      public InetSocketAddress getAddress()
      Gets the remote address of this connection.
      Returns:
      the remote address
    • getProxyName

      public String getProxyName()
      Gets the proxy this player is connected to.
      Returns:
      the proxy this player is connected to
    • getProxy

      public void getProxy(Consumer<Proxy> callback)
      Gets the proxy this player is connected to.
      Parameters:
      callback - the proxy this player is connected to
    • getServerName

      public String getServerName()
      Gets the server this player is connected to.
      Returns:
      the server this player is connected to
    • getServer

      public void getServer(Consumer<Server> callback)
      Gets the server this player is connected to.
      Parameters:
      callback - the server this player is connected to
    • broadcastMessage

      public static void broadcastMessage(String... messages)
      Sends messages to all players
      Parameters:
      messages - Messages to send
    • broadcastMessage

      public static void broadcastMessage(String message, IntConsumer response)
      Sends a message to all players
      Parameters:
      message - Message to send
      response - Success Status
    • broadcastMessage

      public static void broadcastMessage(String[] messages, IntConsumer response)
      Sends messages to all players
      Parameters:
      messages - Messages to send
      response - Success Status
    • sendMessage

      public void sendMessage(String... messages)
      Sends messages to this player
      Parameters:
      messages - Messages to send
    • sendMessage

      public void sendMessage(String message, IntConsumer response)
      Sends a message to this player
      Parameters:
      message - Message to send
      response - Success Status
    • sendMessage

      public void sendMessage(String[] messages, IntConsumer response)
      Sends messages to this player
      Parameters:
      messages - Messages to send
      response - Success Status
    • sendMessage

      public static void sendMessage(UUID[] players, String... messages)
      Sends messages to these players
      Parameters:
      players - Players to select
      messages - Messages to send
    • sendMessage

      public static void sendMessage(UUID[] players, String message, IntConsumer response)
      Sends a message to these players
      Parameters:
      players - Players to select
      message - Message to send
      response - Success Status
    • sendMessage

      public static void sendMessage(UUID[] players, String[] messages, IntConsumer response)
      Sends messages to these players
      Parameters:
      players - Players to select
      messages - Messages to send
      response - Success Status
    • broadcastRawMessage

      public static void broadcastRawMessage(String... messages)
      Sends JSON format messages to all players
      Parameters:
      messages - Messages to send
    • broadcastRawMessage

      public static void broadcastRawMessage(String message, IntConsumer response)
      Sends a JSON format message to all players
      Parameters:
      message - Message to send
      response - Success Status
    • broadcastRawMessage

      public static void broadcastRawMessage(String[] messages, IntConsumer response)
      Sends JSON format messages to all players
      Parameters:
      messages - Messages to send
      response - Success Status
    • sendRawMessage

      public void sendRawMessage(String... messages)
      Sends JSON format messages to this player
      Parameters:
      messages - Messages to send
    • sendRawMessage

      public void sendRawMessage(String message, IntConsumer response)
      Sends a JSON format message to this player
      Parameters:
      message - Message to send
      response - Success Status
    • sendRawMessage

      public void sendRawMessage(String[] message, IntConsumer response)
      Sends JSON format messages to this player
      Parameters:
      message - Message to send
      response - Success Status
    • sendRawMessage

      public static void sendRawMessage(UUID[] players, String... messages)
      Sends JSON format messages to these players
      Parameters:
      players - Players to select
      messages - Messages to send
    • sendRawMessage

      public static void sendRawMessage(UUID[] players, String message, IntConsumer response)
      Sends a JSON format message to these players
      Parameters:
      players - Players to select
      message - Message to send
      response - Success Status
    • sendRawMessage

      public static void sendRawMessage(UUID[] players, String[] messages, IntConsumer response)
      Sends JSON format messages to these players
      Parameters:
      players - Players to select
      messages - Messages to send
      response - Success Status
    • transfer

      public void transfer(String server)
      Transfers this player to another server
      Parameters:
      server - Target server
    • transfer

      public void transfer(String server, IntConsumer response)
      Transfers this player to another server
      Parameters:
      server - Target server
      response - Success status
    • transfer

      public static void transfer(UUID[] players, String server)
      Transfers these players to another server
      Parameters:
      players - Players to select
      server - Target server
    • transfer

      public static void transfer(UUID[] players, String server, IntConsumer response)
      Transfers these players to another server
      Parameters:
      players - Players to select
      server - Target server
      response - Success status
    • disconnect

      public void disconnect()
      Disconnects this player from the network
    • disconnect

      public void disconnect(IntConsumer response)
      Disconnects this player from the network
      Parameters:
      response - Success status
    • disconnect

      public void disconnect(String reason)
      Disconnects this player from the network
      Parameters:
      reason - Disconnect Reason
    • disconnect

      public void disconnect(String reason, IntConsumer response)
      Disconnects this player from the network
      Parameters:
      reason - Disconnect Reason
      response - Success status
    • disconnect

      public static void disconnect(UUID... players)
      Disconnects these players from the network
      Parameters:
      players - Players to select
    • disconnect

      public static void disconnect(UUID[] players, IntConsumer response)
      Disconnects these players from the network
      Parameters:
      players - Players to select
      response - Success status
    • disconnect

      public static void disconnect(UUID[] players, String reason)
      Disconnects these players from the network
      Parameters:
      players - Players to select
      reason - Disconnect Reason
    • disconnect

      public static void disconnect(UUID[] players, String reason, IntConsumer response)
      Disconnects these players from the network
      Parameters:
      players - Players to select
      reason - Disconnect Reason
      response - Success status
    • getTimestamp

      public long getTimestamp()
      Get the Timestamp for when the data was last refreshed
      Returns:
      Data Timestamp
    • getRaw

      public ObjectMap<String> getRaw()
      Get the raw representation of the Server
      Returns:
      Raw Server