From 19956a2ed7b4db9efba8c67d121be7bfc0a07192 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 18 Oct 2018 14:42:10 -0400 Subject: [PATCH] Include forwarding version in modern forwarding This is currently version 1. --- .../com/velocitypowered/proxy/connection/VelocityConstants.java | 2 +- .../proxy/connection/backend/LoginSessionHandler.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/VelocityConstants.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/VelocityConstants.java index 819a521e5..90e390c22 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/VelocityConstants.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/VelocityConstants.java @@ -6,5 +6,5 @@ public class VelocityConstants { } public static final String VELOCITY_IP_FORWARDING_CHANNEL = "velocity:player_info"; - + public static final int FORWARDING_VERSION = 1; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/LoginSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/LoginSessionHandler.java index 6e4cefe40..d8e05f3b3 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/LoginSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/LoginSessionHandler.java @@ -123,6 +123,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler { ByteBuf dataToForward = Unpooled.buffer(); ByteBuf finalData = Unpooled.buffer(); try { + ProtocolUtils.writeVarInt(dataToForward, VelocityConstants.FORWARDING_VERSION); ProtocolUtils.writeString(dataToForward, address); ProtocolUtils.writeUuid(dataToForward, profile.idAsUuid()); ProtocolUtils.writeString(dataToForward, profile.getName());