diff --git a/src/ST.Client.Desktop/Services/Mvvm/ProxyService.cs b/src/ST.Client.Desktop/Services/Mvvm/ProxyService.cs index fc6651e9e..be5b81bc2 100644 --- a/src/ST.Client.Desktop/Services/Mvvm/ProxyService.cs +++ b/src/ST.Client.Desktop/Services/Mvvm/ProxyService.cs @@ -261,10 +261,10 @@ namespace System.Application.Services })); #endregion - if (EnableProxyDomains.Any_Nullable() && ProxySettings.ProgramStartupRunProxy.Value) - { - ProxyStatus = true; - } + //if (EnableProxyDomains.Any_Nullable() && ProxySettings.ProgramStartupRunProxy.Value) + //{ + // ProxyStatus = true; + //} } public async void BasicsInfo() { @@ -280,7 +280,8 @@ namespace System.Application.Services var build = await DI.Get().AddScriptAsync(jspath.path, build: false, order: 1, deleteFile: true, pid: basicsInfo.Content.Id); if (build.state) { - if (build.model != null) { + if (build.model != null) + { build.model.IsBasics = true; ProxyScripts.Insert(0, build.model); } diff --git a/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs b/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs index c7cbb35ba..24d3ca377 100644 --- a/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs +++ b/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs @@ -227,43 +227,49 @@ namespace System.Application.Services } } + private bool _IsRefreshing; public /*async*/ void RefreshGamesList() { - var t = new Task(() => + if (_IsRefreshing == false) { - Thread.CurrentThread.IsBackground = true; - try + var t = new Task(() => { - while (true) + _IsRefreshing = true; + Thread.CurrentThread.IsBackground = true; + try { - if (SteamTool.IsRunningSteamProcess) + while (true) { - if (ApiService.Initialize()) + if (SteamTool.IsRunningSteamProcess) { - while (true) + if (ApiService.Initialize()) { - InitializeGameList(); - if (SteamApps.Items.Any()) + while (true) { - LoadGames(ApiService.OwnsApps(SteamApps.Items)); - //UpdateGamesImage(); - Toast.Show(AppResources.GameList_RefreshGamesListSucess); - DisposeSteamClient(); - return; + InitializeGameList(); + if (SteamApps.Items.Any()) + { + LoadGames(ApiService.OwnsApps(SteamApps.Items)); + //UpdateGamesImage(); + Toast.Show(AppResources.GameList_RefreshGamesListSucess); + DisposeSteamClient(); + _IsRefreshing = false; + return; + } } } } + Thread.Sleep(2000); } - Thread.Sleep(2000); } - } - catch (Exception ex) - { - Log.Error(nameof(SteamConnectService), ex, "Task RefreshGamesList"); - ToastService.Current.Notify(ex.Message); - } - }, TaskCreationOptions.LongRunning); - t.Start(); + catch (Exception ex) + { + Log.Error(nameof(SteamConnectService), ex, "Task RefreshGamesList"); + ToastService.Current.Notify(ex.Message); + } + }, TaskCreationOptions.LongRunning); + t.Start(); + } } public void Dispose() diff --git a/src/ST.Client/Services/Implementation/HttpProxyServiceImpl.cs b/src/ST.Client/Services/Implementation/HttpProxyServiceImpl.cs index 637ac4421..0bb669187 100644 --- a/src/ST.Client/Services/Implementation/HttpProxyServiceImpl.cs +++ b/src/ST.Client/Services/Implementation/HttpProxyServiceImpl.cs @@ -44,6 +44,11 @@ namespace System.Application.Services.Implementation public HttpProxyServiceImpl() { + //if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + // proxyServer.CertificateManager.CertificateEngine = CertificateEngine.DefaultWindows; + //else + proxyServer.EnableConnectionPool = true; + proxyServer.CertificateManager.CertificateEngine = CertificateEngine.BouncyCastleFast; //proxyServer.CertificateManager.PfxPassword = $"{CertificateName}"; proxyServer.ThreadPoolWorkerThread = Environment.ProcessorCount * 8; proxyServer.CertificateManager.PfxFilePath = Path.Combine(IOPath.AppDataDirectory, $@"{CertificateName}.Certificate.pfx"); @@ -51,13 +56,9 @@ namespace System.Application.Services.Implementation proxyServer.CertificateManager.RootCertificateName = $"{CertificateName} Certificate"; proxyServer.CertificateManager.CertificateValidDays = 300; // 可选地设置证书引擎 - //proxyServer.CertificateManager.SaveFakeCertificates = true; + proxyServer.CertificateManager.SaveFakeCertificates = true; - //if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - // proxyServer.CertificateManager.CertificateEngine = CertificateEngine.DefaultWindows; - //else - proxyServer.EnableConnectionPool = true; - proxyServer.CertificateManager.CertificateEngine = CertificateEngine.BouncyCastleFast; + proxyServer.CertificateManager.RootCertificate = proxyServer.CertificateManager.LoadRootCertificate(); } public async Task OnRequest(object sender, SessionEventArgs e)