From 9cb3a60330dc358eb54a0d95bf6772e047149c8c Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:44:44 +0100 Subject: [PATCH] Compatibility with Restrict Markers --- x/ocap/addons/recorder/fnc_handleMarkers.sqf | 9 +++++++++ x/ocap/addons/recorder/fnc_init.sqf | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/x/ocap/addons/recorder/fnc_handleMarkers.sqf b/x/ocap/addons/recorder/fnc_handleMarkers.sqf index 3a9ab33..676eaef 100644 --- a/x/ocap/addons/recorder/fnc_handleMarkers.sqf +++ b/x/ocap/addons/recorder/fnc_handleMarkers.sqf @@ -175,6 +175,9 @@ EGVAR(listener,markers) = [QGVARMAIN(handleMarker), { if (!_local) exitWith {}; + // If the Restrict Markers mod is loaded and enabled, only the server's markers should be recorded + if (GVAR(restrictMarkersCompat) && {!isServer}) exitWith {}; + // check for excluded values in marker name. if name contains at least one value, skip sending traffic to server // if value is undefined, then skip private _isExcluded = false; @@ -225,6 +228,9 @@ EGVAR(listener,markers) = [QGVARMAIN(handleMarker), { if (!_local) exitWith {}; + // If the Restrict Markers mod is loaded and enabled, only the server's markers should be recorded + if (GVAR(restrictMarkersCompat) && {!isServer}) exitWith {}; + // check for excluded values in marker name. if name contains at least one value, skip sending traffic to server // if value is undefined, then skip private _isExcluded = false; @@ -257,6 +263,9 @@ EGVAR(listener,markers) = [QGVARMAIN(handleMarker), { if (!_local) exitWith {}; + // If the Restrict Markers mod is loaded and enabled, only the server's markers should be recorded + if (GVAR(restrictMarkersCompat) && {!isServer}) exitWith {}; + // check for excluded values in marker name. if name contains at least one value, skip sending traffic to server // if value is undefined, then skip private _isExcluded = false; diff --git a/x/ocap/addons/recorder/fnc_init.sqf b/x/ocap/addons/recorder/fnc_init.sqf index de36520..382d278 100644 --- a/x/ocap/addons/recorder/fnc_init.sqf +++ b/x/ocap/addons/recorder/fnc_init.sqf @@ -95,6 +95,13 @@ publicVariable QGVARMAIN(version); EGVAR(extension,version) = ([":VERSION:", []] call EFUNC(extension,sendData)); publicVariable QEGVAR(extension,version); +/* + VARIABLE: OCAP_recorder_restrictMarkersCompat + Global variable flag to prevent a client's local markers from being recorded on the server, in the case of the mod Restrict Markers being loaded and enabled. Otherwise, marker recording would create lots of duplicates that hurt playback performance. +*/ +EGVAR(recorder,restrictMarkersCompat) = isClass (configFile >> "CfgPatches" >> "restrict_markers") && {!isNil "restrict_markers_main_enabled" && {restrict_markers_main_enabled}}; +publicVariable QEGVAR(recorder,restrictMarkersCompat); + // Add mission event handlers call FUNC(addEventMission);