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

Make event API more consistent #11

Closed saviola777 closed 5 years ago

saviola777 commented 5 years ago

The native API handles player object and IDs consistently like this:

This is currently not done in the same way in HHM, but I am instead using the player ID everywhere. The idea behind that was to force room.getPlayer() to be called which could be extended and return a different player object than the native room.getPlayer. Injecting that logic into the event dispatching process what not possible until recently, when pre- and post-event handler hooks were introduced.

In short, the following changes are necessary: