Skip to content
Snippets Groups Projects
Commit 992d2776 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

style(replication): updates formatting to make clang format happy

parent 23c33f1b
Branches
Tags
2 merge requests!107UE5.4-2024.1-rc1,!98Improved join/attachment logic for clusters to support multi-cluster connections at some point
Pipeline #440273 failed
...@@ -267,14 +267,16 @@ void ARWTHVRPawn::AttachClustertoPawn() ...@@ -267,14 +267,16 @@ void ARWTHVRPawn::AttachClustertoPawn()
if (const ARWTHVRPlayerState* State = GetPlayerState<ARWTHVRPlayerState>()) if (const ARWTHVRPlayerState* State = GetPlayerState<ARWTHVRPlayerState>())
{ {
if (!State->GetCorrespondingClusterActor()) if (!State->GetCorrespondingClusterActor())
UE_LOGFMT(Toolkit, Error, UE_LOGFMT(
Toolkit, Error,
"ARWTHVRPawn::AttachClustertoPawn: GetCorrespondingClusterActor returned null! This won't work on " "ARWTHVRPawn::AttachClustertoPawn: GetCorrespondingClusterActor returned null! This won't work on "
"the Cave."); "the Cave.");
const FAttachmentTransformRules AttachmentRules = FAttachmentTransformRules::SnapToTargetNotIncludingScale; const FAttachmentTransformRules AttachmentRules = FAttachmentTransformRules::SnapToTargetNotIncludingScale;
bool bAttached = State->GetCorrespondingClusterActor()->AttachToComponent(GetRootComponent(), AttachmentRules); bool bAttached = State->GetCorrespondingClusterActor()->AttachToComponent(GetRootComponent(), AttachmentRules);
// State->GetCorrespondingClusterActor()->OnAttached(); // State->GetCorrespondingClusterActor()->OnAttached();
UE_LOGFMT(Toolkit, Display, "ARWTHVRPawn: Attaching corresponding cluster actor to our pawn returned: {Attached}", bAttached); UE_LOGFMT(Toolkit, Display,
"ARWTHVRPawn: Attaching corresponding cluster actor to our pawn returned: {Attached}", bAttached);
} }
else else
{ {
......
...@@ -17,7 +17,6 @@ class RWTHVRTOOLKIT_API ARWTHVRGameModeBase : public AGameModeBase ...@@ -17,7 +17,6 @@ class RWTHVRTOOLKIT_API ARWTHVRGameModeBase : public AGameModeBase
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
ARWTHVRGameModeBase(const FObjectInitializer& ObjectInitializer); ARWTHVRGameModeBase(const FObjectInitializer& ObjectInitializer);
protected: protected:
...@@ -35,7 +34,6 @@ protected: ...@@ -35,7 +34,6 @@ protected:
virtual void PostLogin(APlayerController* NewPlayer) override; virtual void PostLogin(APlayerController* NewPlayer) override;
private: private:
UPROPERTY() UPROPERTY()
TMap<int32, AClusterRepresentationActor*> ConnectedClusters; TMap<int32, AClusterRepresentationActor*> ConnectedClusters;
}; };
...@@ -28,20 +28,19 @@ private: ...@@ -28,20 +28,19 @@ private:
EPlayerType PlayerType = EPlayerType::Desktop; EPlayerType PlayerType = EPlayerType::Desktop;
/** Replicated cluster ID for this player. Is -1 in case player is not a cluster*/ /** 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; int32 CorrespondingClusterId = -1;
/** Replicated cluster actor for this player. Is nullptr in case player is not a cluster. /** 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) UPROPERTY(ReplicatedUsing = OnRep_CorrespondingClusterActor)
TObjectPtr<AClusterRepresentationActor> CorrespondingClusterActor; TObjectPtr<AClusterRepresentationActor> CorrespondingClusterActor;
UFUNCTION() UFUNCTION()
virtual void OnRep_CorrespondingClusterActor() virtual void OnRep_CorrespondingClusterActor() { CorrespondingClusterActor->AttachDCRAIfRequired(this); }
{
CorrespondingClusterActor->AttachDCRAIfRequired(this);
}
UFUNCTION(Reliable, Server) UFUNCTION(Reliable, Server)
void ServerSetPlayerTypeRpc(EPlayerType NewPlayerType); void ServerSetPlayerTypeRpc(EPlayerType NewPlayerType);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment