HypixelDev / ModAPI

Hypixel Mod API for interfacing with the Hypixel Server via the Minecraft Plugin Message system.
MIT License
83 stars 10 forks source link

improvement: Change packet handling to only handle the expected version #18

Closed ConnorLinfoot closed 7 months ago

ConnorLinfoot commented 7 months ago

Originally I hoped to use the versioning for some form of backward compatibility, but due to different versions of packets potentially resulting in different behavior, this could have unexpected consequences. This change results in us only reading and handling packets that we "understand" based on the current version, so if the primary packet handler receives an old or new packet then it will simply stop reading after the version and not invoke the registered handlers.