mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
Cache world on portal spawn
This commit is contained in:
@@ -8796,6 +8796,7 @@ speechSynthesis.getVoices();
|
||||
var args = await API.getCachedWorld({
|
||||
worldId: L.worldId
|
||||
});
|
||||
this.portalDownloadWorldCache(args.ref, ref);
|
||||
this.addPhotonEventToGameLog({
|
||||
created_at,
|
||||
type: 'PortalSpawn',
|
||||
@@ -10888,6 +10889,9 @@ speechSynthesis.getVoices();
|
||||
$app.data.worldAutoCacheGPSFilter = configRepository.getBool(
|
||||
'VRCX_worldAutoCacheGPSFilter'
|
||||
);
|
||||
$app.data.portalAutoCache = configRepository.getString(
|
||||
'VRCX_portalAutoCache'
|
||||
);
|
||||
$app.data.autoSweepVRChatCache = configRepository.getBool(
|
||||
'VRCX_autoSweepVRChatCache'
|
||||
);
|
||||
@@ -10952,6 +10956,10 @@ speechSynthesis.getVoices();
|
||||
'VRCX_worldAutoCacheGPSFilter',
|
||||
this.worldAutoCacheGPSFilter
|
||||
);
|
||||
configRepository.setString(
|
||||
'VRCX_portalAutoCache',
|
||||
this.portalAutoCache
|
||||
);
|
||||
configRepository.setBool(
|
||||
'VRCX_autoSweepVRChatCache',
|
||||
this.autoSweepVRChatCache
|
||||
@@ -11129,6 +11137,13 @@ speechSynthesis.getVoices();
|
||||
$app.data.worldAutoCacheGPS
|
||||
);
|
||||
}
|
||||
if (!configRepository.getString('VRCX_portalAutoCache')) {
|
||||
$app.data.portalAutoCache = 'Off';
|
||||
configRepository.setString(
|
||||
'VRCX_portalAutoCache',
|
||||
$app.data.portalAutoCache
|
||||
);
|
||||
}
|
||||
if (!configRepository.getBool('VRCX_vrBackgroundEnabled')) {
|
||||
$app.data.vrBackgroundEnabled = false;
|
||||
configRepository.setBool(
|
||||
@@ -17248,6 +17263,18 @@ speechSynthesis.getVoices();
|
||||
}
|
||||
};
|
||||
|
||||
$app.methods.portalDownloadWorldCache = function (worldRef, userRef) {
|
||||
var isFriend = this.friends.has(userRef.id);
|
||||
var isFavorite = API.cachedFavoritesByObjectId.has(userRef.id);
|
||||
if (
|
||||
this.portalAutoCache === 'Everyone' ||
|
||||
(this.portalAutoCache === 'Friends' && isFriend) ||
|
||||
(this.portalAutoCache === 'VIP' && isFavorite)
|
||||
) {
|
||||
this.autoDownloadWorldCache(worldRef.id, 'Portal', userRef.id);
|
||||
}
|
||||
};
|
||||
|
||||
$app.methods.feedDownloadWorldCache = function (id, location) {
|
||||
if (
|
||||
this.worldAutoCacheGPS === 'Always' ||
|
||||
@@ -17341,6 +17368,20 @@ speechSynthesis.getVoices();
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
if (
|
||||
this.isGameRunning &&
|
||||
(this.downloadCurrent.type === 'Invite' ||
|
||||
this.downloadCurrent.type === 'Portal')
|
||||
) {
|
||||
var entry = {
|
||||
created_at: new Date().toJSON(),
|
||||
type: 'Event',
|
||||
data: `World finished caching ${this.downloadCurrent.ref.name}`
|
||||
};
|
||||
this.queueGameLogNoty(entry);
|
||||
this.addGameLog(entry);
|
||||
database.addGamelogEventToDatabase(entry);
|
||||
}
|
||||
this.downloadCurrent.status = 'Success';
|
||||
this.downloadCurrent.date = Date.now();
|
||||
this.downloadHistoryTable.data.unshift(this.downloadCurrent);
|
||||
@@ -17398,6 +17439,20 @@ speechSynthesis.getVoices();
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
if (
|
||||
this.isGameRunning &&
|
||||
(this.downloadCurrent.type === 'Invite' ||
|
||||
this.downloadCurrent.type === 'Portal')
|
||||
) {
|
||||
var entry = {
|
||||
created_at: new Date().toJSON(),
|
||||
type: 'Event',
|
||||
data: `World already in cache ${this.downloadCurrent.ref.name}`
|
||||
};
|
||||
this.queueGameLogNoty(entry);
|
||||
this.addGameLog(entry);
|
||||
database.addGamelogEventToDatabase(entry);
|
||||
}
|
||||
this.downloadCurrent.status = 'Already in cache';
|
||||
this.downloadCurrent.date = Date.now();
|
||||
this.downloadHistoryTable.data.unshift(this.downloadCurrent);
|
||||
|
||||
@@ -600,7 +600,7 @@ html
|
||||
template(v-once #default="scope")
|
||||
template(v-if="scope.row.details && scope.row.details.imageUrl")
|
||||
el-popover(placement="right" width="500px" trigger="click")
|
||||
img.x-link(slot="reference" v-lazy="scope.row.details.imageUrl" style="flex:none;height:60px;border-radius:4px")
|
||||
img.x-link(slot="reference" v-lazy="scope.row.details.imageUrl" style="flex:none;width:90px;border-radius:4px")
|
||||
img.x-link(v-lazy="scope.row.details.imageUrl" style="width:500px" @click="openExternalLink(scope.row.details.imageUrl)")
|
||||
el-table-column(label="Message" prop="message")
|
||||
template(v-once #default="scope")
|
||||
@@ -1066,7 +1066,7 @@ html
|
||||
el-radio-button(label="Game Running")
|
||||
el-radio-button(label="Always")
|
||||
div.options-container-item
|
||||
el-switch(v-model="worldAutoCacheInviteFilter" @change="saveOpenVROption" inactive-text="VIP" active-text="Everyone" :disabled="worldAutoCacheInvite === 'Never'")
|
||||
el-switch(v-model="worldAutoCacheInviteFilter" @change="saveOpenVROption" inactive-text="VIP" active-text="Friends" :disabled="worldAutoCacheInvite === 'Never'")
|
||||
div.options-container-item
|
||||
span.name Download on GPS:
|
||||
br
|
||||
@@ -1076,7 +1076,15 @@ html
|
||||
el-radio-button(label="Game Running")
|
||||
el-radio-button(label="Always")
|
||||
div.options-container-item
|
||||
el-switch(v-model="worldAutoCacheGPSFilter" @change="saveOpenVROption" inactive-text="VIP" active-text="Everyone" :disabled="worldAutoCacheGPS === 'Never'")
|
||||
el-switch(v-model="worldAutoCacheGPSFilter" @change="saveOpenVROption" inactive-text="VIP" active-text="Friends" :disabled="worldAutoCacheGPS === 'Never'")
|
||||
div.options-container-item(v-if="photonLoggingEnabled")
|
||||
span.name Download on PortalSpawn:
|
||||
br
|
||||
el-radio-group(v-model="portalAutoCache" @change="saveOpenVROption" size="mini")
|
||||
el-radio-button(label="Off")
|
||||
el-radio-button(label="VIP")
|
||||
el-radio-button(label="Friends")
|
||||
el-radio-button(label="Everyone")
|
||||
div.options-container-item
|
||||
el-button(size="small" icon="el-icon-download" @click="showDownloadDialog") Download History
|
||||
br
|
||||
|
||||
Reference in New Issue
Block a user