geforkt von Mirrors/Velocity
Fix none vhost forwarding with legacy Forge.
Dieser Commit ist enthalten in:
Ursprung
effca0da82
Commit
340e1b23d6
@ -160,8 +160,11 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
|||||||
PlayerInfoForwarding forwardingMode = server.getConfiguration().getPlayerInfoForwardingMode();
|
PlayerInfoForwarding forwardingMode = server.getConfiguration().getPlayerInfoForwardingMode();
|
||||||
|
|
||||||
// Initiate the handshake.
|
// Initiate the handshake.
|
||||||
InetSocketAddress destAddress = registeredServer.getServerInfo().getAddress();
|
|
||||||
ProtocolVersion protocolVersion = proxyPlayer.getConnection().getProtocolVersion();
|
ProtocolVersion protocolVersion = proxyPlayer.getConnection().getProtocolVersion();
|
||||||
|
String playerVhost = proxyPlayer.getVirtualHost()
|
||||||
|
.orElseGet(() -> registeredServer.getServerInfo().getAddress())
|
||||||
|
.getHostString();
|
||||||
|
|
||||||
Handshake handshake = new Handshake();
|
Handshake handshake = new Handshake();
|
||||||
handshake.setNextStatus(StateRegistry.LOGIN_ID);
|
handshake.setNextStatus(StateRegistry.LOGIN_ID);
|
||||||
handshake.setProtocolVersion(protocolVersion);
|
handshake.setProtocolVersion(protocolVersion);
|
||||||
@ -171,13 +174,12 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation,
|
|||||||
byte[] secret = server.getConfiguration().getForwardingSecret();
|
byte[] secret = server.getConfiguration().getForwardingSecret();
|
||||||
handshake.setServerAddress(createBungeeGuardForwardingAddress(secret));
|
handshake.setServerAddress(createBungeeGuardForwardingAddress(secret));
|
||||||
} else if (proxyPlayer.getConnection().getType() == ConnectionTypes.LEGACY_FORGE) {
|
} else if (proxyPlayer.getConnection().getType() == ConnectionTypes.LEGACY_FORGE) {
|
||||||
handshake.setServerAddress(destAddress.getHostString() + HANDSHAKE_HOSTNAME_TOKEN);
|
handshake.setServerAddress(playerVhost + HANDSHAKE_HOSTNAME_TOKEN);
|
||||||
} else {
|
} else {
|
||||||
handshake.setServerAddress(proxyPlayer.getVirtualHost()
|
handshake.setServerAddress(playerVhost);
|
||||||
.orElseGet(() -> registeredServer.getServerInfo().getAddress())
|
|
||||||
.getHostString());
|
|
||||||
}
|
}
|
||||||
handshake.setPort(destAddress.getPort());
|
|
||||||
|
handshake.setPort(registeredServer.getServerInfo().getAddress().getPort());
|
||||||
mc.delayedWrite(handshake);
|
mc.delayedWrite(handshake);
|
||||||
|
|
||||||
mc.setProtocolVersion(protocolVersion);
|
mc.setProtocolVersion(protocolVersion);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren