3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-09-29 14:40:21 +02:00

Reset in-flight connection only if the server disconnects the client.

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-05-25 11:44:02 -04:00
Ursprung b0f1398b45
Commit 64c16e61d2

Datei anzeigen

@ -766,12 +766,13 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
public CompletableFuture<Result> connect() {
return this.internalConnect()
.whenCompleteAsync((status, throwable) -> {
if (status != null && !status.isSafe()) {
// If it's not safe to continue the connection we need to shut it down.
handleConnectionException(status.getAttemptedConnection(), throwable, true);
} else if ((status != null && !status.isSuccessful())) {
if (status != null && !status.isSuccessful()) {
if (!status.isSafe()) {
handleConnectionException(status.getAttemptedConnection(), throwable, false);
} else if (status.getStatus() == Status.SERVER_DISCONNECTED) {
resetInFlightConnection();
}
}
}, connection.eventLoop())
.thenApply(x -> x);
}