RemoteSubsystem update
This commit is contained in:
@ -14,6 +14,8 @@ public:
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="DTFlux|Remote")
|
||||
FDateTime UpdateAt = FDateTime::Now();
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="DTFlux|Remote")
|
||||
int RundownPageId = -1;
|
||||
FDTFluxRemoteBasicData() = default;
|
||||
FDTFluxRemoteBasicData(const FDateTime& InUpdateAt): UpdateAt(InUpdateAt){};
|
||||
};
|
||||
@ -38,6 +40,7 @@ public:
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="DTFlux|Remote")
|
||||
FString Function2 = "";
|
||||
|
||||
|
||||
FDTFluxRemoteTitleData() = default;
|
||||
FDTFluxRemoteTitleData(const FString InFirstName, const FString InLastName, const FString InFunction1, const FString InFunction2):
|
||||
FirstName(InFirstName), LastName(InLastName), Function1(InFunction1), Function2(InFunction2){};
|
||||
@ -64,12 +67,10 @@ public:
|
||||
FDTFluxRemoteCommandData() = default;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="DTFlux|Remote")
|
||||
int Type = -1;
|
||||
FString Type = "Stop";
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="DTFlux|Remote")
|
||||
FString Data = "";
|
||||
|
||||
FDTFluxRemoteCommandData(int InType, FString InData):
|
||||
Type(InType), Data(InData){};
|
||||
FDTFluxRemoteCommandData(FString InType):
|
||||
Type(InType){};
|
||||
};
|
||||
|
||||
|
||||
@ -22,7 +22,6 @@ class DTFLUXREMOTE_API UDTFluxRemoteSubsystem : public UEngineSubsystem
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
public:
|
||||
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
|
||||
virtual void Deinitialize() override;
|
||||
|
||||
@ -57,6 +56,25 @@ public:
|
||||
UFUNCTION(BlueprintCallable, Category = "DTFlux API")
|
||||
bool ProcessCommandData(const FString& JsonString);
|
||||
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "DTFlux API")
|
||||
bool bHasPendingTitleRequest = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "DTFlux API")
|
||||
bool bHasPendingTitleBibRequest = false;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "DTFlux API")
|
||||
FDTFluxRemoteTitleData PendingTitleData;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "DTFlux API")
|
||||
FDTFluxRemoteBibData PendingTitleBibData;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "DTFlux API")
|
||||
void ResetPendingTitleData();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "DTFlux API")
|
||||
void ResetPendingBibData();
|
||||
|
||||
private:
|
||||
void SetupRoutes();
|
||||
|
||||
@ -84,6 +102,7 @@ private:
|
||||
|
||||
void UnloadCurrentRundown();
|
||||
void LoadRundownFromSettings();
|
||||
bool LoadRundown(const TSoftObjectPtr<UAvaRundown>& RundownAsset);
|
||||
|
||||
#if WITH_EDITOR
|
||||
FDelegateHandle SettingsRundownChangedHandle;
|
||||
|
||||
94
Source/DTFluxRemote/Public/DTFluxRemotedLevelController.h
Normal file
94
Source/DTFluxRemote/Public/DTFluxRemotedLevelController.h
Normal file
@ -0,0 +1,94 @@
|
||||
// DTFluxRemotedLevelController.h
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "DTFluxRemoteSubsystem.h"
|
||||
#include "DTFluxRemotedLevelController.generated.h"
|
||||
|
||||
UCLASS(BlueprintType, Blueprintable)
|
||||
class DTFLUXREMOTE_API ADTFluxRemotedLevelController : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
ADTFluxRemotedLevelController();
|
||||
|
||||
protected:
|
||||
virtual void PostInitializeComponents() override;
|
||||
virtual void BeginPlay() override;
|
||||
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
||||
|
||||
// Subsystem et binding
|
||||
UPROPERTY(BlueprintReadOnly, Category = "DTFlux")
|
||||
UDTFluxRemoteSubsystem* RemoteSubsystem;
|
||||
|
||||
FDelegateHandle TitleReceivedHandle;
|
||||
FDelegateHandle TitleBibReceivedHandle;
|
||||
FDelegateHandle CommandReceivedHandle;
|
||||
bool bEventsBound;
|
||||
|
||||
// Fonctions de binding
|
||||
void InitializeSubsystemBinding();
|
||||
|
||||
// ✅ CORRECTION : Callbacks avec UFUNCTION()
|
||||
UFUNCTION()
|
||||
void OnTitleDataReceived(const FDTFluxRemoteTitleData& TitleData);
|
||||
|
||||
UFUNCTION()
|
||||
void OnTitleBibDataReceived(const FDTFluxRemoteBibData& BibData);
|
||||
|
||||
UFUNCTION()
|
||||
void OnCommandDataReceived(const FDTFluxRemoteCommandData& CommandData);
|
||||
|
||||
public:
|
||||
// Events Blueprint-friendly
|
||||
UPROPERTY(BlueprintAssignable, Category = "DTFlux Events")
|
||||
FOnTitleReceived OnTitleReceived;
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "DTFlux Events")
|
||||
FOnTitleBibReceived OnTitleBibReceived;
|
||||
|
||||
UPROPERTY(BlueprintAssignable, Category = "DTFlux Events")
|
||||
FOnCommandReceived OnCommandReceived;
|
||||
|
||||
// Fonctions utilitaires
|
||||
UFUNCTION(BlueprintCallable, Category = "DTFlux")
|
||||
bool IsSubsystemAvailable() const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "DTFlux")
|
||||
bool IsHTTPServerRunning() const;
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "DTFlux")
|
||||
void StartHTTPServer(int32 Port = 63350);
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "DTFlux")
|
||||
void StopHTTPServer();
|
||||
|
||||
UFUNCTION(BlueprintCallable, Category = "DTFlux")
|
||||
void EnsureSubsystemBinding();
|
||||
|
||||
protected:
|
||||
// Events Blueprint implémentables
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "DTFlux Events")
|
||||
void BP_OnTitleDataReceived(const FDTFluxRemoteTitleData& TitleData);
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "DTFlux Events")
|
||||
void BP_OnTitleBibDataReceived(const FDTFluxRemoteBibData& BibData);
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent, Category = "DTFlux Events")
|
||||
void BP_OnCommandDataReceived(const FDTFluxRemoteCommandData& CommandData);
|
||||
|
||||
// Fonctions virtuelles C++
|
||||
UFUNCTION(BlueprintNativeEvent, Category = "DTFlux Events")
|
||||
void HandleTitleData(const FDTFluxRemoteTitleData& TitleData);
|
||||
virtual void HandleTitleData_Implementation(const FDTFluxRemoteTitleData& TitleData);
|
||||
|
||||
UFUNCTION(BlueprintNativeEvent, Category = "DTFlux Events")
|
||||
void HandleTitleBibData(const FDTFluxRemoteBibData& BibData);
|
||||
virtual void HandleTitleBibData_Implementation(const FDTFluxRemoteBibData& BibData);
|
||||
|
||||
UFUNCTION(BlueprintNativeEvent, Category = "DTFlux Events")
|
||||
void HandleCommandData(const FDTFluxRemoteCommandData& CommandData);
|
||||
virtual void HandleCommandData_Implementation(const FDTFluxRemoteCommandData& CommandData);
|
||||
};
|
||||
Reference in New Issue
Block a user