-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
PlayerLoginEvent fires twice #8676
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
Comments
As far as I can tell, when the Connection is first disconnected, the channel is requested to close, but upstream removed the "await" part of that close, so the next tick happens and the channel isn't fully closed which makes the player's login be attempted to be handled again. |
I can't seem to reproduce this, was this fixed already? This server is running Paper version git-Paper-170 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 39953cf) |
I can still reproduce this, was also able to get it to fire 3 times sometimes |
I can't find exactly when this got fixed, but we now check if the connection is still open before going through this logic, which fixes this issue. |
I can still reproduce this issue
iirc that was there before. The problem resides Paper/paper-server/patches/sources/net/minecraft/network/Connection.java.patch Lines 238 to 249 in bb1beda
and (actually where the event is fired) Lines 70 to 72 in bb1beda
The isConnected checks if the channel is still open, but since this part of the process runs on the server thread, Channel#close needs to jump to the netty event loop. No clue why this would take multiple tick-times to process, especially on a simple test server, but I guess it can. Simple solution would be to gate disconnection behind a CAS and have isConnected check that but, bleh
|
Expected behavior
When a player connects, the event should only fire once
Observed/Actual behavior
The event fires twice
Steps/models to reproduce
Add the below event listener to your plugin (This event listener can be replaced by turning on the whitelist and looking at the "Disconnecting" logs. The addition of code just makes it a bit easier to see)
Join on an account and "Testing" will be logged twice
Plugin and Datapack List
[22:58:48 INFO]: Plugins (3): Campfire, LuckPerms, spark
Paper version
[22:58:00 INFO]: This server is running Paper version git-Paper-333 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT) (Git: eec64a4)
You are running the latest version
Other
No response
The text was updated successfully, but these errors were encountered: