Table of Contents

Struct EquipmentChange

Namespace
FishMMO.Shared.Core
Assembly
FishMMO.Shared.dll

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

IItemContainer

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

int

ContainerType

Which container Container is, for the persistence row.

public readonly InventoryType ContainerType

Field Value

InventoryType

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

Item

The item that moved: into Socket for an equip, out of it for an unequip.

public readonly Item Item

Field Value

Item

Kind

Whether an item entered or left the socket.

public readonly EquipmentRequestKind Kind

Field Value

EquipmentRequestKind

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

List<Item>

Socket

The equipment socket involved.

public readonly ItemSlot Socket

Field Value

ItemSlot

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

item Item
socket ItemSlot
container IItemContainer
containerType InventoryType
sourceIndex int
displacedItem Item

Returns

EquipmentChange

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

item Item
socket ItemSlot
container IItemContainer
containerType InventoryType
landedIndex int
modifiedItems List<Item>

Returns

EquipmentChange