mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Open world cache directory
This commit is contained in:
+14
-16
@@ -83,27 +83,25 @@ namespace VRCX
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">The ID of the asset bundle.</param>
|
/// <param name="id">The ID of the asset bundle.</param>
|
||||||
/// <param name="version">The version of the asset bundle.</param>
|
/// <param name="version">The version of the asset bundle.</param>
|
||||||
/// <returns>An array containing the file size and lock status of the asset bundle.</returns>
|
/// <returns>A Tuple containing the file size, lock status and path of the asset bundle.</returns>
|
||||||
public long[] CheckVRChatCache(string id, int version)
|
public Tuple<long, bool, string> CheckVRChatCache(string id, int version)
|
||||||
{
|
{
|
||||||
long FileSize = -1;
|
long fileSize = -1;
|
||||||
long IsLocked = 0;
|
var isLocked = false;
|
||||||
var FullLocation = GetVRChatCacheFullLocation(id, version);
|
var fullLocation = GetVRChatCacheFullLocation(id, version);
|
||||||
var FileLocation = Path.Combine(FullLocation, "__data");
|
var fileLocation = Path.Combine(fullLocation, "__data");
|
||||||
if (File.Exists(FileLocation))
|
var cachePath = string.Empty;
|
||||||
|
if (File.Exists(fileLocation))
|
||||||
{
|
{
|
||||||
FileInfo data = new FileInfo(FileLocation);
|
cachePath = fullLocation;
|
||||||
FileSize = data.Length;
|
FileInfo data = new FileInfo(fileLocation);
|
||||||
|
fileSize = data.Length;
|
||||||
}
|
}
|
||||||
if (File.Exists(Path.Combine(FullLocation, "__lock")))
|
if (File.Exists(Path.Combine(fullLocation, "__lock")))
|
||||||
{
|
{
|
||||||
IsLocked = 1;
|
isLocked = true;
|
||||||
}
|
}
|
||||||
return new long[]
|
return new Tuple<long, bool, string>(fileSize, isLocked, cachePath);
|
||||||
{
|
|
||||||
FileSize,
|
|
||||||
IsLocked
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// old asset bundle cacher downloader method reused for updating, it's not pretty
|
// old asset bundle cacher downloader method reused for updating, it's not pretty
|
||||||
|
|||||||
+27
-25
@@ -11399,7 +11399,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
this.checkVRChatCache(avatar).then((cacheInfo) => {
|
this.checkVRChatCache(avatar).then((cacheInfo) => {
|
||||||
var inCache = false;
|
var inCache = false;
|
||||||
if (cacheInfo[0] > 0) {
|
if (cacheInfo.Item1 > 0) {
|
||||||
inCache = true;
|
inCache = true;
|
||||||
}
|
}
|
||||||
this.addEntryPhotonEvent({
|
this.addEntryPhotonEvent({
|
||||||
@@ -11548,7 +11548,7 @@ speechSynthesis.getVoices();
|
|||||||
avatar.description = this.replaceBioSymbols(avatar.description);
|
avatar.description = this.replaceBioSymbols(avatar.description);
|
||||||
this.checkVRChatCache(avatar).then((cacheInfo) => {
|
this.checkVRChatCache(avatar).then((cacheInfo) => {
|
||||||
var inCache = false;
|
var inCache = false;
|
||||||
if (cacheInfo[0] > 0) {
|
if (cacheInfo.Item1 > 0) {
|
||||||
inCache = true;
|
inCache = true;
|
||||||
}
|
}
|
||||||
var entry = {
|
var entry = {
|
||||||
@@ -16419,10 +16419,10 @@ speechSynthesis.getVoices();
|
|||||||
this.currentInstanceWorld.avatarScalingDisabled =
|
this.currentInstanceWorld.avatarScalingDisabled =
|
||||||
args.ref?.tags.includes('feature_avatar_scaling_disabled');
|
args.ref?.tags.includes('feature_avatar_scaling_disabled');
|
||||||
this.checkVRChatCache(args.ref).then((cacheInfo) => {
|
this.checkVRChatCache(args.ref).then((cacheInfo) => {
|
||||||
if (cacheInfo[0] > 0) {
|
if (cacheInfo.Item1 > 0) {
|
||||||
this.currentInstanceWorld.inCache = true;
|
this.currentInstanceWorld.inCache = true;
|
||||||
this.currentInstanceWorld.cacheSize = `${(
|
this.currentInstanceWorld.cacheSize = `${(
|
||||||
cacheInfo[0] / 1048576
|
cacheInfo.Item1 / 1048576
|
||||||
).toFixed(2)} MiB`;
|
).toFixed(2)} MiB`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -16446,10 +16446,10 @@ speechSynthesis.getVoices();
|
|||||||
this.currentInstanceWorld.isQuest = isQuest;
|
this.currentInstanceWorld.isQuest = isQuest;
|
||||||
this.currentInstanceWorld.isIos = isIos;
|
this.currentInstanceWorld.isIos = isIos;
|
||||||
this.checkVRChatCache(args.ref).then((cacheInfo) => {
|
this.checkVRChatCache(args.ref).then((cacheInfo) => {
|
||||||
if (cacheInfo[0] > 0) {
|
if (cacheInfo.Item1 > 0) {
|
||||||
this.currentInstanceWorld.inCache = true;
|
this.currentInstanceWorld.inCache = true;
|
||||||
this.currentInstanceWorld.cacheSize = `${(
|
this.currentInstanceWorld.cacheSize = `${(
|
||||||
cacheInfo[0] / 1048576
|
cacheInfo.Item1 / 1048576
|
||||||
).toFixed(2)} MiB`;
|
).toFixed(2)} MiB`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -17048,6 +17048,7 @@ speechSynthesis.getVoices();
|
|||||||
inCache: false,
|
inCache: false,
|
||||||
cacheSize: 0,
|
cacheSize: 0,
|
||||||
cacheLocked: false,
|
cacheLocked: false,
|
||||||
|
cachePath: '',
|
||||||
lastVisit: '',
|
lastVisit: '',
|
||||||
visitCount: 0,
|
visitCount: 0,
|
||||||
timeSpent: 0,
|
timeSpent: 0,
|
||||||
@@ -17774,6 +17775,7 @@ speechSynthesis.getVoices();
|
|||||||
inCache: false,
|
inCache: false,
|
||||||
cacheSize: 0,
|
cacheSize: 0,
|
||||||
cacheLocked: false,
|
cacheLocked: false,
|
||||||
|
cachePath: '',
|
||||||
fileAnalysis: {}
|
fileAnalysis: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -17810,6 +17812,7 @@ speechSynthesis.getVoices();
|
|||||||
D.inCache = false;
|
D.inCache = false;
|
||||||
D.cacheSize = 0;
|
D.cacheSize = 0;
|
||||||
D.cacheLocked = false;
|
D.cacheLocked = false;
|
||||||
|
D.cachePath = '';
|
||||||
D.isQuestFallback = false;
|
D.isQuestFallback = false;
|
||||||
D.isFavorite = API.cachedFavoritesByObjectId.has(avatarId);
|
D.isFavorite = API.cachedFavoritesByObjectId.has(avatarId);
|
||||||
D.isBlocked = API.cachedAvatarModerations.has(avatarId);
|
D.isBlocked = API.cachedAvatarModerations.has(avatarId);
|
||||||
@@ -21951,15 +21954,16 @@ speechSynthesis.getVoices();
|
|||||||
D.inCache = false;
|
D.inCache = false;
|
||||||
D.cacheSize = 0;
|
D.cacheSize = 0;
|
||||||
D.cacheLocked = false;
|
D.cacheLocked = false;
|
||||||
|
D.cachePath = '';
|
||||||
this.checkVRChatCache(D.ref).then((cacheInfo) => {
|
this.checkVRChatCache(D.ref).then((cacheInfo) => {
|
||||||
if (cacheInfo[0] > 0) {
|
if (cacheInfo.Item1 > 0) {
|
||||||
D.inCache = true;
|
D.inCache = true;
|
||||||
D.cacheSize = `${(cacheInfo[0] / 1048576).toFixed(2)} MiB`;
|
D.cacheSize = `${(cacheInfo.Item1 / 1048576).toFixed(
|
||||||
D.cachePath = cacheInfo[2];
|
2
|
||||||
}
|
)} MiB`;
|
||||||
if (cacheInfo[1] === 1) {
|
D.cachePath = cacheInfo.Item3;
|
||||||
D.cacheLocked = true;
|
|
||||||
}
|
}
|
||||||
|
D.cacheLocked = cacheInfo.Item2;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -21970,14 +21974,16 @@ speechSynthesis.getVoices();
|
|||||||
D.inCache = false;
|
D.inCache = false;
|
||||||
D.cacheSize = 0;
|
D.cacheSize = 0;
|
||||||
D.cacheLocked = false;
|
D.cacheLocked = false;
|
||||||
|
D.cachePath = '';
|
||||||
this.checkVRChatCache(D.ref).then((cacheInfo) => {
|
this.checkVRChatCache(D.ref).then((cacheInfo) => {
|
||||||
if (cacheInfo[0] > 0) {
|
if (cacheInfo.Item1 > 0) {
|
||||||
D.inCache = true;
|
D.inCache = true;
|
||||||
D.cacheSize = `${(cacheInfo[0] / 1048576).toFixed(2)} MiB`;
|
D.cacheSize = `${(cacheInfo.Item1 / 1048576).toFixed(
|
||||||
}
|
2
|
||||||
if (cacheInfo[1] === 1) {
|
)} MiB`;
|
||||||
D.cacheLocked = true;
|
D.cachePath = cacheInfo.Item3;
|
||||||
}
|
}
|
||||||
|
D.cacheLocked = cacheInfo.Item2;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -21985,7 +21991,7 @@ speechSynthesis.getVoices();
|
|||||||
// eslint-disable-next-line require-await
|
// eslint-disable-next-line require-await
|
||||||
$app.methods.checkVRChatCache = async function (ref) {
|
$app.methods.checkVRChatCache = async function (ref) {
|
||||||
if (!ref.unityPackages) {
|
if (!ref.unityPackages) {
|
||||||
return [-1, 0];
|
return { Item1: -1, Item2: false, Item3: '' };
|
||||||
}
|
}
|
||||||
var assetUrl = '';
|
var assetUrl = '';
|
||||||
for (var i = ref.unityPackages.length - 1; i > -1; i--) {
|
for (var i = ref.unityPackages.length - 1; i > -1; i--) {
|
||||||
@@ -22001,14 +22007,10 @@ speechSynthesis.getVoices();
|
|||||||
var id = extractFileId(assetUrl);
|
var id = extractFileId(assetUrl);
|
||||||
var version = parseInt(extractFileVersion(assetUrl), 10);
|
var version = parseInt(extractFileVersion(assetUrl), 10);
|
||||||
if (!id || !version) {
|
if (!id || !version) {
|
||||||
return [-1, 0];
|
return { Item1: -1, Item2: false, Item3: '' };
|
||||||
}
|
}
|
||||||
|
|
||||||
let cacheData = await AssetBundleCacher.CheckVRChatCache(id, version);
|
return AssetBundleCacher.CheckVRChatCache(id, version);
|
||||||
let fullPath = await AssetBundleCacher.GetVRChatCacheFullLocation(id, version);
|
|
||||||
cacheData.push(fullPath);
|
|
||||||
|
|
||||||
return cacheData;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
API.getBundles = function (fileId) {
|
API.getBundles = function (fileId) {
|
||||||
@@ -22312,7 +22314,7 @@ speechSynthesis.getVoices();
|
|||||||
fileVersion
|
fileVersion
|
||||||
);
|
);
|
||||||
var inCache = false;
|
var inCache = false;
|
||||||
if (cacheInfo[0] > 0) {
|
if (cacheInfo.Item1 > 0) {
|
||||||
inCache = true;
|
inCache = true;
|
||||||
}
|
}
|
||||||
console.log(`InCache: ${inCache}`);
|
console.log(`InCache: ${inCache}`);
|
||||||
|
|||||||
+2
-2
@@ -572,7 +572,7 @@ html
|
|||||||
el-tag.x-tag-platform-ios(v-if="worldDialog.isIos" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") iOS
|
el-tag.x-tag-platform-ios(v-if="worldDialog.isIos" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") iOS
|
||||||
el-tag(v-if="worldDialog.avatarScalingDisabled" type="warning" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.avatar_scaling_disabled') }}
|
el-tag(v-if="worldDialog.avatarScalingDisabled" type="warning" effect="plain" size="mini" style="margin-right:5px;margin-top:5px") {{ $t('dialog.world.tags.avatar_scaling_disabled') }}
|
||||||
el-tag(type="info" effect="plain" size="mini" v-text="worldDialog.fileSize" style="margin-right:5px;margin-top:5px")
|
el-tag(type="info" effect="plain" size="mini" v-text="worldDialog.fileSize" style="margin-right:5px;margin-top:5px")
|
||||||
el-tag(v-if="worldDialog.inCache" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px" @click="openFolderGeneric(worldDialog.cachePath)")
|
el-tag.x-link(v-if="worldDialog.inCache" type="info" effect="plain" size="mini" style="margin-right:5px;margin-top:5px" @click="openFolderGeneric(worldDialog.cachePath)")
|
||||||
span(v-text="worldDialog.cacheSize")
|
span(v-text="worldDialog.cacheSize")
|
||||||
| {{ $t('dialog.world.tags.cache')}}
|
| {{ $t('dialog.world.tags.cache')}}
|
||||||
div(style="margin-top:5px")
|
div(style="margin-top:5px")
|
||||||
@@ -747,7 +747,7 @@ html
|
|||||||
el-tag(v-else type="danger" effect="plain" size="mini" style="margin-right:5px") {{ $t('dialog.avatar.tags.private') }}
|
el-tag(v-else type="danger" effect="plain" size="mini" style="margin-right:5px") {{ $t('dialog.avatar.tags.private') }}
|
||||||
el-tag(v-if="avatarDialog.isQuestFallback" type="info" effect="plain" size="mini" style="margin-right:5px") {{ $t('dialog.avatar.tags.fallback') }}
|
el-tag(v-if="avatarDialog.isQuestFallback" type="info" effect="plain" size="mini" style="margin-right:5px") {{ $t('dialog.avatar.tags.fallback') }}
|
||||||
el-tag(v-if="avatarDialog.fileSize" type="info" effect="plain" size="mini" v-text="avatarDialog.fileSize" style="margin-right:5px")
|
el-tag(v-if="avatarDialog.fileSize" type="info" effect="plain" size="mini" v-text="avatarDialog.fileSize" style="margin-right:5px")
|
||||||
el-tag(v-if="avatarDialog.inCache" type="info" effect="plain" size="mini")
|
el-tag.x-link(v-if="avatarDialog.inCache" type="info" effect="plain" size="mini" @click="openFolderGeneric(avatarDialog.cachePath)")
|
||||||
span(v-text="avatarDialog.cacheSize")
|
span(v-text="avatarDialog.cacheSize")
|
||||||
| {{ $t('dialog.avatar.tags.cache') }}
|
| {{ $t('dialog.avatar.tags.cache') }}
|
||||||
div(style="margin-top:5px")
|
div(style="margin-top:5px")
|
||||||
|
|||||||
Reference in New Issue
Block a user