mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:23:28 +00:00
adding OTS authentication handling on init function
This commit is contained in:
@@ -6,7 +6,7 @@ prefix = "armatak"
|
|||||||
[version]
|
[version]
|
||||||
build = 0
|
build = 0
|
||||||
major = 0
|
major = 0
|
||||||
minor = 6
|
minor = 7
|
||||||
patch = 0
|
patch = 0
|
||||||
|
|
||||||
git_hash = 0
|
git_hash = 0
|
||||||
|
|||||||
@@ -52,8 +52,20 @@ class CfgVehicles {
|
|||||||
class Units: Units {
|
class Units: Units {
|
||||||
property = "armatak_module_property_attached_units";
|
property = "armatak_module_property_attached_units";
|
||||||
};
|
};
|
||||||
class armatak_module_ots_api_instance_protocol: Combo {
|
class armatak_module_api_instance: Combo {
|
||||||
property = "armatak_module_property_ots_api_instance_protocol";
|
property = "armatak_module_property_api_instance";
|
||||||
|
displayname = "TAK API Instance";
|
||||||
|
tooltip = "Used TAK Server Instance";
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "ots";
|
||||||
|
|
||||||
|
class Values {
|
||||||
|
class ots { name = "Open TAK Server"; value = "ots"; default = 1; };
|
||||||
|
class fts { name = "Free TAK Server"; value = "fts"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class armatak_module_api_instance_protocol: Combo {
|
||||||
|
property = "armatak_module_property_api_instance_protocol";
|
||||||
displayname = "OTS Protocol";
|
displayname = "OTS Protocol";
|
||||||
tooltip = "OpenTAKServer instance protocol";
|
tooltip = "OpenTAKServer instance protocol";
|
||||||
typeName = "STRING";
|
typeName = "STRING";
|
||||||
@@ -64,29 +76,29 @@ class CfgVehicles {
|
|||||||
class https { name = "HTTPS"; value = "https"; };
|
class https { name = "HTTPS"; value = "https"; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
class armatak_module_ots_api_instance_address: Edit {
|
class armatak_module_api_instance_address: Edit {
|
||||||
property = "armatak_module_property_ots_api_instance_address";
|
property = "armatak_module_property_api_instance_address";
|
||||||
displayname = "OTS Address";
|
displayname = "OTS Address";
|
||||||
tooltip = "OpenTAKServer Instance Address";
|
tooltip = "OpenTAKServer Instance Address";
|
||||||
typeName = "STRING";
|
typeName = "STRING";
|
||||||
defaultValue = "localhost";
|
defaultValue = "localhost";
|
||||||
};
|
};
|
||||||
class armatak_module_ots_api_instance_port: Edit {
|
class armatak_module_api_instance_port: Edit {
|
||||||
property = "armatak_module_property_ots_api_instance_port";
|
property = "armatak_module_property_api_instance_port";
|
||||||
displayname = "OTS Port";
|
displayname = "OTS Port";
|
||||||
tooltip = "OpenTAKServer Instance Port";
|
tooltip = "OpenTAKServer Instance Port";
|
||||||
typeName = "NUMBER";
|
typeName = "NUMBER";
|
||||||
defaultValue = "8080";
|
defaultValue = "8080";
|
||||||
};
|
};
|
||||||
class armatak_module_ots_api_instance_username: Edit {
|
class armatak_module_api_instance_username: Edit {
|
||||||
property = "armatak_module_property_ots_api_instance_username";
|
property = "armatak_module_property_api_instance_username";
|
||||||
displayname = "API Username";
|
displayname = "API Username";
|
||||||
tooltip = "API Username for authorization";
|
tooltip = "API Username for authorization";
|
||||||
typeName = "STRING";
|
typeName = "STRING";
|
||||||
defaultValue = "administrator";
|
defaultValue = "administrator";
|
||||||
};
|
};
|
||||||
class armatak_module_ots_api_instance_password: Edit {
|
class armatak_module_api_instance_password: Edit {
|
||||||
property = "armatak_module_property_ots_api_instance_password";
|
property = "armatak_module_property_api_instance_password";
|
||||||
displayname = "API Password";
|
displayname = "API Password";
|
||||||
tooltip = "API Password for authorization";
|
tooltip = "API Password for authorization";
|
||||||
typeName = "STRING";
|
typeName = "STRING";
|
||||||
|
|||||||
15
addons/main/functions/extract_data/fn_extract_position.sqf
Normal file
15
addons/main/functions/extract_data/fn_extract_position.sqf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// function name: armatak_fnc_extract_position
|
||||||
|
// function author: Valmo
|
||||||
|
// function description: Receives a player's unit as param and return the information array for SIMTAK
|
||||||
|
|
||||||
|
params["_unit"];
|
||||||
|
private _location = (getPos _unit) call armatak_fnc_convert_location;
|
||||||
|
|
||||||
|
private _atak_latitude = _location select 0;
|
||||||
|
private _atak_longitude = _location select 1;
|
||||||
|
private _atak_altitude = _location select 2;
|
||||||
|
private _atak_bearing = parseNumber ((getDir _unit) toFixed 0);
|
||||||
|
|
||||||
|
_unit_info = [_atak_latitude,_atak_longitude,_atak_altitude,_atak_bearing];
|
||||||
|
|
||||||
|
_unit_info
|
||||||
@@ -3,3 +3,33 @@ params [
|
|||||||
["_units", [], [[]]],
|
["_units", [], [[]]],
|
||||||
["_activated", true, [true]]
|
["_activated", true, [true]]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (isServer && _activated) exitWith {
|
||||||
|
private _warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Connecting to OTS Server..."];
|
||||||
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
|
||||||
|
private _atak_instance_protocol = _logic getVariable "armatak_module_api_instance_protocol";
|
||||||
|
private _atak_instance_address = _logic getVariable "armatak_module_api_instance_address";
|
||||||
|
private _atak_instance_port = _logic getVariable "armatak_module_api_instance_port";
|
||||||
|
|
||||||
|
private _atak_fulladdress = _atak_instance_protocol + ":" + "/" + "/" + _atak_instance_address + ":" + (str _atak_instance_port);
|
||||||
|
private _atak_api_username = _logic getVariable "armatak_module_api_instance_username";
|
||||||
|
private _atak_api_password = _logic getVariable "armatak_module_api_instance_password";
|
||||||
|
|
||||||
|
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;
|
||||||
|
} else {
|
||||||
|
private _warning = format ["<t color='#2B7319'>ARMATAK</t><br/> %1", "Connected"];
|
||||||
|
[[_warning, 2]] call CBA_fnc_notify;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
true;
|
||||||
Reference in New Issue
Block a user