From f5cc0b8c2e0b4c630d88574f4e1fbe58ea9fbdac Mon Sep 17 00:00:00 2001 From: Natsumi Date: Mon, 13 Nov 2023 21:37:42 +1300 Subject: [PATCH] Changes and fixes Remove nonce (rip) Current instance avatar change on wrist feed Ignore non-standard unity package variants Remove GPUFix --- Dotnet/LogWatcher.cs | 29 +++++++++- html/src/app.js | 95 ++++++++++++++++++++++++------- html/src/index.pug | 28 ++++----- html/src/mixins/tabs/settings.pug | 6 -- html/src/service/gamelog.js | 5 ++ html/src/vr.pug | 8 +-- 6 files changed, 126 insertions(+), 45 deletions(-) diff --git a/Dotnet/LogWatcher.cs b/Dotnet/LogWatcher.cs index 60772fe49..8f813d873 100644 --- a/Dotnet/LogWatcher.cs +++ b/Dotnet/LogWatcher.cs @@ -229,6 +229,7 @@ out var lineDate ParseLogPortalSpawn(fileInfo, logContext, line, offset) || ParseLogNotification(fileInfo, logContext, line, offset) || ParseLogAPIRequest(fileInfo, logContext, line, offset) || + ParseLogAvatarChange(fileInfo, logContext, line, offset) || ParseLogJoinBlocked(fileInfo, logContext, line, offset) || ParseLogAvatarPedestalChange(fileInfo, logContext, line, offset) || ParseLogVideoError(fileInfo, logContext, line, offset) || @@ -797,7 +798,33 @@ private bool ParseLogAPIRequest(FileInfo fileInfo, LogContext logContext, string return true; } - // + + private bool ParseLogAvatarChange(FileInfo fileInfo, LogContext logContext, string line, int offset) + { + // 2023.11.05 14:45:57 Log - [Behaviour] Switching K․MOG to avatar MoeSera + + if (string.Compare(line, offset, "[Behaviour] Switching ", 0, 22, StringComparison.Ordinal) != 0) + return false; + + var pos = line.LastIndexOf(" to avatar "); + if (pos < 0) + return false; + + var displayName = line.Substring(offset + 22, pos - (offset + 22)); + var avatarName = line.Substring(pos + 11); + + AppendLog(new[] + { + fileInfo.Name, + ConvertLogTimeToISO8601(line), + "avatar-change", + displayName, + avatarName + }); + + 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 diff --git a/html/src/app.js b/html/src/app.js index df11cd6f9..33bd88a67 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -2594,7 +2594,6 @@ speechSynthesis.getVoices(); secureName: '', shortName: '', world: {}, - nonce: '', users: [], // only present when you're the owner clientNumber: '', photonRegion: '', @@ -9251,7 +9250,8 @@ speechSynthesis.getVoices(); var userMap = { displayName: ctx.displayName, userId: ctx.userId, - joinTime: Date.parse(ctx.created_at) + joinTime: Date.parse(ctx.created_at), + lastAvatar: '' }; this.lastLocation.playerList.set(ctx.displayName, userMap); if (this.friends.has(ctx.userId)) { @@ -9969,7 +9969,8 @@ speechSynthesis.getVoices(); var userMap = { displayName: gameLog.displayName, userId, - joinTime + joinTime, + lastAvatar: '' }; this.lastLocation.playerList.set(gameLog.displayName, userMap); if (userId) { @@ -10026,16 +10027,13 @@ speechSynthesis.getVoices(); database.addGamelogJoinLeaveToDatabase(entry); break; case 'player-left': - if (!this.lastLocation.playerList.has(gameLog.displayName)) { - break; - } - var time = 0; var ref = this.lastLocation.playerList.get(gameLog.displayName); - if (typeof ref !== 'undefined') { - time = Date.now() - ref.joinTime; - this.lastLocation.playerList.delete(gameLog.displayName); - this.lastLocation.friendList.delete(gameLog.displayName); + if (typeof ref === 'undefined') { + break; } + var time = Date.now() - ref.joinTime; + this.lastLocation.playerList.delete(gameLog.displayName); + this.lastLocation.friendList.delete(gameLog.displayName); this.photonLobbyAvatars.delete(userId); this.updateVRLastLocation(); this.getCurrentInstanceUserList(); @@ -10169,6 +10167,30 @@ speechSynthesis.getVoices(); } } break; + case 'avatar-change': + var ref = this.lastLocation.playerList.get(gameLog.displayName); + if ( + this.photonLoggingEnabled || + typeof ref === 'undefined' || + ref.lastAvatar === gameLog.avatarName + ) { + break; + } + if (!ref.lastAvatar) { + ref.lastAvatar = gameLog.avatarName; + this.lastLocation.playerList.set(gameLog.displayName, ref); + break; + } + ref.lastAvatar = gameLog.avatarName; + this.lastLocation.playerList.set(gameLog.displayName, ref); + var entry = { + created_at: gameLog.dt, + type: 'AvatarChange', + userId, + name: gameLog.avatarName, + displayName: gameLog.displayName + }; + break; case 'vrcx': // VideoPlay(PyPyDance) "https://jd.pypy.moe/api/v1/videos/jr1NX4Jo8GE.mp4",0.1001,239.606,"0905 : [J-POP] 【まなこ】金曜日のおはよう 踊ってみた (vernities)" var type = gameLog.data.substr(0, gameLog.data.indexOf(' ')); @@ -10281,7 +10303,11 @@ speechSynthesis.getVoices(); $app.methods.silentSeachUser = function (displayName) { var playerListRef = this.lastLocation.playerList.get(displayName); - if (!this.gameLogApiLoggingEnabled || playerListRef.userId) { + if ( + !this.gameLogApiLoggingEnabled || + !playerListRef || + playerListRef.userId + ) { return; } if (this.debugGameLog) { @@ -11872,6 +11898,12 @@ speechSynthesis.getVoices(); } if (!avatar.assetUrl && unityPackages.length > 0) { for (var unityPackage of unityPackages) { + if ( + unityPackage.variant && + unityPackage.variant !== 'standard' + ) { + continue; + } if (unityPackage.platform === 'standalonewindows') { avatar.assetUrl = unityPackage.assetUrl; } @@ -14525,16 +14557,12 @@ speechSynthesis.getVoices(); ); $app.data.isStartAsMinimizedState = false; $app.data.isCloseToTray = false; - $app.data.gpuFix = false; VRCXStorage.Get('VRCX_StartAsMinimizedState').then((result) => { $app.isStartAsMinimizedState = result === 'true'; }); VRCXStorage.Get('VRCX_CloseToTray').then((result) => { $app.isCloseToTray = result === 'true'; }); - VRCXStorage.Get('VRCX_GPUFix').then((result) => { - $app.gpuFix = result === 'true'; - }); if (configRepository.getBool('VRCX_CloseToTray')) { // move back to JSON $app.data.isCloseToTray = configRepository.getBool('VRCX_CloseToTray'); @@ -14551,7 +14579,6 @@ speechSynthesis.getVoices(); this.isStartAsMinimizedState.toString() ); VRCXStorage.Set('VRCX_CloseToTray', this.isCloseToTray.toString()); - VRCXStorage.Set('VRCX_GPUFix', this.gpuFix.toString()); AppApi.SetStartup(this.isStartAtWindowsStartup); }; $app.data.photonEventOverlay = configRepository.getBool( @@ -16970,6 +16997,12 @@ speechSynthesis.getVoices(); var isIos = false; if (typeof unityPackages === 'object') { for (var unityPackage of unityPackages) { + if ( + unityPackage.variant && + unityPackage.variant !== 'standard' + ) { + continue; + } if (unityPackage.platform === 'standalonewindows') { isPC = true; } else if (unityPackage.platform === 'android') { @@ -17593,6 +17626,9 @@ speechSynthesis.getVoices(); var fileSize = ''; for (let i = ref.unityPackages.length - 1; i > -1; i--) { var unityPackage = ref.unityPackages[i]; + if (unityPackage.variant && unityPackage.variant !== 'standard') { + continue; + } if ( unityPackage.platform === 'standalonewindows' && this.compareUnityVersion(unityPackage.unityVersion) @@ -18353,6 +18389,7 @@ speechSynthesis.getVoices(); if ( !assetUrl && unityPackage.platform === 'standalonewindows' && + unityPackage.variant === 'standard' && this.compareUnityVersion(unityPackage.unityVersion) ) { assetUrl = unityPackage.assetUrl; @@ -18615,6 +18652,12 @@ speechSynthesis.getVoices(); var platforms = []; if (ref.unityPackages) { for (var unityPackage of ref.unityPackages) { + if ( + unityPackage.variant && + unityPackage.variant !== 'standard' + ) { + continue; + } var platform = 'PC'; if (unityPackage.platform === 'standalonewindows') { platform = 'PC'; @@ -19087,9 +19130,6 @@ speechSynthesis.getVoices(); } else if (D.region === 'Japan') { tags.push(`~region(jp)`); } - if (D.accessType !== 'public' && D.accessType !== 'group') { - tags.push(`~nonce(${window.crypto.randomUUID()})`); - } if (D.accessType !== 'invite' && D.accessType !== 'friends') { D.strict = false; } @@ -23340,6 +23380,9 @@ speechSynthesis.getVoices(); var assetUrl = ''; for (var i = ref.unityPackages.length - 1; i > -1; i--) { var unityPackage = ref.unityPackages[i]; + if (unityPackage.variant && unityPackage.variant !== 'standard') { + continue; + } if ( unityPackage.platform === 'standalonewindows' && this.compareUnityVersion(unityPackage.unityVersion) @@ -23503,6 +23546,9 @@ speechSynthesis.getVoices(); var assetUrl = ''; for (var i = ref.unityPackages.length - 1; i > -1; i--) { var unityPackage = ref.unityPackages[i]; + if (unityPackage.variant && unityPackage.variant !== 'standard') { + continue; + } if ( unityPackage.platform === 'standalonewindows' && this.compareUnityVersion(unityPackage.unityVersion) @@ -23621,6 +23667,12 @@ speechSynthesis.getVoices(); var unityPackages = this.avatarDialog.ref.unityPackages; for (let i = unityPackages.length - 1; i > -1; i--) { var unityPackage = unityPackages[i]; + if ( + unityPackage.variant && + unityPackage.variant !== 'standard' + ) { + continue; + } if ( unityPackage.platform === 'standalonewindows' && this.compareUnityVersion(unityPackage.unityVersion) @@ -29110,6 +29162,9 @@ speechSynthesis.getVoices(); var assetUrl = ''; for (let i = D.ref.unityPackages.length - 1; i > -1; i--) { var unityPackage = D.ref.unityPackages[i]; + if (unityPackage.variant && unityPackage.variant !== 'standard') { + continue; + } if ( unityPackage.platform === 'standalonewindows' && this.compareUnityVersion(unityPackage.unityVersion) diff --git a/html/src/index.pug b/html/src/index.pug index c3502e968..921a15e74 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1896,17 +1896,17 @@ html el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }} el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }} el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }} + .toggle-item + span.toggle-name Lobby Avatar Change + el-radio-group(v-model="sharedFeedFilters.noty.AvatarChange" size="mini") + el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }} + el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }} + el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }} + el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }} template(v-if="photonLoggingEnabled") br .toggle-item span.toggle-name Photon Event Logging - .toggle-item - span.toggle-name Lobby Avatar Change - el-radio-group(v-model="sharedFeedFilters.noty.AvatarChange" size="mini") - el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }} - el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }} - el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }} - el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }} .toggle-item span.toggle-name Lobby ChatBox Message el-radio-group(v-model="sharedFeedFilters.noty.ChatBoxMessage" size="mini") @@ -2118,17 +2118,17 @@ html el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }} el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }} el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }} + .toggle-item + span.toggle-name Lobby Avatar Change + el-radio-group(v-model="sharedFeedFilters.wrist.AvatarChange" size="mini") + el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }} + el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }} + el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }} + el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }} template(v-if="photonLoggingEnabled") br .toggle-item span.toggle-name Photon Event Logging - .toggle-item - span.toggle-name Lobby Avatar Change - el-radio-group(v-model="sharedFeedFilters.wrist.AvatarChange" size="mini") - el-radio-button(label="Off") {{ $t('dialog.shared_feed_filters.off') }} - el-radio-button(label="VIP") {{ $t('dialog.shared_feed_filters.favorite') }} - el-radio-button(label="Friends") {{ $t('dialog.shared_feed_filters.friends') }} - el-radio-button(label="Everyone") {{ $t('dialog.shared_feed_filters.everyone') }} .toggle-item span.toggle-name Lobby ChatBox Message el-radio-group(v-model="sharedFeedFilters.wrist.ChatBoxMessage" size="mini") diff --git a/html/src/mixins/tabs/settings.pug b/html/src/mixins/tabs/settings.pug index 120a42e8f..088960377 100644 --- a/html/src/mixins/tabs/settings.pug +++ b/html/src/mixins/tabs/settings.pug @@ -511,12 +511,6 @@ mixin settingsTab() el-button-group(style="display:block") el-button(size="small" icon="el-icon-s-operation" @click="promptSetPendingOffline") {{ $t('view.settings.advanced.advanced.pending_offline.set_delay') }} +simpleSwitch("view.settings.advanced.advanced.cache_debug.udon_exception_logging", "udonExceptionLogging", "saveOpenVROption") - div.options-container-item - span.name {{ $t('view.settings.advanced.advanced.cache_debug.gpu_fix') }} - el-tooltip(placement="top" style="margin-left:5px" :content="$t('view.settings.advanced.advanced.cache_debug.gpu_fix_warning')") - i.el-icon-warning - el-switch(v-model="gpuFix" @change="saveVRCXWindowOption") - span.name(style="margin-left:15px") {{ $t('view.settings.advanced.advanced.cache_debug.gpu_fix_notice') }} div.options-container-item span.name {{ $t('view.settings.advanced.advanced.cache_debug.disable_gamelog') }} el-switch(v-model="gameLogDisabled" @change="disableGameLogDialog") diff --git a/html/src/service/gamelog.js b/html/src/service/gamelog.js index f62409208..ea9645252 100644 --- a/html/src/service/gamelog.js +++ b/html/src/service/gamelog.js @@ -58,6 +58,11 @@ class GameLogService { gameLog.url = args[0]; break; + case 'avatar-change': + gameLog.displayName = args[0]; + gameLog.avatarName = args[1]; + break; + case 'photon-id': gameLog.displayName = args[0]; gameLog.photonId = args[1]; diff --git a/html/src/vr.pug b/html/src/vr.pug index d8f81c717..d03a0199c 100644 --- a/html/src/vr.pug +++ b/html/src/vr.pug @@ -159,10 +159,10 @@ html span.time {{ feed.created_at | formatDate }} | 🧍 #[span.name(v-text="feed.displayName" style="margin-right:5px" :style="{'color':feed.tagColour}")] template(v-if="feed.releaseStatus === 'public'") - | #[i.x-user-status.online] - template(v-else) - | #[i.x-user-status.askme] - | {{ feed.name }} + | #[i.x-user-status.online]  + template(v-else-if="feed.releaseStatus === 'private'") + | #[i.x-user-status.askme]  + | {{ feed.name }} template(v-if="feed.description && feed.description !== feed.name") | - {{ feed.description }} div(v-else-if="feed.type === 'ChatBoxMessage'" class="x-friend-item" :class="{ friend: feed.isFriend, favorite: feed.isFavorite }")