3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Fix coding error that caused players to time out if moving to another server fails

Thanks to @Gabik21 for noticing this bug.
Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-30 20:59:04 -04:00
Ursprung b26c9026d3
Commit 60eef09fdd

Datei anzeigen

@ -430,17 +430,20 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
} }
KickedFromServerEvent originalEvent = new KickedFromServerEvent(this, rs, kickReason, KickedFromServerEvent originalEvent = new KickedFromServerEvent(this, rs, kickReason,
!kickedFromCurrent, result); !kickedFromCurrent, result);
handleKickEvent(originalEvent, friendlyReason); handleKickEvent(originalEvent, friendlyReason, kickedFromCurrent);
} }
} }
private void handleKickEvent(KickedFromServerEvent originalEvent, Component friendlyReason) { private void handleKickEvent(KickedFromServerEvent originalEvent, Component friendlyReason,
boolean kickedFromCurrent) {
server.getEventManager().fire(originalEvent) server.getEventManager().fire(originalEvent)
.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. // Make sure we clear the current connected server as the connection is invalid.
connectedServer = null; if (kickedFromCurrent) {
connectedServer = null;
}
if (event.getResult() instanceof DisconnectPlayer) { if (event.getResult() instanceof DisconnectPlayer) {
DisconnectPlayer res = (DisconnectPlayer) event.getResult(); DisconnectPlayer res = (DisconnectPlayer) event.getResult();