3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-16 21:10:30 +01:00

Relay more exceptions (#446)

Dieser Commit ist enthalten in:
A248 2021-03-22 08:11:25 -04:00 committet von GitHub
Ursprung 015693090f
Commit 0016f4ce19
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -86,7 +86,7 @@ public class TransitionSessionHandler implements MinecraftSessionHandler {
server.getEventManager()
.fire(new ServerConnectedEvent(player, serverConn.getServer(),
existingConnection != null ? existingConnection.getServer() : null))
.whenCompleteAsync((x, error) -> {
.thenRunAsync(() -> {
// Make sure we can still transition (player might have disconnected here).
if (!serverConn.isActive()) {
// Connection is obsolete.

Datei anzeigen

@ -1000,8 +1000,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
VelocityServerConnection con = new VelocityServerConnection(vrs,
ConnectedPlayer.this, server);
connectionInFlight = con;
return con.connect().whenCompleteAsync((result, throwable) ->
this.resetIfInFlightIs(con), connection.eventLoop());
return con.connect().thenApplyAsync((result) -> {
this.resetIfInFlightIs(con);
return result;
}, connection.eventLoop());
}, connection.eventLoop());
});
}
@ -1019,8 +1021,12 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
if (status != null && !status.isSuccessful()) {
if (!status.isSafe()) {
handleConnectionException(status.getAttemptedConnection(), throwable, false);
return;
}
}
if (throwable != null) {
logger.error("Exception during connect; status = {}", status, throwable);
}
}, connection.eventLoop())
.thenApply(x -> x);
}

Datei anzeigen

@ -134,7 +134,7 @@ public class GS4QueryHandler extends SimpleChannelInboundHandler<DatagramPacket>
// Call event and write response
server.getEventManager()
.fire(new ProxyQueryEvent(isBasic ? BASIC : FULL, senderAddress, response))
.whenCompleteAsync((event, exc) -> {
.thenAcceptAsync((event) -> {
// Packet header
ByteBuf queryResponse = ctx.alloc().buffer();
queryResponse.writeByte(QUERY_TYPE_STAT);