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