-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
(See #43)
If a client interacts with a Piece that they've newly created, like a chest, this can happen:
- Client places container; client owns container.
- Client interacts with container
- Container.Interact invokes "RequestOpen" RPC
- Because the client owns the container, "RequestOpen" RPC is not routed to the server and is instead called on the client immediately
- Container.RPC_RequestOpen is called
- Sets owner to the client (does nothing because already owned by client)
- Invokes "OpenRespons" RPC which is is not routed to the server and is instead called on the client immediately
- Container.RPC_OpenRespons is called
- Calls InventoryGui.instance.Show(this)
Meanwhile, InventoryGui.UpdateContainer runs this every frame:
if (this.m_currentContainer && this.m_currentContainer.IsOwner())
{
this.m_currentContainer.SetInUse(true);
}Which chains to Container.UpdateUseVisual which calls:
if (this.m_nview.IsOwner())
{
flag = this.m_inUse;
this.m_nview.GetZDO().Set("InUse", this.m_inUse ? 1 : 0);
};So ultimately, the client is able to set the "InUse" value on the ZDO because as far as it's concerned it's the owner. Then when the ownership change arrives from the server, the client gets kicked out of the container but can't unset the "InUse" key because the client no longer owns the container. The chest is now broken until all players leave the area and return at which point the chest is recreated and now works correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels