forked from IDI-Systems/acre2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfnc_dataEvent.sqf
61 lines (56 loc) · 1.64 KB
/
fnc_dataEvent.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "script_component.hpp"
/*
* Author: ACRE2Team
* SHORT DESCRIPTION
*
* Arguments:
* 0: ARGUMENT ONE <TYPE>
* 1: ARGUMENT TWO <TYPE>
*
* Return Value:
* RETURN VALUE <TYPE>
*
* Example:
* [ARGUMENTS] call acre_sys_data_fnc_dataEvent
*
* Public: No
*/
// _this = [radioId, eventType, data]
private _params = ["CfgAcreDataInterface"];
_params append _this;
//private _checkCache = false;
//private _event = "";
/*if ((count _this) == 3) then {
_checkCache = false;
};*/
//_return = nil;
// if (_checkCache) then {
// _event = (_this select 1);
// _cache = missionNamespace getVariable ((_this select 0)+"dataCache");
// if (!isNil "_cache") then {
// _cachedIndex = (_cache select 0) find _event;
// if (_cachedIndex != -1) then {
// _return = (_cache select 1) select _cachedIndex;
// };
// };
// };
//if (!isNil "_return") exitWith { _return; };
private _return = _params call FUNC(acreEvent);
// if (_checkCache) then {
// if (!isNil "_return") then {
// _cache = missionNamespace getVariable ((_this select 0)+"dataCache");
// if (isNil "_cache") then {
// _cache = [[],[]];
// missionNamespace setVariable [(_this select 0)+"dataCache", _cache];
// };
// _cachedIndex = (_cache select 0) find _event;
// if (_cachedIndex != -1) then {
// _return = (_cache select 1) set[_cachedIndex, _return];
// } else {
// _cachedIndex = PUSH((_cache select 0),_event);
// (_cache select 1) set[_cachedIndex, _return];
// };
// };
// };
if (isNil "_return") exitWith { nil };
_return;