Package com.velocitypowered.api.proxy
Interface ConnectionRequestBuilder
public interface ConnectionRequestBuilder
Provides a fluent interface to send a connection request to another server on the proxy. A
connection request is created using
Player.createConnectionRequest(RegisteredServer)
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents the result of a connection request.static enum
Represents the status of a connection request initiated by aConnectionRequestBuilder
. -
Method Summary
Modifier and TypeMethodDescriptionconnect()
Initiates the connection to the remote server and emits a result on theCompletableFuture
after the user has logged on.Initiates the connection to the remote server and emits a result on theCompletableFuture
after the user has logged on.void
Initiates the connection to the remote server without waiting for a result.Returns the server that this connection request represents.
-
Method Details
-
getServer
RegisteredServer getServer()Returns the server that this connection request represents.- Returns:
- the server this request will connect to
-
connect
CompletableFuture<ConnectionRequestBuilder.Result> connect()Initiates the connection to the remote server and emits a result on theCompletableFuture
after the user has logged on. No messages will be communicated to the client: the user is responsible for all error handling.- Returns:
- a
CompletableFuture
representing the status of this connection
-
connectWithIndication
CompletableFuture<Boolean> connectWithIndication()Initiates the connection to the remote server and emits a result on theCompletableFuture
after the user has logged on. Velocity's own built-in handling will be used to provide errors to the client.- Returns:
- a
CompletableFuture
representing the status of this connection
-
fireAndForget
void fireAndForget()Initiates the connection to the remote server without waiting for a result. Velocity will use generic error handling code to notify the user.
-