mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:23:28 +00:00
Created video addon
This commit is contained in:
1
addons/video/$PBOPREFIX$
Normal file
1
addons/video/$PBOPREFIX$
Normal file
@@ -0,0 +1 @@
|
|||||||
|
armatak\armatak\addons\video
|
||||||
11
addons/video/CfgEventHandlers.hpp
Normal file
11
addons/video/CfgEventHandlers.hpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
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
addons/video/XEH_PREP.hpp
Normal file
1
addons/video/XEH_PREP.hpp
Normal file
@@ -0,0 +1 @@
|
|||||||
|
PREP(videoParser);
|
||||||
9
addons/video/XEH_preInit.sqf
Normal file
9
addons/video/XEH_preInit.sqf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
ADDON = false;
|
||||||
|
|
||||||
|
PREP_RECOMPILE_START;
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
|
PREP_RECOMPILE_END;
|
||||||
|
|
||||||
|
ADDON = true;
|
||||||
3
addons/video/XEH_preStart.sqf
Normal file
3
addons/video/XEH_preStart.sqf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
#include "XEH_PREP.hpp"
|
||||||
41
addons/video/config.cpp
Normal file
41
addons/video/config.cpp
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
class CfgPatches {
|
||||||
|
class ADDON {
|
||||||
|
name = COMPONENT_NAME;
|
||||||
|
units[] = {
|
||||||
|
"armatak_module_core",
|
||||||
|
"armatak_module_callsign"
|
||||||
|
};
|
||||||
|
weapons[] = {};
|
||||||
|
requiredAddons[] = {
|
||||||
|
"cba_main",
|
||||||
|
"ace_main",
|
||||||
|
"armatak_main"
|
||||||
|
};
|
||||||
|
requiredVersion = REQUIRED_VERSION;
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
url = "https://github.com/valmojr/armatak";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class CfgMods {
|
||||||
|
class PREFIX {
|
||||||
|
name = "Arma Team Awareness Kit";
|
||||||
|
author = PROJECT_AUTHOR;
|
||||||
|
logo = "logo_ca.paa";
|
||||||
|
logoOver = "logo_hover_ca.paa";
|
||||||
|
tooltip = "ARMATAK";
|
||||||
|
tooltipOwned = "ARMATAK";
|
||||||
|
picture = "picture.paa";
|
||||||
|
actionName = "GitHub";
|
||||||
|
action = "https://github.com/valmojr/armatak";
|
||||||
|
overview = "ARMATAK Addons allows Arma 3 sessions to be parsed to TAK Clients";
|
||||||
|
hideName = 0;
|
||||||
|
hidePicture = 0;
|
||||||
|
dlcColor[] = { 0.23, 0.39, 0.30, 1 };
|
||||||
|
logoSmall = "logo_small_ca.paa";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "CfgEventHandlers.hpp"
|
||||||
83
addons/video/functions/fnc_videoParser.sqf
Normal file
83
addons/video/functions/fnc_videoParser.sqf
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
|
params [
|
||||||
|
["_logic", objNull, [objNull]],
|
||||||
|
["_units", [], [[]]],
|
||||||
|
["_activated", true, [true]]
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isServer) exitWith {
|
||||||
|
private _instance_address = GETVAR(_logic,instance_address,false);
|
||||||
|
private _instance_port = GETVAR(_logic,instance_port,false);
|
||||||
|
private _instance_auth_user = GETVAR(_logic,instance_auth_user,false);
|
||||||
|
private _instance_auth_pass = GETVAR(_logic,instance_auth_pass,false);
|
||||||
|
|
||||||
|
SETMVAR(GVAR(instance_address),_instance_address);
|
||||||
|
SETMVAR(GVAR(instance_port),_instance_port);
|
||||||
|
SETMVAR(GVAR(instance_auth_user),_instance_auth_user);
|
||||||
|
SETMVAR(GVAR(instance_auth_pass),_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;
|
||||||
17
addons/video/script_component.hpp
Normal file
17
addons/video/script_component.hpp
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#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"
|
||||||
Reference in New Issue
Block a user