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>
72 lines
2.2 KiB
Plaintext
72 lines
2.2 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* File: fnc_initVGStore.sqf
|
|
* Author: IDSolutions
|
|
* Date: 2025-12-17
|
|
* Last Update: 2026-01-03
|
|
* Public: No
|
|
*
|
|
* Description:
|
|
* Initializes the Virtual Garage store for managing player vehicle unlocks.
|
|
* Provides methods for syncing, saving, and applying virtual vehicles to BIS Garage.
|
|
*
|
|
* Parameter(s):
|
|
* N/A
|
|
*
|
|
* Returns:
|
|
* Something [BOOL]
|
|
*
|
|
* Example(s):
|
|
* [parameter] call forge_x_component_fnc_myFunction
|
|
*/
|
|
|
|
#pragma hemtt ignore_variables ["_self"]
|
|
GVAR(VGarageStore) = createHashMapObject [[
|
|
["#base", EGVAR(common,BaseStore)],
|
|
["#type", "IVGarageStore"],
|
|
["#create", {
|
|
GVAR(VGarageRegistry) = createHashMap;
|
|
|
|
_self set ["_registry", GVAR(VGarageRegistry)];
|
|
_self set ["_extCallPrefix", "owned:garage"];
|
|
_self set ["_readMethod", "fetch"];
|
|
_self set ["_storeName", "VGarage"];
|
|
_self set ["_syncEventName", CRPC(garage,responseSyncVG)];
|
|
|
|
["INFO", "VGarage Store Initialized!", nil, nil] call EFUNC(common,log);
|
|
}],
|
|
["init", {
|
|
params [["_uid", "", [""]], ["_defaultVGarage", createHashMap, [createHashMap]]];
|
|
|
|
private _finalVGarage = createHashMap;
|
|
|
|
["owned:garage:exists", [_uid]] call EFUNC(extension,extCall) params ["_result", "_isSuccess"];
|
|
private _exists = _result == "true";
|
|
|
|
if !(_exists) then {
|
|
_finalVGarage = _defaultVGarage;
|
|
|
|
["owned:garage:create", [_uid]] call EFUNC(extension,extCall);
|
|
["INFO", format ["Created new VGarage for %1", _uid], nil, nil] call EFUNC(common,log);
|
|
} else {
|
|
private _existingVGarage = _self call ["fetch", [_uid]];
|
|
_finalVGarage = _existingVGarage;
|
|
|
|
{
|
|
if !(_x in _finalVGarage) then { _finalVGarage set [_x, _y]; };
|
|
} forEach _defaultVGarage;
|
|
};
|
|
|
|
GVAR(VGarageRegistry) set [_uid, _finalVGarage];
|
|
|
|
private _player = [_uid] call EFUNC(common,getPlayer);
|
|
[CRPC(garage,responseInitVG), [_finalVGarage], _player] call CFUNC(targetEvent);
|
|
|
|
_finalVGarage
|
|
}]
|
|
]];
|
|
|
|
SETMVAR(FORGE_VGarageStore,GVAR(VGarageStore));
|
|
GVAR(VGarageStore)
|