Interface RegisteredServer


public interface RegisteredServer
Represents a registered backend server that players can connect to.
  • Method Details

    • getName

      @Nonnull String getName()
      Get the name of this server.
      Returns:
      the server name
    • getAddress

      @Nonnull InetSocketAddress getAddress()
      Get the address of this server.
      Returns:
      the server address
    • isDefault

      boolean isDefault()
      Check if this is the default server. New players will be connected to the default server.
      Returns:
      true if this is the default server
    • getPlayers

      @Nonnull Collection<Player> getPlayers()
      Get all players currently connected to this server.
      Returns:
      an unmodifiable collection of connected players
    • getPlayerCount

      int getPlayerCount()
      Get the number of players connected to this server.
      Returns:
      the player count
    • ping

      @Nonnull CompletableFuture<PingResult> ping()
      Ping the server to check if it's online.
      Returns:
      a future that completes with the ping result
    • sendPluginMessage

      boolean sendPluginMessage(@Nonnull ChannelIdentifier channel, @Nonnull byte[] data)
      Sends a plugin message to this server.

      Plugin messages allow the proxy to communicate with backend servers through registered channels. The server must have a corresponding plugin that listens for messages on this channel.

      Parameters:
      channel - the channel to send on
      data - the message data
      Returns:
      true if the message was sent (at least one player connected), false otherwise