Include forwarding version in modern forwarding

This is currently version 1.
This commit is contained in:
Andrew Steinborn
2018-10-18 14:42:10 -04:00
parent 1d8b11e47b
commit 19956a2ed7
2 changed files with 2 additions and 1 deletions

View File

@@ -6,5 +6,5 @@ public class VelocityConstants {
} }
public static final String VELOCITY_IP_FORWARDING_CHANNEL = "velocity:player_info"; public static final String VELOCITY_IP_FORWARDING_CHANNEL = "velocity:player_info";
public static final int FORWARDING_VERSION = 1;
} }

View File

@@ -123,6 +123,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
ByteBuf dataToForward = Unpooled.buffer(); ByteBuf dataToForward = Unpooled.buffer();
ByteBuf finalData = Unpooled.buffer(); ByteBuf finalData = Unpooled.buffer();
try { try {
ProtocolUtils.writeVarInt(dataToForward, VelocityConstants.FORWARDING_VERSION);
ProtocolUtils.writeString(dataToForward, address); ProtocolUtils.writeString(dataToForward, address);
ProtocolUtils.writeUuid(dataToForward, profile.idAsUuid()); ProtocolUtils.writeUuid(dataToForward, profile.idAsUuid());
ProtocolUtils.writeString(dataToForward, profile.getName()); ProtocolUtils.writeString(dataToForward, profile.getName());