mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Fix quit fix and crash relaunch
This commit is contained in:
+33
-9
@@ -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,13 +17957,37 @@ 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 {
|
} else {
|
||||||
args.push(`vrchat://launch?id=${location}`);
|
// 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 {
|
||||||
|
args.push(`vrchat://launch?id=${location}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
var {launchArguments, vrcLaunchPathOverride} = this.launchOptionsDialog;
|
var {launchArguments, vrcLaunchPathOverride} = this.launchOptionsDialog;
|
||||||
if (launchArguments) {
|
if (launchArguments) {
|
||||||
@@ -17998,6 +18021,7 @@ speechSynthesis.getVoices();
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
console.log('Launch Game', args.join(' '), desktopMode);
|
||||||
D.visible = false;
|
D.visible = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user