From 401af627ffa328b7e9a38aee02260bf9e33dae22 Mon Sep 17 00:00:00 2001 From: Mike <76-Mike@users.noreply.git.krews.org> Date: Tue, 5 May 2020 04:00:02 +0200 Subject: [PATCH] Fix exception spam on busy hotels. --- .../networking/gameserver/decoders/GameMessageHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameMessageHandler.java b/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameMessageHandler.java index 143b6c61..a0ba3112 100644 --- a/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameMessageHandler.java +++ b/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameMessageHandler.java @@ -11,6 +11,8 @@ import io.netty.handler.codec.TooLongFrameException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; + @ChannelHandler.Sharable public class GameMessageHandler extends ChannelInboundHandlerAdapter { private static final Logger LOGGER = LoggerFactory.getLogger(GameMessageHandler.class); @@ -53,6 +55,11 @@ public class GameMessageHandler extends ChannelInboundHandlerAdapter { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { + if (cause instanceof IOException) { + ctx.channel().close(); + return; + } + if (cause instanceof TooLongFrameException) { LOGGER.error("Disconnecting client, reason: \"" + cause.getMessage() + "\"."); } else {