Skip to content

Commit 41d6311

Browse files
authored
[Hotfix] Stable 1.82.31 (#788)
# What's Changed? - **[Imp]** Migrate `BridgedNetworkStream` & `CopyToStream` functions to `EncTool` submodule, by @neon-nyan - **[Imp]** Add new async methods for `DnsQuery` & fix marshalling issues in `Hi3Helper.Win32`, by @neon-nyan - **[Imp]** `HttpClientBuilder` improvements, by @neon-nyan: - Make DNS resolve from Client -> OS fully asynchronous - Use shared DNS Nameservers instead of per-`HttpClient` > ~~This way, the users can change the DNS settings without restarting the app.~~ This functionality isn't applied to Stable, yet the component is left behind due to submodule shared with preview branch. - Remove `HttpClientBuilder<THandler>` and instead explicitly use `SocketsHttpHandler` via `HttpClientBuilder` - **[Fix]** Fix incorrect i18n string used for Anisotropic Filtering in ZZZ, by @shatyuka - **[Imp]** Update `SRAM` version & parsing to account for new HSR asset type in version 3.5.0. - **[Imp]** Update .NET components NuGet to 9.0.7, by @bagusnl - **[Loc]** Update localizations, by our Localizers. Thanks for all your hard work ❤️
2 parents 156155f + 748b6fc commit 41d6311

File tree

57 files changed

+390
-628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+390
-628
lines changed

CollapseLauncher/Classes/CachesManagement/Honkai/Fetch.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private async Task<List<CacheAsset>> Fetch(CancellationToken token)
4242
DownloadClient downloadClient = DownloadClient.CreateInstance(httpClientNew);
4343

4444
// Build _gameRepoURL from loading Dispatcher and Gateway
45-
await BuildGameRepoURL(downloadClient, token);
45+
await BuildGameRepoURL(downloadClient.GetHttpClient(), token);
4646

4747
// Iterate type and do fetch
4848
await Parallel.ForEachAsync(
@@ -83,7 +83,7 @@ await Parallel.ForEachAsync(
8383
return returnAsset;
8484
}
8585

86-
private async Task BuildGameRepoURL(DownloadClient downloadClient, CancellationToken token)
86+
private async Task BuildGameRepoURL(HttpClient downloadClient, CancellationToken token)
8787
{
8888
KianaDispatch dispatch = null;
8989
Exception lastException = null;
@@ -330,7 +330,7 @@ private byte[] GetAssetIndexSalt(string data)
330330
key = LauncherMetadataHelper.CurrentMasterKey?.Key;
331331
}
332332

333-
mhyEncTool saltTool = new mhyEncTool(data, key);
333+
MhyEncTool saltTool = new MhyEncTool(data, key);
334334
return saltTool.GetSalt();
335335
}
336336

@@ -354,7 +354,7 @@ private static bool IsValidRegionFile(string input, string lang)
354354
List<CacheAsset> returnAsset = [];
355355

356356
// Build _gameRepoURL from loading Dispatcher and Gateway
357-
await BuildGameRepoURL(downloadClient, token);
357+
await BuildGameRepoURL(downloadClient.GetHttpClient(), token);
358358

359359
// Fetch the progress
360360
_ = await FetchByType(type, downloadClient, returnAsset, token);

CollapseLauncher/Classes/FileMigrationProcess/FileMigrationProcess.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Hi3Helper;
55
using Hi3Helper.Shared.Region;
66
using Hi3Helper.Win32.ManagedTools;
7-
using Hi3Helper.Win32.Native.ManagedTools;
87
using Microsoft.UI.Dispatching;
98
using System;
109
using System.Collections.Generic;

CollapseLauncher/Classes/FileMigrationProcess/Statics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace CollapseLauncher
1313
{
1414
internal partial class FileMigrationProcess
1515
{
16-
internal static async Task<FileMigrationProcess> CreateJob(string dialogTitle, string inputPath, string outputPath = null, CancellationTokenSource token = default, bool showWarningMessage = true)
16+
internal static async Task<FileMigrationProcess> CreateJob(string dialogTitle, string inputPath, string outputPath = null, CancellationTokenSource token = null, bool showWarningMessage = true)
1717
{
1818
// Normalize Path (also normalize path from '/' separator)
1919
inputPath = ConverterTool.NormalizePath(inputPath);

CollapseLauncher/Classes/GamePresetProperty.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
using CollapseLauncher.InstallManager.StarRail;
1111
using CollapseLauncher.InstallManager.Zenless;
1212
using CollapseLauncher.Interfaces;
13+
using Hi3Helper;
1314
using Hi3Helper.SentryHelper;
15+
using Hi3Helper.Win32.ManagedTools;
1416
using Hi3Helper.Win32.Native.Enums;
15-
using Hi3Helper.Win32.Native.ManagedTools;
16-
using Hi3Helper;
1717
using Microsoft.Extensions.Logging;
1818
using Microsoft.UI.Xaml;
1919
using System;

CollapseLauncher/Classes/Helper/Background/ColorPaletteUtility.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private static async ValueTask<WColor[]> TryGenerateNewCachedPalette(BitmapInput
192192
Directory.CreateDirectory(cachedPaletteDirPath ?? "");
193193
}
194194

195-
if (!ConverterTool.TrySerializeStruct(colors, buffer, out int read))
195+
if (!ConverterTool.TrySerializeStruct(buffer, out int read, colors))
196196
{
197197
byte defVal = (byte)(isLight ? 80 : 255);
198198
WColor defColor =

CollapseLauncher/Classes/Helper/Image/ImageLoaderHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using CommunityToolkit.WinUI.Media;
88
using Hi3Helper;
99
using Hi3Helper.Data;
10+
using Hi3Helper.EncTool;
1011
using Microsoft.UI.Text;
1112
using Microsoft.UI.Xaml;
1213
using Microsoft.UI.Xaml.Controls;
@@ -626,7 +627,7 @@ public static async Task<bool> TryDownloadToCompletenessAsync(string? url, HttpC
626627
}
627628
}
628629

629-
private static ConcurrentDictionary<string, int> UrlRetryCount = new();
630+
private static readonly ConcurrentDictionary<string, int> UrlRetryCount = new();
630631

631632
private static async Task<Stream> GetFallbackStreamUrl(HttpClient? client, string urlLocal, CancellationToken tokenLocal)
632633
{

CollapseLauncher/Classes/Helper/LauncherApiLoader/Legacy/LauncherGameNews.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private static void InjectDownloadableItemCancelTokenInner<T>(IEnumerable<T>? pr
154154
return;
155155
}
156156

157-
foreach (T? propValue in prop)
157+
foreach (T propValue in prop)
158158
{
159159
InjectDownloadableItemCancelTokenInner(propValue, launcherApi, token);
160160
}
@@ -224,7 +224,7 @@ public class LauncherGameNewsCarousel : LauncherUIResourceBase, ILauncherGameNew
224224
[JsonConverter(typeof(SanitizeUrlStringConverter))]
225225
public string? CarouselImg
226226
{
227-
get => ImageLoaderHelper.GetCachedSprites(CurrentHttpClient, field, InnerToken ?? default);
227+
get => ImageLoaderHelper.GetCachedSprites(CurrentHttpClient, field, InnerToken ?? CancellationToken.None);
228228
init;
229229
}
230230

@@ -252,15 +252,15 @@ public partial class LauncherGameNewsSocialMedia : LauncherUIResourceBase, ILaun
252252
[JsonConverter(typeof(SanitizeUrlStringConverter))]
253253
public string? IconImg
254254
{
255-
get => ImageLoaderHelper.GetCachedSprites(CurrentHttpClient, field, InnerToken ?? default);
255+
get => ImageLoaderHelper.GetCachedSprites(CurrentHttpClient, field, InnerToken ?? CancellationToken.None);
256256
init;
257257
}
258258

259259
[JsonPropertyName("img_hover")]
260260
[JsonConverter(typeof(SanitizeUrlStringConverter))]
261261
public string? IconImgHover
262262
{
263-
get => ImageLoaderHelper.GetCachedSprites(CurrentHttpClient, field, InnerToken ?? default);
263+
get => ImageLoaderHelper.GetCachedSprites(CurrentHttpClient, field, InnerToken ?? CancellationToken.None);
264264
init;
265265
}
266266

@@ -287,7 +287,7 @@ public string? Title
287287
[JsonConverter(typeof(SanitizeUrlStringConverter))]
288288
public string? QrImg
289289
{
290-
get => ImageLoaderHelper.GetCachedSprites(CurrentHttpClient, field, InnerToken ?? default);
290+
get => ImageLoaderHelper.GetCachedSprites(CurrentHttpClient, field, InnerToken ?? CancellationToken.None);
291291
init;
292292
}
293293

CollapseLauncher/Classes/Helper/Metadata/LauncherMetadataHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using CollapseLauncher.Statics;
66
using Hi3Helper;
77
using Hi3Helper.Data;
8+
using Hi3Helper.EncTool;
89
using Hi3Helper.SentryHelper;
910
using Hi3Helper.Shared.Region;
1011
using System;

CollapseLauncher/Classes/Helper/StreamUtility/CopyToStream.cs

Lines changed: 0 additions & 191 deletions
This file was deleted.

CollapseLauncher/Classes/Helper/Update/LauncherUpdateHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using CollapseLauncher.Extension;
22
using Hi3Helper;
33
using Hi3Helper.Data;
4+
using Hi3Helper.EncTool;
45
using Hi3Helper.SentryHelper;
56
using Hi3Helper.Shared.Region;
67
using System;

0 commit comments

Comments
 (0)