mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Cache world on portal spawn
This commit is contained in:
@@ -8796,6 +8796,7 @@ speechSynthesis.getVoices();
|
|||||||
var args = await API.getCachedWorld({
|
var args = await API.getCachedWorld({
|
||||||
worldId: L.worldId
|
worldId: L.worldId
|
||||||
});
|
});
|
||||||
|
this.portalDownloadWorldCache(args.ref, ref);
|
||||||
this.addPhotonEventToGameLog({
|
this.addPhotonEventToGameLog({
|
||||||
created_at,
|
created_at,
|
||||||
type: 'PortalSpawn',
|
type: 'PortalSpawn',
|
||||||
@@ -10888,6 +10889,9 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.worldAutoCacheGPSFilter = configRepository.getBool(
|
$app.data.worldAutoCacheGPSFilter = configRepository.getBool(
|
||||||
'VRCX_worldAutoCacheGPSFilter'
|
'VRCX_worldAutoCacheGPSFilter'
|
||||||
);
|
);
|
||||||
|
$app.data.portalAutoCache = configRepository.getString(
|
||||||
|
'VRCX_portalAutoCache'
|
||||||
|
);
|
||||||
$app.data.autoSweepVRChatCache = configRepository.getBool(
|
$app.data.autoSweepVRChatCache = configRepository.getBool(
|
||||||
'VRCX_autoSweepVRChatCache'
|
'VRCX_autoSweepVRChatCache'
|
||||||
);
|
);
|
||||||
@@ -10952,6 +10956,10 @@ speechSynthesis.getVoices();
|
|||||||
'VRCX_worldAutoCacheGPSFilter',
|
'VRCX_worldAutoCacheGPSFilter',
|
||||||
this.worldAutoCacheGPSFilter
|
this.worldAutoCacheGPSFilter
|
||||||
);
|
);
|
||||||
|
configRepository.setString(
|
||||||
|
'VRCX_portalAutoCache',
|
||||||
|
this.portalAutoCache
|
||||||
|
);
|
||||||
configRepository.setBool(
|
configRepository.setBool(
|
||||||
'VRCX_autoSweepVRChatCache',
|
'VRCX_autoSweepVRChatCache',
|
||||||
this.autoSweepVRChatCache
|
this.autoSweepVRChatCache
|
||||||
@@ -11129,6 +11137,13 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.worldAutoCacheGPS
|
$app.data.worldAutoCacheGPS
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (!configRepository.getString('VRCX_portalAutoCache')) {
|
||||||
|
$app.data.portalAutoCache = 'Off';
|
||||||
|
configRepository.setString(
|
||||||
|
'VRCX_portalAutoCache',
|
||||||
|
$app.data.portalAutoCache
|
||||||
|
);
|
||||||
|
}
|
||||||
if (!configRepository.getBool('VRCX_vrBackgroundEnabled')) {
|
if (!configRepository.getBool('VRCX_vrBackgroundEnabled')) {
|
||||||
$app.data.vrBackgroundEnabled = false;
|
$app.data.vrBackgroundEnabled = false;
|
||||||
configRepository.setBool(
|
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) {
|
$app.methods.feedDownloadWorldCache = function (id, location) {
|
||||||
if (
|
if (
|
||||||
this.worldAutoCacheGPS === 'Always' ||
|
this.worldAutoCacheGPS === 'Always' ||
|
||||||
@@ -17341,6 +17368,20 @@ speechSynthesis.getVoices();
|
|||||||
type: 'success'
|
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.status = 'Success';
|
||||||
this.downloadCurrent.date = Date.now();
|
this.downloadCurrent.date = Date.now();
|
||||||
this.downloadHistoryTable.data.unshift(this.downloadCurrent);
|
this.downloadHistoryTable.data.unshift(this.downloadCurrent);
|
||||||
@@ -17398,6 +17439,20 @@ speechSynthesis.getVoices();
|
|||||||
type: 'warning'
|
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.status = 'Already in cache';
|
||||||
this.downloadCurrent.date = Date.now();
|
this.downloadCurrent.date = Date.now();
|
||||||
this.downloadHistoryTable.data.unshift(this.downloadCurrent);
|
this.downloadHistoryTable.data.unshift(this.downloadCurrent);
|
||||||
|
|||||||
+11
-3
@@ -600,7 +600,7 @@ html
|
|||||||
template(v-once #default="scope")
|
template(v-once #default="scope")
|
||||||
template(v-if="scope.row.details && scope.row.details.imageUrl")
|
template(v-if="scope.row.details && scope.row.details.imageUrl")
|
||||||
el-popover(placement="right" width="500px" trigger="click")
|
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)")
|
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")
|
el-table-column(label="Message" prop="message")
|
||||||
template(v-once #default="scope")
|
template(v-once #default="scope")
|
||||||
@@ -1066,7 +1066,7 @@ html
|
|||||||
el-radio-button(label="Game Running")
|
el-radio-button(label="Game Running")
|
||||||
el-radio-button(label="Always")
|
el-radio-button(label="Always")
|
||||||
div.options-container-item
|
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
|
div.options-container-item
|
||||||
span.name Download on GPS:
|
span.name Download on GPS:
|
||||||
br
|
br
|
||||||
@@ -1076,7 +1076,15 @@ html
|
|||||||
el-radio-button(label="Game Running")
|
el-radio-button(label="Game Running")
|
||||||
el-radio-button(label="Always")
|
el-radio-button(label="Always")
|
||||||
div.options-container-item
|
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
|
div.options-container-item
|
||||||
el-button(size="small" icon="el-icon-download" @click="showDownloadDialog") Download History
|
el-button(size="small" icon="el-icon-download" @click="showDownloadDialog") Download History
|
||||||
br
|
br
|
||||||
|
|||||||
Reference in New Issue
Block a user