Clear data files on wipe (Rust)
There are certain plugins I wipe data for on wipes that don't automatically wipe themselves. I was wondering if there's a plugin out there that will help with this.

For instance:

- Ability to specify data file names that will automatically have contents cleared on a map wipe
- Ability to specify an additional list of data files that can be cleared on demand via console command

Does something like this exist? If not, I'm thinking it would be wildly popular and certainly useful to me.
I can try to work on this, thanks for the request!
In response to ():
I can try to work on this, thanks for the request!
Awesome. Thanks!
Hello, very nice request, should be nice  :)
Well, my search came out dry. It doesn't seem that I can do this. When a plugin saves data it's not the same as saving configs which is the way I was going to do it and they store it themselves and "clearing" would just be setting it to `{}` which isn't that efficient. You also can't delete files with the System.IO block.
When you say it would set it to {} isn't that effectively clearing the data from the file? As long as the data is gone does it matter?

I would have expected, if a plugin can clear it's own data file when it detects a map wipe, another plugin could clear other data files.
In response to Bumfuzzler ():
When you say it would set it to {} isn't that effectively clearing the data from the file? As long a...
It's really simple task to do. Using OnNewSave(string fn) can help you detect server wipe. You can't delete data files from executed code (unless you have a custom extension as they are not sandboxed by uMod), but usually, every read failure will cause the plugin to re-make the datafile, if the author has implemented this, so you can either delete the contents of json files or just add random lines into them.
 
In response to 2CHEVSKII ():
It's really simple task to do. Using OnNewSave(string fn) can help you detect server wipe. You can't...
It is a simple task to do, but you can't do it to all plugins and most plugins don't check their data files
In response to ():
It is a simple task to do, but you can't do it to all plugins and most plugins don't check their dat...
Let's say you clear a data file from another plugin - either before a wipe with a command or on wipe detection. Won't that plugin then populate the default data structure in its data file the first time it tries to write data after the wipe?
I already made a plugin for your request, use it - WipeDataCleaner
In response to 2CHEVSKII ():
I already made a plugin for your request, use it - WipeDataCleaner
This plugin he made works great for what you are asking for.

His config allows selection of plugins that normally they would need to be manually wiped and you can exclude any that wipe themselves after map change.

It's a good system, it works.
In response to SlyStone ():
This plugin he made works great for what you are asking for.

His config allows selection...
Seems so and I'm much appreciated. Just waiting on an answer to a question there and a fix, as I believe it may make some plugins unusable.
Please use the support section for the plugin, this thread is simply for the original request.
In response to Wulf ():
Please use the support section for the plugin, this thread is simply for the original request.
mmm did, just mentioning that I did.