From 5e783312c74a70432b09a1581f4b5e01363dc0a6 Mon Sep 17 00:00:00 2001 From: Kas-tle <26531652+Kas-tle@users.noreply.github.com> Date: Fri, 12 Apr 2024 05:54:18 -0700 Subject: [PATCH] Remove unused postinitchannel GeyserServerInitializer --- .../network/GeyserServerInitializer.java | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/network/GeyserServerInitializer.java b/core/src/main/java/org/geysermc/geyser/network/GeyserServerInitializer.java index d869a96bd..662e2f4c7 100644 --- a/core/src/main/java/org/geysermc/geyser/network/GeyserServerInitializer.java +++ b/core/src/main/java/org/geysermc/geyser/network/GeyserServerInitializer.java @@ -80,38 +80,6 @@ public class GeyserServerInitializer extends BedrockServerInitializer { } } - @Override - protected void postInitChannel(Channel channel) throws Exception { - super.postInitChannel(channel); - - channel.pipeline().addLast(new SimpleChannelInboundHandler() { - private static final int allowedExceptions = 5; - private static final long delayUntilExceptionsReset = 60; - - private long lastException; - private int exceptionCounts; - - @Override - protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception { - ctx.fireChannelRead(msg); - } - - @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { - final long currentTime = System.currentTimeMillis(); - if (currentTime >= lastException + (delayUntilExceptionsReset * 1000)) { - exceptionCounts = 0; - } - lastException = currentTime; - if (exceptionCounts++ > allowedExceptions) { - ctx.pipeline().get(GeyserBedrockPeer.class).close("Too many exceptions created."); - return; - } - super.exceptionCaught(ctx, cause); - } - }); - } - @Override protected BedrockPeer createPeer(Channel channel) { return new GeyserBedrockPeer(channel, this::createSession);