From 168a71db9aa830687c5e985a4718d2fae80e29c1 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期一, 27 八月 2018 17:19:41 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts

---
 System/AssetVersion/AssetVersion.cs |   52 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/System/AssetVersion/AssetVersion.cs b/System/AssetVersion/AssetVersion.cs
index ee94969..11a12b9 100644
--- a/System/AssetVersion/AssetVersion.cs
+++ b/System/AssetVersion/AssetVersion.cs
@@ -93,36 +93,46 @@
         }
     }
 
-    public bool CheckLocalFileValid()
+    public bool CheckLocalFileValid(bool _completeFile)
     {
-        if (extersion == ".manifest" || extersion == ".bytes" || extersion == ".txt" || extersion == ".dll")
+        if (_completeFile)
         {
             var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
             var fileInfo = new FileInfo(path);
 
-            if (!fileInfo.Exists || fileInfo.Length != size || md5 != FileExtersion.GetMD5HashFromFile(path))
-            {
-                return false;
-            }
-        }
-        else if (string.IsNullOrEmpty(extersion) || extersion.Length == 0)
-        {
-            var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
-            var fileInfo = new FileInfo(path);
-
-            var manifestAssetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact(m_RelativePath, ".manifest"));
-            if (!fileInfo.Exists || fileInfo.Length != size || manifestAssetVersion == null || !manifestAssetVersion.CheckLocalFileValid())
-            {
-                return false;
-            }
+            return fileInfo.Exists && fileInfo.Length == size && md5 == FileExtersion.GetMD5HashFromFile(path);
         }
         else
         {
-            var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
-            var fileInfo = new FileInfo(path);
-            if (!fileInfo.Exists || fileInfo.Length != size)
+            if (extersion == ".manifest" || extersion == ".bytes" || extersion == ".txt" || extersion == ".dll")
             {
-                return false;
+                var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
+                var fileInfo = new FileInfo(path);
+
+                if (!fileInfo.Exists || fileInfo.Length != size || md5 != FileExtersion.GetMD5HashFromFile(path))
+                {
+                    return false;
+                }
+            }
+            else if (string.IsNullOrEmpty(extersion) || extersion.Length == 0)
+            {
+                var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
+                var fileInfo = new FileInfo(path);
+
+                var manifestAssetVersion = AssetVersionUtility.GetAssetVersion(StringUtility.Contact(m_RelativePath, ".manifest"));
+                if (!fileInfo.Exists || fileInfo.Length != size || manifestAssetVersion == null || !manifestAssetVersion.CheckLocalFileValid(false))
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                var path = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, m_RelativePath);
+                var fileInfo = new FileInfo(path);
+                if (!fileInfo.Exists || fileInfo.Length != size)
+                {
+                    return false;
+                }
             }
         }
 

--
Gitblit v1.8.0