添加 Appid 字段 和 EnterTipType 字段
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
<!--直播伴侣exe文件位置(除非程序找不到,否则请留空)-->
|
||||
<add key="liveCompanPath" value="" />
|
||||
<!--直播伴侣进程代理开关-->
|
||||
<add key="liveCompanHookSwitch" value="false" />
|
||||
<add key="liveCompanHookSwitch" value="true" />
|
||||
</appSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
@@ -85,6 +85,10 @@
|
||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -53,6 +53,15 @@ namespace BarrageGrab.Modles.JsonEntity
|
||||
抖音好友 = 112
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 观众的进入方式
|
||||
/// </summary>
|
||||
public enum EnterType
|
||||
{
|
||||
正常进入 = 0,
|
||||
通过分享进入 = 6,
|
||||
//...其他暂时未知
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数据包装器
|
||||
@@ -121,6 +130,11 @@ namespace BarrageGrab.Modles.JsonEntity
|
||||
/// web直播间ID
|
||||
/// </summary>
|
||||
public string WebRoomId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 用户使用的 Appid ,已知 1128,8663,2329 等
|
||||
/// </summary>
|
||||
public string Appid { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -365,6 +379,11 @@ namespace BarrageGrab.Modles.JsonEntity
|
||||
/// 当前直播间人数
|
||||
/// </summary>
|
||||
public long CurrentCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 直播间进入方式,目前已知 0 正常进入,6 通过分享进入
|
||||
/// </summary>
|
||||
public long EnterTipType { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -476,6 +476,14 @@ namespace BarrageGrab.Modles.ProtoEntity
|
||||
[global::ProtoBuf.ProtoMember(19)]
|
||||
public PublicAreaCommon publicAreaCommon { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(20)]
|
||||
[global::System.ComponentModel.DefaultValue("")]
|
||||
public long userEnterTipType { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(21)]
|
||||
[global::System.ComponentModel.DefaultValue("")]
|
||||
public long anchorEnterTipType { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoContract()]
|
||||
public partial class EffectConfig : global::ProtoBuf.IExtensible
|
||||
{
|
||||
@@ -638,6 +646,8 @@ namespace BarrageGrab.Modles.ProtoEntity
|
||||
[global::ProtoBuf.ProtoMember(18)]
|
||||
public long processAtSeiTimeMs { get; set; }
|
||||
|
||||
[global::ProtoBuf.ProtoMember(24)]
|
||||
public long appId { get; set; }
|
||||
}
|
||||
|
||||
[global::ProtoBuf.ProtoContract()]
|
||||
|
||||
@@ -33,6 +33,6 @@ using System.Runtime.InteropServices;
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.7.6.0")]
|
||||
[assembly: AssemblyFileVersion("2.7.6.0")]
|
||||
[assembly: AssemblyVersion("2.7.6.1")]
|
||||
[assembly: AssemblyFileVersion("2.7.6.1")]
|
||||
[assembly: NeutralResourcesLanguage("zh-CN")]
|
||||
|
||||
@@ -36,8 +36,7 @@ namespace BarrageGrab
|
||||
Timer dieout = new Timer(10000);//离线客户端清理计时器
|
||||
Timer giftCountTimer = new Timer(10000);//礼物缓存清理计时器
|
||||
WssBarrageGrab grab = new WssBarrageGrab();//弹幕解析器核心
|
||||
AppSetting Appsetting = AppSetting.Current;//全局配置文件实例
|
||||
WebCastGiftPack giftData = null; //礼物数据
|
||||
AppSetting Appsetting = AppSetting.Current;//全局配置文件实例
|
||||
static int printCount = 0; //控制台输出计数,用于判断清理控制台
|
||||
|
||||
/// <summary>
|
||||
@@ -91,39 +90,6 @@ namespace BarrageGrab
|
||||
this.socketServer = socket;
|
||||
//dieout.Start();
|
||||
giftCountTimer.Start();
|
||||
|
||||
InitGiftData();
|
||||
}
|
||||
|
||||
// 初始化礼物数据
|
||||
private void InitGiftData()
|
||||
{
|
||||
var path = Path.Combine(AppContext.BaseDirectory, "LocalData", "gift.json");
|
||||
if (File.Exists(path))
|
||||
{
|
||||
var jsonData = File.ReadAllText(path);
|
||||
this.giftData = JsonConvert.DeserializeObject<WebCastGiftPack>(jsonData);
|
||||
}
|
||||
|
||||
return;
|
||||
//从服务器获取礼物数据
|
||||
DyServer.GetGifts().ContinueWith(t =>
|
||||
{
|
||||
if (t.IsFaulted) return;
|
||||
if (t.Result == null) return;
|
||||
|
||||
this.giftData = t.Result;
|
||||
Logger.LogInfo("礼物数据下载成功");
|
||||
try
|
||||
{
|
||||
//覆写本地数据
|
||||
File.WriteAllText(path, t.Result.ToJson(true));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogWarn("缓存礼物数据到本地失败,"+ex.Message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//礼物缓存清理计时器回调
|
||||
@@ -272,7 +238,7 @@ namespace BarrageGrab
|
||||
SecUid = roomInfo.Owner.SecUid,
|
||||
UserId = roomInfo.Owner.UserId
|
||||
};
|
||||
msg.WebRoomId = roomInfo.WebRoomId;
|
||||
msg.WebRoomId = roomInfo.WebRoomId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +252,8 @@ namespace BarrageGrab
|
||||
MsgId = msg.Common.msgId,
|
||||
Content = msg.Content,
|
||||
RoomId = msg.Common.roomId.ToString(),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
Appid = e.Message.Common.appId.ToString(),
|
||||
Type = msg.Type,
|
||||
User = GetUser(msg.User)
|
||||
};
|
||||
@@ -314,6 +281,7 @@ namespace BarrageGrab
|
||||
RoomId = msg.Common.roomId.ToString(),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
Content = $"当前直播间人数 {msg.onlineUserForAnchor},累计直播间人数 {msg.totalPvForAnchor}",
|
||||
Appid = e.Message.Common.appId.ToString(),
|
||||
User = null
|
||||
};
|
||||
|
||||
@@ -337,15 +305,15 @@ namespace BarrageGrab
|
||||
int lastCount = 0;
|
||||
|
||||
//纠正赋值礼物数据,比如是否连击,弹幕回送会不准确
|
||||
var findForData = giftData?.gifts?.FirstOrDefault(f => f.id == msg.giftId);
|
||||
if (findForData != null)
|
||||
{
|
||||
var ogift = msg.Gift;
|
||||
ogift.Name = findForData.name;
|
||||
ogift.Combo = findForData.combo;
|
||||
ogift.diamondCount = findForData.diamond_count;
|
||||
ogift.Name = findForData.name;
|
||||
}
|
||||
//var findForData = giftData?.gifts?.FirstOrDefault(f => f.id == msg.giftId);
|
||||
//if (findForData != null)
|
||||
//{
|
||||
// var ogift = msg.Gift;
|
||||
// ogift.Name = findForData.name;
|
||||
// ogift.Combo = findForData.combo;
|
||||
// ogift.diamondCount = findForData.diamond_count;
|
||||
// ogift.Name = findForData.name;
|
||||
//}
|
||||
|
||||
//判断礼物重复
|
||||
if (msg.repeatEnd == 1 && giftCountCache.ContainsKey(key))
|
||||
@@ -400,7 +368,8 @@ namespace BarrageGrab
|
||||
Combo = msg.Gift.Combo,
|
||||
ImgUrl = msg.Gift.Image?.urlLists?.FirstOrDefault() ?? "",
|
||||
User = GetUser(msg.User),
|
||||
ToUser = GetUser(msg.toUser)
|
||||
ToUser = GetUser(msg.toUser),
|
||||
Appid = e.Message.Common.appId.ToString()
|
||||
};
|
||||
|
||||
if (enty.ToUser != null)
|
||||
@@ -428,7 +397,8 @@ namespace BarrageGrab
|
||||
Content = $"{msg.User.Nickname} 关注了主播",
|
||||
RoomId = msg.Common.roomId.ToString(),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
User = GetUser(msg.User)
|
||||
User = GetUser(msg.User),
|
||||
Appid = e.Message.Common.appId.ToString()
|
||||
};
|
||||
|
||||
var msgType = PackMsgType.关注消息;
|
||||
@@ -459,7 +429,8 @@ namespace BarrageGrab
|
||||
RoomId = msg.Common.roomId.ToString(),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
ShareType = type,
|
||||
User = GetUser(msg.User)
|
||||
User = GetUser(msg.User),
|
||||
Appid = e.Message.Common.appId.ToString()
|
||||
};
|
||||
|
||||
var msgType = PackMsgType.直播间分享;
|
||||
@@ -482,11 +453,13 @@ namespace BarrageGrab
|
||||
var enty = new Modles.JsonEntity.MemberMessage()
|
||||
{
|
||||
MsgId = msg.Common.msgId,
|
||||
Content = $"{msg.User.Nickname} 来了 直播间人数:{msg.memberCount}",
|
||||
Content = $"{msg.User.Nickname}${(e.Message.userEnterTipType==6?" 通过分享":"")} 来了 直播间人数:{msg.memberCount}",
|
||||
RoomId = msg.Common.roomId.ToString(),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
CurrentCount = msg.memberCount,
|
||||
User = GetUser(msg.User)
|
||||
User = GetUser(msg.User),
|
||||
Appid = e.Message.Common.appId.ToString(),
|
||||
EnterTipType = e.Message.userEnterTipType,
|
||||
};
|
||||
|
||||
var msgType = PackMsgType.进直播间;
|
||||
@@ -512,7 +485,8 @@ namespace BarrageGrab
|
||||
RoomId = msg.Common.roomId.ToString(),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
Total = msg.Total,
|
||||
User = GetUser(msg.User)
|
||||
User = GetUser(msg.User),
|
||||
Appid = e.Message.Common.appId.ToString()
|
||||
};
|
||||
|
||||
var msgType = PackMsgType.点赞消息;
|
||||
@@ -536,6 +510,7 @@ namespace BarrageGrab
|
||||
RoomId = msg.Common.roomId.ToString(),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
User = GetUser(msg.User),
|
||||
Appid = e.Message.Common.appId.ToString()
|
||||
};
|
||||
|
||||
var msgType = PackMsgType.弹幕消息;
|
||||
@@ -562,7 +537,8 @@ namespace BarrageGrab
|
||||
Content = "直播已结束",
|
||||
RoomId = msg.Common.roomId.ToString(),
|
||||
WebRoomId = AppRuntime.RoomCaches.GetCachedWebRoomid(msg.Common.roomId.ToString()),
|
||||
User = null
|
||||
User = null,
|
||||
Appid = e.Message.Common.appId.ToString()
|
||||
};
|
||||
|
||||
var msgType = PackMsgType.下播;
|
||||
|
||||
@@ -64,6 +64,9 @@
|
||||
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Acornima, Version=1.1.0.0, Culture=neutral, PublicKeyToken=496b38436bb9edeb, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Acornima.1.1.0\lib\net462\Acornima.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.8.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Portable.BouncyCastle.1.8.8\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -86,9 +89,8 @@
|
||||
<Reference Include="HtmlAgilityPack, Version=1.11.51.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.11.51\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Jint, Version=3.0.1.0, Culture=neutral, PublicKeyToken=2e92ba9c8d81157f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Jint.3.0.1\lib\net462\Jint.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Reference Include="Jint, Version=4.1.0.0, Culture=neutral, PublicKeyToken=2e92ba9c8d81157f, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Jint.4.1.0\lib\net462\Jint.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Win32.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll</HintPath>
|
||||
@@ -169,8 +171,8 @@
|
||||
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
|
||||
@@ -259,10 +261,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="LocalData\gift.json">
|
||||
<CustomToolNamespace>WssBarrageService.Resource.LocalData</CustomToolNamespace>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="nlog.config">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Acornima" version="1.1.0" targetFramework="net462" />
|
||||
<package id="BouncyCastle.Cryptography" version="2.0.0" targetFramework="net48" />
|
||||
<package id="BrotliSharpLib" version="0.3.3" targetFramework="net48" />
|
||||
<package id="Costura.Fody" version="5.7.0" targetFramework="net462" developmentDependency="true" />
|
||||
@@ -7,7 +8,7 @@
|
||||
<package id="Fleck" version="1.2.0" targetFramework="net48" />
|
||||
<package id="Fody" version="6.8.2" targetFramework="net462" developmentDependency="true" />
|
||||
<package id="HtmlAgilityPack" version="1.11.51" targetFramework="net48" />
|
||||
<package id="Jint" version="3.0.1" targetFramework="net462" />
|
||||
<package id="Jint" version="4.1.0" targetFramework="net462" />
|
||||
<package id="Microsoft.NETCore.Platforms" version="1.1.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Win32.Registry" version="5.0.0" targetFramework="net48" />
|
||||
@@ -47,7 +48,7 @@
|
||||
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Runtime" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.3" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.Handles" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net462" />
|
||||
|
||||
@@ -146,6 +146,8 @@ message MemberMessage{
|
||||
Image backgroundImageV2 = 17;
|
||||
Text anchorDisplayText = 18;
|
||||
PublicAreaCommon publicAreaCommon = 19;
|
||||
string userEnterTipType = 20;
|
||||
string anchorEnterTipType = 21;
|
||||
|
||||
message EffectConfig{
|
||||
int64 type = 1;
|
||||
@@ -197,6 +199,7 @@ message Common{
|
||||
Room room = 16;
|
||||
int64 anchorFoldTypeV2 = 17;
|
||||
int64 processAtSeiTimeMs = 18;
|
||||
int64 appId = 24;
|
||||
}
|
||||
|
||||
message Text{
|
||||
|
||||
Reference in New Issue
Block a user