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

feature(replication): Adds initial support for multiple clusters joining the same server.

For that, the attachment process is restructured.
parent f4a48b57
No related branches found
No related tags found
2 merge requests!4New attachment process and multiple clusters,!3feature(replication): Adds initial support for multiple clusters joining the same server.
This commit is part of merge request !3. Comments created here will be created in the context of that merge request.
File deleted
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
{ {
"bFollowLocalPlayerCamera": false, "bFollowLocalPlayerCamera": false,
"bExitOnEsc": true, "bExitOnEsc": true,
"bOverrideViewportsFromExternalConfig": true "bOverrideViewportsFromExternalConfig": true,
"bOverrideTransformsFromExternalConfig": false
}, },
"scene": "scene":
{ {
......
No preview for this file type
// Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
#include "CaveSetup.h" #include "CaveSetupComponent.h"
#include "LiveLinkPreset.h"
#include "Logging/StructuredLog.h" #include "Logging/StructuredLog.h"
#include "Utility/RWTHVRClusterUtilities.h" #include "Utility/RWTHVRClusterUtilities.h"
// Sets default values UCaveSetupComponent::UCaveSetupComponent()
ACaveSetup::ACaveSetup()
{ {
PrimaryActorTick.bCanEverTick = false; PrimaryComponentTick.bCanEverTick = false;
SetActorEnableCollision(false); SetIsReplicatedByDefault(false);
// Actor needs to replicate, as it is attached to the pawn on the server.
bReplicates = true;
} }
// Called when the game starts or when spawned void UCaveSetupComponent::BeginPlay()
void ACaveSetup::BeginPlay()
{ {
Super::BeginPlay(); Super::BeginPlay();
if (!URWTHVRClusterUtilities::IsRoomMountedMode()) if (!URWTHVRClusterUtilities::IsRoomMountedMode())
{ {
UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Not in RoomMountedMode, doing nothing."); UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Not in RoomMountedMode, doing nothing.");
...@@ -33,7 +29,7 @@ void ACaveSetup::BeginPlay() ...@@ -33,7 +29,7 @@ void ACaveSetup::BeginPlay()
if (const auto World = GetWorld()) if (const auto World = GetWorld())
{ {
const auto Actor = World->SpawnActor(ActorClass); const auto Actor = World->SpawnActor(ActorClass);
Actor->AttachToActor(this, FAttachmentTransformRules::SnapToTargetNotIncludingScale); Actor->AttachToActor(GetOwner(), FAttachmentTransformRules::SnapToTargetNotIncludingScale);
UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Spawned Actor {Actor} on the Cave and attached it.", UE_LOGFMT(RWTHVRCluster, Display, "CaveSetup: Spawned Actor {Actor} on the Cave and attached it.",
Actor->GetName()); Actor->GetName());
} }
......
...@@ -3,23 +3,20 @@ ...@@ -3,23 +3,20 @@
#pragma once #pragma once
#include "CoreMinimal.h" #include "CoreMinimal.h"
#include "LiveLinkPreset.h"
#include "GameFramework/Actor.h" #include "CaveSetupComponent.generated.h"
#include "CaveSetup.generated.h"
class ULiveLinkPreset;
/**
* Simple Actor that needs to be added to the level which spawns Cave-related actors UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent),
* such as the CaveOverlay. hideCategories = (Rendering, Input, Actor, Base, Collision, Shape, Physics, HLOD))
* It attaches itself to the Primary Node's Pawn and then replicates on the server. class RWTHVRCLUSTER_API UCaveSetupComponent : public UActorComponent
*/
UCLASS(hideCategories = (Rendering, Input, Actor, Base, Collision, Shape, Physics, HLOD))
class RWTHVRCLUSTER_API ACaveSetup : public AActor
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
ACaveSetup(); // Sets default values for this component's properties
UCaveSetupComponent();
UPROPERTY(EditAnywhere) UPROPERTY(EditAnywhere)
TArray<UClass*> ActorsToSpawnOnCave; TArray<UClass*> ActorsToSpawnOnCave;
...@@ -28,6 +25,6 @@ public: ...@@ -28,6 +25,6 @@ public:
ULiveLinkPreset* LiveLinkPresetToApplyOnCave; ULiveLinkPreset* LiveLinkPresetToApplyOnCave;
protected: protected:
// Called when the game starts or when spawned // Called when the game starts
virtual void BeginPlay() override; virtual void BeginPlay() override;
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment