mirror of
https://github.com/PaperMC/Velocity.git
synced 2025-02-05 15:09:37 +08:00
Confine preconnect validation/setup logic to event loop.
This commit is contained in:
parent
a98a7dd67e
commit
75ddeb062f
@ -733,7 +733,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
// Otherwise, initiate the connection.
|
||||
ServerPreConnectEvent event = new ServerPreConnectEvent(ConnectedPlayer.this, toConnect);
|
||||
return server.getEventManager().fire(event)
|
||||
.thenCompose(newEvent -> {
|
||||
.thenComposeAsync(newEvent -> {
|
||||
Optional<RegisteredServer> connectTo = newEvent.getResult().getServer();
|
||||
if (!connectTo.isPresent()) {
|
||||
return CompletableFuture.completedFuture(
|
||||
@ -754,7 +754,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
server);
|
||||
connectionInFlight = con;
|
||||
return con.connect();
|
||||
});
|
||||
}, connection.eventLoop());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user