2015-04-17 17:21:41 +00:00
|
|
|
/*
|
|
|
|
* Author: jaynus
|
|
|
|
*
|
|
|
|
* Call and propegate a synced event
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Name (String)
|
|
|
|
* 1: Arguments (Array)
|
|
|
|
* 2: TTL (Number or Code) [Optional] for this specific event call
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* Boolean of success
|
|
|
|
*/
|
2015-04-18 02:26:27 +00:00
|
|
|
//#define DEBUG_MODE_FULL
|
2015-04-17 17:21:41 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
PARAMS_2(_name,_args);
|
|
|
|
private["_ttl", "_eventData", "_internalData", "_eventLog"];
|
|
|
|
|
|
|
|
if( (count _this) > 2) then {
|
|
|
|
_ttl = _this select 2;
|
|
|
|
} else {
|
|
|
|
_ttl = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith {
|
|
|
|
diag_log text format["[ACE] Error, synced event key not found."];
|
|
|
|
false
|
|
|
|
};
|
|
|
|
|
|
|
|
_eventData = [_name, _args,_ttl];
|
|
|
|
["SEH", _eventData] call FUNC(globalEvent);
|