修复挂游戏时长功能问题

This commit is contained in:
rmbgame
2021-05-19 02:53:01 +08:00
parent 606e203df5
commit d228201a4e
3 changed files with 19 additions and 12 deletions
@@ -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);
@@ -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<ISteamworksWebApiService>().GetUserInfo(id);
CurrentSteamUser.AvatarStream = IHttpService.Instance.GetImageAsync(CurrentSteamUser.AvatarFull, ImageChannelType.SteamAvatars);
AvaterPath = CircleImageStream.Convert(await CurrentSteamUser.AvatarStream);
@@ -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
{