You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb Per.Larsson #jira UE-176605 #preflight 63ea68d9b91ae11c1cbab311 - A common problem that has been reported is that the user has tried to virtualize packages with the virtualization tool but not seen any virtualization occur. When debugged the issue turns out to be that the packages are too old and need to be re-saved. - If the user submits via the editor then the package will be auto reverted if it has not yet been re-saved so this problem is not seen in that flow. - Although this is a problem that will solve itself over time, it would be helpful to the person testing the system if we explicitly log that X number of packages were too old. - Given how annoying this has proven to people the log message is currently set to warning. - We don't actually return why a package trailer fails to load from FPackageTrailer::LoadTrailer, as working that out requires additional file reading and most the time we don't really care. - Instead I added a new utility to the virtualization module so that we can opt into checking the reason. - At the moment we only report if the package is too old and not for every possible reason. [CL 24206813 by paul chipchase in ue5-main branch]
74 lines
2.5 KiB
C++
74 lines
2.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Containers/StringFwd.h"
|
|
#include "Containers/UnrealString.h"
|
|
|
|
class FPackagePath;
|
|
|
|
struct FIoHash;
|
|
|
|
namespace UE::Virtualization::Utils
|
|
{
|
|
|
|
/**
|
|
* Converts a FIoHash into a file path.
|
|
*
|
|
* This utility will take an FIoHash and return a file path that is
|
|
* 3 directories deep. The first six characters of the id will be used to
|
|
* create the directory names, with each directory using two characters.
|
|
* The remaining thirty four characters will be used as the file name.
|
|
* Lastly the extension '.payload' will be applied to complete the path/
|
|
* Example: FIoHash 0139d6d5d477e32dfd2abd3c5bc8ea8507e8eef8 becomes
|
|
* 01/39/d6/d5d477e32dfd2abd3c5bc8ea8507e8eef8.payload'
|
|
*
|
|
* @param Id The payload identifier used to create the file path.
|
|
* @param OutPath Will be reset and then assigned the resulting file path.
|
|
* The string builder must have a capacity of at least 52 characters
|
|
to avoid reallocation.
|
|
*/
|
|
void PayloadIdToPath(const FIoHash& Id, FStringBuilderBase& OutPath);
|
|
|
|
/**
|
|
* Converts a FIoHash into a file path.
|
|
*
|
|
* See above for further details
|
|
*
|
|
* @param Id The payload identifier used to create the file path.
|
|
* @return The resulting file path.
|
|
*/
|
|
FString PayloadIdToPath(const FIoHash& Id);
|
|
|
|
/**
|
|
* Fill in the given string builder with the human readable message of the current system
|
|
* code, followed by the code value itself.
|
|
* In the system value is currently 0, then we assume that it was cleared before this was
|
|
* able to be called and write that the error is unknown instead of assuming that the
|
|
* operation was a success.
|
|
*/
|
|
void GetFormattedSystemError(FStringBuilderBase& SystemErrorMessage);
|
|
|
|
|
|
enum class ETrailerFailedReason : uint8
|
|
{
|
|
/** Could not open the package for reading */
|
|
NotFound,
|
|
/** The header of the package (summary) could not be read or was otherwise corrupted */
|
|
InvalidSummary,
|
|
/** The package predates package version 1002 in which the package trailer was introduced */
|
|
OutOfDate,
|
|
/** The reason for the missing package trailer could not be determined */
|
|
Unknown
|
|
};
|
|
|
|
/**
|
|
* Utility that returns the reason why a given package does not have a package trailer.
|
|
* Note that it does not actually try to load the trailer or validate that the trailer
|
|
* is in fact missing and assumes that the caller previously attempted to a call to
|
|
* load a trailer from the package but it failed.
|
|
*/
|
|
ETrailerFailedReason FindTrailerFailedReason(const FPackagePath& PackagePath);
|
|
|
|
} // namespace UE::Virtualization::Utils
|