Table of Contents

Class ServerItemHooks

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Server-installed callbacks that let shared code hand an item change to the persistence layer without referencing the server assembly.

public static class ServerItemHooks
Inheritance
ServerItemHooks
Inherited Members

Remarks

Why these exist. The ECA actions that give, remove, equip and unequip items are shared code that runs on the server, and they used to mutate the containers and stop. Nothing persisted the change and nothing told the owning client, so a quest that handed out an item produced an item that vanished at the next snapshot or reappeared after a crash, and the player saw it only after a relog. Equip and unequip are covered by the controller's own OnServerEquipmentChanged; these two cover the inventory.

Installed by CharacterInventorySystem when it initialises and cleared when it goes away. Null on every other peer, and shared callers must treat null as "not the server".

Fields

GrantInventoryItem

Grants an item to a character's inventory: places it, tells the owner, persists it. Returns true when the whole item was placed.

public static Func<ICharacter, Item, bool> GrantInventoryItem

Field Value

Func<ICharacter, Item, bool>

InventoryChanged

Reports inventory rows that changed or ceased to exist outside the inventory system's own handlers, so they are written and the owner is told.

public static Action<ICharacter, IReadOnlyList<Item>, IReadOnlyList<RemovedItemRecord>> InventoryChanged

Field Value

Action<ICharacter, IReadOnlyList<Item>, IReadOnlyList<RemovedItemRecord>>

Remarks

Arguments: the character, the items whose rows changed (a reduced stack), and the items that were removed outright.