added main loop on module init function to handle CoT Routing in the module for all syncronized objects

This commit is contained in:
Valmo Trindade
2025-01-31 05:06:08 -03:00
parent 7504a2c3a5
commit 4cc0a67097

View File

@@ -18,26 +18,35 @@ if (isServer) exitWith {
"armatak" callExtension ["cot_router:start", [_tak_server_fulladdress]]; "armatak" callExtension ["cot_router:start", [_tak_server_fulladdress]];
/* _syncUnits = synchronizedObjects _logic;
[{
missionNamespace setVariable ["_armatak_marked_units", _syncUnits];
_syncedUnits = missionNamespace getVariable "_armatak_marked_units";
[{ [{
_syncedUnits = missionNamespace getVariable "_armatak_marked_units"; _syncedUnits = missionNamespace getVariable "_armatak_marked_units";
_markers = [];
{ {
_objectType = _x call BIS_fnc_objectType;
if ((_objectType select 0) == "Soldier") then {
_callsign = [_x] call armatak_fnc_extract_callsign;
_group_name = [group _x] call armatak_fnc_extract_group_color;
_group_role = [_x] call armatak_fnc_extract_group_role;
[_x, _callsign, _group_name, _group_role] call armatak_fnc_send_human_cot;
};
if ((_objectType select 0) == "Vehicle") then {
_atak_type = [_x] call armatak_fnc_extract_role;
_callsign = [_x] call armatak_fnc_extract_callsign;
[_x, _atak_type, _callsign] call armatak_fnc_send_marker_cot;
};
if (unitIsUAV _x) then { if (unitIsUAV _x) then {
_marker = _x call armatak_fnc_extract_drone_info; [_x] call armatak_fnc_send_drone_cot;
_markers append [_marker];
} else {
_marker = _x call armatak_fnc_extract_info;
_markers append [_marker];
}; };
} forEach _syncedUnits; } forEach _syncedUnits;
}, 2, []] call CBA_fnc_addPerFrameHandler;
_request = "armatak" callExtension ["ots_api:post", [_markers]];
}, 1, []] call CBA_fnc_addPerFrameHandler;
}, [], 1] call CBA_fnc_waitAndExecute;
*/
}; };
true; true;