feat: kill install process after exiting game (#864)

* feat: kill install process after exiting game

* Restore en.json

* fix some key incorrect

* gui: update for VRChat OSC Fix

* fix: may incorrectly kill unrelated processes

* fix: pattern incorrect
This commit is contained in:
RingLo_
2024-08-07 16:54:39 +08:00
committed by GitHub
parent c3f4771f4d
commit 6465dc0910
4 changed files with 81 additions and 27 deletions

View File

@@ -11246,27 +11246,44 @@ speechSynthesis.getVoices();
database.addGamelogEventToDatabase(entry);
break;
case 'vrc-quit':
if (!this.vrcQuitFix || !this.isGameRunning) {
if (!this.isGameRunning) {
break;
}
var bias = Date.parse(gameLog.dt) + 3000;
if (bias < Date.now()) {
console.log('QuitFix: Bias too low, not killing VRC');
break;
}
AppApi.QuitGame().then((processCount) => {
if (processCount > 1) {
console.log(
'QuitFix: More than 1 process running, not killing VRC'
);
} else if (processCount === 1) {
console.log('QuitFix: Killed VRC');
} else {
console.log(
'QuitFix: Nothing to kill, no VRC process running'
);
if (this.vrcQuitFix) {
var bias = Date.parse(gameLog.dt) + 3000;
if (bias < Date.now()) {
console.log('QuitFix: Bias too low, not killing VRC');
break;
}
});
AppApi.QuitGame().then((processCount) => {
if (processCount > 1) {
console.log(
'QuitFix: More than 1 process running, not killing VRC'
);
} else if (processCount === 1) {
console.log('QuitFix: Killed VRC');
} else {
console.log(
'QuitFix: Nothing to kill, no VRC process running'
);
}
});
}
if (this.vrcOSCFix) {
setTimeout(() => {
AppApi.KillInstall().then((processKilled) => {
if (processKilled) {
console.log(
'OSCFix: Killed Install.exe'
);
} else {
console.log(
'OSCFix: Nothing to kill, no Install.exe process running'
);
}
});
}, 2000);
}
break;
case 'openvr-init':
this.isGameNoVR = false;
@@ -15394,6 +15411,10 @@ speechSynthesis.getVoices();
'VRCX_vrcQuitFix',
true
);
$app.data.vrcOSCFix = await configRepository.getBool(
'VRCX_vrcOSCFix',
true
);
$app.data.vrBackgroundEnabled = await configRepository.getBool(
'VRCX_vrBackgroundEnabled',
false
@@ -15573,6 +15594,7 @@ speechSynthesis.getVoices();
this.relaunchVRChatAfterCrash
);
await configRepository.setBool('VRCX_vrcQuitFix', this.vrcQuitFix);
await configRepository.setBool('VRCX_vrcOSCFix', this.vrcOSCFix);
await configRepository.setBool(
'VRCX_vrBackgroundEnabled',
this.vrBackgroundEnabled