Closed portlek closed 11 months ago
In what cases does the status get sent before PlayerJoinEvent? My understanding was that if velocity mode is enabled, the player joins, we add to map whilst waiting for confirmation from the proxy, then remove when the status is received from proxy.
It happens when you swtich servers. the resource pack status event runs first before the player join event, that causes the issue. actually it's not but you know putting null is still putting a KEY into the map, so if you have somehow a KEY that equls your unique id the movement will be prevented that's the core issue.
I'll test this shortly as I'm not 100% sure the logic is correct here
Well the issue is fixed and i've been using it since i made the changes and nothing wrong with it.
Is this related to #15? But that was only for DECLINED statuses in my testing. I still don't understand how a SUCCESSFULLY_LOADED can be sent before the player joins their new server, I can't reproduce this.
My understanding of the process is this: The player joins a server on the proxy -> the player is added to the waiting list -> any movement is prevented -> the resource pack for that server is sent -> the player sends ACCEPTED -> the player sends SUCCESSFULLY_LOADED -> player is removed from the waiting list
join server-1 wait for the resource pack load then switch to server-2. that's how it sends before the player join event for server-2.
I got round to testing this whilst rewriting a lot of the plugin.
The player is meant to be put into the map to allow prevent-movement and prevent-damage to work. Without this a client can bypass a resource pack by never sending a status.
I think the real fix to this is more complicated and will need to be addressed in a different PR/commit.
Causes a movement prevent issue.
SUCCESSFULLY_LOADED status will be send before PlayerJoinEvent so it won't be able to remove it in here
putting null in to a map is still putting a key with null value so, ExemptionListener will still prevent our movements.
Debug:
Update: Tested and it's working now.