summaryrefslogtreecommitdiffstats
path: root/EssentialsGroupManager
diff options
context:
space:
mode:
authorElgarL <ElgarL@palmergames.com>2012-06-22 15:44:04 +0100
committerElgarL <ElgarL@palmergames.com>2012-06-22 15:44:04 +0100
commit656f25dc97f6b094b86131263d17a6d8069370f7 (patch)
tree1b87040269a2f07d425828a58fa078b27c911ce9 /EssentialsGroupManager
parent5683ea35fc60eafe70753fb9b2261b8537ed0b0f (diff)
downloadEssentials-656f25dc97f6b094b86131263d17a6d8069370f7.tar
Essentials-656f25dc97f6b094b86131263d17a6d8069370f7.tar.gz
Essentials-656f25dc97f6b094b86131263d17a6d8069370f7.tar.lz
Essentials-656f25dc97f6b094b86131263d17a6d8069370f7.tar.xz
Essentials-656f25dc97f6b094b86131263d17a6d8069370f7.zip
Only output a Data update message if something has changed.
Diffstat (limited to 'EssentialsGroupManager')
-rw-r--r--EssentialsGroupManager/src/Changelog.txt3
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java4
-rw-r--r--EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java8
3 files changed, 11 insertions, 4 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt
index 4a3c232be..134d40250 100644
--- a/EssentialsGroupManager/src/Changelog.txt
+++ b/EssentialsGroupManager/src/Changelog.txt
@@ -183,4 +183,5 @@ v 2.0:
- Re-initialize the WorldsHolder on a reload, as un-registering and re-registering a new holder means all plugins have to check for the new service on every quiery.
- Prevent null perms getting past the GlobalGroups loader.
- Fix forgetting sub groups on a manload.
- - Allow 'manucheckp' to notify when superperms reports false but it is really negated. \ No newline at end of file
+ - Allow 'manucheckp' to notify when superperms reports false but it is really negated.
+ - Only output a Data update message if something has changed. \ No newline at end of file
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
index 5f357641a..61bb41dd1 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/GroupManager.java
@@ -324,8 +324,8 @@ public class GroupManager extends JavaPlugin {
public void run() {
try {
- worldsHolder.saveChanges(false);
- GroupManager.logger.log(Level.INFO, " Data files refreshed.");
+ if (worldsHolder.saveChanges(false))
+ GroupManager.logger.log(Level.INFO, " Data files refreshed.");
} catch (IllegalStateException ex) {
GroupManager.logger.log(Level.WARNING, ex.getMessage());
}
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
index 27a7d9a59..f9735c282 100644
--- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
+++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java
@@ -264,8 +264,9 @@ public class WorldsHolder {
/**
*
*/
- public void saveChanges(boolean overwrite) {
+ public boolean saveChanges(boolean overwrite) {
+ boolean changed = false;
ArrayList<WorldDataHolder> alreadyDone = new ArrayList<WorldDataHolder>();
Tasks.removeOldFiles(plugin, plugin.getBackupFolder());
@@ -294,6 +295,7 @@ public class WorldsHolder {
backupFile(w, true);
WorldDataHolder.writeGroups(w, w.getGroupsFile());
+ changed = true;
//w.removeGroupsChangedFlag();
} else {
// Newer file found.
@@ -307,6 +309,7 @@ public class WorldsHolder {
// Backup Groups file
backupFile(w, true);
w.reloadGroups();
+ changed = true;
}
}
if (!mirrorsUser.containsKey(w.getName().toLowerCase()))
@@ -316,6 +319,7 @@ public class WorldsHolder {
backupFile(w, false);
WorldDataHolder.writeUsers(w, w.getUsersFile());
+ changed = true;
//w.removeUsersChangedFlag();
} else {
// Newer file found.
@@ -329,10 +333,12 @@ public class WorldsHolder {
// Backup Users file
backupFile(w, false);
w.reloadUsers();
+ changed = true;
}
}
alreadyDone.add(w);
}
+ return changed;
}
/**