1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Fixed handshake data bug

This commit is contained in:
Tim203
2021-02-15 00:54:56 +01:00
parent fff10e7084
commit 3bb2122fae
2 changed files with 4 additions and 3 deletions

View File

@@ -73,7 +73,7 @@ public final class FloodgateHandshakeHandler {
data = value;
continue;
}
hostnameBuilder.append(value);
hostnameBuilder.append(value).append('\0');
}
// hostname now doesn't have Floodgate data anymore if it had
String hostname = hostnameBuilder.toString();

View File

@@ -180,6 +180,9 @@ public final class SpigotDataHandler extends ChannelInboundHandlerAdapter {
HandshakeResult result = handshakeHandler.handle(ctx.channel(), handshakeValue);
HandshakeData handshakeData = result.getHandshakeData();
setValue(packet, HANDSHAKE_HOST, handshakeData.getHostname());
logger.info(handshakeData.getHostname());
if (handshakeData.getDisconnectReason() != null) {
ctx.close(); // todo disconnect with message
return;
@@ -203,8 +206,6 @@ public final class SpigotDataHandler extends ChannelInboundHandlerAdapter {
player = result.getFloodgatePlayer();
bungeeData = SpigotUtils.isBungeeData();
setValue(packet, HANDSHAKE_HOST, handshakeData.getHostname());
if (!bungeeData) {
// Use a spoofedUUID for initUUID (just like Bungeecord)
setValue(networkManager, "spoofedUUID", player.getCorrectUniqueId());