mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-14 08:23:29 +00:00
added initial module function to handle the addon init
This commit is contained in:
@@ -1,21 +1,29 @@
|
|||||||
if ((!isServer) && (player != player)) then {
|
params [
|
||||||
waitUntil {
|
["_logic", objNull, [objNull]],
|
||||||
player == player
|
["_units", [], [[]]],
|
||||||
};
|
["_activated", true, [true]]
|
||||||
};
|
];
|
||||||
|
|
||||||
if (isDedicated) exitWith {};
|
if (_activated) exitWith {
|
||||||
|
private _warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Connecting..."];
|
||||||
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
|
||||||
if (player != player) then {
|
_atak_fts_address = _logic getVariable "armatak_module_fts_api_instance_address";
|
||||||
waitUntil {
|
_atak_fts_protocol = _logic getVariable "armatak_module_fts_api_instance_protocol";
|
||||||
player == player
|
_atak_fts_port = _logic getVariable "armatak_module_fts_api_instance_port";
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
{
|
_atak_fts_fulladdress = _atak_fts_protocol + ":" + "/" + "/" + _atak_fts_address + ":" + (str _atak_fts_port);
|
||||||
[{if (_x getVariable "_atak_uid" == "") then {
|
_atak_fts_bearer_token = _logic getVariable "armatak_module_fts_api_instance_token";
|
||||||
[_x] call armatak_fnc_postGeoObject;
|
|
||||||
|
missionNamespace setVariable ["_atak_server_instance",_atak_fts_fulladdress];
|
||||||
|
missionNamespace setVariable ["_atak_server_instance_token",_atak_fts_bearer_token];
|
||||||
|
|
||||||
|
[{
|
||||||
|
_uid = _x getVariable "_atak_uid";
|
||||||
|
if (isNull _uid) then {
|
||||||
|
player call armatak_fnc_postGeoObject;
|
||||||
} else {
|
} else {
|
||||||
[_x] call armatak_fnc_putGeoObject;
|
player call armatak_fnc_putGeoObject;
|
||||||
}},0,[]] call CBA_fnc_addPerFrameHandler;
|
};
|
||||||
} forEach playableUnits;
|
},2,[]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user