Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Explicitly cover unexpected disconnects during login
Dieser Commit ist enthalten in:
Ursprung
d482dc7f4f
Commit
8e0ca2033e
@ -20,6 +20,7 @@ import net.kyori.text.TextComponent;
|
|||||||
import javax.crypto.Mac;
|
import javax.crypto.Mac;
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.io.IOException;
|
||||||
import java.security.InvalidKeyException;
|
import java.security.InvalidKeyException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
@ -100,6 +101,15 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disconnected() {
|
||||||
|
CompletableFuture<ConnectionRequestBuilder.Result> future = connection.getMinecraftConnection().getChannel()
|
||||||
|
.attr(VelocityServerConnection.CONNECTION_NOTIFIER).getAndSet(null);
|
||||||
|
if (future != null) {
|
||||||
|
future.completeExceptionally(new IOException("Unexpectedly disconnected from remote server"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void doNotify(ConnectionRequestBuilder.Result result) {
|
private void doNotify(ConnectionRequestBuilder.Result result) {
|
||||||
CompletableFuture<ConnectionRequestBuilder.Result> future = connection.getMinecraftConnection().getChannel()
|
CompletableFuture<ConnectionRequestBuilder.Result> future = connection.getMinecraftConnection().getChannel()
|
||||||
.attr(VelocityServerConnection.CONNECTION_NOTIFIER).getAndSet(null);
|
.attr(VelocityServerConnection.CONNECTION_NOTIFIER).getAndSet(null);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren