Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

直播间 抽奖、弹幕延迟、醒目留言、舰长信息、各类其他小问题综合修复与优化 #651

Merged
merged 47 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1a19b2e
修复热门页故障
GD-Slime Jan 16, 2024
ce1f06f
update item width
GD-Slime Jan 16, 2024
ca98989
修复收藏夹私密问题
GD-Slime Jan 17, 2024
073d815
Merge branch 'dev' of https://github.com/GD-Slime/biliuwp-lite into dev
GD-Slime Mar 23, 2024
739d034
Merge branch 'ywmoyue:dev' into dev
GD-Slime Mar 27, 2024
622931e
Merge branch 'ywmoyue:dev' into dev
GD-Slime Mar 27, 2024
57aca8a
Merge branch 'ywmoyue:dev' into dev
GD-Slime Apr 9, 2024
047b8c0
Merge branch 'ywmoyue:dev' into dev
GD-Slime Apr 9, 2024
a73b51d
Merge branch 'ywmoyue:dev' into dev
GD-Slime Apr 12, 2024
6fb7be4
Merge branch 'ywmoyue:dev' into dev
GD-Slime Apr 14, 2024
5099a11
Merge branch 'ywmoyue:dev' into dev
GD-Slime Apr 17, 2024
5cfeac5
Merge branch 'ywmoyue:dev' into dev
GD-Slime Apr 18, 2024
4103386
Merge branch 'ywmoyue:dev' into dev
GD-Slime Apr 22, 2024
4b2c7d7
Merge branch 'ywmoyue:dev' into dev
GD-Slime Apr 29, 2024
2df550d
Merge branch 'ywmoyue:dev' into dev
GD-Slime May 3, 2024
8d0ce81
Merge branch 'ywmoyue:dev' into dev
GD-Slime May 3, 2024
adbbd64
Merge branch 'ywmoyue:dev' into dev
GD-Slime May 3, 2024
8c9a6b1
初步完成获取原始流和减少缓冲时间功能
GD-Slime May 8, 2024
db60f5b
Merge branch 'dev' into dev
GD-Slime May 8, 2024
e9c6ea8
Merge branch 'ywmoyue:dev' into dev
GD-Slime May 11, 2024
fbe7158
不将MediaInfoCollect的StartCollect暴露到外部
ywmoyue May 12, 2024
3d16a53
采集媒体信息添加采集Buffer指标,添加定时采集更新
ywmoyue May 12, 2024
7226424
修复一个int越界问题
GD-Slime May 12, 2024
29b77c2
Merge branch 'dev' of https://github.com/GD-Slime/biliuwp-lite into dev
GD-Slime May 12, 2024
78306aa
Merge branch 'dev' of https://github.com/GD-Slime/biliuwp-lite into dev
GD-Slime May 15, 2024
5f5a83b
直播间bug修复
GD-Slime May 15, 2024
5cce86e
天选/红包抽奖实际参与修复
GD-Slime May 27, 2024
90c11d6
修复央视新闻等官方直播间报错
GD-Slime May 27, 2024
3a0ba22
自己发的弹幕加框
GD-Slime May 27, 2024
328bd45
自己和主播的chat特殊处理
GD-Slime May 27, 2024
79fd1df
修复弹幕延迟
GD-Slime May 27, 2024
8bdc79b
修复个人主页点击进入直播间按钮
GD-Slime May 27, 2024
c1a96f6
区分续费与新舰长
GD-Slime May 27, 2024
1299633
RichText支持调整对齐方式
GD-Slime May 27, 2024
2a4b182
SuperChat加入弹幕与chatList
GD-Slime May 27, 2024
a592871
解决冲突
GD-Slime May 27, 2024
508d919
天选修复 参与抽奖需要送礼功能
GD-Slime May 29, 2024
ad73219
某些消息改为居中
GD-Slime May 29, 2024
c334c9c
天选
GD-Slime May 29, 2024
5a4ddcb
修复 主播的标志仍为房管
GD-Slime May 29, 2024
ac319ec
Revert "天选"
GD-Slime May 29, 2024
b632de1
用户大航海等级改为枚举
GD-Slime May 31, 2024
2cf1969
一些没有出现在界面上的属性加[DoNotNotify]
GD-Slime May 31, 2024
dc03acf
弃元规范化
GD-Slime May 31, 2024
d420002
Merge branch 'ywmoyue:dev' into dev
GD-Slime May 31, 2024
ab11844
弃元规范化
GD-Slime May 31, 2024
486b93a
修复枚举类型使用
ywmoyue Jun 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Extensions/ApiModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static async Task<HttpResults> Request(this ApiModel api, [CallerMemberNa
{
if (api.need_cookie)
{
return await api.url.PostHttpResultsWithCookie(api.body, api.headers);
return await api.url.PostHttpResultsWithCookie(api.body, api.headers, api.ExtraCookies);
}

return await api.url.PostHttpResultsAsync(api.body, api.headers);
Expand Down
9 changes: 5 additions & 4 deletions src/BiliLite.UWP/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static string TraditionalToSimplified(this string input)
/// <returns></returns>
public static RichTextBlock ToRichTextBlock(this string txt, JObject emote, bool isLive = false,
string fontColor = null, string fontWeight = "Normal", string lowProfilePrefix = "",
bool enableVideoSeekTime = false)
string textAlignment = "Left", bool enableVideoSeekTime = false)
{
var input = txt;
try
Expand Down Expand Up @@ -124,12 +124,13 @@ public static RichTextBlock ToRichTextBlock(this string txt, JObject emote, bool
var xaml = string.Format(@"<RichTextBlock HorizontalAlignment=""Stretch"" xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" xmlns:d=""http://schemas.microsoft.com/expression/blend/2008""
xmlns:mc = ""http://schemas.openxmlformats.org/markup-compatibility/2006"" LineHeight=""{1}"" {2} {3}>
<Paragraph>{4}{0}</Paragraph>
</RichTextBlock>", input,
<Paragraph {5}>{4}{0}</Paragraph>
</RichTextBlock>", input,
isLive ? 22 : 20,
fontColor == null ? "" : $"Foreground=\"{fontColor}\"",
$"FontWeight=\"{fontWeight}\"",
lowProfilePrefix);
lowProfilePrefix,
$"TextAlignment=\"{textAlignment}\"");
if (!xaml.IsXmlString())
{
throw new CustomizedErrorException("不是有效的xml字符串");
Expand Down
11 changes: 10 additions & 1 deletion src/BiliLite.UWP/Extensions/StringHttpExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static async Task<HttpResults> PostHttpResultsAsync(this string url, stri
return httpResult;
}

public static async Task<HttpResults> PostHttpResultsWithCookie(this string url, string body, IDictionary<string, string> headers = null)
public static async Task<HttpResults> PostHttpResultsWithCookie(this string url, string body, IDictionary<string, string> headers = null, IDictionary<string, string> extraCookies = null)
{
try
{
Expand All @@ -223,6 +223,15 @@ public static async Task<HttpResults> PostHttpResultsWithCookie(this string url,
}
cookies = cookieService.Cookies;
var cookiesCollection = cookies.ToDictionary(x => x.Name, x => x.Value);

if (extraCookies != null)
{
foreach (var kvp in extraCookies)
{
cookiesCollection.Add(kvp.Key, kvp.Value);
}
}

return await url.PostHttpResultsAsync(body, headers, cookiesCollection);
}
catch (Exception ex)
Expand Down
30 changes: 29 additions & 1 deletion src/BiliLite.UWP/Models/Common/Enumerates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ public enum MessageType
/// </summary>
GuardBuy,

/// <summary>
/// 新上舰消息, 可区分续费和新人
/// </summary>
GuardBuyNew,

/// <summary>
/// 房间信息更新
/// </summary>
Expand Down Expand Up @@ -409,7 +414,7 @@ public enum MessageType
/// <summary>
/// 直播间等级禁言
/// </summary>
RoomSlient,
ChatLevelMute,
}

public enum MessageDelayType {
Expand Down Expand Up @@ -443,4 +448,27 @@ public enum UserDynamicShowType
Season = 2,
Article = 3
}

/// <summary>
/// 用户大航海等级
/// </summary>
public enum UserCaptainType
{
None = 0,

/// <summary>
/// 总督
/// </summary>
Zongdu = 1,

/// <summary>
/// 提督
/// </summary>
Tidu = 2,

/// <summary>
/// 舰长
/// </summary>
JianZhang = 3,
}
}
29 changes: 21 additions & 8 deletions src/BiliLite.UWP/Models/Common/Live/DanmuMsgModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,23 @@ public class DanmuMsgModel
/// </summary>
public string UserName { get; set; }

private string _userNameColor;
/// <summary>
/// 用户名颜色, 默认灰色
/// </summary>
public string UserNameColor { get; set; } = "#FF808080";
public string UserNameColor
{
get => _userNameColor ??
UserCaptain switch
{
UserCaptainType.JianZhang => "#FF23709E",
UserCaptainType.Tidu => "#FF7B166F",
UserCaptainType.Zongdu => "#FFC01039",
_ => "#FF808080"
};

set => _userNameColor = value;
}

/// <summary>
/// 用户名字重, 默认Normal
Expand Down Expand Up @@ -83,17 +96,17 @@ public class DanmuMsgModel
/// <summary>
/// 勋章等级
/// </summary>
public string MedalLevel { get; set; }
public int MedalLevel { get; set; }

/// <summary>
/// 勋章颜色
/// </summary>
public string MedalColor { get; set; }

/// <summary>
/// 用户上的舰的名称
/// 用户大航海等级
/// </summary>
public string UserCaptain { get; set; }
public UserCaptainType UserCaptain { get; set; }

/// <summary>
/// 用户上的舰的图片
Expand All @@ -102,9 +115,9 @@ public string UserCaptainImage
{
get => UserCaptain switch
{
"舰长" => "ms-appx:///Assets/Live/ic_live_guard_3.png",
"提督" => "ms-appx:///Assets/Live/ic_live_guard_2.png",
"总督" => "ms-appx:///Assets/Live/ic_live_guard_1.png",
UserCaptainType.JianZhang => "ms-appx:///Assets/Live/ic_live_guard_3.png", //舰长
UserCaptainType.Tidu => "ms-appx:///Assets/Live/ic_live_guard_2.png", //提督
UserCaptainType.Zongdu => "ms-appx:///Assets/Live/ic_live_guard_1.png", //总督
_ => null,
};
}
Expand Down
10 changes: 10 additions & 0 deletions src/BiliLite.UWP/Models/Common/Live/GuardBuyMsgModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,15 @@ public Color CardColor
/// 礼物名称
/// </summary>
public string GiftName { get; set; }

/// <summary>
/// 购买的时间单位, 如"月"
/// </summary>
public string Unit { get; set;}

/// <summary>
/// 庆祝消息正文
/// </summary>
public string Message { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Models/Common/Live/InteractWordModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class InteractWordModel

public string MedalName { get; set; }

public string MedalLevel { get; set; }
public int MedalLevel { get; set; }

public string MedalColor { get; set; }

Expand Down
Loading