client/addons/org/functions/fnc_acceptInvite.sqf
Jacob Schmidt 613f05d52a Refactor: Database and Client Updates
This commit introduces several changes related to database interactions and client-side functionality:

*   **Database Response Handling:** Implements a mechanism to handle responses from server requests, specifically for database operations. This includes setting up a callback system to process results based on request IDs.
*   **Store Functionality:** Corrects a typo in the `fnc_buyItem.sqf` script, changing `EFUNC(armory,addArmoryItem)` to `EFUNC(arsenal,addArmoryItem)`.
*   **Inventory Management:** Improves the `fnc_moveInventory.sqf` script by correcting a conditional statement to ensure proper handling of inventory items.
*   **Configuration Updates:** Updates the mod configuration (`CfgMods.hpp`) to use the correct path for the mod picture.
*   **Client Initialization:** Adds a client registration call to the server during client post-initialization (`XEH_postInit_client.sqf`).
*   **Workflow Update:** Updates the build workflow to use the latest Ubuntu runner.
*   **Database Preparation:** Removes unnecessary preparations from `XEH_postInit.sqf` and `XEH_PREP.hpp`.
2025-03-28 09:46:24 -05:00

31 lines
1.0 KiB
Plaintext

#include "..\script_component.hpp"
/*
* Function: forge_client_org_fnc_acceptInvite
* Author: J. Schmidt
*
* Description:
* Allows a player to accept an organization invite from their stored invites
*
* Arguments:
* 0: _playerUID - Player UID <STRING>
* 1: _playerName - Player Name <STRING>
* 2: _inviteKey - Invite key from the player's invites <STRING>
*
* Return Value:
* Success <BOOL>
*/
params [["_playerUID", "", [""]], ["_playerName", "", [""]], ["_inviteKey", "", [""]]];
if (_playerUID == "" || _playerName == "" || _inviteKey == "") exitWith { TRACE_3("Invalid parameters for accepting invitation",_playerUID,_playerName,_inviteKey); false };
private _playerInvites = GETVAR(profileNamespace,FORGE_ORG_INVITES,createHashMap);
private _invite = _playerInvites get _inviteKey;
if (isNil "_invite") exitWith { TRACE_1("Invite not found",_inviteKey); false };
private _orgName = _invite get "orgName";
private _ownerUID = _invite get "ownerUID";
[_ownerUID, _orgName, _playerUID, _playerName, "member"] call FUNC(join);