Closed wxyz-abcd closed 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.
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.