mirror of
https://github.com/vrcx-team/VRCX.git
synced 2026-04-06 00:32:02 +02:00
Fix Electron IsGameRunning check
This commit is contained in:
@@ -13,17 +13,15 @@ namespace VRCX
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the VRChat game and SteamVR are currently running and updates the browser's JavaScript function $app.updateIsGameRunning with the results.
|
||||
/// for Cef only, checks if VRChat and SteamVR are currently running and updates the browser using JavaScript with the results.
|
||||
/// </summary>
|
||||
public override void CheckGameRunning()
|
||||
{
|
||||
ProcessMonitor.Instance.IsProcessRunning("VRChat");
|
||||
ProcessMonitor.Instance.IsProcessRunning("vrserver");
|
||||
}
|
||||
|
||||
public override bool IsGameRunning()
|
||||
{
|
||||
var processes = Process.GetProcessesByName("VRChat");
|
||||
var processes = Process.GetProcessesByName("VRChat.exe");
|
||||
var isGameRunning = processes.Length > 0;
|
||||
foreach (var process in processes)
|
||||
process.Dispose();
|
||||
@@ -56,7 +54,7 @@ namespace VRCX
|
||||
|
||||
public override int QuitGame()
|
||||
{
|
||||
var processes = Process.GetProcessesByName("vrchat");
|
||||
var processes = Process.GetProcessesByName("VRChat.exe");
|
||||
if (processes.Length == 1)
|
||||
processes[0].Kill();
|
||||
foreach (var process in processes)
|
||||
|
||||
@@ -432,13 +432,8 @@ namespace VRCX
|
||||
if (!success)
|
||||
break; // this fails while SteamVR overlay is open
|
||||
|
||||
var prox = state.ulButtonPressed & (1UL << ((int)EVRButtonId.k_EButton_ProximitySensor));
|
||||
var isHmdAfk = prox == 0;
|
||||
if (isHmdAfk != IsHmdAfk)
|
||||
{
|
||||
IsHmdAfk = isHmdAfk;
|
||||
Program.AppApiInstance.CheckGameRunning();
|
||||
}
|
||||
// var prox = state.ulButtonPressed & (1UL << ((int)EVRButtonId.k_EButton_ProximitySensor));
|
||||
// var isHmdAfk = prox == 0;
|
||||
|
||||
var headsetErr = ETrackedPropertyError.TrackedProp_Success;
|
||||
var headsetBatteryPercentage = system.GetFloatTrackedDeviceProperty(i, ETrackedDeviceProperty.Prop_DeviceBatteryPercentage_Float, ref headsetErr);
|
||||
|
||||
@@ -284,7 +284,6 @@ namespace VRCX
|
||||
logger.Info("Launch Command: {0}", StartupArgs.LaunchArguments.LaunchCommand);
|
||||
|
||||
AppApiInstance = new AppApiElectron();
|
||||
// ProcessMonitor.Instance.Init();
|
||||
|
||||
VRCXVRInstance = new VRCXVRElectron();
|
||||
VRCXVRInstance.Init();
|
||||
|
||||
Reference in New Issue
Block a user