Update runtime

This commit is contained in:
hevinci
2022-08-03 20:51:06 +08:00
parent 195d1805e9
commit 7e6c678e91
14 changed files with 80 additions and 74 deletions
@@ -119,8 +119,8 @@ namespace YooAsset
DecryptionFileInfo fileInfo = new DecryptionFileInfo();
fileInfo.BundleName = MainBundleInfo.BundleName;
fileInfo.BundleHash = MainBundleInfo.Hash;
fileInfo.BundleCRC = MainBundleInfo.CRC;
fileInfo.FileHash = MainBundleInfo.FileHash;
fileInfo.FileCRC = MainBundleInfo.FileCRC;
ulong offset = AssetSystem.DecryptionServices.GetFileOffset(fileInfo);
if (_isWaitForAsyncComplete)
CacheBundle = AssetBundle.LoadFromFile(_fileLoadPath, 0, offset);
@@ -169,7 +169,7 @@ namespace YooAsset
if (MainBundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromCache)
{
string cacheLoadPath = MainBundleInfo.GetCacheLoadPath();
if (DownloadSystem.CheckContentIntegrity(EVerifyLevel.High, cacheLoadPath, MainBundleInfo.SizeBytes, MainBundleInfo.CRC) == false)
if (DownloadSystem.CheckContentIntegrity(EVerifyLevel.High, cacheLoadPath, MainBundleInfo.FileSize, MainBundleInfo.FileCRC) == false)
{
if (File.Exists(cacheLoadPath))
{
@@ -61,7 +61,7 @@ namespace YooAsset
// 1. 从服务器或缓存中获取AssetBundle文件
if (_steps == ESteps.LoadFile)
{
_webRequest = UnityWebRequestAssetBundle.GetAssetBundle(_webURL, Hash128.Parse(MainBundleInfo.Hash));
_webRequest = UnityWebRequestAssetBundle.GetAssetBundle(_webURL, Hash128.Parse(MainBundleInfo.FileHash));
_webRequest.SendWebRequest();
_steps = ESteps.CheckFile;
}
@@ -203,7 +203,7 @@ namespace YooAsset
}
else if (_bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromStreaming)
{
if (DownloadSystem.ContainsVerifyFile(_bundleInfo.Hash))
if (DownloadSystem.ContainsVerifyFile(_bundleInfo.FileHash))
_steps = ESteps.CheckAndCopyFile;
else
_steps = ESteps.DownloadFromApk;
@@ -238,9 +238,9 @@ namespace YooAsset
}
else
{
if (DownloadSystem.CheckContentIntegrity(GetCachePath(), _bundleInfo.SizeBytes, _bundleInfo.CRC))
if (DownloadSystem.CheckContentIntegrity(GetCachePath(), _bundleInfo.FileSize, _bundleInfo.FileCRC))
{
DownloadSystem.CacheVerifyFile(_bundleInfo.Hash, _bundleInfo.FileName);
DownloadSystem.CacheVerifyFile(_bundleInfo.FileHash, _bundleInfo.FileName);
_steps = ESteps.CheckAndCopyFile;
}
else
@@ -267,7 +267,7 @@ namespace YooAsset
// 如果原生文件已经存在,则验证其完整性
if (File.Exists(CopyPath))
{
bool result = DownloadSystem.CheckContentIntegrity(CopyPath, _bundleInfo.SizeBytes, _bundleInfo.CRC);
bool result = DownloadSystem.CheckContentIntegrity(CopyPath, _bundleInfo.FileSize, _bundleInfo.FileCRC);
if (result)
{
_steps = ESteps.Done;
@@ -355,7 +355,7 @@ namespace YooAsset
}
else if (_bundleInfo.LoadMode == BundleInfo.ELoadMode.LoadFromStreaming)
{
if (DownloadSystem.ContainsVerifyFile(_bundleInfo.Hash))
if (DownloadSystem.ContainsVerifyFile(_bundleInfo.FileHash))
_steps = ESteps.CheckAndCopyFile;
else
_steps = ESteps.DownloadFromApk;
@@ -421,9 +421,9 @@ namespace YooAsset
}
else
{
if (DownloadSystem.CheckContentIntegrity(GetCachePath(), _bundleInfo.SizeBytes, _bundleInfo.CRC))
if (DownloadSystem.CheckContentIntegrity(GetCachePath(), _bundleInfo.FileSize, _bundleInfo.FileCRC))
{
DownloadSystem.CacheVerifyFile(_bundleInfo.Hash, _bundleInfo.FileName);
DownloadSystem.CacheVerifyFile(_bundleInfo.FileHash, _bundleInfo.FileName);
_steps = ESteps.CheckAndCopyFile;
}
else
@@ -450,7 +450,7 @@ namespace YooAsset
// 如果原生文件已经存在,则验证其完整性
if (File.Exists(CopyPath))
{
bool result = DownloadSystem.CheckContentIntegrity(CopyPath, _bundleInfo.SizeBytes, _bundleInfo.CRC);
bool result = DownloadSystem.CheckContentIntegrity(CopyPath, _bundleInfo.FileSize, _bundleInfo.FileCRC);
if (result)
{
_steps = ESteps.Done;