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 TypeMethodDescriptionbooleanThe cancel status of this event.voidcancelled(boolean cancelled) Sets the cancel status of this event.Deprecated, 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 connect@Nullable InetSocketAddressproxyIp()The IP address of the proxy handling the connection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.geysermc.event.Cancellable
isCancelled, setCancelled
-
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
-
cancelled
public boolean cancelled()The cancel status of this event. If this event is cancelled, the connection will be rejected.- Specified by:
cancelledin interfaceorg.geysermc.event.Cancellable- Returns:
- the cancel status of this event
-
cancelled
public void cancelled(boolean cancelled) Sets the cancel status of this event. If this event is canceled, the connection will be rejected.- Specified by:
cancelledin interfaceorg.geysermc.event.Cancellable- Parameters:
cancelled- the cancel status of this event.
-
inetSocketAddress()instead