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

Fix ace_settings #1432

Merged
merged 3 commits into from
May 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,25 @@ GVAR(commonPostInited) = true;
[{
// If post inits are not ready then wait
if !(SLX_XEH_MACHINE select 8) exitWith {};

// If settings are not initialized then wait
if !(GVAR(SettingsInitialized)) exitWith {};
if (isNil QGVAR(settings)) exitWith {
diag_log text format["[ACE] Waiting on settings from server"];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to print this to the rtp? What if the settings arrive late? Then we have spammed the rtp with quite a few messages. There is no need to print this multiple times I think.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I noticed that, but I decided leaving that spam on the first version should be good, to be able to easily check how long the settings are delaying. I propose to remove it on the next update.

};

[(_this select 1)] call cba_fnc_removePerFrameHandler;

diag_log text format["[ACE] Settings received from server"];

// Load user settings from profile
if (hasInterface) then {
call FUNC(loadSettingsFromProfile);
call FUNC(loadSettingsLocalizedText);
};

diag_log text format["[ACE] Settings initialized"];

//Event that settings are safe to use:
["SettingsInitialized", []] call FUNC(localEvent);

}, 0, []] call cba_fnc_addPerFrameHandler;
14 changes: 0 additions & 14 deletions addons/common/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -294,23 +294,9 @@ GVAR(waitAndExecArray) = [];
//Debug
ACE_COUNTERS = [];

// Wait for server settings to arrive
GVAR(SettingsInitialized) = false;
["ServerSettingsReceived", {
diag_log text format["[ACE] Settings received from server"];
// Load user settings from profile
if (hasInterface) then {
call FUNC(loadSettingsFromProfile);
call FUNC(loadSettingsLocalizedText);
};
GVAR(SettingsInitialized) = true;
}] call FUNC(addEventhandler);

// Load settings on the server and broadcast them
if (isServer) then {
call FUNC(loadSettingsOnServer);
// Raise a global event to notify settings from the server have arrived
["ServerSettingsReceived", []] call FUNC(globalEvent);
};

ACE_player = player;
Expand Down