Skip to content

Commit 1e32d4d

Browse files
committed
新增StreamerPanel插件
1 parent 5ae1122 commit 1e32d4d

File tree

5 files changed

+175
-6
lines changed

5 files changed

+175
-6
lines changed

OpenDanmaki.sln

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BiliveDanmakuAgent", "Biliv
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PluginDemo.odp", "PluginDemo.odp\PluginDemo.odp.csproj", "{E1195847-8C2A-41B2-AF56-1403470347DA}"
1515
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreamerPanel.odp", "StreamerPanel.odp\StreamerPanel.odp.csproj", "{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}"
17+
EndProject
1618
Global
1719
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1820
Debug|Any CPU = Debug|Any CPU
@@ -61,6 +63,14 @@ Global
6163
{E1195847-8C2A-41B2-AF56-1403470347DA}.Release|Any CPU.Build.0 = Release|Any CPU
6264
{E1195847-8C2A-41B2-AF56-1403470347DA}.Release|x64.ActiveCfg = Release|Any CPU
6365
{E1195847-8C2A-41B2-AF56-1403470347DA}.Release|x64.Build.0 = Release|Any CPU
66+
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67+
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Debug|Any CPU.Build.0 = Debug|Any CPU
68+
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Debug|x64.ActiveCfg = Debug|Any CPU
69+
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Debug|x64.Build.0 = Debug|Any CPU
70+
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Release|Any CPU.ActiveCfg = Release|Any CPU
71+
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Release|Any CPU.Build.0 = Release|Any CPU
72+
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Release|x64.ActiveCfg = Release|Any CPU
73+
{21A36AC2-A490-4081-9B69-29BEBB8DEBC9}.Release|x64.Build.0 = Release|Any CPU
6474
EndGlobalSection
6575
GlobalSection(SolutionProperties) = preSolution
6676
HideSolutionNode = FALSE

OpenDanmaki/Server/HttpHandler.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ public async Task OnHttpRequest(IHttpSocketClient client, HttpContextEventArgs e
3030
try
3131
{
3232
long uid = long.Parse(e.Context.Request.RelativeURL.Substring("/imageservice/avatar/".Length));
33-
e.Context.Response.ContentType = "image/jpeg";
34-
e.Context.Response.SetContent(avatar.GetAvatar(uid));
35-
await e.Context.Response.AnswerAsync();
36-
return;
33+
if (uid != 0)
34+
{
35+
e.Context.Response.ContentType = "image/jpeg";
36+
e.Context.Response.SetContent(avatar.GetAvatar(uid));
37+
await e.Context.Response.AnswerAsync();
38+
return;
39+
}
3740
}catch(Exception ex)
3841
{
3942
log.Error("Failed serving avatar!",ex);
@@ -100,7 +103,7 @@ public async Task OnHttpRequest(IHttpSocketClient client, HttpContextEventArgs e
100103
}
101104
}
102105

103-
public string FillPlaceholders(string text, List<Placeholder> placeholders)
106+
public static string FillPlaceholders(string text, List<Placeholder> placeholders)
104107
{
105108
foreach(var ph in placeholders)
106109
{

0 commit comments

Comments
 (0)