PaperMC / PaperMC/Waterfall

Login event should be called after disconnect event, when we have multiple connections for the same player

Open
#604 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
752
Forks
307
Avg merge
15h 48m
Merged PRs (30d)
7

Description

Currently (Version: 1.16.4 / #393) when a player connects to the proxy, when another connection for the same player is still online (out of whichever reasons), it can happen that the login event for the new connection is called before the old connection has their disconnect.

This situation can lead to some problems for custom plugins / development with the order of events and you can't make sure that the order is always disconnect and than login. So you maybe have to do some manual checks in the login event.

grafik

As @electronicboy stated in Discord it "would need look into making it happen as a callback in netty if it lets us". It would therefore be good if this is checked so that you can always maintain a defined order of events for a player. Alternatively, one could generally think about whether a new connection should be allowed at all as long as an old connection still exists.

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

Trace the connection lifecycle and login/disconnect event dispatch, starting with the Netty callback mentioned in the issue. Determine how duplicate connections are handled and verify the change by reproducing the case; done means the old connection's disconnect event always occurs before the new connection's login event.

Written by the indexing model from the issue text.

Assessment

Domain
networking
Issue type
Bug
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.