Player placed monitors on quarrys randomly disapear on server restart. Any ideas ?
Monitors disapearing on server restartSolved
Thanks for reporting. I just tested and was able to reproduce this issue. I placed two storage monitors on a quarry at the Water Treatment Plant monument. I verified that the quarry had saving enabled, and that the storage monitors also had saving enabled. I then saved and restarted. The storage monitors were missing.
Either the quarries themselves are being destroyed and replaced on server restart, or something is specifically destroying the storage monitors. I will keep looking into it.
Update #1: I have tested and confirmed that items in a quarry container were persisted after server restart. I have also verified that the net id of the quarry did not change after server restart. This is strong evidence that the quarry is not being destroyed and replaced on server restart.
Update #2: I have determined that the storage containers attached to the quarry do not have saving enabled. This is surely the culprit. This means those contains will be destroyed and replaced by new containers on restart.
The reason that the items in the containers are persisted is that their contents are saved as part of the quarry itself, then restored after the new containers are spawned.
Update #3: To solve, we could possibly enable saving on those containers, but that would probably create some problems. In order to keep the storage monitors working in the Rust+ app, the net ids of the storage monitors need not change across server restarts, meaning I can't simply destroy them and replace them later with the same properties (via a data file keeping track). I need to actually unparent them from the storage containers on server save or plugin unload and reparent them to the quarry itself. After saving, or after loading the plugin, the storage monitors need to be reparented to the original containers.
Thank you for looking at it so quickly. Let me know if you find a solution.
I've been working on a solution, but it has the side effect of making the storage monitors on the quarry containers no longer work after the server is restarted, since they are not parented to the storage containers immediately. I will likely need to expose some fields/methods via an Oxide patch to fix that properly. Once said Oxide patch is out, I'll post a beta here that you can use, until next month when I release it to everyone.
Merged post
If you download the latest Oxide update, you can use this unreleased version of the plugin.
https://github.com/WheteThunger/StorageMonitorControl/blob/develop/StorageMonitorControl.cs
I will release it on uMod after the next force wipe, when everyone is guaranteed to have updated Oxide.
Locked automatically