mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Change ACE_HeadlessClientJoined event to be global and always triggered
This commit is contained in:
parent
971d8d1e02
commit
6edd7ab093
@ -4,13 +4,13 @@
|
|||||||
if (hasInterface && !isServer) exitWith {};
|
if (hasInterface && !isServer) exitWith {};
|
||||||
|
|
||||||
["SettingsInitialized", {
|
["SettingsInitialized", {
|
||||||
// Exit if HC transferring disabled
|
|
||||||
if (!GVAR(Enabled)) exitWith {};
|
|
||||||
|
|
||||||
if (isServer) then {
|
if (isServer) then {
|
||||||
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}];
|
// Add disconnect EH if HC transferring enabled
|
||||||
|
if (GVAR(Enabled)) then {
|
||||||
|
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}];
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
// Register HC on server (this part happens on HC only)
|
// Register HC (this part happens on HC only)
|
||||||
["ACE_HeadlessClientJoined", [player]] call EFUNC(common,serverEvent);
|
["ACE_HeadlessClientJoined", [player]] call EFUNC(common,globalEvent);
|
||||||
};
|
};
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -17,8 +17,13 @@
|
|||||||
|
|
||||||
params ["_headlessClient"];
|
params ["_headlessClient"];
|
||||||
|
|
||||||
// Exit if already registered
|
// Delay until settings are initialized (for checking if HC trasnferring is enabled)
|
||||||
if (_headlessClient in GVAR(headlessClients)) exitWith {};
|
if (!EGVAR(common,settingsInitFinished)) exitWith {
|
||||||
|
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(handleConnectHC), _this];
|
||||||
|
};
|
||||||
|
|
||||||
|
// Exit if HC transferring disabled or HC already registered
|
||||||
|
if (!GVAR(Enabled) || {_headlessClient in GVAR(headlessClients)}) exitWith {};
|
||||||
|
|
||||||
// Register for use
|
// Register for use
|
||||||
GVAR(headlessClients) pushBack _headlessClient;
|
GVAR(headlessClients) pushBack _headlessClient;
|
||||||
|
Loading…
Reference in New Issue
Block a user