Esempio n. 1
0
 public void 公告项目启动()
 {
     //动态推送1
     new Thread(new ThreadStart(delegate
     {
         try
         {
             while (true)
             {
                 bool 动态推送1开关 = MMPU.TcpSend(20009, "{}", true) == "1" ? true : false;
                 if (动态推送1开关)
                 {
                     string 动态推送内容 = MMPU.TcpSend(20010, "{}", true);
                     this.Dispatcher.Invoke(new Action(delegate
                     {
                         动态推送1.Content = 动态推送内容;
                     }));
                 }
                 Thread.Sleep(300 * 1000);
             }
         }
         catch (Exception) { }
     })).Start();
     //版本检查
     new Thread(new ThreadStart(delegate
     {
         try
         {
             string 务器版本号 = MMPU.TcpSend(20011, "{}", true);
             if (!string.IsNullOrEmpty(务器版本号))
             {
                 if (MMPU.版本号 != MMPU.TcpSend(20011, "{}", true))
                 {
                     MessageBoxResult dr = System.Windows.MessageBox.Show("检测到版本更新,更新公告:\n" + MMPU.TcpSend(20012, "{}", true) + "\n\n点击确定跳转到补丁(大约1MB)下载网页,点击取消忽略", "有新版本", MessageBoxButton.OKCancel, MessageBoxImage.Question);
                     if (dr == MessageBoxResult.OK)
                     {
                         System.Diagnostics.Process.Start("https://github.com/CHKZL/DDTV2/releases/latest");
                     }
                 }
             }
         }
         catch (Exception) { }
     })).Start();
     //推送内容1
     new Thread(new ThreadStart(delegate
     {
         try
         {
             string 推送内容1text = MMPU.TcpSend(20005, "{}", true);
             if (推送内容1text.Length < 25)
             {
                 this.Dispatcher.Invoke(new Action(delegate
                 {
                     推送内容1.Content = 推送内容1text;
                 }));
             }
         }
         catch (Exception) { }
     })).Start();
 }
Esempio n. 2
0
 public static void Connect()
 {
     new Task(() =>
     {
         try
         {
             MMPU.DDC采集间隔 = int.Parse(MMPU.TcpSend(30001, "{}", true));
         }
         catch (Exception)
         {
             MMPU.DDC采集间隔 = 1000;
         }
         DDC DDC = new DDC();
         DDC.WebSocket();
     }).Start();
 }
Esempio n. 3
0
 public static void Connect()
 {
     new Task(() =>
     {
         try
         {
             MMPU.DDC采集间隔 = int.Parse(MMPU.TcpSend(30001, "{}", true, 50));
         }
         catch (Exception)
         {
             //如果服务器无响应或者返回内容错误,保守使用延迟
             MMPU.DDC采集间隔 = 60000;
         }
         DDC DDC = new DDC();
         DDC.WebSocket();
     }).Start();
 }
Esempio n. 4
0
 public static void Connect()
 {
     new Task(() =>
     {
         try
         {
             MMPU.DDC采集间隔 = int.Parse(MMPU.TcpSend(Server.RequestCode.GET_DDC_TIME_NUMBER, "{}", true, 50));
         }
         catch (Exception)
         {
             //如果服务器无响应或者返回内容错误,保守使用延迟
             MMPU.DDC采集间隔 = 60000;
         }
         DDC DDC = new DDC();
         DDC.WebSocket();
     }).Start();
 }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Auxiliary.VTBS.API.VTBS服务器CDN.根据CDN更新VTBS_Url();
            MMPU.配置文件初始化(1);
            new Task(() =>
            {
                DDTVLiveRecWebServer.Program.Main(new string[] { });
            }).Start();

            new Task(() =>
            {
                while (true)
                {
                    try
                    {
                        string 务器版本号 = MMPU.TcpSend(Server.RequestCode.GET_VER, "{}", true, 50);
                        if (!string.IsNullOrEmpty(务器版本号))
                        {
                            bool 检测状态 = true;
                            foreach (var item in MMPU.检测的版本号)
                            {
                                if (务器版本号 == item)
                                {
                                    检测状态 = false;
                                }
                            }
                            if (MMPU.版本号 != 务器版本号 && 检测状态)
                            {
                                MMPU.更新公告   = MMPU.TcpSend(Server.RequestCode.GET_UPDATE_ANNOUNCEMENT, "{}", true, 100);
                                MMPU.是否有新版本 = true;
                                InfoLog.InfoPrintf("检测到版本更新,更新内容:\n" + MMPU.TcpSend(Server.RequestCode.GET_VERTEXT, "{}", true, 100) + "\n\n", InfoLog.InfoClass.载必要提示);
                            }
                        }
                    }
                    catch (Exception) { }
                    Thread.Sleep(3600 * 1000);
                }
            }).Start();
            MMPU.缓存路径 = MMPU.载储存目录;
            InfoLog.InfoPrintf(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ": " + "DDTVLiveRec启动完成", InfoLog.InfoClass.载必要提示);
            while (true)
            {
                Thread.Sleep(10);
            }
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
#if false
            载("14275133");
#else
            Auxiliary.VTBS.API.VTBS服务器CDN.根据CDN更新VTBS_Url();
            MMPU.配置文件初始化(1);
            new Task(() => {
                DDTVLiveRecWebServer.Program.Main(new string[] { });
            }).Start();
#endif
            new Task(() =>
            {
                try
                {
                    string 务器版本号 = MMPU.TcpSend(20013, "{}", true, 50);
                    if (!string.IsNullOrEmpty(务器版本号))
                    {
                        bool 检测状态 = true;
                        foreach (var item in MMPU.检测的版本号)
                        {
                            if (务器版本号 == item)
                            {
                                检测状态 = false;
                            }
                        }
                        if (MMPU.版本号 != 务器版本号 && 检测状态)
                        {
                            MMPU.是否有新版本 = true;
                            InfoLog.InfoPrintf("检测到版本更新,更新公告:\n" + MMPU.TcpSend(20014, "{}", true, 100) + "\n\n", InfoLog.InfoClass.载必要提示);
                            //Console.ReadKey();
                        }
                    }
                }
                catch (Exception) { }
            }).Start();
            MMPU.载储存目录 = MMPU.缓存路径;
            InfoLog.InfoPrintf(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ": " + "DDTVLiveRec启动完成", InfoLog.InfoClass.载必要提示);
            while (true)
            {
                Thread.Sleep(10);
            }
        }
Esempio n. 7
0
        private void BT1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(平台.SelectedItem.ToString()))
                {
                    MessageBox.Show("未选择平台");
                    return;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("未选择平台");
                return;
            }
            if (string.IsNullOrEmpty(中文名称.Text) || string.IsNullOrEmpty(平台.SelectedItem.ToString()) || string.IsNullOrEmpty(唯一码.Text))
            {
                MessageBox.Show("不能留空");
                return;
            }
            if (this.Title == "添加新单推" || this.Title == "从网络添加房间")
            {
                if (平台.SelectedItem.ToString() == "bilibili")
                {
                    foreach (var item in RoomInit.bilibili房间主表)
                    {
                        if (item.唯一码 == 唯一码.Text)
                        {
                            MessageBox.Show("已存在相同的房间号!\n" + item.称 + " " + item.平台 + " " + item.唯一码);
                            return;
                        }
                    }
                }
                else if (平台.SelectedItem.ToString() == "youtube")
                {
                    foreach (var item in RoomInit.youtube房间主表)
                    {
                        if (item.唯一码 == 唯一码.Text)
                        {
                            MessageBox.Show("已存在相同的房间号!\n" + item.称 + " " + item.平台 + " " + item.唯一码);
                            return;
                        }
                    }
                }
                新增V信息 NEWV = new 新增V信息()
                {
                    CN_Name = 中文名称.Text, LA_Name = 官方名称.Text, Platform = 平台.SelectedItem.ToString(), GUID = 唯一码.Text
                };
                NewThreadTask.Run(() =>
                {
                    MMPU.TcpSend(Server.RequestCode.GET_NEW_MEMBER_LIST_CONTENT,
                                 JsonConvert.SerializeObject(NEWV), true);
                });

                RoomBox rlc = JsonConvert.DeserializeObject <RoomBox>(ReadConfigFile(RoomConfigFile));
                RoomBox RB  = new RoomBox();
                RB.data = new List <RoomCadr>();
                if (rlc.data != null)
                {
                    foreach (var item in rlc.data)
                    {
                        RB.data.Add(item);
                        if (RoomInit.根据唯一码获取直播状态(item.RoomNumber))
                        {
                            RB.data[RB.data.Count() - 1].LiveStatus = true;
                        }
                    }
                }
                RB.data.Add(new RoomCadr {
                    Name = 中文名称.Text, RoomNumber = 唯一码.Text, Types = 平台.SelectedItem.ToString(), RemindStatus = false, status = false, VideoStatus = false, OfficialName = 官方名称.Text, LiveStatus = RoomInit.根据唯一码获取直播状态(GUID)
                });
                string JOO = JsonConvert.SerializeObject(RB);
                MMPU.储存文本(JOO, RoomConfigFile);
                if (平台.SelectedItem.ToString() == "bilibili")
                {
                    InitializeRoomList(int.Parse(唯一码.Text), false, false);
                }
                else
                {
                    InitializeRoomList(0, false, false);
                }



                //更新房间列表(平台.SelectedItem.ToString(), 唯一码.Text,1);
                //MessageBox.Show("添加成功");
            }
            else if (this.Title == "修改单推属性")
            {
                新增V信息 NEWV = new 新增V信息()
                {
                    CN_Name = 中文名称.Text, LA_Name = 官方名称.Text, Platform = 平台.SelectedItem.ToString(), GUID = 唯一码.Text
                };
                NewThreadTask.Run(() =>
                {
                    MMPU.TcpSend(Server.RequestCode.GET_NEW_MEMBER_LIST_CONTENT,
                                 JsonConvert.SerializeObject(NEWV), true);
                });

                RoomBox rlc = JsonConvert.DeserializeObject <RoomBox>(ReadConfigFile(RoomConfigFile));
                RoomBox RB  = new RoomBox();
                RB.data = new List <RoomCadr>();
                if (rlc.data != null)
                {
                    foreach (var item in rlc.data)
                    {
                        if (item.RoomNumber == GUID)
                        {
                            RB.data.Add(item);
                            RB.data[RB.data.Count - 1].Name         = 中文名称.Text;
                            RB.data[RB.data.Count - 1].OfficialName = 官方名称.Text;
                            RB.data[RB.data.Count - 1].Types        = 平台.SelectedItem.ToString();
                        }
                        else
                        {
                            RB.data.Add(item);
                            if (RoomInit.根据唯一码获取直播状态(item.RoomNumber))
                            {
                                RB.data[RB.data.Count() - 1].LiveStatus = true;
                            }
                        }
                    }
                }

                string JOO = JsonConvert.SerializeObject(RB);
                MMPU.储存文本(JOO, RoomConfigFile);
                InitializeRoomList(0, false, false);
                //var rlc2 = JsonConvert.DeserializeObject<RoomBox>(ReadConfigFile(RoomConfigFile));
                //RoomBox RB = new RoomBox();
                //RB.data = new List<RoomCadr>();
                //int rlclen = 房间主表.Count()-1;
                //int 覆盖的编号 = 0;
                //for (int i =0;i< rlclen; i++)
                //{
                //    if(房间主表[i].唯一码==GUID)
                //    {
                //        覆盖的编号 = i;
                //        //房间主表.Remove(房间主表[i]);
                //        //i--;
                //        RB.data.Add(new RoomCadr { Name = 中文名称.Text, RoomNumber = 唯一码.Text, Types = 平台.SelectedItem.ToString(), RemindStatus = false, status = false, VideoStatus = false, OfficialName = 官方名称.Text,LiveStatus= RoomInit.根据唯一码获取直播状态(GUID) });
                //    }
                //    else
                //    {
                //        RB.data.Add(new RoomCadr(){ LiveStatus= 房间主表[i] .直播状态,Name= 房间主表[i] .名称,OfficialName= 房间主表[i] .原名,RoomNumber= 房间主表[i] .唯一码,VideoStatus= 房间主表[i] .是否录制,Types= 房间主表[i] .平台, RemindStatus= 房间主表[i] .是否提醒,status=false });
                //        if (RoomInit.根据唯一码获取直播状态(房间主表[i].唯一码))
                //        {
                //            RB.data[RB.data.Count() - 1].LiveStatus = true;
                //        }
                //    }
                //}
                //房间主表.Clear();
                //foreach (var item in RB.data)
                //{
                //    房间主表.Add(new RL { 名称=item.Name,原名=item.OfficialName,唯一码=item.RoomNumber,平台=item.Types,是否录制=item.VideoStatus,是否提醒=item.RemindStatus,直播状态=item.LiveStatus});
                //}

                //新增V信息 NEWV = new 新增V信息() { CN_Name = 中文名称.Text, LA_Name = 官方名称.Text, Platform = 平台.SelectedItem.ToString(), GUID = 唯一码.Text };

                //new Task(() => { MMPU.TcpSend(20001, JsonConvert.SerializeObject(NEWV), true); }).Start();
                //string JOO = JsonConvert.SerializeObject(RB);
                //MMPU.储存文本(JOO, RoomConfigFile);
                //InitializeRoomList();
                ////MessageBox.Show("修改成功");
            }
            this.Close();
        }