mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-19 07:27:42 +01:00
Move connectedServer clearing check to be done later.
This commit is contained in:
@@ -421,8 +421,6 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
Optional<RegisteredServer> next = getNextServerToTry(rs);
|
Optional<RegisteredServer> next = getNextServerToTry(rs);
|
||||||
result = next.<ServerKickResult>map(RedirectPlayer::create)
|
result = next.<ServerKickResult>map(RedirectPlayer::create)
|
||||||
.orElseGet(() -> DisconnectPlayer.create(friendlyReason));
|
.orElseGet(() -> DisconnectPlayer.create(friendlyReason));
|
||||||
// Make sure we clear the current connected server as the connection is invalid.
|
|
||||||
connectedServer = null;
|
|
||||||
} else {
|
} else {
|
||||||
// If we were kicked by going to another server, the connection should not be in flight
|
// If we were kicked by going to another server, the connection should not be in flight
|
||||||
if (connectionInFlight != null && connectionInFlight.getServer().equals(rs)) {
|
if (connectionInFlight != null && connectionInFlight.getServer().equals(rs)) {
|
||||||
@@ -441,6 +439,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
|||||||
.thenAcceptAsync(event -> {
|
.thenAcceptAsync(event -> {
|
||||||
// There can't be any connection in flight now.
|
// There can't be any connection in flight now.
|
||||||
connectionInFlight = null;
|
connectionInFlight = null;
|
||||||
|
// Make sure we clear the current connected server as the connection is invalid.
|
||||||
|
connectedServer = null;
|
||||||
|
|
||||||
if (event.getResult() instanceof DisconnectPlayer) {
|
if (event.getResult() instanceof DisconnectPlayer) {
|
||||||
DisconnectPlayer res = (DisconnectPlayer) event.getResult();
|
DisconnectPlayer res = (DisconnectPlayer) event.getResult();
|
||||||
|
|||||||
Reference in New Issue
Block a user