mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 14:23:28 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 753dcab26e | |||
| 2f53488ba8 | |||
| 323339e679 | |||
| 3f14a75e81 | |||
| 469a54c141 |
@@ -107,6 +107,12 @@ switch (toLower worldName) do {
|
||||
case "rut_mandol": {
|
||||
_realLocation = _position call armatak_fnc_convert_to_rut_mandol;
|
||||
};
|
||||
case "hellanmaa": {
|
||||
_realLocation = _position call armatak_fnc_convert_to_hellanmaa;
|
||||
};
|
||||
case "hellanmaaw": {
|
||||
_realLocation = _position call armatak_fnc_convert_to_hellanmaa;
|
||||
};
|
||||
default {
|
||||
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
@@ -122,6 +125,9 @@ class CfgFunctions {
|
||||
class convert_to_rut_mandol {
|
||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_rut_mandol.sqf";
|
||||
};
|
||||
class convert_to_hellanmaa {
|
||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_hellanmaa.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
|
||||
30
addons/main/functions/map/fn_convert_to_hellanmaa.sqf
Normal file
30
addons/main/functions/map/fn_convert_to_hellanmaa.sqf
Normal file
@@ -0,0 +1,30 @@
|
||||
params ["_longitudeInGame", "_latitudeInGame", "_altitude"];
|
||||
|
||||
private _mapWidth = 8192;
|
||||
private _mapHeight = 8192;
|
||||
|
||||
// SW corner (used as origin)
|
||||
private _SW_lat = 63.005389;
|
||||
private _SW_lon = 22.638957;
|
||||
|
||||
// SE corner
|
||||
private _SE_lat = 63.010092;
|
||||
private _SE_lon = 22.800107;
|
||||
|
||||
// NW corner
|
||||
private _NW_lat = 63.078713;
|
||||
private _NW_lon = 22.628542;
|
||||
|
||||
private _edgeSE_lat = _SE_lat - _SW_lat;
|
||||
private _edgeSE_lon = _SE_lon - _SW_lon;
|
||||
|
||||
private _edgeNW_lat = _NW_lat - _SW_lat;
|
||||
private _edgeNW_lon = _NW_lon - _SW_lon;
|
||||
|
||||
private _fx = _longitudeInGame / _mapWidth;
|
||||
private _fy = _latitudeInGame / _mapHeight;
|
||||
|
||||
private _realLat = _SW_lat + (_fx * _edgeSE_lat) + (_fy * _edgeNW_lat);
|
||||
private _realLon = _SW_lon + (_fx * _edgeSE_lon) + (_fy * _edgeNW_lon);
|
||||
|
||||
[_realLat, _realLon, _altitude]
|
||||
@@ -1 +0,0 @@
|
||||
armatak\armatak\addons\video
|
||||
@@ -1,11 +0,0 @@
|
||||
class Extended_PreStart_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit));
|
||||
};
|
||||
};
|
||||
@@ -1,73 +0,0 @@
|
||||
class CfgVehicles {
|
||||
class Logic;
|
||||
|
||||
class Module_F : Logic
|
||||
{
|
||||
class AttributesBase
|
||||
{
|
||||
class Default;
|
||||
class Edit;
|
||||
class Combo;
|
||||
class Checkbox;
|
||||
class CheckboxNumber;
|
||||
class ModuleDescription;
|
||||
class Units;
|
||||
};
|
||||
|
||||
class ModuleDescription
|
||||
{
|
||||
class AnyBrain;
|
||||
};
|
||||
};
|
||||
class EGVAR(server,moduleBase);
|
||||
class GVAR(videoModule): EGVAR(server,moduleBase) {
|
||||
scope = 2;
|
||||
scopeCurator = 0;
|
||||
displayname = "Video Streaming Handler";
|
||||
icon = "\a3\Modules_F_Curator\Data\iconRadio_ca.paa";
|
||||
category = QEGVAR(main,moduleCategory);
|
||||
function = QFUNC(videoParser);
|
||||
functionPriority = 1;
|
||||
isGlobal = 0;
|
||||
isTriggerActivated = 1;
|
||||
isDisposable = 1;
|
||||
is3den = 0;
|
||||
curatorCanAttach = 0;
|
||||
curatorInfoType = "RscDisplayAttributeModuleNuke";
|
||||
canSetArea = 0;
|
||||
canSetAreaShape = 0;
|
||||
canSetAreaHeight = 0;
|
||||
/*
|
||||
class Attributes: AttributesBase {
|
||||
class GVAR(instanceAddress): Edit {
|
||||
property = QGVAR(instanceAddress);
|
||||
displayname = "MediaMTX Provider Address";
|
||||
tooltip = "MediaMTX Provider Instance Address";
|
||||
typeName = "STRING";
|
||||
defaultValue = "localhost";
|
||||
};
|
||||
class GVAR(instancePort): Edit {
|
||||
property = QGVAR(instancePort);
|
||||
displayname = QUOTE(MediaMTX Provider Port);
|
||||
tooltip = QUOTE(MediaMTX Provider Port for handling video streams);
|
||||
typeName = "STRING";
|
||||
defaultValue = "8554";
|
||||
};
|
||||
class GVAR(instanceAuthUser): Edit {
|
||||
property = QGVAR(instanceAuthUser);
|
||||
displayname = QUOTE(MediaMTX Provider Username);
|
||||
tooltip = QUOTE(MediaMTX Provider Instance Username);
|
||||
typeName = "STRING";
|
||||
defaultValue = "administrator";
|
||||
};
|
||||
class GVAR(instanceAuthPassword): Edit {
|
||||
property = QGVAR(instanceAuthPassword);
|
||||
displayname = QUOTE(MediaMTX Provider Password);
|
||||
tooltip = QUOTE(MediaMTX Provider Instance Password);
|
||||
typeName = "STRING";
|
||||
defaultValue = "password";
|
||||
};
|
||||
};
|
||||
*/
|
||||
};
|
||||
};
|
||||
@@ -1 +0,0 @@
|
||||
PREP(videoParser);
|
||||
@@ -1,9 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
ADDON = true;
|
||||
@@ -1,3 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#include "XEH_PREP.hpp"
|
||||
@@ -1,23 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
name = COMPONENT_NAME;
|
||||
units[] = {
|
||||
//QGVAR(videoModule)
|
||||
};
|
||||
weapons[] = {};
|
||||
requiredAddons[] = {
|
||||
"cba_main",
|
||||
"ace_main",
|
||||
"armatak_main",
|
||||
"armatak_server"
|
||||
};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
author = PROJECT_AUTHOR;
|
||||
url = "https://github.com/valmojr/armatak";
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
//#include "CfgVehicles.hpp"
|
||||
@@ -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;
|
||||
@@ -1,17 +0,0 @@
|
||||
#define COMPONENT video
|
||||
#define COMPONENT_BEAUTIFIED Video Streaming
|
||||
#include "\armatak\armatak\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
// #define DISABLE_COMPILE_CACHE
|
||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||
|
||||
#ifdef DEBUG_ENABLED_MAIN
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_MAIN
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
@@ -16,9 +16,18 @@ pub struct CursorOverTime {
|
||||
pub track_speed: Option<f32>,
|
||||
pub link_uid: Option<String>,
|
||||
pub remarker: Option<String>,
|
||||
pub video_url: Option<String>,
|
||||
}
|
||||
|
||||
impl CursorOverTime {
|
||||
fn escape_xml_attribute(value: &str) -> String {
|
||||
value
|
||||
.replace('&', "&")
|
||||
.replace('"', """)
|
||||
.replace('<', "<")
|
||||
.replace('>', ">")
|
||||
}
|
||||
|
||||
pub fn convert_to_xml(&self) -> String {
|
||||
let uuid = match &self.uuid {
|
||||
Some(uuid) => uuid,
|
||||
@@ -107,6 +116,18 @@ impl CursorOverTime {
|
||||
xml.push_str(format!("<remarks>ARMATAK | {}</remarks>", remark).as_str());
|
||||
}
|
||||
|
||||
if let Some(video_url) = &self.video_url {
|
||||
if !video_url.trim().is_empty() {
|
||||
xml.push_str(
|
||||
format!(
|
||||
"<__video url=\"{}\" />",
|
||||
Self::escape_xml_attribute(video_url.trim())
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
xml.push_str("</detail></event>");
|
||||
|
||||
return xml;
|
||||
|
||||
@@ -40,6 +40,8 @@ impl DigitalPointerPayload {
|
||||
track_speed: None,
|
||||
link_uid: Some(self.link_uid.clone()),
|
||||
remarker: None,
|
||||
video_url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@ impl EudCoTPayload {
|
||||
track_speed: Some(self.track_speed),
|
||||
link_uid: None,
|
||||
remarker: None,
|
||||
video_url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ impl ExternalPositionPayload {
|
||||
track_speed: Some(self.track_speed),
|
||||
link_uid: None,
|
||||
remarker: Some(self.remarker.clone()),
|
||||
video_url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,40 @@ pub struct MarkerCoTPayload {
|
||||
pub contact_callsign: String,
|
||||
pub track_course: i32,
|
||||
pub track_speed: f32,
|
||||
pub video_url: Option<String>,
|
||||
}
|
||||
|
||||
impl FromArma for MarkerCoTPayload {
|
||||
fn from_arma(data: String) -> Result<MarkerCoTPayload, FromArmaError> {
|
||||
if let Ok((
|
||||
uuid,
|
||||
r#type,
|
||||
point_lat,
|
||||
point_lon,
|
||||
point_hae,
|
||||
contact_callsign,
|
||||
track_course,
|
||||
track_speed,
|
||||
video_url,
|
||||
)) = <(String, String, f64, f64, f32, String, i32, f32, String)>::from_arma(data.clone())
|
||||
{
|
||||
return Ok(Self {
|
||||
uuid,
|
||||
r#type,
|
||||
point_lat,
|
||||
point_lon,
|
||||
point_hae,
|
||||
contact_callsign,
|
||||
track_course,
|
||||
track_speed,
|
||||
video_url: if video_url.trim().is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(video_url)
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
let (
|
||||
uuid,
|
||||
r#type,
|
||||
@@ -34,6 +64,7 @@ impl FromArma for MarkerCoTPayload {
|
||||
contact_callsign,
|
||||
track_course,
|
||||
track_speed,
|
||||
video_url: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -55,6 +86,7 @@ impl MarkerCoTPayload {
|
||||
track_speed: Some(self.track_speed),
|
||||
link_uid: None,
|
||||
remarker: None,
|
||||
video_url: self.video_url.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user