Jump to content

Inventory Not Saving

Work in Progress 3.1.16

dustyhansen
dustyhansen

Posted

So I had several items on me in player mode, a hazmat, prototype 17, ammo, a jack hammer, etc. Then I switched to admin mode. When I went pack to player mode, all of those items were gone. There was a server restart in between switching back. 

Xray

Posted

Maybe just switch out of admin mode before rebooting your server?

If in admin mode & you reboot the server the plugin might not be able to restore & update the player inventory

Xray

Posted

Changed Status from Pending to Work in Progress

dustyhansen

Posted (edited)

Then will you lose your admin inventory? How is it storing the inventory if there is no data files? I will probably just not use this feature since it is not reliable.

Edited by dustyhansen
Xray

Posted

Correct, the plugin doesn't use data files to store the inventory data; it uses something called RAM. And once you reboot your Rust server, the RAM for the Rust-dedicated process is gone.

In the case, you are still in admin mode and log off (Inventory still cached in RAM), and if you then reboot the server, I am unsure if the plugin is quick enough to return the inventory & sync it. Therefore, I said before logging off, perhaps just revert the toggle to the player and no more issues.

dustyhansen

Posted

I appreciate the explanation. I personally feel like this is bad design and the plugin should use a data file or some other means of storing the separate inventories so that you don't lose items in the event of a server restart, crash, etc. But, if that is the way it is written/expected behavior, then I will just not use the feature since I can't rely on it to keep my inventory safe and do not want to have to worry about what mode I am on before logging off or server restart. Thanks.

Xray

Posted

If a server restarts or shuts down unexpectedly many data can be lost

I could see this being an issue if your server repeatedly restarts

But since its been over 2 years since I wrote this logic and don't have time to code up a modern fix I am sorry but my best suggestion if your server epeatedly restarts is to prehabs use backpacks from umod that is free & more up to date 

image.png.b25dff26e87dca838d01e6942afbfe4d.png

dustyhansen

Posted

I would say no. The inventory does not save if the server restarts and most of us restart our servers daily. If you can lose one of the inventories that easily, then I would say this feature should either be fixed so that it is more reliable or at the very least should have a warning added in the config that inventories do not save on server restart.

I am not using this feature because I cannot trust it.

Xray

Posted

Have you tried just revert toggle back to player before server restart?

dustyhansen

Posted

2 hours ago, Xray said:

Have you tried just revert toggle back to player before server restart?

If I switch to player mode and restart the server, won't it lose whatever is in my admin inventory though because of RAM?

I didn't test this, but just assumed that you cannot store stuff in both inventories and have it remember both inventories after a server restart because of the way it is written.

Xray

Posted

Yes if using the virtual inventory/separate inventory as intended by switching back to playermode before server restart everything should work just perfect

The way the code I made works is
you start in player mode
Upon switching to admin mode it analyzes everything in your inventory and keeps track of it this data is indeed stored in RAM
Upon exiting admin mode & returning to player mode this inventory is given back to you  again

dustyhansen

Posted

Ok, I understand. I am just saying in the real world, admins might wish to maintain 2 separate inventories and may not want to lose either their admin inventory or player inventory (if they forget to switch back) when the server restarts. 

If this feature is working as designed and you feel this is a good user experience, then feel free to close it. However, I am assuming you will have others complain about it in the future (unless you clearly explain the behavior). And because this does not work the way I think it should work, I am not going to use the feature, so I have disabled it.

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.4k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.