small changes for resource loading logging

This commit is contained in:
Natsumi
2023-03-25 03:57:33 +13:00
parent 3f0a479e1a
commit 4d97dcb798
5 changed files with 45 additions and 19 deletions

View File

@@ -4656,6 +4656,9 @@ speechSynthesis.getVoices();
var buildTreeData = (json) => {
var node = [];
for (var key in json) {
if (key[0] === '$') {
continue;
}
var value = json[key];
if (Array.isArray(value) && value.length === 0) {
node.push({
@@ -8977,6 +8980,7 @@ speechSynthesis.getVoices();
this.updateVRLastLocation();
this.getCurrentInstanceUserList();
this.lastVideoUrl = '';
this.lastResourceloadUrl = '';
this.applyUserDialogLocation();
this.applyWorldDialogInstances();
this.applyGroupDialogInstances();
@@ -9209,6 +9213,7 @@ speechSynthesis.getVoices();
$app.data.lastLocationDestination = '';
$app.data.lastLocationDestinationTime = 0;
$app.data.lastVideoUrl = '';
$app.data.lastResourceloadUrl = '';
$app.methods.addGameLogEntry = function (gameLog, location) {
if (this.gameLogDisabled) {
@@ -9378,15 +9383,22 @@ speechSynthesis.getVoices();
this.nowPlaying.offset = parseInt(timestamp, 10);
}
break;
case 'resource-load':
if (!this.logResourceLoad) {
case 'resource-load-string':
case 'resource-load-image':
if (
!this.logResourceLoad ||
this.lastResourceloadUrl === gameLog.resourceUrl
) {
break;
}
this.lastResourceloadUrl = gameLog.resourceUrl;
var entry = {
created_at: gameLog.dt,
type: gameLog.resourceType === 'string' ? 'StringLoad' : 'ImageLoad',
type:
gameLog.type === 'resource-load-string'
? 'StringLoad'
: 'ImageLoad',
resourceUrl: gameLog.resourceUrl,
resourceType: gameLog.resourceType,
location
};
database.addGamelogResourceLoadToDatabase(entry);
@@ -13372,8 +13384,10 @@ speechSynthesis.getVoices();
AppApi.ExecuteVrOverlayFunction('updateHudTimeout', '[]');
}
};
$app.data.logResourceLoad = configRepository.getBool('VRCX_logResourceLoad', false);
$app.methods.saveGameLogOptions = function() {
$app.data.logResourceLoad = configRepository.getBool(
'VRCX_logResourceLoad'
);
$app.methods.saveGameLogOptions = function () {
configRepository.setBool('VRCX_logResourceLoad', this.logResourceLoad);
};
@@ -20754,6 +20768,7 @@ speechSynthesis.getVoices();
if (result || !this.isRealInstance(lastLocation)) {
return;
}
AppApi.FocusWindow();
var entry = {
created_at: new Date().toJSON(),
type: 'Event',