saviola777 / haxball-headless-manager

Suite of management scripts for headless haxball hosts, including plugins with dependency management
MIT License
7 stars 3 forks source link

Override global HBInit to provide dynamic plugin loading #13

Closed saviola777 closed 5 years ago

saviola777 commented 5 years ago

After pasting the HHM config into the dev console, the HBInit() function becomes essentially useless (it can only be called once). Additionally, the user has to type HHM.manager.addPluginByCode(the code,the-name); to load additional plugins.

To make this easier, the HHM should override the HBInit() function with a custom function that dynamically creates a new plugin. That way, the user can paste plugins or vanilla headless scripts into the dev console and they will be loaded normally. It's important to use var room = HBInit() for this to work.

A configurable timer should be used to determine when a plugin is ready to be loaded, since unlike with plugins loaded from scripts, we can't tell when a plugin has been completely executed on the dev console.

saviola777 commented 5 years ago

After considering the implications and the necessity of this feature, I have decided to not implement this for now. It's always possible to just use HHM.manager.addPluginByCode("code", "name").