diff --git a/Dotnet/AssetBundleCacher.cs b/Dotnet/AssetBundleCacher.cs index 481793f0..1f282f4c 100644 --- a/Dotnet/AssetBundleCacher.cs +++ b/Dotnet/AssetBundleCacher.cs @@ -5,6 +5,7 @@ // For a copy, see . using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Security.Cryptography; @@ -276,17 +277,19 @@ public void DeleteAllCache() /// /// Removes empty directories from the VRChat cache directory and deletes old versions of cached asset bundles. /// - public void SweepCache() + public List SweepCache() { + var output = new List(); var cachePath = GetVRChatCacheLocation(); if (!Directory.Exists(cachePath)) - return; + return output; var directories = new DirectoryInfo(cachePath); var cacheDirectories = directories.GetDirectories(); foreach (var cacheDirectory in cacheDirectories) { + // var versionDirectories = cacheDirectory.GetDirectories().OrderBy(d => ReverseHexToDecimal(d.Name)).ToArray(); var versionDirectories = - cacheDirectory.GetDirectories().OrderBy(d => ReverseHexToDecimal(d.Name)).ToArray(); + cacheDirectory.GetDirectories().OrderBy(d => d.LastWriteTime).ToArray(); for (var index = 0; index < versionDirectories.Length; index++) { var versionDirectory = versionDirectories[index]; @@ -303,11 +306,14 @@ public void SweepCache() continue; // skip locked version versionDirectory.Delete(true); + output.Add($"{cacheDirectory.Name}\\{versionDirectory.Name}"); } if (cacheDirectory.GetDirectories().Length + cacheDirectory.GetFiles().Length == 0) cacheDirectory.Delete(); // delete empty directory } + + return output; } /// diff --git a/Dotnet/LogWatcher.cs b/Dotnet/LogWatcher.cs index c791deaf..7de45174 100644 --- a/Dotnet/LogWatcher.cs +++ b/Dotnet/LogWatcher.cs @@ -406,8 +406,9 @@ private bool ParseLogLocationDestination(FileInfo fileInfo, LogContext logContex // 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 // 2022.08.13 18:57:00 Log - [Behaviour] OnLeftRoom + // 2024.11.22 15:32:28 Log - [Behaviour] Successfully left room - if (line.Contains("[Behaviour] OnLeftRoom")) + if (line.Contains("[Behaviour] Successfully left room")) { AppendLog(new[] { diff --git a/html/src/app.js b/html/src/app.js index 3867055f..5fadb355 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -4673,7 +4673,9 @@ speechSynthesis.getVoices(); this.updateOnlineFriendCoutner(); } ctx.state = newState; - ctx.name = ref.displayName; + if (ref?.displayName) { + ctx.name = ref.displayName; + } ctx.isVIP = isVIP; }; @@ -5525,6 +5527,9 @@ speechSynthesis.getVoices(); `${ref.displayName} GPS ${previousLocation} -> ${newLocation}` ); } + if (previousLocation === 'offline') { + previousLocation = ''; + } if (!previousLocation) { // no previous location if ($app.debugFriendState) { @@ -16726,7 +16731,8 @@ speechSynthesis.getVoices(); }; $app.methods.sweepVRChatCache = async function () { - await AssetBundleCacher.SweepCache(); + var output = await AssetBundleCacher.SweepCache(); + console.log('SweepCache', output); if (this.VRChatConfigDialog.visible) { this.getVRChatCacheSize(); }