BankerHandler - jimdroberts/FishMMO GitHub Wiki

Description

BankerHandler handles interactions with banker objects on the server in FishMMO. It allows players to access their bank and triggers NPC interaction logic.


API Access

Methods

  • public void HandleInteraction(IInteractable interactable, IPlayerCharacter character, ISceneObject sceneObject, InteractableSystem serverInstance)

    Handles the interaction between a player character and a banker. Sets the last interactable ID, broadcasts bank access to the client, and triggers NPC look-at logic. Parameters: - IInteractable interactable: The interactable object (should be a banker). - IPlayerCharacter character: The player character interacting with the banker. - ISceneObject sceneObject: The scene object associated with the interaction. - InteractableSystem serverInstance: The server instance managing interactables.


Basic Usage

Setup

  1. Register BankerHandler as the handler for banker interactables on the server.
  2. The handler will automatically process player interactions and broadcast the appropriate data to the client.

Example

// Example 1: Handling a banker interaction
bankerHandler.HandleInteraction(interactable, character, sceneObject, serverInstance);

Best Practices

  • Ensure the handler is registered for the correct interactable types.
  • Use the handler to trigger both client UI and NPC logic for a seamless player experience.
  • Validate all interaction data before broadcasting to clients.
⚠️ **GitHub.com Fallback** ⚠️