Skip to content

Commit 0970930

Browse files
committed
Small Code QA
1 parent adc8853 commit 0970930

File tree

2 files changed

+2
-113
lines changed

2 files changed

+2
-113
lines changed

CollapseLauncher/Classes/InstallManagement/Base/InstallManagerBase.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
using ZipArchive = SharpCompress.Archives.Zip.ZipArchive;
6666
using ZipArchiveEntry = SharpCompress.Archives.Zip.ZipArchiveEntry;
6767
// ReSharper disable SwitchStatementMissingSomeEnumCasesNoDefault
68-
#pragma warning disable CS8777 // Parameter must have a non-null value when exiting.
6968
#endif
7069

7170
// ReSharper disable ForCanBeConvertedToForeach
@@ -2139,15 +2138,15 @@ protected virtual int GetIDByLanguageLocaleCode([NotNull] string? localeCode)
21392138
};
21402139
}
21412140

2142-
protected virtual string GetLanguageStringByLocaleCode([NotNull] string? localeCode, bool throwIfInvalid =
2141+
protected virtual string GetLanguageStringByLocaleCode(string? localeCode, bool throwIfInvalid =
21432142
#if DEBUG
21442143
true
21452144
#else
21462145
false
21472146
#endif
21482147
) => GetLanguageStringByLocaleCodeStatic(localeCode, throwIfInvalid);
21492148

2150-
internal static string GetLanguageStringByLocaleCodeStatic([NotNull] string? localeCode, bool throwIfInvalid =
2149+
internal static string GetLanguageStringByLocaleCodeStatic(string? localeCode, bool throwIfInvalid =
21512150
#if DEBUG
21522151
true
21532152
#else

CollapseLauncher/Classes/RepairManagement/Genshin/Fetch.cs

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -197,116 +197,6 @@ await GenshinInstall.DownloadPkgVersionStatic(httpClient,
197197
}
198198
#nullable restore
199199

200-
/*
201-
private async Task BuildPrimaryManifestOld(DownloadClient downloadClient,
202-
DownloadProgressDelegate downloadProgress,
203-
List<PkgVersionProperties> assetIndex,
204-
Dictionary<string, PkgVersionProperties> hashtableManifest,
205-
CancellationToken token)
206-
{
207-
try
208-
{
209-
// Try Cleanup Download Profile file
210-
TryDeleteDownloadPref();
211-
212-
// Build basic file entry.
213-
string manifestPath = Path.Combine(GamePath, "pkg_version");
214-
215-
// Download basic package version list
216-
var basicVerURL = CombineURLFromString(GameRepoURL, "pkg_version");
217-
#if DEBUG
218-
LogWriteLine($"Downloading pkg_version...\r\n\t{basicVerURL}", LogType.Debug, true);
219-
#endif
220-
await downloadClient.DownloadAsync(
221-
basicVerURL,
222-
EnsureCreationOfDirectory(manifestPath),
223-
true,
224-
progressDelegateAsync: downloadProgress,
225-
maxConnectionSessions: DownloadThreadCount,
226-
cancelToken: token
227-
);
228-
229-
// Download additional package lists
230-
var dataVerPath = $@"{ExecPrefix}_Data\StreamingAssets\data_versions_streaming";
231-
var dataVerURL = CombineURLFromString(GameRepoURL, dataVerPath);
232-
#if DEBUG
233-
LogWriteLine($"Downloading data_versions_streaming...\r\n\t{dataVerURL}", LogType.Debug, true);
234-
#endif
235-
await downloadClient.DownloadAsync(
236-
dataVerURL,
237-
EnsureCreationOfDirectory(Path.Combine(GamePath, dataVerPath)),
238-
true,
239-
progressDelegateAsync: downloadProgress,
240-
maxConnectionSessions: DownloadThreadCount,
241-
cancelToken: token
242-
);
243-
244-
var silenceVerPath = $@"{ExecPrefix}_Data\StreamingAssets\silence_versions_streaming";
245-
var silenceVerURL = CombineURLFromString(GameRepoURL, silenceVerPath);
246-
#if DEBUG
247-
LogWriteLine($"Downloading silence_versions_streaming...\r\n\t{silenceVerURL}", LogType.Debug, true);
248-
#endif
249-
await downloadClient.DownloadAsync(
250-
silenceVerURL,
251-
EnsureCreationOfDirectory(Path.Combine(GamePath, silenceVerPath)),
252-
true,
253-
progressDelegateAsync: downloadProgress,
254-
maxConnectionSessions: DownloadThreadCount,
255-
cancelToken: token
256-
);
257-
258-
var resVerPath = $@"{ExecPrefix}_Data\StreamingAssets\res_versions_streaming";
259-
var resVerURL = CombineURLFromString(GameRepoURL, resVerPath);
260-
#if DEBUG
261-
LogWriteLine($"Downloading res_versions_streaming...\r\n\t{resVerURL}", LogType.Debug, true);
262-
#endif
263-
await downloadClient.DownloadAsync(
264-
resVerURL,
265-
EnsureCreationOfDirectory(Path.Combine(GamePath, resVerPath)),
266-
true,
267-
progressDelegateAsync: downloadProgress,
268-
maxConnectionSessions: DownloadThreadCount,
269-
cancelToken: token
270-
);
271-
272-
var videoVerPath = $@"{ExecPrefix}_Data\StreamingAssets\VideoAssets\video_versions_streaming";
273-
var videoVerURL = CombineURLFromString(GameRepoURL, videoVerPath);
274-
#if DEBUG
275-
LogWriteLine($"Downloading video_versions_streaming...\r\n\t{videoVerURL}", LogType.Debug, true);
276-
#endif
277-
await downloadClient.DownloadAsync(
278-
videoVerURL,
279-
EnsureCreationOfDirectory(Path.Combine(GamePath, videoVerPath)),
280-
true,
281-
progressDelegateAsync: downloadProgress,
282-
maxConnectionSessions: DownloadThreadCount,
283-
cancelToken: token
284-
);
285-
286-
// Parse basic package version.
287-
var streamingAssetsPath = $@"{ExecPrefix}_Data\StreamingAssets";
288-
ParseManifestToAssetIndex(manifestPath, "", assetIndex, hashtableManifest, GameRepoURL, true);
289-
290-
// Build additional blks entry.
291-
EnumerateManifestToAssetIndex(streamingAssetsPath, streamingAssetsPath, "data_versions_*", assetIndex, hashtableManifest,
292-
GameRepoURL, true);
293-
EnumerateManifestToAssetIndex(streamingAssetsPath, streamingAssetsPath, "silence_versions_*", assetIndex, hashtableManifest,
294-
GameRepoURL, true);
295-
EnumerateManifestToAssetIndex(streamingAssetsPath, streamingAssetsPath, "res_versions_*", assetIndex, hashtableManifest,
296-
GameRepoURL, true);
297-
298-
// Build cutscenes entry.
299-
EnumerateManifestToAssetIndex(streamingAssetsPath, streamingAssetsPath, "VideoAssets\\*_versions_*", assetIndex, hashtableManifest,
300-
GameRepoURL, true);
301-
}
302-
catch (Exception ex)
303-
{
304-
LogWriteLine($"Parsing primary manifest has failed!\r\n{ex}", LogType.Error, true);
305-
ErrorSender.SendException(ex);
306-
}
307-
}
308-
*/
309-
310200
private void TryDeleteDownloadPref()
311201
{
312202
// Get the paths

0 commit comments

Comments
 (0)