添弹幕打印过滤器

This commit is contained in:
梅浩东
2023-10-11 11:31:55 +08:00
parent dc3ef8274a
commit 6c573ee18c
+1
View File
@@ -126,6 +126,7 @@ namespace BarrageGrab
private void PrintMsg(Msg msg, PackMsgType barType) private void PrintMsg(Msg msg, PackMsgType barType)
{ {
if (!Appsetting.PrintBarrage) return; if (!Appsetting.PrintBarrage) return;
if (Appsetting.Current.PrintFilter.Any() && !Appsetting.Current.PrintFilter.Contains(barType.GetHashCode())) return;
var rinfo = AppRuntime.RoomCaches.GetCachedWebRoomInfo(msg.RoomId.ToString()); var rinfo = AppRuntime.RoomCaches.GetCachedWebRoomInfo(msg.RoomId.ToString());
var roomName = (rinfo?.Owner?.Nickname ?? ("直播间" + (msg.WebRoomId == 0 ? msg.RoomId : msg.WebRoomId))); var roomName = (rinfo?.Owner?.Nickname ?? ("直播间" + (msg.WebRoomId == 0 ? msg.RoomId : msg.WebRoomId)));