Ver Fonte

fix progress bar

Veloe há 1 ano atrás
pai
commit
375e4215d7

+ 4 - 2
VeloeMinecraftLauncher/Utils/Downloader.cs

@@ -52,6 +52,7 @@ internal class Downloader
             Parameters.Action.TasksStatus($"Task {tasksIterator} of {tasksCount} complete.");
 
             var handler = new HttpClientHandler() { AllowAutoRedirect = true };
+            
             var ph = new ProgressMessageHandler(handler);
             ph.HttpSendProgress += (_, args) =>
             {
@@ -100,7 +101,7 @@ internal class Downloader
             tasksIterator++;
             Parameters.Action.TasksStatus($"Task {tasksIterator} of {tasksCount} complete.");
 
-            await DownloadAssets(httpClient, versionJson, cancellationToken);
+            await DownloadAssets(versionJson, cancellationToken);
             
             Parameters.Action.SetProgress(100);
             tasksIterator++;
@@ -297,8 +298,9 @@ internal class Downloader
         File.Delete($"{Settings.minecraftForlderPath}versions/Forge{versionJson.Id}/libraries.zip");
     }
 
-    private async Task DownloadAssets(HttpClient httpClient, Entity.Version.Version versionJson, CancellationToken cancellationToken)
+    private async Task DownloadAssets(Entity.Version.Version versionJson, CancellationToken cancellationToken)
     {
+        using var httpClient = new HttpClient();
         var assetsJson = await Downloader.DownloadAndDeserializeJsonData<AssetsManifest>(versionJson.AssetIndex.Url);
         var assetsPath = $"{Settings.minecraftForlderPath}{(versionJson.Assets == "pre-1.6" ? "resources" :   $"assets/{versionJson.Assets}/objects")}";
         var assetsUrl = "https://resources.download.minecraft.net/";

+ 2 - 3
VeloeMinecraftLauncher/VeloeMinecraftLauncher.csproj

@@ -10,8 +10,8 @@
 		<DebugType>embedded</DebugType>
 		<StartupObject>VeloeMinecraftLauncher.Program</StartupObject>
 		<PlatformTarget>x64</PlatformTarget>
-		<AssemblyVersion>1.5.0.48</AssemblyVersion>
-		<FileVersion>1.5.0.48</FileVersion>
+		<AssemblyVersion>1.5.0.51</AssemblyVersion>
+		<FileVersion>1.5.0.51</FileVersion>
 		<Configurations>Debug;Release</Configurations>
 	</PropertyGroup>
 	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -41,7 +41,6 @@
 		<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.10" />
 		<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.10" />
 		<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
-		<PackageReference Include="Avalonia.Xaml.Interactivity" Version="11.0.10.6" />
 		<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
 		<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.4" />
 		<PackageReference Include="ReactiveUI.Blazor" Version="19.6.1" />