From d228201a4e2f25ff936ca80a8422ec72833db2ca Mon Sep 17 00:00:00 2001 From: rmbgame Date: Wed, 19 May 2021 02:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8C=82=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E6=97=B6=E9=95=BF=E5=8A=9F=E8=83=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommandLineTools.cs | 17 ++++++++++++----- .../Services/Mvvm/SteamConnectService.cs | 6 +++--- .../GameListPage/IdleAppWindowViewModel.cs | 8 ++++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs b/src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs index 90d72acd6..1f72411fb 100644 --- a/src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs +++ b/src/ST.Client.Desktop.Avalonia.App/CommandLineTools.cs @@ -150,11 +150,18 @@ namespace System.Application.UI } else { - initStartup(DILevel.Steam); - SteamConnectService.Current.Initialize(id); - var day = 86400000; - while (true) - Threading.Thread.Sleep(day); + try + { + initStartup(DILevel.Steam); + SteamConnectService.Current.Initialize(id); + var day = 86400000; + while (true) + Threading.Thread.Sleep(day); + } + catch (Exception ex) + { + + } } }); rootCommand.AddCommand(unlock_achievement); diff --git a/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs b/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs index d5dfe690d..6f0dc0867 100644 --- a/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs +++ b/src/ST.Client.Desktop/Services/Mvvm/SteamConnectService.cs @@ -22,8 +22,8 @@ namespace System.Application.Services #endregion private readonly ISteamworksLocalApiService ApiService = ISteamworksLocalApiService.Instance; - private readonly ISteamworksWebApiService SteamworksWebApiService = ISteamworksWebApiService.Instance; - private readonly ISteamDbWebApiService steamDbApiService = ISteamDbWebApiService.Instance; + //private readonly ISteamworksWebApiService SteamworksWebApiService = ISteamworksWebApiService.Instance; + //private readonly ISteamDbWebApiService steamDbApiService = ISteamDbWebApiService.Instance; private readonly ISteamService SteamTool = ISteamService.Instance; public SteamConnectService() @@ -196,7 +196,7 @@ namespace System.Application.Services continue; } IsConnectToSteam = true; - CurrentSteamUser = await SteamworksWebApiService.GetUserInfo(id); + CurrentSteamUser = await DI.Get().GetUserInfo(id); CurrentSteamUser.AvatarStream = IHttpService.Instance.GetImageAsync(CurrentSteamUser.AvatarFull, ImageChannelType.SteamAvatars); AvaterPath = CircleImageStream.Convert(await CurrentSteamUser.AvatarStream); diff --git a/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/IdleAppWindowViewModel.cs b/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/IdleAppWindowViewModel.cs index 4b97a3357..ee36f5200 100644 --- a/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/IdleAppWindowViewModel.cs +++ b/src/ST.Client.Desktop/UI/ViewModels/Windows/GameListPage/IdleAppWindowViewModel.cs @@ -129,14 +129,14 @@ namespace System.Application.UI.ViewModels if (runState == null) { - item.Process = Process.Start(AppHelper.ProgramPath, "-clt -silence app -id " + item.AppId.ToString(CultureInfo.InvariantCulture)); + item.Process = Process.Start(AppHelper.ProgramPath, "-clt app -silence -id " + item.AppId.ToString(CultureInfo.InvariantCulture)); SteamConnectService.Current.RuningSteamApps.Add(item); } else { if (runState.Process == null || !runState.Process.HasExited) { - runState.Process = Process.Start(AppHelper.ProgramPath, "-clt -silence app -id " + runState.AppId.ToString(CultureInfo.InvariantCulture)); + runState.Process = Process.Start(AppHelper.ProgramPath, "-clt app -silence -id " + runState.AppId.ToString(CultureInfo.InvariantCulture)); } else { @@ -190,7 +190,7 @@ namespace System.Application.UI.ViewModels { if (app.Process == null) { - app.Process = Process.Start(AppHelper.ProgramPath, "-clt -silence app -id " + app.AppId.ToString(CultureInfo.InvariantCulture)); + app.Process = Process.Start(AppHelper.ProgramPath, "-clt app -silence -id " + app.AppId.ToString(CultureInfo.InvariantCulture)); } else { @@ -233,7 +233,7 @@ namespace System.Application.UI.ViewModels else { var runState = SteamConnectService.Current.RuningSteamApps.FirstOrDefault(x => x.AppId == item.Key); - runState?.Process?.Kill(); + runState?.Process?.Kill(); list.Add(new SteamApp {