wei
2021-03-03 d4811b7d34b45ff6b21b97f11da128b5572ec526
HDL_ON/Entity/Function/Scene.cs
@@ -1,5 +1,6 @@
using 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>
@@ -236,23 +237,17 @@
                            {
                                Application.RunOnMainThread(() =>
                                {
                                    if (time / 60 > 1)
                                    if (time > 60)
                                    {
                                        btnShowDelay.Text = (time / 60).ToString() + "min";
                                        btnShowDelay.Text = (time / 60).ToString() + "min" + time % 60 + "s";
                                    }
                                    else
                                    {
                                        btnShowDelay.Text = (time--).ToString() + "s";
                                        btnShowDelay.Text = time.ToString() + "s";
                                    }
                                });
                                if (time / 60 > 1)
                                {
                                    System.Threading.Thread.Sleep(time / 60 * 60000);
                                }
                                else
                                {
                                    System.Threading.Thread.Sleep(1000);
                                }
                                System.Threading.Thread.Sleep(1000);
                                time--;
                            }
                            Application.RunOnMainThread(() =>
                            {
@@ -264,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>