This commit is contained in:
rmbgame
2021-04-29 18:03:24 +08:00
parent e73e22464e
commit d83c2e3de9
3 changed files with 42 additions and 34 deletions
@@ -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<IScriptManagerService>().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);
}
@@ -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()
@@ -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)