mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Time spent in world, world PC/Quest badge, fix Nuisance badge
This commit is contained in:
+22
-4
@@ -12033,9 +12033,9 @@ speechSynthesis.getVoices();
|
|||||||
avatarName: '',
|
avatarName: '',
|
||||||
fileCreatedAt: ''
|
fileCreatedAt: ''
|
||||||
},
|
},
|
||||||
lastSeen: '',
|
|
||||||
joinCount: 0,
|
joinCount: 0,
|
||||||
timeSpent: ''
|
timeSpent: 0,
|
||||||
|
lastSeen: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
$app.watch['userDialog.memo'] = function () {
|
$app.watch['userDialog.memo'] = function () {
|
||||||
@@ -12248,7 +12248,7 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
D.lastSeen = '';
|
D.lastSeen = '';
|
||||||
D.joinCount = 0;
|
D.joinCount = 0;
|
||||||
D.timeSpent = '';
|
D.timeSpent = 0;
|
||||||
API.getCachedUser({
|
API.getCachedUser({
|
||||||
userId
|
userId
|
||||||
})
|
})
|
||||||
@@ -13054,7 +13054,10 @@ speechSynthesis.getVoices();
|
|||||||
cacheSize: 0,
|
cacheSize: 0,
|
||||||
cacheLocked: false,
|
cacheLocked: false,
|
||||||
lastVisit: '',
|
lastVisit: '',
|
||||||
visitCount: 0
|
visitCount: 0,
|
||||||
|
timeSpent: 0,
|
||||||
|
isPC: false,
|
||||||
|
isQuest: false
|
||||||
};
|
};
|
||||||
|
|
||||||
API.$on('LOGOUT', function () {
|
API.$on('LOGOUT', function () {
|
||||||
@@ -13153,6 +13156,9 @@ speechSynthesis.getVoices();
|
|||||||
D.rooms = [];
|
D.rooms = [];
|
||||||
D.lastVisit = '';
|
D.lastVisit = '';
|
||||||
D.visitCount = '';
|
D.visitCount = '';
|
||||||
|
D.timeSpent = 0;
|
||||||
|
D.isPC = false;
|
||||||
|
D.isQuest = false;
|
||||||
database.getLastVisit(D.id).then((ref) => {
|
database.getLastVisit(D.id).then((ref) => {
|
||||||
if (ref.worldId === D.id) {
|
if (ref.worldId === D.id) {
|
||||||
D.lastVisit = ref.created_at;
|
D.lastVisit = ref.created_at;
|
||||||
@@ -13163,6 +13169,11 @@ speechSynthesis.getVoices();
|
|||||||
D.visitCount = ref.visitCount;
|
D.visitCount = ref.visitCount;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
database.getTimeSpentInWorld(D.id).then((ref) => {
|
||||||
|
if (ref.worldId === D.id) {
|
||||||
|
D.timeSpent = ref.timeSpent;
|
||||||
|
}
|
||||||
|
});
|
||||||
API.getCachedWorld({
|
API.getCachedWorld({
|
||||||
worldId: L.worldId
|
worldId: L.worldId
|
||||||
})
|
})
|
||||||
@@ -13176,6 +13187,13 @@ speechSynthesis.getVoices();
|
|||||||
D.loading = false;
|
D.loading = false;
|
||||||
D.ref = args.ref;
|
D.ref = args.ref;
|
||||||
D.isFavorite = API.cachedFavoritesByObjectId.has(D.id);
|
D.isFavorite = API.cachedFavoritesByObjectId.has(D.id);
|
||||||
|
for (var unityPackage of args.ref.unityPackages) {
|
||||||
|
if (unityPackage.platform === 'standalonewindows') {
|
||||||
|
D.isPC = true;
|
||||||
|
} else if (unityPackage.platform === 'android') {
|
||||||
|
D.isQuest = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.updateVRChatWorldCache();
|
this.updateVRChatWorldCache();
|
||||||
if (args.cache) {
|
if (args.cache) {
|
||||||
API.getWorld(args.params)
|
API.getWorld(args.params)
|
||||||
|
|||||||
+9
-1
@@ -1319,6 +1319,7 @@ html
|
|||||||
div
|
div
|
||||||
el-tag.name(type="info" effect="plain" size="mini" :class="userDialog.ref.$trustClass" v-text="userDialog.ref.$trustLevel" style="margin-right:5px;margin-top:5px")
|
el-tag.name(type="info" effect="plain" size="mini" :class="userDialog.ref.$trustClass" v-text="userDialog.ref.$trustLevel" style="margin-right:5px;margin-top:5px")
|
||||||
el-tag.x-tag-friend(v-if="userDialog.isFriend && userDialog.friend" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Friend No.{{userDialog.friend.no}}
|
el-tag.x-tag-friend(v-if="userDialog.isFriend && userDialog.friend" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Friend No.{{userDialog.friend.no}}
|
||||||
|
el-tag.x-tag-troll(v-if="userDialog.ref.$isTroll" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Nuisance
|
||||||
el-tag.x-tag-legendary(v-if="userDialog.ref.$isLegend" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Legend
|
el-tag.x-tag-legendary(v-if="userDialog.ref.$isLegend" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Legend
|
||||||
el-tag.x-tag-vip(v-if="userDialog.ref.$isModerator" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") VRChat Team
|
el-tag.x-tag-vip(v-if="userDialog.ref.$isModerator" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") VRChat Team
|
||||||
el-tag.x-tag-vrcplus(v-if="userDialog.ref.$isVRCPlus" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") VRC+
|
el-tag.x-tag-vrcplus(v-if="userDialog.ref.$isVRCPlus" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") VRC+
|
||||||
@@ -1534,6 +1535,8 @@ html
|
|||||||
el-tag(v-if="worldDialog.ref.$isLabs" type="primary" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Labs
|
el-tag(v-if="worldDialog.ref.$isLabs" type="primary" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Labs
|
||||||
el-tag(v-else-if="worldDialog.ref.releaseStatus === 'public'" type="success" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Public
|
el-tag(v-else-if="worldDialog.ref.releaseStatus === 'public'" type="success" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Public
|
||||||
el-tag(v-else type="danger" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Private
|
el-tag(v-else type="danger" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Private
|
||||||
|
el-tag.x-tag-platform-pc(v-if="worldDialog.isPC" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") PC
|
||||||
|
el-tag.x-tag-platform-quest(v-if="worldDialog.isQuest" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") Quest
|
||||||
el-tag(type="info" effect="plain" size="mini" v-text="worldDialog.fileSize" style="margin-right:5px;margin-top:5px")
|
el-tag(type="info" effect="plain" size="mini" v-text="worldDialog.fileSize" style="margin-right:5px;margin-top:5px")
|
||||||
el-tag(v-if="worldDialog.inCache" type="info" effect="plain" size="mini" style="margin-top:5px")
|
el-tag(v-if="worldDialog.inCache" type="info" effect="plain" size="mini" style="margin-top:5px")
|
||||||
span(v-text="worldDialog.cacheSize")
|
span(v-text="worldDialog.cacheSize")
|
||||||
@@ -1670,6 +1673,11 @@ html
|
|||||||
.detail
|
.detail
|
||||||
span.name Visit Count
|
span.name Visit Count
|
||||||
span.extra(v-text="worldDialog.visitCount")
|
span.extra(v-text="worldDialog.visitCount")
|
||||||
|
.x-friend-item(style="cursor:default")
|
||||||
|
.detail
|
||||||
|
span.name Time Spent
|
||||||
|
span.extra(v-if="worldDialog.timeSpent === 0") -
|
||||||
|
span.extra(v-else) {{ worldDialog.timeSpent | timeToText }}
|
||||||
el-tab-pane(label="JSON")
|
el-tab-pane(label="JSON")
|
||||||
el-button(type="default" @click="refreshWorldDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
|
el-button(type="default" @click="refreshWorldDialogTreeData()" size="mini" icon="el-icon-refresh" circle)
|
||||||
el-tree(:data="worldDialog.treeData" style="margin-top:5px;font-size:12px")
|
el-tree(:data="worldDialog.treeData" style="margin-top:5px;font-size:12px")
|
||||||
@@ -2072,7 +2080,7 @@ html
|
|||||||
el-dialog.x-dialog(ref="launchDialog" :visible.sync="launchDialog.visible" title="Launch" width="400px")
|
el-dialog.x-dialog(ref="launchDialog" :visible.sync="launchDialog.visible" title="Launch" width="400px")
|
||||||
div #[span(v-text="launchDialog.shortUrl" style="word-break:break-all;font-size:12px")]
|
div #[span(v-text="launchDialog.shortUrl" style="word-break:break-all;font-size:12px")]
|
||||||
el-tooltip(placement="top" content="Copy to clipboard" :disabled="hideTooltips")
|
el-tooltip(placement="top" content="Copy to clipboard" :disabled="hideTooltips")
|
||||||
el-button(@click="copyInstanceUrl(launchDialog.shortUrl)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle)
|
el-button(v-if="launchDialog.shortUrl" @click="copyInstanceUrl(launchDialog.shortUrl)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle)
|
||||||
div(style="margin-top:10px") #[span(v-text="launchDialog.url" style="word-break:break-all;font-size:12px")]
|
div(style="margin-top:10px") #[span(v-text="launchDialog.url" style="word-break:break-all;font-size:12px")]
|
||||||
el-tooltip(placement="top" content="Copy to clipboard" :disabled="hideTooltips")
|
el-tooltip(placement="top" content="Copy to clipboard" :disabled="hideTooltips")
|
||||||
el-button(@click="copyInstanceUrl(launchDialog.url)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle)
|
el-button(@click="copyInstanceUrl(launchDialog.url)" size="mini" icon="el-icon-s-order" style="margin-left:5px" circle)
|
||||||
|
|||||||
@@ -751,6 +751,20 @@ class Database {
|
|||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getTimeSpentInWorld(input) {
|
||||||
|
var worldId = input.replaceAll("'", '');
|
||||||
|
var ref = {
|
||||||
|
timeSpent: 0,
|
||||||
|
worldId: input
|
||||||
|
};
|
||||||
|
await sqliteService.execute((row) => {
|
||||||
|
if (typeof row[0] === 'number') {
|
||||||
|
ref.timeSpent += row[0];
|
||||||
|
}
|
||||||
|
}, `SELECT time FROM gamelog_location WHERE world_id = '${worldId}'`);
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
async getLastSeen(input) {
|
async getLastSeen(input) {
|
||||||
var userId = input.id.replaceAll("'", '');
|
var userId = input.id.replaceAll("'", '');
|
||||||
var displayName = input.displayName.replaceAll("'", "''");
|
var displayName = input.displayName.replaceAll("'", "''");
|
||||||
|
|||||||
Reference in New Issue
Block a user