2019-12-26 14:45:42 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2019-08-08 00:48:21 -04:00
|
|
|
|
|
|
|
|
#include "InstallBundleManagerInterface.h"
|
|
|
|
|
#include "InstallBundleManagerModule.h"
|
|
|
|
|
|
2021-05-27 13:40:37 -04:00
|
|
|
FInstallBundleManagerInitCompleteMultiDelegate IInstallBundleManager::InitCompleteDelegate;
|
|
|
|
|
|
2024-08-19 13:10:01 -04:00
|
|
|
FInstallBundleChunkDownloadMetricsMultiDelegate IInstallBundleManager::InstallBundleChunkDownloadMetricsDelegate;
|
|
|
|
|
|
2020-04-20 14:13:16 -04:00
|
|
|
FInstallBundleCompleteMultiDelegate IInstallBundleManager::InstallBundleCompleteDelegate;
|
2019-08-08 00:48:21 -04:00
|
|
|
|
|
|
|
|
FInstallBundlePausedMultiDelegate IInstallBundleManager::PausedBundleDelegate;
|
|
|
|
|
|
2020-08-11 01:36:57 -04:00
|
|
|
FInstallBundleReleasedMultiDelegate IInstallBundleManager::ReleasedDelegate;
|
|
|
|
|
|
2020-03-16 14:48:59 -04:00
|
|
|
FInstallBundleManagerOnPatchCheckComplete IInstallBundleManager::PatchCheckCompleteDelegate;
|
|
|
|
|
|
2020-10-29 13:38:15 -04:00
|
|
|
TSharedPtr<IInstallBundleManager> IInstallBundleManager::GetPlatformInstallBundleManager()
|
2019-08-08 00:48:21 -04:00
|
|
|
{
|
2020-10-29 13:38:15 -04:00
|
|
|
static IInstallBundleManagerModule* Module = nullptr;
|
2019-08-08 00:48:21 -04:00
|
|
|
static bool bCheckedIni = false;
|
|
|
|
|
|
2020-10-29 13:38:15 -04:00
|
|
|
if (Module)
|
|
|
|
|
{
|
|
|
|
|
return Module->GetInstallBundleManager();
|
|
|
|
|
}
|
2019-08-08 00:48:21 -04:00
|
|
|
|
|
|
|
|
if (!bCheckedIni && !GEngineIni.IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
FString ModuleName;
|
2020-04-28 13:11:00 -04:00
|
|
|
#if WITH_EDITOR
|
|
|
|
|
GConfig->GetString(TEXT("InstallBundleManager"), TEXT("EditorModuleName"), ModuleName, GEngineIni);
|
2020-04-28 13:11:06 -04:00
|
|
|
#else
|
|
|
|
|
GConfig->GetString(TEXT("InstallBundleManager"), TEXT("ModuleName"), ModuleName, GEngineIni);
|
2020-04-28 13:11:00 -04:00
|
|
|
#endif // WITH_EDITOR
|
2019-08-08 00:48:21 -04:00
|
|
|
|
|
|
|
|
if (FModuleManager::Get().ModuleExists(*ModuleName))
|
|
|
|
|
{
|
|
|
|
|
Module = FModuleManager::LoadModulePtr<IInstallBundleManagerModule>(*ModuleName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bCheckedIni = true;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-29 13:38:15 -04:00
|
|
|
if (Module)
|
|
|
|
|
{
|
|
|
|
|
return Module->GetInstallBundleManager();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {};
|
2019-08-08 00:48:21 -04:00
|
|
|
}
|
|
|
|
|
|
2024-03-20 21:48:59 -04:00
|
|
|
const TSharedPtr<IInstallBundleSource> IInstallBundleManager::GetBundleSource(FInstallBundleSourceType SourceType) const
|
2023-03-15 14:09:41 -04:00
|
|
|
{
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-04-20 06:28:52 -04:00
|
|
|
TValueOrError<FInstallBundleRequestInfo, EInstallBundleResult> IInstallBundleManager::RequestUpdateContent(FName BundleName, EInstallBundleRequestFlags Flags, ELogVerbosity::Type LogVerbosityOverride /*= ELogVerbosity::NoLogging*/, InstallBundleUtil::FContentRequestSharedContextPtr RequestSharedContext /*= nullptr*/)
|
2019-12-13 14:44:37 -05:00
|
|
|
{
|
2023-04-20 06:28:52 -04:00
|
|
|
return RequestUpdateContent(MakeArrayView(&BundleName, 1), Flags, LogVerbosityOverride, RequestSharedContext);
|
2019-12-13 14:44:37 -05:00
|
|
|
}
|
|
|
|
|
|
2021-05-12 18:10:03 -04:00
|
|
|
FDelegateHandle IInstallBundleManager::GetContentState(FName BundleName, EInstallBundleGetContentStateFlags Flags, bool bAddDependencies, FInstallBundleGetContentStateDelegate Callback, FName RequestTag /*= NAME_None*/)
|
2019-12-13 14:44:37 -05:00
|
|
|
{
|
|
|
|
|
return GetContentState(MakeArrayView(&BundleName, 1), Flags, bAddDependencies, MoveTemp(Callback), RequestTag);
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-12 18:10:03 -04:00
|
|
|
FDelegateHandle IInstallBundleManager::GetInstallState(FName BundleName, bool bAddDependencies, FInstallBundleGetInstallStateDelegate Callback, FName RequestTag /*= NAME_None*/)
|
2020-06-23 18:40:00 -04:00
|
|
|
{
|
|
|
|
|
return GetInstallState(MakeArrayView(&BundleName, 1), bAddDependencies, MoveTemp(Callback), RequestTag);
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-11 01:36:57 -04:00
|
|
|
TValueOrError<FInstallBundleCombinedInstallState, EInstallBundleResult> IInstallBundleManager::GetInstallStateSynchronous(FName BundleName, bool bAddDependencies) const
|
2020-06-23 18:40:00 -04:00
|
|
|
{
|
|
|
|
|
return GetInstallStateSynchronous(MakeArrayView(&BundleName, 1), bAddDependencies);
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-20 15:11:58 -04:00
|
|
|
TValueOrError<FInstallBundleReleaseRequestInfo, EInstallBundleResult> IInstallBundleManager::RequestReleaseContent(FName ReleaseName, EInstallBundleReleaseRequestFlags Flags, TArrayView<const FName> KeepNames /*= TArrayView<const FName>()*/, ELogVerbosity::Type LogVerbosityOverride /*= ELogVerbosity::NoLogging*/)
|
2020-08-11 01:36:57 -04:00
|
|
|
{
|
2021-02-03 14:57:28 -04:00
|
|
|
return RequestReleaseContent(MakeArrayView(&ReleaseName, 1), Flags, KeepNames, LogVerbosityOverride);
|
2020-08-11 01:36:57 -04:00
|
|
|
}
|
|
|
|
|
|
2021-04-08 14:32:07 -04:00
|
|
|
EInstallBundleResult IInstallBundleManager::FlushCache(FInstallBundleManagerFlushCacheCompleteDelegate Callback, ELogVerbosity::Type LogVerbosityOverride /*= ELogVerbosity::NoLogging*/)
|
|
|
|
|
{
|
|
|
|
|
return FlushCache({}, MoveTemp(Callback), LogVerbosityOverride);
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 14:44:37 -05:00
|
|
|
void IInstallBundleManager::RequestRemoveContentOnNextInit(FName RemoveName, TArrayView<const FName> KeepNames /*= TArrayView<const FName>()*/)
|
|
|
|
|
{
|
|
|
|
|
RequestRemoveContentOnNextInit(MakeArrayView(&RemoveName, 1), KeepNames);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IInstallBundleManager::CancelRequestRemoveContentOnNextInit(FName BundleName)
|
|
|
|
|
{
|
|
|
|
|
CancelRequestRemoveContentOnNextInit(MakeArrayView(&BundleName, 1));
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-24 18:42:39 -04:00
|
|
|
void IInstallBundleManager::CancelUpdateContent(FName BundleName)
|
2019-12-13 14:44:37 -05:00
|
|
|
{
|
2020-11-24 18:42:39 -04:00
|
|
|
CancelUpdateContent(MakeArrayView(&BundleName, 1));
|
2019-12-13 14:44:37 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IInstallBundleManager::PauseUpdateContent(FName BundleName)
|
|
|
|
|
{
|
|
|
|
|
PauseUpdateContent(MakeArrayView(&BundleName, 1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IInstallBundleManager::ResumeUpdateContent(FName BundleName)
|
|
|
|
|
{
|
|
|
|
|
ResumeUpdateContent(MakeArrayView(&BundleName, 1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IInstallBundleManager::UpdateContentRequestFlags(FName BundleName, EInstallBundleRequestFlags AddFlags, EInstallBundleRequestFlags RemoveFlags)
|
|
|
|
|
{
|
|
|
|
|
UpdateContentRequestFlags(MakeArrayView(&BundleName, 1), AddFlags, RemoveFlags);
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-16 14:48:59 -04:00
|
|
|
void IInstallBundleManager::StartPatchCheck()
|
|
|
|
|
{
|
|
|
|
|
PatchCheckCompleteDelegate.Broadcast(EInstallBundleManagerPatchCheckResult::NoPatchRequired);
|
|
|
|
|
}
|
|
|
|
|
|