ProtocolLib

3M Downloads

Sending a pong packet with a specific id (trying to replace transaction packets with ping-pong packets to support 1.17)

Nort721 opened this issue ยท 1 comments

commented

Describe the bug
until now I was sending a transaction packet to the client with a specific number so I will be able to identify when the client responds to my specific transaction since the client responds with the "same packet", now in 1.17 transaction packets have been removed and replaced by PING PONG packets which from my understanding have more or less the same behavior as transactions had

Anyways I'm trying to send a PONG packet with ProtocolLib with a specific "id" number but I'm getting a weird issue where the client is getting kicked with a console error saying
"Nort721 lost connection: Internal Exception: io.netty.handler.codec.EncoderException: java.io.IOException: Can't serialize unregistered packet"
And on the client screen you see:
Capture
the number, in that case, was -1 and I'm getting the same behavior if I send it with 0

To Reproduce
Steps to reproduce the behavior:

  1. just try sending a pong packet with a number in and yeah you'll get the same issue

Expected behavior
I expect the client to respond by sending a PING packet to the server with the same number that was in the pong I sent

Screenshots
provided above

Version Info
https://pastebin.com/Sx4AShbd

Additional context
here is my code for sending the pong packet, I'm intentionally showing the entire function to show the context of what I'm trying to do
https://pastebin.com/mmtQ1JmL

I hope you can help me figure this out, like what I'm doing wrong, I'm not really sure if its me doing something wrong or a bug in ProtocolLib

commented

nevermind I solved the issue, my understanding of PING PONG packets was wrong