From ac378a8efab8fa1d3fed669f8e8044d8dcbf1b52 Mon Sep 17 00:00:00 2001 From: MatrixTunnel Date: Mon, 6 Aug 2018 16:06:57 -0700 Subject: [PATCH] Update version strings + add constant --- README.md | 2 +- .../proxy/connection/client/StatusSessionHandler.java | 3 ++- .../com/velocitypowered/proxy/protocol/ProtocolConstants.java | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e93376abf..d15197202 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ It is sufficient to run `./gradlew build` to run the full build cycle. ## Status Velocity is far from finished, but most of the essential pieces are in place: -you can switch between two servers running Minecraft 1.9-1.13. More versions +you can switch between two servers running Minecraft 1.8-1.13. More versions and functionality is planned. You should join us on **irc.spi.gt** `#velocity` or send us a pull request. diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/StatusSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/StatusSessionHandler.java index 1dee26ce4..375185973 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/StatusSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/StatusSessionHandler.java @@ -4,6 +4,7 @@ import com.google.common.base.Preconditions; import com.velocitypowered.proxy.VelocityServer; import com.velocitypowered.proxy.config.VelocityConfiguration; import com.velocitypowered.proxy.protocol.MinecraftPacket; +import com.velocitypowered.proxy.protocol.ProtocolConstants; import com.velocitypowered.proxy.protocol.packet.StatusPing; import com.velocitypowered.proxy.protocol.packet.StatusRequest; import com.velocitypowered.proxy.protocol.packet.StatusResponse; @@ -35,7 +36,7 @@ public class StatusSessionHandler implements MinecraftSessionHandler { // Status request ServerPing ping = new ServerPing( - new ServerPing.Version(connection.getProtocolVersion(), "Velocity 1.9-1.13"), + new ServerPing.Version(connection.getProtocolVersion(), "Velocity " + ProtocolConstants.SUPPORTED_GENERIC_VERSION_STRING), new ServerPing.Players(0, configuration.getShowMaxPlayers()), configuration.getMotdComponent(), null diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/ProtocolConstants.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/ProtocolConstants.java index 421a04124..96c98f3d6 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/ProtocolConstants.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/ProtocolConstants.java @@ -17,6 +17,9 @@ public enum ProtocolConstants { ; public static final int MINECRAFT_1_13 = 393; public static final int MINIMUM_GENERIC_VERSION = MINECRAFT_1_8; + public static final int MAXIMUM_GENERIC_VERSION = MINECRAFT_1_13; + + public static final String SUPPORTED_GENERIC_VERSION_STRING = "1.8-1.13"; public static final int[] SUPPORTED_VERSIONS = new int[] { MINECRAFT_1_8,