diff --git a/Ra3.BattleNet.Downloader/Download.cs b/Ra3.BattleNet.Downloader/Download.cs index 38de5a9..e31667c 100644 --- a/Ra3.BattleNet.Downloader/Download.cs +++ b/Ra3.BattleNet.Downloader/Download.cs @@ -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()); var taskSource = new TaskCompletionSource(); @@ -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; } diff --git a/Ra3.BattleNet.Downloader/Ra3.BattleNet.Downloader.csproj b/Ra3.BattleNet.Downloader/Ra3.BattleNet.Downloader.csproj index 7db5c78..08766b3 100644 --- a/Ra3.BattleNet.Downloader/Ra3.BattleNet.Downloader.csproj +++ b/Ra3.BattleNet.Downloader/Ra3.BattleNet.Downloader.csproj @@ -36,7 +36,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - +