diff --git a/Dotnet/AssetBundleManager.cs b/Dotnet/AssetBundleManager.cs
index 1fb6048d..2aa61089 100644
--- a/Dotnet/AssetBundleManager.cs
+++ b/Dotnet/AssetBundleManager.cs
@@ -28,16 +28,14 @@ namespace VRCX
public string GetAssetId(string id, string variant = "")
{
- using (var sha256 = SHA256.Create())
+ using var sha256 = SHA256.Create();
+ var hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(id + variant));
+ var idHex = new StringBuilder(hash.Length * 2);
+ foreach (var b in hash)
{
- byte[] hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(id + variant));
- StringBuilder idHex = new StringBuilder(hash.Length * 2);
- foreach (byte b in hash)
- {
- idHex.AppendFormat("{0:x2}", b);
- }
- return idHex.ToString().ToUpper().Substring(0, 16);
+ idHex.Append($"{b:x2}");
}
+ return idHex.ToString().ToUpper().Substring(0, 16);
}
public string GetAssetVersion(int version, int variantVersion = 0)
@@ -136,7 +134,7 @@ namespace VRCX
if (File.Exists(fileLocation))
{
cachePath = fullLocation;
- FileInfo data = new FileInfo(fileLocation);
+ var data = new FileInfo(fileLocation);
fileSize = data.Length;
}
if (File.Exists(Path.Join(fullLocation, "__lock")))
@@ -241,8 +239,8 @@ namespace VRCX
public long DirSize(DirectoryInfo d)
{
long size = 0;
- FileInfo[] files = d.GetFiles("*.*", SearchOption.AllDirectories);
- foreach (FileInfo file in files)
+ var files = d.GetFiles("*.*", SearchOption.AllDirectories);
+ foreach (var file in files)
{
size += file.Length;
}
diff --git a/Dotnet/Update.cs b/Dotnet/Update.cs
index ff5996b2..735aa207 100644
--- a/Dotnet/Update.cs
+++ b/Dotnet/Update.cs
@@ -217,8 +217,7 @@ namespace VRCX
{
var fileHashBytes = await sha256.ComputeHashAsync(stream, _cancellationToken);
var fileHashString = Convert.ToHexString(fileHashBytes);
- if (!string.IsNullOrEmpty(fileHashString) &&
- !hashString.Equals(fileHashString, StringComparison.OrdinalIgnoreCase))
+ if (!hashString.Equals(fileHashString, StringComparison.OrdinalIgnoreCase))
{
logger.Error($"Hash check failed file:{fileHashString} web:{hashString}");
throw new Exception("Hash check failed");
diff --git a/src/api/avatar.js b/src/api/avatar.js
index 9e14b8e7..f1622359 100644
--- a/src/api/avatar.js
+++ b/src/api/avatar.js
@@ -122,7 +122,7 @@ const avatarReq = {
/**
* @param {{ avatarId: string }} params
- * @returns {Promise<{json: T, params}>}
+ * @returns {Promise<{json: any, params}>}
*/
deleteImposter(params) {
return request(`avatars/${params.avatarId}/impostor`, {
@@ -151,7 +151,7 @@ const avatarReq = {
},
/**
- * @param {{ avatarId: string }} avatarId
+ * @param {string} avatarId
* @returns {Promise<{json: any, params}>}
*/
getAvatarGallery(avatarId) {
@@ -174,7 +174,7 @@ const avatarReq = {
},
/**
- * @param {{ imageData: string, avatarId: string }} params
+ * @param {{ imageData: string, avatarId: string }}
* @returns {Promise<{json: any, params}>}
*/
uploadAvatarGalleryImage(imageData, avatarId) {
diff --git a/src/components/dialogs/AvatarDialog/AvatarDialog.vue b/src/components/dialogs/AvatarDialog/AvatarDialog.vue
index 27348b48..81a70f34 100644
--- a/src/components/dialogs/AvatarDialog/AvatarDialog.vue
+++ b/src/components/dialogs/AvatarDialog/AvatarDialog.vue
@@ -553,18 +553,6 @@
icon="el-icon-refresh"
circle
@click="refreshAvatarDialogTreeData">
-
-
-
@@ -665,7 +653,6 @@
const treeData = ref([]);
const timeSpent = ref(0);
const memo = ref('');
- const fileAnalysis = ref({});
const setAvatarTagsDialog = reactive({
visible: false,
loading: false,
@@ -740,7 +727,7 @@
}
function handleDialogOpen() {
- fileAnalysis.value = {};
+ avatarDialog.value.fileAnalysis = {};
memo.value = '';
treeData.value = [];
getAvatarTimeSpent();
@@ -1085,66 +1072,6 @@
treeData.value = buildTreeData(avatarDialog.value.ref);
}
- function getAvatarFileAnalysis() {
- let unityPackage;
- const D = avatarDialog.value;
- const avatarId = D.ref.id;
- let assetUrl = '';
- let variant = 'security';
- for (let i = D.ref.unityPackages.length - 1; i > -1; i--) {
- unityPackage = D.ref.unityPackages[i];
- if (unityPackage.variant !== 'security') {
- continue;
- }
- if (unityPackage.platform === 'standalonewindows' && compareUnityVersion(unityPackage.unitySortNumber)) {
- assetUrl = unityPackage.assetUrl;
- break;
- }
- }
- if (!assetUrl) {
- for (let i = D.ref.unityPackages.length - 1; i > -1; i--) {
- unityPackage = D.ref.unityPackages[i];
- if (unityPackage.variant !== 'standard') {
- continue;
- }
- if (
- unityPackage.platform === 'standalonewindows' &&
- compareUnityVersion(unityPackage.unitySortNumber)
- ) {
- variant = 'standard';
- assetUrl = unityPackage.assetUrl;
- break;
- }
- }
- }
- const fileId = extractFileId(assetUrl);
- const version = parseInt(extractFileVersion(assetUrl), 10);
- if (!fileId || !version) {
- $message({
- message: 'File Analysis unavailable',
- type: 'error'
- });
- return;
- }
- miscRequest.getFileAnalysis({ fileId, version, variant }).then((args) => {
- if (!avatarDialog.value.visible || avatarDialog.value.id !== avatarId) {
- return;
- }
- const ref = args.json;
- if (typeof ref.fileSize !== 'undefined') {
- ref._fileSize = `${(ref.fileSize / 1048576).toFixed(2)} MB`;
- }
- if (typeof ref.uncompressedSize !== 'undefined') {
- ref._uncompressedSize = `${(ref.uncompressedSize / 1048576).toFixed(2)} MB`;
- }
- if (typeof ref.avatarStats?.totalTextureUsage !== 'undefined') {
- ref._totalTextureUsage = `${(ref.avatarStats.totalTextureUsage / 1048576).toFixed(2)} MB`;
- }
-
- fileAnalysis.value = buildTreeData(args.json);
- });
- }
-
function showSetAvatarTagsDialog(avatarId) {
const D = setAvatarTagsDialog;
D.visible = true;
diff --git a/src/components/dialogs/WorldDialog/WorldDialog.vue b/src/components/dialogs/WorldDialog/WorldDialog.vue
index 2e5b0ada..2a147dc4 100644
--- a/src/components/dialogs/WorldDialog/WorldDialog.vue
+++ b/src/components/dialogs/WorldDialog/WorldDialog.vue
@@ -722,6 +722,17 @@
circle
style="margin-left: 5px"
@click="downloadAndSaveJson(worldDialog.id, worldDialog.ref)">
+
+
+
+
+
+
+
+
diff --git a/src/service/database/gameLog.js b/src/service/database/gameLog.js
index d6a60452..59fcce1b 100644
--- a/src/service/database/gameLog.js
+++ b/src/service/database/gameLog.js
@@ -267,7 +267,7 @@ const gameLog = {
async getVisitCount(worldId) {
var ref = {
- visitCount: '',
+ visitCount: 0,
worldId: ''
};
await sqliteService.execute(
diff --git a/src/shared/utils/common.js b/src/shared/utils/common.js
index 54420749..502dcd10 100644
--- a/src/shared/utils/common.js
+++ b/src/shared/utils/common.js
@@ -86,7 +86,9 @@ async function deleteVRChatCache(ref) {
compareUnityVersion(unityPackage.unitySortNumber)
) {
assetUrl = unityPackage.assetUrl;
- if (unityPackage.variant !== 'standard') {
+ if (!unityPackage.variant || unityPackage.variant === 'standard') {
+ variant = 'security';
+ } else {
variant = unityPackage.variant;
}
break;
@@ -119,7 +121,9 @@ async function checkVRChatCache(ref) {
compareUnityVersion(unityPackage.unitySortNumber)
) {
assetUrl = unityPackage.assetUrl;
- if (unityPackage.variant !== 'standard') {
+ if (!unityPackage.variant || unityPackage.variant === 'standard') {
+ variant = 'security';
+ } else {
variant = unityPackage.variant;
}
break;
@@ -424,6 +428,7 @@ async function getBundleDateSize(ref) {
const { currentInstanceWorld, currentInstanceLocation } =
storeToRefs(instanceStore);
const bundleSizes = [];
+ const bundleJson = [];
for (let i = ref.unityPackages.length - 1; i > -1; i--) {
const unityPackage = ref.unityPackages[i];
if (
@@ -443,59 +448,63 @@ async function getBundleDateSize(ref) {
}
const assetUrl = unityPackage.assetUrl;
const fileId = extractFileId(assetUrl);
- const fileVersion = parseInt(extractFileVersion(assetUrl), 10);
- if (!fileId) {
+ const version = parseInt(extractFileVersion(assetUrl), 10);
+ let variant = '';
+ if (!unityPackage.variant || unityPackage.variant === 'standard') {
+ variant = 'security';
+ } else {
+ variant = unityPackage.variant;
+ }
+ if (!fileId || !version) {
continue;
}
- const args = await miscRequest.getBundles(fileId);
- if (!args?.json?.versions) {
+ console.log(
+ `Fetching bundle size for ${platform} - fileId: ${fileId}, version: ${version}, variant: ${variant}`
+ );
+ const args = await miscRequest.getFileAnalysis({
+ fileId,
+ version,
+ variant
+ });
+ if (!args?.json?.success) {
continue;
}
- let { versions } = args.json;
- for (let j = versions.length - 1; j > -1; j--) {
- const version = versions[j];
- if (version.version === fileVersion) {
- const createdAt = version.created_at;
- const fileSize = `${(
- version.file.sizeInBytes / 1048576
- ).toFixed(2)} MB`;
- bundleSizes[platform] = {
- createdAt,
- fileSize
- };
+ const json = args.json;
+ if (typeof json.fileSize !== 'undefined') {
+ json._fileSize = `${(json.fileSize / 1048576).toFixed(2)} MB`;
+ }
+ if (typeof json.uncompressedSize !== 'undefined') {
+ json._uncompressedSize = `${(json.uncompressedSize / 1048576).toFixed(2)} MB`;
+ }
+ if (typeof json.avatarStats?.totalTextureUsage !== 'undefined') {
+ json._totalTextureUsage = `${(json.avatarStats.totalTextureUsage / 1048576).toFixed(2)} MB`;
+ }
+ bundleJson[platform] = json;
+ const createdAt = json.created_at;
+ const fileSize = `${(json.fileSize / 1048576).toFixed(2)} MB`;
+ bundleSizes[platform] = {
+ createdAt,
+ fileSize
+ };
- // update avatar dialog
- if (avatarDialog.value.id === ref.id) {
- avatarDialog.value.bundleSizes[platform] =
- bundleSizes[platform];
- if (avatarDialog.value.lastUpdated < version.created_at) {
- avatarDialog.value.lastUpdated = version.created_at;
- }
- }
- // update world dialog
- if (worldDialog.value.id === ref.id) {
- worldDialog.value.bundleSizes[platform] =
- bundleSizes[platform];
- if (worldDialog.value.lastUpdated < version.created_at) {
- worldDialog.value.lastUpdated = version.created_at;
- }
- }
- // update player list
- if (currentInstanceLocation.value.worldId === ref.id) {
- currentInstanceWorld.value.bundleSizes[platform] =
- bundleSizes[platform];
-
- if (
- currentInstanceWorld.value.lastUpdated <
- version.created_at
- ) {
- currentInstanceWorld.value.lastUpdated =
- version.created_at;
- }
- }
- break;
- }
+ // update avatar dialog
+ if (avatarDialog.value.id === ref.id) {
+ avatarDialog.value.bundleSizes[platform] = bundleSizes[platform];
+ avatarDialog.value.lastUpdated = createdAt;
+ avatarDialog.value.fileAnalysis = buildTreeData(bundleJson);
+ }
+ // update world dialog
+ if (worldDialog.value.id === ref.id) {
+ worldDialog.value.bundleSizes[platform] = bundleSizes[platform];
+ worldDialog.value.lastUpdated = createdAt;
+ worldDialog.value.fileAnalysis = buildTreeData(bundleJson);
+ }
+ // update player list
+ if (currentInstanceLocation.value.worldId === ref.id) {
+ currentInstanceWorld.value.bundleSizes[platform] =
+ bundleSizes[platform];
+ currentInstanceWorld.value.lastUpdated = createdAt;
}
}
diff --git a/src/stores/avatar.js b/src/stores/avatar.js
index 2442a498..c5cf4e05 100644
--- a/src/stores/avatar.js
+++ b/src/stores/avatar.js
@@ -50,9 +50,10 @@ export const useAvatarStore = defineStore('Avatar', () => {
galleryLoading: false,
lastUpdated: '',
inCache: false,
- cacheSize: 0,
+ cacheSize: '',
cacheLocked: false,
- cachePath: ''
+ cachePath: '',
+ fileAnalysis: {}
},
cachedAvatarModerations: new Map(),
avatarHistory: new Set(),
@@ -131,9 +132,12 @@ export const useAvatarStore = defineStore('Avatar', () => {
highestPrice: null,
id: '',
imageUrl: '',
+ listingDate: null,
lock: false,
lowestPrice: null,
name: '',
+ pendingUpload: false,
+ performance: {},
productId: null,
publishedListings: [],
releaseStatus: '',
@@ -205,9 +209,10 @@ export const useAvatarStore = defineStore('Avatar', () => {
D.loading = true;
D.id = avatarId;
D.inCache = false;
- D.cacheSize = 0;
+ D.cacheSize = '';
D.cacheLocked = false;
D.cachePath = '';
+ D.fileAnalysis = {};
D.isQuestFallback = false;
D.isPC = false;
D.isQuest = false;
@@ -350,7 +355,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
const D = state.avatarDialog;
if (D.visible) {
D.inCache = false;
- D.cacheSize = 0;
+ D.cacheSize = '';
D.cacheLocked = false;
D.cachePath = '';
checkVRChatCache(D.ref).then((cacheInfo) => {
diff --git a/src/stores/world.js b/src/stores/world.js
index de444622..8f678dd5 100644
--- a/src/stores/world.js
+++ b/src/stores/world.js
@@ -39,9 +39,10 @@ export const useWorldStore = defineStore('World', () => {
bundleSizes: [],
lastUpdated: '',
inCache: false,
- cacheSize: 0,
+ cacheSize: '',
cacheLocked: false,
cachePath: '',
+ fileAnalysis: {},
lastVisit: '',
visitCount: 0,
timeSpent: 0,
@@ -96,11 +97,13 @@ export const useWorldStore = defineStore('World', () => {
D.visible = true;
D.loading = true;
D.inCache = false;
- D.cacheSize = 0;
+ D.cacheSize = '';
D.cacheLocked = false;
+ D.cachePath = '';
+ D.fileAnalysis = {};
D.rooms = [];
D.lastVisit = '';
- D.visitCount = '';
+ D.visitCount = 0;
D.timeSpent = 0;
D.isFavorite = false;
D.avatarScalingDisabled = false;
@@ -211,7 +214,7 @@ export const useWorldStore = defineStore('World', () => {
const D = state.worldDialog;
if (D.visible) {
D.inCache = false;
- D.cacheSize = 0;
+ D.cacheSize = '';
D.cacheLocked = false;
D.cachePath = '';
checkVRChatCache(D.ref).then((cacheInfo) => {