mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
Relaunch on game crash, log udon exceptions
This commit is contained in:
@@ -5026,6 +5026,7 @@ speechSynthesis.getVoices();
|
||||
API.currentUser.$online_for = '';
|
||||
API.currentUser.$offline_for = Date.now();
|
||||
this.autoVRChatCacheManagement();
|
||||
this.checkIfGameCrashed();
|
||||
this.ipcTimeout = 0;
|
||||
}
|
||||
this.lastLocationReset();
|
||||
@@ -9197,7 +9198,8 @@ speechSynthesis.getVoices();
|
||||
if (
|
||||
this.debugGameLog &&
|
||||
gameLog.type !== 'photon-id' &&
|
||||
gameLog.type !== 'api-request'
|
||||
gameLog.type !== 'api-request' &&
|
||||
gameLog.type !== 'udon-exception'
|
||||
) {
|
||||
console.log('gameLog:', gameLog);
|
||||
}
|
||||
@@ -9525,6 +9527,15 @@ speechSynthesis.getVoices();
|
||||
this.isGameNoVR = true;
|
||||
configRepository.setBool('isGameNoVR', this.isGameNoVR);
|
||||
break;
|
||||
case 'udon-exception':
|
||||
console.log('UdonException', gameLog.data);
|
||||
// var entry = {
|
||||
// created_at: gameLog.dt,
|
||||
// type: 'Event',
|
||||
// data: gameLog.data
|
||||
// };
|
||||
// database.addGamelogEventToDatabase(entry);
|
||||
break;
|
||||
}
|
||||
if (entry) {
|
||||
this.queueGameLogNoty(entry);
|
||||
@@ -13060,6 +13071,9 @@ speechSynthesis.getVoices();
|
||||
$app.data.autoSweepVRChatCache = configRepository.getBool(
|
||||
'VRCX_autoSweepVRChatCache'
|
||||
);
|
||||
$app.data.relaunchVRChatAfterCrash = configRepository.getBool(
|
||||
'VRCX_relaunchVRChatAfterCrash'
|
||||
);
|
||||
$app.data.vrcQuitFix = configRepository.getBool('VRCX_vrcQuitFix');
|
||||
$app.data.vrBackgroundEnabled = configRepository.getBool(
|
||||
'VRCX_vrBackgroundEnabled'
|
||||
@@ -13180,6 +13194,10 @@ speechSynthesis.getVoices();
|
||||
'VRCX_autoSweepVRChatCache',
|
||||
this.autoSweepVRChatCache
|
||||
);
|
||||
configRepository.setBool(
|
||||
'VRCX_relaunchVRChatAfterCrash',
|
||||
this.relaunchVRChatAfterCrash
|
||||
);
|
||||
configRepository.setBool('VRCX_vrcQuitFix', this.vrcQuitFix);
|
||||
configRepository.setBool(
|
||||
'VRCX_vrBackgroundEnabled',
|
||||
@@ -17738,9 +17756,29 @@ speechSynthesis.getVoices();
|
||||
args.push('--no-vr');
|
||||
}
|
||||
if (vrcLaunchPathOverride) {
|
||||
AppApi.StartGameFromPath(vrcLaunchPathOverride, args.join(' '));
|
||||
AppApi.StartGameFromPath(
|
||||
vrcLaunchPathOverride,
|
||||
args.join(' ')
|
||||
).then((result) => {
|
||||
if (!result) {
|
||||
this.$message({
|
||||
message:
|
||||
'Failed to launch VRChat, invalid custom path set',
|
||||
type: 'error'
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: 'VRChat launched',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
AppApi.StartGame(args.join(' '));
|
||||
this.$message({
|
||||
message: 'VRChat launched',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
D.visible = false;
|
||||
};
|
||||
@@ -20689,6 +20727,28 @@ speechSynthesis.getVoices();
|
||||
}
|
||||
};
|
||||
|
||||
$app.methods.checkIfGameCrashed = function () {
|
||||
if (!this.relaunchVRChatAfterCrash) {
|
||||
return;
|
||||
}
|
||||
var lastLocation = this.lastLocation.location;
|
||||
AppApi.VrcClosedGracefully().then((result) => {
|
||||
console.log(result, lastLocation);
|
||||
if (result || !this.isRealInstance(lastLocation)) {
|
||||
return;
|
||||
}
|
||||
var entry = {
|
||||
created_at: new Date().toJSON(),
|
||||
type: 'Event',
|
||||
data: 'VRChat crashed, attempting to rejoin last instance'
|
||||
};
|
||||
database.addGamelogEventToDatabase(entry);
|
||||
this.queueGameLogNoty(entry);
|
||||
this.addGameLog(entry);
|
||||
this.launchGame(lastLocation);
|
||||
});
|
||||
};
|
||||
|
||||
$app.data.VRChatUsedCacheSize = '';
|
||||
$app.data.VRChatTotalCacheSize = '';
|
||||
$app.data.VRChatCacheSizeLoading = false;
|
||||
|
||||
@@ -1406,15 +1406,14 @@ html
|
||||
el-button(size="small" icon="el-icon-s-operation" @click="showLaunchOptions()") {{ $t('view.settings.advanced.advanced.launch_options') }}
|
||||
el-button(size="small" icon="el-icon-picture" @click="showScreenshotMetadataDialog()") {{ $t('view.settings.advanced.advanced.screenshot_metadata') }}
|
||||
div.options-container
|
||||
span.sub-header {{ $t('view.settings.advanced.advanced.pending_offline.header') }}
|
||||
div.options-container-item
|
||||
span.name {{ $t('view.settings.advanced.advanced.pending_offline.description') }}
|
||||
el-button-group(style="display:block")
|
||||
el-button(size="small" icon="el-icon-s-operation" @click="promptSetPendingOffline") {{ $t('view.settings.advanced.advanced.pending_offline.set_delay') }}
|
||||
span.sub-header {{ $t('view.settings.advanced.advanced.primary_password.header') }}
|
||||
div.options-container-item
|
||||
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.primary_password.description') }}
|
||||
el-switch(v-model="enablePrimaryPassword" @change="enablePrimaryPasswordChange" :disabled="!loginForm.savedCredentials[API.currentUser.username]")
|
||||
span.sub-header {{ $t('view.settings.advanced.advanced.relaunch_vrchat.header') }}
|
||||
div.options-container-item
|
||||
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.relaunch_vrchat.description') }}
|
||||
el-switch(v-model="relaunchVRChatAfterCrash" @change="saveOpenVROption")
|
||||
span.sub-header {{ $t('view.settings.advanced.advanced.vrchat_quit_fix.header') }}
|
||||
div.options-container-item
|
||||
span.name(style="min-width:300px") {{ $t('view.settings.advanced.advanced.vrchat_quit_fix.description') }}
|
||||
@@ -1497,6 +1496,11 @@ html
|
||||
el-button(size="small" icon="el-icon-time" @click="promptPhotonLobbyTimeoutThreshold" :disabled="!openVR") {{ $t('view.settings.advanced.photon.timeout_hud.timeout_threshold') }}
|
||||
div.options-container
|
||||
span.header {{ $t('view.settings.advanced.advanced.cache_debug.header') }}
|
||||
span.sub-header {{ $t('view.settings.advanced.advanced.pending_offline.header') }}
|
||||
div.options-container-item
|
||||
span.name {{ $t('view.settings.advanced.advanced.pending_offline.description') }}
|
||||
el-button-group(style="display:block")
|
||||
el-button(size="small" icon="el-icon-s-operation" @click="promptSetPendingOffline") {{ $t('view.settings.advanced.advanced.pending_offline.set_delay') }}
|
||||
div.options-container-item
|
||||
span.name {{ $t('view.settings.advanced.advanced.cache_debug.disable_gamelog') }}
|
||||
el-switch(v-model="gameLogDisabled" @change="disableGameLogDialog")
|
||||
|
||||
@@ -359,6 +359,10 @@
|
||||
"header": "Primary Password",
|
||||
"description": "Encrypt password (disables auto login)"
|
||||
},
|
||||
"relaunch_vrchat": {
|
||||
"header": "Relaunch VRChat after crashing",
|
||||
"description": "Rejoin last instance when VRChat crashes"
|
||||
},
|
||||
"vrchat_quit_fix": {
|
||||
"header": "VRChat Quit Fix",
|
||||
"description": "Kill VRChat after exiting game"
|
||||
|
||||
@@ -71,6 +71,10 @@ class GameLogService {
|
||||
case 'desktop-mode':
|
||||
break;
|
||||
|
||||
case 'udon-exception':
|
||||
gameLog.data = args[0];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user