Beispiel #1
0
        /// <summary>
        /// 重新检查程序版本号
        /// </summary>
        public static void RecheckAppVersion(Action <int> checkComplated)
        {
            string localVersion = FileUtility.ReadFileText(VERSION_FILENAME, PathType.Local);
            Action <string, AsyncCompletedEventArgs> complated = (fileName, e) =>
            {
                if (fileName != VERSION_FILENAME)
                {
                    return;
                }

                string remoteVersion = localVersion;
                if (e.Error != null)
                {
                    Debug.LogErrorFormat("load remote version error:[{0}]", e.Error.Message);
                    remoteVersion = localVersion;
                }
                else if (!e.Cancelled)
                {
                    remoteVersion = FileUtility.ReadFileText(VERSION_FILENAME, PathType.Cache);
                }
                if (checkComplated != null)
                {
                    checkComplated(CheckVersion(remoteVersion, localVersion));
                }
            };

            WebClientDownloader.AppendDownloadFile(VERSION_FILENAME, complated, null);
        }
Beispiel #2
0
 void StartDownLoadRemoteUpdatedAssets()
 {
     m_NeedUpdateFileRecords = FilterNeedUpdateFileRecodes(m_RemoteFileRecords, m_LocalFileRecords);
     if (m_NeedUpdateFileRecords.Count > 0)
     {
         m_NeedDownCount = m_NeedUpdateFileRecords.Count;
         for (int i = m_NeedUpdateFileRecords.Count - 1; i >= 0; i--)
         {
             FileRecord record = m_NeedUpdateFileRecords[i];
             WebClientDownloader.AppendDownloadFile(record.FileName, DownloadAssetFile_Complated, null);
         }
         IsLoadedNewAsset = true;
     }
     else
     {
         // 拷贝远程版本号到本地
         FileUtility.CopyFileByPathType(VERSION_FILENAME, PathType.Cache, PathType.Local);
         HotfixUpdaterSwitchToState(HotFixUpdaterState.ValidateLocalData);
     }
 }
Beispiel #3
0
 /// <summary>
 /// 开始加载远程的列表文件
 /// </summary>
 void StartLoadRemoteRecordFile()
 {
     WebClientDownloader.AppendDownloadFile(FILERECORD_FILENAME, DownLoadFileRecords_Complated, null);
 }
Beispiel #4
0
 public void StartLoadRemoteVersionFile()
 {
     WebClientDownloader.AppendDownloadFile(VERSION_FILENAME, DownLoadVersionFile_Complated, null);
 }