added handling on SQF for letting the OTS server handle sync links on entities with core armatak module

This commit is contained in:
Valmo Trindade
2024-12-11 04:11:46 -03:00
parent d10dd71dca
commit 7e143c1b6b
5 changed files with 43 additions and 10 deletions

View File

@@ -19,9 +19,9 @@ if (isServer && _activated) exitWith {
missionNamespace setVariable ["_atak_server_instance", _atak_fulladdress];
missionNamespace setVariable ["_atak_server_instance_username", _atak_api_username];
missionNamespace setVariable ["_atak_server_instance_password", _atak_api_password];
/*
_atak_server_instance_token = call armatak_fnc_extract_auth_token;
if (_atak_server_instance_token == "") then {
private _warning = format ["<t color='#FF0000'>ARMATAK</t><br/> %1", "Connection Failed"];
[[_warning, 2]] call CBA_fnc_notify;
@@ -29,7 +29,31 @@ if (isServer && _activated) exitWith {
private _warning = format ["<t color='#2B7319'>ARMATAK</t><br/> %1", "Connected"];
[[_warning, 2]] call CBA_fnc_notify;
};
*/
_syncUnits = synchronizedObjects _logic;
missionNamespace setVariable ["_armatak_marked_units", _syncUnits];
[{
[{
_syncedUnits = missionNamespace getVariable "_armatak_marked_units";
_markers = [];
{
if (unitIsUAV _x) then {
_marker = _x call armatak_fnc_extract_drone_info;
_markers append [_marker];
} else {
_marker = _x call armatak_fnc_extract_info;
_markers append [_marker];
};
} forEach _syncedUnits;
_request = "armatak" callExtension ["ots_api:post", [_markers]];
systemChat format ["Result: %1, Code: %2", _request select 0, _request select 1];
}, 1, []] call CBA_fnc_addPerFrameHandler;
}, [], 5] call CBA_fnc_waitAndExecute;
};
true;