From d4811b7d34b45ff6b21b97f11da128b5572ec526 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期三, 03 三月 2021 16:03:03 +0800 Subject: [PATCH] 20210303-1 --- HDL_ON/Entity/Function/Scene.cs | 61 ++++++++++++++++-------------- 1 files changed, 33 insertions(+), 28 deletions(-) diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs index a369fa7..c974e1e 100644 --- a/HDL_ON/Entity/Function/Scene.cs +++ b/HDL_ON/Entity/Function/Scene.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using HDL_ON.Common; using HDL_ON.DAL.Server; using Shared; @@ -56,10 +57,10 @@ /// 鎵�灞炴埧闂村垪琛� /// </summary> public List<string> roomIds = new List<string>(); - /// <summary> - /// 鎵�灞炴埧闂村垪琛� - /// </summary> - public List<string> uids = new List<string>(); + ///// <summary> + ///// 鎵�灞炴埧闂村垪琛� + ///// </summary> + //public List<string> uids = new List<string>(); /// <summary> /// 寤舵椂 /// </summary> @@ -258,40 +259,44 @@ } } } - /// <summary> - /// 淇濆瓨鍔熻兘鏁版嵁 + /// 淇濆瓨鍦烘櫙鏁版嵁鏂囦欢 /// </summary> - public void SaveSceneData(bool upServer) + public void SaveSceneFile() { - if (upServer) - { - UploadScene(); - } - else - { - var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); - Common.FileUtlis.Files.WriteFileByBytes(savePath, ssd); - MainPage.Log($"Save Scene Data : {savePath}"); - } + var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); + FileUtlis.Files.WriteFileByBytes(savePath, ssd); + MainPage.Log($"Save Scene Data : {savePath}"); } + /// <summary> /// 鏀惰棌鍦烘櫙 /// </summary> /// <returns></returns> - public string CollectScene() + public void CollectScene() { - var pm = new HttpServerRequest(); - if (this.collect) + var result = StateCode.SUCCESS; + new System.Threading.Thread(() => { - var revPack = pm.CollectScene(this.userSceneId); - return revPack; - } - else - { - var revPack = pm.CancelCollectScene(this.userSceneId); - return revPack; - } + if (collect) + { + result = ApiUtlis.Ins.HttpRequest.CollectScene(userSceneId); + } + else + { + result = ApiUtlis.Ins.HttpRequest.CancelCollectScene(userSceneId); + } + //鎻愮ず閿欒 + if (result != StateCode.SUCCESS) + { + Application.RunOnMainThread(() => + { + collect = !collect; + IMessageCommon.Current.ShowErrorInfoAlter(result); + }); + } + }) + { IsBackground = true }.Start(); } /// <summary> -- Gitblit v1.8.0