mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 15:33:12 +09:00
Send the full subspace inventory immediately on startup
This commit is contained in:
2 files changed
+41
-2
No files matched your search
@@ -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(() => {
|
||||
|
||||
Reference in new issue
Block a user