Disconnected while attempting to connect to a server due to failed packet parsing
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 960
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 2
Description
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:
- Make yourself a /send command that does not have a cooldown
- Rapidly send yourself to three servers (not in the same instant, a few 100ms delays should do you good!)
- Disconnection should occur if the servers and client support the configuration state and if the player fails to connect to one of the servers due to a connection being "in progress".
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproduction steps in the issue: rapidly send a client to three servers while connections are still in progress, using clients that support the configuration state. Trace the transition to CONFIGURATION before a server send and the packet parsing that follows. Done means repeated sends no longer disconnect the client when a connection is already in progress.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100