From d55930158395dd275142d5ed0c0cea84de48aa0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3?= Date: Tue, 24 Nov 2020 17:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Socket=E7=A8=B3=E5=AE=9A?= =?UTF-8?q?=E6=80=A7=EF=BC=8C=E4=BC=98=E5=8C=96=E9=95=BF=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8C=85=E6=8E=A5=E6=94=B6=E5=85=BC=E5=AE=B9=E7=A8=B3=E5=AE=9A?= =?UTF-8?q?=E6=80=A7=20=E4=BC=98=E5=8C=96=E5=88=9D=E5=A7=8B=E5=8C=96VTBS?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=8E=B7=E5=8F=96=E6=B5=81=E7=A8=8B=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86=E5=92=8C?= =?UTF-8?q?=E5=A4=87=E7=94=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Auxiliary/DDcenter/DdcClient.cs | 2 +- Auxiliary/MMPU.cs | 19 ++++++--- Auxiliary/Server.cs | 2 + Auxiliary/bilibili.cs | 37 ++++++++++++------ "Auxiliary/\345\244\226\351\203\250API.cs" | 2 +- DDTVLiveRec/App.config | 3 ++ DDTVLiveRec/DDTV.ico | Bin 0 -> 67646 bytes DDTVLiveRec/DDTVLiveRec.csproj | 1 + DDTVLiveRec/Program.cs | 14 ++++--- DDTV_New/AddMonitoringList.xaml.cs | 4 +- DDTV_New/App.config | 1 + DDTV_New/MainWindow.xaml.cs | 12 +++--- ...6\216\247\345\210\227\350\241\250.xaml.cs" | 4 +- 13 files changed, 67 insertions(+), 34 deletions(-) create mode 100644 DDTVLiveRec/DDTV.ico diff --git a/Auxiliary/DDcenter/DdcClient.cs b/Auxiliary/DDcenter/DdcClient.cs index c1cd29eb3..62d8f0ec8 100644 --- a/Auxiliary/DDcenter/DdcClient.cs +++ b/Auxiliary/DDcenter/DdcClient.cs @@ -19,7 +19,7 @@ public static void Connect() { try { - MMPU.DDC采集间隔 = int.Parse(MMPU.TcpSend(30001, "{}", true)); + MMPU.DDC采集间隔 = int.Parse(MMPU.TcpSend(30001, "{}", true,50)); } catch (Exception) { diff --git a/Auxiliary/MMPU.cs b/Auxiliary/MMPU.cs index 00cbfc4bc..cc2fc062b 100644 --- a/Auxiliary/MMPU.cs +++ b/Auxiliary/MMPU.cs @@ -31,7 +31,7 @@ public class MMPU public static int 直播更新时间 = 60; public static string 下载储存目录 = ""; public static string 版本号 = "2.0.4.5b"; - public static string[] 不检测的版本号 = {}; + public static string[] 不检测的版本号 = {"2.0.4.3b"}; public static bool 第一次打开播放窗口 = true; public static int 默认音量 = 0; public static int 缩小功能 = 1; @@ -97,7 +97,7 @@ public static bool 配置文件初始化(int 模式) { InfoLog.InfoInit("./DDTVLiveRecLog.out", new InfoLog.InfoClasslBool() { - Debug = false, + Debug = true, 下载必要提示 = true, 杂项提示 = false, 系统错误信息 = true, @@ -189,7 +189,7 @@ public static void DokiDoki(int 模式) { try { - MMPU.TcpSend(模式 == 0 ? Server.RequestCode.SET_DokiDoki_DDTV : Server.RequestCode.SET_DokiDoki_DDTVLiveRec, "{}", true); + MMPU.TcpSend(模式 == 0 ? Server.RequestCode.SET_DokiDoki_DDTV : Server.RequestCode.SET_DokiDoki_DDTVLiveRec, "{}", true,50); } catch (Exception) { } Thread.Sleep(3600 * 1000); @@ -1010,19 +1010,21 @@ public static bool setFiles(string key, string value) /// 消息内容 /// /// - public static string TcpSend(int code, string msg, bool 是否需要回复) + public static string TcpSend(int code, string msg, bool 是否需要回复,int 等待时间) { try { string 回复内容 = ""; Socket tcpClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + tcpClient.ReceiveBufferSize = 1024 * 1024 * 8; IPAddress ipaddress = Server.IP_ADDRESS; EndPoint point = new IPEndPoint(ipaddress, Server.PORT); tcpClient.Connect(point);//通过IP和端口号来定位一个所要连接的服务器端 tcpClient.Send(Encoding.UTF8.GetBytes(JSON发送拼接(code, msg))); if (是否需要回复) { - byte[] buffer = new byte[1024 * 1024]; + byte[] buffer = new byte[1024 * 1024 * 8]; + Thread.Sleep(等待时间); tcpClient.Receive(buffer); string 收到的数据 = Encoding.UTF8.GetString(buffer).Trim('\0'); 回复内容 = 收到的数据; @@ -1032,6 +1034,13 @@ public static string TcpSend(int code, string msg, bool 是否需要回复) 回复内容 = null; } tcpClient.Close(); + try + { + tcpClient.Dispose(); + } + catch (Exception) + { + } return 回复内容; } catch (Exception) diff --git a/Auxiliary/Server.cs b/Auxiliary/Server.cs index 05d225674..b83fbeed9 100644 --- a/Auxiliary/Server.cs +++ b/Auxiliary/Server.cs @@ -15,6 +15,8 @@ public static class Server public static readonly IPAddress IP_ADDRESS = MMPU.根据URL获取IP地址("api.ddtv.pro"); #elif false public static readonly IPAddress IP_ADDRESS = MMPU.根据URL获取IP地址("192.168.199.100"); +#elif false + public static readonly IPAddress IP_ADDRESS = MMPU.根据URL获取IP地址("127.0.0.1"); #endif public static readonly int PORT = 11433; public static readonly string PROJECT_ADDRESS = "https://github.com/CHKZL/DDTV2/releases/latest"; diff --git a/Auxiliary/bilibili.cs b/Auxiliary/bilibili.cs index 65a8a2e70..2ef5cc8ec 100644 --- a/Auxiliary/bilibili.cs +++ b/Auxiliary/bilibili.cs @@ -88,9 +88,15 @@ public static void 更新VTBS房间数据() { while (true) { + int 完整错误次数 = 0; try { - + if(完整错误次数>=5) + { + InfoLog.InfoPrintf($"----------【重要】----------\r\n多次尝试获取服务器RoomList缓存失败,切换为纯WSS连接模式,该模式下初始化连接速度较慢,大约20连接一个房间\r\n----------【重要】----------", InfoLog.InfoClass.下载必要提示); + wss连接初始化准备已完成 = true; + return; + } string vtbs房间数据 = string.Empty; try { @@ -98,10 +104,12 @@ public static void 更新VTBS房间数据() } catch (Exception) { - vtbs房间数据 = MMPU.TcpSend(Server.RequestCode.GET_VTBSROOMLIST, "{}", true); + InfoLog.InfoPrintf($"通过原始数据源更新VTBS房间数据失败,切换到备用DDTV服务器获取", InfoLog.InfoClass.Debug); + vtbs房间数据 = MMPU.TcpSend(Server.RequestCode.GET_VTBSROOMLIST, "{}", true, 1500); } JArray JO = (JArray)JsonConvert.DeserializeObject(vtbs房间数据); + InfoLog.InfoPrintf($"获取VTBS房间数据完成:{JO}", InfoLog.InfoClass.Debug); foreach (var item in JO) { if (int.Parse(item["roomid"].ToString()) != 0) @@ -109,11 +117,14 @@ public static void 更新VTBS房间数据() VtbsRoomList.Add(new VtbsRoom() { mid = int.Parse(item["mid"].ToString()), room = int.Parse(item["roomid"].ToString()), name = item["uname"].ToString() }); } } + InfoLog.InfoPrintf($"VTBS数据数据准备完成", InfoLog.InfoClass.Debug); wss连接初始化准备已完成 = true; break; } - catch (Exception) + catch (Exception ) { + 完整错误次数++; + InfoLog.InfoPrintf($"VTBS获取RoomList失败,再次重试,已重试次数{完整错误次数}/5", InfoLog.InfoClass.Debug); } Thread.Sleep(5000); @@ -215,7 +226,7 @@ public static void 使用vtbsAPI更新房间状态() InfoLog.InfoPrintf("Vtbs数据加载失败,使用备用数据源开始获取", InfoLog.InfoClass.Debug); try { - JArray JO = (JArray)JsonConvert.DeserializeObject(MMPU.TcpSend(Server.RequestCode.GET_LIVELSIT, "{}", true)); + JArray JO = (JArray)JsonConvert.DeserializeObject(MMPU.TcpSend(Server.RequestCode.GET_LIVELSIT, "{}", true,200)); foreach (var roomtask in RoomList) { if (!roomtask.名称.Contains("-NV")) @@ -354,15 +365,19 @@ public static void 初始化所有房间连接() }).Start(); while (!wss连接初始化准备已完成) { - Thread.Sleep(1000); + InfoLog.InfoPrintf("连接初始化准备未完成3秒后重试", InfoLog.InfoClass.Debug); + Thread.Sleep(3000); } + InfoLog.InfoPrintf("wss连接初始化准备已完成", InfoLog.InfoClass.Debug); List MTPlist = new List(); + InfoLog.InfoPrintf($"wss连接初始化准备已完成,列表长度:{VtbsRoomList.Count}", InfoLog.InfoClass.Debug); foreach (var item in VtbsRoomList) { MTPlist.Add(item.room); } List Vtbs存在的直播间 = new List(); List Vtbs不存在的直播间 = new List(); + InfoLog.InfoPrintf($"生成双边队列临时API房间列表数:{Vtbs存在的直播间.Count},优先连接组数:{Vtbs不存在的直播间.Count}", InfoLog.InfoClass.Debug); foreach (var item in RoomList) { if(MTPlist.Contains(int.Parse(item.房间号))) @@ -381,7 +396,7 @@ public static void 初始化所有房间连接() InfoLog.InfoPrintf("LiveChatListener开始连接非VTBS监控范围内房间:" + item.房间号, InfoLog.InfoClass.Debug); if (item.平台 == "bilibili") { - item.liveChatListener = new LiveChatListener(); + item.liveChatListener = new LiveChatListener(); item.liveChatListener.Connect(int.Parse(item.房间号)); item.liveChatListener.MessageReceived += 直播间状态WS变化事件; 已连接的直播间状态.Add(new 直播间状态() { 房间号 = int.Parse(item.房间号) }); @@ -834,11 +849,11 @@ public static string 获取真实房间号(string roomID) try { JObject result = JObject.Parse(roomHtml); - string live_status = result["data"]["live_status"].ToString(); - if (live_status != "1") - { - return "-1"; - } + //string live_status = result["data"]["live_status"].ToString(); + //if (live_status != "1") + //{ + // return "-1"; + //} string roomid = result["data"]["room_id"].ToString(); DataCache.写缓存(CacheStr + roomID, roomid); return roomid; diff --git "a/Auxiliary/\345\244\226\351\203\250API.cs" "b/Auxiliary/\345\244\226\351\203\250API.cs" index e13b5f1cc..d19acefad 100644 --- "a/Auxiliary/\345\244\226\351\203\250API.cs" +++ "b/Auxiliary/\345\244\226\351\203\250API.cs" @@ -35,7 +35,7 @@ public class 直播信息 public List<直播信息> 直播数据 = new List<直播信息>(); public void 更新正在直播数据() { - string UURL = MMPU.TcpSend(30002, "{}", true); + string UURL = MMPU.TcpSend(30002, "{}", true,50); string URL = string.IsNullOrEmpty(UURL)?"https://hiyoko.sonoj.net/dy-st/30s/6c6cb639-1d2f-4151-81c7-fd877700cf98.json": UURL; JArray jo = (JArray)JsonConvert.DeserializeObject(MMPU.返回网页内容(URL)); for(int i =0;i< jo.Count;i++) diff --git a/DDTVLiveRec/App.config b/DDTVLiveRec/App.config index cb2015ebc..e992731c4 100644 --- a/DDTVLiveRec/App.config +++ b/DDTVLiveRec/App.config @@ -1,6 +1,7 @@  + @@ -29,6 +30,8 @@ + + diff --git a/DDTVLiveRec/DDTV.ico b/DDTVLiveRec/DDTV.ico new file mode 100644 index 0000000000000000000000000000000000000000..75f97efe9e36368cd3569605d64076442ac362d8 GIT binary patch literal 67646 zcmeI53v?V;dB;bVaim?#&%}D#vP0}Bv7H{8_LN79ODQL`v`OhHg&YW^JX+vTdfLJ{ zKtt?PP$31Jgg_D?6bO$7NJ&EckSxiPEx+<|Y)ejJ;)g7)wR-p=Sx-N2|KFYYX7Aj+ zvpc&xE8CLS=kM>{nc3Oh`Tf7|-kE*KvI_8T%^C~;FScrm3akZ|Wz|4fL<{9|YEo-{ z)RMCMm;e9Ah89@RXQ5Z1c2Z1H7utU6#5&SZ)-c*W>cDbEZD_xIWO%^~&^D+J`Ze@0 zbT9NV=v~k)&~?y^!@~s zU(g=Mx=v^#bT9M{XdYAm<#r&Z=)L3M57k00f0GaVJfU*e+w235%-t`7q02g8dl1|0 zgzoJaT5u~=gvYY>L050Vj)2OaJP_0enT!qW3-$p;KMw?5uKD94#-3j2SJ2-;vmuLg z^_Kbw^xzmlwUA`b9^lBefTLOmxE+=kI@637MsJXpyc$No9(o^C0$HdFsSm;wUaRsa z514$w?A6HZO;Pm&=e}Q5Yl5c@FOVNpPpEB=7rgx04}pi1%p9yj?QOyMOa{;CiB zY6AN~tqIgN)dOCpdw}~UFZeBUJ;EL^Gq=5ySa$*U+lGC<6PgB1VdCDG-iKoW)k1>A z?Dd$=2PQu-cT;5ce$kJAj?3e?|G(fdBart%OwnHd=>-;4+jkoLSpj^I&JTKB;J(QV zw2XYf>vT`#$lM)=Xg}EZDD)t7Eo70V@{R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WO{b_h?mk;)jeqpM9A=bP6 zvAs{<_7AOJV->i5^XYd;zuL!}wnqyt^6#&a{!gs8ynS@ZmF{|PAB*k$LxY}=u}@i| zuGjm(=lTV^lNHb2o_aEUJnO5q?N@32)mk52_5SqmYM&ln?Zfh({wl4%+S|9QQH$eu zX+CU_=&z#96Md(6x$EVlE9;fM5Vkk?{>goKK|Wji{z7!v2g`XpxwM+@&Fj}_>n*po z(et6y=h`RxczCXzvfrWg*Pw6jUcNrs+r$-@UuDy?b}3?{04Q`NawG|Aj+@&j0`b literal 0 HcmV?d00001 diff --git a/DDTVLiveRec/DDTVLiveRec.csproj b/DDTVLiveRec/DDTVLiveRec.csproj index d912e7e34..f6dab02b1 100644 --- a/DDTVLiveRec/DDTVLiveRec.csproj +++ b/DDTVLiveRec/DDTVLiveRec.csproj @@ -3,6 +3,7 @@ Exe net5.0 + DDTV.ico diff --git a/DDTVLiveRec/Program.cs b/DDTVLiveRec/Program.cs index 2be2cb15e..7024a9fa0 100644 --- a/DDTVLiveRec/Program.cs +++ b/DDTVLiveRec/Program.cs @@ -1,4 +1,6 @@ using Auxiliary; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; using System.Drawing; using System.IO; @@ -15,19 +17,19 @@ static void Main(string[] args) 下载("14275133"); #else - Auxiliary.VTBS.API.VTBS服务器CDN.根据CDN更新VTBS_Url(); + Auxiliary.VTBS.API.VTBS服务器CDN.根据CDN更新VTBS_Url(); MMPU.配置文件初始化(1); new Task(() => { DDTVLiveRecWebServer.Program.Main(new string[] { }); }).Start(); - - + + #endif - new Task(() => + new Task(() => { try { - string 服务器版本号 = MMPU.TcpSend(20013, "{}", true); + string 服务器版本号 = MMPU.TcpSend(20013, "{}", true,50); if (!string.IsNullOrEmpty(服务器版本号)) { bool 检测状态 = true; @@ -41,7 +43,7 @@ static void Main(string[] args) if (MMPU.版本号 != 服务器版本号 && 检测状态) { MMPU.是否有新版本 = true; - InfoLog.InfoPrintf("检测到版本更新,更新公告:\n" + MMPU.TcpSend(20014, "{}", true) + "\n\n", InfoLog.InfoClass.下载必要提示); + InfoLog.InfoPrintf("检测到版本更新,更新公告:\n" + MMPU.TcpSend(20014, "{}", true,100) + "\n\n", InfoLog.InfoClass.下载必要提示); //Console.ReadKey(); } } diff --git a/DDTV_New/AddMonitoringList.xaml.cs b/DDTV_New/AddMonitoringList.xaml.cs index ea56d8f7c..2584a8136 100644 --- a/DDTV_New/AddMonitoringList.xaml.cs +++ b/DDTV_New/AddMonitoringList.xaml.cs @@ -142,7 +142,7 @@ private void BT1_Click(object sender, RoutedEventArgs e) NewThreadTask.Run(() => { MMPU.TcpSend(Server.RequestCode.GET_NEW_MEMBER_LIST_CONTENT, - JsonConvert.SerializeObject(NEWV), true); + JsonConvert.SerializeObject(NEWV), true,50); }); RoomBox rlc = JsonConvert.DeserializeObject(ReadConfigFile(RoomConfigFile)); @@ -183,7 +183,7 @@ private void BT1_Click(object sender, RoutedEventArgs e) NewThreadTask.Run(() => { MMPU.TcpSend(Server.RequestCode.GET_NEW_MEMBER_LIST_CONTENT, - JsonConvert.SerializeObject(NEWV), true); + JsonConvert.SerializeObject(NEWV), true,50); }); RoomBox rlc = JsonConvert.DeserializeObject(ReadConfigFile(RoomConfigFile)); diff --git a/DDTV_New/App.config b/DDTV_New/App.config index 7a6c63fba..8b7bb3b07 100644 --- a/DDTV_New/App.config +++ b/DDTV_New/App.config @@ -1,5 +1,6 @@  + diff --git a/DDTV_New/MainWindow.xaml.cs b/DDTV_New/MainWindow.xaml.cs index f6ca0421e..53c95a6ed 100644 --- a/DDTV_New/MainWindow.xaml.cs +++ b/DDTV_New/MainWindow.xaml.cs @@ -57,7 +57,7 @@ public MainWindow() InitializeComponent(); this.Title = "DDTV2.0主窗口"; - + ViewModel = new MainViewModel(); this.WhenActivated(disposable => @@ -515,13 +515,13 @@ public void 公告项目启动() NewThreadTask.Loop(runOnLocalThread => { bool 动态推送1开关 = MMPU.TcpSend( - Server.RequestCode.GET_TOGGLE_DYNAMIC_NOTIFICATION, "{}", true) + Server.RequestCode.GET_TOGGLE_DYNAMIC_NOTIFICATION, "{}", true,50) == "1" ? true : false; if (动态推送1开关) { string 动态推送内容 = MMPU.TcpSend( - Server.RequestCode.GET_DYNAMIC_NOTIFICATION, "{}", true); + Server.RequestCode.GET_DYNAMIC_NOTIFICATION, "{}", true, 50); runOnLocalThread(() => ViewModel.PushNotification = 动态推送内容); } }, this, 3600 * 1000); @@ -536,7 +536,7 @@ public void 公告项目启动() NewThreadTask.Run(() => { string 服务器版本号 = MMPU.TcpSend( - Server.RequestCode.GET_LATEST_VERSION_NUMBER, "{}", true); + Server.RequestCode.GET_LATEST_VERSION_NUMBER, "{}", true, 50); if (!string.IsNullOrEmpty(服务器版本号)) { @@ -552,7 +552,7 @@ public void 公告项目启动() { MessageBoxResult dr = MessageBox.Show( "检测到版本更新,更新公告:\n" - + MMPU.TcpSend(Server.RequestCode.GET_UPDATE_ANNOUNCEMENT, "{}", true) + + MMPU.TcpSend(Server.RequestCode.GET_UPDATE_ANNOUNCEMENT, "{}", true, 100) + "\n\n点击确定启动自动更新,点击取消忽略", "有新版本", MessageBoxButton.OKCancel, @@ -590,7 +590,7 @@ public void 公告项目启动() NewThreadTask.Run(runOnLocalThread => { string 推送内容1text = MMPU.TcpSend( - Server.RequestCode.GET_PUSH_NOTIFICATION_1, "{}", true); + Server.RequestCode.GET_PUSH_NOTIFICATION_1, "{}", true, 100); if (推送内容1text.Length > 0) { runOnLocalThread(() => ViewModel.Announcement = 推送内容1text); diff --git "a/DDTV_New/window/\345\242\236\345\212\240\347\233\221\346\216\247\345\210\227\350\241\250.xaml.cs" "b/DDTV_New/window/\345\242\236\345\212\240\347\233\221\346\216\247\345\210\227\350\241\250.xaml.cs" index 1caa8950b..5687ce36f 100644 --- "a/DDTV_New/window/\345\242\236\345\212\240\347\233\221\346\216\247\345\210\227\350\241\250.xaml.cs" +++ "b/DDTV_New/window/\345\242\236\345\212\240\347\233\221\346\216\247\345\210\227\350\241\250.xaml.cs" @@ -42,7 +42,7 @@ private void Button_Click(object sender, RoutedEventArgs e) try { roomId = int.Parse(唯一码.Text); - if (roomId < 10000) + if (roomId < 10001) { string roomDD = bilibili.根据房间号获取房间信息.获取真实房间号(roomId.ToString()); if(!string.IsNullOrEmpty(roomDD)) @@ -73,7 +73,7 @@ private void Button_Click(object sender, RoutedEventArgs e) RB.data.Add(item); } } - RB.data.Add(new RoomCadr() { Name = 名称.Text + "-NV", OfficialName = 名称.Text + "-NV", RoomNumber = 唯一码.Text }); + RB.data.Add(new RoomCadr() { Name = 名称.Text + "-NV", OfficialName = 名称.Text + "-NV", RoomNumber = roomId.ToString() }); string JOO = JsonConvert.SerializeObject(RB); MMPU.储存文本(JOO, RoomConfigFile); 提示.Content = 名称.Text + "-NV["+ 唯一码.Text + "]添加完成";