Fix quit fix and crash relaunch

This commit is contained in:
Natsumi
2023-04-25 22:39:14 +12:00
parent 18447710bb
commit edcbf69369
+32 -8
View File
@@ -5039,7 +5039,6 @@ speechSynthesis.getVoices();
API.currentUser.$online_for = Date.now(); API.currentUser.$online_for = Date.now();
API.currentUser.$offline_for = ''; API.currentUser.$offline_for = '';
} else { } else {
this.isGameNoVR = false;
configRepository.setBool( configRepository.setBool(
'isGameNoVR', 'isGameNoVR',
this.isGameNoVR this.isGameNoVR
@@ -9566,12 +9565,12 @@ speechSynthesis.getVoices();
database.addGamelogEventToDatabase(entry); database.addGamelogEventToDatabase(entry);
break; break;
case 'vrc-quit': case 'vrc-quit':
var bias = Date.parse(gameLog.dt) + 1000; if (!this.vrcQuitFix || !this.isGameRunning) {
if ( break;
!this.vrcQuitFix || }
!this.isGameRunning || var bias = Date.parse(gameLog.dt) + 3000;
bias < Date.now() if (bias < Date.now()) {
) { console.log('QuitFix: Bias too low, not killing VRC');
break; break;
} }
AppApi.QuitGame().then((processCount) => { AppApi.QuitGame().then((processCount) => {
@@ -17958,14 +17957,38 @@ speechSynthesis.getVoices();
)}`; )}`;
}; };
$app.methods.launchGame = function (location, shortName, desktopMode) { $app.methods.launchGame = async function (
location,
shortName,
desktopMode
) {
var D = this.launchDialog; var D = this.launchDialog;
var args = []; var args = [];
if (shortName) { if (shortName) {
args.push(`vrchat://launch?id=${location}&shortName=${shortName}`); args.push(`vrchat://launch?id=${location}&shortName=${shortName}`);
} else {
// fetch shortName
var newShortName = '';
var L = API.parseLocation(location);
var response = await API.getInstanceShortName({
worldId: L.worldId,
instanceId: L.instanceId
});
if (response.json) {
if (response.json.shortName) {
newShortName = response.json.shortName;
} else {
newShortName = response.json.secureName;
}
}
if (newShortName) {
args.push(
`vrchat://launch?id=${location}&shortName=${newShortName}`
);
} else { } else {
args.push(`vrchat://launch?id=${location}`); args.push(`vrchat://launch?id=${location}`);
} }
}
var {launchArguments, vrcLaunchPathOverride} = this.launchOptionsDialog; var {launchArguments, vrcLaunchPathOverride} = this.launchOptionsDialog;
if (launchArguments) { if (launchArguments) {
args.push(launchArguments); args.push(launchArguments);
@@ -17998,6 +18021,7 @@ speechSynthesis.getVoices();
type: 'success' type: 'success'
}); });
} }
console.log('Launch Game', args.join(' '), desktopMode);
D.visible = false; D.visible = false;
}; };