2015-01-30 21:56:45 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: esteldunedain
|
2015-01-30 21:56:45 +00:00
|
|
|
* Load the parameters on the server.
|
|
|
|
* Config < Server UserConfig < Mission Config
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-02-03 03:43:23 +00:00
|
|
|
GVAR(settings) = [];
|
2015-01-30 21:56:45 +00:00
|
|
|
|
|
|
|
// Load settings from main config
|
|
|
|
_countOptions = count (configFile >> "ACE_Settings");
|
|
|
|
for "_index" from 0 to (_countOptions - 1) do {
|
|
|
|
_optionEntry = (configFile >> "ACE_Settings") select _index;
|
|
|
|
|
2015-02-03 00:13:31 +00:00
|
|
|
[_optionEntry] call FUNC(setSettingFromConfig);
|
2015-01-30 21:56:45 +00:00
|
|
|
};
|
|
|
|
// Check if all settings should be forced
|
|
|
|
if (GVAR(forceAllSettings)) then {
|
|
|
|
{
|
2015-02-03 03:43:23 +00:00
|
|
|
_x set [6, true];
|
|
|
|
} forEach GVAR(settings);
|
2015-01-30 21:56:45 +00:00
|
|
|
};
|
|
|
|
|
2015-02-03 03:43:23 +00:00
|
|
|
// @todo
|
2015-02-03 00:13:31 +00:00
|
|
|
// Load settings from server userconfig only if the ACE_ServerSettings is loaded
|
2015-02-03 03:43:23 +00:00
|
|
|
/*if (isClass (configFile >> "CfgPatches" >> "ACE_ServerSettings")) then {
|
2015-02-03 00:13:31 +00:00
|
|
|
DFUNC(serverUserConfig) = compile preprocessFileLineNumbers "\userconfig\ACE\ACE_Settings.hpp";
|
|
|
|
if !(isNil DFUNC(serverUserConfig)) then {
|
|
|
|
[] call FUNC(serverUserConfig);
|
|
|
|
};
|
|
|
|
// Check if all settings should be forced
|
|
|
|
if (GVAR(forceAllSettings)) then {
|
|
|
|
{
|
|
|
|
if !(missionNamespace getVariable format ["%1_forced", _x]) then {
|
|
|
|
missionNamespace setVariable format ["%1_forced", _x, true];
|
|
|
|
publicVariable format ["%1_forced", _name];
|
|
|
|
};
|
|
|
|
} forEach GVAR(settingsList);
|
|
|
|
};
|
2015-02-03 03:43:23 +00:00
|
|
|
};*/
|
2015-01-30 21:56:45 +00:00
|
|
|
|
|
|
|
// Load settings from mission config
|
|
|
|
_countOptions = count (missionConfigFile >> "ACE_Settings");
|
|
|
|
for "_index" from 0 to (_countOptions - 1) do {
|
|
|
|
_optionEntry = (missionConfigFile >> "ACE_Settings") select _index;
|
|
|
|
|
2015-02-03 00:13:31 +00:00
|
|
|
[_optionEntry] call FUNC(setSettingFromConfig);
|
2015-01-30 21:56:45 +00:00
|
|
|
};
|
|
|
|
// Check if all settings should be forced
|
|
|
|
if (GVAR(forceAllSettings)) then {
|
|
|
|
{
|
2015-02-03 03:43:23 +00:00
|
|
|
_x set [6, true];
|
|
|
|
} forEach GVAR(settings);
|
2015-02-03 00:13:31 +00:00
|
|
|
};
|
2015-02-03 03:43:23 +00:00
|
|
|
|
|
|
|
// Publish all settings data
|
|
|
|
publicVariable QGVAR(settings);
|
|
|
|
// Publish all setting values
|
|
|
|
{
|
|
|
|
publicVariable (_x select 0);
|
|
|
|
} forEach GVAR(settings);
|