Ver código fonte

Config files are now backed up even when running in SQL mode

GJ 12 anos atrás
pai
commit
0419dca385

+ 1 - 0
Changelog.txt

@@ -65,6 +65,7 @@ Version 1.4.00-dev
  = Fixed a bug where a new party leader wasn't appointed, after the previous party leader left
  = Fixed a bug where Disarm and Deflect had wrong values
  = Fixed Magic Hunter (Fishing ability) favoring certain enchants
+ ! Config files are now backed up even when running in SQL mode
  ! Changed /p and /a to use /partychat and /adminchat as the default command name. The use of /p, /pc, /a, and /ac is still supported.
  ! We're now using Bukkit sounds instead of Spout sounds.
  ! It is now possible to use a negative number for Max_Level in treasures.yml to not use a maximum level, changed default file accordingly

+ 8 - 4
src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java

@@ -28,15 +28,16 @@ public class ZipLibrary {
 
     public static void mcMMObackup() throws IOException {
         if (Config.getInstance().getUseMySQL()) {
-            mcMMO.p.getLogger().info("No Backup performed, in SQL Mode.");
-            return;
+            mcMMO.p.getLogger().info("This server is running in SQL Mode.");
+            mcMMO.p.getLogger().info("Only config files will be backed up.");
         }
 
         try {
             if (BackupDir.mkdir()) {
                 mcMMO.p.getLogger().info("Created Backup Directory.");
             }
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             mcMMO.p.getLogger().severe(e.toString());
         }
 
@@ -47,7 +48,10 @@ public class ZipLibrary {
 
         //Create the Source List, and add directories/etc to the file.
         List<File> sources = new ArrayList<File>();
-        sources.add(FlatFileDirectory);
+        if (!Config.getInstance().getUseMySQL()) {
+            sources.add(FlatFileDirectory);
+        }
+
         sources.add(ConfigFile);
         sources.add(TreasuresFile);
         sources.add(AdvancedConfigFile);