mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-23 08:43:50 +02:00
VRC quit fix
This commit is contained in:
@@ -137,6 +137,15 @@ namespace VRCX
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int QuitGame()
|
||||||
|
{
|
||||||
|
var processes = Process.GetProcessesByName("vrchat");
|
||||||
|
if (processes.Length == 1)
|
||||||
|
processes[0].Kill();
|
||||||
|
|
||||||
|
return processes.Length;
|
||||||
|
}
|
||||||
|
|
||||||
public void StartGame(string arguments)
|
public void StartGame(string arguments)
|
||||||
{
|
{
|
||||||
// try stream first
|
// try stream first
|
||||||
|
|||||||
@@ -235,7 +235,8 @@ namespace VRCX
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ParseLogShaderKeywordsLimit(fileInfo, logContext, line, offset) == true ||
|
if (ParseLogShaderKeywordsLimit(fileInfo, logContext, line, offset) == true ||
|
||||||
ParseLogSDK2VideoPlay(fileInfo, logContext, line, offset) == true)
|
ParseLogSDK2VideoPlay(fileInfo, logContext, line, offset) == true ||
|
||||||
|
ParseApplicationQuit(fileInfo, logContext, line, offset) == true)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -838,6 +839,23 @@ namespace VRCX
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool ParseApplicationQuit(FileInfo fileInfo, LogContext logContext, string line, int offset)
|
||||||
|
{
|
||||||
|
// 2022.06.12 01:51:46 Log - VRCApplication: OnApplicationQuit at 1603.499
|
||||||
|
|
||||||
|
if (string.Compare(line, offset, "VRCApplication: OnApplicationQuit at ", 0, 37, StringComparison.Ordinal) != 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
AppendLog(new[]
|
||||||
|
{
|
||||||
|
fileInfo.Name,
|
||||||
|
ConvertLogTimeToISO8601(line),
|
||||||
|
"vrc-quit"
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public string[][] Get()
|
public string[][] Get()
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
|
|||||||
@@ -8255,6 +8255,27 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
database.addGamelogEventToDatabase(entry);
|
database.addGamelogEventToDatabase(entry);
|
||||||
break;
|
break;
|
||||||
|
case 'vrc-quit':
|
||||||
|
var bias = Date.parse(gameLog.dt) + 1000;
|
||||||
|
if (
|
||||||
|
!this.vrcQuitFix ||
|
||||||
|
!this.isGameRunning ||
|
||||||
|
bias < Date.now()
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AppApi.QuitGame().then((processCount) => {
|
||||||
|
if (processCount > 1) {
|
||||||
|
console.log(
|
||||||
|
'More than 1 process running, not killing VRC'
|
||||||
|
);
|
||||||
|
} else if (processCount === 1) {
|
||||||
|
console.log('Killed VRC');
|
||||||
|
} else {
|
||||||
|
console.log('Nothing to kill, no VRC process running');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (entry) {
|
if (entry) {
|
||||||
this.queueGameLogNoty(entry);
|
this.queueGameLogNoty(entry);
|
||||||
@@ -11460,6 +11481,7 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.autoSweepVRChatCache = configRepository.getBool(
|
$app.data.autoSweepVRChatCache = configRepository.getBool(
|
||||||
'VRCX_autoSweepVRChatCache'
|
'VRCX_autoSweepVRChatCache'
|
||||||
);
|
);
|
||||||
|
$app.data.vrcQuitFix = configRepository.getBool('VRCX_vrcQuitFix');
|
||||||
$app.data.vrBackgroundEnabled = configRepository.getBool(
|
$app.data.vrBackgroundEnabled = configRepository.getBool(
|
||||||
'VRCX_vrBackgroundEnabled'
|
'VRCX_vrBackgroundEnabled'
|
||||||
);
|
);
|
||||||
@@ -11531,6 +11553,7 @@ speechSynthesis.getVoices();
|
|||||||
'VRCX_autoSweepVRChatCache',
|
'VRCX_autoSweepVRChatCache',
|
||||||
this.autoSweepVRChatCache
|
this.autoSweepVRChatCache
|
||||||
);
|
);
|
||||||
|
configRepository.setBool('VRCX_vrcQuitFix', this.vrcQuitFix);
|
||||||
configRepository.setBool(
|
configRepository.setBool(
|
||||||
'VRCX_vrBackgroundEnabled',
|
'VRCX_vrBackgroundEnabled',
|
||||||
this.vrBackgroundEnabled
|
this.vrBackgroundEnabled
|
||||||
|
|||||||
@@ -1188,6 +1188,10 @@ html
|
|||||||
span.name Force ISO date format
|
span.name Force ISO date format
|
||||||
el-switch(v-model="dtIsoFormat" @change="setDatetimeFormat")
|
el-switch(v-model="dtIsoFormat" @change="setDatetimeFormat")
|
||||||
div.options-container
|
div.options-container
|
||||||
|
span.sub-header VRChat Quit Fix
|
||||||
|
div.options-container-item
|
||||||
|
span.name(style="min-width:300px") Kill VRChat after exiting game
|
||||||
|
el-switch(v-model="vrcQuitFix" @change="saveOpenVROption")
|
||||||
span.sub-header Automatically Manage Cache When Closing VRChat
|
span.sub-header Automatically Manage Cache When Closing VRChat
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
span.name(style="min-width:300px") Auto delete old versions from cache
|
span.name(style="min-width:300px") Auto delete old versions from cache
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ class GameLogService {
|
|||||||
gameLog.photonId = args[1];
|
gameLog.photonId = args[1];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'vrc-quit':
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user