3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-06 00:00:47 +01:00

Fix another case where an in-flight connection would be retained.

Dieser Commit ist enthalten in:
Andrew Steinborn 2019-02-20 13:55:18 -05:00
Ursprung 1ec070069f
Commit c6dcba36c3

Datei anzeigen

@ -362,7 +362,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
Optional<RegisteredServer> nextServer = getNextServerToTry(rs);
if (nextServer.isPresent()) {
// There can't be any connection in flight now.
connectionInFlight = null;
resetInFlightConnection();
createConnectionRequest(nextServer.get()).fireAndForget();
} else {
@ -376,6 +376,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
result = next.<ServerKickResult>map(RedirectPlayer::create)
.orElseGet(() -> DisconnectPlayer.create(friendlyReason));
} else {
// If we were kicked by going to another server, the connection should not be in flight
if (connectionInFlight != null && connectionInFlight.getServer().equals(rs)) {
resetInFlightConnection();
}
result = Notify.create(friendlyReason);
}
KickedFromServerEvent originalEvent = new KickedFromServerEvent(this, rs, kickReason,