move_speed will silently desync if the player-list reset packet is ever sent #26
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The client keeps a player's render speed in a per-slot byte set by the
move_speedmask, andWorld.Player.report_speed/2sends it only when the valuechanges. That is correct as long as the client's copy only ever changes when we
say so.
There is one packet that changes it behind our back: the one that clears the
whole player list also resets every slot's speed to
1and re-seeds the localplayer. We do not send it today — the ordinary scene rebuild leaves the array
alone, which is why change-only sending is safe right now.
The moment anything sends it — instancing, a forced world reset, a re-login path
that reuses the connection — every player's speed silently reverts to walk on
the client while the server still believes it sent
2. Nothing will changeagain, so nothing will be re-sent, and running renders at walking pace until the
next time the value happens to change. That failure mode is a slow drift of the
avatar behind its true tile, not an error.
World.addition_masks/1already handles the sibling case, restating the speedfor anyone entering a viewer's view rather than waiting for a change.
Shape of a fix
Whatever ends up sending that packet must also invalidate every player's cached
speed so the next tick restates it. Worth a note next to
report_speed/2now soit is found when it matters.