Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-06 00:00:47 +01:00
Confine preconnect validation/setup logic to event loop.
Dieser Commit ist enthalten in:
Ursprung
a98a7dd67e
Commit
75ddeb062f
@ -733,7 +733,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
// Otherwise, initiate the connection.
|
// Otherwise, initiate the connection.
|
||||||
ServerPreConnectEvent event = new ServerPreConnectEvent(ConnectedPlayer.this, toConnect);
|
ServerPreConnectEvent event = new ServerPreConnectEvent(ConnectedPlayer.this, toConnect);
|
||||||
return server.getEventManager().fire(event)
|
return server.getEventManager().fire(event)
|
||||||
.thenCompose(newEvent -> {
|
.thenComposeAsync(newEvent -> {
|
||||||
Optional<RegisteredServer> connectTo = newEvent.getResult().getServer();
|
Optional<RegisteredServer> connectTo = newEvent.getResult().getServer();
|
||||||
if (!connectTo.isPresent()) {
|
if (!connectTo.isPresent()) {
|
||||||
return CompletableFuture.completedFuture(
|
return CompletableFuture.completedFuture(
|
||||||
@ -754,7 +754,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
server);
|
server);
|
||||||
connectionInFlight = con;
|
connectionInFlight = con;
|
||||||
return con.connect();
|
return con.connect();
|
||||||
});
|
}, connection.eventLoop());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren