Skip to content

Commit

Permalink
更新README
Browse files Browse the repository at this point in the history
  • Loading branch information
ape-byte committed Jun 9, 2023
1 parent 3c4b592 commit 47feee5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 11 additions & 2 deletions BarrageGrab/WsBarrageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,19 @@ private void Grab_OnControlMessage(object sender, ControlMessage e)
}
}

static int count = 0;
private void Print(string msg, ConsoleColor color, BarrageMsgType bartype)
{
if (!Appsetting.PrintFilter.Any(a => a == bartype.GetHashCode())) return;

if (Appsetting.PrintBarrage)
{
if (++count > 1000)
{
Console.Clear();
Console.WriteLine("控制台已清理");
}
console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")} [{bartype.ToString()}] " + msg + "\n", color);
count = 0;
}
}

Expand Down Expand Up @@ -414,9 +420,12 @@ public void Broadcast(string msg)
{
foreach (var user in socketList)
{
var socket = user.Value;
var socket = user.Value;
socket.Socket.Send(msg);
}
//删除掉线的套接字
var offlines = socketList.Where(w=>!w.Value.Socket.IsAvailable).Select(s=>s.Key).ToList();
offlines.ForEach(key => socketList.Remove(key));
}

/// <summary>
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,9 @@
## 📢鸣谢

+ 请施舍一个 ⭐Start ,现在工具处于早期版本,及时订阅更新获得更佳的使用体验



## ⚖️免责声明

+ 本程序仅供学习参考,不得用于商业用途

0 comments on commit 47feee5

Please sign in to comment.