haxball-room-trapper

This module contains documentation for components of the haxball room trapper.

Description

This module contains documentation for components of the haxball room trapper.

From the GitHub page:

This is a module for intercepting the setting and removing of HaxBall RoomObject event handlers and properties. It has been made for a plugin system for the HaxBall headless in mind.

The module allows the plugins to manage room properties and event handlers exactly like with the vanilla room object, but in the background a trappedRoomManager manages access to the proxied room object as well as storage and execution of event handlers and properties for each plugin.

Instead of allowing a plugin to assign a handler or property to the RoomObject, a Proxy is created with the method RoomTrapper.createTrappedRoom and injected to be used by the plugin instead. The created Proxy will intercept the setting, unsetting, as well as accessing and enumeration of handlers and properties and instead will redirect the calls to the trappedRoomManager. Other properties and methods of the RoomObject are available to be used through the Proxy normally.