Tux2/GriefPrevention — pull request #35 by Alshain01 (2014-03-31 01:03:26+00:00)
Title: Adds YAML Auto Save Feature and Universal Importer

Ok, this is the last little bit of this implementation, I added an auto save feature since YAML is normally cached and it was only saving on server reload or stop. This gives an option in yamlconfig.yml to set the number of minutes (default 60) between autosaves.

It also adds the importer. I originally tried to update the migrate methods I found, but I think they were being overridden and I didn't want to break something so I made a new one. It's usage is pretty simple:

this.dataStore = new YamlDataStore().importDataStore(new FlatFileDataStore());

This is in the abstract class so it will work with any of the DataStore types (you can now go back from SQL to flat file using this). Of course I had to make a few small tweaks to all the DataStore types in order to make this work, I extracted the group bonus loading part of the initialize methods into it's own method (which is abstract) and I added a convenience enum DataStoreType and an abstract getType() method.

I did quite a few tests and it all seems solid and ready to be implemented in the main class.