From f2ac9fcbe7817ee7301d519bb3970297c0cf5f0b Mon Sep 17 00:00:00 2001 From: Jacob Schmidt Date: Sun, 24 May 2026 23:13:39 -0500 Subject: [PATCH] Fix framework hashmap object initialization --- .../addons/actor/XEH_postInitClient.sqf | 2 +- .../client/addons/bank/XEH_postInitClient.sqf | 4 +-- .../bank/functions/fnc_initUIBridge.sqf | 19 ++++++++--- arma/client/addons/cad/XEH_postInitClient.sqf | 4 +-- .../addons/cad/functions/fnc_initUIBridge.sqf | 19 ++++++++--- .../common/functions/fnc_initWebUIBridge.sqf | 6 ++-- .../addons/garage/XEH_postInitClient.sqf | 14 ++++---- .../garage/functions/fnc_initUIBridge.sqf | 17 +++++++--- .../addons/locker/XEH_postInitClient.sqf | 4 +-- .../notifications/XEH_postInitClient.sqf | 2 +- arma/client/addons/org/XEH_postInitClient.sqf | 4 +-- .../addons/org/functions/fnc_initUIBridge.sqf | 17 +++++++--- .../addons/phone/XEH_postInitClient.sqf | 2 +- .../addons/store/XEH_postInitClient.sqf | 2 +- arma/server/addons/actor/XEH_postInit.sqf | 2 +- .../actor/functions/fnc_initActorStore.sqf | 18 +++++++--- arma/server/addons/bank/XEH_postInit.sqf | 2 +- .../bank/functions/fnc_initBankStore.sqf | 18 +++++++--- arma/server/addons/common/XEH_preInit.sqf | 2 +- arma/server/addons/economy/XEH_preInit.sqf | 6 ++-- arma/server/addons/garage/XEH_postInit.sqf | 2 +- .../garage/functions/fnc_initGarageStore.sqf | 18 +++++++--- .../garage/functions/fnc_initVGStore.sqf | 18 +++++++--- arma/server/addons/locker/XEH_postInit.sqf | 2 +- .../locker/functions/fnc_initLockerStore.sqf | 18 +++++++--- .../locker/functions/fnc_initVAStore.sqf | 18 +++++++--- .../addons/main/functions/fnc_initStores.sqf | 32 ++++++++--------- arma/server/addons/org/XEH_postInit.sqf | 2 +- .../addons/org/functions/fnc_initOrgStore.sqf | 34 ++++++++----------- arma/server/addons/phone/XEH_preInit.sqf | 2 +- arma/server/addons/task/XEH_postInit.sqf | 2 +- 31 files changed, 194 insertions(+), 118 deletions(-) diff --git a/arma/client/addons/actor/XEH_postInitClient.sqf b/arma/client/addons/actor/XEH_postInitClient.sqf index d60aacf..b866719 100644 --- a/arma/client/addons/actor/XEH_postInitClient.sqf +++ b/arma/client/addons/actor/XEH_postInitClient.sqf @@ -23,7 +23,7 @@ player addEventHandler ["Respawn", { [SRPC(economy,onRespawn), [_unit, _corpse, _uid]] call CFUNC(serverEvent); }]; -if (isNil QGVAR(ActorRepository)) then { call FUNC(initRepository); }; +if (isNil QGVAR(ActorRepository)) then { call FUNC(initRepository); true }; GVAR(resetMedicalSpectator) = { player switchMove ""; diff --git a/arma/client/addons/bank/XEH_postInitClient.sqf b/arma/client/addons/bank/XEH_postInitClient.sqf index 90c8646..b9b8e55 100644 --- a/arma/client/addons/bank/XEH_postInitClient.sqf +++ b/arma/client/addons/bank/XEH_postInitClient.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" -if (isNil QGVAR(BankRepository)) then { call FUNC(initRepository); }; -if (isNil QGVAR(BankUIBridge)) then { call FUNC(initUIBridge); }; +if (isNil QGVAR(BankRepository)) then { call FUNC(initRepository); true }; +if (isNil QGVAR(BankUIBridge)) then { call FUNC(initUIBridge); true }; GVAR(sendPhoneBankEvent) = { params [["_functionName", "", [""]], ["_arguments", [], [[]]]]; diff --git a/arma/client/addons/bank/functions/fnc_initUIBridge.sqf b/arma/client/addons/bank/functions/fnc_initUIBridge.sqf index b121901..a8ff31c 100644 --- a/arma/client/addons/bank/functions/fnc_initUIBridge.sqf +++ b/arma/client/addons/bank/functions/fnc_initUIBridge.sqf @@ -23,11 +23,14 @@ private _webUIDeclarations = call EFUNC(common,initWebUIBridge); private _webUIBridgeDeclaration = _webUIDeclarations get "bridgeDeclaration"; -GVAR(BankUIBridgeBaseClass) = compileFinal createHashMapFromArray [ - ["#base", _webUIBridgeDeclaration], +GVAR(BankUIBridgeBaseClass) = compileFinal ([ + _webUIBridgeDeclaration, + createHashMapFromArray [ ["#type", "BankUIBridgeBaseClass"], ["#create", compileFinal { + _self set ["screen", createHashMapObject [EGVAR(common,WebUIScreenDeclaration), []]]; _self set ["mode", "bank"]; + true }], ["getActiveBrowserControl", compileFinal { private _display = uiNamespace getVariable ["RscBank", displayNull]; @@ -166,7 +169,13 @@ GVAR(BankUIBridgeBaseClass) = compileFinal createHashMapFromArray [ _self set ["mode", _finalMode]; _finalMode }] -]; +]] call { + params ["_base", "_child"]; -GVAR(BankUIBridge) = createHashMapObject [GVAR(BankUIBridgeBaseClass)]; -GVAR(BankUIBridge) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(BankUIBridge) = createHashMapObject [GVAR(BankUIBridgeBaseClass), []]; +true diff --git a/arma/client/addons/cad/XEH_postInitClient.sqf b/arma/client/addons/cad/XEH_postInitClient.sqf index a64fb15..f7228d5 100644 --- a/arma/client/addons/cad/XEH_postInitClient.sqf +++ b/arma/client/addons/cad/XEH_postInitClient.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" -if (isNil QGVAR(CADRepository)) then { call FUNC(initRepository); }; -if (isNil QGVAR(CADUIBridge)) then { call FUNC(initUIBridge); }; +if (isNil QGVAR(CADRepository)) then { call FUNC(initRepository); true }; +if (isNil QGVAR(CADUIBridge)) then { call FUNC(initUIBridge); true }; [QGVAR(openCAD), { call FUNC(openUI); diff --git a/arma/client/addons/cad/functions/fnc_initUIBridge.sqf b/arma/client/addons/cad/functions/fnc_initUIBridge.sqf index e59768a..6656076 100644 --- a/arma/client/addons/cad/functions/fnc_initUIBridge.sqf +++ b/arma/client/addons/cad/functions/fnc_initUIBridge.sqf @@ -23,12 +23,15 @@ private _webUIDeclarations = call EFUNC(common,initWebUIBridge); private _webUIBridgeDeclaration = _webUIDeclarations get "bridgeDeclaration"; -GVAR(CADUIBridgeBaseClass) = compileFinal createHashMapFromArray [ - ["#base", _webUIBridgeDeclaration], +GVAR(CADUIBridgeBaseClass) = compileFinal ([ + _webUIBridgeDeclaration, + createHashMapFromArray [ ["#type", "CADUIBridgeBaseClass"], ["#create", compileFinal { + _self set ["screen", createHashMapObject [EGVAR(common,WebUIScreenDeclaration), []]]; _self set ["dispatcherReady", false]; _self set ["topBarReady", false]; + true }], ["getActiveBrowserControl", compileFinal { private _display = uiNamespace getVariable [QGVAR(Display), displayNull]; @@ -482,7 +485,13 @@ GVAR(CADUIBridgeBaseClass) = compileFinal createHashMapFromArray [ ["success", _result getOrDefault ["success", false]] ]]] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(CADUIBridge) = createHashMapObject [GVAR(CADUIBridgeBaseClass)]; -GVAR(CADUIBridge) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(CADUIBridge) = createHashMapObject [GVAR(CADUIBridgeBaseClass), []]; +true diff --git a/arma/client/addons/common/functions/fnc_initWebUIBridge.sqf b/arma/client/addons/common/functions/fnc_initWebUIBridge.sqf index 15450d6..0218b3a 100644 --- a/arma/client/addons/common/functions/fnc_initWebUIBridge.sqf +++ b/arma/client/addons/common/functions/fnc_initWebUIBridge.sqf @@ -37,6 +37,7 @@ GVAR(WebUIScreenDeclaration) = compileFinal createHashMapFromArray [ _self set ["control", _control]; _self set ["readyState", false]; _self set ["pendingEvents", []]; + true }], ["dispose", compileFinal { _self set ["control", controlNull]; @@ -86,7 +87,8 @@ GVAR(WebUIScreenDeclaration) = compileFinal createHashMapFromArray [ GVAR(WebUIBridgeDeclaration) = compileFinal createHashMapFromArray [ ["#type", "IWebUIBridge"], ["#create", compileFinal { - _self set ["screen", createHashMapObject [GVAR(WebUIScreenDeclaration)]]; + _self set ["screen", createHashMapObject [GVAR(WebUIScreenDeclaration), []]]; + true }], ["deliverPayload", compileFinal { params [["_control", controlNull, [controlNull]], ["_payload", createHashMap, [createHashMap]]]; @@ -132,7 +134,7 @@ GVAR(WebUIBridgeDeclaration) = compileFinal createHashMapFromArray [ }; if (!_hasScreen) then { - _screen = createHashMapObject [GVAR(WebUIScreenDeclaration)]; + _screen = createHashMapObject [GVAR(WebUIScreenDeclaration), []]; _self set ["screen", _screen]; }; diff --git a/arma/client/addons/garage/XEH_postInitClient.sqf b/arma/client/addons/garage/XEH_postInitClient.sqf index e187c2d..5f145d7 100644 --- a/arma/client/addons/garage/XEH_postInitClient.sqf +++ b/arma/client/addons/garage/XEH_postInitClient.sqf @@ -1,12 +1,12 @@ #include "script_component.hpp" -if (isNil QGVAR(GarageHelperService)) then { call FUNC(initHelperService); }; -if (isNil QGVAR(GarageRepository)) then { call FUNC(initRepository); }; -if (isNil QGVAR(GarageContextService)) then { call FUNC(initContextService); }; -if (isNil QGVAR(GaragePayloadService)) then { call FUNC(initPayloadService); }; -if (isNil QGVAR(GarageActionService)) then { call FUNC(initActionService); }; -if (isNil QGVAR(GarageUIBridge)) then { call FUNC(initUIBridge); }; -if (isNil QGVAR(VGRepository)) then { call FUNC(initVGRepository); }; +if (isNil QGVAR(GarageHelperService)) then { call FUNC(initHelperService); true }; +if (isNil QGVAR(GarageRepository)) then { call FUNC(initRepository); true }; +if (isNil QGVAR(GarageContextService)) then { call FUNC(initContextService); true }; +if (isNil QGVAR(GaragePayloadService)) then { call FUNC(initPayloadService); true }; +if (isNil QGVAR(GarageActionService)) then { call FUNC(initActionService); true }; +if (isNil QGVAR(GarageUIBridge)) then { call FUNC(initUIBridge); true }; +if (isNil QGVAR(VGRepository)) then { call FUNC(initVGRepository); true }; [QGVAR(initGarage), { GVAR(GarageRepository) call ["init", []]; diff --git a/arma/client/addons/garage/functions/fnc_initUIBridge.sqf b/arma/client/addons/garage/functions/fnc_initUIBridge.sqf index ee20a28..d6ebabf 100644 --- a/arma/client/addons/garage/functions/fnc_initUIBridge.sqf +++ b/arma/client/addons/garage/functions/fnc_initUIBridge.sqf @@ -23,8 +23,9 @@ private _webUIDeclarations = call EFUNC(common,initWebUIBridge); private _webUIBridgeDeclaration = _webUIDeclarations get "bridgeDeclaration"; -GVAR(GarageUIBridgeBaseClass) = compileFinal createHashMapFromArray [ - ["#base", _webUIBridgeDeclaration], +GVAR(GarageUIBridgeBaseClass) = compileFinal ([ + _webUIBridgeDeclaration, + createHashMapFromArray [ ["#type", "GarageUIBridgeBaseClass"], ["getActiveBrowserControl", compileFinal { private _display = uiNamespace getVariable ["RscGarage", displayNull]; @@ -53,7 +54,13 @@ GVAR(GarageUIBridgeBaseClass) = compileFinal createHashMapFromArray [ _self call ["sendEvent", ["garage::sync", GVAR(GaragePayloadService) call ["buildPayload", []], _control]] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(GarageUIBridge) = createHashMapObject [GVAR(GarageUIBridgeBaseClass)]; -GVAR(GarageUIBridge) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(GarageUIBridge) = createHashMapObject [GVAR(GarageUIBridgeBaseClass), []]; +true diff --git a/arma/client/addons/locker/XEH_postInitClient.sqf b/arma/client/addons/locker/XEH_postInitClient.sqf index a0a878d..9ad710f 100644 --- a/arma/client/addons/locker/XEH_postInitClient.sqf +++ b/arma/client/addons/locker/XEH_postInitClient.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" -if (isNil QGVAR(LockerRepository)) then { call FUNC(initRepository); }; -if (isNil QGVAR(VARepository)) then { call FUNC(initVARepository); }; +if (isNil QGVAR(LockerRepository)) then { call FUNC(initRepository); true }; +if (isNil QGVAR(VARepository)) then { call FUNC(initVARepository); true }; [QGVAR(initLocker), { GVAR(LockerRepository) call ["init", []]; diff --git a/arma/client/addons/notifications/XEH_postInitClient.sqf b/arma/client/addons/notifications/XEH_postInitClient.sqf index 6504295..76fa15b 100644 --- a/arma/client/addons/notifications/XEH_postInitClient.sqf +++ b/arma/client/addons/notifications/XEH_postInitClient.sqf @@ -5,7 +5,7 @@ }, { ("NotificationHudLayer" call BFUNC(rscLayer)) cutRsc ["RscNotifications", "PLAIN"]; call FUNC(openUI); - if (isNil QGVAR(NotificationService)) then { call FUNC(initService); }; + if (isNil QGVAR(NotificationService)) then { call FUNC(initService); true }; }] call CFUNC(waitUntilAndExecute); [QGVAR(recieveNotification), { diff --git a/arma/client/addons/org/XEH_postInitClient.sqf b/arma/client/addons/org/XEH_postInitClient.sqf index cce0b05..0d9a269 100644 --- a/arma/client/addons/org/XEH_postInitClient.sqf +++ b/arma/client/addons/org/XEH_postInitClient.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" -if (isNil QGVAR(OrgRepository)) then { call FUNC(initRepository); }; -if (isNil QGVAR(OrgUIBridge)) then { call FUNC(initUIBridge); }; +if (isNil QGVAR(OrgRepository)) then { call FUNC(initRepository); true }; +if (isNil QGVAR(OrgUIBridge)) then { call FUNC(initUIBridge); true }; [QGVAR(initOrg), { GVAR(OrgRepository) call ["init", []]; diff --git a/arma/client/addons/org/functions/fnc_initUIBridge.sqf b/arma/client/addons/org/functions/fnc_initUIBridge.sqf index b8dfc67..69910fb 100644 --- a/arma/client/addons/org/functions/fnc_initUIBridge.sqf +++ b/arma/client/addons/org/functions/fnc_initUIBridge.sqf @@ -24,8 +24,9 @@ private _webUIDeclarations = call EFUNC(common,initWebUIBridge); private _webUIBridgeDeclaration = _webUIDeclarations get "bridgeDeclaration"; -GVAR(OrgUIBridgeBaseClass) = compileFinal createHashMapFromArray [ - ["#base", _webUIBridgeDeclaration], +GVAR(OrgUIBridgeBaseClass) = compileFinal ([ + _webUIBridgeDeclaration, + createHashMapFromArray [ ["#type", "OrgUIBridgeBaseClass"], ["setPendingBrowserControl", compileFinal { params [["_control", controlNull, [controlNull]]]; @@ -242,7 +243,13 @@ GVAR(OrgUIBridgeBaseClass) = compileFinal createHashMapFromArray [ ["refreshPortal", compileFinal { _self call ["requestHydrate", ["org::sync"]] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(OrgUIBridge) = createHashMapObject [GVAR(OrgUIBridgeBaseClass)]; -GVAR(OrgUIBridge) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(OrgUIBridge) = createHashMapObject [GVAR(OrgUIBridgeBaseClass), []]; +true diff --git a/arma/client/addons/phone/XEH_postInitClient.sqf b/arma/client/addons/phone/XEH_postInitClient.sqf index 532ae08..5ae4bc2 100644 --- a/arma/client/addons/phone/XEH_postInitClient.sqf +++ b/arma/client/addons/phone/XEH_postInitClient.sqf @@ -6,7 +6,7 @@ [QGVAR(initPhone), []] call CFUNC(localEvent); }] call CFUNC(waitUntilAndExecute); -if (isNil QGVAR(PhoneRepository)) then { [] call FUNC(initRepository); }; +if (isNil QGVAR(PhoneRepository)) then { [] call FUNC(initRepository); true }; [QGVAR(initPhone), { GVAR(PhoneRepository) call ["init", []]; diff --git a/arma/client/addons/store/XEH_postInitClient.sqf b/arma/client/addons/store/XEH_postInitClient.sqf index 44eb8c8..97bf5ed 100644 --- a/arma/client/addons/store/XEH_postInitClient.sqf +++ b/arma/client/addons/store/XEH_postInitClient.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -if (isNil QGVAR(StoreUIBridge)) then { call FUNC(initUIBridge); }; +if (isNil QGVAR(StoreUIBridge)) then { call FUNC(initUIBridge); true }; [QGVAR(responseCategory), { params [["_payload", createHashMap, [createHashMap]]]; diff --git a/arma/server/addons/actor/XEH_postInit.sqf b/arma/server/addons/actor/XEH_postInit.sqf index d06a0ed..0f1041f 100644 --- a/arma/server/addons/actor/XEH_postInit.sqf +++ b/arma/server/addons/actor/XEH_postInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); }; +if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); true }; if (isNil QGVAR(BankAccountCreatedEventTokens)) then { private _welcomeNewActor = { params ["_event"]; diff --git a/arma/server/addons/actor/functions/fnc_initActorStore.sqf b/arma/server/addons/actor/functions/fnc_initActorStore.sqf index 8f60179..8454b1b 100644 --- a/arma/server/addons/actor/functions/fnc_initActorStore.sqf +++ b/arma/server/addons/actor/functions/fnc_initActorStore.sqf @@ -105,11 +105,13 @@ GVAR(ActorModel) = compileFinal createHashMapObject [[ }] ]]; -GVAR(ActorBaseStore) = compileFinal createHashMapFromArray [ - ["#base", EGVAR(common,BaseStore)], +GVAR(ActorBaseStore) = compileFinal ([ + EGVAR(common,BaseStore), + createHashMapFromArray [ ["#type", "ActorBaseStore"], ["#create", compileFinal { ["INFO", "Actor Store Initialized!"] call EFUNC(common,log); + true }], ["cacheActor", compileFinal { params [["_uid", "", [""]], ["_actor", createHashMap, [createHashMap]]]; @@ -561,7 +563,13 @@ GVAR(ActorBaseStore) = compileFinal createHashMapFromArray [ _self call ["override", [_uid, _finalActor, false]] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(ActorStore) = createHashMapObject [GVAR(ActorBaseStore)]; -GVAR(ActorStore) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(ActorStore) = createHashMapObject [GVAR(ActorBaseStore), []]; +true diff --git a/arma/server/addons/bank/XEH_postInit.sqf b/arma/server/addons/bank/XEH_postInit.sqf index fab3df1..7a0f818 100644 --- a/arma/server/addons/bank/XEH_postInit.sqf +++ b/arma/server/addons/bank/XEH_postInit.sqf @@ -2,7 +2,7 @@ call FUNC(initBank); -if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); }; +if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); true }; if (isNil QGVAR(AccountSyncEventTokens)) then { private _sendAccountSync = { params ["_event"]; diff --git a/arma/server/addons/bank/functions/fnc_initBankStore.sqf b/arma/server/addons/bank/functions/fnc_initBankStore.sqf index bc46888..9689597 100644 --- a/arma/server/addons/bank/functions/fnc_initBankStore.sqf +++ b/arma/server/addons/bank/functions/fnc_initBankStore.sqf @@ -14,11 +14,13 @@ */ #pragma hemtt ignore_variables ["_self"] -GVAR(BankBaseStore) = compileFinal createHashMapFromArray [ - ["#base", EGVAR(common,BaseStore)], +GVAR(BankBaseStore) = compileFinal ([ + EGVAR(common,BaseStore), + createHashMapFromArray [ ["#type", "BankBaseStore"], ["#create", compileFinal { ["INFO", "Bank Store Initialized!"] call EFUNC(common,log); + true }], ["normalizeAccount", compileFinal { params [["_uid", "", [""]], ["_account", createHashMap, [createHashMap]], ["_playerName", "", [""]]]; @@ -571,7 +573,13 @@ GVAR(BankBaseStore) = compileFinal createHashMapFromArray [ ] ] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(BankStore) = createHashMapObject [GVAR(BankBaseStore)]; -GVAR(BankStore) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(BankStore) = createHashMapObject [GVAR(BankBaseStore), []]; +true diff --git a/arma/server/addons/common/XEH_preInit.sqf b/arma/server/addons/common/XEH_preInit.sqf index 52ef5b7..412daa0 100644 --- a/arma/server/addons/common/XEH_preInit.sqf +++ b/arma/server/addons/common/XEH_preInit.sqf @@ -6,7 +6,7 @@ PREP_RECOMPILE_END; // private _category = [QUOTE(MOD_NAME), LLSTRING(displayName)]; -if (isNil QGVAR(EventBus)) then { call FUNC(eventBus); }; +if (isNil QGVAR(EventBus)) then { call FUNC(eventBus); true }; if (isNil QGVAR(NotificationEventTokens)) then { private _sendNotification = { params ["_event"]; diff --git a/arma/server/addons/economy/XEH_preInit.sqf b/arma/server/addons/economy/XEH_preInit.sqf index f941726..c9e7cbf 100644 --- a/arma/server/addons/economy/XEH_preInit.sqf +++ b/arma/server/addons/economy/XEH_preInit.sqf @@ -6,9 +6,9 @@ PREP_RECOMPILE_END; // private _category = [QUOTE(MOD_NAME), LLSTRING(displayName)]; -if (isNil QGVAR(MEconomyStore)) then { call FUNC(initMEconomyStore); }; -if (isNil QGVAR(FEconomyStore)) then { call FUNC(initFEconomyStore); }; -if (isNil QGVAR(SEconomyStore)) then { call FUNC(initSEconomyStore); }; +if (isNil QGVAR(MEconomyStore)) then { call FUNC(initMEconomyStore); true }; +if (isNil QGVAR(FEconomyStore)) then { call FUNC(initFEconomyStore); true }; +if (isNil QGVAR(SEconomyStore)) then { call FUNC(initSEconomyStore); true }; [QGVAR(FuelStart), { params ["_source", "_target", "_unit"]; diff --git a/arma/server/addons/garage/XEH_postInit.sqf b/arma/server/addons/garage/XEH_postInit.sqf index 8916239..b7dbd84 100644 --- a/arma/server/addons/garage/XEH_postInit.sqf +++ b/arma/server/addons/garage/XEH_postInit.sqf @@ -2,7 +2,7 @@ call FUNC(initGarage); -if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); }; +if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); true }; if (isNil QGVAR(SyncEventTokens)) then { private _sendVGarageSync = { params ["_event"]; diff --git a/arma/server/addons/garage/functions/fnc_initGarageStore.sqf b/arma/server/addons/garage/functions/fnc_initGarageStore.sqf index 759f685..0365ecb 100644 --- a/arma/server/addons/garage/functions/fnc_initGarageStore.sqf +++ b/arma/server/addons/garage/functions/fnc_initGarageStore.sqf @@ -22,13 +22,15 @@ */ #pragma hemtt ignore_variables ["_self"] -GVAR(GarageBaseStore) = compileFinal createHashMapFromArray [ - ["#base", EGVAR(common,BaseStore)], +GVAR(GarageBaseStore) = compileFinal ([ + EGVAR(common,BaseStore), + createHashMapFromArray [ ["#type", "GarageBaseStore"], ["#create", compileFinal { ["INFO", "Garage Store Initialized!"] call EFUNC(common,log); _self set ["lastCallSucceeded", false]; _self set ["lastError", ""]; + true }], ["callHotGarage", compileFinal { params [["_function", "", [""]], ["_arguments", [], [[]]]]; @@ -114,7 +116,13 @@ GVAR(GarageBaseStore) = compileFinal createHashMapFromArray [ if (_uid isEqualTo "" || { _payloadJson isEqualTo "" }) exitWith { createHashMap }; _self call ["callHotGarage", ["garage:hot:remove_vehicle", [_uid, _payloadJson]]] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(GarageStore) = createHashMapObject [GVAR(GarageBaseStore)]; -GVAR(GarageStore) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(GarageStore) = createHashMapObject [GVAR(GarageBaseStore), []]; +true diff --git a/arma/server/addons/garage/functions/fnc_initVGStore.sqf b/arma/server/addons/garage/functions/fnc_initVGStore.sqf index a17b9c5..be3d649 100644 --- a/arma/server/addons/garage/functions/fnc_initVGStore.sqf +++ b/arma/server/addons/garage/functions/fnc_initVGStore.sqf @@ -38,11 +38,13 @@ GVAR(VGarageModel) = compileFinal createHashMapObject [[ }] ]]; -GVAR(VGBaseStore) = compileFinal createHashMapFromArray [ - ["#base", EGVAR(common,BaseStore)], +GVAR(VGBaseStore) = compileFinal ([ + EGVAR(common,BaseStore), + createHashMapFromArray [ ["#type", "VGBaseStore"], ["#create", compileFinal { ["INFO", "VGarage Store Initialized!"] call EFUNC(common,log); + true }], ["callHotVGarage", compileFinal { params [["_function", "", [""]], ["_arguments", [], [[]]]]; @@ -90,7 +92,13 @@ GVAR(VGBaseStore) = compileFinal createHashMapFromArray [ if (_uid isEqualTo "") exitWith { createHashMap }; _self call ["callHotVGarage", ["owned:garage:hot:save", [_uid]]] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(VGarageStore) = createHashMapObject [GVAR(VGBaseStore)]; -GVAR(VGarageStore) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(VGarageStore) = createHashMapObject [GVAR(VGBaseStore), []]; +true diff --git a/arma/server/addons/locker/XEH_postInit.sqf b/arma/server/addons/locker/XEH_postInit.sqf index e0e1969..1f2f10a 100644 --- a/arma/server/addons/locker/XEH_postInit.sqf +++ b/arma/server/addons/locker/XEH_postInit.sqf @@ -2,7 +2,7 @@ call FUNC(initLocker); -if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); }; +if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); true }; if (isNil QGVAR(SyncEventTokens)) then { private _sendLockerSync = { params ["_event"]; diff --git a/arma/server/addons/locker/functions/fnc_initLockerStore.sqf b/arma/server/addons/locker/functions/fnc_initLockerStore.sqf index b76bde4..4786074 100644 --- a/arma/server/addons/locker/functions/fnc_initLockerStore.sqf +++ b/arma/server/addons/locker/functions/fnc_initLockerStore.sqf @@ -22,11 +22,13 @@ */ #pragma hemtt ignore_variables ["_self"] -GVAR(LockerBaseStore) = compileFinal createHashMapFromArray [ - ["#base", EGVAR(common,BaseStore)], +GVAR(LockerBaseStore) = compileFinal ([ + EGVAR(common,BaseStore), + createHashMapFromArray [ ["#type", "LockerBaseStore"], ["#create", compileFinal { ["INFO", "Locker Store Initialized!"] call EFUNC(common,log); + true }], ["callHotLocker", compileFinal { params [["_function", "", [""]], ["_arguments", [], [[]]]]; @@ -92,7 +94,13 @@ GVAR(LockerBaseStore) = compileFinal createHashMapFromArray [ if (_uid isEqualTo "") exitWith { createHashMap }; _self call ["callHotLocker", ["locker:hot:save", [_uid]]] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(LockerStore) = createHashMapObject [GVAR(LockerBaseStore)]; -GVAR(LockerStore) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(LockerStore) = createHashMapObject [GVAR(LockerBaseStore), []]; +true diff --git a/arma/server/addons/locker/functions/fnc_initVAStore.sqf b/arma/server/addons/locker/functions/fnc_initVAStore.sqf index ecbc234..542bb6a 100644 --- a/arma/server/addons/locker/functions/fnc_initVAStore.sqf +++ b/arma/server/addons/locker/functions/fnc_initVAStore.sqf @@ -36,11 +36,13 @@ GVAR(VArsenalModel) = compileFinal createHashMapObject [[ }] ]]; -GVAR(VABaseStore) = compileFinal createHashMapFromArray [ - ["#base", EGVAR(common,BaseStore)], +GVAR(VABaseStore) = compileFinal ([ + EGVAR(common,BaseStore), + createHashMapFromArray [ ["#type", "VABaseStore"], ["#create", compileFinal { ["INFO", "VArsenal Store Initialized!"] call EFUNC(common,log); + true }], ["callHotVArsenal", compileFinal { params [["_function", "", [""]], ["_arguments", [], [[]]]]; @@ -88,7 +90,13 @@ GVAR(VABaseStore) = compileFinal createHashMapFromArray [ if (_uid isEqualTo "") exitWith { createHashMap }; _self call ["callHotVArsenal", ["owned:locker:hot:save", [_uid]]] }] -]; +]] call { + params ["_base", "_child"]; -GVAR(VAStore) = createHashMapObject [GVAR(VABaseStore)]; -GVAR(VAStore) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(VAStore) = createHashMapObject [GVAR(VABaseStore), []]; +true diff --git a/arma/server/addons/main/functions/fnc_initStores.sqf b/arma/server/addons/main/functions/fnc_initStores.sqf index fbed0dc..80aba99 100644 --- a/arma/server/addons/main/functions/fnc_initStores.sqf +++ b/arma/server/addons/main/functions/fnc_initStores.sqf @@ -17,37 +17,37 @@ */ // Base -if (isNil QEGVAR(common,BaseStore)) then { call EFUNC(common,baseStore); }; -if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); }; +if (isNil QEGVAR(common,BaseStore)) then { call EFUNC(common,baseStore); true }; +if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); true }; // Actor -if (isNil QEGVAR(actor,ActorStore)) then { call EFUNC(actor,initActorStore); }; +if (isNil QEGVAR(actor,ActorStore)) then { call EFUNC(actor,initActorStore); true }; // Bank -if (isNil QEGVAR(bank,BankSessionManager)) then { call EFUNC(bank,initSessionManager); }; -if (isNil QEGVAR(bank,BankMessenger)) then { call EFUNC(bank,initMessenger); }; -if (isNil QEGVAR(bank,BankModel)) then { call EFUNC(bank,initModel); }; -if (isNil QEGVAR(bank,BankPayloadBuilder)) then { call EFUNC(bank,initPayloadBuilder); }; -if (isNil QEGVAR(bank,BankStore)) then { call EFUNC(bank,initBankStore); }; +if (isNil QEGVAR(bank,BankSessionManager)) then { call EFUNC(bank,initSessionManager); true }; +if (isNil QEGVAR(bank,BankMessenger)) then { call EFUNC(bank,initMessenger); true }; +if (isNil QEGVAR(bank,BankModel)) then { call EFUNC(bank,initModel); true }; +if (isNil QEGVAR(bank,BankPayloadBuilder)) then { call EFUNC(bank,initPayloadBuilder); true }; +if (isNil QEGVAR(bank,BankStore)) then { call EFUNC(bank,initBankStore); true }; // Garage -if (isNil QEGVAR(garage,GarageStore)) then { call EFUNC(garage,initGarageStore); }; +if (isNil QEGVAR(garage,GarageStore)) then { call EFUNC(garage,initGarageStore); true }; // VGarage -if (isNil QEGVAR(garage,VGarageStore)) then { call EFUNC(garage,initVGStore); }; +if (isNil QEGVAR(garage,VGarageStore)) then { call EFUNC(garage,initVGStore); true }; // Locker -if (isNil QEGVAR(locker,LockerStore)) then { call EFUNC(locker,initLockerStore); }; +if (isNil QEGVAR(locker,LockerStore)) then { call EFUNC(locker,initLockerStore); true }; // VArsenal -if (isNil QEGVAR(locker,VAStore)) then { call EFUNC(locker,initVAStore); }; +if (isNil QEGVAR(locker,VAStore)) then { call EFUNC(locker,initVAStore); true }; // Org -if (isNil QEGVAR(org,OrgPayloadBuilder)) then { call EFUNC(org,initPayloadBuilder); }; -if (isNil QEGVAR(org,OrgStore)) then { call EFUNC(org,initOrgStore); }; +if (isNil QEGVAR(org,OrgPayloadBuilder)) then { call EFUNC(org,initPayloadBuilder); true }; +if (isNil QEGVAR(org,OrgStore)) then { call EFUNC(org,initOrgStore); true }; // Store -if (isNil QEGVAR(store,StorefrontStore)) then { call EFUNC(store,initStorefrontStore); }; +if (isNil QEGVAR(store,StorefrontStore)) then { call EFUNC(store,initStorefrontStore); true }; // Validation Harness -if (isNil QGVAR(ValidationHarness)) then { call FUNC(initValidationHarness); }; +if (isNil QGVAR(ValidationHarness)) then { call FUNC(initValidationHarness); true }; diff --git a/arma/server/addons/org/XEH_postInit.sqf b/arma/server/addons/org/XEH_postInit.sqf index 2a74f25..0768f3f 100644 --- a/arma/server/addons/org/XEH_postInit.sqf +++ b/arma/server/addons/org/XEH_postInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); }; +if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); true }; if (isNil QGVAR(SyncEventTokens)) then { private _sendOrgSync = { params ["_event"]; diff --git a/arma/server/addons/org/functions/fnc_initOrgStore.sqf b/arma/server/addons/org/functions/fnc_initOrgStore.sqf index 46c851d..4574fd6 100644 --- a/arma/server/addons/org/functions/fnc_initOrgStore.sqf +++ b/arma/server/addons/org/functions/fnc_initOrgStore.sqf @@ -148,8 +148,9 @@ GVAR(OrgModel) = compileFinal createHashMapObject [[ }] ]]; -GVAR(OrgBaseStore) = compileFinal createHashMapFromArray [ - ["#base", EGVAR(common,BaseStore)], +GVAR(OrgBaseStore) = compileFinal ([ + EGVAR(common,BaseStore), + createHashMapFromArray [ ["#type", "OrgBaseStore"], ["#create", compileFinal { ["INFO", "Org Store Initialized!"] call EFUNC(common,log); @@ -157,20 +158,7 @@ GVAR(OrgBaseStore) = compileFinal createHashMapFromArray [ ["org:exists", ["default"]] call EFUNC(extension,extCall) params ["_result", "_isSuccess"]; if !(_isSuccess) exitWith { ["ERROR", "Failed to check for default org!"] call EFUNC(common,log); - - private _defaultOrg = createHashMapFromArray [ - ["id", "default"], - ["owner", "server"], - ["name", "Forge Dynamics"], - ["funds", 200000], - ["reputation", 0], - ["credit_lines", createHashMap], - ["assets", createHashMap], - ["fleet", createHashMap], - ["members", createHashMap], - ["pending_invites", createHashMap] - ]; - _defaultOrg + true }; if (_result != "true") then { @@ -207,7 +195,7 @@ GVAR(OrgBaseStore) = compileFinal createHashMapFromArray [ ]; }; - _loadedDefaultOrg + true }], ["callHotOrg", compileFinal { params [["_function", "", [""]], ["_arguments", [], [[]]]]; @@ -1363,7 +1351,13 @@ GVAR(OrgBaseStore) = compileFinal createHashMapFromArray [ _finalOrg }] -]; +]] call { + params ["_base", "_child"]; -GVAR(OrgStore) = createHashMapObject [GVAR(OrgBaseStore)]; -GVAR(OrgStore) + private _merged = +_base; + { _merged set [_x, _y]; } forEach _child; + _merged +}); + +GVAR(OrgStore) = createHashMapObject [GVAR(OrgBaseStore), []]; +true diff --git a/arma/server/addons/phone/XEH_preInit.sqf b/arma/server/addons/phone/XEH_preInit.sqf index e25b713..346b5dc 100644 --- a/arma/server/addons/phone/XEH_preInit.sqf +++ b/arma/server/addons/phone/XEH_preInit.sqf @@ -6,7 +6,7 @@ PREP_RECOMPILE_END; // private _category = [QUOTE(MOD_NAME), LLSTRING(displayName)]; -if (isNil QGVAR(PhoneStore)) then { [] call FUNC(initPhoneStore); }; +if (isNil QGVAR(PhoneStore)) then { [] call FUNC(initPhoneStore); true }; // Contact Management Events [QGVAR(requestInitPhone), { diff --git a/arma/server/addons/task/XEH_postInit.sqf b/arma/server/addons/task/XEH_postInit.sqf index 7666467..b9710e4 100644 --- a/arma/server/addons/task/XEH_postInit.sqf +++ b/arma/server/addons/task/XEH_postInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); }; +if (isNil QEGVAR(common,EventBus)) then { call EFUNC(common,eventBus); true }; if (isNil QGVAR(TaskLifecycleEventLogTokens)) then { private _logTaskLifecycleEvent = { params ["_event"];