支持直播伴侣开播获取房间信息;
WebRoomid 全部改为 string
This commit is contained in:
@@ -144,11 +144,11 @@ namespace BarrageGrab
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="roomid"></param>
|
/// <param name="roomid"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public long GetCachedWebRoomid(string roomid)
|
public string GetCachedWebRoomid(string roomid)
|
||||||
{
|
{
|
||||||
RoomInfo value;
|
RoomInfo value;
|
||||||
if (RoomInfoCache.TryGetValue(roomid,out value)) return long.Parse(value.WebRoomId??"-1");
|
if (RoomInfoCache.TryGetValue(roomid,out value)) return value.WebRoomId??"未知";
|
||||||
return -1;
|
return "未知";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace BarrageGrab
|
|||||||
ForcePolling = bool.Parse(AppSettings["forcePolling"].Trim());
|
ForcePolling = bool.Parse(AppSettings["forcePolling"].Trim());
|
||||||
PollingInterval = int.Parse(AppSettings["pollingInterval"].Trim());
|
PollingInterval = int.Parse(AppSettings["pollingInterval"].Trim());
|
||||||
DisableLivePageScriptCache = bool.Parse(AppSettings["disableLivePageScriptCache"].Trim());
|
DisableLivePageScriptCache = bool.Parse(AppSettings["disableLivePageScriptCache"].Trim());
|
||||||
WebRoomIds = AppSettings["webRoomIds"].Trim().Split(',').Where(w => !string.IsNullOrWhiteSpace(w)).Select(x => long.Parse(x)).ToArray();
|
WebRoomIds = AppSettings["webRoomIds"].Trim().Split(',').Where(w => !string.IsNullOrWhiteSpace(w)).ToArray();
|
||||||
|
|
||||||
ConfigComPort();
|
ConfigComPort();
|
||||||
ConfigFilter();
|
ConfigFilter();
|
||||||
@@ -177,7 +177,7 @@ namespace BarrageGrab
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 监听的房间号
|
/// 监听的房间号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long[] WebRoomIds { get; private set; } = new long[0];
|
public string[] WebRoomIds { get; private set; } = new string[0];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 使用域名过滤
|
/// 使用域名过滤
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ namespace BarrageGrab.Modles.JsonEntity
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// web直播间ID
|
/// web直播间ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long WebRoomId { get; set; }
|
public string WebRoomId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace BarrageGrab.Modles
|
|||||||
/// Web房间号
|
/// Web房间号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string WebRoomId { get; set; }
|
public string WebRoomId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 房间号
|
/// 房间号
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -66,7 +66,7 @@ namespace BarrageGrab.Modles
|
|||||||
/// 直播间管理员用户id
|
/// 直播间管理员用户id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<string> AdminUserIds { get; set; } = new List<string>();
|
public List<string> AdminUserIds { get; set; } = new List<string>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 主播信息
|
/// 主播信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -510,7 +510,7 @@ namespace BarrageGrab.Modles
|
|||||||
/// <param name="html"></param>
|
/// <param name="html"></param>
|
||||||
/// <param name="result"></param>
|
/// <param name="result"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static Tuple<int,string> TryParseRoomPageHtml(string html, out RoomInfo result)
|
public static Tuple<int, string> TryParseRoomPageHtml(string html, out RoomInfo result)
|
||||||
{
|
{
|
||||||
result = null;
|
result = null;
|
||||||
if (html.IsNullOrWhiteSpace())
|
if (html.IsNullOrWhiteSpace())
|
||||||
@@ -579,7 +579,66 @@ namespace BarrageGrab.Modles
|
|||||||
HeadUrl = roomOwner["avatar_thumb"]["url_list"].Values<string>()?.FirstOrDefault() ?? "",
|
HeadUrl = roomOwner["avatar_thumb"]["url_list"].Values<string>()?.FirstOrDefault() ?? "",
|
||||||
FollowStatus = roomOwner["follow_info"]["follow_status"].Value<int>()
|
FollowStatus = roomOwner["follow_info"]["follow_status"].Value<int>()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
return Tuple.Create(0, "succ");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从直播伴侣的直播创建回调中解析房间信息
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="json"></param>
|
||||||
|
/// <param name="info"></param>
|
||||||
|
/// <param name="cache">缓存</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static Tuple<int, string> TryParseStreamPusherCreate(string json, out RoomInfo info)
|
||||||
|
{
|
||||||
|
info = null;
|
||||||
|
JObject res;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
res = JsonConvert.DeserializeObject<JObject>(json);
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return Tuple.Create(4, "不是合法的json格式");
|
||||||
|
}
|
||||||
|
if (res == null)
|
||||||
|
{
|
||||||
|
return Tuple.Create(1, "正文为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
var rootData = res["data"];
|
||||||
|
var ownerInfo = rootData["owner"];
|
||||||
|
|
||||||
|
var dto = new RoomInfo();
|
||||||
|
dto.RoomId = rootData["id_str"]?.ToString() ?? "";
|
||||||
|
dto.AdminUserIds = rootData["admin_user_ids_str"]?.Values<string>().ToList() ?? new List<string>();
|
||||||
|
dto.IsLive = rootData["status"]?.Value<int>() == 2;
|
||||||
|
dto.Title = rootData["title"]?.ToString() ?? "";
|
||||||
|
dto.UserCount = long.Parse(rootData["room_view_stats"]?["display_value"]?.Value<string>() ?? "0");
|
||||||
|
dto.TotalUserCount = rootData["room_view_stats"]?["total_user_str"]?.Value<string>() ?? "0";
|
||||||
|
dto.LikeCount = rootData["like_count"]?.Value<long>() ?? 0;
|
||||||
|
dto.QrcodeUrl = $"https://live.douyin.com/{ownerInfo?["display_id"] ?? ""}";
|
||||||
|
dto.AuthInfo = rootData["room_auth"]?.ToObject<RoomInfo.RoomAuth>();
|
||||||
|
dto.Cover = rootData["cover"]?["url_list"]?.Values<string>().FirstOrDefault() ?? "";//下播情况下没有cover字段
|
||||||
|
dto.WebRoomId = rootData["web_rid"]?.ToString() ?? ownerInfo?["display_id"]?.ToString() ?? "";
|
||||||
|
if (ownerInfo != null)
|
||||||
|
{
|
||||||
|
dto.Owner = new RoomAnchor()
|
||||||
|
{
|
||||||
|
UserId = ownerInfo["id_str"].ToString(),
|
||||||
|
Nickname = ownerInfo["nickname"].ToString(),
|
||||||
|
SecUid = ownerInfo["sec_uid"].ToString(),
|
||||||
|
HeadUrl = ownerInfo["avatar_thumb"]?["url_list"]?.Values<string>()?.FirstOrDefault()?.ToString(),
|
||||||
|
FollowStatus = ownerInfo["follow_info"]?["follow_status"]?.Value<int>() ?? 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
info = dto;
|
||||||
|
|
||||||
return Tuple.Create(0, "succ");
|
return Tuple.Create(0, "succ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,759 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace BarrageGrab.Modles
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物信息
|
||||||
|
/// </summary>
|
||||||
|
public class WebCastGift
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 图片信息
|
||||||
|
/// </summary>
|
||||||
|
public GiftImage image { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 描述
|
||||||
|
/// </summary>
|
||||||
|
public string describe { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否通知
|
||||||
|
/// </summary>
|
||||||
|
public bool notify { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 持续时长
|
||||||
|
/// </summary>
|
||||||
|
public int duration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// ID
|
||||||
|
/// </summary>
|
||||||
|
public long id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 用于连麦
|
||||||
|
/// </summary>
|
||||||
|
public bool for_linkmic { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 涂鸦
|
||||||
|
/// </summary>
|
||||||
|
public bool doodle { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 用于粉丝团
|
||||||
|
/// </summary>
|
||||||
|
public bool for_fansclub { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是连击礼物
|
||||||
|
/// </summary>
|
||||||
|
public bool combo { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 类型
|
||||||
|
/// </summary>
|
||||||
|
public int type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 钻石数量
|
||||||
|
/// </summary>
|
||||||
|
public int diamond_count { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否显示在礼物面板上
|
||||||
|
/// </summary>
|
||||||
|
public bool is_displayed_on_panel { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 主要效果 ID
|
||||||
|
/// </summary>
|
||||||
|
public int primary_effect_id { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 名称
|
||||||
|
/// </summary>
|
||||||
|
public string name { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 区域
|
||||||
|
/// </summary>
|
||||||
|
public string region { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 手动
|
||||||
|
/// </summary>
|
||||||
|
public string manual { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为自定义礼物
|
||||||
|
/// </summary>
|
||||||
|
public bool for_custom { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 特殊效果
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, object> special_effects { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图标信息
|
||||||
|
/// </summary>
|
||||||
|
public Icon icon { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 行为类型
|
||||||
|
/// </summary>
|
||||||
|
public int action_type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 西瓜子数
|
||||||
|
/// </summary>
|
||||||
|
public int watermelon_seeds { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 金特效
|
||||||
|
/// </summary>
|
||||||
|
public string gold_effect { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订阅列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> subs { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 金豆数
|
||||||
|
/// </summary>
|
||||||
|
public int golden_beans { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 荣誉等级
|
||||||
|
/// </summary>
|
||||||
|
public int honor_level { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 物品类型
|
||||||
|
/// </summary>
|
||||||
|
public int item_type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 方案链接
|
||||||
|
/// </summary>
|
||||||
|
public string scheme_url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 事件名称
|
||||||
|
/// </summary>
|
||||||
|
public string event_name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 贵族等级
|
||||||
|
/// </summary>
|
||||||
|
public int noble_level { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 引导链接
|
||||||
|
/// </summary>
|
||||||
|
public string guide_url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 惩罚药物
|
||||||
|
/// </summary>
|
||||||
|
public bool punish_medicine { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为门户
|
||||||
|
/// </summary>
|
||||||
|
public bool for_portal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 商业文本
|
||||||
|
/// </summary>
|
||||||
|
public string business_text { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为CNY礼物
|
||||||
|
/// </summary>
|
||||||
|
public bool cny_gift { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// App ID
|
||||||
|
/// </summary>
|
||||||
|
public int app_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// VIP等级
|
||||||
|
/// </summary>
|
||||||
|
public int vip_level { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否灰度
|
||||||
|
/// </summary>
|
||||||
|
public bool is_gray { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 灰度方案链接
|
||||||
|
/// </summary>
|
||||||
|
public string gray_scheme_url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物场景
|
||||||
|
/// </summary>
|
||||||
|
public int gift_scene { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 触发词语列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> trigger_words { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物Buff信息列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> gift_buff_infos { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为首充礼物
|
||||||
|
/// </summary>
|
||||||
|
public bool for_first_recharge { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发送后动作
|
||||||
|
/// </summary>
|
||||||
|
public int after_send_action { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物下线时间
|
||||||
|
/// </summary>
|
||||||
|
public int gift_offline_time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 顶部栏文本
|
||||||
|
/// </summary>
|
||||||
|
public string top_bar_text { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 横幅方案链接
|
||||||
|
/// </summary>
|
||||||
|
public string banner_scheme_url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否锁定
|
||||||
|
/// </summary>
|
||||||
|
public bool is_locked { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 请求额外类型
|
||||||
|
/// </summary>
|
||||||
|
public int req_extra_type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 资产ID列表
|
||||||
|
/// </summary>
|
||||||
|
public List<int> asset_ids { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物预览信息
|
||||||
|
/// </summary>
|
||||||
|
public GiftPreviewInfo gift_preview_info { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物提示信息
|
||||||
|
/// </summary>
|
||||||
|
public GiftTip gift_tip { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 需要扫光次数
|
||||||
|
/// </summary>
|
||||||
|
public int need_sweep_light_count { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分组信息列表
|
||||||
|
/// </summary>
|
||||||
|
public List<GroupInfo> group_info { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 神秘商店状态
|
||||||
|
/// </summary>
|
||||||
|
public int mystery_shop_status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 可选资产ID列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> optional_asset_ids { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否禁用心愿单
|
||||||
|
/// </summary>
|
||||||
|
public bool disable_wish_list { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 托盘动态图可翻转
|
||||||
|
/// </summary>
|
||||||
|
public bool tray_dynamic_img_flippable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Pico展示动作
|
||||||
|
/// </summary>
|
||||||
|
public int pico_show_action { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选择的动态效果
|
||||||
|
/// </summary>
|
||||||
|
public int selected_dynamic_effect { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 业务类型
|
||||||
|
/// </summary>
|
||||||
|
public int biz_type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// WebP图片信息
|
||||||
|
/// </summary>
|
||||||
|
public WebpImage webp_image { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物来源
|
||||||
|
/// </summary>
|
||||||
|
public int gift_source { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class GiftImage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 图片 URL 列表
|
||||||
|
/// </summary>
|
||||||
|
public List<string> url_list { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片 URI
|
||||||
|
/// </summary>
|
||||||
|
public string uri { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片高度
|
||||||
|
/// </summary>
|
||||||
|
public int height { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片宽度
|
||||||
|
/// </summary>
|
||||||
|
public int width { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 平均颜色
|
||||||
|
/// </summary>
|
||||||
|
public string avg_color { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片类型
|
||||||
|
/// </summary>
|
||||||
|
public int image_type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 开放的网页 URL
|
||||||
|
/// </summary>
|
||||||
|
public string open_web_url { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是动画
|
||||||
|
/// </summary>
|
||||||
|
public bool is_animated { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 弹性设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> flex_setting_list { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文本设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> text_setting_list { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Icon
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 图标 URL 列表
|
||||||
|
/// </summary>
|
||||||
|
public List<string> url_list { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图标 URI
|
||||||
|
/// </summary>
|
||||||
|
public string uri { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图标高度
|
||||||
|
/// </summary>
|
||||||
|
public int height { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图标宽度
|
||||||
|
/// </summary>
|
||||||
|
public int width { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 平均颜色
|
||||||
|
/// </summary>
|
||||||
|
public string avg_color { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图标类型
|
||||||
|
/// </summary>
|
||||||
|
public int image_type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 开放的网页 URL
|
||||||
|
/// </summary>
|
||||||
|
public string open_web_url { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是动画
|
||||||
|
/// </summary>
|
||||||
|
public bool is_animated { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 弹性设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> flex_setting_list { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文本设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> text_setting_list { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GiftTipDisplayTextKeyPiece
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 键
|
||||||
|
/// </summary>
|
||||||
|
public string key { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 默认模式
|
||||||
|
/// </summary>
|
||||||
|
public string default_pattern { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 片段列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> pieces { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 模式信息
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, object> schema_infos { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GiftTipDisplayText
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 显示文本键
|
||||||
|
/// </summary>
|
||||||
|
public GiftTipDisplayTextKeyPiece display_text { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GiftTip
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 显示文本
|
||||||
|
/// </summary>
|
||||||
|
public GiftTipDisplayText display_text { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 背景颜色
|
||||||
|
/// </summary>
|
||||||
|
public string background_color { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 剩余时长
|
||||||
|
/// </summary>
|
||||||
|
public int remaining_duration { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 倒计时截止时间
|
||||||
|
/// </summary>
|
||||||
|
public int countdown_deadline_time { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GiftPreviewInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 锁定状态
|
||||||
|
/// </summary>
|
||||||
|
public int lock_status { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 客户端阻止使用网页链接
|
||||||
|
/// </summary>
|
||||||
|
public bool client_block_use_scheme_url { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 阻止网页链接
|
||||||
|
/// </summary>
|
||||||
|
public string block_scheme_url { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 客户端检查剩余钻石
|
||||||
|
/// </summary>
|
||||||
|
public bool client_check_left_diamond { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 阻止提示
|
||||||
|
/// </summary>
|
||||||
|
public string block_toast { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GroupInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 组数量
|
||||||
|
/// </summary>
|
||||||
|
public int group_count { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 组文本
|
||||||
|
/// </summary>
|
||||||
|
public string group_text { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WebpImage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 图片 URL 列表
|
||||||
|
/// </summary>
|
||||||
|
public List<string> url_list { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片 URI
|
||||||
|
/// </summary>
|
||||||
|
public string uri { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片高度
|
||||||
|
/// </summary>
|
||||||
|
public int height { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片宽度
|
||||||
|
/// </summary>
|
||||||
|
public int width { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 平均颜色
|
||||||
|
/// </summary>
|
||||||
|
public string avg_color { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 图片类型
|
||||||
|
/// </summary>
|
||||||
|
public int image_type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 开放的网页 URL
|
||||||
|
/// </summary>
|
||||||
|
public string open_web_url { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 是否是动画
|
||||||
|
/// </summary>
|
||||||
|
public bool is_animated { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 弹性设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> flex_setting_list { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 文本设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> text_setting_list { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物组信息
|
||||||
|
/// </summary>
|
||||||
|
public class GiftsInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 新礼物ID
|
||||||
|
/// </summary>
|
||||||
|
public int new_gift_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 粉丝团礼物ID列表
|
||||||
|
/// </summary>
|
||||||
|
public List<int> fansclub_gift_ids { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 快速礼物ID
|
||||||
|
/// </summary>
|
||||||
|
public int speedy_gift_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物词语
|
||||||
|
/// </summary>
|
||||||
|
public string gift_words { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物组信息列表
|
||||||
|
/// </summary>
|
||||||
|
public List<GiftGroupInfo> gift_group_infos { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 免费礼物项列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> free_cell_items { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 荣耀礼物ID列表
|
||||||
|
/// </summary>
|
||||||
|
public List<int> honor_gift_ids { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 游戏礼物项列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> game_gift_items { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 贵族礼物ID列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> noble_gift_ids { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否隐藏充值入口
|
||||||
|
/// </summary>
|
||||||
|
public bool hide_recharge_entry { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物入口图标信息
|
||||||
|
/// </summary>
|
||||||
|
public GiftEntranceIcon gift_entrance_icon { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// VIP礼物ID列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> vip_gift_ids { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物连击信息列表
|
||||||
|
/// </summary>
|
||||||
|
public List<GiftComboInfo> gift_combo_infos { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 快速礼物弹窗信息
|
||||||
|
/// </summary>
|
||||||
|
public SpeedyGiftPopupInfo speedy_gift_popup_info { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 首充快速礼物ID
|
||||||
|
/// </summary>
|
||||||
|
public int first_recharge_speedy_gift_id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 消息处理过滤器
|
||||||
|
/// </summary>
|
||||||
|
public MsgProcessFilter msg_process_filter { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 额外参数
|
||||||
|
/// </summary>
|
||||||
|
public ExtraParams extra_params { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 连击信息
|
||||||
|
/// </summary>
|
||||||
|
public class GiftComboInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 连击次数
|
||||||
|
/// </summary>
|
||||||
|
public int combo_count { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 连击效果图片信息
|
||||||
|
/// </summary>
|
||||||
|
public ComboEffectImage combo_effect_img { get; set; }
|
||||||
|
|
||||||
|
public class ComboEffectImage
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 图片URL列表
|
||||||
|
/// </summary>
|
||||||
|
public List<string> url_list { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片URI
|
||||||
|
/// </summary>
|
||||||
|
public string uri { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片高度
|
||||||
|
/// </summary>
|
||||||
|
public int height { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片宽度
|
||||||
|
/// </summary>
|
||||||
|
public int width { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 平均颜色
|
||||||
|
/// </summary>
|
||||||
|
public string avg_color { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 图片类型
|
||||||
|
/// </summary>
|
||||||
|
public int image_type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 打开网页链接
|
||||||
|
/// </summary>
|
||||||
|
public string open_web_url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否为动画
|
||||||
|
/// </summary>
|
||||||
|
public bool is_animated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 弹性设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> flex_setting_list { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文本设置列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> text_setting_list { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GiftGroupInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物组数量
|
||||||
|
/// </summary>
|
||||||
|
public int group_count { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物组文本
|
||||||
|
/// </summary>
|
||||||
|
public string group_text { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GiftEntranceIcon
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 图片URL列表
|
||||||
|
/// </summary>
|
||||||
|
public List<string> url_list { get; set; }
|
||||||
|
|
||||||
|
// ... (其他字段和类型同 ComboEffectImage)
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SpeedyGiftPopupInfo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 工具栏图标方案URL
|
||||||
|
/// </summary>
|
||||||
|
public string toolbar_icon_scheme_url { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 弹出信息列表
|
||||||
|
/// </summary>
|
||||||
|
public List<object> pop_up_info { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 额外信息
|
||||||
|
/// </summary>
|
||||||
|
public object extra { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class MsgProcessFilter
|
||||||
|
{
|
||||||
|
// ... (这里可能还有其他字段,需要查看实际 JSON 结构)
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ExtraParams
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 预测字典
|
||||||
|
/// </summary>
|
||||||
|
public PredictDict predict_dict { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PredictDict
|
||||||
|
{
|
||||||
|
// ... (这里可能还有其他字段,需要查看实际 JSON 结构)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Response 包装器
|
||||||
|
/// </summary>
|
||||||
|
public class WebCastGiftPack
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物组
|
||||||
|
/// </summary>
|
||||||
|
public GiftsInfo gifts_info { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 礼物列表
|
||||||
|
/// </summary>
|
||||||
|
public List<WebCastGift> gifts { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,13 +30,13 @@ namespace BarrageGrab
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="obj"></param>
|
/// <param name="obj"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string ToJson(this object obj)
|
public static string ToJson(this object obj,bool format = false)
|
||||||
{
|
{
|
||||||
if (obj is string)
|
if (obj is string)
|
||||||
{
|
{
|
||||||
return obj.ToString();
|
return obj.ToString();
|
||||||
}
|
}
|
||||||
return JsonConvert.SerializeObject(obj);
|
return JsonConvert.SerializeObject(obj, format?Formatting.Indented:Formatting.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ using System.Net.Security;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using BarrageGrab.Modles;
|
using BarrageGrab.Modles;
|
||||||
|
using BarrageGrab.Modles.JsonEntity;
|
||||||
using BarrageGrab.Proxy.ProxyEventArgs;
|
using BarrageGrab.Proxy.ProxyEventArgs;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using Titanium.Web.Proxy;
|
using Titanium.Web.Proxy;
|
||||||
using Titanium.Web.Proxy.EventArguments;
|
using Titanium.Web.Proxy.EventArguments;
|
||||||
using Titanium.Web.Proxy.Http;
|
using Titanium.Web.Proxy.Http;
|
||||||
@@ -28,6 +31,7 @@ namespace BarrageGrab.Proxy
|
|||||||
const string USER_INFO_PATH = "/webcast/user/me/";
|
const string USER_INFO_PATH = "/webcast/user/me/";
|
||||||
const string BARRAGE_POOL_PATH = "/webcast/im/fetch";
|
const string BARRAGE_POOL_PATH = "/webcast/im/fetch";
|
||||||
const string LIVE_SCRIPT_PATH = "/obj/static/webcast/douyin_live";
|
const string LIVE_SCRIPT_PATH = "/obj/static/webcast/douyin_live";
|
||||||
|
const string WEBCAST_AMEMV_HOST = "webcast.amemv.com";
|
||||||
|
|
||||||
public override string HttpUpstreamProxy { get { return proxyServer?.UpStreamHttpProxy?.ToString() ?? ""; } }
|
public override string HttpUpstreamProxy { get { return proxyServer?.UpStreamHttpProxy?.ToString() ?? ""; } }
|
||||||
|
|
||||||
@@ -80,6 +84,10 @@ namespace BarrageGrab.Proxy
|
|||||||
proxyServer.CertificateManager.CreateRootCertificate();
|
proxyServer.CertificateManager.CreateRootCertificate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//信任证书
|
||||||
|
proxyServer.CertificateManager.CreateRootCertificate();
|
||||||
|
proxyServer.CertificateManager.TrustRootCertificate(true);
|
||||||
|
|
||||||
proxyServer.ServerCertificateValidationCallback += ProxyServer_ServerCertificateValidationCallback;
|
proxyServer.ServerCertificateValidationCallback += ProxyServer_ServerCertificateValidationCallback;
|
||||||
proxyServer.BeforeResponse += ProxyServer_BeforeResponse;
|
proxyServer.BeforeResponse += ProxyServer_BeforeResponse;
|
||||||
//proxyServer.AfterResponse += ProxyServer_AfterResponse;
|
//proxyServer.AfterResponse += ProxyServer_AfterResponse;
|
||||||
@@ -121,6 +129,9 @@ namespace BarrageGrab.Proxy
|
|||||||
var processName = base.GetProcessName(processid);
|
var processName = base.GetProcessName(processid);
|
||||||
var contentType = e.HttpClient.Response.ContentType ?? "";
|
var contentType = e.HttpClient.Response.ContentType ?? "";
|
||||||
|
|
||||||
|
//处理直播伴侣开播更新
|
||||||
|
await HookSelfLive(e);
|
||||||
|
|
||||||
//处理弹幕
|
//处理弹幕
|
||||||
await HookBarrage(e);
|
await HookBarrage(e);
|
||||||
|
|
||||||
@@ -131,6 +142,51 @@ namespace BarrageGrab.Proxy
|
|||||||
await HookScriptAsync(e);
|
await HookScriptAsync(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hook 直播伴侣开播信息并更新
|
||||||
|
private async Task HookSelfLive(SessionEventArgs e)
|
||||||
|
{
|
||||||
|
//Hook 直播伴侣直播间创建 https://webcast.amemv.com/webcast/room/create/?ac=wifi&app_name=webcast_mate&version_code=7.3.3&device_platform=windows&webcast_sdk_version=1520&resolution=1707%2A1067&os_version=10.0.22621&language=zh&aid=2079&live_id=1&channel=online&device_id=2164319493312045&iid=42200736232026&extra_first_tag_id=22&extra_second_tag_id=22093&extra_third_tag_id=22093195&extra_encoder_core=qsv&extra_codec_name=h264_qsv_ex&extra_codec_is_ex=1&extra_use_265=0&msToken=8tJ0NCHWun7wHpdPd_fd0_nlUmgRwM8sQYThkqkq4-qR00mKiJ3Wd3h05r4mm5HO_R_qA2qeTIn8qR2yjcXXoh5mmXkewUuTS4G1Yoi_D-m8EZiacZVWoDqgnqw=&X-Bogus=DFSzswVLJzC4fUiKt5a4a3JCqOA1&_signature=_02B4Z6wo00001fHp2wAAAIDCdmADbSJfNUnx6d-AABpim6xRe8bmnvrrC1Z7GWTwK8sPujtot.bkv7h8bk-nde0WvO-78H3cwglXRzZk8uHTs3ZKWlZqOqaBVjgdHIRritV.peh4bkRETofZ7f
|
||||||
|
string uri = e.HttpClient.Request.RequestUri.ToString();
|
||||||
|
var urix = new Uri(uri);
|
||||||
|
var processid = e.HttpClient.ProcessId.Value;
|
||||||
|
var processName = base.GetProcessName(processid);
|
||||||
|
var response = e.HttpClient.Response;
|
||||||
|
if (urix.AbsolutePath != "/webcast/room/create/") return;
|
||||||
|
if (processName != "直播伴侣") return;
|
||||||
|
if (response.StatusCode != 200) return;
|
||||||
|
var reponse = await e.GetResponseBodyAsString();
|
||||||
|
RoomInfo roomInfo;
|
||||||
|
//缓存直播间信息
|
||||||
|
var tupe = RoomInfo.TryParseStreamPusherCreate(reponse, out roomInfo);
|
||||||
|
var code = tupe.Item1;
|
||||||
|
var msg = tupe.Item2;
|
||||||
|
|
||||||
|
if (code != 0)
|
||||||
|
{
|
||||||
|
Logger.LogWarn($"直播伴侣开播房间资料缓存失败,原因:{msg}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var jobj = JsonConvert.DeserializeObject<JObject>(reponse);
|
||||||
|
|
||||||
|
var roomid = jobj["data"]?["id_str"]?.Value<string>();
|
||||||
|
var sec_uid = jobj["data"]?["owner"]?["sec_uid"]?.Value<string>();
|
||||||
|
var nickname = jobj["data"]?["owner"]?["nickname"]?.Value<string>();
|
||||||
|
var displayId = jobj["data"]?["owner"]?["display_id"]?.Value<string>();
|
||||||
|
|
||||||
|
if (roomInfo != null && !roomid.IsNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
roomInfo.RoomId = roomid;
|
||||||
|
roomInfo.Title = jobj["data"]?["title"]?.Value<string>();
|
||||||
|
Logger.LogInfo($"直播伴侣开播,开播账号:{displayId} {nickname} ,更新RoomId={roomInfo.RoomId}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (roomInfo != null)
|
||||||
|
{
|
||||||
|
AppRuntime.RoomCaches.AddRoomInfoCache(roomInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Hook 弹幕
|
// Hook 弹幕
|
||||||
private async Task HookBarrage(SessionEventArgs e)
|
private async Task HookBarrage(SessionEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -425,7 +481,8 @@ namespace BarrageGrab.Proxy
|
|||||||
var decryptSsls = new string[]
|
var decryptSsls = new string[]
|
||||||
{
|
{
|
||||||
SCRIPT_HOST,
|
SCRIPT_HOST,
|
||||||
LIVE_HOST
|
LIVE_HOST,
|
||||||
|
WEBCAST_AMEMV_HOST , //直播伴侣开播请求地址
|
||||||
};
|
};
|
||||||
|
|
||||||
if (decryptSsls.Contains(hostname))
|
if (decryptSsls.Contains(hostname))
|
||||||
|
|||||||
@@ -127,7 +127,10 @@ namespace BarrageGrab
|
|||||||
|
|
||||||
response.Messages.ForEach(f => DoMessage(f,e.ProcessName));
|
response.Messages.ForEach(f => DoMessage(f,e.ProcessName));
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.LogError(ex,$"处理弹幕数据包时出错:{ex.Message}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//http 数据处理
|
//http 数据处理
|
||||||
@@ -203,43 +206,6 @@ namespace BarrageGrab
|
|||||||
case "WebcastGiftMessage":
|
case "WebcastGiftMessage":
|
||||||
{
|
{
|
||||||
var arg = Serializer.Deserialize<GiftMessage>(new ReadOnlyMemory<byte>(msg.Payload));
|
var arg = Serializer.Deserialize<GiftMessage>(new ReadOnlyMemory<byte>(msg.Payload));
|
||||||
|
|
||||||
if (arg.Gift == null)
|
|
||||||
{
|
|
||||||
if (arg.giftId == 685)
|
|
||||||
{
|
|
||||||
arg.Gift = new GiftStruct()
|
|
||||||
{
|
|
||||||
Id = arg.giftId,
|
|
||||||
Name = "粉丝灯牌",
|
|
||||||
diamondCount = 1
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else if (arg.giftId == 3389)
|
|
||||||
{
|
|
||||||
arg.Gift = new GiftStruct()
|
|
||||||
{
|
|
||||||
Id = arg.giftId,
|
|
||||||
Name = "欢乐盲盒",
|
|
||||||
diamondCount = 10
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else if (arg.giftId == 4021)
|
|
||||||
{
|
|
||||||
arg.Gift = new GiftStruct()
|
|
||||||
{
|
|
||||||
Id = arg.giftId,
|
|
||||||
Name = "欢乐拼图",
|
|
||||||
diamondCount = 10
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.PrintColor("未能识别的礼物ID:" + arg.giftId, ConsoleColor.Red);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.OnGiftMessage?.Invoke(this, new RoomMessageEventArgs<GiftMessage>(processName, arg));
|
this.OnGiftMessage?.Invoke(this, new RoomMessageEventArgs<GiftMessage>(processName, arg));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,7 @@
|
|||||||
<Compile Include="AppRuntime.cs" />
|
<Compile Include="AppRuntime.cs" />
|
||||||
<Compile Include="AppSetting.cs" />
|
<Compile Include="AppSetting.cs" />
|
||||||
<Compile Include="ComPortServer.cs" />
|
<Compile Include="ComPortServer.cs" />
|
||||||
|
<Compile Include="DyServer.cs" />
|
||||||
<Compile Include="Forms\FormView.cs">
|
<Compile Include="Forms\FormView.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -166,6 +167,7 @@
|
|||||||
<Compile Include="Modles\ProtoEntity\Messages.cs" />
|
<Compile Include="Modles\ProtoEntity\Messages.cs" />
|
||||||
<Compile Include="Modles\ProtoEntity\Wss.cs" />
|
<Compile Include="Modles\ProtoEntity\Wss.cs" />
|
||||||
<Compile Include="Modles\RoomInfo.cs" />
|
<Compile Include="Modles\RoomInfo.cs" />
|
||||||
|
<Compile Include="Modles\WebCastGift.cs" />
|
||||||
<Compile Include="ObjectExtension.cs" />
|
<Compile Include="ObjectExtension.cs" />
|
||||||
<Compile Include="Proxy\ProxyEventArgs\HttpResponseEventArgs.cs" />
|
<Compile Include="Proxy\ProxyEventArgs\HttpResponseEventArgs.cs" />
|
||||||
<Compile Include="Proxy\ProxyEventArgs\SystemProxyChangeEventArgs.cs" />
|
<Compile Include="Proxy\ProxyEventArgs\SystemProxyChangeEventArgs.cs" />
|
||||||
@@ -181,6 +183,10 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
|
<None Include="LocalData\gift.json">
|
||||||
|
<CustomToolNamespace>WssBarrageService.Resource.LocalData</CustomToolNamespace>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
<None Include="nlog.config">
|
<None Include="nlog.config">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
@@ -215,5 +221,6 @@
|
|||||||
<DependentUpon>RoomDetail.cs</DependentUpon>
|
<DependentUpon>RoomDetail.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup />
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user