This commit is contained in:
Natsumi
2026-01-24 01:04:24 +13:00
committed by pa
parent c4f75e50d7
commit dfce6760ca
6 changed files with 40 additions and 20 deletions

View File

@@ -5,6 +5,7 @@ using System.Globalization;
using System.IO;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading;
using NLog;
@@ -32,6 +33,7 @@ namespace VRCX
private DateTime tillDate;
public bool VrcClosedGracefully;
private readonly ConcurrentQueue<string> m_LogQueue = new ConcurrentQueue<string>(); // for electron
private static readonly Regex CleanId = new("[^a-zA-Z0-9_\\-~:()]", RegexOptions.Compiled);
// NOTE
// FileSystemWatcher() is unreliable
@@ -371,6 +373,7 @@ namespace VRCX
return true;
var location = line.Substring(lineOffset);
location = CleanId.Replace(location, string.Empty);
AppendLog(new[]
{
@@ -447,7 +450,8 @@ namespace VRCX
if (lineOffset >= line.Length)
return true;
logContext.LocationDestination = line.Substring(lineOffset);
var locationDestination = line.Substring(lineOffset);
logContext.LocationDestination = CleanId.Replace(locationDestination, string.Empty);
return true;
}
@@ -495,8 +499,8 @@ namespace VRCX
fileInfo.Name,
ConvertLogTimeToISO8601(line),
"player-joined",
userInfo.DisplayName ?? string.Empty,
userInfo.UserId ?? string.Empty
userInfo.DisplayName,
userInfo.UserId
});
return true;
@@ -1351,14 +1355,15 @@ namespace VRCX
var inventoryIdIndex = info.IndexOf("inv_", StringComparison.Ordinal);
var inventoryId = info.Substring(inventoryIdIndex);
inventoryId = CleanId.Replace(inventoryId, string.Empty);
AppendLog(new[]
{
fileInfo.Name,
ConvertLogTimeToISO8601(line),
"sticker-spawn",
userId ?? string.Empty,
displayName ?? string.Empty,
userId,
displayName,
inventoryId
});
@@ -1400,21 +1405,22 @@ namespace VRCX
return new string[][] { };
}
private static (string? DisplayName, string? UserId) ParseUserInfo(string userInfo)
private static (string DisplayName, string UserId) ParseUserInfo(string userInfo)
{
string? userDisplayName;
string? userId;
string userDisplayName;
string userId;
int pos = userInfo.LastIndexOf(" (", StringComparison.Ordinal);
var pos = userInfo.LastIndexOf(" (", StringComparison.Ordinal);
if (pos >= 0)
{
userDisplayName = userInfo.Substring(0, pos);
userId = userInfo.Substring(pos + 2, userInfo.LastIndexOf(')') - (pos + 2));
userId = CleanId.Replace(userId, string.Empty);
}
else
{
userDisplayName = userInfo;
userId = null;
userId = string.Empty;
}
return (userDisplayName, userId);

View File

@@ -247,9 +247,15 @@ namespace VRCX
public void SetCookies(string cookies)
{
using (var stream = new MemoryStream(Convert.FromBase64String(cookies)))
try
{
CookieContainer.Add(System.Text.Json.JsonSerializer.Deserialize<CookieCollection>(stream));
using var stream = new MemoryStream(Convert.FromBase64String(cookies));
var data = System.Text.Json.JsonSerializer.Deserialize<CookieCollection>(stream);
CookieContainer.Add(data);
}
catch (Exception e)
{
Logger.Error($"Failed to set cookies: {e.Message}");
}
_cookieDirty = true; // force cookies to be saved for lastUserLoggedIn

View File

@@ -143,12 +143,18 @@ async function checkVRChatCache(ref) {
return { Item1: -1, Item2: false, Item3: '' };
}
return AssetBundleManager.CheckVRChatCache(
id,
version,
variant,
variantVersion
);
try {
return AssetBundleManager.CheckVRChatCache(
id,
version,
variant,
variantVersion
);
} catch (err) {
console.error('Failed reading VRChat cache size:', err);
toast.error(`Failed reading VRChat cache size: ${err}`);
return { Item1: -1, Item2: false, Item3: '' };
}
}
/**

View File

@@ -961,7 +961,7 @@ export const useNotificationStore = defineStore('Notification', () => {
fileId,
fileVersion
);
} else if (imageUrl) {
} else if (imageUrl && imageUrl.startsWith('http')) {
fileVersion = imageUrl.split('/').pop(); // 1416226261.thumbnail-500.png
fileId = fileVersion.split('.').shift(); // 1416226261
imageLocation = await AppApi.GetImage(

View File

@@ -211,7 +211,7 @@ export const useAppearanceSettingsStore = defineStore(
JSON.stringify(TRUST_COLOR_DEFAULTS)
),
configRepository.getBool('VRCX_notificationIconDot', true),
configRepository.getBool('VRCX_navIsCollapsed', true),
configRepository.getBool('VRCX_navIsCollapsed', false),
configRepository.getBool('VRCX_dataTableStriped', false),
configRepository.getBool('VRCX_showPointerOnHover', false),
configRepository.getString(

View File

@@ -296,6 +296,7 @@
<EditInviteMessageDialog
v-model:isEditInviteMessagesDialogVisible="isEditInviteMessagesDialogVisible"
@close="isEditInviteMessagesDialogVisible = false" />
<RegistryBackupDialog />
</template>
</div>
</template>
@@ -332,6 +333,7 @@
const ExportDiscordNamesDialog = defineAsyncComponent(() => import('./dialogs/ExportDiscordNamesDialog.vue'));
const ExportFriendsListDialog = defineAsyncComponent(() => import('./dialogs/ExportFriendsListDialog.vue'));
const ExportAvatarsListDialog = defineAsyncComponent(() => import('./dialogs/ExportAvatarsListDialog.vue'));
const RegistryBackupDialog = defineAsyncComponent(() => import('../Settings/dialogs/RegistryBackupDialog.vue'));
const { t } = useI18n();
const router = useRouter();