From 4c00ed21d1006e37b7b38223fc433f96296aa57b Mon Sep 17 00:00:00 2001 From: Muihd <1083092844@qq.com> Date: Sun, 10 Mar 2024 04:03:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E8=A7=A3=E5=8C=85?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BarrageGrab/WssBarrageGrab.cs | 43 +---------------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/BarrageGrab/WssBarrageGrab.cs b/BarrageGrab/WssBarrageGrab.cs index 38e7e60..4f524d0 100644 --- a/BarrageGrab/WssBarrageGrab.cs +++ b/BarrageGrab/WssBarrageGrab.cs @@ -20,8 +20,6 @@ namespace BarrageGrab //ISystemProxy proxy = new FiddlerProxy(); ISystemProxy proxy = new TitaniumProxy(); Appsetting appsetting = Appsetting.Current; - //解包成功的域名缓存 - List succPackHostNames = new List(); /// /// 进入直播间 @@ -126,11 +124,7 @@ namespace BarrageGrab allBuff = e.NeedDecompress ? Decompress(enty.Payload) : enty.Payload; var response = Serializer.Deserialize(new ReadOnlyMemory(allBuff)); - if (!succPackHostNames.Contains(e.HostName)) - { - succPackHostNames.Add(e.HostName); - SaveHostNameCache(); - } + response.Messages.ForEach(f => DoMessage(f,e.ProcessName)); } catch (Exception) { } @@ -143,11 +137,6 @@ namespace BarrageGrab var response = Serializer.Deserialize(new ReadOnlyMemory(payload)); - if (!succPackHostNames.Contains(e.HostName)) - { - succPackHostNames.Add(e.HostName); - SaveHostNameCache(); - } response.Messages.ForEach(f => { DoMessage(f,e.ProcessName); @@ -285,36 +274,6 @@ namespace BarrageGrab } } - //将成功解包的域名缓存到文件 - private void SaveHostNameCache() - { - //获取程序运行目录 - var baseDir = Directory.GetCurrentDirectory(); - var fullPath = Path.Combine(baseDir, "成功解包域名缓存.txt"); - - try - { - //文件不存在则创建 - if (!File.Exists(fullPath)) - { - File.Create(fullPath); - } - var text = File.ReadAllText(fullPath); - var currentHosts = text.Split('\n').Where(w => !string.IsNullOrWhiteSpace(w)).Select(s => s.Trim().Trim('\r')).ToList(); - var newHosts = succPackHostNames.Except(currentHosts).ToList(); - //保存 - if (newHosts.Count > 0) - { - File.AppendAllLines(fullPath, newHosts); - } - } - catch (Exception ex) - { - Logger.PrintColor("写入成功解包域名缓存失败:" + ex.Message, ConsoleColor.Red); - } - } - - public class RoomMessageEventArgs : EventArgs where T : class { ///