|
|
|
|
| #pragma once
|
|
|
| #include "NetworkReplayStreaming.h"
|
| #include "Subsystems/GameInstanceSubsystem.h"
|
| #include "GameplayTagContainer.h"
|
|
|
| #include "LyraReplaySubsystem.generated.h"
|
|
|
| #define UE_API LYRAGAME_API
|
|
|
| class UDemoNetDriver;
|
| class APlayerController;
|
| class ULocalPlayer;
|
| struct FFrame;
|
|
|
|
|
| UCLASS(MinimalAPI, BlueprintType)
|
| class ULyraReplayListEntry : public UObject
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| FNetworkReplayStreamInfo StreamInfo;
|
|
|
|
|
| UFUNCTION(BlueprintPure, Category=Replays)
|
| FString GetFriendlyName() const { return StreamInfo.FriendlyName; }
|
|
|
|
|
| UFUNCTION(BlueprintPure, Category=Replays)
|
| FDateTime GetTimestamp() const { return StreamInfo.Timestamp; }
|
|
|
|
|
| UFUNCTION(BlueprintPure, Category=Replays)
|
| FTimespan GetDuration() const { return FTimespan::FromMilliseconds(StreamInfo.LengthInMS); }
|
|
|
|
|
| UFUNCTION(BlueprintPure, Category=Replays)
|
| int32 GetNumViewers() const { return StreamInfo.NumViewers; }
|
|
|
|
|
| UFUNCTION(BlueprintPure, Category=Replays)
|
| bool GetIsLive() const { return StreamInfo.bIsLive; }
|
| };
|
|
|
|
|
| UCLASS(MinimalAPI, BlueprintType)
|
| class ULyraReplayList : public UObject
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| UPROPERTY(BlueprintReadWrite, Category=Replays)
|
| TArray<TObjectPtr<ULyraReplayListEntry>> Results;
|
| };
|
|
|
|
|
| UCLASS(MinimalAPI)
|
| class ULyraReplaySubsystem : public UGameInstanceSubsystem
|
| {
|
| GENERATED_BODY()
|
|
|
| public:
|
| UE_API ULyraReplaySubsystem();
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = Replays, BlueprintPure = false)
|
| static UE_API bool DoesPlatformSupportReplays();
|
|
|
|
|
| static UE_API FGameplayTag GetPlatformSupportTraitTag();
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category=Replays)
|
| UE_API void PlayReplay(ULyraReplayListEntry* Replay);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = Replays)
|
| UE_API void RecordClientReplay(APlayerController* PlayerController);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = Replays)
|
| UE_API void CleanupLocalReplays(ULocalPlayer* LocalPlayer, int32 NumReplaysToKeep);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category=Replays)
|
| UE_API void SeekInActiveReplay(float TimeInSeconds);
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category = Replays, BlueprintPure = false)
|
| UE_API float GetReplayLengthInSeconds() const;
|
|
|
|
|
| UFUNCTION(BlueprintCallable, Category=Replays, BlueprintPure=false)
|
| UE_API float GetReplayCurrentTime() const;
|
|
|
| private:
|
| TSharedPtr<INetworkReplayStreamer> CurrentReplayStreamer;
|
|
|
| UPROPERTY()
|
| TObjectPtr<ULocalPlayer> LocalPlayerDeletingReplays;
|
|
|
| int32 DeletingReplaysNumberToKeep;
|
|
|
| UDemoNetDriver* GetDemoDriver() const;
|
|
|
| void OnEnumerateStreamsCompleteForDelete(const FEnumerateStreamsResult& Result);
|
| void OnDeleteReplay(const FDeleteFinishedStreamResult& DeleteResult);
|
| };
|
|
|
| #undef UE_API
|
|
|