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>
74 lines
1.9 KiB
Plaintext
74 lines
1.9 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: IDSolutions
|
|
* Initializes the garage class.
|
|
*
|
|
* Arguments:
|
|
* None
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [] call forge_client_garage_fnc_initGarageClass;
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
#pragma hemtt ignore_variables ["_self"]
|
|
GVAR(GarageClass) = createHashMapObject [[
|
|
["#type", "IGarageClass"],
|
|
["#create", {
|
|
_self set ["uid", (getPlayerUID player)];
|
|
_self set ["garage", createHashMap];
|
|
_self set ["isLoaded", false];
|
|
_self set ["lastSave", time];
|
|
}],
|
|
["init", {
|
|
private _uid = _self get "uid";
|
|
private _garage = _self get "garage";
|
|
|
|
[SRPC(garage,requestInitGarage), [_uid, _garage]] call CFUNC(serverEvent);
|
|
|
|
systemChat format ["Garage loaded for %1", (name player)];
|
|
diag_log "[FORGE:Client:Garage] Garage Class Initialized!";
|
|
}],
|
|
["save", {
|
|
params [["_sync", false, [false]]];
|
|
|
|
private _uid = _self get "uid";
|
|
[SRPC(garage,requestSaveGarage), [_uid, _sync]] call CFUNC(serverEvent);
|
|
|
|
_self set ["lastSave", time];
|
|
}],
|
|
["sync", {
|
|
params [["_data", createHashMap, [createHashMap]], ["_sync", false, [false]]];
|
|
|
|
private _garage = _self get "garage";
|
|
private _isLoaded = _self get "isLoaded";
|
|
|
|
if (_data isEqualTo createHashMap) exitWith {
|
|
diag_log "[FORGE:Client:Garage] Empty data received for sync, skipping.";
|
|
};
|
|
|
|
{
|
|
_garage set [_x, _y];
|
|
} forEach _data;
|
|
|
|
_self set ["garage", _garage];
|
|
|
|
if !(_isLoaded) then { _self set ["isLoaded", true]; };
|
|
diag_log "[FORGE:Client:Garage] Sync completed";
|
|
}],
|
|
["get", {
|
|
params [["_key", "", [""]], ["_default", nil, [[], "", 0, false, createHashMap]]];
|
|
|
|
private _garage = _self get "garage";
|
|
_garage getOrDefault [_key, _default];
|
|
}]
|
|
]];
|
|
|
|
SETVAR(player,FORGE_GarageClass,GVAR(GarageClass));
|
|
GVAR(GarageClass)
|