Struct EquipmentChange
One equipment mutation the server has just applied, described completely enough to be persisted and reported without re-reading the containers.
public readonly struct EquipmentChange
- Inherited Members
Remarks
Raised by OnServerEquipmentChanged from inside the controller's own equip and unequip, so it covers every server-side path — the owner's predicted request, an ECA action, anything a later system adds — with one subscriber. The persistence layer used to live in the broadcast handler and so only ever saw the one path that went through it; an ECA equip rearranged item ownership between containers and wrote nothing.
Holds live Item references. It is consumed synchronously on the main thread by the subscriber, which turns it into persistence rows before anything else can run.
Fields
Container
The container on the other side of the move: the source of an equip, the destination of an unequip.
public readonly IItemContainer Container
Field Value
ContainerIndex
For an equip, the index the item came from — and where DisplacedItem now sits, if there was one. For an unequip, the index the item landed in.
public readonly int ContainerIndex
Field Value
ContainerType
Which container Container is, for the persistence row.
public readonly InventoryType ContainerType
Field Value
DisplacedItem
For an equip that replaced an equipped item, the item that was pushed back into the container. Otherwise null.
public readonly Item DisplacedItem
Field Value
Item
The item that moved: into Socket for an equip, out of it for an unequip.
public readonly Item Item
Field Value
Kind
Whether an item entered or left the socket.
public readonly EquipmentRequestKind Kind
Field Value
ModifiedItems
For an unequip, every container item the placement touched — the item itself, or the stacks it merged into. Null for an equip.
public readonly List<Item> ModifiedItems
Field Value
Socket
The equipment socket involved.
public readonly ItemSlot Socket
Field Value
Methods
ForEquip(Item, ItemSlot, IItemContainer, InventoryType, int, Item)
Describes an item that just entered a socket.
public static EquipmentChange ForEquip(Item item, ItemSlot socket, IItemContainer container, InventoryType containerType, int sourceIndex, Item displacedItem)
Parameters
itemItemsocketItemSlotcontainerIItemContainercontainerTypeInventoryTypesourceIndexintdisplacedItemItem
Returns
ForUnequip(Item, ItemSlot, IItemContainer, InventoryType, int, List<Item>)
Describes an item that just left a socket.
public static EquipmentChange ForUnequip(Item item, ItemSlot socket, IItemContainer container, InventoryType containerType, int landedIndex, List<Item> modifiedItems)
Parameters
itemItemsocketItemSlotcontainerIItemContainercontainerTypeInventoryTypelandedIndexintmodifiedItemsList<Item>