2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2021-10-14 15:46:43 +00:00
|
|
|
/*
|
|
|
|
* Author: Jonpas
|
|
|
|
* Registers connected Headless Client for use.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Headless Client <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [headlessClient] call ace_headless_fnc_handleConnectHC
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_headlessClient"];
|
|
|
|
|
|
|
|
// Exit if HC already registered
|
|
|
|
// No need to check if distribution or end mission enabled, as if disabled this will never run
|
2024-04-04 11:01:12 +00:00
|
|
|
if (GVAR(headlessClients) pushBackUnique _headlessClient == -1) exitWith {};
|
2021-10-14 15:46:43 +00:00
|
|
|
|
|
|
|
if (XGVAR(log)) then {
|
|
|
|
INFO_1("Registered HC: %1",_headlessClient);
|
|
|
|
};
|
|
|
|
|
|
|
|
// Exit if AI distribution is disabled
|
2024-04-04 11:01:12 +00:00
|
|
|
if (!XGVAR(enabled)) exitWith {};
|
2021-10-14 15:46:43 +00:00
|
|
|
|
|
|
|
// Rebalance
|
|
|
|
[true] call FUNC(rebalance);
|