Interface PlayerConnection

All Known Subinterfaces:
PlayerCommonConnection, PlayerConfigurationConnection, PlayerGameConnection, PlayerLoginConnection, ReadablePlayerCookieConnection, WritablePlayerCookieConnection

public interface PlayerConnection
  • Method Details

    • disconnect

      void disconnect(Component component)
      Disconnects the player connection.

      Note that calling this during connection related events may caused undefined behavior.

      Parameters:
      component - disconnect reason
    • isTransferred

      boolean isTransferred()
      Gets if this connection originated from a transferred connection.

      Do note that this is sent and stored on the client.

      Returns:
      is transferred
    • getAddress

      SocketAddress getAddress()
      Gets the raw remote address of the connection. This may be a proxy address or a Unix domain socket address, depending on how the channel was established.
      Returns:
      the remote SocketAddress of the channel
    • getClientAddress

      InetSocketAddress getClientAddress()
      Gets the real client address of the player. If the connection is behind a proxy, this will be the actual player’s IP address extracted from the proxy handshake.
      Returns:
      the client InetSocketAddress
    • getVirtualHost

      @Nullable InetSocketAddress getVirtualHost()
      Returns the virtual host the client is connected to.

      The virtual host refers to the hostname/port the client used to connect to the server.

      Returns:
      The client's virtual host, or null if unknown
    • getHAProxyAddress

      @Nullable InetSocketAddress getHAProxyAddress()
      Gets the socket address of this player's proxy
      Returns:
      the player's proxy address, null if the server doesn't have Proxy Protocol enabled, or the player didn't connect to an HAProxy instance