mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
@@ -7646,6 +7646,10 @@ speechSynthesis.getVoices();
|
|||||||
'VRCX_feedTableVIPFilter',
|
'VRCX_feedTableVIPFilter',
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
$app.data.gameLogTable.vip = await configRepository.getBool(
|
||||||
|
'VRCX_gameLogTableVIPFilter',
|
||||||
|
false
|
||||||
|
);
|
||||||
$app.data.gameLogTable.filter = JSON.parse(
|
$app.data.gameLogTable.filter = JSON.parse(
|
||||||
await configRepository.getString('VRCX_gameLogTableFilters', '[]')
|
await configRepository.getString('VRCX_gameLogTableFilters', '[]')
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -450,6 +450,18 @@ export default class extends baseClass {
|
|||||||
// event time can be before last gameLog entry
|
// event time can be before last gameLog entry
|
||||||
this.updateSharedFeed(true);
|
this.updateSharedFeed(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the VIP friend filter is enabled, logs from other friends will be ignored.
|
||||||
|
if (
|
||||||
|
this.gameLogTable.vip &&
|
||||||
|
!this.localFavoriteFriends.has(entry.userId) &&
|
||||||
|
(entry.type === 'OnPlayerJoined' ||
|
||||||
|
entry.type === 'OnPlayerLeft' ||
|
||||||
|
entry.type === 'PortalSpawn' ||
|
||||||
|
entry.type === 'External')
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
entry.type === 'LocationDestination' ||
|
entry.type === 'LocationDestination' ||
|
||||||
entry.type === 'AvatarChange' ||
|
entry.type === 'AvatarChange' ||
|
||||||
@@ -866,10 +878,19 @@ export default class extends baseClass {
|
|||||||
'VRCX_gameLogTableFilters',
|
'VRCX_gameLogTableFilters',
|
||||||
JSON.stringify(this.gameLogTable.filter)
|
JSON.stringify(this.gameLogTable.filter)
|
||||||
);
|
);
|
||||||
|
await configRepository.setBool(
|
||||||
|
'VRCX_gameLogTableVIPFilter',
|
||||||
|
this.gameLogTable.vip
|
||||||
|
);
|
||||||
this.gameLogTable.loading = true;
|
this.gameLogTable.loading = true;
|
||||||
|
let vipList = [];
|
||||||
|
if (this.gameLogTable.vip) {
|
||||||
|
vipList = Array.from(this.localFavoriteFriends.values());
|
||||||
|
}
|
||||||
this.gameLogTable.data = await database.lookupGameLogDatabase(
|
this.gameLogTable.data = await database.lookupGameLogDatabase(
|
||||||
this.gameLogTable.search,
|
this.gameLogTable.search,
|
||||||
this.gameLogTable.filter
|
this.gameLogTable.filter,
|
||||||
|
vipList
|
||||||
);
|
);
|
||||||
this.gameLogTable.loading = false;
|
this.gameLogTable.loading = false;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ mixin gameLogTab()
|
|||||||
data-tables(v-bind="gameLogTable" v-loading="gameLogTable.loading")
|
data-tables(v-bind="gameLogTable" v-loading="gameLogTable.loading")
|
||||||
template(#tool)
|
template(#tool)
|
||||||
div(style="margin:0 0 10px;display:flex;align-items:center")
|
div(style="margin:0 0 10px;display:flex;align-items:center")
|
||||||
|
div(style="flex:none;margin-right:10px")
|
||||||
|
el-tooltip(placement="bottom" :content="$t('view.feed.favorites_only_tooltip')" :disabled="hideTooltips")
|
||||||
|
el-switch(v-model="gameLogTable.vip" @change="gameLogTableLookup" active-color="#13ce66")
|
||||||
el-select(v-model="gameLogTable.filter" @change="gameLogTableLookup" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.game_log.filter_placeholder')")
|
el-select(v-model="gameLogTable.filter" @change="gameLogTableLookup" multiple clearable collapse-tags style="flex:1" :placeholder="$t('view.game_log.filter_placeholder')")
|
||||||
el-option(v-once v-for="type in ['Location', 'OnPlayerJoined', 'OnPlayerLeft', 'PortalSpawn', 'VideoPlay', 'Event', 'External', 'StringLoad', 'ImageLoad']" :key="type" :label="type" :value="type")
|
el-option(v-once v-for="type in ['Location', 'OnPlayerJoined', 'OnPlayerLeft', 'PortalSpawn', 'VideoPlay', 'Event', 'External', 'StringLoad', 'ImageLoad']" :key="type" :label="type" :value="type")
|
||||||
el-input(v-model="gameLogTable.search" :placeholder="$t('view.game_log.search_placeholder')" @keyup.native.13="gameLogTableLookup" @change="gameLogTableLookup" clearable style="flex:none;width:150px;margin:0 10px")
|
el-input(v-model="gameLogTable.search" :placeholder="$t('view.game_log.search_placeholder')" @keyup.native.13="gameLogTableLookup" @change="gameLogTableLookup" clearable style="flex:none;width:150px;margin:0 10px")
|
||||||
|
|||||||
@@ -1631,11 +1631,30 @@ class Database {
|
|||||||
return gamelogDatabase;
|
return gamelogDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
async lookupGameLogDatabase(search, filters) {
|
/**
|
||||||
|
* Lookup the game log database for a specific search term
|
||||||
|
* @param {string} search The search term
|
||||||
|
* @param {Array} filters The filters to apply
|
||||||
|
* @param {Array} [vipList] The list of VIP users
|
||||||
|
* @returns {Promise<any[]>} The game log data
|
||||||
|
*/
|
||||||
|
|
||||||
|
async lookupGameLogDatabase(search, filters, vipList = []) {
|
||||||
var search = search.replaceAll("'", "''");
|
var search = search.replaceAll("'", "''");
|
||||||
if (search.startsWith('wrld_')) {
|
if (search.startsWith('wrld_')) {
|
||||||
return Database.getGameLogByLocation(search, filters);
|
return Database.getGameLogByLocation(search, filters);
|
||||||
}
|
}
|
||||||
|
let vipQuery = '';
|
||||||
|
if (vipList.length > 0) {
|
||||||
|
vipQuery = 'AND user_id IN (';
|
||||||
|
vipList.forEach((vip, i) => {
|
||||||
|
vipQuery += `'${vip.replaceAll("'", "''")}'`;
|
||||||
|
if (i < vipList.length - 1) {
|
||||||
|
vipQuery += ', ';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
vipQuery += ')';
|
||||||
|
}
|
||||||
var location = true;
|
var location = true;
|
||||||
var onplayerjoined = true;
|
var onplayerjoined = true;
|
||||||
var onplayerleft = true;
|
var onplayerleft = true;
|
||||||
@@ -1723,7 +1742,7 @@ class Database {
|
|||||||
time: dbRow[6]
|
time: dbRow[6]
|
||||||
};
|
};
|
||||||
gamelogDatabase.unshift(row);
|
gamelogDatabase.unshift(row);
|
||||||
}, `SELECT * FROM gamelog_join_leave WHERE (display_name LIKE '%${search}%' AND user_id != '${Database.userId}') ${query} ORDER BY id DESC LIMIT ${Database.maxTableSize}`);
|
}, `SELECT * FROM gamelog_join_leave WHERE (display_name LIKE '%${search}%' AND user_id != '${Database.userId}') ${vipQuery} ${query} ORDER BY id DESC LIMIT ${Database.maxTableSize}`);
|
||||||
}
|
}
|
||||||
if (portalspawn) {
|
if (portalspawn) {
|
||||||
await sqliteService.execute((dbRow) => {
|
await sqliteService.execute((dbRow) => {
|
||||||
@@ -1738,7 +1757,7 @@ class Database {
|
|||||||
worldName: dbRow[6]
|
worldName: dbRow[6]
|
||||||
};
|
};
|
||||||
gamelogDatabase.unshift(row);
|
gamelogDatabase.unshift(row);
|
||||||
}, `SELECT * FROM gamelog_portal_spawn WHERE (display_name LIKE '%${search}%' OR world_name LIKE '%${search}%') ORDER BY id DESC LIMIT ${Database.maxTableSize}`);
|
}, `SELECT * FROM gamelog_portal_spawn WHERE (display_name LIKE '%${search}%' OR world_name LIKE '%${search}%') ${vipQuery} ORDER BY id DESC LIMIT ${Database.maxTableSize}`);
|
||||||
}
|
}
|
||||||
if (msgevent) {
|
if (msgevent) {
|
||||||
await sqliteService.execute((dbRow) => {
|
await sqliteService.execute((dbRow) => {
|
||||||
@@ -1763,7 +1782,7 @@ class Database {
|
|||||||
location: dbRow[5]
|
location: dbRow[5]
|
||||||
};
|
};
|
||||||
gamelogDatabase.unshift(row);
|
gamelogDatabase.unshift(row);
|
||||||
}, `SELECT * FROM gamelog_external WHERE (display_name LIKE '%${search}%' OR message LIKE '%${search}%') ORDER BY id DESC LIMIT ${Database.maxTableSize}`);
|
}, `SELECT * FROM gamelog_external WHERE (display_name LIKE '%${search}%' OR message LIKE '%${search}%') ${vipQuery} ORDER BY id DESC LIMIT ${Database.maxTableSize}`);
|
||||||
}
|
}
|
||||||
if (videoplay) {
|
if (videoplay) {
|
||||||
await sqliteService.execute((dbRow) => {
|
await sqliteService.execute((dbRow) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user