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 usingPlayer.createConnectionRequest(RegisteredServer)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ConnectionRequestBuilder.Result
Represents the result of a connection request.static class
ConnectionRequestBuilder.Status
Represents the status of a connection request initiated by aConnectionRequestBuilder
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletableFuture<ConnectionRequestBuilder.Result>
connect()
Initiates the connection to the remote server and emits a result on theCompletableFuture
after the user has logged on.CompletableFuture<Boolean>
connectWithIndication()
Initiates the connection to the remote server and emits a result on theCompletableFuture
after the user has logged on.void
fireAndForget()
Initiates the connection to the remote server without waiting for a result.RegisteredServer
getServer()
Returns the server that this connection request represents.
-
-
-
Method Detail
-
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.
-
-