mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:33:29 +00:00
removed functions related to HTTP requests
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
params[_type, _message];
|
||||
|
||||
"armatak" callExtension ["log", [_type, _message]]
|
||||
@@ -1,3 +0,0 @@
|
||||
params["_marker"];
|
||||
|
||||
"armatak" callExtension ["ots_api:delete", _marker call armatak_fnc_extract_info];
|
||||
@@ -1,3 +0,0 @@
|
||||
params["_markers"];
|
||||
|
||||
"armatak" callExtension ["ots_api:post", [[_markers]]];
|
||||
@@ -1,3 +0,0 @@
|
||||
params["_markers"];
|
||||
|
||||
"armatak" callExtension ["ots_api:post_debug", [[markers]]];
|
||||
@@ -1,39 +0,0 @@
|
||||
// function name: armatak_fnc_extract_drone
|
||||
// function author: Valmo
|
||||
// function description: Gets the drone information for the HTTP request
|
||||
|
||||
params["_drone"];
|
||||
|
||||
private _location = (getPos _drone) call armatak_fnc_convert_location;
|
||||
private _atak_uid = _drone call armatak_fnc_extract_uuid;
|
||||
private _atak_latitude = _location select 0;
|
||||
private _atak_longitude = _location select 1;
|
||||
private _atak_speed = speed _drone;
|
||||
private _atak_bearing = parseNumber ((getDir _drone) toFixed 0);
|
||||
private _atak_role = "a-f-A";
|
||||
private _atak_callsign = getText(configFile >> "CfgVehicles" >> typeOf _drone >> "displayName");
|
||||
private _atak_server_instance = missionNamespace getVariable "_atak_server_instance";
|
||||
private _atak_server_instance_token = missionNamespace getVariable "_atak_server_instance_token";
|
||||
private _atak_altitude = _location select 2;
|
||||
|
||||
switch (side _drone) do {
|
||||
case "WEST": {
|
||||
_atak_role = "a-f-A-M-F-Q"
|
||||
};
|
||||
case "EAST": {
|
||||
_atak_role = "a-h-A-M-F-Q"
|
||||
};
|
||||
case "INDEPENDENT": {
|
||||
_atak_role = "a-n-A-M-F-Q"
|
||||
};
|
||||
case "CIVILIAN": {
|
||||
_atak_role = "a-f-A-C"
|
||||
};
|
||||
default {
|
||||
_atak_role = "a-f-A-M-F-Q"
|
||||
};
|
||||
};
|
||||
|
||||
_drone_info = [_atak_uid, _atak_latitude, _atak_longitude, _atak_speed, _atak_bearing, _atak_role, _atak_callsign, _atak_altitude, _atak_server_instance, _atak_server_instance_token];
|
||||
|
||||
_drone_info
|
||||
@@ -1,22 +0,0 @@
|
||||
// function name: armatak_fnc_extract_info
|
||||
// function author: Valmo
|
||||
// function description: Receives a player's unit as param and return the information array needed to send the HTTP request
|
||||
|
||||
params["_unit"];
|
||||
|
||||
private _location = (getPos _unit) call armatak_fnc_convert_location;
|
||||
|
||||
private _atak_uid = [_unit] call armatak_fnc_extract_uuid;
|
||||
private _atak_latitude = _location select 0;
|
||||
private _atak_longitude = _location select 1;
|
||||
private _atak_speed = speed _unit;
|
||||
private _atak_bearing = parseNumber ((getDir _unit) toFixed 0);
|
||||
private _atak_role = [_unit] call armatak_fnc_extract_role;
|
||||
private _atak_callsign = [_unit] call armatak_fnc_extract_callsign;
|
||||
private _atak_altitude = _location select 2;
|
||||
private _atak_server_instance = missionNamespace getVariable "_atak_server_instance";
|
||||
private _atak_server_instance_token = missionNamespace getVariable "_atak_server_instance_token";
|
||||
|
||||
_unit_info = [_atak_uid, _atak_latitude, _atak_longitude, _atak_speed, _atak_bearing, _atak_role, _atak_callsign, _atak_altitude, _atak_server_instance, _atak_server_instance_token];
|
||||
|
||||
_unit_info
|
||||
@@ -1,25 +0,0 @@
|
||||
// function name: armatak_fnc_extract_side
|
||||
// function author: Valmo
|
||||
// function description: Gets the unit side
|
||||
|
||||
params["_unit"];
|
||||
|
||||
_side = "friendly";
|
||||
switch (side _unit) do {
|
||||
case "WEST": {
|
||||
_side = "friendly";
|
||||
};
|
||||
case "EAST": {
|
||||
_side = "hostile";
|
||||
};
|
||||
case "INDEPENDENT": {
|
||||
_side = "neutral";
|
||||
};
|
||||
case "CIVILIAN": {
|
||||
_side = "unknown";
|
||||
};
|
||||
default {
|
||||
_side = "friendly";
|
||||
};
|
||||
};
|
||||
_side
|
||||
@@ -1,22 +0,0 @@
|
||||
// function name: armatak_fnc_extract_auth_token
|
||||
// function author: Valmo
|
||||
// function description: Gets the mission params and authenticate on OpenTAKServer API to be able to send HTTP requests
|
||||
|
||||
private _atak_server_instance = missionNamespace getVariable "_atak_server_instance";
|
||||
private _atak_server_instance_username = missionNamespace getVariable "_atak_server_instance_username";
|
||||
private _atak_server_instance_password = missionNamespace getVariable "_atak_server_instance_password";
|
||||
private _authentication = [_atak_server_instance, _atak_server_instance_username, _atak_server_instance_password];
|
||||
|
||||
_atak_server_instance_token = ("armatak" callExtension ["ots_api:get_auth_token", [_authentication]]) select 0;
|
||||
|
||||
if ((_atak_server_instance_token != "") and !(["ERROR", _atak_server_instance_token, false] call BIS_fnc_inString)) then {
|
||||
missionNamespace setVariable ["_atak_server_instance_token", _atak_server_instance_token];
|
||||
private _warning = format ["<t color='#2B7319'>ARMATAK</t><br/> %1", "Authorized"];
|
||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||
} else {
|
||||
missionNamespace setVariable ["_atak_server_instance_token", _atak_server_instance_token];
|
||||
private _warning = format ["<t color='#FF0000'>ARMATAK</t><br/> %1", "Failed to get Auth Token " + _atak_server_instance_token];
|
||||
[[_warning, 1]] call CBA_fnc_notify;
|
||||
};
|
||||
|
||||
_atak_server_instance_token
|
||||
Reference in New Issue
Block a user