diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index 44bc56df..caa61223 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -39,6 +39,7 @@ import net.md_5.bungee.netty.PacketDecoder; import net.md_5.bungee.netty.PacketHandler; import net.md_5.bungee.netty.PipelineUtils; import net.md_5.bungee.protocol.Forge; +import net.md_5.bungee.protocol.Vanilla; import net.md_5.bungee.protocol.packet.DefinedPacket; import net.md_5.bungee.protocol.packet.Packet1Login; import net.md_5.bungee.protocol.packet.Packet2Handshake; @@ -142,6 +143,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection this.handshake = handshake; bungee.getLogger().log( Level.INFO, "{0} has connected", this ); + if ( handshake.getProcolVersion() > Vanilla.PROTOCOL_VERSION ) + { + disconnect( "Outdated server!" ); + } else if ( handshake.getProcolVersion() < Vanilla.PROTOCOL_VERSION ) + { + disconnect( "Outdated client!" ); + } + if ( handshake.getUsername().length() > 16 ) { disconnect( "Cannot have username longer than 16 characters" );