This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
196 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
// 有关程序集的一般信息由以下 | ||
// 控制。更改这些特性值可修改 | ||
// 与程序集关联的信息。 | ||
[assembly: AssemblyTitle("ShowInfo")] | ||
[assembly: AssemblyDescription("显示投喂用户的隐藏信息")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("")] | ||
[assembly: AssemblyCopyright("")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// 将 ComVisible 设置为 false 会使此程序集中的类型 | ||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 | ||
//请将此类型的 ComVisible 特性设置为 true。 | ||
[assembly: ComVisible(false)] | ||
|
||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID | ||
[assembly: Guid("30d14085-4d54-4a80-b59b-9881ee1dff66")] | ||
|
||
// 程序集的版本信息由下列四个值组成: | ||
// | ||
// 主版本 | ||
// 次版本 | ||
// 生成号 | ||
// 修订号 | ||
// | ||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 | ||
//通过使用 "*",如下所示: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
using System; | ||
using System.Text.RegularExpressions; | ||
using BilibiliDM_PluginFramework; | ||
|
||
namespace ShowInfo | ||
{ | ||
public class ShowInfo : DMPlugin | ||
{ | ||
public ShowInfo() | ||
{ | ||
ReceivedDanmaku += B_ReceivedDanmaku; | ||
PluginAuth = "lzblzr"; | ||
PluginName = "用户信息"; | ||
PluginDesc = "显示投喂用户的隐藏信息"; | ||
PluginCont = "[email protected]"; | ||
PluginVer = "v1.0.0"; | ||
} | ||
private void B_ReceivedDanmaku(object sender, ReceivedDanmakuArgs e) | ||
{ | ||
if (e.Danmaku.MsgType == MsgTypeEnum.GiftSend) | ||
{ | ||
string rawData = e.Danmaku.RawData; | ||
|
||
string defaultLog; | ||
string userLog = defaultLog = e.Danmaku.UserName + " 剩余"; | ||
|
||
Regex gold = new Regex("\"gold\":\"?(\\d+)"); | ||
Match hasGold = gold.Match(rawData); | ||
if (hasGold.Success) | ||
{ | ||
string value = hasGold.Groups[1].Value; | ||
if (value != "0") | ||
userLog += String.Format(" {0}金瓜子", value); | ||
} | ||
|
||
Regex silver = new Regex("\"silver\":\"?(\\d+)"); | ||
Match hasSilver = silver.Match(rawData); | ||
if (hasSilver.Success) | ||
{ | ||
string value = hasSilver.Groups[1].Value; | ||
if (value != "0") | ||
userLog += String.Format(" {0}银瓜子", value); | ||
} | ||
|
||
Regex package = new Regex("\"eventNum\":\"?(\\d+)"); | ||
Match hasPackage = package.Match(rawData); | ||
if (hasPackage.Success) | ||
{ | ||
string value = hasPackage.Groups[1].Value; | ||
if (value != "0") | ||
userLog += String.Format(" {0}{1}", value, e.Danmaku.GiftName); | ||
} | ||
|
||
Regex normalCapsule = new Regex("\"normal\":{ \"coin\":\"?(\\d+)"); | ||
Match hasNormalCapsule = normalCapsule.Match(rawData); | ||
if (hasNormalCapsule.Success) | ||
{ | ||
string value = hasNormalCapsule.Groups[1].Value; | ||
if (value != "0") | ||
userLog += String.Format(" {0}普通扭蛋", value); | ||
} | ||
|
||
Regex colorfulCapsule = new Regex("\"colorful\":{ \"coin\":\"?(\\d+)"); | ||
Match hascClorfulCapsule = colorfulCapsule.Match(rawData); | ||
if (hascClorfulCapsule.Success) | ||
{ | ||
string value = hascClorfulCapsule.Groups[1].Value; | ||
if (value != "0") | ||
userLog += String.Format(" {0}梦幻扭蛋", value); | ||
} | ||
|
||
if (userLog != defaultLog) | ||
Log(userLog); | ||
} | ||
} | ||
public override void Admin() | ||
{ | ||
base.Admin(); | ||
Console.WriteLine("不要点啦, 没用的"); | ||
Log("不要点啦, 没用的"); | ||
AddDM("不要点啦, 没用的", true); | ||
} | ||
public override void Start() | ||
{ | ||
base.Start(); | ||
Console.WriteLine("插件已启用"); | ||
Log("插件已启用"); | ||
AddDM("插件已启用", true); | ||
} | ||
public override void Stop() | ||
{ | ||
base.Stop(); | ||
Console.WriteLine("插件已禁用"); | ||
Log("插件已禁用"); | ||
AddDM("插件已禁用", true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{30D14085-4D54-4A80-B59B-9881EE1DFF66}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>ShowInfo</RootNamespace> | ||
<AssemblyName>ShowInfo</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="BilibiliDM_PluginFramework"> | ||
<HintPath>..\BilibiliDM_PluginFramework\BilibiliDM_PluginFramework.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="WindowsBase" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="ShowInfo.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters