13
0
geforkt von Mirrors/Velocity

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() server.getEventManager()
.fire(new ServerConnectedEvent(player, serverConn.getServer(), .fire(new ServerConnectedEvent(player, serverConn.getServer(),
existingConnection != null ? existingConnection.getServer() : null)) existingConnection != null ? existingConnection.getServer() : null))
.whenCompleteAsync((x, error) -> { .thenRunAsync(() -> {
// Make sure we can still transition (player might have disconnected here). // Make sure we can still transition (player might have disconnected here).
if (!serverConn.isActive()) { if (!serverConn.isActive()) {
// Connection is obsolete. // Connection is obsolete.

Datei anzeigen

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

Datei anzeigen

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