修复窗体初始化问题;
修复轮询模式payload获取异常的问题
This commit is contained in:
@@ -29,11 +29,7 @@ namespace BarrageGrab
|
||||
InitializeComponent();
|
||||
barServer.OnPrint += WssService_OnPrint;
|
||||
barServer.Grab.Proxy.OnProxyStatus += Proxy_OnProxyStatus;
|
||||
AppRuntime.RoomCaches.OnCache += RoomCaches_OnCache;
|
||||
this.txb_wsaddr.Text = barServer.ServerLocation;
|
||||
this.txb_upstreamProxy.Text = proxy.HttpUpstreamProxy;
|
||||
this.cbx_barrageLog.Checked = AppSetting.Current.BarrageLog;
|
||||
InitTabPages();
|
||||
AppRuntime.RoomCaches.OnCache += RoomCaches_OnCache;
|
||||
}
|
||||
|
||||
private void InitTabPages()
|
||||
@@ -155,6 +151,11 @@ namespace BarrageGrab
|
||||
|
||||
private void FormView_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.txb_wsaddr.Text = barServer.ServerLocation;
|
||||
this.txb_upstreamProxy.Text = proxy.HttpUpstreamProxy;
|
||||
this.cbx_barrageLog.Checked = AppSetting.Current.BarrageLog;
|
||||
InitTabPages();
|
||||
|
||||
this.cbx_enableProxy.Checked = SystemProxy.ProxyIsOpen();
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ namespace BarrageGrab
|
||||
{
|
||||
var dir = Path.Combine(AppContext.BaseDirectory, "logs", "弹幕日志");
|
||||
var room = AppRuntime.RoomCaches.GetCachedWebRoomInfo(msg.RoomId.ToString());
|
||||
if(room == null) return;
|
||||
var date = DateTime.Now.ToString("yyyy年MM月dd日直播");
|
||||
dir = Path.Combine(dir, $"({room.WebRoomId}){room?.Owner?.Nickname ?? "-1"}", date);
|
||||
if (!Directory.Exists(dir))
|
||||
|
||||
@@ -31,5 +31,10 @@ namespace BarrageGrab.Proxy.ProxyEventArgs
|
||||
/// 域名
|
||||
/// </summary>
|
||||
public string HostName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 有效载荷
|
||||
/// </summary>
|
||||
public byte[] Payload { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,13 +207,15 @@ namespace BarrageGrab.Proxy
|
||||
//轮询方式(当抖音ws连接断开后,客户端也会降级使用轮询模式获取弹幕)
|
||||
if (uri.Contains(BARRAGE_POOL_PATH) && contentType.Contains("application/protobuffer"))
|
||||
{
|
||||
//var payload = await e.GetResponseBody();
|
||||
var payload = await e.GetResponseBody();
|
||||
|
||||
base.FireOnFetchResponse(new HttpResponseEventArgs()
|
||||
{
|
||||
HttpClient = e.HttpClient,
|
||||
ProcessID = processid,
|
||||
HostName = hostname,
|
||||
ProcessName = base.GetProcessName(processid),
|
||||
Payload = payload
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +136,9 @@ namespace BarrageGrab
|
||||
//http 数据处理
|
||||
private void Proxy_OnFetchResponse(object sender, HttpResponseEventArgs e)
|
||||
{
|
||||
var payload = e.HttpClient.Response.Body;
|
||||
var payload = e.Payload;
|
||||
|
||||
if (payload == null || payload.Length == 0) return;
|
||||
|
||||
var response = Serializer.Deserialize<Response>(new ReadOnlyMemory<byte>(payload));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user