Fix desktop/VR detection on VRC open beta

This commit is contained in:
Natsumi
2024-07-26 10:18:42 +12:00
parent 21181f0b55
commit 37bd128908
4 changed files with 14 additions and 44 deletions

View File

@@ -202,7 +202,6 @@ namespace VRCX
if (line.Length <= 36 ||
line[31] != '-')
{
ParseDesktopModeOld(fileInfo, line);
continue;
}
@@ -1028,9 +1027,11 @@ namespace VRCX
// 2023.04.22 16:52:28 Log - Initializing VRSDK.
// 2023.04.22 16:52:29 Log - StartVRSDK: Open VR Loader
// 2024.07.26 01:48:56 Log - STEAMVR HMD Model: Index
if (string.Compare(line, offset, "OpenVR initialized!", 0, 19, StringComparison.Ordinal) != 0 &&
string.Compare(line, offset, "Initializing VRSDK.", 0, 19, StringComparison.Ordinal) != 0)
if (string.Compare(line, offset, "Initializing VRSDK.", 0, 19, StringComparison.Ordinal) != 0 &&
string.Compare(line, offset, "STEAMVR HMD Model: ", 0, 20, StringComparison.Ordinal) != 0)
return false;
AppendLog(new[]
@@ -1060,23 +1061,6 @@ namespace VRCX
return true;
}
private bool ParseDesktopModeOld(FileInfo fileInfo, string line)
{
// XR Device: None
if (string.Compare(line, 0, " XR Device: None", 0, 19, StringComparison.Ordinal) != 0)
return false;
AppendLog(new[]
{
fileInfo.Name,
ConvertLogTimeToISO8601(line),
"desktop-mode"
});
return true;
}
private bool ParseLogStringDownload(FileInfo fileInfo, LogContext logContext, string line, int offset)
{
// 2023.03.23 11:37:21 Log - [String Download] Attempting to load String from URL 'https://pastebin.com/raw/BaW6NL2L'

View File

@@ -28309,7 +28309,9 @@ speechSynthesis.getVoices();
}
if (!avatarInFavorites) {
removeFromArray(this.localAvatarFavoritesList, avatarId);
database.removeAvatarFromCache(avatarId);
if (!this.avatarHistory.has(avatarId)) {
database.removeAvatarFromCache(avatarId);
}
}
database.removeAvatarFromFavorites(avatarId, group);
if (
@@ -28544,7 +28546,9 @@ speechSynthesis.getVoices();
avatarIdRemoveList.forEach((id) => {
removeFromArray(this.localAvatarFavoritesList, id);
database.removeAvatarFromCache(id);
if (!this.avatarHistory.has(id)) {
database.removeAvatarFromCache(id);
}
});
};

View File

@@ -112,7 +112,8 @@ html
el-tabs.zero-margin-tabs(stretch="true" style="height:calc(100% - 60px;margin-top:5px")
el-tab-pane
template(#label)
span {{ $t('side_panel.friends') }} ({{ onlineFriendCount }}/{{ friends.size }})
span {{ $t('side_panel.friends') }}
span(style="color:#909399;font-size:12px;margin-left:10px") ({{ onlineFriendCount }}/{{ friends.size }})
.x-friend-list(style="padding:10px 5px")
.x-friend-group.x-link(@click="isFriendsGroupMe = !isFriendsGroupMe; saveFriendsGroupStates()" style="padding:0px 0px 5px")
i.el-icon-arrow-right(:class="{ rotate: isFriendsGroupMe }")
@@ -190,7 +191,8 @@ html
el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px")
el-tab-pane
template(#label)
span {{ $t('side_panel.groups') }} ({{ groupInstances.length }})
span {{ $t('side_panel.groups') }}
span(style="color:#909399;font-size:12px;margin-left:10px") ({{ groupInstances.length }})
.x-friend-list(style="padding:10px 5px")
.x-friend-item(v-for="ref in groupInstances" :key="ref.instance.id" @click="showGroupDialog(ref.instance.ownerId)")
.avatar

View File

@@ -2281,26 +2281,6 @@ class Database {
);
}
addAvatarToCache(entry) {
sqliteService.executeNonQuery(
`INSERT OR REPLACE INTO cache_avatar (id, added_at, author_id, author_name, created_at, description, image_url, name, release_status, thumbnail_image_url, updated_at, version) VALUES (@id, @added_at, @author_id, @author_name, @created_at, @description, @image_url, @name, @release_status, @thumbnail_image_url, @updated_at, @version)`,
{
'@id': entry.id,
'@added_at': new Date().toJSON(),
'@author_id': entry.authorId,
'@author_name': entry.authorName,
'@created_at': entry.created_at,
'@description': entry.description,
'@image_url': entry.imageUrl,
'@name': entry.name,
'@release_status': entry.releaseStatus,
'@thumbnail_image_url': entry.thumbnailImageUrl,
'@updated_at': entry.updated_at,
'@version': entry.version
}
);
}
async getAvatarCache() {
var data = [];
await sqliteService.execute((dbRow) => {