Commit 021889e9 authored by Razer's avatar Razer
Browse files

Updated extension callback handling

parent 087d6279
......@@ -38,15 +38,15 @@ if (_name == 'libredex_callback') then {";
_eventString = _eventString + "
_this spawn {
params ['_name','_function','_params'];
params ['_name','_function',['_paramsLibredex','[]']];
_timeout = diag_tickTime + 3;
waitUntil {!isNil {missionNamespace getVariable _function} || diag_tickTime > _timeout};
if (diag_tickTime > _timeout) exitWith {diag_log format ['<ApmsDB>: ERROR: Unable to find callback function UUID: %1',_function]};
(missionNamespace getVariable _function) params ['_callFunction','_params'];
if (_params != '') then {_params append (parseSimpleArray _params)};
_params call (missionNamespace getVariable [_callFunction,{diag_log format ['<ApmsDB>: ERROR: Unable to find function: %1',_callFunction]}]);
(missionNamespace getVariable _function) params ['_callFunction',['_params',[]]];
_params append (parseSimpleArray _paramsLibredex);
_params call (missionNamespace getVariable [_callFunction,{diag_log format ['<ApmsDB>: ERROR: Unable to find function: %1',_callFunction]}]);
};
};
if (_name == 'libredex_callin') then {";
......@@ -61,7 +61,14 @@ if (_name == 'libredex_callin') then {";
};
_eventString = _eventString + "
_params = parseSimpleArray _params;
_params = (_params splitString ' ') joinString '';
if (((_params splitString '') select 0) isEqualTo '[') then {
_params = parseSimpleArray _params;
} else {
_params = '[' + _params + ']';
_params = parseSimpleArray _params;
};
diag_log format ['%1',_params];
_params spawn (missionNamespace getVariable [_function,{diag_log format ['<ApmsDB>: ERROR: Unable to find funtion: %1',_function]}]);
};";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment