Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Restrict Markers #32

Open
wants to merge 1 commit into
base: feature/cba_rework
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions x/ocap/addons/recorder/fnc_handleMarkers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions x/ocap/addons/recorder/fnc_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down