I use 4.19 to load pak file packed by 4.13,Is there something wrong? The error is:
LogPakFile: Error: Attempted seek using thread-specific pak file reader on the wrong thread. Reader for thread 12481 used by thread 10592.
LogPakFile: Error: Attempted serialize using thread-specific pak file reader on the wrong thread. Reader for thread 12481 used by thread 10592.
m_PPakPlatform = new FPakPlatformFile;
m_PInnerPlatform = &FPlatformFileManager::Get().GetPlatformFile();
m_PPakPlatform->Initialize(m_PInnerPlatform, TEXT(""));
m_PPakPlatform->InitializeNewAsyncIO();
FPlatformFileManager::Get().SetPlatformFile(*m_PPakPlatform);
FString pakFilePath = FPaths::GameContentDir() + TEXT("Models/uncooked/4f921108d13911e4879a00163e021ee1.pak");
FPakFile PakFile(m_PPakPlatform, *pakFilePath, false);
if (!PakFile.IsValid()) {
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red,
"Invalid pak file: " + pakFilePath);
return;
}
FString MountingPath = FPaths::GameContentDir() + TEXT("4f921108d13911e4879a00163e021ee1") + "/";
FPaths::MakeStandardFilename(MountingPath);
PakFile.SetMountPoint(*MountingPath);
if (!m_PPakPlatform->Mount(*pakFilePath, 0,
*MountingPath)) {
GEngine->AddOnScreenDebugMessage(
-1, 5.f, FColor::Red, "Failed to mount pak file: " + pakFilePath);
return;
}
TSet<FString> fileList;
PakFile.FindFilesAtPath(fileList, *PakFile.GetMountPoint(), true, false,
true);
UE_LOG(LogTemp, Warning, TEXT("------------------"));
for (FString File : fileList.Array())
{
FString AssetPath;
if (File.EndsWith(FPackageName::GetAssetPackageExtension()) ||
File.EndsWith(FPackageName::GetMapPackageExtension())) {
FString assetShortName = FPackageName::GetShortName(File);
assetShortName.RemoveFromEnd(FPackageName::GetAssetPackageExtension());
AssetPath = FString(TEXT("/Game/")) + TEXT("4f921108d13911e4879a00163e021ee1") + TEXT("/") + assetShortName + TEXT(".") +
assetShortName;
}
UObject* Object = LoadObject<UObject>(nullptr, *AssetPath);
if (Object)
{
UE_LOG(LogTemp, Warning, TEXT("Object:%s"), *Object->GetName());
}
}