Class QueryServer


public class QueryServer extends GlowDatagramServer
Implementation of a server for the minecraft server query protocol.
See Also:
  • Constructor Details

    • QueryServer

      public QueryServer(GlowServer server, ProtocolProvider protocolProvider, CountDownLatch latch, boolean showPlugins)
      Creates an instance for the specified server.
      Parameters:
      server - the associated GlowServer
      latch - The countdown latch used during server startup to wait for network server binding.
      showPlugins - whether the plugin list should be included in responses
  • Method Details

    • bind

      public io.netty.channel.ChannelFuture bind(InetSocketAddress address)
      Bind the server on the specified address.
      Overrides:
      bind in class GlowDatagramServer
      Parameters:
      address - The address.
      Returns:
      Netty channel future for bind operation.
    • shutdown

      public void shutdown()
      Shut the query server down.
      Overrides:
      shutdown in class GlowDatagramServer
    • generateChallengeToken

      public int generateChallengeToken(InetSocketAddress address)
      Generate a new token.
      Parameters:
      address - The sender address.
      Returns:
      The generated valid token.
    • verifyChallengeToken

      public boolean verifyChallengeToken(InetSocketAddress address, int token)
      Verify that the request is using the correct challenge token.
      Parameters:
      address - The sender address.
      token - The token.
      Returns:
      true if the token is valid.
    • flushChallengeTokens

      public void flushChallengeTokens()
      Invalidates all challenge tokens.
    • onBindSuccess

      public void onBindSuccess(InetSocketAddress address)
      Overrides:
      onBindSuccess in class GlowNetworkServer
    • onBindFailure

      public void onBindFailure(InetSocketAddress address, Throwable t)
      Specified by:
      onBindFailure in class GlowNetworkServer