添加送礼目标字段
This commit is contained in:
@@ -245,6 +245,11 @@ namespace BarrageGrab.Modles.JsonEntity
|
||||
/// 抖币价格
|
||||
/// </summary>
|
||||
public int DiamondCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 送礼目标(连麦直播间有用)
|
||||
/// </summary>
|
||||
public MsgUser ToUser { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -107,6 +107,7 @@ namespace BarrageGrab
|
||||
//解析用户
|
||||
private MsgUser GetUser(User data)
|
||||
{
|
||||
if (data == null) return null;
|
||||
MsgUser user = new MsgUser()
|
||||
{
|
||||
DisplayId = data.displayId,
|
||||
@@ -114,13 +115,13 @@ namespace BarrageGrab
|
||||
Gender = data.Gender,
|
||||
Id = data.Id,
|
||||
Level = data.Level,
|
||||
PayLevel = (int)(data.payGrade?.Level ?? 0),
|
||||
Nickname = data.Nickname,
|
||||
HeadImgUrl = data.avatarThumb.urlLists.FirstOrDefault() ?? "",
|
||||
PayLevel = (int)(data.payGrade?.Level ?? -1),
|
||||
Nickname = data.Nickname ?? "用户" + data.displayId,
|
||||
HeadImgUrl = data.avatarThumb?.urlLists?.FirstOrDefault() ?? "",
|
||||
SecUid = data.sec_uid,
|
||||
FollowerCount = data.followInfo.followerCount,
|
||||
FollowingCount = data.followInfo.followingCount,
|
||||
FollowStatus = data.followInfo.followStatus,
|
||||
FollowerCount = data.followInfo?.followerCount ?? -1,
|
||||
FollowingCount = data.followInfo?.followingCount ?? -1,
|
||||
FollowStatus = data.followInfo?.followStatus ?? -1,
|
||||
};
|
||||
user.FansClub = new FansClubInfo()
|
||||
{
|
||||
@@ -153,8 +154,8 @@ namespace BarrageGrab
|
||||
var append = msg.Content;
|
||||
switch (barType)
|
||||
{
|
||||
case PackMsgType.弹幕消息:append = $"{msg?.User?.Nickname}: {msg.Content}"; break;
|
||||
case PackMsgType.下播:append = $"直播已结束"; break;
|
||||
case PackMsgType.弹幕消息: append = $"{msg?.User?.Nickname}: {msg.Content}"; break;
|
||||
case PackMsgType.下播: append = $"直播已结束"; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -296,9 +297,15 @@ namespace BarrageGrab
|
||||
GroupId = msg.groupId,
|
||||
GiftId = msg.giftId,
|
||||
GiftName = msg.Gift.Name,
|
||||
User = GetUser(msg.User)
|
||||
User = GetUser(msg.User),
|
||||
ToUser = GetUser(msg.toUser)
|
||||
};
|
||||
|
||||
if (enty.ToUser != null)
|
||||
{
|
||||
enty.Content += ",给" + enty.ToUser.Nickname;
|
||||
}
|
||||
|
||||
var msgType = PackMsgType.礼物消息;
|
||||
PrintMsg(enty, msgType);
|
||||
var pack = new BarrageMsgPack(enty.ToJson(), PackMsgType.礼物消息, e.Process);
|
||||
|
||||
Reference in New Issue
Block a user