From 992d27761dd4700066f7b5aa2cb2898b884bd6b9 Mon Sep 17 00:00:00 2001
From: David Gilbert <gilbert@vr.rwth-aachen.de>
Date: Tue, 6 Aug 2024 14:32:25 +0200
Subject: [PATCH] style(replication): updates formatting to make clang format
 happy

---
 .../Private/Core/RWTHVRGameModeBase.cpp           |  8 ++++----
 .../Private/Pawn/ClusterRepresentationActor.cpp   |  2 +-
 Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp  | 12 +++++++-----
 .../Public/Core/RWTHVRGameModeBase.h              |  2 --
 .../RWTHVRToolkit/Public/Core/RWTHVRPlayerState.h | 15 +++++++--------
 5 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp b/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp
index 172f00f8..c9efeaf3 100644
--- a/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp
+++ b/Source/RWTHVRToolkit/Private/Core/RWTHVRGameModeBase.cpp
@@ -28,7 +28,7 @@ FString ARWTHVRGameModeBase::InitNewPlayer(APlayerController* NewPlayerControlle
 	// Check if we're using our custom PlayerState so that we can save the player type there.
 	// If not, just ingore all related args.
 	ARWTHVRPlayerState* State = Cast<ARWTHVRPlayerState>(NewPlayerController->PlayerState);
-	
+
 	if (State != nullptr)
 	{
 		int32 ClusterId = -1;
@@ -63,7 +63,7 @@ FString ARWTHVRGameModeBase::InitNewPlayer(APlayerController* NewPlayerControlle
 void ARWTHVRGameModeBase::PostLogin(APlayerController* NewPlayer)
 {
 	if (ARWTHVRPlayerState* State = Cast<ARWTHVRPlayerState>(NewPlayer->PlayerState); State != nullptr)
-	{		
+	{
 		// If we're in none-standalone netmode, this is only executed on the server, as the GM only exists there.
 		// On standalone, this is executed on every node.
 		int32 ClusterId = State->GetCorrespondingClusterId();
@@ -93,7 +93,7 @@ void ARWTHVRGameModeBase::PostLogin(APlayerController* NewPlayer)
 
 			// Double check for sanity
 			check(ClusterRepresentation != nullptr);
-			
+
 			State->SetCorrespondingClusterActor(ClusterRepresentation);
 
 			if (State->GetPlayerType() == EPlayerType::nDisplayPrimary)
@@ -102,7 +102,7 @@ void ARWTHVRGameModeBase::PostLogin(APlayerController* NewPlayer)
 				ClusterRepresentation->SetOwner(NewPlayer);
 			}
 		}
-		
+
 		// Do we already have an auto-possessing pawn possessed?
 		if (NewPlayer->GetPawn() && NewPlayer->GetPawn()->IsValidLowLevelFast())
 		{
diff --git a/Source/RWTHVRToolkit/Private/Pawn/ClusterRepresentationActor.cpp b/Source/RWTHVRToolkit/Private/Pawn/ClusterRepresentationActor.cpp
index 57c16ee8..d6b2f4f0 100644
--- a/Source/RWTHVRToolkit/Private/Pawn/ClusterRepresentationActor.cpp
+++ b/Source/RWTHVRToolkit/Private/Pawn/ClusterRepresentationActor.cpp
@@ -50,7 +50,7 @@ void AClusterRepresentationActor::AttachDCRAIfRequired(const ARWTHVRPlayerState*
 				  "AClusterRepresentationActor::AttachDCRAIfRequired: Already attached, skipping repeated attachment.");
 		return;
 	}
-	
+
 	UE_LOGFMT(Toolkit, Display, "AClusterRepresentationActor::AttachDCRAIfRequired: Starting DCRA Attachment process.");
 
 	// This should give us the first local player controller
diff --git a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp
index 0d11d17c..5c27dac2 100644
--- a/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp
+++ b/Source/RWTHVRToolkit/Private/Pawn/RWTHVRPawn.cpp
@@ -267,14 +267,16 @@ void ARWTHVRPawn::AttachClustertoPawn()
 	if (const ARWTHVRPlayerState* State = GetPlayerState<ARWTHVRPlayerState>())
 	{
 		if (!State->GetCorrespondingClusterActor())
-			UE_LOGFMT(Toolkit, Error,
-					  "ARWTHVRPawn::AttachClustertoPawn: GetCorrespondingClusterActor returned null! This won't work on "
-					  "the Cave.");
+			UE_LOGFMT(
+				Toolkit, Error,
+				"ARWTHVRPawn::AttachClustertoPawn: GetCorrespondingClusterActor returned null! This won't work on "
+				"the Cave.");
 
 		const FAttachmentTransformRules AttachmentRules = FAttachmentTransformRules::SnapToTargetNotIncludingScale;
 		bool bAttached = State->GetCorrespondingClusterActor()->AttachToComponent(GetRootComponent(), AttachmentRules);
-		//State->GetCorrespondingClusterActor()->OnAttached();
-		UE_LOGFMT(Toolkit, Display, "ARWTHVRPawn: Attaching corresponding cluster actor to our pawn returned: {Attached}", bAttached);
+		// State->GetCorrespondingClusterActor()->OnAttached();
+		UE_LOGFMT(Toolkit, Display,
+				  "ARWTHVRPawn: Attaching corresponding cluster actor to our pawn returned: {Attached}", bAttached);
 	}
 	else
 	{
diff --git a/Source/RWTHVRToolkit/Public/Core/RWTHVRGameModeBase.h b/Source/RWTHVRToolkit/Public/Core/RWTHVRGameModeBase.h
index a4342f01..be8e65d9 100644
--- a/Source/RWTHVRToolkit/Public/Core/RWTHVRGameModeBase.h
+++ b/Source/RWTHVRToolkit/Public/Core/RWTHVRGameModeBase.h
@@ -17,7 +17,6 @@ class RWTHVRTOOLKIT_API ARWTHVRGameModeBase : public AGameModeBase
 {
 	GENERATED_BODY()
 public:
-	
 	ARWTHVRGameModeBase(const FObjectInitializer& ObjectInitializer);
 
 protected:
@@ -35,7 +34,6 @@ protected:
 	virtual void PostLogin(APlayerController* NewPlayer) override;
 
 private:
-
 	UPROPERTY()
 	TMap<int32, AClusterRepresentationActor*> ConnectedClusters;
 };
diff --git a/Source/RWTHVRToolkit/Public/Core/RWTHVRPlayerState.h b/Source/RWTHVRToolkit/Public/Core/RWTHVRPlayerState.h
index f5fcb06d..5c353027 100644
--- a/Source/RWTHVRToolkit/Public/Core/RWTHVRPlayerState.h
+++ b/Source/RWTHVRToolkit/Public/Core/RWTHVRPlayerState.h
@@ -28,21 +28,20 @@ private:
 	EPlayerType PlayerType = EPlayerType::Desktop;
 
 	/** Replicated cluster ID for this player. Is -1 in case player is not a cluster*/
-	UPROPERTY(Replicated, Category = PlayerState, BlueprintGetter = GetCorrespondingClusterId, meta = (AllowPrivateAccess))
+	UPROPERTY(Replicated, Category = PlayerState, BlueprintGetter = GetCorrespondingClusterId,
+			  meta = (AllowPrivateAccess))
 	int32 CorrespondingClusterId = -1;
 
 	/** Replicated cluster actor for this player. Is nullptr in case player is not a cluster.
-	 * As this is not guaranteed to be valid on BeginPlay, we need to do a callback to the CorrespondingClusterActor here...
+	 * As this is not guaranteed to be valid on BeginPlay, we need to do a callback to the CorrespondingClusterActor
+	 * here...
 	 */
 	UPROPERTY(ReplicatedUsing = OnRep_CorrespondingClusterActor)
 	TObjectPtr<AClusterRepresentationActor> CorrespondingClusterActor;
 
 	UFUNCTION()
-	virtual void OnRep_CorrespondingClusterActor()
-	{
-		CorrespondingClusterActor->AttachDCRAIfRequired(this);
-	}
-	
+	virtual void OnRep_CorrespondingClusterActor() { CorrespondingClusterActor->AttachDCRAIfRequired(this); }
+
 	UFUNCTION(Reliable, Server)
 	void ServerSetPlayerTypeRpc(EPlayerType NewPlayerType);
 
@@ -57,7 +56,7 @@ public:
 
 	UFUNCTION(BlueprintGetter)
 	AClusterRepresentationActor* GetCorrespondingClusterActor() const { return CorrespondingClusterActor; }
-	
+
 	void SetCorrespondingClusterId(int32 NewCorrespondingClusterId);
 	void SetCorrespondingClusterActor(AClusterRepresentationActor* NewCorrespondingClusterActor);
 
-- 
GitLab