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

Move connectedServer clearing check to be done later.

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-27 15:25:13 -04:00
Ursprung 7cb70973b0
Commit b26c9026d3

Datei anzeigen

@ -421,8 +421,6 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
Optional<RegisteredServer> next = getNextServerToTry(rs);
result = next.<ServerKickResult>map(RedirectPlayer::create)
.orElseGet(() -> DisconnectPlayer.create(friendlyReason));
// Make sure we clear the current connected server as the connection is invalid.
connectedServer = null;
} else {
// If we were kicked by going to another server, the connection should not be in flight
if (connectionInFlight != null && connectionInFlight.getServer().equals(rs)) {
@ -441,6 +439,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
.thenAcceptAsync(event -> {
// There can't be any connection in flight now.
connectionInFlight = null;
// Make sure we clear the current connected server as the connection is invalid.
connectedServer = null;
if (event.getResult() instanceof DisconnectPlayer) {
DisconnectPlayer res = (DisconnectPlayer) event.getResult();