You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485 [CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
56 lines
2.1 KiB
C++
56 lines
2.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "StorageServerPackageStore.h"
|
|
#include "IO/IoContainerHeader.h"
|
|
#include "IO/IoDispatcher.h"
|
|
#include "StorageServerConnection.h"
|
|
|
|
#if !UE_BUILD_SHIPPING
|
|
|
|
FStorageServerPackageStore::FStorageServerPackageStore(FStorageServerConnection& Connection)
|
|
{
|
|
FIoChunkId HeaderChunkId = CreateIoChunkId(FIoContainerId::FromName(TEXT("global")).Value(), 0, EIoChunkType::ContainerHeader);
|
|
Connection.ReadChunkRequest(HeaderChunkId, 0, uint64(-1), [this](FStorageServerResponse& ResponseStream)
|
|
{
|
|
if (ResponseStream.IsOk())
|
|
{
|
|
FIoContainerHeader ContainerHeader;
|
|
ResponseStream << ContainerHeader;
|
|
StoreEntriesData = MoveTemp(ContainerHeader.StoreEntries);
|
|
StoreEntriesMap.Reserve(ContainerHeader.PackageCount);
|
|
TArrayView<const FFilePackageStoreEntry> StoreEntries(reinterpret_cast<const FFilePackageStoreEntry*>(StoreEntriesData.GetData()), ContainerHeader.PackageCount);
|
|
int32 Index = 0;
|
|
for (const FFilePackageStoreEntry& StoreEntry : StoreEntries)
|
|
{
|
|
const FPackageId& PackageId = ContainerHeader.PackageIds[Index];
|
|
check(PackageId.IsValid());
|
|
StoreEntriesMap.FindOrAdd(PackageId, &StoreEntry);
|
|
++Index;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
bool FStorageServerPackageStore::DoesPackageExist(FPackageId PackageId)
|
|
{
|
|
return PackageId.IsValid() && StoreEntriesMap.Contains(PackageId);
|
|
}
|
|
|
|
EPackageStoreEntryStatus FStorageServerPackageStore::GetPackageStoreEntry(FPackageId PackageId, FPackageStoreEntry& OutPackageStoreEntry)
|
|
{
|
|
const FFilePackageStoreEntry* FindEntry = StoreEntriesMap.FindRef(PackageId);
|
|
if (FindEntry)
|
|
{
|
|
OutPackageStoreEntry.ExportInfo.ExportCount = FindEntry->ExportCount;
|
|
OutPackageStoreEntry.ExportInfo.ExportBundleCount = FindEntry->ExportBundleCount;
|
|
OutPackageStoreEntry.ImportedPackageIds = MakeArrayView(FindEntry->ImportedPackages.Data(), FindEntry->ImportedPackages.Num());
|
|
OutPackageStoreEntry.ShaderMapHashes = MakeArrayView(FindEntry->ShaderMapHashes.Data(), FindEntry->ShaderMapHashes.Num());
|
|
return EPackageStoreEntryStatus::Ok;
|
|
}
|
|
else
|
|
{
|
|
return EPackageStoreEntryStatus::Missing;
|
|
}
|
|
}
|
|
|
|
#endif |