| 
					
				 | 
			
			
				@@ -2,8 +2,6 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using VEngine; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System.Collections; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using UnityEngine; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System.Reflection; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-using System; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 namespace GFGGame 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -20,8 +18,8 @@ namespace GFGGame 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public IEnumerator InitVersion() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LauncherView.Instance.SetDesc("正在校验资源版本..."); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             EncryptHelper.resKey = LauncherConfig.resKey; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LogServerHelperHttp.SendNodeLog((int)LogNode.StartCheckVersion); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Versions.DownloadURL = LauncherConfig.CDN_ROOT; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var operation = Versions.InitializeAsync(LauncherConfig.CDN_ROOT); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             yield return operation; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -32,24 +30,10 @@ namespace GFGGame 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //VEngine.Logger.I("PlayerDataPath: {0}", Versions.PlayerDataPath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //VEngine.Logger.I("DownloadDataPath: {0}", Versions.DownloadDataPath); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //VEngine.Logger.I("DownloadURL: {0}", Versions.DownloadURL); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            StartUpdateManifest(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            StartCheckManifestVersion(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private void CheckApkVersion() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            var versionTarget = Versions.Manifest.appVersion; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            var version = Application.version; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(VersionUtil.compare(version, versionTarget)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                DownloadApk(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                DownloadRes(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private void StartUpdateManifest() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        private void StartCheckManifestVersion() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             StartCoroutine(CheckManifestVersion()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -58,6 +42,7 @@ namespace GFGGame 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (!Versions.OfflineMode) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                LogServerHelperHttp.SendNodeLog((int)LogNode.StartCheckVersion); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 // TODO:生产环境这里的清单名字应该使用带 hash 的版本 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 updateVersions = Versions.UpdateAsync(nameof(Manifest)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 while(!updateVersions.isDone) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -66,41 +51,29 @@ namespace GFGGame 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                          
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         var max = updateVersions.asset.assetVersion.size; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        LauncherView.Instance.SetDesc($"获取版本文件...", $"{Utility.FormatBytes(max)}"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        LauncherView.Instance.SetDesc($"正在校验资源版本...", $"{Utility.FormatBytes(max)}"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         LauncherView.Instance.SetProgress((int)(updateVersions.asset.progress * 100)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     yield return updateVersions; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if (updateVersions.status == OperationStatus.Failed) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    yield return Alert.Show("更新版本信息失败,请检测网络链接后重试。") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        .SetLeftButton(true, "重试", (data) => { StartUpdateManifest(); }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    yield break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    Alert.Show("更新版本信息失败,请检测网络链接后重试。") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        .SetLeftButton(true, "重试", (data) => { StartCheckManifestVersion(); }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    yield return GetDownloadSize(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                CheckApkVersion(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                yield break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            OnComplete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private void DownloadApk() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Alert.Show("需要安装新的安装包,请联系研发获取。") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    .SetLeftButton(true, "知道了", (data) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        Application.Quit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        private void DownloadRes() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            StartCoroutine(GetDownloadSize()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                OnComplete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private IEnumerator GetDownloadSize() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            LogServerHelperHttp.SendNodeLog((int)LogNode.StartDownload); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Debug.Log("VersionController GetDownloadSize"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var getDownloadSize = Versions.GetDownloadSizeAsync(updateVersions); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             var totalCount = getDownloadSize.bundles.Count; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             while(!getDownloadSize.isDone) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -119,12 +92,15 @@ namespace GFGGame 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 yield break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            OnComplete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                OnComplete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private void StartDownload(GetDownloadSize getDownloadSize) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            LogServerHelperHttp.SendNodeLog((int)LogNode.StartDownload); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             StartCoroutine(Downloading(getDownloadSize)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -143,14 +119,15 @@ namespace GFGGame 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             yield return downloadAsync; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (downloadAsync.status == OperationStatus.Failed) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                yield return Alert.Show("下载失败!请检查网络状态后重试。") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Alert.Show("下载失败!请检查网络状态后重试。") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     .SetLeftButton(true, "重试", (data) => {  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         StartDownload(getDownloadSize);  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                yield break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            OnComplete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                OnComplete(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         private void OnComplete() 
			 |