wxyz-abcd / node-haxball

The most powerful and lightweight API that allows you to develop your original Haxball(www.haxball.com) host, client, and standalone applications both on node.js and browser environments and also includes every possible hack and functionality that you can imagine.
MIT License
34 stars 13 forks source link

"Auto" event #1

Closed wxyz-abcd closed 1 year ago

wxyz-abcd commented 1 year ago

This event might be specialized to send/receive different data than the original client. This would allow us to send a special signal that would only be understood by our modified client. (Still needs testing to prove it though.) The original auto event can easily be replaced by 1 or 2 PlayerTeamChanged events.

wxyz-abcd commented 1 year ago

Modifying the "auto" event required admin privileges and also caused desynchronization issues. Instead, "chat indicator" event was modified to be sent just once with some custom data just after joining a room, to indicate that we are using a special client. If the host is using the same client mechanism, it would understand this message and register the sender client as a custom client that can receive custom events.

There is also a CustomEvent that can be sent by Room.sendCustomEvent, and received by Plugin.onCustomEvent. Room.sendCustomEvent sends this custom event message to only modified clients, because sending any unregistered signal/event causes an error on original Haxball clients.