mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-03 18:43:43 +01:00 
			
		
		
		
	Add another error message if mcMMO finds something unexpected in the database
This commit is contained in:
		@@ -310,16 +310,15 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
 | 
				
			|||||||
                boolean wroteUser = false;
 | 
					                boolean wroteUser = false;
 | 
				
			||||||
                // While not at the end of the file
 | 
					                // While not at the end of the file
 | 
				
			||||||
                while ((line = in.readLine()) != null) {
 | 
					                while ((line = in.readLine()) != null) {
 | 
				
			||||||
                    boolean goodData = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    //Check for incomplete or corrupted data
 | 
					                    //Check for incomplete or corrupted data
 | 
				
			||||||
                    if(!line.contains(":"))
 | 
					                    if(!line.contains(":")) {
 | 
				
			||||||
 | 
					                        mcMMO.p.getLogger().severe("mcMMO found some unexpected data in mcmmo.users and is removing it");
 | 
				
			||||||
                        continue;
 | 
					                        continue;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    String[] splitData = line.split(":");
 | 
					                    String[] splitData = line.split(":");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    //This would be rare, but check the splitData for having enough entries to contain a username
 | 
					                    //This would be rare, but check the splitData for having enough entries to contain a username
 | 
				
			||||||
 | 
					 | 
				
			||||||
                    if(splitData.length < USERNAME_INDEX) { //UUID have been in mcMMO DB for a very long time so any user without
 | 
					                    if(splitData.length < USERNAME_INDEX) { //UUID have been in mcMMO DB for a very long time so any user without
 | 
				
			||||||
                        //Something is wrong if we don't have enough split data to have an entry for a username
 | 
					                        //Something is wrong if we don't have enough split data to have an entry for a username
 | 
				
			||||||
                        mcMMO.p.getLogger().severe("mcMMO found some corrupted data in mcmmo.users and is removing it.");
 | 
					                        mcMMO.p.getLogger().severe("mcMMO found some corrupted data in mcmmo.users and is removing it.");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user