NexusBR submitted a new resource:
Inventory Guardian - Restore players inventory even after server Wipe!
Read more about this resource...

Inventory Guardian
Restore players inventory even after server wipe
Total Downloads: 3,604 - First Release: Jan 12, 2015 - Last Update: Feb 4, 2017
- 5/5, 19 likes
-
NexusBR updated Inventory Guardian with a new update entry:
Added ResourceID to work with Updater
-
Hello !
It works like charm!
Is there a way to control off and on mode in another way?
In my server having the mode on and doing a restart, just after this, players logged on fast , and they started killing each other not loosing anything from inventory, even more, they were able to duplicate their items at will.
For sure they had fun after the restart haha. I had to run like crazy in order to deactivate it .
Is there a way for just allow it for restarts only?
Thanks -
Well by default the Restoration Upon Death is disabled, And /restoreinv do not duplicate the items, It strips whole inventory before restore the saved, You still would have a problem with that?
[DOUBLEPOST=1421140585][/DOUBLEPOST]
But the problem is they can trow things away disconnect and the items are restored.
I could add a command to restore the inventory once for each player on connect then when connected destroy the saved inventory.
And i can give a command to act as a on/off switch.
I'll do that and post an update when ready
[DOUBLEPOST=1421157310,1421140150][/DOUBLEPOST]I already developed that features just waiting for Oxide Update to fix Memory Leak to the current version, Then i'll test, fix if needed and publish the update. -
NexusBR updated Inventory Guardian with a new update entry:
Major update
[DOUBLEPOST=1421171818][/DOUBLEPOST]
I even tried to add a command to to restore all players inventories but if the server is wiped so there is no players to be found so that does not work.
So i changed a few things and added a few things too.
You can take a look at the changelog and on the description.
Tell me what you think about the new update and if you tested and if it solved your problems. -
[Oxide] 9:45 PM [Error] Inventory-Guardian: [string "Inventory-Guardian.lua"]:254: attempt to index field '?' (a nil value)
at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0 -
NexusBR updated Inventory Guardian with a new update entry:
Minor bug fix
[DOUBLEPOST=1421229915][/DOUBLEPOST] -
Can the admin save player inventories if the server is empty and restore them after the wipe automatically?
-
There is no way to detect if the server was been wiped (/save/ folder deleted) as you can see on this topic : http://oxidemod.org/threads/anyway-to-detect-server-wipe.6422/#post-60266
The players inventories are saved automatically when the player disconnect. -
I've tried today something different in order to see if it could work or not. It worked but in a half way (not bad)
I did a wipe in the sever. Before the wipe, I activated the mod, did the wipe, and there , as admin I kept everything in my inventory (perhaps becuase I am the owner flagged as admin).As for the players, there were a lot of situations, some were having half of their stuff, some others nothing at all, and the rest almost everything.
I was surprised it worked in a half way lol
I just wanted to let it know if someone tries, in order to know what it can happen since I tested it.
Thank you Nexus, the plugin works good now without the index field issue. -
Well that is not the plugin fault, but rust/oxide, The items restoration is a slow process, but if the player opens the inventory before it completes not all items are restored.
As you can see on the description: Note: If the Inventory Guardian not fully restored your saved inventory is because you pressed TAB (Open Inventory) before the server completed the restoration, That can happen because a server lag, Just run the restoration again with/restoreinv and wait about 5 seconds before press TAB.
So is not possible to detect if the server was wiped, so i did the best way that i thought.
I don't know how to improve this plugin in anyway. -
NexusBR updated Inventory Guardian with a new update entry:
Fixed incomplete restoration and add batch process and more
-
NexusBR updated Inventory Guardian with a new update entry:
Complete code rewrite
-
I get this on ig.saveall
Initiating all players inventories salvation...
Code:[Oxide] 12:00 AM [Error] Inventory-Guardian: [string "Inventory-Guardian.lua"]:846: parameters do not match signature at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Last edited by a moderator: Sep 15, 2015 -
NexusBR updated Inventory Guardian with a new update entry:
Minor bug fix
-
I love this plugin, working like a charm with the lastest update. Thank you NexusBR
-
how do you type in or use the command to delete all inventories that have been saved
-
You need delete the server/(ServerID)/oxide/data/Inventory-Guardian.json and reload the plugin with oxide.reload Inventory-Guardian. -
Something wrong with RestoreInventory() after wipe. Second cycle skipped without errors/warnings and inventory becomes empty after player.inventory:Strip().
UPD: I found the reason why inventory doesn't restored.
When called RestoreInventory() code will execute after 1 sec (timer.Once(1, f()…end)). But ClearSavedInventory() in the hook OnPlayerSpawn() executed earlier, so nothing is restored.
ChangeCode:Line 791: IG:ClearSavedInventory(playerID)
Code:timer.Once(3, function() IG:ClearSavedInventory(playerID) end)
Last edited by a moderator: Feb 1, 2015 -
NexusBR updated Inventory Guardian with a new update entry:
Fixed auto restore, Improved map wipe detection