Table of Contents

Interface IInteractableSystem

Namespace
FishMMO.Server.Core.World.SceneServer
Assembly
FishMMO.Server.dll

Engine-agnostic public API for interactable handling and validation. Implementations validate interactions and broadcast inventory/merchant updates. Interactable behaviour is now driven entirely by ECA triggers on each prefab.

public interface IInteractableSystem : IServerBehaviour, IServerComponent

Methods

OnInteractNPC(IPlayerCharacter, IInteractable)

Handles a player interacting with an NPC.

void OnInteractNPC(IPlayerCharacter character, IInteractable interactable)

Parameters

character IPlayerCharacter

The player character initiating the interaction.

interactable IInteractable

The interactable NPC being engaged.

SendNewItemBroadcast<T>(T, ICharacter, IInventoryController, Item)

Sends a new item broadcast notification to the specified connection.

bool SendNewItemBroadcast<T>(T conn, ICharacter character, IInventoryController inventoryController, Item newItem)

Parameters

conn T

The connection to notify.

character ICharacter

The character receiving the item.

inventoryController IInventoryController

The inventory controller managing the item.

newItem Item

The new item to broadcast.

Returns

bool

True if the broadcast was sent successfully; otherwise false.

Type Parameters

T

The connection type.

StartDialogueSession(IPlayerCharacter, ISceneObject, IDialogueInteractable)

Starts a dialogue session between a player character and a dialogue interactable.

void StartDialogueSession(IPlayerCharacter character, ISceneObject sceneObject, IDialogueInteractable dialogue)

Parameters

character IPlayerCharacter

The player character.

sceneObject ISceneObject

The scene object associated with the dialogue.

dialogue IDialogueInteractable

The dialogue interactable containing the dialogue data.

Events

OnPlayerInteracting

Raised for every interaction the system accepts — validated, in range, rate limited — before the interactable's own triggers run.

event Action<IPlayerCharacter, IInteractable> OnPlayerInteracting

Event Type

Action<IPlayerCharacter, IInteractable>

Remarks

How a module handles an interaction kind the interactable carries intrinsically rather than through a trigger list: the Commerce module opens a corpse's loot window here, so any NPC that can die is lootable without a content author having to remember a trigger, and a game without Commerce has corpses nobody can open. Handlers run on the main thread and must not throw.