13
0
geforkt von Mirrors/Velocity

Bump client connection state before sending disconnection packets

Dieser Commit ist enthalten in:
Shane Freeder 2024-02-01 12:59:47 +00:00
Ursprung 38558783bb
Commit 5956751284
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: A3F61EA5A085289C

Datei anzeigen

@ -132,6 +132,8 @@ public class HandshakeSessionHandler implements MinecraftSessionHandler {
InetAddress address = ((InetSocketAddress) connection.getRemoteAddress()).getAddress();
if (!server.getIpAttemptLimiter().attempt(address)) {
// Bump connection into correct protocol state so that we can send the disconnect packet.
connection.setState(StateRegistry.LOGIN);
ic.disconnectQuietly(Component.translatable("velocity.error.logging-in-too-fast"));
return;
}
@ -142,6 +144,8 @@ public class HandshakeSessionHandler implements MinecraftSessionHandler {
// and lower, otherwise IP information will never get forwarded.
if (server.getConfiguration().getPlayerInfoForwardingMode() == PlayerInfoForwarding.MODERN
&& handshake.getProtocolVersion().lessThan(ProtocolVersion.MINECRAFT_1_13)) {
// Bump connection into correct protocol state so that we can send the disconnect packet.
connection.setState(StateRegistry.LOGIN);
ic.disconnectQuietly(
Component.translatable("velocity.error.modern-forwarding-needs-new-client"));
return;