Skip to content
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

ServerPostConnectEvent fires before the player connection is complete (Only 1.20.2) #1102

Open
VelVeV opened this issue Oct 12, 2023 · 6 comments
Labels
type: bug Something isn't working

Comments

@VelVeV
Copy link
Contributor

VelVeV commented Oct 12, 2023

ServerPostConnectEvent fires before the player connection is complete (Only 1.20.2)

@VelVeV
Copy link
Contributor Author

VelVeV commented Oct 12, 2023

#1097 (comment)

@VelVeV
Copy link
Contributor Author

VelVeV commented Oct 13, 2023

Plugins that use ServerPostConnectEvent cause client errors because the event is fired before the player has completed connecting.

@SladeHazard
Copy link

SladeHazard commented Oct 22, 2023

can confirm.

  @Subscribe(order = PostOrder.EARLY)
   public void onPlayerChat(ServerPostConnectEvent event) {
       if (!event.getPlayer().getCurrentServer().isPresent())
           return;
/*        if (event.getPlayer().getCurrentServer().get().getServerInfo().getName().equalsIgnoreCase("hub"))
           return;
       if (event.getPlayer().getCurrentServer().get().getServerInfo().getName().equalsIgnoreCase("hub-02"))
           return;*/
       for (int i = 0; i < 300; i++)
           event.getPlayer().sendMessage(this.message);
   }

the messages are being sent in a weird way, way after the login

@diamkil
Copy link

diamkil commented Nov 29, 2023

How is this software breaking bug still not fixed.. Prevents any 1.20.2 players from joining with 1.20.2 Velocity and Viaversion only.. 1.20.1 players can join though

@electronicboy
Copy link
Member

I generally fail to understand the issue here, and between my sight issues and health, I don't have the means to go crazy testing
This event is sent from the join game packet and always has been, there is 0 garauntees that it's safe to send anything like messages as the client is still in the loading screens as it's not in the world yet; No idea what you mean by client errors, and errors induced due to stuff like via are generally not our issue

@Coloryr
Copy link

Coloryr commented Jan 5, 2024

Sometime client will disconnect with The package is too large or Reading data beyond range when send plugin message with player just join the server.
This issue occurs at 1.20.2 and when using my plugin.
When I delay the send plugin message pack by 500ms or longer, it will not occur.

@4drian3d 4drian3d added the type: bug Something isn't working label Jan 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants