From 7c412cbec8591ea990a4dad4a855d001c6ff3082 Mon Sep 17 00:00:00 2001 From: Shatteredbeam Date: Tue, 1 May 2012 00:07:17 -0700 Subject: [PATCH] Fix for zip backup running in SQL mode. --- Changelog.txt | 1 + .../shatteredlands/shatt/backup/ZipLibrary.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 9574f640d..67c5f7307 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -15,6 +15,7 @@ Version 1.3.07 + Added permission nodes for Treasure & Magic Hunter for Fishing + Added config options for enabling/disabling specific double drops + Added automatic zip backup of flatfile database + = Fixed zip backup performing when running in SQL mode. = Fixed bug where the permission node for Impact didn't work = Fixed some bypass nodes defaulting true for Ops ! Changed Mining to ignore blocks when the pick is enchanted with Silk Touch diff --git a/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java b/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java index 68af13db1..5d6018b0b 100644 --- a/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java +++ b/src/main/java/net/shatteredlands/shatt/backup/ZipLibrary.java @@ -13,6 +13,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.config.Config; public class ZipLibrary { @@ -24,13 +25,20 @@ public class ZipLibrary { private static File Leaderboards = new File(mcMMO.leaderboardDirectory); public static void mcMMObackup() throws IOException { - if (BackupDir.mkdir()) { - try { + + if (Config.getInstance().getUseMySQL()) { + System.out.println("No Backup performed, in SQL Mode."); + return; + } + + try { + if (BackupDir.mkdir()) { mcMMO.p.getLogger().info("Created Backup Directory."); + } } catch (Exception e) { mcMMO.p.getLogger().severe(e.toString()); } - } + //Generate the proper date for the backup filename Date date = new Date();