If my .pak loader and my external .pak projects do not use IoStore. It works.
- When i active IOStore on the .exe of the pak loader, and i try to load external .pak without IoStore, i have this error:
After:
bIsMounted = PakFileMgr->Mount(*InputPath, PakOrder);
i have:
LogPakFile: Warning: IoStore container “…....\MyPakFiles\MyCars.utoc” not found
I think it’s normal.
- When i active IOStore on the .exe of the pak loader, and i try to load external .pak with IoStore, i have this error:
After:
bIsMounted = PakFileMgr->Mount(*InputPath, PakOrder);
i have:
LogIoDispatcher: Display: Reading toc: …....\MyPakFiles\MyCars.utoc
LogIoDispatcher: Display: Toc signature hash: 0000000000000000000000000000000000000000
LogIoDispatcher: Display: Mounting container ‘…....\MyPakFiles\MyCars.utoc’ in location slot 1
LogPakFile: Display: Mounted IoStore container “…....\MyPakFiles\MyCars.utoc”
LogPakFile: Display: Mounted Pak file ‘…....\MyPakFiles\MyCars.pak’, mount point: ‘/’
- If i use Loader and .pak without IoStore i have (which works):
After:
bIsMounted = PakFileMgr->Mount(*InputPath, PakOrder);
i have:
LogPakFile: Display: Mounted Pak file ‘…....\MyPakFiles\MyCars.pak’, mount point: ‘…/…/…/’
Mount point seems to be different. Do i have to change something in my code ?
Here is my code:
`bool MyBFL::MountPakFile(const FString& PakFilePath, const FString& PakMountPoint)
{
int32 PakOrder = 0;
bool bIsMounted = false;
FString InputPath = PakFilePath;
FPaths::MakePlatformFilename(InputPath);
FPakPlatformFile* PakFileMgr = (FPakPlatformFile*)(FPlatformFileManager::Get().FindPlatformFile(TEXT("PakFile")));
if (PakFileMgr == nullptr)
{
UE_LOG(LogTemp, Log, TEXT("Unable to get PakPlatformFile for pak file (mount): %s"), *(PakFilePath));
return false;
}
FKeyChain keyChain;
FString EncryptionKeyBase64 = "oIq0gO3Oy1YsMCc0kT1meGVFYeRA5vO9sbPQKhet+Zo="; // My encryption key
TArray<uint8> Key;
bool rsDecode = FBase64::Decode(EncryptionKeyBase64, Key);
check(Key.Num() == sizeof(FAES::FAESKey::Key));
FNamedAESKey NewKey;
NewKey.Name = TEXT("Default");
NewKey.Guid = FGuid();
FMemory::Memcpy(NewKey.Key.Key, &Key[0], sizeof(FAES::FAESKey::Key));
keyChain.GetEncryptionKeys().Add(NewKey.Guid, NewKey);
UE_LOG(LogTemp, Log, TEXT("key decode: %d NewKey.IsValid() = %d"), rsDecode ? 1 : 0, NewKey.IsValid() ? 1 : 0);
KeyChainUtilities::ApplyEncryptionKeys(keyChain);
UE_LOG(LogTemp, Log, TEXT("Try FPakPlatformFile::Mount()"));
bIsMounted = PakFileMgr->Mount(*InputPath, PakOrder);
UE_LOG(LogTemp, Log, TEXT("FPakPlatformFile::Mount() result: bIsMounted = %d"), bIsMounted ? 1 : 0);
return bIsMounted;
}`