geforkt von Mirrors/Velocity
Commit
a09cf9363a
@ -1,14 +1,14 @@
|
|||||||
package com.velocitypowered.proxy.connection.client;
|
package com.velocitypowered.proxy.connection.client;
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
|
import com.velocitypowered.proxy.connection.MinecraftConnection;
|
||||||
|
import com.velocitypowered.proxy.connection.MinecraftSessionHandler;
|
||||||
import com.velocitypowered.proxy.protocol.MinecraftPacket;
|
import com.velocitypowered.proxy.protocol.MinecraftPacket;
|
||||||
import com.velocitypowered.proxy.protocol.ProtocolConstants;
|
import com.velocitypowered.proxy.protocol.ProtocolConstants;
|
||||||
import com.velocitypowered.proxy.protocol.StateRegistry;
|
import com.velocitypowered.proxy.protocol.StateRegistry;
|
||||||
import com.velocitypowered.proxy.protocol.packets.Disconnect;
|
import com.velocitypowered.proxy.protocol.packets.Disconnect;
|
||||||
import com.velocitypowered.proxy.protocol.packets.Handshake;
|
import com.velocitypowered.proxy.protocol.packets.Handshake;
|
||||||
import com.velocitypowered.proxy.connection.MinecraftConnection;
|
import net.kyori.text.TranslatableComponent;
|
||||||
import com.velocitypowered.proxy.connection.MinecraftSessionHandler;
|
|
||||||
import net.kyori.text.TextComponent;
|
|
||||||
|
|
||||||
public class HandshakeSessionHandler implements MinecraftSessionHandler {
|
public class HandshakeSessionHandler implements MinecraftSessionHandler {
|
||||||
private final MinecraftConnection connection;
|
private final MinecraftConnection connection;
|
||||||
@ -35,7 +35,7 @@ public class HandshakeSessionHandler implements MinecraftSessionHandler {
|
|||||||
connection.setState(StateRegistry.LOGIN);
|
connection.setState(StateRegistry.LOGIN);
|
||||||
connection.setProtocolVersion(handshake.getProtocolVersion());
|
connection.setProtocolVersion(handshake.getProtocolVersion());
|
||||||
if (!ProtocolConstants.isSupported(handshake.getProtocolVersion())) {
|
if (!ProtocolConstants.isSupported(handshake.getProtocolVersion())) {
|
||||||
connection.closeWith(Disconnect.create(TextComponent.of("Unsupported client")));
|
connection.closeWith(Disconnect.create(TranslatableComponent.of("multiplayer.disconnect.outdated_client")));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
connection.setSessionHandler(new LoginSessionHandler(connection));
|
connection.setSessionHandler(new LoginSessionHandler(connection));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren