From 7491c05d57c54238c0226894a505645bab0b6313 Mon Sep 17 00:00:00 2001 From: Muihd <1083092844@qq.com> Date: Wed, 30 Apr 2025 21:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5=20`RoomTit?= =?UTF-8?q?le`,`IsAnonymous`=EF=BC=9B=20=E4=BF=AE=E6=AD=A3=20=20Msg=20?= =?UTF-8?q?=E7=B1=BB=20=20`Owner`=E5=AD=97=E6=AE=B5=20=E7=9A=84=E6=8B=BC?= =?UTF-8?q?=E5=86=99=E9=94=99=E8=AF=AF;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BarrageGrab/Server/WsBarrageServer.cs | 29 +++++++++++++++------------ 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/BarrageGrab/Server/WsBarrageServer.cs b/BarrageGrab/Server/WsBarrageServer.cs index bf6e502..37e4e40 100644 --- a/BarrageGrab/Server/WsBarrageServer.cs +++ b/BarrageGrab/Server/WsBarrageServer.cs @@ -189,7 +189,9 @@ namespace BarrageGrab { MsgId = msg.Common?.msgId, RoomId = roomid, - WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(roomid), + WebRoomId = roomInfo?.WebRoomId ?? "", + RoomTitle = roomInfo?.Title ?? "", + IsAnonymous = roomInfo?.IsAnonymous ?? false, Appid = msg.Common.appId.ToString(), User = hasUser ? GetUser(msg.User) : null, }; @@ -287,18 +289,19 @@ namespace BarrageGrab { if (msg == null) return; var roomInfo = AppRuntime.RoomCaches.GetCachedWebRoomInfo(msg.RoomId.ToString()); - if (roomInfo != null && roomInfo.Owner != null) + if (roomInfo == null) return; + + msg.Owner = new RoomAnchorInfo() { - msg.Onwer = new RoomAnchorInfo() - { - Nickname = roomInfo.Owner.Nickname, - HeadUrl = roomInfo.Owner.HeadUrl, - FollowStatus = roomInfo.Owner.FollowStatus, - SecUid = roomInfo.Owner.SecUid, - UserId = roomInfo.Owner.UserId - }; - msg.WebRoomId = roomInfo.WebRoomId; - } + Nickname = roomInfo.Owner.Nickname, + HeadUrl = roomInfo.Owner.HeadUrl, + FollowStatus = roomInfo.Owner.FollowStatus, + SecUid = roomInfo.Owner.SecUid, + UserId = roomInfo.Owner.UserId + }; + + msg.WebRoomId = roomInfo.WebRoomId; + msg.RoomTitle = roomInfo.Title; } //粉丝团 @@ -581,7 +584,7 @@ namespace BarrageGrab try { var cmdPack = JsonConvert.DeserializeObject(message); - if (cmdPack == null) return; + if (cmdPack == null) return; } catch (Exception) { } };