mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-05 14:18:21 +02:00
Fix for file date conflict causing memory data to be wiped.
This commit is contained in:
@@ -324,8 +324,12 @@ public class WorldDataHolder {
|
|||||||
public void reloadGroups() {
|
public void reloadGroups() {
|
||||||
GroupManager.setLoaded(false);
|
GroupManager.setLoaded(false);
|
||||||
try {
|
try {
|
||||||
resetGroups();
|
// temporary holder in case the load fails.
|
||||||
loadGroups(this, getGroupsFile());
|
WorldDataHolder ph = new WorldDataHolder(this.getName());
|
||||||
|
loadGroups(ph, getGroupsFile());
|
||||||
|
this.groups = ph.getGroups();
|
||||||
|
this.removeGroupsChangedFlag();
|
||||||
|
this.timeStampGroups = ph.getTimeStampGroups();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger(WorldDataHolder.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(WorldDataHolder.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
@@ -335,8 +339,12 @@ public class WorldDataHolder {
|
|||||||
public void reloadUsers() {
|
public void reloadUsers() {
|
||||||
GroupManager.setLoaded(false);
|
GroupManager.setLoaded(false);
|
||||||
try {
|
try {
|
||||||
resetUsers();
|
// temporary holder in case the load fails.
|
||||||
loadUsers(this, getUsersFile());
|
WorldDataHolder ph = new WorldDataHolder(this.getName());
|
||||||
|
loadUsers(ph, getUsersFile());
|
||||||
|
this.users = ph.getUsers();
|
||||||
|
this.removeUsersChangedFlag();
|
||||||
|
this.timeStampUsers = ph.getTimeStampUsers();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger(WorldDataHolder.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(WorldDataHolder.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
@@ -523,29 +531,6 @@ public class WorldDataHolder {
|
|||||||
return ph;
|
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
|
* Updates the WorldDataHolder from the Groups file
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user