Skip to content

Commit

Permalink
修复两个直播间小问题 (#629)
Browse files Browse the repository at this point in the history
礼物id的int越界修复
弹幕延迟计算防止除以0
  • Loading branch information
GD-Slime authored May 15, 2024
1 parent 2870469 commit 3ad1608
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Models/Common/Live/LiveGiftItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public class LiveGiftItem
public int ComboResourcesId { get; set; }

[JsonProperty("goods_id")]
public int GoodsId { get; set; }
public long GoodsId { get; set; }

public int Num { get; set; } = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Modules/Live/LiveMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private async Task ParseData(byte[] data)
foreach (var item in textLines)
{
// 使用上波弹幕到这波的间隔确定延迟
var danmuDelay = (timeStampNow - PreviousDanmuPackageTimeStamp) / danmuCount * 1.3;
var danmuDelay = danmuCount > 0 ? ((timeStampNow - PreviousDanmuPackageTimeStamp) / danmuCount * 1.3) : 0;
var delay = ParseMessage(item) switch
{
MessageDelayType.DanmuMessage => danmuDelay <= 30 ? 30 : danmuDelay, // 常规弹幕类型, 加延迟
Expand Down

0 comments on commit 3ad1608

Please sign in to comment.