Reset in-flight connection only if the server disconnects the client.
This commit is contained in:
@@ -766,12 +766,13 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
public CompletableFuture<Result> connect() {
|
public CompletableFuture<Result> connect() {
|
||||||
return this.internalConnect()
|
return this.internalConnect()
|
||||||
.whenCompleteAsync((status, throwable) -> {
|
.whenCompleteAsync((status, throwable) -> {
|
||||||
if (status != null && !status.isSafe()) {
|
if (status != null && !status.isSuccessful()) {
|
||||||
// If it's not safe to continue the connection we need to shut it down.
|
if (!status.isSafe()) {
|
||||||
handleConnectionException(status.getAttemptedConnection(), throwable, true);
|
handleConnectionException(status.getAttemptedConnection(), throwable, false);
|
||||||
} else if ((status != null && !status.isSuccessful())) {
|
} else if (status.getStatus() == Status.SERVER_DISCONNECTED) {
|
||||||
resetInFlightConnection();
|
resetInFlightConnection();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, connection.eventLoop())
|
}, connection.eventLoop())
|
||||||
.thenApply(x -> x);
|
.thenApply(x -> x);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user