From b2d9e11217f2440808e8e6baddafa0595e47365d Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 6 Aug 2020 07:42:42 -0400 Subject: [PATCH] Fix packet decode logging not giving useful errors See #349 for context --- .../velocitypowered/proxy/connection/MinecraftConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java index c3212d09..e99ddf21 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftConnection.java @@ -157,9 +157,9 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter { logger.error("{}: read timed out", association); } else { boolean isQuietDecoderException = cause instanceof QuietDecoderException; - boolean willLogQuietDecoderException = isQuietDecoderException + boolean willLogQuietDecoderException = MinecraftDecoder.DEBUG || (isQuietDecoderException && !(sessionHandler instanceof LoginSessionHandler) - && !(sessionHandler instanceof HandshakeSessionHandler); + && !(sessionHandler instanceof HandshakeSessionHandler)); if (willLogQuietDecoderException) { logger.error("{}: exception encountered in {}", association, sessionHandler, cause); } else if (isQuietDecoderException) {