Class ConnectionRequestEvent
java.lang.Object
org.geysermc.geyser.api.event.connection.ConnectionRequestEvent
- All Implemented Interfaces:
org.geysermc.event.Cancellable,org.geysermc.event.Event
public final class ConnectionRequestEvent
extends Object
implements org.geysermc.event.Event, org.geysermc.event.Cancellable
Called whenever a client attempts to connect to the server, before the connection is accepted.
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionRequestEvent(InetSocketAddress ip, @Nullable InetSocketAddress proxyIp) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.@Nullable InetSocketAddressDeprecated, for removal: This API element is subject to removal in a future version.UseproxyIp()insteadThe IP address of the client attempting to connectbooleanThe cancel status of this event.@Nullable InetSocketAddressproxyIp()The IP address of the proxy handling the connection.voidsetCancelled(boolean cancelled) Sets the cancel status of this event.
-
Constructor Details
-
ConnectionRequestEvent
-
-
Method Details
-
getInetSocketAddress
Deprecated, for removal: This API element is subject to removal in a future version.UseinetSocketAddress()insteadThe IP address of the client attempting to connect- Returns:
- the IP address of the client attempting to connect
-
getProxyIp
Deprecated, for removal: This API element is subject to removal in a future version.UseproxyIp()insteadThe IP address of the proxy handling the connection. It will return null if there is no proxy.- Returns:
- the IP address of the proxy handling the connection
-
inetSocketAddress
The IP address of the client attempting to connect- Returns:
- the IP address of the client attempting to connect
-
proxyIp
The IP address of the proxy handling the connection. It will return null if there is no proxy.- Returns:
- the IP address of the proxy handling the connection
-
isCancelled
public boolean isCancelled()The cancel status of this event. If this event is cancelled, the connection will be rejected.- Specified by:
isCancelledin interfaceorg.geysermc.event.Cancellable- Returns:
- the cancel status of this event
-
setCancelled
public void setCancelled(boolean cancelled) Sets the cancel status of this event. If this event is canceled, the connection will be rejected.- Specified by:
setCancelledin interfaceorg.geysermc.event.Cancellable- Parameters:
cancelled- the cancel status of this event.
-
inetSocketAddress()instead