PaperMC / PaperMC/Velocity

Consider deprecating ServerConnectedEvent

Open
#569 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: feature
Dominant language
Java
Stars
2.3k
Forks
959
Avg merge
5d 10h
Merged PRs (30d)
2

Description

This event as currently implemented is fired between the connection to the previous user's server and the server they are actually connecting to. The implementation is fatally flawed, particularly as during this event Player#getCurrentServer() will return null. The event's current implementation came as the result of ViaVersion, but as of Velocity 3.0.0 it uses a different and much more reliable method of injection into Velocity connections. Therfore I believe most, if not all, uses of this event should be replaced with ServerPostConnectEvent which is the event that most users should use instead.

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 by tracing usages of ServerConnectedEvent and comparing them with ServerPostConnectEvent in the Velocity codebase. Review how each event is fired and how Player#getCurrentServer() behaves during dispatch. Done means deciding the deprecation and replacement scope, updating affected uses, and verifying the event behavior with the relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.