forge/arma/server/addons/main/functions/fnc_initStores.sqf
Jacob Schmidt 6c0ce9e867 refactor(bank): split monolithic store into focused modules; fix locker grant for attachments
- Split BankBaseStore into SessionManager, Messenger, Model, Store, Validator
- Extract validation logic into BankValidator with try/catch and per-action methods
- Remove duplicate notifications from transaction actions
- Update event handlers to call validator first, forward context to store/session
- Fix locker grantItems: add missing 'attachment' category mapping to 'item'
- Fix locker grantItems: replace exitWith with if/else to prevent skipping remaining items

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-03-16 10:54:25 -05:00

49 lines
1.3 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Author: J.Schmidt
* Initializes all stores in the correct order.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* call forge_server_main_fnc_initStores;
*
* Public: No
*/
// Base
if (isNil QEGVAR(common,BaseStore)) then { call EFUNC(common,baseStore); };
// Actor
if (isNil QEGVAR(actor,ActorStore)) then { call EFUNC(actor,initActorStore); };
// 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,BankStore)) then { call EFUNC(bank,initStore); };
if (isNil QEGVAR(bank,BankValidator)) then { call EFUNC(bank,initValidator); };
// Garage
if (isNil QEGVAR(garage,GarageStore)) then { call EFUNC(garage,initGarageStore); };
// VGarage
if (isNil QEGVAR(garage,VGarageStore)) then { call EFUNC(garage,initVGStore); };
// Locker
if (isNil QEGVAR(locker,LockerStore)) then { call EFUNC(locker,initLockerStore); };
// VArsenal
if (isNil QEGVAR(locker,VAStore)) then { call EFUNC(locker,initVAStore); };
// Org
if (isNil QEGVAR(org,OrgStore)) then { call EFUNC(org,initOrgStore); };
// Store
if (isNil QEGVAR(store,StoreStore)) then { call EFUNC(store,initStoreStore); };