ProtocolLib

3M Downloads

ProtocolLib reports incorrect PacketType under CatServer (Bukkit-Forge hybrid server)

NewbieOrange opened this issue ยท 1 comments

commented

Describe the bug
This is a follow-up issue of #825.

While ProtocolLib does load and receive & send packets under CatServer, the received packet sometimes gives incorrect PacketType. This behaviour breaks plugins using PacketType to determine which packet is received.

To Reproduce
The reproduce example is using plugin FastLogin. Any other plugin should have the similar results.

Note that probably only a portion, not all of the PacketTypes are incorrectly identified.

Steps to reproduce the behavior:

  1. Login to a server with FastLogin installed.
  2. Stack trace printed to the console.

Expected behavior
Correct PacketType value is expected. In this case, the Login.Client.LoginInStart packet is recognized as another type, causing FastLogin to access non-existent fields.

I have not analyzed which type ProtocolLib gives, but adding two temporary packet listener using /packet command to Login.Client.Start and Login.Client.EncryptionBegin gives no message when a player logs in.

Screenshots
Exception stack traces: https://pastebin.com/sYJGCyup

Version Info
https://pastebin.com/Jf6Sq9RY

Additional context
A workaround fix for FastLogin games647/FastLogin#360 fixed the issue under CatServer, confirming ProtocolLib does report wrong PacketType.

commented

I might have some idea on how to fix this... May make a PR soon.