Interface NetherNetHTTPSignaling.MotdProvider

Enclosing class:
NetherNetHTTPSignaling
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface NetherNetHTTPSignaling.MotdProvider
Functional interface providing the MOTD returned to clients querying the server.
  • Method Details

    • getMotd

      @Nullable NetherNetServerSignaling.PongData getMotd(String host, InetSocketAddress remoteAddress)
      Called for every status request, so the returned data can change over time.

      Called on the event loop, so don't block in here. The discovery-only fields of NetherNetServerSignaling.PongData are ignored, as they have no place in the status response.

      Answering null serves no status at all, which is how a host says it does not take NetherNet for this request. A join sent anyway still reaches the NetherNetHTTPSignaling.PlayerFilter.

      Parameters:
      host - The host header from the join request, which may be used to identify the server
      remoteAddress - The address the status request came from
      Returns:
      The MOTD to advertise, or null to leave the client to its other transport