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:
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user