Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions addons/recorder/fnc_eh_disconnected.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion addons/recorder/fnc_exportData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
10 changes: 0 additions & 10 deletions addons/recorder/fnc_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading