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

Remove Geyser -> Bungee Floodgate data after use

This commit is contained in:
Tim203
2021-09-24 20:26:09 +02:00
parent cc3e5f999f
commit 95a51480f0
3 changed files with 5 additions and 4 deletions

View File

@@ -121,6 +121,8 @@ public class BungeeProxyDataHandler extends ChannelInboundHandlerAdapter {
channelWrapper.setRemoteAddress(newIp);
}
packet.setHost(handshakeData.getHostname());
if (handshakeData.getDisconnectReason() != null) {
ctx.channel().attr(kickMessageAttribute).set(handshakeData.getDisconnectReason());
return;

View File

@@ -67,8 +67,7 @@ public class BungeeServerDataHandler extends ChannelOutboundHandlerAdapter {
private final AttributeKey<FloodgatePlayer> playerAttribute;
@Override
public void write(ChannelHandlerContext ctx, Object packet, ChannelPromise promise)
throws Exception {
public void write(ChannelHandlerContext ctx, Object packet, ChannelPromise promise) {
if (packet instanceof Handshake) {
// get the Proxy <-> Player channel from the Proxy <-> Server channel
HandlerBoss handlerBoss = ctx.pipeline().get(HandlerBoss.class);

View File

@@ -119,6 +119,8 @@ public final class VelocityProxyDataHandler extends ChannelInboundHandlerAdapter
setValue(connection, REMOTE_ADDRESS, newIp);
}
setValue(packet, HANDSHAKE_SERVER_ADDRESS, handshakeData.getHostname());
if (handshakeData.getDisconnectReason() != null) {
ctx.channel().attr(kickMessageAttribute).set(handshakeData.getDisconnectReason());
return;
@@ -149,8 +151,6 @@ public final class VelocityProxyDataHandler extends ChannelInboundHandlerAdapter
FloodgatePlayer player = result.getFloodgatePlayer();
setValue(packet, HANDSHAKE_SERVER_ADDRESS, handshakeData.getHostname());
logger.info("Floodgate player who is logged in as {} {} joined",
player.getCorrectUsername(), player.getCorrectUniqueId());
}).handle((v, error) -> {