Interface PlayerFilter

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 interface PlayerFilter
Functional interface for filtering players before a connection is created for them.
  • Method Details

    • refuse

      @Nullable JoinRefusal refuse(String host, PlayerInfo player)
      Called once the identity attached to an SDP offer has been validated, before the connection is handed to the NetherNetServerSignaling.NewConnectionHandler.

      Called on the event loop, so don't block in here. A thrown exception turns the player away as JoinRefusal.REJECTED does.

      Parameters:
      host - The host header from the join request, which may be used to identify the server
      player - The validated player attempting to join
      Returns:
      Why to turn the player away, or null to let them in