DungeonEntranceHandler - jimdroberts/FishMMO GitHub Wiki
DungeonEntranceHandler
handles interactions with dungeon entrance objects on the server in FishMMO. It allows players to open the dungeon finder interface.
-
public void HandleInteraction(IInteractable interactable, IPlayerCharacter character, ISceneObject sceneObject, InteractableSystem serverInstance)
Handles the interaction between a player character and a dungeon entrance. Broadcasts dungeon finder data to the client. Parameters: - IInteractable interactable: The interactable object (should be a dungeon entrance). - IPlayerCharacter character: The player character interacting with the dungeon entrance. - ISceneObject sceneObject: The scene object associated with the interaction. - InteractableSystem serverInstance: The server instance managing interactables.
- Register
DungeonEntranceHandler
as the handler for dungeon entrance interactables on the server. - The handler will automatically process player interactions and broadcast the appropriate data to the client.
// Example 1: Handling a dungeon entrance interaction
dungeonEntranceHandler.HandleInteraction(interactable, character, sceneObject, serverInstance);
- Ensure the handler is registered for the correct interactable types.
- Use the handler to trigger the dungeon finder UI for a seamless player experience.
- Validate all interaction data before broadcasting to clients.