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