mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 14:37:43 +01:00
Reapply f1cb3eb and add the same fix to ping passthrough
This commit is contained in:
@@ -616,7 +616,9 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
|
||||
*/
|
||||
private Optional<RegisteredServer> getNextServerToTry(@Nullable RegisteredServer current) {
|
||||
if (serversToTry == null) {
|
||||
String virtualHostStr = connectedHost().map(InetSocketAddress::getHostString).orElse("");
|
||||
String virtualHostStr = connectedHost().map(InetSocketAddress::getHostString)
|
||||
.orElse("")
|
||||
.toLowerCase(Locale.ROOT);
|
||||
serversToTry = server.configuration().getForcedHosts().getOrDefault(virtualHostStr,
|
||||
Collections.emptyList());
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -168,6 +169,7 @@ public class StatusSessionHandler implements MinecraftSessionHandler {
|
||||
return CompletableFuture.completedFuture(constructLocalPing(shownVersion));
|
||||
} else {
|
||||
String virtualHostStr = inbound.connectedHost().map(InetSocketAddress::getHostString)
|
||||
.map(str -> str.toLowerCase(Locale.ROOT))
|
||||
.orElse("");
|
||||
List<String> serversToTry = server.configuration().getForcedHosts().getOrDefault(
|
||||
virtualHostStr, server.configuration().getAttemptConnectionOrder());
|
||||
|
||||
Reference in New Issue
Block a user