forge/arma/server/addons/locker/functions/fnc_initVAStore.sqf
Jacob Schmidt ebfe77a340 feat: implement complete Forge framework with Rust/Redis backend and Arma 3 integration
Implemented features:
- High-performance Rust extension with Redis persistence
- Actor/player management with loadout, position, and state tracking
- Banking system with deposit, withdraw, and transfer operations
- Physical and virtual garage/locker systems for vehicle and equipment storage
- Organization management with member tracking and permissions
- Client-side UI with React-like state management
- Server-side event-driven architecture with CBA Events
- Security: Self-transfer prevention at multiple layers
- Logging system with per-module log files
- ICOM module for inter-server communication

Co-Authored-By: Warp <agent@warp.dev>
2026-01-04 12:52:15 -06:00

72 lines
2.2 KiB
Plaintext

#include "..\script_component.hpp"
/*
* File: fnc_initVAStore.sqf
* Author: IDSolutions
* Date: 2025-12-17
* Last Update: 2026-01-03
* Public: No
*
* Description:
* Initializes the Virtual Arsenal store for managing player arsenal unlocks.
* Provides methods for syncing, saving, and applying virtual items to BIS Arsenal.
*
* Parameter(s):
* N/A
*
* Returns:
* vArsenal class object [HASHMAP OBJECT]
*
* Example(s):
* [parameter] call forge_client_locker_fnc_initVAStore;
*/
#pragma hemtt ignore_variables ["_self"]
GVAR(VArsenalStore) = createHashMapObject [[
["#base", EGVAR(common,BaseStore)],
["#type", "IVArsenalStore"],
["#create", {
GVAR(VArsenalRegistry) = createHashMap;
_self set ["_registry", GVAR(VArsenalRegistry)];
_self set ["_extCallPrefix", "owned:locker"];
_self set ["_readMethod", "fetch"];
_self set ["_storeName", "VArsenal"];
_self set ["_syncEventName", CRPC(locker,responseSyncVA)];
["INFO", "VArsenal Store Initialized!", nil, nil] call EFUNC(common,log);
}],
["init", {
params [["_uid", "", [""]], ["_defaultVArsenal", createHashMap, [createHashMap]]];
private _finalVArsenal = createHashMap;
["owned:locker:exists", [_uid]] call EFUNC(extension,extCall) params ["_result", "_isSuccess"];
private _exists = _result == "true";
if !(_exists) then {
_finalVArsenal = _defaultVArsenal;
["owned:locker:create", [_uid]] call EFUNC(extension,extCall);
["INFO", format ["Created new VArsenal for %1", _uid], nil, nil] call EFUNC(common,log);
} else {
private _existingVArsenal = _self call ["fetch", [_uid]];
_finalVArsenal = _existingVArsenal;
{
if !(_x in _finalVArsenal) then { _finalVArsenal set [_x, _y]; };
} forEach _defaultVArsenal;
};
GVAR(VArsenalRegistry) set [_uid, _finalVArsenal];
private _player = [_uid] call EFUNC(common,getPlayer);
[CRPC(locker,responseInitVA), [_finalVArsenal], _player] call CFUNC(targetEvent);
_finalVArsenal
}]
]];
SETMVAR(FORGE_VArsenalStore,GVAR(VArsenalStore));
GVAR(VArsenalStore)