-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API - setRadioData & getRadioData #835
Conversation
Co-Authored-By: jonpas <jonpas33@gmail.com>
setRadioData is potentially a source of synchronisation issues between clients. The key is to mention that it has to be called globally - otherwise radio details will not be in sync. e.g. radio frequencies for one client may be out causing all sorts of issues. Please update the header to make this clear! (Might even be worth logging it's use should issues begin to appear!) |
What if we just made the effects global to prevent that issue? |
Most API methods in ACRE2 tend to have local effects so for consistency sake the local effect is useful. |
In this case though would it not be more useful to be global? Since it would be required anyway? I could add a |
Co-Authored-By: Ferran Obon <ferran@idi-systems.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking a bit about this and locality. The global parameter is a good idea, but something more important dawned on me.
Simple overriding the data doesn't quite feel right - This technically allows it to override radio data at any moment even. ACRE has an extensive system for synchronising data and processing events for setting channel data through sys_data
which houses a fair bit of the code.
I think opting to use events (it would probably require a new event) that sets the data is a better one. It would even allow the interface of the radio to update should the user have the device open/is broadcasting etc.
The major downside to the event approach is there is more code. I think there's two approaches either use the existing events and send a lot of them - I believe one would be required for each property inside the data as the current internal setData event sets one key/value at a time. The alternative would be to make a new event to set the entire radio data. The event system would also then handle the global transmission of data.
Having a function to save and load radio states will allow radio's to be persisted between play sessions on long campaigns. |
This should be changed to use data events as @Sniperhid got "dawned on". |
No further activity, would have to be re-done with data framework. |
When merged this pull request will:
acre_api_fnc_getRadioData
acre_api_fnc_setRadioData