mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 17:03:31 +00:00
Added video url prop to 3den editor/zeus, allowing to parse __video prop to cots
This commit is contained in:
@@ -78,6 +78,16 @@ class Cfg3den {
|
||||
condition = "objectVehicle";
|
||||
typeName = "STRING";
|
||||
};
|
||||
class armatak_attribute_marker_video_url {
|
||||
displayName = "Video Feed URL";
|
||||
tooltip = "Video feed URL injected into __video on TAK";
|
||||
property = "armatak_attribute_marker_video_url";
|
||||
control = "Edit";
|
||||
expression = "_this setVariable ['armatak_attribute_marker_video_url',_value]";
|
||||
defaultValue = "''";
|
||||
condition = "objectVehicle";
|
||||
typeName = "STRING";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -31,6 +31,9 @@ class CfgFunctions {
|
||||
class extract_marker_callsign {
|
||||
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_marker_callsign.sqf";
|
||||
};
|
||||
class extract_marker_video_url {
|
||||
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_marker_video_url.sqf";
|
||||
};
|
||||
class extract_role {
|
||||
file = "\armatak\armatak\addons\main\functions\extract_data\fn_extract_role.sqf";
|
||||
};
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
|
||||
params ["_unit", "_type", "_callsign"];
|
||||
|
||||
_unit_position = _unit call armatak_client_fnc_extractClientPosition;
|
||||
|
||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||
|
||||
_marker_cot = [_uuid, _type, _unit_position select 1, _unit_position select 2, _unit_position select 3, _callsign, _unit_position select 5, _unit_position select 6];
|
||||
|
||||
"armatak" callExtension ["tcp_socket:cot:marker", [_marker_cot]];
|
||||
_unit_position = _unit call armatak_client_fnc_extractClientPosition;
|
||||
_video_url = [_unit] call armatak_fnc_extract_marker_video_url;
|
||||
|
||||
_uuid = _unit call armatak_fnc_extract_uuid;
|
||||
|
||||
_marker_cot = [_uuid, _type, _unit_position select 1, _unit_position select 2, _unit_position select 3, _callsign, _unit_position select 5, _unit_position select 6, _video_url];
|
||||
|
||||
"armatak" callExtension ["tcp_socket:cot:marker", [_marker_cot]];
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// function name: armatak_fnc_extract_marker_video_url
|
||||
// function author: Codex
|
||||
// function description: Gets the marker video URL configured in 3DEN for a vehicle
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
private _videoUrl = _unit getVariable ["armatak_attribute_marker_video_url", ""];
|
||||
|
||||
if (isNil "_videoUrl") exitWith {
|
||||
""
|
||||
};
|
||||
|
||||
_videoUrl
|
||||
@@ -1,83 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
params [
|
||||
["_logic", objNull, [objNull]],
|
||||
["_units", [], [[]]],
|
||||
["_activated", true, [true]]
|
||||
];
|
||||
|
||||
if (isServer) exitWith {
|
||||
private _instance_address = GETVAR(_logic,GVAR(instanceAddress),false);
|
||||
private _instance_port = GETVAR(_logic,GVAR(instancePort),false);
|
||||
private _instance_auth_user = GETVAR(_logic,GVAR(instanceAuthUser),false);
|
||||
private _instance_auth_pass = GETVAR(_logic,GVAR(instanceAuthPassword),false);
|
||||
|
||||
SETMVAR(GVAR(instanceAddress),_instance_address);
|
||||
SETMVAR(GVAR(instancePort),_instance_port);
|
||||
SETMVAR(GVAR(instanceAuthUser),_instance_auth_user);
|
||||
SETMVAR(GVAR(instanceAuthPassword),_instance_auth_pass);
|
||||
|
||||
_startAction = [
|
||||
QGVAR(startStream),
|
||||
"Start Video Feed",
|
||||
"",
|
||||
{
|
||||
_uuid = (_this select 0) call armatak_fnc_extract_uuid;
|
||||
_uuid_short = _uuid select [0, 8];
|
||||
_role = roleDescription (_this select 0);
|
||||
_name = name (_this select 0);
|
||||
|
||||
_role = [_role] call BIS_fnc_filterString;
|
||||
_name = [_name] call BIS_fnc_filterString;
|
||||
|
||||
_stream_path = _name + "_" + _role + "_" + _uuid_short;
|
||||
|
||||
armatak_mediamtx_video_stream_instance_address = GETMVAR(instance_address,false);
|
||||
armatak_mediamtx_video_stream_instance_port = missionNamespace getVariable "instance_port";
|
||||
armatak_mediamtx_video_stream_instance_auth_user = missionNamespace getVariable "instance_auth_user";
|
||||
armatak_mediamtx_video_stream_instance_auth_pass = missionNamespace getVariable "instance_auth_pass";
|
||||
|
||||
"armatak" callExtension ["video_stream:start", [armatak_mediamtx_video_stream_instance_address, armatak_mediamtx_video_stream_instance_port, _stream_path, armatak_mediamtx_video_stream_instance_auth_user, armatak_mediamtx_video_stream_instance_auth_pass]];
|
||||
(_this select 0) setVariable ["armatak_video_feed_is_streaming", true];
|
||||
},
|
||||
{
|
||||
(_this select 0) getVariable "armatak_video_feed_is_streaming" == false
|
||||
}
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
[
|
||||
"Man",
|
||||
1,
|
||||
["ACE_SelfActions"],
|
||||
_startAction,
|
||||
true
|
||||
] call ace_interact_menu_fnc_addActionToClass;
|
||||
|
||||
_stopAction = [
|
||||
"ArmatakStopStream",
|
||||
"Stop Video Feed",
|
||||
"",
|
||||
{
|
||||
"armatak" callExtension ["video_stream:stop", []];
|
||||
SETVAR(_this select 0,GVAR(isStreaming),false);
|
||||
},
|
||||
{
|
||||
GETVAR((this select 0),GVAR(isStreaming),false)
|
||||
}
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
[
|
||||
"Man",
|
||||
1,
|
||||
["ACE_SelfActions"],
|
||||
_stopAction,
|
||||
true
|
||||
] call ace_interact_menu_fnc_addActionToClass;
|
||||
if (isMultiplayer) then {
|
||||
{
|
||||
SETVAR(_x,GVAR(isStreaming),false);
|
||||
} forEach playableUnits;
|
||||
} else {
|
||||
SETVAR(player,GVAR(isStreaming),false);
|
||||
};
|
||||
};
|
||||
|
||||
true;
|
||||
Reference in New Issue
Block a user