Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 7 additions & 5 deletions Ra3.BattleNet.Downloader/Download.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ public static async Task BitTorrentDownload(ViewModel viewModel)

var settingsBuilder = new EngineSettingsBuilder
{
ListenPort = -1,
DhtPort = -1,
AllowLocalPeerDiscovery = false,
AllowPortForwarding = false,
CacheDirectory = cacheFolder,
DhtEndPoint = null,
};
settingsBuilder.ListenEndPoints.Clear();
var engine = new ClientEngine(settingsBuilder.ToSettings());
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disposable 'ClientEngine' is created but not disposed.

Copilot uses AI. Check for mistakes.

var taskSource = new TaskCompletionSource<string>();
Expand All @@ -59,10 +60,11 @@ public static async Task BitTorrentDownload(ViewModel viewModel)
if (!torrentManager.Complete)
{
var monitor = torrentManager.Monitor;
viewModel.SetDownloadedSize(monitor.DataBytesDownloaded, torrent.Size);
var progress = (double)monitor.DataBytesDownloaded / torrent.Size;
var dataBytesReceived = monitor.DataBytesReceived;
viewModel.SetDownloadedSize(dataBytesReceived, torrent.Size);
var progress = (double)dataBytesReceived / torrent.Size;
viewModel.SetProgress(progress);
viewModel.SetDownloadSpeed(monitor.DownloadSpeed);
viewModel.SetDownloadSpeed(monitor.DownloadRate);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Ra3.BattleNet.Downloader/Ra3.BattleNet.Downloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MonoTorrent" Version="2.0.7" />
<PackageReference Include="MonoTorrent" Version="3.0.2" />
</ItemGroup>

</Project>
Loading