diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-09-03 16:13:43 +0100 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-09-03 16:13:43 +0100 |
commit | e3756623a1531241b40084c0aa9a8e4b4e8cda31 (patch) | |
tree | 14fa17cb72c2868b180b215ccb2b7742626cc477 /EssentialsGroupManager/src | |
parent | 8f28073b29a99c46ed3782784cc928c54addcb26 (diff) | |
download | Essentials-e3756623a1531241b40084c0aa9a8e4b4e8cda31.tar Essentials-e3756623a1531241b40084c0aa9a8e4b4e8cda31.tar.gz Essentials-e3756623a1531241b40084c0aa9a8e4b4e8cda31.tar.lz Essentials-e3756623a1531241b40084c0aa9a8e4b4e8cda31.tar.xz Essentials-e3756623a1531241b40084c0aa9a8e4b4e8cda31.zip |
- Fix for Users.yml containing only 'users:' causing a crash.
- GroupManager will now generate a fresh Users and Groups yml if either
file is empty.
Diffstat (limited to 'EssentialsGroupManager/src')
4 files changed, 11 insertions, 4 deletions
diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 401d762f1..2879a9d33 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -5,4 +5,6 @@ v 1.1: - Added SuperPerms support so GM will update and provide the permissions to plugins which only support Bukkit Perms.
- Added more helpful output to errors on argument lengths.
- GroupManager will now attempt to select the default world when using commands instead of failing and telling you to use '/manselect <world>'.
- - Invalid groups assigned to players in users.yml will no longer cause a crash. GM will now set them to the default group instead.
\ No newline at end of file + - Invalid groups assigned to players in users.yml will no longer cause a crash. GM will now set them to the default group instead.
+ - Fix for Users.yml containing only 'users:' causing a crash.
+ - GroupManager will now generate a fresh Users and Groups yml if either file is empty.
\ No newline at end of file diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java index ae68e03cc..77d933fa0 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/WorldDataHolder.java @@ -578,6 +578,11 @@ public class WorldDataHolder { // PROCESS USERS FILE Map<String, Object> allUsersNode = (Map<String, Object>) usersRootDataNode.get("users"); + + // Stop loading if the file is empty + if (allUsersNode == null) + return ph; + for (String usersKey : allUsersNode.keySet()) { Map<String, Object> thisUserNode = (Map<String, Object>) allUsersNode.get(usersKey); User thisUser = ph.createUser(usersKey); diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java index b4d50b431..a2c34be16 100755..100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/dataholder/worlds/WorldsHolder.java @@ -265,7 +265,7 @@ public class WorldsHolder { File groupsFile = new File(defaultWorldFolder, "groups.yml"); File usersFile = new File(defaultWorldFolder, "users.yml"); File oldDataFile = new File(plugin.getDataFolder(), "data.yml"); - if (!groupsFile.exists()) { + if (!groupsFile.exists() || groupsFile.length() == 0) { if (oldDataFile.exists()) { try { Tasks.copy(oldDataFile, groupsFile); @@ -281,7 +281,7 @@ public class WorldsHolder { } } } - if (!usersFile.exists()) { + if (!usersFile.exists() || usersFile.length() == 0) { if (oldDataFile.exists()) { try { Tasks.copy(oldDataFile, usersFile); diff --git a/EssentialsGroupManager/src/plugin.yml b/EssentialsGroupManager/src/plugin.yml index ace9701cd..6863df1de 100644 --- a/EssentialsGroupManager/src/plugin.yml +++ b/EssentialsGroupManager/src/plugin.yml @@ -1,5 +1,5 @@ name: GroupManager -version: "1.1" +version: "1.1 (Phoenix)" main: org.anjocaido.groupmanager.GroupManager website: http://www.anjocaido.info/ description: Provides on-the-fly system for Permission system created by Nijikokun. But all in memory, and with flat-file saving schedule. |