From 1a7f574e2644615e2f0e5c8c5e6bd851676d078b Mon Sep 17 00:00:00 2001
From: David Gilbert <gilbert@vr.rwth-aachen.de>
Date: Wed, 8 Nov 2023 13:21:29 +0100
Subject: [PATCH] chore(all): renames master -> primaryNode, slave ->
 secondaryNode

---
 .../Private/CAVEOverlay/CAVEOverlayController.cpp      |  2 +-
 Source/RWTHVRCluster/Private/CaveSetup.cpp             |  4 ++--
 .../RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp  |  6 +++---
 .../Private/Utility/VirtualRealityUtilities.cpp        | 10 +++++-----
 .../Public/Utility/VirtualRealityUtilities.h           |  4 ++--
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp
index dec8239c..ec52a1f9 100644
--- a/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp
+++ b/Source/RWTHVRCluster/Private/CAVEOverlay/CAVEOverlayController.cpp
@@ -156,7 +156,7 @@ void ACAVEOverlayController::BeginPlay()
 		return;
 
 	//Input config
-	if (UVirtualRealityUtilities::IsMaster())
+	if (UVirtualRealityUtilities::IsPrimaryNode())
 	{
 		if (CycleDoorTypeInputAction == nullptr || IMCCaveOverlayInputMapping == nullptr)
 		{
diff --git a/Source/RWTHVRCluster/Private/CaveSetup.cpp b/Source/RWTHVRCluster/Private/CaveSetup.cpp
index 8691ab84..debb2b14 100644
--- a/Source/RWTHVRCluster/Private/CaveSetup.cpp
+++ b/Source/RWTHVRCluster/Private/CaveSetup.cpp
@@ -39,9 +39,9 @@ void ACaveSetup::BeginPlay()
 		}
 	}
 
-	// Apply the DTrack LiveLink Preset. Only do this if we are the master
+	// Apply the DTrack LiveLink Preset. Only do this if we are the primaryNode
 
-	if (UVirtualRealityUtilities::IsMaster())
+	if (UVirtualRealityUtilities::IsPrimaryNode())
 	{
 		if (LiveLinkPresetToApplyOnCave && LiveLinkPresetToApplyOnCave->IsValidLowLevelFast())
 		{
diff --git a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp
index 4b9f8add..cee75e1e 100644
--- a/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp
+++ b/Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp
@@ -67,9 +67,9 @@ void AVirtualRealityPawn::NotifyControllerChanged()
 	// Only do this for all local controlled pawns
 	if (IsLocallyControlled())
 	{
-		// Only do this for the master or when we're running in standalone
-		if (UVirtualRealityUtilities::IsRoomMountedMode() && (UVirtualRealityUtilities::IsMaster() || GetNetMode()) ==
-			NM_Standalone)
+		// Only do this for the primary node or when we're running in standalone
+		if (UVirtualRealityUtilities::IsRoomMountedMode() && (UVirtualRealityUtilities::IsPrimaryNode() || GetNetMode())
+			== NM_Standalone)
 		{
 			if (HasAuthority())
 				AttachDCRAtoPawn();
diff --git a/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp b/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp
index 5653faff..c13df15f 100644
--- a/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp
+++ b/Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp
@@ -81,8 +81,8 @@ bool UVirtualRealityUtilities::IsRolv()
 #endif
 }
 
-/* Return true on the Master in cluster mode and in a normal desktop session. Otherwise false */
-bool UVirtualRealityUtilities::IsMaster()
+/* Return true on the Primary in cluster mode and in a normal desktop session. Otherwise false */
+bool UVirtualRealityUtilities::IsPrimaryNode()
 {
 #if PLATFORM_SUPPORTS_NDISPLAY
 	if (!IDisplayCluster::IsAvailable())
@@ -92,7 +92,7 @@ bool UVirtualRealityUtilities::IsMaster()
 	IDisplayClusterClusterManager* Manager = IDisplayCluster::Get().GetClusterMgr();
 	if (Manager == nullptr)
 	{
-		return true; // if we are not in cluster mode, we are always the master
+		return true; // if we are not in cluster mode, we are always the primary node
 	}
 	return Manager->IsPrimary() || !Manager->IsSecondary();
 #else
@@ -100,9 +100,9 @@ bool UVirtualRealityUtilities::IsMaster()
 #endif
 }
 
-bool UVirtualRealityUtilities::IsSlave()
+bool UVirtualRealityUtilities::IsSecondaryNode()
 {
-	return !IsMaster();
+	return !IsPrimaryNode();
 }
 
 FString UVirtualRealityUtilities::GetNodeName()
diff --git a/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h b/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h
index d5ff0913..f2dbdcb1 100644
--- a/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h
+++ b/Source/RWTHVRToolkit/Public/Utility/VirtualRealityUtilities.h
@@ -63,9 +63,9 @@ public:
 	static bool IsRolv();
 
 	UFUNCTION(BlueprintPure, Category = "DisplayCluster")
-	static bool IsMaster();
+	static bool IsPrimaryNode();
 	UFUNCTION(BlueprintPure, Category = "DisplayCluster")
-	static bool IsSlave();
+	static bool IsSecondaryNode();
 
 	UFUNCTION(BlueprintPure, Category = "DisplayCluster")
 	static FString GetNodeName();
-- 
GitLab