java.lang.Object
net.ME1312.SubServers.Client.Common.Network.API.Server
Direct Known Subclasses:
SubServer

public class Server extends Object
Simplified Server Data Class
  • Constructor Details

    • Server

      public Server(ObjectMap<String> raw)
      Create an API representation of a Server
      Parameters:
      raw - Raw representation of the Server
  • 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
    • getSubData

      public DataSender[] getSubData()
      Gets the SubData Client Channel IDs
      Returns:
      SubData Client Channel ID Array
    • getName

      public String getName()
      Get the Name of this Server
      Returns:
      Server Name
    • getDisplayName

      public String getDisplayName()
      Get the Display Name of this Server
      Returns:
      Display Name
    • getAddress

      public InetSocketAddress getAddress()
      Get the Address of this Server
      Returns:
      Server Address
    • getGroups

      public List<String> getGroups()
      Get this Server's Groups
      Returns:
      Group names
    • command

      public void command(UUID player, UUID target, String command, IntConsumer response)
      Commands the Server
      Parameters:
      player - Player who's Commanding
      target - Player who will Send
      command - Commmand to Send
      response - Response Code
    • command

      public void command(UUID player, String command, IntConsumer response)
      Commands the Server
      Parameters:
      player - Player who's Commanding
      command - Commmand to Send
      response - Response Code
    • command

      public void command(String command, IntConsumer response)
      Commands the Server
      Parameters:
      command - Commmand to Send
      response - Response Code
    • command

      public void command(UUID player, UUID target, String command)
      Commands the Server
      Parameters:
      player - Player who's Commanding
      target - Player who's Commanding
      command - Command to Send
    • command

      public void command(UUID player, String command)
      Commands the Server
      Parameters:
      player - Player who's Commanding
      command - Command to Send
    • command

      public void command(String command)
      Commands the Server
      Parameters:
      command - Command to Send
    • getRemotePlayers

      public Collection<Pair<String,UUID>> getRemotePlayers()
      Get players on this server across all known proxies
      Returns:
      Remote Player Collection
    • getRemotePlayers

      public void getRemotePlayers(Consumer<Collection<RemotePlayer>> callback)
      Get players on this server across all known proxies
      Parameters:
      callback - Remote Player Collection
    • isHidden

      public boolean isHidden()
      If the server is hidden from players
      Returns:
      Hidden Status
    • getMotd

      public String getMotd()
      Gets the MOTD of the Server
      Returns:
      Server MOTD
    • isRestricted

      public boolean isRestricted()
      Gets if the Server is Restricted
      Returns:
      Restricted Status
    • getWhitelist

      public Collection<UUID> getWhitelist()
      Get a copy of the current whitelist
      Returns:
      Player Whitelist
    • isWhitelisted

      public boolean isWhitelisted(UUID player)
      See if a player is whitelisted
      Parameters:
      player - Player to check
      Returns:
      Whitelisted Status
    • getSignature

      public String getSignature()
      Get the Signature of this Object
      Returns:
      Object Signature
    • 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