Skip to content

Commit

Permalink
Fix desktop/VR detection on VRC open beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Natsumi-sama committed Jul 25, 2024
1 parent 21181f0 commit 37bd128
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 44 deletions.
24 changes: 4 additions & 20 deletions Dotnet/LogWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ private void ParseLog(FileInfo fileInfo, LogContext logContext)
if (line.Length <= 36 ||
line[31] != '-')
{
ParseDesktopModeOld(fileInfo, line);
continue;
}

Expand Down Expand Up @@ -1028,9 +1027,11 @@ private bool ParseOpenVRInit(FileInfo fileInfo, LogContext logContext, string li

// 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[]
Expand Down Expand Up @@ -1060,23 +1061,6 @@ private bool ParseDesktopMode(FileInfo fileInfo, LogContext logContext, string l
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'
Expand Down
8 changes: 6 additions & 2 deletions html/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -28544,7 +28546,9 @@ speechSynthesis.getVoices();

avatarIdRemoveList.forEach((id) => {
removeFromArray(this.localAvatarFavoritesList, id);
database.removeAvatarFromCache(id);
if (!this.avatarHistory.has(id)) {
database.removeAvatarFromCache(id);
}
});
};

Expand Down
6 changes: 4 additions & 2 deletions html/src/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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 }")
Expand Down Expand Up @@ -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
Expand Down
20 changes: 0 additions & 20 deletions html/src/repository/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 37bd128

Please sign in to comment.