PaperMC / PaperMC/Velocity

Disconnected while attempting to connect to a server due to failed packet parsing

Open
#1,272 4 comments 0 reactions 0 assignees View on GitHub

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.

image

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:

  1. Make yourself a /send command that does not have a cooldown
  2. Rapidly send yourself to three servers (not in the same instant, a few 100ms delays should do you good!)
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.