Skip to content

Commit

Permalink
新增StreamerPanel插件
Browse files Browse the repository at this point in the history
  • Loading branch information
developer-ken committed Feb 2, 2024
1 parent 5ae1122 commit 1e32d4d
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 6 deletions.
2 changes: 1 addition & 1 deletion BiliApi.Net
10 changes: 10 additions & 0 deletions OpenDanmaki.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BiliveDanmakuAgent", "Biliv
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PluginDemo.odp", "PluginDemo.odp\PluginDemo.odp.csproj", "{E1195847-8C2A-41B2-AF56-1403470347DA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreamerPanel.odp", "StreamerPanel.odp\StreamerPanel.odp.csproj", "{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -61,6 +63,14 @@ Global
{E1195847-8C2A-41B2-AF56-1403470347DA}.Release|Any CPU.Build.0 = Release|Any CPU
{E1195847-8C2A-41B2-AF56-1403470347DA}.Release|x64.ActiveCfg = Release|Any CPU
{E1195847-8C2A-41B2-AF56-1403470347DA}.Release|x64.Build.0 = Release|Any CPU
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Debug|x64.ActiveCfg = Debug|Any CPU
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Debug|x64.Build.0 = Debug|Any CPU
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Release|Any CPU.Build.0 = Release|Any CPU
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Release|x64.ActiveCfg = Release|Any CPU
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
13 changes: 8 additions & 5 deletions OpenDanmaki/Server/HttpHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ public async Task OnHttpRequest(IHttpSocketClient client, HttpContextEventArgs e
try
{
long uid = long.Parse(e.Context.Request.RelativeURL.Substring("/imageservice/avatar/".Length));
e.Context.Response.ContentType = "image/jpeg";
e.Context.Response.SetContent(avatar.GetAvatar(uid));
await e.Context.Response.AnswerAsync();
return;
if (uid != 0)
{
e.Context.Response.ContentType = "image/jpeg";
e.Context.Response.SetContent(avatar.GetAvatar(uid));
await e.Context.Response.AnswerAsync();
return;
}
}catch(Exception ex)
{
log.Error("Failed serving avatar!",ex);
Expand Down Expand Up @@ -100,7 +103,7 @@ public async Task OnHttpRequest(IHttpSocketClient client, HttpContextEventArgs e
}
}

public string FillPlaceholders(string text, List<Placeholder> placeholders)
public static string FillPlaceholders(string text, List<Placeholder> placeholders)
{
foreach(var ph in placeholders)
{
Expand Down
Loading

0 comments on commit 1e32d4d

Please sign in to comment.