-
Notifications
You must be signed in to change notification settings - Fork 168
/
BarrageMessages.cs
380 lines (323 loc) · 8.31 KB
/
BarrageMessages.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
using System.ComponentModel;
namespace BarrageGrab.Modles.JsonEntity
{
/// <summary>
/// 弹幕消息类型
/// </summary>
public enum PackMsgType
{
[Description("无")]
无 = 0,
[Description("消息")]
弹幕消息 = 1,
[Description("点赞")]
点赞消息 = 2,
[Description("进房")]
进直播间 = 3,
[Description("关注")]
关注消息 = 4,
[Description("礼物")]
礼物消息 = 5,
[Description("统计")]
直播间统计 = 6,
[Description("粉团")]
粉丝团消息 = 7,
[Description("分享")]
直播间分享 = 8,
[Description("下播")]
下播 = 9
}
/// <summary>
/// 粉丝团消息类型
/// </summary>
public enum FansclubType
{
无 = 0,
粉丝团升级 = 1,
加入粉丝团 = 2
}
/// <summary>
/// 直播间分享目标
/// </summary>
public enum ShareType
{
未知 = 0,
微信 = 1,
朋友圈 = 2,
微博 = 3,
QQ空间 = 4,
QQ = 5,
抖音好友 = 112
}
/// <summary>
/// 数据包装器
/// </summary>
public class BarrageMsgPack
{
/// <summary>
/// 消息类型
/// </summary>
public PackMsgType Type { get; set; }
/// <summary>
/// 进程名
/// </summary>
public string ProcessName { get; set; }
/// <summary>
/// 消息对象
/// </summary>
public string Data { get; set; }
public BarrageMsgPack()
{
}
public BarrageMsgPack(string data, PackMsgType type,string processName)
{
Data = data;
Type = type;
ProcessName = processName;
}
}
/// <summary>
/// 消息
/// </summary>
public class Msg
{
/// <summary>
/// 弹幕ID
/// </summary>
public long MsgId { get; set; }
/// <summary>
/// 用户数据
/// </summary>
public MsgUser User { get; set; }
/// <summary>
/// 主播简要信息
/// </summary>
public RoomAnchorInfo Onwer { get; set; }
/// <summary>
/// 消息内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 房间号
/// </summary>
public string RoomId { get; set; }
/// <summary>
/// web直播间ID
/// </summary>
public string WebRoomId { get; set; }
}
/// <summary>
/// 粉丝团信息
/// </summary>
public class FansClubInfo
{
/// <summary>
/// 粉丝团名称
/// </summary>
public string ClubName { get; set; }
/// <summary>
/// 粉丝团等级,没加入则0
/// </summary>
public int Level { get; set; }
}
/// <summary>
/// 直播间主播信息
/// </summary>
public class RoomAnchorInfo
{
/// <summary>
/// 用户ID
/// </summary>
public string UserId { get; set; }
/// <summary>
/// SecUid
/// </summary>
public string SecUid { get; set; }
/// <summary>
/// 昵称
/// </summary>
public string Nickname { get; set; }
/// <summary>
/// 头像地址
/// </summary>
public string HeadUrl { get; set; }
/// <summary>
/// 关注状态 0未关注,1已关注,...
/// </summary>
public int FollowStatus { get; set; }
}
/// <summary>
/// 用户弹幕信息
/// </summary>
public class MsgUser
{
/// <summary>
/// 真实ID
/// </summary>
public long Id { get; set; }
/// <summary>
/// ShortId
/// </summary>
public long ShortId { get; set; }
/// <summary>
/// 自定义ID
/// </summary>
public string DisplayId { get; set; }
/// <summary>
/// 昵称
/// </summary>
public string Nickname { get; set; }
/// <summary>
/// 未知
/// </summary>
public int Level { get; set; }
/// <summary>
/// 支付等级
/// </summary>
public int PayLevel { get; set; }
/// <summary>
/// 性别 1男 2女
/// </summary>
public int Gender { get; set; }
/// <summary>
/// 头像地址
/// </summary>
public string HeadImgUrl { get; set; }
/// <summary>
/// 用户主页地址
/// </summary>
public string SecUid { get; set; }
/// <summary>
/// 粉丝团信息
/// </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 ? "女" : "妖";
}
}
/// <summary>
/// 礼物消息
/// </summary>
public class GiftMsg : Msg
{
/// <summary>
/// 礼物ID
/// </summary>
public long GiftId { get; set; }
/// <summary>
/// 礼物名称
/// </summary>
public string GiftName { get; set; }
/// <summary>
/// 礼物分组ID
/// </summary>
public long GroupId { get; set; }
/// <summary>
/// 本次(增量)礼物数量
/// </summary>
public long GiftCount { get; set; }
/// <summary>
/// 礼物数量(连续的)
/// </summary>
public long RepeatCount { get; set; }
/// <summary>
/// 抖币价格
/// </summary>
public int DiamondCount { get; set; }
/// <summary>
/// 该礼物是否可连击
/// </summary>
public bool Combo { get; set; }
/// <summary>
/// 礼物图片地址
/// </summary>
public string ImgUrl { get; set; }
/// <summary>
/// 送礼目标(连麦直播间有用)
/// </summary>
public MsgUser ToUser { get; set; }
}
/// <summary>
/// 点赞消息
/// </summary>
public class LikeMsg : Msg
{
/// <summary>
/// 点赞数量
/// </summary>
public long Count { get; set; }
/// <summary>
/// 总共点赞数量
/// </summary>
public long Total { get; set; }
}
/// <summary>
/// 直播间统计消息
/// </summary>
public class UserSeqMsg : Msg
{
/// <summary>
/// 当前直播间用户数量
/// </summary>
public long OnlineUserCount { get; set; }
/// <summary>
/// 累计直播间用户数量
/// </summary>
public long TotalUserCount { get; set; }
/// <summary>
/// 累计直播间用户数量 显示文本
/// </summary>
public string TotalUserCountStr { get; set; }
/// <summary>
/// 当前直播间用户数量 显示文本
/// </summary>
public string OnlineUserCountStr { get; set; }
}
/// <summary>
/// 粉丝团消息
/// </summary>
public class FansclubMsg : Msg
{
/// <summary>
/// 粉丝团消息类型,升级1,加入2
/// </summary>
public int Type { get; set; }
/// <summary>
/// 粉丝团等级
/// </summary>
public int Level { get; set; }
}
/// <summary>
/// 来了消息
/// </summary>
public class MemberMessage : Msg
{
/// <summary>
/// 当前直播间人数
/// </summary>
public long CurrentCount { get; set; }
}
/// <summary>
/// 直播间分享
/// </summary>
public class ShareMessage : Msg
{
/// <summary>
/// 分享目标
/// </summary>
public ShareType ShareType { get; set; }
}
}