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
characterIPlayerCharacterThe player character initiating the interaction.
interactableIInteractableThe 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
connTThe connection to notify.
characterICharacterThe character receiving the item.
inventoryControllerIInventoryControllerThe inventory controller managing the item.
newItemItemThe new item to broadcast.
Returns
- bool
True if the broadcast was sent successfully; otherwise false.
Type Parameters
TThe 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
characterIPlayerCharacterThe player character.
sceneObjectISceneObjectThe scene object associated with the dialogue.
dialogueIDialogueInteractableThe 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
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.