Paper icon indicating copy to clipboard operation
Paper copied to clipboard

PlayerLoginEvent fires twice

Open TheMysterys opened this issue 3 years ago • 6 comments

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)

@EventHandler
public void playerLoginEvent (PlayerLoginEvent event) {
     System.out.println("Testing");
}

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

TheMysterys avatar Dec 15 '22 06:12 TheMysterys

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.

Machine-Maker avatar Dec 15 '22 06:12 Machine-Maker

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) You are running the latest version Previous version: git-Paper-169 (MC: 1.20.1)

Gameoholic avatar Sep 06 '23 06:09 Gameoholic

I can still reproduce this, was also able to get it to fire 3 times sometimes

Warriorrrr avatar Sep 15 '23 06:09 Warriorrrr