Beispiel #1
0
        public static async ETTask StartCheckUpdate(this UIUpdateView self)
        {
            //TODO 网络检查
            await self.CheckIsInWhiteList();

            await self.CheckUpdateList();

            var Over = await self.CheckAppUpdate();

            if (Over)
            {
                return;
            }

            var isUpdateDone = await self.CheckResUpdate();

            if (isUpdateDone)
            {
                Log.Info("更新完成,准备进入游戏");
                self.UpdateFinishAndStartGame().Coroutine();
            }
            else
            {
                Log.Info("不需要更新,直接进入游戏");
                self.OnOver?.Invoke();
                await self.CloseSelf();
            }
        }
Beispiel #2
0
        async static ETTask CheckUpdateList(this UIUpdateView self)
        {
            var url = ServerConfigComponent.Instance.GetUpdateListCdnUrl();
            //UpdateConfig aa = new UpdateConfig
            //{
            //    app_list = new Dictionary<string, AppConfig>
            //    {

            //    },
            //    res_list = new Dictionary<string, Dictionary<string, Resver>>
            //    {
            //        {"100",new Dictionary<string, Resver>{
            //            { "1.0.0",new Resver{
            //                channel = new List<string>(){"all"},
            //                update_tailnumber = new List<string>(){"all"},
            //            } }
            //        }}
            //    }
            //};
            var info = await HttpManager.Instance.HttpGetResult <UpdateConfig>(url);

            if (info == null)
            {
                var btnState = await self.ShowMsgBoxView("Update_Get_Fail", "Update_ReTry", self.force_update?"Btn_Exit" : "Update_Skip");

                if (btnState == self.BTN_CONFIRM)
                {
                    await self.CheckUpdateList();
                }
                else if (self.force_update)
                {
                    GameUtility.Quit();
                    return;
                }
            }
            else
            {
                ServerConfigComponent.Instance.SetUpdateList(info);
            }
        }