PaperMC / Velocity

The modern, next-generation Minecraft server proxy.
https://papermc.io/software/velocity
GNU General Public License v3.0
1.73k stars 599 forks source link

Velocity doesn't seem to forward server address to backend servers? #1311

Open ghost opened 3 months ago

ghost commented 3 months ago
 @EventHandler
    public void onPlayerHandshake(PlayerHandshakeEvent event) {
        if (event.getServerHostname() != null) {
            hostNames.put(event.getUniqueId(), event.getServerHostname().toLowerCase().replace(" ", ""));
        }
    }
This code worked on bungee but doesn't on velocity, I have modern forwarding enabled and paper backend
electronicboy commented 3 months ago

the forwarding mechansim is irrelevant

for RegisteredServer#ping(), we pass through the hostname as defined in the servers list, for an actual player, we try to pass through the players vhost that they sent us (else, we fall back to the registered server info if we don't have that)