#include "..\script_component.hpp" /* * Function: forge_client_db_fnc_requestServerDB * Author: J. Schmidt * * Description: * Sends database requests to the server using CBA events * * Arguments: * 0: _type - Type of database operation * 1: _data - Data for the operation * 2: _callback - Function to call when data is returned * * Return Value: * Request ID */ params [ ["_type", "", [""]], ["_data", nil, [createHashMap, [], "", 0, true, objNull]], ["_callback", {}, [{}]] ]; private _requestID = format ["%1_%2", diag_tickTime, random 1000]; if (isNil QGVAR(pendingCallbacks)) then { GVAR(pendingCallbacks) = createHashMap; }; GVAR(pendingCallbacks) set [_requestID, _callback]; ["forge_db_request", [getPlayerUID player, _type, _data, _requestID]] call CBA_fnc_serverEvent; _requestID