-
-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disconnected while attempting to connect to a server due to failed packet parsing #1272
Comments
Thats a client-side race condition as the client send ChatSession PLAY-state packet asynchronously. You can disable chat signing as a workaround ( |
As stated here, it is a workaround but it is unfortunately not a fix. I don't experience this problem anymore as I've avoided the initial issue that caused the players to be sent to the servers while there is a connection already in progress, but it doesn't help our commands to forcibly send players (or mass send all players, which would be a headache) to servers. This should really be patched on velocity's end, as the server itself wouldn't be sending the join packet to request the chat session unless itself was fully out of the configuration state, which it is. I'm suspecting velocity somehow temporarily throws the client in to the configuration state while it's attempting to figure out whether it should send them to another server or not, which it shouldn't do (although admittedly I don't touch velocity's backend enough to know anything about the way it operates, I'm just making assumptions based off of the packet logging I've done). |
Here's an example of this occurring to me with potentially relevant and useful logs for fixing this issue. |
Ideally it should be fixed client-side as fixing it properly at server-side will be "very hard" due to client sometimes break or delay chat signing initialization by itself. It can be partially fixed by waiting for ChatSession packet before trying to switch to the configuration state, but it will not fix this race condition completly, like if the client is overloaded with receiving skins, http requests is blocked client-side, background thread pool is overloaded or client uuid is changed by the server, client will delay or even will never send ChatSession packet. Also, looks like Mojang fixed some client-side configuration state race conditions in 1.20.5, but this one is left untouched. |
While tracking down another bug I'd caused in a plugin, I'd stumbled upon an issue regarding the way that velocity handles it's server connections for clients on 1.20.2 and above due to the configuration state.
Players will be disconnected with the following message if you attempt to send them to a server while a connection to another server is already in progress. This did not happen to clients prior to 1.20.2's release due to the configuration state not existing.
This is due to the player's state being switched to CONFIGURATION pre-server send, I believe, which doesn't allow the client to parse any play-related packets, resulting in the client kicking itself because it thinks that it has found an incorrect packet ID.
To replicate, it is relatively simple:
This does not happen 100% of the time, as it is wholly dependent on the stage that the client is at when it is parsing packets.
The text was updated successfully, but these errors were encountered: