BindstoneHandler - jimdroberts/FishMMO GitHub Wiki

Description

BindstoneHandler handles interactions with bindstone objects on the server in FishMMO. It allows players to set their respawn location to the current scene and position.


API Access

Methods

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

    Handles the interaction between a player character and a bindstone. Validates character and scene, then sets the character's bind position and scene for respawn. Parameters: - IInteractable interactable: The interactable object (should be a bindstone). - IPlayerCharacter character: The player character interacting with the bindstone. - ISceneObject sceneObject: The scene object associated with the interaction. - InteractableSystem serverInstance: The server instance managing interactables.


Basic Usage

Setup

  1. Register BindstoneHandler as the handler for bindstone interactables on the server.
  2. The handler will automatically process player interactions and update the character's respawn location.

Example

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

Best Practices

  • Ensure the handler is registered for the correct interactable types.
  • Validate that the character and scene are correct before updating respawn data.
  • Log and handle errors gracefully to aid in debugging and player support.
⚠️ **GitHub.com Fallback** ⚠️