diff --git a/addons/recorder/fnc_eh_disconnected.sqf b/addons/recorder/fnc_eh_disconnected.sqf index f8a60b7..4f9b60c 100644 --- a/addons/recorder/fnc_eh_disconnected.sqf +++ b/addons/recorder/fnc_eh_disconnected.sqf @@ -44,4 +44,14 @@ if (_unit getVariable [QGVARMAIN(isInitialized), false]) then { _unit setVariable [QGVARMAIN(exclude), true]; }; +// saveOnEmpty: if this was the last player, save immediately +if ( + EGVAR(settings,saveOnEmpty) && + !isNil QGVAR(startTime) && + {count ((call CBA_fnc_players) - [_unit]) == 0} && + {(GVAR(frameCaptureDelay) * GVAR(captureFrameNo)) / 60 >= GVAR(minMissionTime)} +) then { + [nil, "Recording ended due to server being empty"] call FUNC(exportData); +}; + false; diff --git a/addons/recorder/fnc_exportData.sqf b/addons/recorder/fnc_exportData.sqf index c0c43f4..5eb210e 100644 --- a/addons/recorder/fnc_exportData.sqf +++ b/addons/recorder/fnc_exportData.sqf @@ -128,7 +128,7 @@ private _endMessage = if (isNil "_message") then {if (_winSide == "") then {"Mis private _saveTag = if (!isNil "_tag") then {_tag} else {EGVAR(settings,saveTag)}; INFO_3("Saving recording — mission: %1 | frames: %2 | tag: %3",GVAR(missionName),_endFrameNumber,_saveTag); private _saveStart = diag_tickTime; -[":MISSION:SAVE:", [worldName, GVAR(missionName), getMissionConfigValue ["author", ""], GVAR(frameCaptureDelay), _endFrameNumber, _saveTag]] call EFUNC(extension,sendData); +[":MISSION:SAVE:", []] call EFUNC(extension,sendData); INFO_2("Recording saved — took %1 ms | mission: %2",round ((diag_tickTime - _saveStart) * 1000),GVAR(missionName)); OCAPEXTLOG(ARR4("Saved recording of mission",GVAR(missionName),"with tag",_saveTag)); diff --git a/addons/recorder/fnc_init.sqf b/addons/recorder/fnc_init.sqf index 2a76cfb..44457f8 100644 --- a/addons/recorder/fnc_init.sqf +++ b/addons/recorder/fnc_init.sqf @@ -225,16 +225,6 @@ call EFUNC(extension,initSession); } ] call CBA_fnc_waitUntilAndExecute; -// Auto-save on empty - checked every 30 seconds -// If a recording has been started, exceeds min mission time, and no players are on the server, auto-save -[{ - if ( - EGVAR(settings,saveOnEmpty) && - !isNil QGVAR(startTime) && (GVAR(frameCaptureDelay) * GVAR(captureFrameNo)) / 60 >= GVAR(minMissionTime) && count (call CBA_fnc_players) == 0 - ) then { - [nil, "Recording ended due to server being empty"] call FUNC(exportData); - }; -}, 30] call CBA_fnc_addPerFrameHandler; if (isNil QGVAR(entityMonitorsInitialized)) then { call FUNC(entityMonitors);