From 6ba1856a7abd323978945816259e96695bf888ec Mon Sep 17 00:00:00 2001 From: Natsumi Date: Fri, 27 Oct 2023 23:34:48 +1300 Subject: [PATCH] Small changes Add "friends in instance" to invite dialog Change XS notification height depending on text length Attempt to fetch userId's for users in current instance Add user dialog friend history tooltip --- Dotnet/AppApi/XSOverlay.cs | 13 ++- Dotnet/LogWatcher.cs | 176 +++++++++++++++++-------------- html/src/app.js | 82 ++++++++++++-- html/src/index.pug | 21 +++- html/src/localization/en/en.json | 3 +- 5 files changed, 205 insertions(+), 90 deletions(-) diff --git a/Dotnet/AppApi/XSOverlay.cs b/Dotnet/AppApi/XSOverlay.cs index 407a474c..f5cbc3d7 100644 --- a/Dotnet/AppApi/XSOverlay.cs +++ b/Dotnet/AppApi/XSOverlay.cs @@ -24,12 +24,23 @@ namespace VRCX icon = "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAHaGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc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bq6Or1LZVw7nJ6eWg8APMHBRQ0ehkilUggODuaSHp4QGdriHh0dcTMDlsV6ISEhXF0cGb29vRYHMGTqqTCWmZiYgKWlJVheXgaZTMatAw4PD43WVSqVMD09zdVD48kRtiWXy98mzYe0Id+gADb4ADCMjSuPlYJ9MKLYVFAAm3wAaMbGFxcXBQugu7ubAviDDwCfY+N4Ro/DVGjCmUIrcX7P1+PxfdpJ68tWGBoagr7+PrMZH3DiwglnBGPCtQOWxeSIM45W8IvEUr4AfEG8xPcj7sbGRqMAVpZX9NWdIv6Ur/cDqD4k/o64j/h34jEzeUTTHhdMX2+fQQCyVzIa9KXmwe0z4hB6kXwCQL2DLyEQ+xK/byZ7EfsRN1AICwsLDwLAKVZTDkfkZ8RO2hfINwA+9YQ+iUYf/nloDADe80/vN2LNAFCRxGsYx4vnL/QmRS0Ar4g/sjUAqC/pKGhvb7dLAKhyCmFyctIuAbxL3EEhaL+eowVARvyxrQJASYlnKAS6IbInAKg44lMKAYU7Ra1p8BNbB4D6hvgGY8MlMG6PNQBWiCPsAYAL8Y96lr+4ivzAHgDQpPiS+EwikfxFPl8Tf00s4RWA+Lq8CEAEIAIQAYgARAA26b8BaVJkoY+4rDoAAAAASUVORK5CYII="; } + var height = 110f; + if (content.Length > 100) { + height += 90f; + } + if (content.Length > 200) { + height += 75f; + } + if (content.Length > 300) { + height += 155f; + } + var msg = new XSOMessage { messageType = 1, title = title, content = content, - height = 110f, + height = height, sourceApp = "VRCX", timeout = timeout, audioPath = string.Empty, diff --git a/Dotnet/LogWatcher.cs b/Dotnet/LogWatcher.cs index d81300ac..60772fe4 100644 --- a/Dotnet/LogWatcher.cs +++ b/Dotnet/LogWatcher.cs @@ -355,7 +355,8 @@ namespace VRCX logContext.RecentWorldName }); - logContext.onJoinPhotonDisplayName = string.Empty; + // logContext.onJoinPhotonDisplayName = string.Empty; + // logContext.onJoinPhotonDisplayNameDate = string.Empty; logContext.LastAudioDevice = string.Empty; logContext.LastVideoError = string.Empty; logContext.locationDestination = string.Empty; @@ -457,8 +458,6 @@ namespace VRCX userDisplayName }); - logContext.onJoinPhotonDisplayName = userDisplayName; - return true; } @@ -798,79 +797,103 @@ namespace VRCX return true; } - - private bool ParseLogPhotonId(FileInfo fileInfo, LogContext logContext, string line, int offset) - { - // 2021.11.02 02:21:41 Log - [Behaviour] Configuring remote player VRCPlayer[Remote] 22349737 1194 - // 2021.11.02 02:21:41 Log - [Behaviour] Initialized player Natsumi-sama - - // 2021.11.10 08:10:28 Log - [Behaviour] Initialize Limb Avatar (UnityEngine.Animator) VRCPlayer[Remote] 78614426 59 (DŽDŽDŽDžDŽDžDžDŽDžDŽDŽDžDžDŽDžDŽDžDžDžDŽDŽDŽDžDŽDŽDžDžDŽDžDžDŽDžDžDŽDžDžDžDžDŽDžDŽDžDŽDŽDŽDŽDž) False Loading - // 2021.11.10 08:57:32 Log - [Behaviour] Initialize Limb Avatar (UnityEngine.Animator) VRCPlayer[Local] 59136629 1 (DŽDŽDŽDžDŽDžDžDŽDžDŽDŽDžDžDŽDžDŽDžDžDžDŽDŽDŽDžDŽDŽDžDžDŽDžDžDŽDžDžDŽDžDžDžDžDŽDžDŽDžDŽDŽDŽDŽDž) True Loading - - // 2022.03.05 11:29:16 Log - [Behaviour] Initialize ThreePoint Avatar (UnityEngine.Animator) VRCPlayer[Local] 50608765 1 (DŽDžDŽDŽDŽDžDŽDžDžDŽDžDŽDŽDžDžDŽDŽDŽDžDŽDŽDŽDžDŽDžDŽDžDžDŽDŽDŽDŽDžDžDŽDŽDŽDŽDžDžDŽDŽDžDŽDŽDžDž) True Custom - - if (line.Contains("] Initialize ") && line.Contains(" Avatar (UnityEngine.Animator) VRCPlayer[")) - { - var pos = -1; - - if (line.Contains(" Avatar (UnityEngine.Animator) VRCPlayer[Remote] ")) - { - pos = line.LastIndexOf(" Avatar (UnityEngine.Animator) VRCPlayer[Remote] "); - pos += 49; - } - - if (line.Contains(" Avatar (UnityEngine.Animator) VRCPlayer[Local] ")) - { - pos = line.LastIndexOf(" Avatar (UnityEngine.Animator) VRCPlayer[Local] "); - pos += 48; - } - - if (pos < 0) - return false; - - if (!string.IsNullOrEmpty(logContext.onJoinPhotonDisplayName)) - { - var endPos = line.LastIndexOf(" ("); - var photonId = line.Substring(pos + 9, endPos - (pos + 9)); - - AppendLog(new[] - { - fileInfo.Name, - ConvertLogTimeToISO8601(line), - "photon-id", - logContext.onJoinPhotonDisplayName, - photonId - }); - logContext.onJoinPhotonDisplayName = string.Empty; - - return true; - } - } - - if (line.Contains(": 3 Point IK") || line.Contains(": Limb IK")) - { - var lineOffset = line.IndexOf("] "); - if (lineOffset < 0) - return true; - lineOffset += 2; - - if (line.Contains(": 3 Point IK")) - { - var endPos = line.LastIndexOf(": 3 Point IK"); - logContext.onJoinPhotonDisplayName = line.Substring(lineOffset, endPos - lineOffset); - return true; - } - - if (line.Contains(": Limb IK")) - { - var endPos = line.LastIndexOf(": Limb IK"); - logContext.onJoinPhotonDisplayName = line.Substring(lineOffset, endPos - lineOffset); - return true; - } - } - - return false; - } + // + // private bool ParseLogPhotonId(FileInfo fileInfo, LogContext logContext, string line, int offset) + // { + // // 2021.11.02 02:21:41 Log - [Behaviour] Configuring remote player VRCPlayer[Remote] 22349737 1194 + // // 2021.11.02 02:21:41 Log - [Behaviour] Initialized player Natsumi-sama + // + // // 2021.11.10 08:10:28 Log - [Behaviour] Initialize Limb Avatar (UnityEngine.Animator) VRCPlayer[Remote] 78614426 59 (DŽDŽDŽDžDŽDžDžDŽDžDŽDŽDžDžDŽDžDŽDžDžDžDŽDŽDŽDžDŽDŽDžDžDŽDžDžDŽDžDžDŽDžDžDžDžDŽDžDŽDžDŽDŽDŽDŽDž) False Loading + // // 2021.11.10 08:57:32 Log - [Behaviour] Initialize Limb Avatar (UnityEngine.Animator) VRCPlayer[Local] 59136629 1 (DŽDŽDŽDžDŽDžDžDŽDžDŽDŽDžDžDŽDžDŽDžDžDžDŽDŽDŽDžDŽDŽDžDžDŽDžDžDŽDžDžDŽDžDžDžDžDŽDžDŽDžDŽDŽDŽDŽDž) True Loading + // + // // 2022.03.05 11:29:16 Log - [Behaviour] Initialize ThreePoint Avatar (UnityEngine.Animator) VRCPlayer[Local] 50608765 1 (DŽDžDŽDŽDŽDžDŽDžDžDŽDžDŽDŽDžDžDŽDŽDŽDžDŽDŽDŽDžDŽDžDŽDžDžDŽDŽDŽDŽDžDžDŽDŽDŽDŽDžDžDŽDŽDžDŽDŽDžDž) True Custom + // + // if (line.Contains("] Initialize ") && line.Contains(" Avatar (UnityEngine.Animator) VRCPlayer[")) + // { + // var pos = -1; + // + // if (line.Contains(" Avatar (UnityEngine.Animator) VRCPlayer[Remote] ")) + // { + // pos = line.LastIndexOf(" Avatar (UnityEngine.Animator) VRCPlayer[Remote] "); + // pos += 49; + // } + // + // if (line.Contains(" Avatar (UnityEngine.Animator) VRCPlayer[Local] ")) + // { + // pos = line.LastIndexOf(" Avatar (UnityEngine.Animator) VRCPlayer[Local] "); + // pos += 48; + // } + // + // if (pos < 0) + // return false; + // + // if (!string.IsNullOrEmpty(logContext.onJoinPhotonDisplayName)) + // { + // var endPos = line.LastIndexOf(" ("); + // var photonId = line.Substring(pos + 9, endPos - (pos + 9)); + // + // AppendLog(new[] + // { + // fileInfo.Name, + // ConvertLogTimeToISO8601(line), + // "photon-id", + // logContext.onJoinPhotonDisplayName, + // photonId + // }); + // logContext.onJoinPhotonDisplayName = string.Empty; + // + // return true; + // } + // } + // + // if (line.Contains("[Behaviour] Initialized player ")) + // { + // var pos = line.LastIndexOf("[Behaviour] Initialized player "); + // if (pos < 0) + // return false; + // + // pos += 31; + // if (pos >= line.Length) + // return false; + // + // var displayName = line.Substring(pos, line.Length - pos); + // logContext.onJoinPhotonDisplayName = displayName; + // logContext.onJoinPhotonDisplayNameDate = ConvertLogTimeToISO8601(line); + // + // return true; + // } + // + // if (line.Contains("[Behaviour] Configuring remote player VRCPlayer[Remote] ")) + // { + // if (string.IsNullOrEmpty(logContext.onJoinPhotonDisplayName) || + // logContext.onJoinPhotonDisplayNameDate != ConvertLogTimeToISO8601(line)) + // return false; + // + // var pos = line.LastIndexOf("[Behaviour] Configuring remote player VRCPlayer[Remote] "); + // if (pos < 0) + // return false; + // + // pos += 56; + // var startPos = pos + 9; + // var length = line.Length - startPos; + // var photonId = line.Substring(startPos, length); + // + // AppendLog(new[] + // { + // fileInfo.Name, + // ConvertLogTimeToISO8601(line), + // "photon-id", + // logContext.onJoinPhotonDisplayName, + // photonId + // }); + // logContext.onJoinPhotonDisplayName = string.Empty; + // logContext.onJoinPhotonDisplayNameDate = string.Empty; + // + // return true; + // } + // + // return false; + // } private bool ParseLogOnAudioConfigurationChanged(FileInfo fileInfo, LogContext logContext, string line, int offset) { @@ -1162,7 +1185,6 @@ namespace VRCX public string LastVideoError; public long Length; public string locationDestination; - public string onJoinPhotonDisplayName; public long Position; public string RecentWorldName; public bool ShaderKeywordsLimitReached; diff --git a/html/src/app.js b/html/src/app.js index 10fdae2f..705c935f 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -9599,6 +9599,7 @@ speechSynthesis.getVoices(); }; database.updateGamelogLocationTimeToDatabase(update); } + this.gameLogApiLoggingEnabled = false; this.lastLocationDestination = ''; this.lastLocationDestinationTime = 0; this.lastLocation = { @@ -9871,6 +9872,7 @@ speechSynthesis.getVoices(); $app.data.lastLocationDestinationTime = 0; $app.data.lastVideoUrl = ''; $app.data.lastResourceloadUrl = ''; + $app.data.gameLogApiLoggingEnabled = false; $app.methods.addGameLogEntry = function (gameLog, location) { if (this.gameLogDisabled) { @@ -9976,8 +9978,18 @@ speechSynthesis.getVoices(); database .getUserIdFromDisplayName(gameLog.displayName) .then((oldUserId) => { - if (oldUserId && this.isGameRunning) { - API.getUser({ userId: oldUserId }); + if (this.isGameRunning) { + if (oldUserId) { + API.getUser({ userId: oldUserId }); + } else if (Date.now() - joinTime < 5 * 1000) { + workerTimers.setTimeout( + () => + this.silentSeachUser( + gameLog.displayName + ), + 10 * 1000 + ); + } } }); } @@ -10130,8 +10142,11 @@ speechSynthesis.getVoices(); } catch (err) { console.error(err); } - if (userId && !API.cachedUsers.has(userId)) { - API.getUser({ userId }); + if (userId) { + this.gameLogApiLoggingEnabled = true; + if (!API.cachedUsers.has(userId)) { + API.getUser({ userId }); + } } break; case 'vrcx': @@ -10244,6 +10259,39 @@ speechSynthesis.getVoices(); } }; + $app.methods.silentSeachUser = function (displayName) { + var playerListRef = this.lastLocation.playerList.get(displayName); + if (!this.gameLogApiLoggingEnabled || playerListRef.userId) { + return; + } + if (this.debugGameLog) { + console.log('Fetching userId for', displayName); + } + var params = { + n: 5, + offset: 0, + fuzzy: false, + search: displayName + }; + API.getUsers(params).then((args) => { + var map = new Map(); + var nameFound = false; + for (var json of args.json) { + var ref = API.cachedUsers.get(json.id); + if (typeof ref !== 'undefined') { + map.set(ref.id, ref); + } + if (json.displayName === displayName) { + nameFound = true; + } + } + if (!nameFound) { + console.error('userId not found for', displayName); + } + return args; + }); + }; + $app.methods.addGamelogLocationToDatabase = async function (input) { var groupName = await this.getGroupName(input.location); var entry = { @@ -12742,7 +12790,7 @@ speechSynthesis.getVoices(); n: 10, offset: 0, fuzzy: false, - search: this.replaceBioSymbols(displayName) + search: displayName }; await this.moreSearchUser(); }; @@ -12751,7 +12799,7 @@ speechSynthesis.getVoices(); this.searchUserParams = { n: 10, offset: 0, - search: this.replaceBioSymbols(this.searchText) + search: this.searchText }; await this.moreSearchUser(); }; @@ -15927,7 +15975,8 @@ speechSynthesis.getVoices(); avatarModeration: 0, previousDisplayNames: [], dateFriended: '', - unFriended: false + unFriended: false, + dateFriendedInfo: [] }; $app.data.ignoreUserMemoSave = false; @@ -16208,6 +16257,7 @@ speechSynthesis.getVoices(); D.previousDisplayNames = []; D.dateFriended = ''; D.unFriended = false; + D.dateFriendedInfo = []; if (userId === API.currentUser.id) { this.getWorldName(API.currentUser.homeLocation).then( (worldName) => { @@ -16349,6 +16399,12 @@ speechSynthesis.getVoices(); ref2.created_at; } } + if ( + ref2.type === 'Friend' || + ref2.type === 'Unfriend' + ) { + D.dateFriendedInfo.push(ref2); + } } }); var displayNameMapSorted = new Map( @@ -18621,7 +18677,8 @@ speechSynthesis.getVoices(); loading: false, worldId: '', worldName: '', - userIds: [] + userIds: [], + friendsInInstance: [] }; API.$on('LOGOUT', function () { @@ -18697,6 +18754,15 @@ speechSynthesis.getVoices(); D.userIds = []; D.worldId = L.tag; D.worldName = args.ref.name; + D.friendsInInstance = []; + for (var ctx of this.friends.values()) { + if (typeof ctx.ref === 'undefined') { + continue; + } + if (ctx.ref.location === this.lastLocation.location) { + D.friendsInInstance.push(ctx); + } + } D.visible = true; }); }; diff --git a/html/src/index.pug b/html/src/index.pug index d94794d5..8df85ffe 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -431,9 +431,16 @@ html span.name {{ $t('dialog.user.info.date_joined') }} span.extra(v-text="userDialog.ref.date_joined") .x-friend-item(v-if="API.currentUser.id !== userDialog.id" style="cursor:default") - .detail - span.name(v-if="userDialog.unFriended") {{ $t('dialog.user.info.unfriended') }} - el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')") + el-tooltip(placement="top") + template(#content v-if="userDialog.dateFriendedInfo.length") + template(v-for="ref in userDialog.dateFriendedInfo") + span {{ ref.type }}: {{ ref.created_at | formatDate('long') }} + br + template(#content v-else) + span - + .detail + span.name(v-if="userDialog.unFriended") {{ $t('dialog.user.info.unfriended') }} + el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')") i.el-icon-warning span.name(v-else) {{ $t('dialog.user.info.friended') }} el-tooltip(v-if="!hideTooltips" placement="top" style="margin-left:5px" :content="$t('dialog.user.info.accuracy_notice')") @@ -1216,6 +1223,14 @@ html img(v-lazy="userImage(API.currentUser)") .detail span.name(v-text="API.currentUser.displayName") + el-option-group(v-if="inviteDialog.friendsInInstance.length" :label="$t('dialog.invite.friends_in_instance')") + el-option.x-friend-item(v-for="friend in inviteDialog.friendsInInstance" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") + template(v-if="friend.ref") + .avatar(:class="userStatusClass(friend.ref)") + img(v-lazy="userImage(friend.ref)") + .detail + span.name(v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") + span(v-else v-text="friend.id") el-option-group(v-if="friendsGroup0.length" :label="$t('side_panel.favorite')") el-option.x-friend-item(v-for="friend in friendsGroup0" :key="friend.id" :label="friend.name" :value="friend.id" style="height:auto") template(v-if="friend.ref") diff --git a/html/src/localization/en/en.json b/html/src/localization/en/en.json index cbc9ddc2..52152981 100644 --- a/html/src/localization/en/en.json +++ b/html/src/localization/en/en.json @@ -868,7 +868,8 @@ "header": "Invite", "select_placeholder": "Choose Friends", "invite_with_message": "Invite With Message", - "invite": "Invite" + "invite": "Invite", + "friends_in_instance": "Friends In Instance" }, "social_status": { "header": "Social Status",