#include "EditorStreamAutoStart.h"
#include "PortaSettings.h"

#if WITH_EDITOR
#include "IPixelStreamingEditorModule.h"
using namespace UE::EditorPixelStreaming;
#endif

void UEditorStreamAutoStart::Initialize(FSubsystemCollectionBase& Collection)
{
#if WITH_EDITOR
	if (GIsEditor)
	{
		auto Config = GetMutableDefault<UPortaSettings>();
		if (Config->ShouldStartPixelStream())
		{
			IPixelStreamingEditorModule::Get().UseExternalSignallingServer(true);
			IPixelStreamingEditorModule::Get().StartStreaming(EStreamTypes::LevelEditorViewport);
		}
	}

#endif

}

void UEditorStreamAutoStart::Deinitialize()
{

}
