From a4f0ab80ec068c8a7e5a4f85d12d0cf7f0b53bf1 Mon Sep 17 00:00:00 2001 From: vbawol Date: Fri, 2 Dec 2016 09:46:59 -0600 Subject: [PATCH] workaround for HandleDisconnect not working --- Sources/epoch_server/init/server_init.sqf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Sources/epoch_server/init/server_init.sqf b/Sources/epoch_server/init/server_init.sqf index e1185734..52c4348d 100644 --- a/Sources/epoch_server/init/server_init.sqf +++ b/Sources/epoch_server/init/server_init.sqf @@ -79,7 +79,18 @@ addMissionEventHandler ["PlayerConnected", { ["PlayerData", _uid, EPOCH_expiresPlayer, [_name]] call EPOCH_fnc_server_hiveSETEX; ['Connected', [_uid, _name]] call EPOCH_fnc_server_hiveLog; }]; -addMissionEventHandler ["HandleDisconnect", {_this call EPOCH_server_onPlayerDisconnect}]; + +onPlayerDisconnected { + params ["_id", "_uid", "_name"]; + _unit = objNull; + { + if ((_x getVariable["PUID", "0"]) == _uid) exitWith { + _unit = _x; + }; + } forEach allUnits; + [_unit,_id,_uid,_name] call EPOCH_server_onPlayerDisconnect +}; +// addMissionEventHandler ["HandleDisconnect", {_this call EPOCH_server_onPlayerDisconnect}]; diag_log "Epoch: Setup Side Settings"; //set side status