mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix package converter missing directory
This commit is contained in:
@@ -6,7 +6,6 @@ using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
|
||||
using Snap.Hutao.Core.ExceptionService;
|
||||
using Snap.Hutao.Core.IO;
|
||||
using Snap.Hutao.Core.IO.Hashing;
|
||||
using Snap.Hutao.Service.Notification;
|
||||
using Snap.Hutao.Web.Hoyolab.SdkStatic.Hk4e.Launcher;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
@@ -260,6 +259,7 @@ internal sealed partial class PackageConverter
|
||||
}
|
||||
|
||||
// Cache no matching item, download
|
||||
Directory.CreateDirectory(context.ServerCacheTargetFolder);
|
||||
using (FileStream fileStream = File.Create(cacheFile))
|
||||
{
|
||||
string remoteUrl = context.GetScatteredFilesUrl(remoteName);
|
||||
|
||||
@@ -29,9 +29,12 @@ internal sealed class PackageReplaceStatus : ICloneable<PackageReplaceStatus>
|
||||
public PackageReplaceStatus(string name, long bytesRead, long totalBytes)
|
||||
{
|
||||
Percent = (double)bytesRead / totalBytes;
|
||||
Description = $"{name}\n{Converters.ToFileSizeString(bytesRead)}/{Converters.ToFileSizeString(totalBytes)}";
|
||||
Name = name;
|
||||
Description = $"{Converters.ToFileSizeString(bytesRead)}/{Converters.ToFileSizeString(totalBytes)}";
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述
|
||||
/// </summary>
|
||||
|
||||
@@ -40,7 +40,7 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task UnlockAsync(UnlockTimingOptions options, IProgress<UnlockerStatus> progress, CancellationToken token = default)
|
||||
public async ValueTask UnlockAsync(UnlockTimingOptions options, IProgress<UnlockerStatus> progress, CancellationToken token = default)
|
||||
{
|
||||
Verify.Operation(status.IsUnlockerValid, "This Unlocker is invalid");
|
||||
|
||||
@@ -177,7 +177,7 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
|
||||
return FindModuleResult.ModuleNotLoaded;
|
||||
}
|
||||
|
||||
private async Task<ValueResult<FindModuleResult, GameModule>> FindModuleAsync(TimeSpan findModuleDelay, TimeSpan findModuleLimit)
|
||||
private async ValueTask<ValueResult<FindModuleResult, GameModule>> FindModuleAsync(TimeSpan findModuleDelay, TimeSpan findModuleLimit)
|
||||
{
|
||||
ValueStopwatch watch = ValueStopwatch.StartNew();
|
||||
using (PeriodicTimer timer = new(findModuleDelay))
|
||||
@@ -205,7 +205,7 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
|
||||
return new(FindModuleResult.TimeLimitExeeded, default);
|
||||
}
|
||||
|
||||
private async Task LoopAdjustFpsAsync(TimeSpan adjustFpsDelay, IProgress<UnlockerStatus> progress, CancellationToken token)
|
||||
private async ValueTask LoopAdjustFpsAsync(TimeSpan adjustFpsDelay, IProgress<UnlockerStatus> progress, CancellationToken token)
|
||||
{
|
||||
using (PeriodicTimer timer = new(adjustFpsDelay))
|
||||
{
|
||||
|
||||
@@ -16,5 +16,5 @@ internal interface IGameFpsUnlocker
|
||||
/// <param name="progress">进度</param>
|
||||
/// <param name="token">取消令牌</param>
|
||||
/// <returns>解锁的结果</returns>
|
||||
Task UnlockAsync(UnlockTimingOptions options, IProgress<UnlockerStatus> progress, CancellationToken token = default);
|
||||
ValueTask UnlockAsync(UnlockTimingOptions options, IProgress<UnlockerStatus> progress, CancellationToken token = default);
|
||||
}
|
||||
Reference in New Issue
Block a user