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

CBA Settings implementation to replace removed userconfig file #1099

Merged
merged 4 commits into from
Sep 20, 2016
Merged

Conversation

zgmrvn
Copy link
Contributor

@zgmrvn zgmrvn commented Aug 20, 2016

Here it is, it was pretty simple since the CBA Settings design fits perfectly the way you have designed the TFAR. The CBA Settings init function has to be executed on client and server (no matter your variable is server or client specific) so i have created a cba_settings.sqf file then included it in both of the init functions.

@dedmen
Copy link
Collaborator

dedmen commented Sep 18, 2016

One question i have is how does one set the serverside settings? As there is no "settings" menu on a dedicated server.
Is there a config file that serveradmins can set like the old userconfig stuff? I googled only a bit on CBA settings but didnt find anything meaningful.

@kavinsky
Copy link
Collaborator

ACE team does it with server settings.

@dedmen
Copy link
Collaborator

dedmen commented Sep 18, 2016

Yep according to https://github.com/CBATeam/CBA_A3/tree/master/template/static_settings_addon
We just add a serverside only userconfig and some code to only load it on serverside.
For reference https://github.com/acemod/ACE3/blob/03f3b1084d4e9d14617f159db14a7086b1af8682/addons/common/functions/fnc_loadSettingsOnServer.sqf
@zgmrvn would you try to add that to this PR please?

@dedmen dedmen mentioned this pull request Sep 19, 2016
@dedmen dedmen added this to the 0.9.12 milestone Sep 19, 2016
@dedmen
Copy link
Collaborator

dedmen commented Sep 19, 2016

0819605
I did the functions to load the settings file on preInit. Problem right now is CBA appears to dictate that all CBA_Settings.. settings have to be defined in userconfig\cba\settings.sqf. Because thats what https://github.com/CBATeam/CBA_A3/tree/master/optionals/auto_load_settings_file uses.
But this way we can't distribute the config file to not let people overwrite the CBA settings file.
But i think that's kinda fine. As only serveradmins will use this we might just add a wiki entry on how to set these settings (I don't know how the settings.sqf file should look like yet). And there are only few people that use this anyway.

@zgmrvn please also remove the old userconfig folder in the PR.

Need some opinions on what to do with the settings file @kavinsky @michail-nikolaev
Im for just leaving it in userconfig\cba\settings.sqf and adding info to the wiki.

Also if we are implementing CBA settings we should do it completly not just partly right?
for example: https://github.com/michail-nikolaev/task-force-arma-3-radio/blob/master/arma3/%40task_force_radio/addons/task_force_radio/functions/fn_initialiseEnforceUsageModule.sqf should use CBA_settings_fnc_set. But.... I dont know what script would execute first.. If the userconfig loading from the server executes after the Module init, the userconfig might override the Module which we dont want.
But preInit runs before the variables are initialized in postInit. So I guess we could check if a variable exists in the userconfig init and if it already is just ignore the setting.
But that would only work if loadorder is
Module > preInit > postInit
But if the order is
preInit > postInit > Module or
preInit > Module > postInit
We are fine as the Module would overwrite the userconfig.

@dedmen dedmen self-assigned this Sep 19, 2016
This was referenced Sep 19, 2016
@kavinsky
Copy link
Collaborator

#956

@zgmrvn
Copy link
Contributor Author

zgmrvn commented Sep 19, 2016

Looks like "Static settings" is something diferent than the "Settings Framework". This PR is fonctionnal and you should not have to code any additional function to load data.

CBA Settings has a menu you can access while being ingame in Options >> Game >> Configure Addons (at the bottom of the window).
http://images.akamai.steamusercontent.com/ugc/269474880029576673/1E54995EB12658C358B5A7DA5D91612582A50F5B/

You have to be logged as admin to access the server tab. Data are stored in client/server profile.

Here is the documentation i have used : CBATeam/CBA_A3#317

@dedmen
Copy link
Collaborator

dedmen commented Sep 19, 2016

Wow nice. I didnt know there is a Server tab there.
@kavinsky We should merge this then. And then you or.. someone who can should create a 0.9.12 pre-release to test this stuff. pre-release because its untested and if we do a full release people will jump onto it.

Stuff to test:

  • Serverside variables settable
  • Serverside variables stay after restart
  • Serverside variables do what they should do (not give microdagr or long range radio when thats disabled)

@kavinsky kavinsky self-assigned this Sep 19, 2016
@kavinsky
Copy link
Collaborator

Ill take it.

@kavinsky
Copy link
Collaborator

kavinsky commented Sep 19, 2016

the PR looks good for me, im gonna try to test it this night.
Thanks @zgmrvn

@kavinsky kavinsky mentioned this pull request Sep 19, 2016
@kavinsky
Copy link
Collaborator

@zgmrvn can you join the TFAR Slack room?

@kavinsky kavinsky merged commit 7e57381 into michail-nikolaev:master Sep 20, 2016
@MakatoMiela
Copy link

MakatoMiela commented Dec 13, 2016

It is recommended to execute the function via a CBA XEH preInit event. This way you can make sure that the setting is available in the Eden-Editor.

https://github.com/CBATeam/CBA_A3/wiki/Settings-System
https://github.com/CBATeam/CBA_A3/wiki/Extended-Event-Handlers-(new)#extended_preinit_eventhandlers

@dedmen
Copy link
Collaborator

dedmen commented Dec 14, 2016

@MakatoMiela Already solved in 1.0. And i think it should also be in 0.9.12 already.. but.. maybe not

dedmen pushed a commit that referenced this pull request Jun 17, 2019
CBA Settings implementation to replace removed userconfig file

Former-commit-id: fd1e5ef5e98d5961f16668d85db61a538d2fa890 [formerly bb732b97febb4d0db52114881a3a35645b105927] [formerly 4c4890e50da77b4df60e35bcc24c3df7de9421e9 [formerly 6702f1d15232563ca7aa5b3907e49e2e47eab517]] [formerly fc88ce76305c8110e8d5e0fa625f542979180261 [formerly 55b9f54ca7a4da6bca6fe601fdb15354b975b6dc] [formerly 555943a05a146c77e8a65574479d9047102aa214 [formerly c9f1569449b90796a48d51d909a1e3a840f5751f]]]
Former-commit-id: 36d8078f0c587d869d660defef96be40502ce993 [formerly 81e452d95368af261a78f808bdb3465e0a7fd0fc] [formerly 2a540029539c68cf254d7be65a1ce6c7c6b8599b [formerly 5091431750622fd4a9dcfd36cf8b5bda831b44d2]]
Former-commit-id: 646e0a09d0e3efdaa2f123bf3df01bb9ff76cdab [formerly dee6eea4cf7e43587c73eb08e7a8c1fe8862450e]
Former-commit-id: 8baf2b24c4103a12e606d0cff83dc86792b5f41f
dedmen pushed a commit that referenced this pull request Jun 17, 2019
CBA Settings implementation to replace removed userconfig file

Former-commit-id: fd1e5ef5e98d5961f16668d85db61a538d2fa890 [formerly bb732b97febb4d0db52114881a3a35645b105927] [formerly 4c4890e50da77b4df60e35bcc24c3df7de9421e9 [formerly 6702f1d15232563ca7aa5b3907e49e2e47eab517]] [formerly fc88ce76305c8110e8d5e0fa625f542979180261 [formerly 55b9f54ca7a4da6bca6fe601fdb15354b975b6dc] [formerly 555943a05a146c77e8a65574479d9047102aa214 [formerly c9f1569449b90796a48d51d909a1e3a840f5751f]]]
Former-commit-id: 36d8078f0c587d869d660defef96be40502ce993 [formerly 81e452d95368af261a78f808bdb3465e0a7fd0fc] [formerly 2a540029539c68cf254d7be65a1ce6c7c6b8599b [formerly 5091431750622fd4a9dcfd36cf8b5bda831b44d2]]
Former-commit-id: 646e0a09d0e3efdaa2f123bf3df01bb9ff76cdab [formerly dee6eea4cf7e43587c73eb08e7a8c1fe8862450e]
Former-commit-id: 8baf2b24c4103a12e606d0cff83dc86792b5f41f
Former-commit-id: 24c0c59
dedmen pushed a commit that referenced this pull request Jun 17, 2019
CBA Settings implementation to replace removed userconfig file
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.

4 participants