添加了部分字段

This commit is contained in:
小白猿
2023-04-24 21:39:22 +08:00
parent 7181a8f4ff
commit 4390371d62
3 changed files with 62 additions and 15 deletions
+37 -1
View File
@@ -121,6 +121,11 @@
/// </summary>
public long Id { get; set; }
/// <summary>
/// ShortId
/// </summary>
public long ShortId { get; set; }
/// <summary>
/// 自定义ID
/// </summary>
@@ -132,10 +137,15 @@
public string Nickname { get; set; }
/// <summary>
/// 等级
/// 未知
/// </summary>
public int Level { get; set; }
/// <summary>
/// 支付等级
/// </summary>
public int PayLevel { get; set; }
/// <summary>
/// 性别 1男 2女
/// </summary>
@@ -156,6 +166,22 @@
/// </summary>
public FansClubInfo FansClub { get; set; }
/// <summary>
/// 粉丝数
/// </summary>
public long FollowerCount { get; set; }
/// <summary>
/// 关注状态 0 未关注 1 已关注 2,不明
/// </summary>
public long FollowStatus { get; set; }
/// <summary>
/// 关注数
/// </summary>
public long FollowingCount;
public string GenderToString()
{
return Gender == 1 ? "男" : Gender == 2 ? "女" : "妖";
@@ -177,6 +203,11 @@
/// </summary>
public string GiftName { get; set; }
/// <summary>
/// 礼物分组ID
/// </summary>
public long GroupId { get; set; }
/// <summary>
/// 本次(增量)礼物数量
/// </summary>
@@ -244,6 +275,11 @@
/// 粉丝团消息类型,升级1,加入2
/// </summary>
public int Type { get; set; }
/// <summary>
/// 粉丝团等级
/// </summary>
public int Level { get; set; }
}
/// <summary>
+17 -2
View File
@@ -85,12 +85,17 @@ namespace BarrageGrab
MsgUser user = new MsgUser()
{
DisplayId = data.displayId,
ShortId = data.shortId,
Gender = data.Gender,
Id = data.Id,
Level = data.Level,
PayLevel = (int)(data.payGrade?.Level??0),
Nickname = data.Nickname,
HeadImgUrl = data.avatarThumb.urlLists.FirstOrDefault() ?? "",
SecUid = data.sec_uid
SecUid = data.sec_uid,
FollowerCount = data.followInfo.followerCount,
FollowingCount = data.followInfo.followingCount,
FollowStatus = data.followInfo.followStatus,
};
user.FansClub = new FansClubInfo()
{
@@ -101,7 +106,7 @@ namespace BarrageGrab
if (data.fansClub != null && data.fansClub.Data != null)
{
user.FansClub.ClubName = data.fansClub.Data.clubName;
user.Level = data.fansClub.Data.Level;
user.FansClub.Level = data.fansClub.Data.Level;
}
return user;
@@ -119,6 +124,7 @@ namespace BarrageGrab
Type = e.Type,
User = GetUser(e.User)
};
enty.Level = enty.User.FansClub.Level;
Print(enty.User.GenderToString() + " " + enty.Content, ConsoleColor.Blue, BarrageMsgType.粉丝团消息);
var pack = new BarrageMsgPack(JsonConvert.SerializeObject(enty), BarrageMsgType.粉丝团消息);
var json = JsonConvert.SerializeObject(pack);
@@ -208,11 +214,13 @@ namespace BarrageGrab
DiamondCount = e.Gift.diamondCount,
RepeatCount = currCount,
GiftCount = count,
GroupId = e.groupId,
GiftId = e.giftId,
GiftName = e.Gift.Name,
User = GetUser(e.User)
};
Print($"{enty.User.GenderToString()} {enty.Content}", ConsoleColor.Red, BarrageMsgType.礼物消息);
var pack = new BarrageMsgPack(JsonConvert.SerializeObject(enty), BarrageMsgType.礼物消息);
var json = JsonConvert.SerializeObject(pack);
@@ -315,7 +323,14 @@ namespace BarrageGrab
RoomId = e.Common.roomId,
User = GetUser(e.User)
};
Print($"{enty.User.GenderToString()} {enty.User.Nickname}: {enty.Content}", ConsoleColor.White, BarrageMsgType.弹幕消息);
if (e.User.followInfo.followStatus != 1 && e.User.followInfo.followStatus != 0 && e.User.followInfo.followStatus != 2)
{
Console.WriteLine(e.User.followInfo.followStatus);
}
var pack = new BarrageMsgPack(JsonConvert.SerializeObject(enty), BarrageMsgType.弹幕消息);
var json = JsonConvert.SerializeObject(pack);
this.Broadcast(json);
+4 -8
View File
@@ -3,6 +3,10 @@
## ⛳近期更新
2023-04-24 v2.6.5
1.新增了若干用户字段,包括用户shortid,粉丝数,关注数,主播关注状态,消费等级,并修正了粉丝团等级的错误赋值;礼物消息新增了GroupId用于帮助区分礼物连送分组; 字段详解见 [BarrageMessages.cs](./BarrageGrab/JsonEntity/BarrageMessages.cs)
2023-04-10 v2.6.4
1. 修改为礼物消息为增量推送,不再逐个推送,增量字段为GiftCount
@@ -20,14 +24,6 @@
1. 丰富了用户的数据信息,支持房间号过滤(见配置文件)
2023-03-09 v2.6.0
1. 针对直播伴侣抓不到的问题 放宽了域名规则限制(个人没几个粉丝,不好测试,有问题请第一时间提出)
2. 添加了更多配置项,请再次查看[配置说明](#tag1)
3. 添加了域名成功解包的日志记录,用于在出现问题的情况下手动调配,见[详细描述](#tag2)
## 😎介绍及配置