mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-02 13:31:54 +01:00
Fix for file date conflict causing memory data to be wiped.
This commit is contained in:
parent
e7234e621d
commit
1c7e0e5b9f
@ -324,8 +324,12 @@ public class WorldDataHolder {
|
||||
public void reloadGroups() {
|
||||
GroupManager.setLoaded(false);
|
||||
try {
|
||||
resetGroups();
|
||||
loadGroups(this, getGroupsFile());
|
||||
// temporary holder in case the load fails.
|
||||
WorldDataHolder ph = new WorldDataHolder(this.getName());
|
||||
loadGroups(ph, getGroupsFile());
|
||||
this.groups = ph.getGroups();
|
||||
this.removeGroupsChangedFlag();
|
||||
this.timeStampGroups = ph.getTimeStampGroups();
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(WorldDataHolder.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
@ -335,8 +339,12 @@ public class WorldDataHolder {
|
||||
public void reloadUsers() {
|
||||
GroupManager.setLoaded(false);
|
||||
try {
|
||||
resetUsers();
|
||||
loadUsers(this, getUsersFile());
|
||||
// temporary holder in case the load fails.
|
||||
WorldDataHolder ph = new WorldDataHolder(this.getName());
|
||||
loadUsers(ph, getUsersFile());
|
||||
this.users = ph.getUsers();
|
||||
this.removeUsersChangedFlag();
|
||||
this.timeStampUsers = ph.getTimeStampUsers();
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(WorldDataHolder.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
@ -523,29 +531,6 @@ public class WorldDataHolder {
|
||||
return ph;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the WorldDataHolder from the files
|
||||
*
|
||||
* @param ph
|
||||
* @param groupsFile
|
||||
* @param usersFile
|
||||
*
|
||||
* @throws FileNotFoundException
|
||||
* @throws IOException
|
||||
*/
|
||||
public static WorldDataHolder Update(WorldDataHolder ph, File groupsFile, File usersFile) throws FileNotFoundException, IOException {
|
||||
|
||||
GroupManager.setLoaded(false);
|
||||
ph.resetGroups();
|
||||
loadGroups(ph, groupsFile);
|
||||
|
||||
ph.resetUsers();
|
||||
loadUsers(ph, usersFile);
|
||||
GroupManager.setLoaded(true);
|
||||
|
||||
return ph;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the WorldDataHolder from the Groups file
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user