diff --git a/LogWatcher.cs b/LogWatcher.cs index 439f12f6..7fa6afed 100644 --- a/LogWatcher.cs +++ b/LogWatcher.cs @@ -349,12 +349,12 @@ namespace VRCX // 2021.09.02 00:02:12 Log - [Behaviour] Destination set: wrld_4432ea9b-729c-46e3-8eaf-846aa0a37fdd:15609~private(usr_032383a7-748c-4fb2-94e4-bcb928e5de6b)~nonce(72CC87D420C1D49AEFFBEE8824C84B2DF0E38678E840661E) // 2021.09.02 00:49:15 Log - [Behaviour] Destination fetching: wrld_4432ea9b-729c-46e3-8eaf-846aa0a37fdd - if (line.Contains("[Behaviour] Destination fetching: ")) + if (line.Contains("[Behaviour] Destination set: ")) { - var lineOffset = line.LastIndexOf("] Destination fetching: "); + var lineOffset = line.LastIndexOf("] Destination set: "); if (lineOffset < 0) return true; - lineOffset += 24; + lineOffset += 19; if (lineOffset >= line.Length) return true; diff --git a/html/src/app.js b/html/src/app.js index c38ddcef..35115755 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -6471,9 +6471,6 @@ speechSynthesis.getVoices(); }); API.$on('FRIEND:STATE', function (args) { - if (args.json.state === 'online') { - $app.APILastOnline.set(args.params.userId, Date.now()); - } $app.updateFriend(args.params.userId, args.json.state); }); @@ -6604,14 +6601,19 @@ speechSynthesis.getVoices(); if (typeof ctx === 'undefined') { return; } - if (this.updateFriendInProgress.has(id)) { - var date = this.updateFriendInProgress.get(id); - if (date + 10000 >= Date.now()) { - // wait for 10 seconds - return; - } + var lastOnlineDate = this.APILastOnline.get(id); + if ( + stateInput && + ctx.state !== stateInput && + lastOnlineDate && + lastOnlineDate > Date.now() - 100 + ) { + // crappy double online fix + return; + } + if (stateInput === 'online') { + this.APILastOnline.set(id, Date.now()); } - this.updateFriendInProgress.set(id, Date.now()); var ref = API.cachedUsers.get(id); var isVIP = API.cachedFavoritesByObjectId.has(id); if (typeof stateInput === 'undefined' || ctx.state === stateInput) { @@ -6704,16 +6706,20 @@ speechSynthesis.getVoices(); ctx.state === 'online' && (stateInput === 'active' || stateInput === 'offline') ) { - // wait 1minute then check if user came back online + // check if already waiting + var date = this.updateFriendInProgress.get(id); + if (date && date > Date.now() - 110000) { + return; + } + this.updateFriendInProgress.set(id, Date.now()); + // wait 2minutes then check if user came back online await new Promise((resolve) => { - setTimeout(resolve, 50000); + setTimeout(resolve, 110000); }); - if (this.APILastOnline.has(id)) { - var date = this.APILastOnline.get(id); - if (date > Date.now() - 60000) { - this.updateFriendInProgress.delete(id); - return; - } + var date1 = this.APILastOnline.get(id); + if (date1 && date1 > Date.now() - 120000) { + this.updateFriendInProgress.delete(id); + return; } } try { diff --git a/html/src/index.pug b/html/src/index.pug index 7499ae3a..0f8741a6 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1333,7 +1333,7 @@ html location.extra(:location="item.ref.location" :traveling="item.ref.travelingToLocation" :link="false") img.avatar(v-lazy="userImage(item.ref)") span(v-else) Search More: #[span(v-text="item.label" style="font-weight:bold")] - el-tooltip(placement="bottom" content="Direct access ID/URL" :disabled="hideTooltips") + el-tooltip(placement="bottom" content="Direct access ID/URL from clipboard" :disabled="hideTooltips") el-button(type="default" @click="directAccessPaste" size="mini" icon="el-icon-discover" circle) el-tooltip(placement="bottom" content="Refresh friends" :disabled="hideTooltips") el-button(type="default" @click="API.closeWebSocket(); API.getCurrentUser(); API.refreshFriends()" :loading="API.isRefreshFriendsLoading" size="mini" icon="el-icon-refresh" circle style="margin-right:10px")