Add support for configuring default Archive File Search Mode through a Cache Var (#5668)
* Renamed ArchiveLocationPriority enum to FileSearchPriority and made it a proper enum class Added an ArchiveVars.cpp which checks the a new define: `LY_ARCHIVE_FILE_SEARCH_MODE_DEFAULT` That define represents the default value to use for the Archive system search mode Moved the FileSearchLocation enum to the ArchiveVars.h header Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated the AssetBundleComponent to use AZ::IO::Path for level dirs Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added a LY_ARCHIVE_FILE_SEARCH_MODE cache variable The Cache Variable default value is to Archive File Search Mode to PakOnly in Release. This can be overridden using a value for all configurations by specifying a number of 0, 1 or 2. Alternatively a generator expression can be used to set the Archive File Search Mode in specific configurations. For example to set the FileSearchMode to 1 in profile and 2 in release the following LY_ARCHIVE_FILE_SEARCH_MODE value can be used `$<$<CONFIG:profile>:1>$<$<CONFIG:release>:2>` Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Updated AssetBundler(Batch) VS Debugger arguments to populate the project-path optoin if a single project is configured. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Add support for serializing older versions of the AssetBundleManifest This is done by attaching the "ObjectStreamWriteElementOverride" attribute to the AssetBundleManifest reflection. That attribute contains a function which outputs an older serialized version of the AssetBundleManifest based on the `m_bundleVersion` member value. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * AZStd::variant Serialization fix The AttributeData<T> type is no longer suitable for storing the ObjectStreamWriterOverrideCB function Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
489877b82a
commit
9d22c98c26
@@ -34,7 +34,6 @@
|
||||
#include <AzFramework/Archive/Archive.h>
|
||||
#include <AzFramework/Archive/NestedArchive.h>
|
||||
#include <AzFramework/Archive/ArchiveBus.h>
|
||||
#include <AzFramework/Archive/ArchiveVars.h>
|
||||
#include <AzFramework/Archive/MissingFileReport.h>
|
||||
#include <AzFramework/Archive/ZipDirFind.h>
|
||||
#include <AzFramework/Archive/ZipDirCacheFactory.h>
|
||||
@@ -43,8 +42,10 @@
|
||||
|
||||
namespace AZ::IO
|
||||
{
|
||||
AZ_CVAR(int, sys_PakPriority, aznumeric_cast<int>(ArchiveVars{}.nPriority), nullptr, AZ::ConsoleFunctorFlags::Null,
|
||||
"If set to 1, tells Archive to try to open the file in pak first, then go to file system");
|
||||
AZ_CVAR(int, sys_PakPriority, aznumeric_cast<int>(ArchiveVars{}.m_fileSearchPriority), nullptr, AZ::ConsoleFunctorFlags::Null,
|
||||
"If set to 0, tells Archive to try to open the file on the file system first othewise check mounted paks.\n"
|
||||
"If set to 1, tells Archive to try to open the file in pak first, then go to file system.\n"
|
||||
"If set to 2, tells the Archive to only open files from the pak");
|
||||
AZ_CVAR(int, sys_PakMessageInvalidFileAccess, ArchiveVars{}.nMessageInvalidFileAccess, nullptr, AZ::ConsoleFunctorFlags::Null,
|
||||
"Message Box synchronous file access when in game");
|
||||
|
||||
@@ -437,9 +438,9 @@ namespace AZ::IO
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool Archive::IsFileExist(AZStd::string_view sFilename, EFileSearchLocation fileLocation)
|
||||
bool Archive::IsFileExist(AZStd::string_view sFilename, FileSearchLocation fileLocation)
|
||||
{
|
||||
const AZ::IO::ArchiveLocationPriority nVarPakPriority = GetPakPriority();
|
||||
const AZ::IO::FileSearchPriority nVarPakPriority = GetPakPriority();
|
||||
|
||||
auto szFullPath = AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath(sFilename);
|
||||
if (!szFullPath)
|
||||
@@ -450,25 +451,25 @@ namespace AZ::IO
|
||||
|
||||
switch(fileLocation)
|
||||
{
|
||||
case IArchive::eFileLocation_Any:
|
||||
case FileSearchLocation::Any:
|
||||
// Search for file based on pak priority
|
||||
switch (nVarPakPriority)
|
||||
{
|
||||
case ArchiveLocationPriority::ePakPriorityFileFirst:
|
||||
case FileSearchPriority::FileFirst:
|
||||
return FileIOBase::GetDirectInstance()->Exists(szFullPath->c_str()) || FindPakFileEntry(szFullPath->Native());
|
||||
case ArchiveLocationPriority::ePakPriorityPakFirst:
|
||||
case FileSearchPriority::PakFirst:
|
||||
return FindPakFileEntry(szFullPath->Native()) || IO::FileIOBase::GetDirectInstance()->Exists(szFullPath->c_str());
|
||||
case ArchiveLocationPriority::ePakPriorityPakOnly:
|
||||
case FileSearchPriority::PakOnly:
|
||||
return FindPakFileEntry(szFullPath->Native());
|
||||
default:
|
||||
AZ_Assert(false, "PakPriority %d doesn't match a value in the ArchiveLocationPriority enum",
|
||||
AZ_Assert(false, "PakPriority %d doesn't match a value in the FileSearchPriority enum",
|
||||
aznumeric_cast<int>(nVarPakPriority));
|
||||
}
|
||||
break;
|
||||
case IArchive::eFileLocation_InPak:
|
||||
case FileSearchLocation::InPak:
|
||||
return FindPakFileEntry(szFullPath->Native());
|
||||
case IArchive::eFileLocation_OnDisk:
|
||||
if (nVarPakPriority != ArchiveLocationPriority::ePakPriorityPakOnly)
|
||||
case FileSearchLocation::OnDisk:
|
||||
if (nVarPakPriority != FileSearchPriority::PakOnly)
|
||||
{
|
||||
return FileIOBase::GetDirectInstance()->Exists(szFullPath->c_str());
|
||||
}
|
||||
@@ -485,7 +486,7 @@ namespace AZ::IO
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool Archive::IsFolder(AZStd::string_view sPath)
|
||||
{
|
||||
AZStd::fixed_string<AZ::IO::MaxPathLength > filePath{ sPath };
|
||||
AZ::IO::FixedMaxPath filePath{ sPath };
|
||||
return AZ::IO::FileIOBase::GetDirectInstance()->IsDirectory(filePath.c_str());
|
||||
}
|
||||
|
||||
@@ -515,7 +516,7 @@ namespace AZ::IO
|
||||
|
||||
// get the priority into local variable to avoid it changing in the course of
|
||||
// this function execution (?)
|
||||
const ArchiveLocationPriority nVarPakPriority = GetPakPriority();
|
||||
const FileSearchPriority nVarPakPriority = GetPakPriority();
|
||||
|
||||
AZ::IO::OpenMode nOSFlags = AZ::IO::GetOpenModeFromStringMode(szMode);
|
||||
|
||||
@@ -628,17 +629,17 @@ namespace AZ::IO
|
||||
|
||||
switch (nVarPakPriority)
|
||||
{
|
||||
case ArchiveLocationPriority::ePakPriorityFileFirst:
|
||||
case FileSearchPriority::FileFirst:
|
||||
{
|
||||
AZ::IO::HandleType fileHandle = OpenFromFileSystem();
|
||||
return fileHandle != AZ::IO::InvalidHandle ? fileHandle : OpenFromArchive();
|
||||
}
|
||||
case ArchiveLocationPriority::ePakPriorityPakFirst:
|
||||
case FileSearchPriority::PakFirst:
|
||||
{
|
||||
AZ::IO::HandleType fileHandle = OpenFromArchive();
|
||||
return fileHandle != AZ::IO::InvalidHandle ? fileHandle : OpenFromFileSystem();
|
||||
}
|
||||
case ArchiveLocationPriority::ePakPriorityPakOnly:
|
||||
case FileSearchPriority::PakOnly:
|
||||
{
|
||||
return OpenFromArchive();
|
||||
}
|
||||
@@ -810,7 +811,7 @@ namespace AZ::IO
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (GetPakPriority() == ArchiveLocationPriority::ePakPriorityFileFirst) // if the file system files have priority now..
|
||||
if (GetPakPriority() == FileSearchPriority::FileFirst) // if the file system files have priority now..
|
||||
{
|
||||
IArchive::SignedFileSize nFileSize = GetFileSizeOnDisk(fullPath->Native());
|
||||
if (nFileSize != IArchive::FILE_NOT_PRESENT)
|
||||
@@ -825,7 +826,7 @@ namespace AZ::IO
|
||||
return pFileEntry->desc.lSizeUncompressed;
|
||||
}
|
||||
|
||||
if (bAllowUseFileSystem || GetPakPriority() == ArchiveLocationPriority::ePakPriorityPakFirst) // if the archive files had more priority, we didn't attempt fopen before- try it now
|
||||
if (bAllowUseFileSystem || GetPakPriority() == FileSearchPriority::PakFirst) // if the archive files had more priority, we didn't attempt fopen before- try it now
|
||||
{
|
||||
IArchive::SignedFileSize nFileSize = GetFileSizeOnDisk(fullPath->Native());
|
||||
if (nFileSize != IArchive::FILE_NOT_PRESENT)
|
||||
@@ -1023,7 +1024,7 @@ namespace AZ::IO
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
AZ::IO::ArchiveFileIterator Archive::FindFirst(AZStd::string_view pDir, EFileSearchType searchType)
|
||||
AZ::IO::ArchiveFileIterator Archive::FindFirst(AZStd::string_view pDir, FileSearchLocation searchType)
|
||||
{
|
||||
auto szFullPath = AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath(pDir);
|
||||
if (!szFullPath)
|
||||
@@ -1036,18 +1037,21 @@ namespace AZ::IO
|
||||
bool bAllowUseFileSystem{};
|
||||
switch (searchType)
|
||||
{
|
||||
case IArchive::eFileSearchType_AllowInZipsOnly:
|
||||
bAllowUseFileSystem = false;
|
||||
bScanZips = true;
|
||||
break;
|
||||
case IArchive::eFileSearchType_AllowOnDiskAndInZips:
|
||||
bAllowUseFileSystem = true;
|
||||
bScanZips = true;
|
||||
break;
|
||||
case IArchive::eFileSearchType_AllowOnDiskOnly:
|
||||
bAllowUseFileSystem = true;
|
||||
bScanZips = false;
|
||||
break;
|
||||
case FileSearchLocation::InPak:
|
||||
bAllowUseFileSystem = false;
|
||||
bScanZips = true;
|
||||
break;
|
||||
case FileSearchLocation::Any:
|
||||
bAllowUseFileSystem = true;
|
||||
bScanZips = true;
|
||||
break;
|
||||
case FileSearchLocation::OnDisk:
|
||||
bAllowUseFileSystem = true;
|
||||
bScanZips = false;
|
||||
break;
|
||||
default:
|
||||
AZ_Assert(false, "Invalid search location value supplied");
|
||||
break;
|
||||
}
|
||||
|
||||
AZStd::intrusive_ptr pFindData = aznew AZ::IO::FindData();
|
||||
@@ -1218,7 +1222,7 @@ namespace AZ::IO
|
||||
else
|
||||
{
|
||||
// [LYN-2376] Remove once legacy slice support is removed
|
||||
AZStd::vector<AZStd::string> levelDirs;
|
||||
AZStd::vector<AZ::IO::Path> levelDirs;
|
||||
|
||||
if (addLevels)
|
||||
{
|
||||
@@ -1380,7 +1384,7 @@ namespace AZ::IO
|
||||
return true;
|
||||
}
|
||||
|
||||
if (AZ::IO::ArchiveFileIterator fileIterator = FindFirst(pWildcardIn, IArchive::eFileSearchType_AllowOnDiskOnly); fileIterator)
|
||||
if (AZ::IO::ArchiveFileIterator fileIterator = FindFirst(pWildcardIn, FileSearchLocation::OnDisk); fileIterator)
|
||||
{
|
||||
AZStd::vector<AZ::IO::FixedMaxPath> files;
|
||||
do
|
||||
@@ -1955,15 +1959,15 @@ namespace AZ::IO
|
||||
}
|
||||
|
||||
// gets the current archive priority
|
||||
ArchiveLocationPriority Archive::GetPakPriority() const
|
||||
FileSearchPriority Archive::GetPakPriority() const
|
||||
{
|
||||
int pakPriority = aznumeric_cast<int>(ArchiveVars{}.nPriority);
|
||||
FileSearchPriority pakPriority = ArchiveVars{}.m_fileSearchPriority;
|
||||
if (auto console = AZ::Interface<AZ::IConsole>::Get(); console != nullptr)
|
||||
{
|
||||
[[maybe_unused]] AZ::GetValueResult getCvarResult = console->GetCvarValue("sys_PakPriority", pakPriority);
|
||||
[[maybe_unused]] AZ::GetValueResult getCvarResult = console->GetCvarValue("sys_PakPriority", reinterpret_cast<int&>(pakPriority));
|
||||
AZ_Error("Archive", getCvarResult == AZ::GetValueResult::Success, "Lookup of 'sys_PakPriority console variable failed with error %s", AZ::GetEnumString(getCvarResult));
|
||||
}
|
||||
return static_cast<ArchiveLocationPriority>(pakPriority);
|
||||
return pakPriority;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -2030,13 +2034,13 @@ namespace AZ::IO
|
||||
|
||||
switch (GetPakPriority())
|
||||
{
|
||||
case ArchiveLocationPriority::ePakPriorityFileFirst:
|
||||
case FileSearchPriority::FileFirst:
|
||||
info.m_conflictResolution = AZ::IO::ConflictResolution::PreferFile;
|
||||
break;
|
||||
case ArchiveLocationPriority::ePakPriorityPakFirst:
|
||||
case FileSearchPriority::PakFirst:
|
||||
info.m_conflictResolution = AZ::IO::ConflictResolution::PreferArchive;
|
||||
break;
|
||||
case ArchiveLocationPriority::ePakPriorityPakOnly:
|
||||
case FileSearchPriority::PakOnly:
|
||||
info.m_conflictResolution = AZ::IO::ConflictResolution::UseArchiveOnly;
|
||||
break;
|
||||
}
|
||||
@@ -2147,13 +2151,13 @@ namespace AZ::IO
|
||||
return manifestInfo;
|
||||
}
|
||||
|
||||
AZStd::vector<AZStd::string> Archive::ScanForLevels(ZipDir::CachePtr pZip)
|
||||
AZStd::vector<AZ::IO::Path> Archive::ScanForLevels(ZipDir::CachePtr pZip)
|
||||
{
|
||||
AZStd::queue<AZStd::string> scanDirs;
|
||||
AZStd::vector<AZStd::string> levelDirs;
|
||||
AZStd::string currentDir = "levels";
|
||||
AZStd::string currentDirPattern;
|
||||
AZStd::string currentFilePattern;
|
||||
AZStd::queue<AZ::IO::Path> scanDirs;
|
||||
AZStd::vector<AZ::IO::Path> levelDirs;
|
||||
AZ::IO::Path currentDir = "levels";
|
||||
AZ::IO::Path currentDirPattern;
|
||||
AZ::IO::Path currentFilePattern;
|
||||
ZipDir::FindDir findDir(pZip);
|
||||
|
||||
findDir.FindFirst(currentDir.c_str());
|
||||
@@ -2171,11 +2175,10 @@ namespace AZ::IO
|
||||
scanDirs.pop();
|
||||
}
|
||||
|
||||
currentDirPattern = currentDir + AZ_FILESYSTEM_SEPARATOR_WILDCARD;
|
||||
currentFilePattern = currentDir + AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING + "level.pak";
|
||||
currentDirPattern = currentDir / "*";
|
||||
currentFilePattern = currentDir / "level.pak";
|
||||
|
||||
ZipDir::FileEntry* fileEntry = findFile.FindExact(currentFilePattern.c_str());
|
||||
if (fileEntry)
|
||||
if (ZipDir::FileEntry* fileEntry = findFile.FindExact(currentFilePattern); fileEntry)
|
||||
{
|
||||
levelDirs.emplace_back(currentDir);
|
||||
continue;
|
||||
@@ -2183,9 +2186,7 @@ namespace AZ::IO
|
||||
|
||||
for (findDir.FindFirst(currentDirPattern.c_str()); findDir.GetDirEntry(); findDir.FindNext())
|
||||
{
|
||||
AZStd::string_view dirName = findDir.GetDirName();
|
||||
AZStd::string dirToAdd = AZStd::string::format("%s/%.*s", currentDir.data(), aznumeric_cast<int>(dirName.size()), dirName.data());
|
||||
scanDirs.push(dirToAdd);
|
||||
scanDirs.push(currentDir / findDir.GetDirName());
|
||||
}
|
||||
} while (!scanDirs.empty());
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace AZ::IO
|
||||
uint64_t FTell(AZ::IO::HandleType handle) override;
|
||||
int FFlush(AZ::IO::HandleType handle) override;
|
||||
int FClose(AZ::IO::HandleType handle) override;
|
||||
AZ::IO::ArchiveFileIterator FindFirst(AZStd::string_view pDir, EFileSearchType searchType = eFileSearchType_AllowInZipsOnly) override;
|
||||
AZ::IO::ArchiveFileIterator FindFirst(AZStd::string_view pDir, FileSearchLocation searchType = FileSearchLocation::InPak) override;
|
||||
AZ::IO::ArchiveFileIterator FindNext(AZ::IO::ArchiveFileIterator fileIterator) override;
|
||||
bool FindClose(AZ::IO::ArchiveFileIterator fileIterator) override;
|
||||
int FEof(AZ::IO::HandleType handle) override;
|
||||
@@ -219,7 +219,7 @@ namespace AZ::IO
|
||||
bool RemoveDir(AZStd::string_view pName) override; // remove directory from FS (if supported)
|
||||
bool IsAbsPath(AZStd::string_view pPath) override;
|
||||
|
||||
bool IsFileExist(AZStd::string_view sFilename, EFileSearchLocation fileLocation = eFileLocation_Any) override;
|
||||
bool IsFileExist(AZStd::string_view sFilename, FileSearchLocation fileLocation = FileSearchLocation::Any) override;
|
||||
bool IsFolder(AZStd::string_view sPath) override;
|
||||
IArchive::SignedFileSize GetFileSizeOnDisk(AZStd::string_view filename) override;
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace AZ::IO
|
||||
bool DisableRuntimeFileAccess(bool status, AZStd::thread_id threadId) override;
|
||||
|
||||
// gets the current archive priority
|
||||
ArchiveLocationPriority GetPakPriority() const override;
|
||||
FileSearchPriority GetPakPriority() const override;
|
||||
|
||||
uint64_t GetFileOffsetOnMedia(AZStd::string_view szName) const override;
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace AZ::IO
|
||||
AZStd::shared_ptr<AzFramework::AssetRegistry> GetBundleCatalog(ZipDir::CachePtr pZip, const AZStd::string& catalogName);
|
||||
|
||||
// [LYN-2376] Remove once legacy slice support is removed
|
||||
AZStd::vector<AZStd::string> ScanForLevels(ZipDir::CachePtr pZip);
|
||||
AZStd::vector<AZ::IO::Path> ScanForLevels(ZipDir::CachePtr pZip);
|
||||
|
||||
mutable AZStd::shared_mutex m_csOpenFiles;
|
||||
ZipPseudoFileArray m_arrOpenFiles;
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace AZ::IO
|
||||
size = m_archive->FGetSize(filePath, true);
|
||||
if (!size)
|
||||
{
|
||||
return m_archive->IsFileExist(filePath, IArchive::eFileLocation_Any) ? IO::ResultCode::Success : IO::ResultCode::Error;
|
||||
return m_archive->IsFileExist(filePath, FileSearchLocation::Any) ? IO::ResultCode::Success : IO::ResultCode::Error;
|
||||
}
|
||||
|
||||
return IO::ResultCode::Success;
|
||||
|
||||
@@ -78,9 +78,9 @@ namespace AZ::IO
|
||||
{
|
||||
// get the priority into local variable to avoid it changing in the course of
|
||||
// this function execution
|
||||
ArchiveLocationPriority nVarPakPriority = archive->GetPakPriority();
|
||||
FileSearchPriority nVarPakPriority = archive->GetPakPriority();
|
||||
|
||||
if (nVarPakPriority == ArchiveLocationPriority::ePakPriorityFileFirst)
|
||||
if (nVarPakPriority == FileSearchPriority::FileFirst)
|
||||
{
|
||||
// first, find the file system files
|
||||
ScanFS(archive, szDir);
|
||||
@@ -96,7 +96,7 @@ namespace AZ::IO
|
||||
{
|
||||
ScanZips(archive, szDir);
|
||||
}
|
||||
if (bAllowUseFS || nVarPakPriority != ArchiveLocationPriority::ePakPriorityPakOnly)
|
||||
if (bAllowUseFS || nVarPakPriority != FileSearchPriority::PakOnly)
|
||||
{
|
||||
ScanFS(archive, szDir);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <AzFramework/Archive/ArchiveVars.h>
|
||||
|
||||
namespace AZ::IO
|
||||
{
|
||||
FileSearchPriority GetDefaultFileSearchPriority()
|
||||
{
|
||||
#if defined(LY_ARCHIVE_FILE_SEARCH_MODE_DEFAULT)
|
||||
return FileSearchPriority{ LY_ARCHIVE_FILE_SEARCH_MODE_DEFAULT };
|
||||
#else
|
||||
return FileSearchPriority{};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -13,13 +13,24 @@
|
||||
|
||||
namespace AZ::IO
|
||||
{
|
||||
enum class ArchiveLocationPriority
|
||||
enum class FileSearchPriority
|
||||
{
|
||||
ePakPriorityFileFirst = 0,
|
||||
ePakPriorityPakFirst = 1,
|
||||
ePakPriorityPakOnly = 2
|
||||
FileFirst,
|
||||
PakFirst,
|
||||
PakOnly
|
||||
};
|
||||
|
||||
|
||||
//file location enum used in isFileExist to control where the archive system looks for the file.
|
||||
enum class FileSearchLocation
|
||||
{
|
||||
Any,
|
||||
OnDisk,
|
||||
InPak
|
||||
};
|
||||
|
||||
FileSearchPriority GetDefaultFileSearchPriority();
|
||||
|
||||
// variables that control behavior of the Archive subsystem
|
||||
struct ArchiveVars
|
||||
{
|
||||
@@ -28,8 +39,6 @@ namespace AZ::IO
|
||||
#else
|
||||
inline static constexpr bool IsReleaseConfig{};
|
||||
#endif
|
||||
|
||||
public:
|
||||
int nReadSlice{};
|
||||
int nSaveTotalResourceList{};
|
||||
int nSaveFastloadResourceList{};
|
||||
@@ -42,9 +51,7 @@ namespace AZ::IO
|
||||
int nLoadCache{};
|
||||
int nLoadModePaks{};
|
||||
int nStreamCache{ STREAM_CACHE_DEFAULT };
|
||||
ArchiveLocationPriority nPriority{ IsReleaseConfig
|
||||
? ArchiveLocationPriority::ePakPriorityPakOnly
|
||||
: ArchiveLocationPriority::ePakPriorityFileFirst }; // Which file location to favor (loose vs. pak files)
|
||||
FileSearchPriority m_fileSearchPriority{ GetDefaultFileSearchPriority()};
|
||||
int nMessageInvalidFileAccess{};
|
||||
int nLogInvalidFileAccess{ IsReleaseConfig ? 0 : 1 };
|
||||
int nDisableNonLevelRelatedPaks{ 1 };
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
#include <AzCore/std/string/fixed_string.h>
|
||||
|
||||
#include <AzFramework/Archive/ArchiveFindData.h>
|
||||
|
||||
#include <AzFramework/Archive/ArchiveVars.h>
|
||||
|
||||
enum EStreamSourceMediaType : int32_t;
|
||||
|
||||
namespace AZ::IO
|
||||
{
|
||||
enum class ArchiveLocationPriority;
|
||||
enum class FileSearchPriority;
|
||||
struct IResourceList;
|
||||
struct INestedArchive;
|
||||
struct IArchive;
|
||||
@@ -114,14 +114,6 @@ namespace AZ::IO
|
||||
RFOM_NextLevel // used for level2level loading
|
||||
};
|
||||
|
||||
//file location enum used in isFileExist to control where the archive system looks for the file.
|
||||
enum EFileSearchLocation
|
||||
{
|
||||
eFileLocation_Any = 0,
|
||||
eFileLocation_OnDisk,
|
||||
eFileLocation_InPak,
|
||||
};
|
||||
|
||||
enum EInMemoryArchiveLocation
|
||||
{
|
||||
eInMemoryPakLocale_Unload = 0,
|
||||
@@ -130,12 +122,6 @@ namespace AZ::IO
|
||||
eInMemoryPakLocale_PAK,
|
||||
};
|
||||
|
||||
enum EFileSearchType
|
||||
{
|
||||
eFileSearchType_AllowInZipsOnly = 0,
|
||||
eFileSearchType_AllowOnDiskAndInZips,
|
||||
eFileSearchType_AllowOnDiskOnly
|
||||
};
|
||||
|
||||
using SignedFileSize = int64_t;
|
||||
|
||||
@@ -213,7 +199,7 @@ namespace AZ::IO
|
||||
virtual AZStd::intrusive_ptr<AZ::IO::MemoryBlock> PoolAllocMemoryBlock(size_t nSize, const char* sUsage, size_t nAlign = 1) = 0;
|
||||
|
||||
// Arguments:
|
||||
virtual ArchiveFileIterator FindFirst(AZStd::string_view pDir, EFileSearchType searchType = eFileSearchType_AllowInZipsOnly) = 0;
|
||||
virtual ArchiveFileIterator FindFirst(AZStd::string_view pDir, FileSearchLocation searchType = FileSearchLocation::InPak) = 0;
|
||||
virtual ArchiveFileIterator FindNext(AZ::IO::ArchiveFileIterator handle) = 0;
|
||||
virtual bool FindClose(AZ::IO::ArchiveFileIterator handle) = 0;
|
||||
//returns file modification time
|
||||
@@ -221,7 +207,7 @@ namespace AZ::IO
|
||||
|
||||
// Description:
|
||||
// Checks if specified file exist in filesystem.
|
||||
virtual bool IsFileExist(AZStd::string_view sFilename, EFileSearchLocation = eFileLocation_Any) = 0;
|
||||
virtual bool IsFileExist(AZStd::string_view sFilename, FileSearchLocation = FileSearchLocation::Any) = 0;
|
||||
|
||||
// Checks if path is a folder
|
||||
virtual bool IsFolder(AZStd::string_view sPath) = 0;
|
||||
@@ -283,7 +269,7 @@ namespace AZ::IO
|
||||
virtual bool DisableRuntimeFileAccess(bool status, AZStd::thread_id threadId) = 0;
|
||||
|
||||
// gets the current pak priority
|
||||
virtual ArchiveLocationPriority GetPakPriority() const = 0;
|
||||
virtual FileSearchPriority GetPakPriority() const = 0;
|
||||
|
||||
// Summary:
|
||||
// Return offset in archive file (ideally has to return offset on DVD) for streaming requests sorting
|
||||
@@ -295,7 +281,7 @@ namespace AZ::IO
|
||||
|
||||
// Event sent when a archive file is opened that contains a level.pak
|
||||
// @param const AZStd::vector<AZStd::string>& - Array of directories containing level.pak files
|
||||
using LevelPackOpenEvent = AZ::Event<const AZStd::vector<AZStd::string>&>;
|
||||
using LevelPackOpenEvent = AZ::Event<const AZStd::vector<AZ::IO::Path>&>;
|
||||
virtual auto GetLevelPackOpenEvent()->LevelPackOpenEvent* = 0;
|
||||
// Event sent when a archive contains a level.pak is closed
|
||||
// @param const AZStd::string_view - Name of the pak file that was closed
|
||||
|
||||
@@ -7,23 +7,153 @@
|
||||
*/
|
||||
|
||||
#include <AzFramework/Asset/AssetBundleManifest.h>
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
#include <AzCore/Serialization/ObjectStream.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
|
||||
namespace AzFramework
|
||||
{
|
||||
|
||||
const int AssetBundleManifest::CurrentBundleVersion = 2;
|
||||
// Redirects writing of the AssetBundleManifest to an older version if the bundle version
|
||||
// is not set to the current version
|
||||
static void OldBundleManifestWriter(AZ::SerializeContext::EnumerateInstanceCallContext& callContext, const void* bundleManifestPointer,
|
||||
const AZ::SerializeContext::ClassData&, const AZ::SerializeContext::ClassElement* assetBundleManifestClassElement);
|
||||
|
||||
static bool BundleManifestVersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootElement);
|
||||
|
||||
const int AssetBundleManifest::CurrentBundleVersion = 3;
|
||||
const char AssetBundleManifest::s_manifestFileName[] = "manifest.xml";
|
||||
|
||||
AssetBundleManifest::AssetBundleManifest() = default;
|
||||
AssetBundleManifest::~AssetBundleManifest() = default;
|
||||
|
||||
void AssetBundleManifest::ReflectSerialize(AZ::SerializeContext* serializeContext)
|
||||
{
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->Class<AssetBundleManifest>()
|
||||
->Version(2)
|
||||
->Version(CurrentBundleVersion, &BundleManifestVersionConverter)
|
||||
->Attribute(AZ::SerializeContextAttributes::ObjectStreamWriteElementOverride, &OldBundleManifestWriter)
|
||||
->Field("BundleVersion", &AssetBundleManifest::m_bundleVersion)
|
||||
->Field("CatalogName", &AssetBundleManifest::m_catalogName)
|
||||
->Field("DependentBundleNames", &AssetBundleManifest::m_depedendentBundleNames)
|
||||
->Field("DependentBundleNames", &AssetBundleManifest::m_dependentBundleNames)
|
||||
->Field("LevelNames", &AssetBundleManifest::m_levelDirs);
|
||||
|
||||
// Make sure the AZStd::vector<AZStd::string> type is reflected so that it can be read
|
||||
// using DataElement::GetChildData
|
||||
serializeContext->RegisterGenericType<AZStd::vector<AZStd::string>>();
|
||||
}
|
||||
}
|
||||
|
||||
bool BundleManifestVersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& rootElement)
|
||||
{
|
||||
if (rootElement.GetVersion() < 3)
|
||||
{
|
||||
static constexpr AZ::u32 levelNamesCrc = AZ_CRC_CE("LevelNames");
|
||||
AZStd::vector<AZ::IO::Path> newLevelDirs;
|
||||
if (AZStd::vector<AZStd::string> oldLevelNames; rootElement.GetChildData(levelNamesCrc, oldLevelNames))
|
||||
{
|
||||
newLevelDirs.insert(newLevelDirs.end(),
|
||||
AZStd::make_move_iterator(oldLevelNames.begin()), AZStd::make_move_iterator(oldLevelNames.end()));
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Error("AssetBundleManifest", false, R"(Unable to read "levelNames" from AssetBundleManifest version %u )",
|
||||
rootElement.GetVersion());
|
||||
}
|
||||
|
||||
rootElement.RemoveElementByName(levelNamesCrc);
|
||||
rootElement.AddElementWithData(context, "LevelNames", newLevelDirs);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void OldBundleManifestWriter(AZ::SerializeContext::EnumerateInstanceCallContext& callContext, const void* bundleManifestPointer,
|
||||
const AZ::SerializeContext::ClassData&, const AZ::SerializeContext::ClassElement* assetBundleManifestClassElement)
|
||||
{
|
||||
// Copy the AssetBundleManifest current version instance to the AssetBundleManifest V2 instance
|
||||
auto assetBundleManifestCurrent = reinterpret_cast<const AssetBundleManifest*>(bundleManifestPointer);
|
||||
if (assetBundleManifestCurrent->GetBundleVersion() <= 2)
|
||||
{
|
||||
auto serializeContext = const_cast<AZ::SerializeContext*>(callContext.m_context);
|
||||
|
||||
struct AssetBundleManifestV2
|
||||
{
|
||||
// Use the same ClassName and typeid as the AssetBundleManifest
|
||||
AZ_TYPE_INFO(AssetBundleManifest, azrtti_typeid<AssetBundleManifest>());
|
||||
AZStd::string m_catalogName;
|
||||
AZStd::vector<AZStd::string> m_dependentBundleNames;
|
||||
AZStd::vector<AZStd::string> m_levelDirs;
|
||||
int m_bundleVersion{};
|
||||
};
|
||||
auto ReflectAssetBundleManifestV2 = [](AZ::SerializeContext* serializeContext)
|
||||
{
|
||||
serializeContext->Class<AssetBundleManifestV2>()
|
||||
->Version(2)
|
||||
->Field("BundleVersion", &AssetBundleManifestV2::m_bundleVersion)
|
||||
->Field("CatalogName", &AssetBundleManifestV2::m_catalogName)
|
||||
->Field("DependentBundleNames", &AssetBundleManifestV2::m_dependentBundleNames)
|
||||
->Field("LevelNames", &AssetBundleManifestV2::m_levelDirs);
|
||||
};
|
||||
|
||||
// Unreflect the AssetBundleManifest class at the version since it shares the same typeid
|
||||
// as the older version and Reflect the V2 AssetBundlerManifest
|
||||
serializeContext->EnableRemoveReflection();
|
||||
AssetBundleManifest::ReflectSerialize(serializeContext);
|
||||
serializeContext->DisableRemoveReflection();
|
||||
ReflectAssetBundleManifestV2(serializeContext);
|
||||
|
||||
// Use the Current AssetBundleManifest instance to make a Version 2 AssetBundleManifest
|
||||
AssetBundleManifestV2 assetBundleManifestV2;
|
||||
assetBundleManifestV2.m_catalogName = assetBundleManifestCurrent->GetCatalogName();
|
||||
assetBundleManifestV2.m_dependentBundleNames = assetBundleManifestCurrent->GetDependentBundleNames();
|
||||
assetBundleManifestV2.m_bundleVersion = assetBundleManifestCurrent->GetBundleVersion();
|
||||
for (const AZ::IO::Path& levelDir : assetBundleManifestCurrent->GetLevelDirectories())
|
||||
{
|
||||
assetBundleManifestV2.m_levelDirs.emplace_back(levelDir.Native());
|
||||
}
|
||||
|
||||
const AZ::TypeId& assetBundlerManifestTypeId = azrtti_typeid<AssetBundleManifestV2>();
|
||||
const auto assetBundleManifestV2ClassData = serializeContext->FindClassData(assetBundlerManifestTypeId);
|
||||
|
||||
// Create an AssetBundleManifest Version 2 Class Eleemnt
|
||||
// It will copy over the name and nameCrc values of the current AssetBundleManifestelemnt
|
||||
auto CreateAssetBundleManifestV2ClassElement = [&assetBundlerManifestTypeId](
|
||||
const AZ::SerializeContext::ClassElement* currentVersionElement) -> AZ::SerializeContext::ClassElement
|
||||
{
|
||||
AZ::SerializeContext::ClassElement v2ClassElement;
|
||||
// Copy over the name of he current
|
||||
if (currentVersionElement)
|
||||
{
|
||||
v2ClassElement.m_name = currentVersionElement->m_name;
|
||||
v2ClassElement.m_nameCrc = currentVersionElement->m_nameCrc;
|
||||
}
|
||||
v2ClassElement.m_dataSize = sizeof(AssetBundleManifest);
|
||||
v2ClassElement.m_azRtti = AZ::GetRttiHelper<AssetBundleManifestV2>();
|
||||
v2ClassElement.m_genericClassInfo = nullptr;
|
||||
v2ClassElement.m_typeId = assetBundlerManifestTypeId;
|
||||
v2ClassElement.m_editData = nullptr;
|
||||
v2ClassElement.m_attributeOwnership = AZ::SerializeContext::ClassElement::AttributeOwnership::Self;
|
||||
return v2ClassElement;
|
||||
};
|
||||
const auto assetBundleManifestV2ClassElement = CreateAssetBundleManifestV2ClassElement(assetBundleManifestClassElement);
|
||||
|
||||
serializeContext->EnumerateInstanceConst(&callContext, &assetBundleManifestV2, assetBundlerManifestTypeId,
|
||||
assetBundleManifestV2ClassData, assetBundleManifestClassElement ? &assetBundleManifestV2ClassElement : nullptr);
|
||||
|
||||
// Unreflect the V2 AssetBundleManifest and Re-reflect the AssetBundleManifest class at the current version
|
||||
serializeContext->EnableRemoveReflection();
|
||||
ReflectAssetBundleManifestV2(serializeContext);
|
||||
serializeContext->DisableRemoveReflection();
|
||||
AssetBundleManifest::ReflectSerialize(serializeContext);
|
||||
}
|
||||
}
|
||||
|
||||
const AZStd::vector<AZ::IO::Path>& AssetBundleManifest::GetLevelDirectories() const
|
||||
{
|
||||
return m_levelDirs;
|
||||
}
|
||||
void AssetBundleManifest::SetLevelsDirectory(const AZStd::vector<AZ::IO::Path>& levelDirs)
|
||||
{
|
||||
m_levelDirs = levelDirs;
|
||||
}
|
||||
} // namespace AzFramework
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/IO/Path/Path_fwd.h>
|
||||
#include <AzCore/RTTI/TypeInfo.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
@@ -27,7 +28,8 @@ namespace AzFramework
|
||||
AZ_TYPE_INFO(AssetBundleManifest, "{8628A669-7B19-4C48-A7CB-F670CC9586FD}");
|
||||
AZ_CLASS_ALLOCATOR(AssetBundleManifest, AZ::SystemAllocator, 0);
|
||||
|
||||
AssetBundleManifest() = default;
|
||||
AssetBundleManifest();
|
||||
~AssetBundleManifest();
|
||||
|
||||
static void ReflectSerialize(AZ::SerializeContext* serializeContext);
|
||||
|
||||
@@ -35,21 +37,21 @@ namespace AzFramework
|
||||
// of files within the AssetBundle in order to update the Asset Registry at runtime when
|
||||
// loading the bundle
|
||||
const AZStd::string& GetCatalogName() const { return m_catalogName; }
|
||||
AZStd::vector<AZStd::string> GetDependentBundleNames() const { return m_depedendentBundleNames; }
|
||||
AZStd::vector<AZStd::string> GetLevelDirectories() const { return m_levelDirs; }
|
||||
AZStd::vector<AZStd::string> GetDependentBundleNames() const { return m_dependentBundleNames; }
|
||||
const AZStd::vector<AZ::IO::Path>& GetLevelDirectories() const;
|
||||
int GetBundleVersion() const { return m_bundleVersion; }
|
||||
void SetCatalogName(const AZStd::string& catalogName) { m_catalogName = catalogName; }
|
||||
void SetBundleVersion(int bundleVersion) { m_bundleVersion = bundleVersion; }
|
||||
void SetDependentBundleNames(const AZStd::vector<AZStd::string>& dependentBundleNames) { m_depedendentBundleNames = dependentBundleNames; }
|
||||
void SetLevelsDirectory(const AZStd::vector<AZStd::string>& levelDirs) { m_levelDirs = levelDirs; }
|
||||
void SetDependentBundleNames(const AZStd::vector<AZStd::string>& dependentBundleNames) { m_dependentBundleNames = dependentBundleNames; }
|
||||
void SetLevelsDirectory(const AZStd::vector<AZ::IO::Path>& levelDirs);
|
||||
|
||||
static const char s_manifestFileName[];
|
||||
static const int CurrentBundleVersion;
|
||||
|
||||
private:
|
||||
private:
|
||||
AZStd::string m_catalogName;
|
||||
AZStd::vector<AZStd::string> m_depedendentBundleNames;
|
||||
AZStd::vector<AZStd::string> m_levelDirs;
|
||||
AZStd::vector<AZStd::string> m_dependentBundleNames;
|
||||
AZStd::vector<AZ::IO::Path> m_levelDirs;
|
||||
int m_bundleVersion = CurrentBundleVersion;
|
||||
};
|
||||
|
||||
|
||||
@@ -1186,7 +1186,7 @@ namespace AzFramework
|
||||
}
|
||||
|
||||
|
||||
bool AssetCatalog::CreateBundleManifest(const AZStd::string& deltaCatalogPath, const AZStd::vector<AZStd::string>& dependentBundleNames, const AZStd::string& fileDirectory, int bundleVersion, const AZStd::vector<AZStd::string>& levelDirs)
|
||||
bool AssetCatalog::CreateBundleManifest(const AZStd::string& deltaCatalogPath, const AZStd::vector<AZStd::string>& dependentBundleNames, const AZStd::string& fileDirectory, int bundleVersion, const AZStd::vector<AZ::IO::Path>& levelDirs)
|
||||
{
|
||||
if (bundleVersion > AzFramework::AssetBundleManifest::CurrentBundleVersion || bundleVersion < 0)
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace AzFramework
|
||||
bool InsertDeltaCatalogBefore(AZStd::shared_ptr<AzFramework::AssetRegistry> deltaCatalog, AZStd::shared_ptr<AzFramework::AssetRegistry> afterDeltaCatalog) override;
|
||||
bool RemoveDeltaCatalog(AZStd::shared_ptr<AzFramework::AssetRegistry> deltaCatalog) override;
|
||||
static bool SaveAssetBundleManifest(const char* assetBundleManifestFile, AzFramework::AssetBundleManifest* bundleManifest);
|
||||
bool CreateBundleManifest(const AZStd::string& deltaCatalogPath, const AZStd::vector<AZStd::string>& dependentBundleNames, const AZStd::string& fileDirectory, int bundleVersion, const AZStd::vector<AZStd::string>& levelDirs) override;
|
||||
bool CreateBundleManifest(const AZStd::string& deltaCatalogPath, const AZStd::vector<AZStd::string>& dependentBundleNames, const AZStd::string& fileDirectory, int bundleVersion, const AZStd::vector<AZ::IO::Path>& levelDirs) override;
|
||||
bool CreateDeltaCatalog(const AZStd::vector<AZStd::string>& files, const AZStd::string& filePath) override;
|
||||
void AddExtension(const char* extension) override;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ set(FILES
|
||||
Archive/ArchiveFindData.cpp
|
||||
Archive/ArchiveFindData.h
|
||||
Archive/ArchiveVars.h
|
||||
Archive/ArchiveVars.cpp
|
||||
Archive/Codec.h
|
||||
Archive/IArchive.h
|
||||
Archive/INestedArchive.h
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME})
|
||||
ly_get_list_relative_pal_filename(common_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/Common)
|
||||
|
||||
@@ -33,6 +32,14 @@ ly_add_target(
|
||||
3rdParty::lz4
|
||||
)
|
||||
|
||||
set(LY_SEARCH_MODE_DEFINE $<$<NOT:$<STREQUAL:"${LY_ARCHIVE_FILE_SEARCH_MODE}","">>:LY_ARCHIVE_FILE_SEARCH_MODE_DEFAULT=${LY_ARCHIVE_FILE_SEARCH_MODE}>)
|
||||
|
||||
ly_add_source_properties(
|
||||
SOURCES
|
||||
AzFramework/Archive/ArchiveVars.cpp
|
||||
PROPERTY COMPILE_DEFINITIONS
|
||||
VALUES ${LY_SEARCH_MODE_DEFINE})
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
|
||||
|
||||
ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Tests/Platform/${PAL_PLATFORM_NAME})
|
||||
|
||||
@@ -273,7 +273,7 @@ namespace UnitTest
|
||||
// Also enable extra verbosity in the AZ::IO::Archive code
|
||||
CVarIntValueScope previousLocationPriority{ *console, "sys_pakPriority" };
|
||||
CVarIntValueScope oldArchiveVerbosity{ *console, "az_archive_verbosity" };
|
||||
console->PerformCommand("sys_PakPriority", { AZ::CVarFixedString::format("%d", aznumeric_cast<int>(AZ::IO::ArchiveLocationPriority::ePakPriorityPakOnly)) });
|
||||
console->PerformCommand("sys_PakPriority", { AZ::CVarFixedString::format("%d", aznumeric_cast<int>(AZ::IO::FileSearchPriority::PakOnly)) });
|
||||
console->PerformCommand("az_archive_verbosity", { "1" });
|
||||
|
||||
// ---- Archive FGetCachedFileDataTests (these leverage Archive CachedFile mechanism for caching data ---
|
||||
@@ -459,7 +459,7 @@ namespace UnitTest
|
||||
|
||||
// Once the archive has been deleted it should no longer be searched
|
||||
CVarIntValueScope previousLocationPriority{ *console, "sys_pakPriority" };
|
||||
console->PerformCommand("sys_PakPriority", { AZ::CVarFixedString::format("%d", aznumeric_cast<int>(AZ::IO::ArchiveLocationPriority::ePakPriorityPakOnly)) });
|
||||
console->PerformCommand("sys_PakPriority", { AZ::CVarFixedString::format("%d", aznumeric_cast<int>(AZ::IO::FileSearchPriority::PakOnly)) });
|
||||
|
||||
handle = archive->FindFirst("levels\\*");
|
||||
EXPECT_FALSE(static_cast<bool>(handle));
|
||||
@@ -785,7 +785,7 @@ namespace UnitTest
|
||||
|
||||
EXPECT_TRUE(archive->OpenPack("@usercache@", realNameBuf));
|
||||
EXPECT_TRUE(archive->IsFileExist("@usercache@/foundit.dat"));
|
||||
EXPECT_FALSE(archive->IsFileExist("@usercache@/foundit.dat", AZ::IO::IArchive::eFileLocation_OnDisk));
|
||||
EXPECT_FALSE(archive->IsFileExist("@usercache@/foundit.dat", AZ::IO::FileSearchLocation::OnDisk));
|
||||
EXPECT_FALSE(archive->IsFileExist("@usercache@/notfoundit.dat"));
|
||||
EXPECT_TRUE(archive->ClosePack(realNameBuf));
|
||||
|
||||
@@ -793,7 +793,7 @@ namespace UnitTest
|
||||
EXPECT_TRUE(archive->OpenPack("@products@", realNameBuf));
|
||||
EXPECT_TRUE(archive->IsFileExist("@products@/foundit.dat"));
|
||||
EXPECT_FALSE(archive->IsFileExist("@usercache@/foundit.dat")); // do not find it in the previous location!
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/foundit.dat", AZ::IO::IArchive::eFileLocation_OnDisk));
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/foundit.dat", AZ::IO::FileSearchLocation::OnDisk));
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/notfoundit.dat"));
|
||||
EXPECT_TRUE(archive->ClosePack(realNameBuf));
|
||||
|
||||
@@ -802,8 +802,8 @@ namespace UnitTest
|
||||
EXPECT_TRUE(archive->IsFileExist("@products@/mystuff/foundit.dat"));
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/foundit.dat")); // do not find it in the previous locations!
|
||||
EXPECT_FALSE(archive->IsFileExist("@usercache@/foundit.dat")); // do not find it in the previous locations!
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/foundit.dat", AZ::IO::IArchive::eFileLocation_OnDisk));
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/mystuff/foundit.dat", AZ::IO::IArchive::eFileLocation_OnDisk));
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/foundit.dat", AZ::IO::FileSearchLocation::OnDisk));
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/mystuff/foundit.dat", AZ::IO::FileSearchLocation::OnDisk));
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/notfoundit.dat")); // non-existent file
|
||||
EXPECT_FALSE(archive->IsFileExist("@products@/mystuff/notfoundit.dat")); // non-existent file
|
||||
EXPECT_TRUE(archive->ClosePack(realNameBuf));
|
||||
|
||||
Reference in New Issue
Block a user