ModAPI icon indicating copy to clipboard operation
ModAPI copied to clipboard

Hypixel server seems to send hello packet too early

Open My-Name-Is-Jeff opened this issue 1 year ago • 3 comments

~~Not too sure if this affects the official Mod API implementation~~ EDIT: Yes, it does affect the HypixelDev/ForgeModAPI implementation

On the Forge 1.8.9 client the value mc.netHandler depends on the player to be loaded in.

Sometimes the hello packet is received before the S01JoinGame packet, causing the registration packet to fail to send

My-Name-Is-Jeff avatar May 18 '24 21:05 My-Name-Is-Jeff

We send the hello packet at the same time the standard registration occurs. If this is an order of operations issue in forge, we may need to store a local reference to the net handler from the server connect event and use that. But I'm not sure if this is the best solution to this issue.

ConnorLinfoot avatar May 18 '24 21:05 ConnorLinfoot

We send the hello packet at the same time the standard registration occurs. If this is an order of operations issue in forge, we may need to store a local reference to the net handler from the server connect event and use that. But I'm not sure if this is the best solution to this issue.

the issue is caused by how the JoinGame packet is handled on the Minecraft client thread (and has to wait) while the hello packet would be handled immediately on the Netty thread

My-Name-Is-Jeff avatar May 18 '24 22:05 My-Name-Is-Jeff

We send the hello packet at the same time the standard registration occurs. If this is an order of operations issue in forge, we may need to store a local reference to the net handler from the server connect event and use that. But I'm not sure if this is the best solution to this issue.

the issue is caused by how the JoinGame packet is handled on the Minecraft client thread (and has to wait) while the hello packet would be handled immediately on the Netty thread

In that case, another option may be to schedule tasks onto the main thread and handling packets from there. I did create https://github.com/HypixelDev/ForgeModAPI/pull/2 with holding reference, but if scheduling onto the main thread works then that is likely a better approach, so I'll look into that.

ConnorLinfoot avatar May 18 '24 22:05 ConnorLinfoot

This should be fixed with the 0.5.0 release. I've been unable to reproduce the issue but it was also less common for me in the first place, so do let me know if you still see some issues.

ConnorLinfoot avatar Jun 16 '24 18:06 ConnorLinfoot