Class ClientAPI

java.lang.Object
net.ME1312.SubServers.Client.Common.ClientAPI

public abstract class ClientAPI extends Object
  • Constructor Details

    • ClientAPI

      protected ClientAPI()
  • Method Details

    • getInstance

      public static ClientAPI getInstance()
      Gets the SubAPI Client Common Methods
      Returns:
      SubAPI Client Common
    • getName

      public abstract String getName()
      Get the Server Name
      Returns:
      Server Name
    • getHosts

      public void getHosts(Consumer<Map<String,Host>> callback)
      Gets the Hosts
      Parameters:
      callback - Host Map
    • getHost

      public void getHost(String name, Consumer<Host> callback)
      Gets a Host
      Parameters:
      name - Host name
      callback - a Host
    • getGroups

      public void getGroups(Consumer<Map<String,List<Server>>> callback)
      Gets the Server Groups (Group names are case sensitive here)
      Parameters:
      callback - Group Map
    • getLowercaseGroups

      public void getLowercaseGroups(Consumer<Map<String,List<Server>>> callback)
      Gets the Server Groups (Group names are all lowercase here)
      Parameters:
      callback - Group Map
    • getGroup

      public void getGroup(String name, Consumer<Pair<String,List<Server>>> callback)
      Gets a Server Group (Group names are case insensitive here)
      Parameters:
      name - Group name
      callback - a Server Group
    • getServers

      public void getServers(Consumer<Map<String,Server>> callback)
      Gets the Servers (including SubServers)
      Parameters:
      callback - Server Map
    • getServer

      public void getServer(String name, Consumer<Server> callback)
      Gets a Server
      Parameters:
      name - Server name
      callback - a Server
    • addServer

      public void addServer(String name, InetAddress ip, int port, String motd, boolean hidden, boolean restricted, IntConsumer response)
      Adds a Server to the Network
      Parameters:
      name - Name of the Server
      ip - IP of the Server
      port - Port of the Server
      motd - MOTD of the Server
      hidden - if the server should be hidden from players
      restricted - Players will need a permission to join if true
      response - Response Code
    • addServer

      public void addServer(UUID player, String name, InetAddress ip, int port, String motd, boolean hidden, boolean restricted, IntConsumer response)
      Adds a Server to the Network
      Parameters:
      player - Player who added
      name - Name of the Server
      ip - IP of the Server
      port - Port of the Server
      motd - MOTD of the Server
      hidden - If the server should be hidden from players
      restricted - Players will need a permission to join if true
      response - Response Code
    • addServer

      public void addServer(String name, InetAddress ip, int port, String motd, boolean hidden, boolean restricted)
      Adds a Server to the Network
      Parameters:
      name - Name of the Server
      ip - IP of the Server
      port - Port of the Server
      motd - MOTD of the Server
      hidden - if the server should be hidden from players
      restricted - Players will need a permission to join if true
    • addServer

      public void addServer(UUID player, String name, InetAddress ip, int port, String motd, boolean hidden, boolean restricted)
      Adds a Server to the Network
      Parameters:
      player - Player who added
      name - Name of the Server
      ip - IP of the Server
      port - Port of the Server
      motd - MOTD of the Server
      hidden - If the server should be hidden from players
      restricted - Players will need a permission to join if true
    • removeServer

      public void removeServer(String name, IntConsumer response)
      Remove a Server from the Network
      Parameters:
      name - Name of the Server
      response - Response Code
    • removeServer

      public void removeServer(UUID player, String name, IntConsumer response)
      Remove a Server from the Network
      Parameters:
      player - Player Removing
      name - Name of the Server
      response - Response Code
    • removeServer

      public void removeServer(String name)
      Remove a Server from the Network
      Parameters:
      name - Name of the Server
    • removeServer

      public void removeServer(UUID player, String name)
      Remove a Server from the Network
      Parameters:
      player - Player Removing
      name - Name of the Server
    • forceRemoveServer

      public void forceRemoveServer(String name, IntConsumer response)
      Force Remove a Server from the Network
      Parameters:
      name - Name of the Server
      response - Response Code
    • forceRemoveServer

      public void forceRemoveServer(UUID player, String name, IntConsumer response)
      Force Remove a Server from the Network
      Parameters:
      player - Player Removing
      name - Name of the Server
      response - Response Code
    • forceRemoveServer

      public void forceRemoveServer(String name)
      Force Remove a Server from the Network
      Parameters:
      name - Name of the Server
    • forceRemoveServer

      public void forceRemoveServer(UUID player, String name)
      Force Remove a Server from the Network
      Parameters:
      player - Player Removing
      name - Name of the Server
    • getSubServers

      public void getSubServers(Consumer<Map<String,SubServer>> callback)
      Gets the SubServers
      Parameters:
      callback - SubServer Map
    • getSubServer

      public void getSubServer(String name, Consumer<SubServer> callback)
      Gets a SubServer
      Parameters:
      name - SubServer name
      callback - a SubServer
    • getProxies

      public void getProxies(Consumer<Map<String,Proxy>> callback)
      Gets the known Proxies
      Parameters:
      callback - Proxy Map
    • getProxy

      public void getProxy(String name, Consumer<Proxy> callback)
      Gets a Proxy
      Parameters:
      name - Proxy name
      callback - a Proxy
    • getMasterProxy

      public void getMasterProxy(Consumer<Proxy> callback)
      Get the Master Proxy Value
      Parameters:
      callback - Master Proxy
    • getRemotePlayers

      public void getRemotePlayers(Consumer<Map<UUID,RemotePlayer>> callback)
      Gets players on this network across all known proxies
      Parameters:
      callback - Remote Player Collection
    • getRemotePlayer

      public void getRemotePlayer(String name, Consumer<RemotePlayer> callback)
      Gets a player on this network by searching across all known proxies
      Parameters:
      name - Player name
      callback - Remote Player
    • getRemotePlayer

      public void getRemotePlayer(UUID id, Consumer<RemotePlayer> callback)
      Gets a player on this network by searching across all known proxies
      Parameters:
      id - Player UUID
      callback - Remote Player
    • getSubDataNetwork

      public abstract DataClient[] getSubDataNetwork()
      Gets the SubData Network Connections
      Returns:
      SubData Network Connections
    • getSubDataProtocol

      public abstract DataProtocol getSubDataProtocol()
      Gets the SubData Network Protocol
      Returns:
      SubData Network Protocol
    • getLangChannels

      public abstract Collection<String> getLangChannels()
      Gets the current SubServers Lang Channels
      Returns:
      SubServers Lang Channel list
    • getLang

      public abstract Map<String,String> getLang(String channel)
      Gets values from the SubServers Lang
      Parameters:
      channel - Lang Channel
      Returns:
      Lang Value
    • getLang

      public String getLang(String channel, String key)
      Gets a value from the SubServers Lang
      Parameters:
      channel - Lang Channel
      key - Key
      Returns:
      Lang Values