Correctly forward the player's virtual host to the remote server.

This commit is contained in:
Andrew Steinborn
2021-02-01 16:17:02 -05:00
parent 4f80d2b261
commit b88c573eb1

View File

@@ -101,7 +101,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
// separated by \0 (the null byte). In order, you send the original host, the player's IP, their
// UUID (undashed), and if you are in online-mode, their login properties (from Mojang).
StringBuilder data = new StringBuilder()
.append(registeredServer.getServerInfo().getAddress().getHostString())
.append(proxyPlayer.getVirtualHost()
.orElseGet(() -> registeredServer.getServerInfo().getAddress())
.getHostString())
.append('\0')
.append(proxyPlayer.getRemoteAddress().getHostString())
.append('\0')