Skip to content

Commit 8287b47

Browse files
authored
Preview 1.82.11 Hotfix (#648)
# What's new? - 1.82.11 - **[New]** Toggle "Playing" Discord RPC status per-region, by @bagusnl - You can disable "Playing" status per-region now by going to Quick Settings (bottom right on Homepage) and toggling it off. - This is enabled by default (as it always is) - **[Fix]** Bloated Sophon pre-download/update size due to duplicate entries, by @neon-nyan - **[Imp]** Match API requests headers, by @neon-nyan - **[Fix]** Cannot copy error message caused by ``HGlobal`` buffer misallocation for some users, by @neon-nyan - **[Fix]** IOSharingViolation due to file/directory handling in some methods, by @neon-nyan - **[Fix]** Repair causing application crashes due to value overflow, by @bagusnl - **[Fix]** Game installation error due to invalid VO language selection, by @neon-nyan - **[Imp]** Sentry improvements, by @bagusnl - Filter exceptions to be sent + Exceptions caused by users' internet situation are filtered - Add loaded modules info to breadcrumb - Detach inner exception handler method - **[Imp]** Sophon Download Improvements, by @neon-nyan - Adding disk-space check on Game Installation/Update and Pre-load Download. - Ignore if VO's LanguageString is not valid on non-debug build - Separate Sophon methods to its own code files - **[Imp]** UI/UX Improvements, by @shatyuka @neon-nyan and @bagusnl - New fallback background when the background sprite is not yet downloaded > The official HoYoPlay's default background is used for the fallback background - Disable some tab focus within the PostPanel - Resize Pivot header in PostPanel - Make ScrollViewer receive focus as a whole - Enable navigation via arrow keys in ScrollViewer - Adjust Audio-related setting's Grid layout on Genshin Game Settings Page - **[Fix]** DB sync buttons on App Settings page doesn't get disabled when the toggle is off - **[Loc]** Localization Sync from Transifex, by Localizers <3 ### Templates <details> <summary>Changelog Prefixes</summary> ``` **[New]** **[Imp]** **[Fix]** **[Loc]** **[Doc]** ``` </details>
2 parents ded4902 + 16e4707 commit 8287b47

Some content is hidden

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

51 files changed

+2096
-1400
lines changed

.github/workflows/qodana-scan-pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ on:
33
pull_request:
44
branches:
55
- main
6+
- preview
7+
- stable
68

79
jobs:
810
qodana:

CollapseLauncher/App.xaml

Lines changed: 150 additions & 27 deletions
Large diffs are not rendered by default.
789 KB
Loading
740 KB
Loading
752 KB
Loading
878 KB
Loading

CollapseLauncher/Classes/CachesManagement/Honkai/Check.cs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using CollapseLauncher.Interfaces;
1+
using CollapseLauncher.Helper;
2+
using CollapseLauncher.Interfaces;
23
using Hi3Helper;
34
using System;
45
using System.Collections.Generic;
@@ -57,19 +58,31 @@ private async Task<List<CacheAsset>> Check(List<CacheAsset> assetIndex, Cancella
5758

5859
private void CheckUnusedAssets(List<CacheAsset> assetIndex, List<CacheAsset> returnAsset)
5960
{
61+
// Directory info and if the directory doesn't exist, return
62+
DirectoryInfo directoryInfo = new DirectoryInfo(_gamePath);
63+
if (!directoryInfo.Exists)
64+
{
65+
return;
66+
}
67+
6068
// Iterate the file contained in the _gamePath
61-
foreach (string filePath in Directory.EnumerateFiles(_gamePath!, "*", SearchOption.AllDirectories))
69+
foreach (FileInfo fileInfo in directoryInfo.EnumerateFiles("*", SearchOption.AllDirectories)
70+
.EnumerateNoReadOnly())
6271
{
63-
if (!filePath.Contains("output_log") && !filePath.Contains("Crashes")
64-
&& !filePath.Contains("Verify.txt") && !filePath.Contains("APM")
65-
&& !filePath.Contains("FBData") && !filePath.Contains("asb.dat")
66-
&& !assetIndex!.Exists(x => x!.ConcatPath == filePath))
72+
string filePath = fileInfo.FullName;
73+
74+
if (!filePath.Contains("output_log", StringComparison.OrdinalIgnoreCase)
75+
&& !filePath.Contains("Crashes", StringComparison.OrdinalIgnoreCase)
76+
&& !filePath.Contains("Verify.txt", StringComparison.OrdinalIgnoreCase)
77+
&& !filePath.Contains("APM", StringComparison.OrdinalIgnoreCase)
78+
&& !filePath.Contains("FBData", StringComparison.OrdinalIgnoreCase)
79+
&& !filePath.Contains("asb.dat", StringComparison.OrdinalIgnoreCase)
80+
&& !assetIndex.Exists(x => x.ConcatPath == fileInfo.FullName))
6781
{
6882
// Increment the total found count
6983
_progressAllCountFound++;
7084

7185
// Add asset to the returnAsset
72-
FileInfo fileInfo = new FileInfo(filePath);
7386
CacheAsset asset = new CacheAsset()
7487
{
7588
BasePath = Path.GetDirectoryName(filePath),
@@ -106,10 +119,10 @@ private async ValueTask CheckAsset(CacheAsset asset, List<CacheAsset> returnAsse
106119
_status.ActivityAll = string.Format(Lang._CachesPage.CachesTotalStatusChecking!, _progressAllCountCurrent, _progressAllCountTotal);
107120

108121
// Assign the file info.
109-
FileInfo fileInfo = new FileInfo(asset.ConcatPath!);
122+
FileInfo fileInfo = new FileInfo(asset.ConcatPath).EnsureNoReadOnly(out bool isExist);
110123

111124
// Check if the file exist. If not, then add it to asset index.
112-
if (!fileInfo.Exists)
125+
if (!isExist)
113126
{
114127
AddGenericCheckAsset(asset, CacheAssetStatus.New, returnAsset, null, asset.CRCArray);
115128
return;

CollapseLauncher/Classes/CachesManagement/Honkai/Update.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ private async Task UpdateCacheAsset((CacheAsset AssetIndex, IAssetProperty Asset
126126

127127
FileInfo fileInfo = new FileInfo(asset.AssetIndex.ConcatPath!)
128128
.EnsureCreationOfDirectory()
129-
.EnsureNoReadOnly();
129+
.EnsureNoReadOnly(out bool isExist);
130130

131131
// This is a action for Unused asset.
132132
if (asset.AssetIndex.DataType == CacheAssetType.Unused)
133133
{
134-
if (fileInfo.Exists)
134+
if (isExist)
135135
fileInfo.Delete();
136136

137137
LogWriteLine($"Deleted unused file: {fileInfo.FullName}", LogType.Default, true);

CollapseLauncher/Classes/CachesManagement/StarRail/Check.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Hi3Helper;
1+
using CollapseLauncher.Helper;
2+
using Hi3Helper;
23
using Hi3Helper.EncTool.Parser.AssetMetadata.SRMetadataAsset;
34
using System;
45
using System.Collections.Generic;
@@ -79,12 +80,12 @@ private async ValueTask CheckAsset(SRAsset asset, List<SRAsset> returnAsset, str
7980
}
8081

8182
// Get persistent and streaming paths
82-
FileInfo fileInfoPersistent = new FileInfo(Path.Combine(basePersistent!, asset.LocalName!));
83-
FileInfo fileInfoStreaming = new FileInfo(Path.Combine(baseStreaming!, asset.LocalName!));
83+
FileInfo fileInfoPersistent = new FileInfo(Path.Combine(basePersistent!, asset.LocalName!)).EnsureNoReadOnly(out bool isPersistentExist);
84+
FileInfo fileInfoStreaming = new FileInfo(Path.Combine(baseStreaming!, asset.LocalName!)).EnsureNoReadOnly(out bool isStreamingExist);
8485

85-
bool UsePersistent = !fileInfoStreaming.Exists;
86-
bool IsPersistentExist = fileInfoPersistent.Exists && fileInfoPersistent.Length == asset.Size;
87-
bool IsStreamingExist = fileInfoStreaming.Exists && fileInfoStreaming.Length == asset.Size;
86+
bool UsePersistent = !isStreamingExist;
87+
bool IsPersistentExist = isPersistentExist && fileInfoPersistent.Length == asset.Size;
88+
bool IsStreamingExist = isStreamingExist && fileInfoStreaming.Length == asset.Size;
8889
asset.LocalName = UsePersistent ? fileInfoPersistent.FullName : fileInfoStreaming.FullName;
8990

9091
// Check if the file exist. If not, then add it to asset index.

CollapseLauncher/Classes/Extension/TaskExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#nullable enable
77
namespace CollapseLauncher.Extension
88
{
9-
internal delegate Task<TResult?> ActionTimeoutValueTaskCallback<TResult>(CancellationToken token);
10-
internal delegate void ActionOnTimeOutRetry(int retryAttemptCount, int retryAttemptTotal, int timeOutSecond, int timeOutStep);
9+
public delegate Task<TResult?> ActionTimeoutValueTaskCallback<TResult>(CancellationToken token);
10+
public delegate void ActionOnTimeOutRetry(int retryAttemptCount, int retryAttemptTotal, int timeOutSecond, int timeOutStep);
1111
internal static class TaskExtensions
1212
{
1313
internal const int DefaultTimeoutSec = 10;

0 commit comments

Comments
 (0)