Class Query

java.lang.Object
net.minestom.server.extras.query.Query

public class Query extends Object
Utility class to manage responses to the GameSpy4 Query Protocol.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Charset
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Checks if the query system has been started.
    static int
    Starts the query system, responding to queries on a random port, logging if it could not be started.
    static boolean
    start(int port)
    Starts the query system, responding to queries on a given port, logging if it could not be started.
    static boolean
    Stops the query system.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CHARSET

      public static final Charset CHARSET
  • Method Details

    • start

      public static int start()
      Starts the query system, responding to queries on a random port, logging if it could not be started.
      Returns:
      the port
      Throws:
      IllegalArgumentException - if the system was already running
    • start

      public static boolean start(int port)
      Starts the query system, responding to queries on a given port, logging if it could not be started.
      Parameters:
      port - the port
      Returns:
      true if the query system started successfully, false otherwise
    • stop

      public static boolean stop()
      Stops the query system.
      Returns:
      true if the query system was stopped, false if it was not running
    • isStarted

      public static boolean isStarted()
      Checks if the query system has been started.
      Returns:
      true if it has been started, false otherwise