From dd1fbb948b867405b0273cc346959a793a5d9d48 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 15 Sep 2020 18:12:01 +0100 Subject: [PATCH] Add the ability to generate decoder traces for debugging --- ...to-generate-decoder-traces-for-debug.patch | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 BungeeCord-Patches/0059-Add-the-ability-to-generate-decoder-traces-for-debug.patch diff --git a/BungeeCord-Patches/0059-Add-the-ability-to-generate-decoder-traces-for-debug.patch b/BungeeCord-Patches/0059-Add-the-ability-to-generate-decoder-traces-for-debug.patch new file mode 100644 index 0000000..aeceaa2 --- /dev/null +++ b/BungeeCord-Patches/0059-Add-the-ability-to-generate-decoder-traces-for-debug.patch @@ -0,0 +1,44 @@ +From 571479857c831423a4e20e11e86913719e969a19 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Tue, 15 Sep 2020 18:11:49 +0100 +Subject: [PATCH] Add the ability to generate decoder traces for debugging + + +diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java b/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java +index 2583aa2c..334d5054 100644 +--- a/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java ++++ b/protocol/src/main/java/net/md_5/bungee/protocol/FastDecoderException.java +@@ -4,6 +4,7 @@ import io.netty.handler.codec.DecoderException; + + public class FastDecoderException extends DecoderException { + ++ private static final boolean PROCESS_TRACES = Boolean.getBoolean("waterfall.decoder-traces"); // Waterfall + public FastDecoderException(String message, Throwable cause) { + super(message, cause); + } +@@ -15,12 +16,22 @@ public class FastDecoderException extends DecoderException { + @Override + public Throwable initCause(Throwable cause) + { ++ // Waterfall start ++ if (PROCESS_TRACES) { ++ return super.initCause(cause); ++ } ++ // Waterfall end + return this; + } + + @Override + public Throwable fillInStackTrace() + { ++ // Waterfall start ++ if (PROCESS_TRACES) { ++ return super.fillInStackTrace(); ++ } ++ // Waterfall end + return this; + } + } +-- +2.28.0 +