fix IsGameRunning

This commit is contained in:
Lightczx
2023-10-26 14:12:45 +08:00
committed by DismissedLight
parent 9a54463d7d
commit f29fa1e8a0
4 changed files with 6 additions and 9 deletions

View File

@@ -76,7 +76,7 @@ internal sealed partial class DailyNoteOptions : DbStoreOptions
{
if (runtimeOptions.IsElevated)
{
// leave below untouched if we are running in elevated privilege
// leave untouched when we are running in elevated privilege
return null;
}
@@ -87,7 +87,7 @@ internal sealed partial class DailyNoteOptions : DbStoreOptions
{
if (runtimeOptions.IsElevated)
{
// leave below untouched if we are running in elevated privilege
// leave untouched when we are running in elevated privilege
return;
}

View File

@@ -222,8 +222,8 @@ internal sealed partial class GameService : IGameService
return false;
}
return Process.GetProcessesByName(YuanShenProcessName) is [_, ..]
|| Process.GetProcessesByName(GenshinImpactProcessName) is [_, ..];
return Process.GetProcessesByName(YuanShenProcessName).Any()
|| Process.GetProcessesByName(GenshinImpactProcessName).Any();
}
/// <inheritdoc/>
@@ -242,6 +242,7 @@ internal sealed partial class GameService : IGameService
{
try
{
Interlocked.Increment(ref runningGamesCounter);
game.Start();
progress.Report(new(LaunchPhase.ProcessStarted, SH.ServiceGameLaunchPhaseProcessStarted));

View File

@@ -72,10 +72,7 @@ internal sealed class GameFpsUnlocker : IGameFpsUnlocker
{
ulong temp = 0;
bool result = ReadProcessMemory((HANDLE)process.Handle, (void*)baseAddress, (byte*)&temp, 8);
if (!result)
{
ThrowHelper.InvalidOperation(SH.ServiceGameUnlockerReadProcessMemoryPointerAddressFailed, null);
}
Verify.Operation(result, SH.ServiceGameUnlockerReadProcessMemoryPointerAddressFailed);
value = (nuint)temp;
return result;

View File

@@ -212,7 +212,6 @@
<MenuFlyoutSeparator Grid.Column="2"/>
</Grid>
<shvcont:StatisticsSegmented
x:Name="StatisticsSegmented"
Margin="0,12,0,0"