From 549ae3441f01bc6a2f7ade1c238779c3f805a39e Mon Sep 17 00:00:00 2001 From: ryanhamshire Date: Thu, 9 Oct 2014 15:05:50 -0700 Subject: [PATCH] Now UUID-migrating players with $ and _ names. Players with names starting with these special characters will now be migrated. --- .../GriefPrevention/DatabaseDataStore.java | 22 +------------ .../GriefPrevention/FlatFileDataStore.java | 33 ++----------------- 2 files changed, 4 insertions(+), 51 deletions(-) diff --git a/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java b/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java index b303442..199ca8a 100644 --- a/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java +++ b/src/me/ryanhamshire/GriefPrevention/DatabaseDataStore.java @@ -153,9 +153,6 @@ public class DatabaseDataStore extends DataStore //get the id String playerName = results.getString("name"); - //ignore groups - if(playerName.startsWith("$")) continue; - //add to list of names to convert to UUID namesToConvert.add(playerName); } @@ -181,9 +178,6 @@ public class DatabaseDataStore extends DataStore //get the id String playerName = results.getString("name"); - //ignore groups - if(playerName.startsWith("$")) continue; - //try to convert player name to UUID try { @@ -302,21 +296,7 @@ public class DatabaseDataStore extends DataStore Claim topLevelClaim = new Claim(lesserBoundaryCorner, greaterBoundaryCorner, ownerID, builderNames, containerNames, accessorNames, managerNames, claimID); - //search for another claim overlapping this one - Claim conflictClaim = this.getClaimAt(topLevelClaim.lesserBoundaryCorner, true, null); - - //if there is such a claim, mark it for later removal - if(conflictClaim != null) - { - claimsToRemove.add(conflictClaim); - continue; - } - - //otherwise, add this claim to the claims collection - else - { - this.addClaim(topLevelClaim, false); - } + this.addClaim(topLevelClaim, false); //look for any subdivisions for this claim Statement statement2 = this.databaseConnection.createStatement(); diff --git a/src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java b/src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java index 34e2147..5f64345 100644 --- a/src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java +++ b/src/me/ryanhamshire/GriefPrevention/FlatFileDataStore.java @@ -157,9 +157,7 @@ public class FlatFileDataStore extends DataStore //rename files for(File playerFile : files) { - //anything starting with an underscore or dollar sign isn't a player, ignore those String currentFilename = playerFile.getName(); - if(currentFilename.startsWith("$") || currentFilename.startsWith("_")) continue; //try to convert player name to UUID UUID playerID = null; @@ -172,17 +170,8 @@ public class FlatFileDataStore extends DataStore { playerFile.renameTo(new File(playerDataFolder, playerID.toString())); } - - //otherwise hide it from the data store for the future - else - { - playerFile.renameTo(new File(playerDataFolder, "__" + currentFilename)); - } - } - catch(Exception ex) - { - playerFile.renameTo(new File(playerDataFolder, "__" + currentFilename)); } + catch(Exception ex){ } } } @@ -312,24 +301,8 @@ public class FlatFileDataStore extends DataStore //instantiate topLevelClaim = new Claim(lesserBoundaryCorner, greaterBoundaryCorner, ownerID, builderNames, containerNames, accessorNames, managerNames, claimID); - //search for another claim overlapping this one - Claim conflictClaim = this.getClaimAt(topLevelClaim.lesserBoundaryCorner, true, null); - - //if there is such a claim, delete this file and move on to the next - if(conflictClaim != null) - { - inStream.close(); - files[i].delete(); - line = null; - continue; - } - - //otherwise, add this claim to the claims collection - else - { - topLevelClaim.modifiedDate = new Date(files[i].lastModified()); - this.addClaim(topLevelClaim, false); - } + topLevelClaim.modifiedDate = new Date(files[i].lastModified()); + this.addClaim(topLevelClaim, false); } //otherwise there's already a top level claim, so this must be a subdivision of that top level claim