Hi, I was looking around for a way to do stuff after Packets are sent / received.
With "do stuff" I mean things like display packet info on the screen or in the Minecraft game output. I found a lot of posts about this, but the unhelpful standard answers were always something like "There are no events fired for vanilla packets" or questions like "Why you need to interact with Vanilla packets?". The most helpful forum post I found was the following one, but the presented solution is to work with mixins, which is a bit much for just a little debug info.
So here it goes:
Why I want to do this
Originally I just want to find out why Hypixel kicks me from time to time and if I can do someting about it, but then my investigation got a little out of hand. I did get quite far using Wireshark and the Minecraft game output (for crossreferencing IOException timestamps), but as the TCP packets are encrypted, compressed and in encoded, I hit a dead end with my diagnostics.
Now the idea was to do a simple System.out.println(); each time a KeepAlive packet gets sent or received (which should be about ever 15 to 120 seconds or so depending on server and client settings), as a missing KeepAlive packet can be one of the reasons why a server would kick a client using a TCP RST packet. This way I would know which of the packets are the KeepAlive ones and when they are sent and received.
Thanks