Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

BrettMayson
Copy link
Contributor

When merged this pull request will:

  • Add acre_api_fnc_getRadioData
  • Add acre_api_fnc_setRadioData

@jonpas jonpas added this to the 2.7.2 milestone Sep 17, 2019
addons/api/fnc_getRadioData.sqf Outdated Show resolved Hide resolved
addons/api/fnc_setRadioData.sqf Outdated Show resolved Hide resolved
addons/api/fnc_setRadioData.sqf Outdated Show resolved Hide resolved
addons/api/fnc_setRadioData.sqf Outdated Show resolved Hide resolved
addons/api/fnc_getRadioData.sqf Outdated Show resolved Hide resolved
addons/api/fnc_setRadioData.sqf Outdated Show resolved Hide resolved
addons/api/fnc_getRadioData.sqf Outdated Show resolved Hide resolved
addons/api/fnc_getRadioData.sqf Outdated Show resolved Hide resolved
Co-Authored-By: jonpas <jonpas33@gmail.com>
@Sniperhid
Copy link
Member

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!)

@BrettMayson
Copy link
Contributor Author

What if we just made the effects global to prevent that issue?

@Sniperhid
Copy link
Member

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.

@BrettMayson
Copy link
Contributor Author

In this case though would it not be more useful to be global? Since it would be required anyway?

I could add a _global param that is true by default so you can set it to default if you do want local only effect for some reason

addons/api/fnc_setRadioData.sqf Outdated Show resolved Hide resolved
Co-Authored-By: Ferran Obon <ferran@idi-systems.com>
Copy link
Member

@Sniperhid Sniperhid left a 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.

@TheMagnetar TheMagnetar modified the milestones: 2.7.2, Ongoing Oct 2, 2019
@jonpas jonpas modified the milestones: Ongoing, Backlog Apr 5, 2020
@ThymoNL
Copy link
Contributor

ThymoNL commented May 19, 2020

Having a function to save and load radio states will allow radio's to be persisted between play sessions on long campaigns.

@jonpas
Copy link
Member

jonpas commented Feb 24, 2021

This should be changed to use data events as @Sniperhid got "dawned on".

@jonpas
Copy link
Member

jonpas commented Sep 14, 2023

No further activity, would have to be re-done with data framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants