-
-
Save md-5/f0da28c916de6e6b9950 to your computer and use it in GitHub Desktop.
protocol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Packet2Handshake.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Packet2Handshake.java | |
index 2d139f1..af8b059 100644 | |
--- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Packet2Handshake.java | |
+++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Packet2Handshake.java | |
@@ -3,9 +3,11 @@ package net.md_5.bungee.protocol.packet; | |
import io.netty.buffer.ByteBuf; | |
import lombok.EqualsAndHashCode; | |
import lombok.Getter; | |
+import lombok.Setter; | |
import lombok.ToString; | |
@Getter | |
+@Setter | |
@ToString | |
@EqualsAndHashCode(callSuper = false) | |
public class Packet2Handshake extends DefinedPacket | |
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 9d58b2f..ec8e05a 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 | |
@@ -163,7 +163,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection | |
forced.ping( pingBack ); | |
} else | |
{ | |
- pingBack.done( new ServerPing( bungee.getProtocolVersion(), bungee.getGameVersion(), motd, bungee.getOnlineCount(), listener.getMaxPlayers() ), null ); | |
+ byte protocolVersion = bungee.getProtocolVersion(); | |
+ String gameVersion = bungee.getGameVersion(); | |
+ if ( version == 74 ) | |
+ { | |
+ protocolVersion = 74; | |
+ gameVersion = "1.6.2"; | |
+ } | |
+ pingBack.done( new ServerPing( protocolVersion, gameVersion, motd, bungee.getOnlineCount(), listener.getMaxPlayers() ), null ); | |
} | |
} | |
@@ -198,13 +205,14 @@ public class InitialHandler extends PacketHandler implements PendingConnection | |
this.vHost = new InetSocketAddress( handshake.getHost(), handshake.getPort() ); | |
bungee.getLogger().log( Level.INFO, "{0} has connected", this ); | |
- if ( handshake.getProtocolVersion() > Vanilla.PROTOCOL_VERSION ) | |
+ if ( handshake.getProtocolVersion() > 78 ) | |
{ | |
disconnect( bungee.getTranslation( "outdated_server" ) ); | |
- } else if ( handshake.getProtocolVersion() < Vanilla.PROTOCOL_VERSION ) | |
+ } else if ( handshake.getProtocolVersion() < 74 ) | |
{ | |
disconnect( bungee.getTranslation( "outdated_client" ) ); | |
} | |
+ handshake.setProtocolVersion( (byte) 78 ); | |
if ( handshake.getUsername().length() > 16 ) | |
{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment