client/addons/org/functions/fnc_addMember.sqf
Jacob Schmidt 31402b40db
All checks were successful
Build / Build (push) Successful in 27s
Refactor: Organization Store CRUD Operations and Function Simplification
This commit refactors the organization store to utilize the new CRUD (Create, Read, Update, Delete) operations and simplifies several organization-related functions.

*   **Organization Store CRUD Operations:** Implements a new interface for the organization store, providing methods for creating, reading, updating, and deleting organization data. This includes methods for adding and removing assets, managing funds and reputation, and handling member operations. The store now interfaces with the ArmaDragonflyClient database for persistence.
*   **Function Simplification:** Simplifies several organization functions by leveraging the new CRUD operations within the organization store. This reduces code duplication and improves readability. Specifically:
    *   `fnc_addAsset.sqf`: Simplified to use the `addAsset` method.
    *   `fnc_removeAsset.sqf`: Simplified to use the `removeAsset` method.
    *   `fnc_create.sqf`: Simplified to use the `createOrg` method.
    *   `fnc_leave.sqf`: Simplified to use the `leaveOrg` method.
    *   `fnc_disband.sqf`: Simplified to use the `deleteOrg` method.
    *   `fnc_addFunds.sqf`: Simplified to use the `updateFunds` method.
    *   `fnc_addReputation.sqf`: Simplified to use the `updateReputation` method.
    *   `fnc_verifyOrgStore.sqf`: Improved to ensure the store is initialized.
*   **XEH Updates:** Updated `XEH_PREP.hpp` files to reflect the changes in function calls.
*   **Locker Fix:** Fixed an issue in `fnc_equipGear.sqf` where the `isNull` check was incorrect for certain gear types.
2025-03-30 17:15:02 -05:00

31 lines
722 B
Plaintext

#include "..\script_component.hpp"
/*
* Function: forge_client_org_fnc_addMember
* Author: J. Schmidt
*
* Description:
* Adds a member to an organization
*
* Arguments:
* 0: _uid - Target player UID <STRING>
* 1: _name - Target player name <STRING>
*
* Return Value:
* Success <BOOL>
*/
params [["_uid", "", [""]], ["_name", "", [""]]];
if (_uid == "" || _name == "") exitWith { TRACE_2("Invalid parameters for organization invitation",_uid,_name); false };
private _store = call FUNC(verifyOrgStore);
private _result = _store call ["addMember", [_uid, _name]];
if (_result) then {
TRACE_2("Member added successfully",_uid,_name);
} else {
TRACE_2("Failed to add member",_uid,_name);
};
_result