mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
05d30c5573
* convert log macros to cba versions * Add changes to AB * remove obsolete macro
35 lines
839 B
Plaintext
35 lines
839 B
Plaintext
/*
|
|
* Author: jaynus
|
|
* Handles synced events being received. Server will log them, and server/client will execute them.
|
|
*
|
|
* Arguments [Client] :
|
|
* 0: eventName <STRING>
|
|
* 1: arguments <ARRAY>
|
|
* 2: ttl <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* Boolean of success <BOOL>
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_name", "_args", "_ttl"];
|
|
|
|
if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith {
|
|
ERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name);
|
|
false
|
|
};
|
|
|
|
private _internalData = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet;
|
|
_internalData params ["_eventCode", "_eventLog"];
|
|
|
|
if (isServer) then {
|
|
// Server needs to internally log it for synchronization
|
|
if (_ttl > -1) then {
|
|
_eventLog pushBack [diag_tickTime, _args, _ttl];
|
|
};
|
|
};
|
|
|
|
_args call _eventCode;
|