Expand waterfall.packet-decode-logging

Bungeecord by default will supress the output of pretty much all decoder exceptions
by default, which in part moots some debug ability, especially when you can't even see
what packet was afflicated. This patch expands the existing system property in order
to increase the usefulness of the logged exceptions, and more, by ensuring that they're
fully printed, vs just having to rely on the max sizes, etc, as I've done in the past
This commit is contained in:
Shane Freeder 2022-06-19 10:14:49 +01:00
parent a033a14504
commit c10f289a57
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
From ec009a979056edb2b9db738ba7925399362cd54a Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 19 Jun 2022 10:31:51 +0100
Subject: [PATCH] Expand packet-decode-logging usage
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
index 33494237..29cf4b4f 100644
--- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
+++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java
@@ -142,6 +142,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - read timed out", handler );
} else if ( cause instanceof DecoderException )
{
+ // Waterfall start
+ if (net.md_5.bungee.protocol.MinecraftDecoder.DEBUG) {
+ java.util.logging.LogRecord logRecord = new java.util.logging.LogRecord(Level.WARNING, "{0} - A decoder exception has been thrown:");
+ logRecord.setParameters(new Object[]{handler});
+ logRecord.setThrown(cause);
+ ProxyServer.getInstance().getLogger().log(logRecord);
+ } else
+ // Waterfall end
if ( cause instanceof CorruptedFrameException )
{
ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - corrupted frame: {1}", new Object[]
--
2.36.1