diff --git a/html/src/app.js b/html/src/app.js index 2a1ed258..eb8803f7 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -9035,11 +9035,11 @@ speechSynthesis.getVoices(); this.photonLobbyAvatars = new Map(); this.photonLobbyLastModeration = new Map(); this.photonLobbyJointime = new Map(); + this.photonLobbyActivePortals = new Map(); this.photonEvent7List = new Map(); this.photonLastEvent7List = ''; this.photonLastChatBoxMsg = new Map(); this.moderationEventQueue = new Map(); - this.lastPortalList = new Map(); if (this.photonEventTable.data.length > 0) { this.photonEventTablePrevious.data = this.photonEventTable.data; this.photonEventTable.data = []; @@ -9702,7 +9702,6 @@ speechSynthesis.getVoices(); database.addGamelogLocationToDatabase(entry); }; - $app.data.lastPortalList = new Map(); $app.data.moderationEventQueue = new Map(); $app.data.moderationAgainstTable = []; $app.data.photonLobby = new Map(); @@ -9715,6 +9714,7 @@ speechSynthesis.getVoices(); $app.data.photonLobbyWatcherLoop = false; $app.data.photonLobbyTimeout = []; $app.data.photonLobbyJointime = new Map(); + $app.data.photonLobbyActivePortals = new Map(); $app.data.photonEvent7List = new Map(); $app.data.photonLastEvent7List = ''; $app.data.photonLastChatBoxMsg = new Map(); @@ -10468,23 +10468,52 @@ speechSynthesis.getVoices(); var userId = data.Parameters[245][2]; var shortName = data.Parameters[245][5]; var worldName = data.Parameters[245][8].name; - this.lastPortalList.set(portalId, Date.parse(gameLogDate)); this.addPhotonPortalSpawn( gameLogDate, userId, shortName, worldName ); + this.photonLobbyActivePortals.set(portalId, { + userId, + shortName, + worldName, + created_at: Date.parse(gameLogDate), + playerCount: 0, + pendingLeave: 0 + }); } else if (data.Parameters[245][0] === 22) { var portalId = data.Parameters[245][1]; - var date = this.lastPortalList.get(portalId); - var time = timeToText(Date.parse(gameLogDate) - date); + var text = 'DeletedPortal'; + var ref = this.photonLobbyActivePortals.get(portalId); + if (typeof ref !== 'undefined') { + var worldName = ref.worldName; + var playerCount = ref.playerCount; + var time = timeToText( + Date.parse(gameLogDate) - ref.created_at + ); + text = `DeletedPortal after ${time} with ${playerCount} players to ${worldName}`; + } this.addEntryPhotonEvent({ - text: `DeletedPortal ${time}`, + text, + type: 'DeletedPortal', + created_at: gameLogDate + }); + this.photonLobbyActivePortals.delete(portalId); + } else if (data.Parameters[245][0] === 23) { + var portalId = data.Parameters[245][1]; + var playerCount = data.Parameters[245][3]; + var ref = this.photonLobbyActivePortals.get(portalId); + if (typeof ref !== 'undefined') { + ref.pendingLeave++; + ref.playerCount = playerCount; + } + } else if (data.Parameters[245][0] === 24) { + this.addEntryPhotonEvent({ + text: 'PortalError failed to create portal', type: 'DeletedPortal', created_at: gameLogDate }); - this.lastPortalList.delete(portalId); } break; } @@ -10873,6 +10902,9 @@ speechSynthesis.getVoices(); }; $app.methods.photonUserLeave = function (photonId, gameLogDate) { + if (!this.photonLobbyCurrent.has(photonId)) { + return; + } var text = 'has left'; var lastEvent = this.photonEvent7List.get(parseInt(photonId, 10)); if (typeof lastEvent !== 'undefined') { @@ -10882,6 +10914,12 @@ speechSynthesis.getVoices(); text = `has timed out after ${timeToText(timeSinceLastEvent)}`; } } + this.photonLobbyActivePortals.forEach((portal) => { + if (portal.pendingLeave > 0) { + text = `has left through portal to ${portal.worldName}`; + portal.pendingLeave--; + } + }); this.addEntryPhotonEvent({ photonId, text, @@ -22165,6 +22203,19 @@ speechSynthesis.getVoices(); ); this.photonEventPulse(); break; + case 'OnOperationRequest': + if (!this.isGameRunning) { + console.log('Game closed, skipped event', data); + return; + } + if (this.debugPhotonLogging) { + console.log( + 'OnOperationRequest', + data.OnOperationRequestData.OperationCode, + data.OnOperationRequestData + ); + } + break; case 'VRCEvent': if (!this.isGameRunning) { console.log('Game closed, skipped event', data); @@ -25872,6 +25923,9 @@ speechSynthesis.getVoices(); break; } } + if (!assetUrl) { + assetUrl = D.ref.assetUrl; + } var fileId = extractFileId(assetUrl); var version = parseInt(extractFileVersion(assetUrl), 10); if (!fileId || !version) { diff --git a/html/src/mixins/tabs/favorites.pug b/html/src/mixins/tabs/favorites.pug index 9a24e945..b9e80a57 100644 --- a/html/src/mixins/tabs/favorites.pug +++ b/html/src/mixins/tabs/favorites.pug @@ -1,5 +1,5 @@ mixin favoritesTab() - .x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'favorite'" v-if="$refs.menu && $refs.menu.activeIndex === 'favorite'") + .x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'favorite'") el-tooltip(placement="bottom" :content="$t('view.favorite.refresh_tooltip')" :disabled="hideTooltips") el-button(type="default" :loading="API.isFavoriteLoading" @click="API.refreshFavorites(); getLocalWorldFavorites()" size="small" icon="el-icon-refresh" circle style="position:relative;float:right;z-index:1") el-tabs(ref="favoriteTabRef" type="card" v-loading="API.isFavoriteLoading") diff --git a/html/src/repository/database.js b/html/src/repository/database.js index 8b436724..a24e9136 100644 --- a/html/src/repository/database.js +++ b/html/src/repository/database.js @@ -1038,6 +1038,7 @@ class Database { '@displayName': input.displayName } ); + instances.delete(''); ref.joinCount = instances.size; return ref; }