Пример #1
0
        /// <summary>
        /// 开始更新
        /// </summary>
        public override void OnStart(JsonData _data)
        {
//#if UNITY_EDITOR
//            base.OnEnd();
//            return;
//#endif
            huUrl = RunningTimeData.GetRunningData(CommonKey.URL_HOTUPDATE);
            if (string.IsNullOrEmpty(huUrl))
            {
                Utility.LogError("没有有效的热更地址,将直接结束热更");
                OnEnd();
                return;
            }
            huUrl += "/";

            TimeModule.instance.RunIEnumerator(DownloadTotalFile());
        }
Пример #2
0
        private void ComponentDataGetBundleIdentify()
        {
            //版本
            string _v = RunningTimeData.GetRunningData(CommonKey.VERSION_LOCAL, "0.0.0.0");

            version = new Version(_v);
            string _bu = DateTime.Now.ToString("MMdd");

            buidle = int.Parse(_bu);
            if (buidle > version.Build)
            {
                buidle = 0;
                PersistenceData.SavePrefsData("LOCAL_VERSION_BUIDLE", buidle);
            }

            buidle = PersistenceData.GetPrefsDataInt("LOCAL_VERSION_BUIDLE", 0);
        }
Пример #3
0
        private static void GetUserSetting()
        {
            wholeModule = PersistenceData.GetPrefsDataBool("ASSET_PACKAGER_WHOLE_MODULE");

            string _v = RunningTimeData.GetRunningData(CommonKey.VERSION_LOCAL, "2.0.0.0");

            version = new Version(_v);
            string _bu = DateTime.Now.ToString("MMdd");

            buidle = int.Parse(_bu);
            if (buidle > version.Build)
            {
                buidle = 0;
                PersistenceData.SavePrefsData("LOCAL_VERSION_BUIDLE", buidle);
            }

            buidle = PersistenceData.GetPrefsDataInt("LOCAL_VERSION_BUIDLE", 0);
        }
        public override void OnStart(JsonData _data)
        {
            huUrl = RunningTimeData.GetRunningData(CommonKey.URL_HOTUPDATE);
            string _filesjson = _data["files"].Value;

            string[] _files = JsonMapper.ToObject <string[]>(_filesjson);
            if (_data["emergent"].BoolValue)
            {
                List <string> _temp = new List <string>();
                _temp.AddRange(_files);
                _temp.AddRange(needDown);
                needDown = _temp;
            }
            else
            {
                needDown.AddRange(_files);
            }

            TimeModule.instance.RunIEnumerator(OnDownloadFileList());
        }
Пример #5
0
        /// <summary>
        /// 检查更新版本
        /// </summary>
        private void CheckVersion()
        {
            //本地版本和服务器版本
            string _serverVersion = serverConfigs[CommonKey.VERSION_SERVER];
            string _localVersion  = RunningTimeData.GetRunningData(CommonKey.VERSION_LOCAL, "0.0.0.0");

            System.Version _sv = new System.Version(_serverVersion);
            System.Version _lv = new System.Version(_localVersion);

            //大版本变更,需要更新整包
            if (_sv.Major > _lv.Major || _sv.Minor > _lv.Minor)
            {
                //给出提示,引导跳转
                MessageModule.instance.Recevive(string.Empty, MessageType.OnHotupdateFailed, "2");
            }
            //小版本变更或者无版本变更,检查热更,保证文件正确性,避免被修改
            else
            {
                TimeModule.instance.RunIEnumerator(OnDownloadVersionFile());
            }
        }
Пример #6
0
        private void GetUserSetting()
        {
            ComponentDataGetServer();
            ComponentDataGetBundleIdentify();

            //基础模块(针对业务逻辑)
            string _baseJson = RunningTimeData.GetRunningData("JSON_BASE_MODULE", string.Empty);

            if (!string.IsNullOrEmpty(_baseJson))
            {
                baseModule = JsonMapper.ToObject <List <string> >(_baseJson);
            }

            //平台
            bt = (MBuidleTarget)PersistenceData.GetPrefsDataInt("BUNDLE_PLANTFORM", 0);
            //是否debug版本
            isDebug = PersistenceData.GetPrefsDataBool("BUNDLE_ISDEBUG", true);
            //全包含资源
            isFull = PersistenceData.GetPrefsDataBool("BUNDLE_ISFULL", false);
            //分离体
            buildDepartPackage = PersistenceData.GetPrefsDataBool("BUNDLE_ISDEPART", false);
            //不打新资源(不存在依然会打包资源)
            oldRes = PersistenceData.GetPrefsDataBool("BUNDLE_ISOLDRES", false);
        }