Пример #1
0
        private static void SetUserSetting()
        {
            PersistenceData.SavePrefsData("ASSET_PACKAGER_WHOLE_MODULE", wholeModule);

            RunningTimeData.SetRunningData(CommonKey.VERSION_LOCAL, version.ToString());
            RunningTimeData.Record();
        }
Пример #2
0
        protected override void OnEnd()
        {
            //更新本地版本号
            string _serverVersion = serverConfigs[CommonKey.VERSION_SERVER];

            RunningTimeData.SetRunningData(CommonKey.VERSION_LOCAL, _serverVersion);
            RunningTimeData.Record();
            base.OnEnd();
        }
Пример #3
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());
        }
Пример #4
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);
        }
Пример #5
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());
        }
Пример #7
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());
            }
        }
Пример #8
0
        private void SetUserSetting()
        {
            ComponentDataSetServer();
            ComponentDataSetBundleIdentify();

            //基础模块(针对业务逻辑)
            string _baseJson = JsonMapper.ToJson(baseModule);

            RunningTimeData.SetRunningData("JSON_BASE_MODULE", _baseJson);

            //平台
            PersistenceData.SavePrefsData("BUNDLE_PLANTFORM", (int)bt);
            //是否debug版本
            PersistenceData.SavePrefsData("BUNDLE_ISDEBUG", isDebug);
            //全包含资源
            PersistenceData.SavePrefsData("BUNDLE_ISFULL", isFull);
            //分离体
            PersistenceData.SavePrefsData("BUNDLE_ISDEPART", buildDepartPackage);
            //不打新资源(不存在依然会打包资源)
            PersistenceData.SavePrefsData("BUNDLE_ISOLDRES", oldRes);
        }
Пример #9
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);
        }
Пример #10
0
        private void Propertys()
        {
            ComponentOnGUIBundleIdentify();
            ComponentOnGUIServer();

            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.LabelField("平台: ", GUILayout.Width(40));
                bt = (MBuidleTarget)EditorGUILayout.EnumPopup(bt, GUILayout.Width(300));
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            buildDepartPackage = EditorGUILayout.Toggle("Android分离体", buildDepartPackage);
            isDebug            = EditorGUILayout.Toggle("测试包", isDebug);
            oldRes             = EditorGUILayout.Toggle("不打新资源", oldRes);
            if (!isDebug)
            {
                isFull = EditorGUILayout.Toggle("包含全资源", isFull);
            }
            if (!isDebug && !isFull)
            {
                EditorGUILayout.LabelField("需要打入的基础模块名称(无关大小写)");
                for (int i = 0; i < baseModule.Count; i++)
                {
                    baseModule[i] = baseModule[i].ToLower();
                    EditorGUILayout.BeginHorizontal();
                    {
                        EditorGUILayout.LabelField(baseModule[i], GUILayout.Width(300));
                        if (GUILayout.Button("删除", GUILayout.Width(60)))
                        {
                            baseModule.RemoveAt(i);
                            i--;
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUILayout.Space();

                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.LabelField("添加一个新的基础模块:", GUILayout.Width(150));
                    tempBaseModule = EditorGUILayout.TextField(tempBaseModule, GUILayout.Width(200));
                    if (GUILayout.Button("添加", GUILayout.Width(50)))
                    {
                        baseModule.Add(tempBaseModule);
                        tempBaseModule = string.Empty;
                    }
                }
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.Space();
            }

            EditorGUILayout.Space();

            if (GUILayout.Button("打包", GUILayout.Width(300)))
            {
                ComponentOnBuildBundleIdentify();
                ComponentOnBuildWorkServer();
                RunningTimeData.Record();
                StartBuild();
            }
        }
 private void ComponentOnBuildWorkServer()
 {
     RunningTimeData.SetRunningData("DEFAULT_SERVER", gameServers[chooseServerCount]);
     RunningTimeData.SetRunningData("URL_HOTUPDATE", hotServers[chooseServerCount]);
     RunningTimeData.Record();
 }
 private void ComponentDataSetServer()
 {
     RunningTimeData.SetRunningData("SWITCH_USE_HOTUPDATE", useHotupdate.ToString());
 }
 private void ComponentDataGetServer()
 {
     useHotupdate = RunningTimeData.GetRunningDataBool("SWITCH_USE_HOTUPDATE", true);
 }
Пример #14
0
 private void ComponentDataSetBundleIdentify()
 {
     //版本
     RunningTimeData.SetRunningData(CommonKey.VERSION_LOCAL, version.ToString());
 }