OneLife icon indicating copy to clipboard operation
OneLife copied to clipboard

Objects with move transitions when held by client causes server to spam and disconnect all surrounding clients

Open connorhsm opened this issue 1 year ago • 2 comments

@jasonrohrer there have been multiple cases where objects cause all players in an area to disconnect.

This is happening where an animal has multiple objects, a ground and a held version. The ground version has a move transition and also transitions into the held version when picked up or picked out of a container.

Because the ground version has a move transition, it cannot be held by the player. If it is, the player cannot put it down and the server aggressively spams all surrounding clients with the update, with no end until the player starves.

There are many ways you could accidentally achieve this with the editor, but in this case you're able to put the ground version in a clothing slot when the clothing is on the ground, if you then put the clothing on yourself and take the ground version out of the slot, it does not transition into the held version.

This is rather easy to happen in an environment like AHAP where these concepts are easily forgotten.

https://github.com/user-attachments/assets/cd98bfa5-bd5e-40b8-92b0-b11d55e7d5a3

connorhsm avatar Jul 20 '24 12:07 connorhsm

Disconnect is apparent on the live server, but not locally as shown in the video.

connorhsm avatar Jul 20 '24 12:07 connorhsm

Currently effects

  • https://ahap.info/197-Domestic-Boop
  • https://ahap.info/923-Wandering-Space-Whale-slotsInvis
    • Unclear of the exact way this one is picked up, but somewhere around taking the last object out of it, you're able to pick up its ground version

connorhsm avatar Jul 20 '24 13:07 connorhsm

Two fixes are needed here:

  1. If an object tries to move in the player's hands, it does a self-to-self transition. The server code currently doesn't update the heldEtaDecay time when this happens, so the stale decay time persists, causing the transition to be attempted over and over. This can be fixed by resetting the heldEtaDecay time correctly when a held object goes through a legit self-to-self transition. There are other cases in the server code where handleHoldingChange is called where we do NOT want to update the decay times in cases where the held object doesn't change (we generally call handleHoldingChange all over the place as a kind of catch-all). So we need a special case where we can force a change even when the object doesn't change, so the decay time gets updated. We need to fix this regardless, because it's too easy to forget to make a "held state" for a moving object, and it's also easy to forget to make a transition from ground-to-held for such objects. If a player ever is holding a moving object, it shouldn't break everything.

  2. When taking an object out of a clothing slot, it should go through a pick-up transition, if one exists. Currently, that's not happening (though it does happen correctly when removing an object from a container on the ground).

jasonrohrer avatar Oct 13 '25 16:10 jasonrohrer

Both the above fixes have been implemented.

jasonrohrer avatar Oct 13 '25 17:10 jasonrohrer