Pass the correct virtual host port during the handshake (#1205)
This commit is contained in:
@@ -176,8 +176,8 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
||||
|
||||
// Initiate the handshake.
|
||||
ProtocolVersion protocolVersion = proxyPlayer.getConnection().getProtocolVersion();
|
||||
String playerVhost =
|
||||
proxyPlayer.getVirtualHost().orElseGet(() -> registeredServer.getServerInfo().getAddress())
|
||||
String playerVhost = proxyPlayer.getVirtualHost()
|
||||
.orElseGet(() -> registeredServer.getServerInfo().getAddress())
|
||||
.getHostString();
|
||||
|
||||
HandshakePacket handshake = new HandshakePacket();
|
||||
@@ -197,7 +197,9 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
||||
handshake.setServerAddress(playerVhost);
|
||||
}
|
||||
|
||||
handshake.setPort(registeredServer.getServerInfo().getAddress().getPort());
|
||||
handshake.setPort(proxyPlayer.getVirtualHost()
|
||||
.orElseGet(() -> registeredServer.getServerInfo().getAddress())
|
||||
.getPort());
|
||||
mc.delayedWrite(handshake);
|
||||
|
||||
mc.setProtocolVersion(protocolVersion);
|
||||
|
Reference in New Issue
Block a user