Fix select_known_packs registered multiple times#1383
Fix select_known_packs registered multiple times#1383ryanalexander wants to merge 1 commit intoPrismarineJS:masterfrom
Conversation
|
Just noticed this is a duplicate of #1381 |
|
If you have details on why this is correct or even could add a non regression test it would be useful |
"If multiple sperm fertilize an egg (a condition called polyspermy), it typically leads to a non-viable embryo with an abnormal number of chromosomes, usually resulting in the development halting" Similar occurs with an event listener. If multiple register, the response fires multiple times halting the connection. -- Non smart-ass answer The protocol specification means that the pack reply needs to be 1:1 with requests. By registering .on rather than .once, we are causing our method to be called on each emit multiplied by the number of times we have gone into the configuration stage. While adding non regression testing specifically for this PR would be difficult due to the requirement of having a server change the connection back into configuration stage, this has been manually tested for direct connections to a minecraft vanilla, spigot and paper server, as well as those proxied by Bungeecord and Velocity. As for why it is correct... There are not really any sources other than reviewing NMS which confirms that sending a resource pack response past the configuration stage will result in a premature socket closure. |
|
If it helps, there was a discussion on this topic found here. (main discord server) https://discord.gg/YKG6fdKYbB |
select_known_packs was registering a listener each time the client went into configuration state. Causes issues with Bungeecord.
This fixes people complaining about 1.21.1 bungeecord & velocity issues