Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Avoid respawn desync of player metadata

Open Lulu13022002 opened this issue 2 years ago • 3 comments

Closes #8689 Avoid to desync the player metadata on respawn and world teleport Before the 1.19.3 the metadata was copied with the respawn packet but now it's not always the case (notably at the death) And since upstream doesn't recreate the player instance, the metadata aren't dirty anymore here and so aren't resend to the client later. This emulate the behavior of like if the player was recreated with the default values to avoid a total reset at the respawn packet.

Lulu13022002 avatar Dec 17 '22 13:12 Lulu13022002

Do the other synced values not need to be resent? I would think that instead what we should do here is mark all of the sync values as dirty?

Owen1212055 avatar Dec 17 '22 19:12 Owen1212055

The respawn packet will already do that for us in case of a world teleport. For the death all values are reset in vanilla except those i have marked as dirty here

Lulu13022002 avatar Dec 17 '22 19:12 Lulu13022002

Upstream has pushed a fix for that to update all metadata when not default, this solve the skin desync and those metadata desync (clientside) but since upstream has also a lot of desync (serverside) that happens when a player died (due to some missing metadata reset in the ServerPlayer#reset to again simulate the Player instance recreated) that brings back those desync into the client. Then there no desync at all but it's not anymore vanilla and also that send another packet when the player change of dimension with portal for no reason. So if we want to keep the upstream patch we would need to reset all the metadata on death serverside otherwise some metadata will not be reinitialized properly. Those desync are also present in this patch but aren't resend to the client so ideally we would recreate the instance for a proper fix.

Lulu13022002 avatar Dec 28 '22 18:12 Lulu13022002

Closing as upstream has fixed this and just resends everything.

Owen1212055 avatar Feb 11 '23 15:02 Owen1212055