Send the full subspace inventory immediately on startup

This commit is contained in:
Danielv123 committed 2026-10-11 13:22:26 +02:00
1 parent ae6e25d1b9
commit 7fa1e90ed7
2 files changed
+41 -2

No files matched your search

+3 -2
View File
@@ -99,8 +99,9 @@ export default async function(context: InstancePluginContext) {
let items = await instance.sendTo("controller", new GetStorageRequest());
// Cache items for periodic time updates
cachedInventoryItems = items;
// Send the full inventory before a delta update can replace the cached items.
const itemsJson = lib.escapeString(JSON.stringify(items));
await instance.sendRcon(`/sc __subspace_storage__ UpdateInvData("${itemsJson}", true)`, true, plugin.name);
// Ensure a payload with updated time is sent every second
timeUpdateId = setInterval(() => {