DGP-Studio / Snap.Hutao

实用的开源多功能原神工具箱 🧰 / Multifunctional Open-source Genshin Impact Toolkit 🧰
https://hut.ao
MIT License
4.09k stars 192 forks source link

[Bug]: 重启后分辨率设置无法保存 #2229

Open UN-AF opened 1 day ago

UN-AF commented 1 day ago

检查清单

Windows 版本

19045.5131

Snap Hutao 版本

1.12.3.0

设备 ID

7020793F3DCD1A0F6731BF16F3EB4779

问题分类

游戏启动器

发生了什么?

设置好启动分辨率的宽度和高度后关闭胡桃再重新打开分辨率会回到默认设置

你期望发生的行为?

重启胡桃之后能保留原来设置的分辨率

最后一步

dgp-bot[bot] commented 1 day ago

device_id: 7020793F3DCD1A0F6731BF16F3EB4779

Exception Data:
----------------------------------------
System.IO.IOException: 指定不存在的设备。 : 'G:\Genshin Impact\Genshin Impact Game\config.ini'
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.OpenText(String path)
   at Snap.Hutao.Core.IO.Ini.IniSerializer.DeserializeFromFile(String filePath) in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Core\IO\Ini\IniSerializer.cs:line 12
   at Snap.Hutao.Service.Game.GameFileSystemExtension.TryFixScriptVersion(GameFileSystem gameFileSystem) in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Service\Game\GameFileSystemExtension.cs:line 88
   at Snap.Hutao.Service.Game.Configuration.GameChannelOptionsService.GetChannelOptions() in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Service\Game\Configuration\GameChannelOptionsService.cs:line 38
   at Snap.Hutao.Service.Game.GameServiceFacade.GetChannelOptions() in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Service\Game\GameServiceFacade.cs:line 34
   at Snap.Hutao.ViewModel.Game.LaunchGameShared.GetCurrentLaunchSchemeFromConfigFile() in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\ViewModel\Game\LaunchGameShared.cs:line 29
   at Snap.Hutao.ViewModel.Game.LaunchGameViewModelSlim.LoadAsync() in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\ViewModel\Game\LaunchGameViewModelSlim.cs:line 45
   at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext.<>c__DisplayClass2_0.<Post>b__0()
Exception Data:
[string]:Description:操作标识符不正确。

[string]:RestrictedDescription:The WinUI Desktop Window object has already been closed.
[string]:RestrictedErrorReference:
[string]:RestrictedCapabilitySid:
[WinRT.ObjectReferenceWithContext<WinRT.Interop.IUnknownVftbl>]:__RestrictedErrorObjectReference:WinRT.ObjectReferenceWithContext`1[WinRT.Interop.IUnknownVftbl]
[bool]:__HasRestrictedLanguageErrorObject:False
----------------------------------------
System.Runtime.InteropServices.COMException (0x800710DD): 操作标识符不正确。

The WinUI Desktop Window object has already been closed.
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IWindowMethods.get_Content(IObjectReference _obj)
   at Microsoft.UI.Xaml.Window.get_Content()
   at Snap.Hutao.Core.LifeCycle.CurrentXamlWindowReferenceExtension.GetXamlRoot(ICurrentXamlWindowReference reference) in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Core\LifeCycle\CurrentXamlWindowReferenceExtension.cs:line 15
   at Snap.Hutao.Factory.ContentDialog.ContentDialogFactory.CreateForConfirmCancelAsync(String title, String content, ContentDialogButton defaultButton) in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Factory\ContentDialog\ContentDialogFactory.cs:line 48
   at Snap.Hutao.ViewModel.TitleViewModel.DoCheckUpdateAsync() in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\ViewModel\TitleViewModel.cs:line 122
   at Snap.Hutao.ViewModel.TitleViewModel.InitializeOverrideAsync() in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\ViewModel\TitleViewModel.cs:line 69
   at Snap.Hutao.ViewModel.Abstraction.ViewModel.InitializeAsync() in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\ViewModel\Abstraction\ViewModel.cs:line 48
   at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext.<>c__DisplayClass2_0.<Post>b__0()
Exception Data:
----------------------------------------
System.ObjectDisposedException: Cannot access a closed Stream.
   at System.IO.MemoryStream.get_Length()
   at System.Net.Http.HttpContent.ReadBufferedContentAsString()
   at System.Net.Http.HttpContent.WaitAndReturnAsync[TState,TResult](Task waitTask, TState state, Func`2 returnFunc)
   at Snap.Hutao.Web.Hoyolab.DataSigning.DataSignOptions.CreateFromHttpRequestMessageBuilderAsync(HttpRequestMessageBuilder builder, SaltType type, Boolean includeChars, DataSignAlgorithmVersion version) in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Web\Hoyolab\DataSigning\DataSignOptions.cs:line 44
   at Snap.Hutao.Web.Hoyolab.DataSigning.DataSignHttpRequestMessageBuilderExtension.SignDataAsync(HttpRequestMessageBuilder builder, DataSignAlgorithmVersion version, SaltType saltType, Boolean includeChars) in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Web\Hoyolab\DataSigning\DataSignHttpRequestMessageBuilderExtension.cs:line 12
   at Snap.Hutao.Web.Hoyolab.Takumi.Event.BbsSignReward.SignInClient.SignAsync(UserAndUid userAndUid, CancellationToken token) in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Web\Hoyolab\Takumi\Event\BbsSignReward\SignInClient.cs:line 119
   at Snap.Hutao.Service.SignIn.SignInService.ClaimRewardAsync(UserAndUid userAndUid, CancellationToken token) in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\Service\SignIn\SignInService.cs:line 32
   at Snap.Hutao.ViewModel.User.UserViewModel.ClaimSignInRewardAsync() in C:\Users\Public\appveyor\Snap.Hutao\src\Snap.Hutao\Snap.Hutao\ViewModel\User\UserViewModel.cs:line 315
   at CommunityToolkit.Mvvm.Input.AsyncRelayCommand.AwaitAndThrowIfFailed(Task executionTask)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext.<>c__DisplayClass2_0.<Post>b__0()
dgp-bot[bot] commented 1 day ago

3af7d174f3dd79588560f923faa14f923b87dc95 已完成此议题