Now UUID-migrating players with $ and _ names.

Players with names starting with these special characters will now be
migrated.
This commit is contained in:
ryanhamshire 2014-10-09 15:05:50 -07:00
parent 7c1b4ca32a
commit 549ae3441f
2 changed files with 4 additions and 51 deletions

View File

@ -153,9 +153,6 @@ public class DatabaseDataStore extends DataStore
//get the id //get the id
String playerName = results.getString("name"); String playerName = results.getString("name");
//ignore groups
if(playerName.startsWith("$")) continue;
//add to list of names to convert to UUID //add to list of names to convert to UUID
namesToConvert.add(playerName); namesToConvert.add(playerName);
} }
@ -181,9 +178,6 @@ public class DatabaseDataStore extends DataStore
//get the id //get the id
String playerName = results.getString("name"); String playerName = results.getString("name");
//ignore groups
if(playerName.startsWith("$")) continue;
//try to convert player name to UUID //try to convert player name to UUID
try try
{ {
@ -302,21 +296,7 @@ public class DatabaseDataStore extends DataStore
Claim topLevelClaim = new Claim(lesserBoundaryCorner, greaterBoundaryCorner, ownerID, builderNames, containerNames, accessorNames, managerNames, claimID); 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 //look for any subdivisions for this claim
Statement statement2 = this.databaseConnection.createStatement(); Statement statement2 = this.databaseConnection.createStatement();

View File

@ -157,9 +157,7 @@ public class FlatFileDataStore extends DataStore
//rename files //rename files
for(File playerFile : files) for(File playerFile : files)
{ {
//anything starting with an underscore or dollar sign isn't a player, ignore those
String currentFilename = playerFile.getName(); String currentFilename = playerFile.getName();
if(currentFilename.startsWith("$") || currentFilename.startsWith("_")) continue;
//try to convert player name to UUID //try to convert player name to UUID
UUID playerID = null; UUID playerID = null;
@ -172,17 +170,8 @@ public class FlatFileDataStore extends DataStore
{ {
playerFile.renameTo(new File(playerDataFolder, playerID.toString())); 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,25 +301,9 @@ public class FlatFileDataStore extends DataStore
//instantiate //instantiate
topLevelClaim = new Claim(lesserBoundaryCorner, greaterBoundaryCorner, ownerID, builderNames, containerNames, accessorNames, managerNames, claimID); 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()); topLevelClaim.modifiedDate = new Date(files[i].lastModified());
this.addClaim(topLevelClaim, false); this.addClaim(topLevelClaim, false);
} }
}
//otherwise there's already a top level claim, so this must be a subdivision of that top level claim //otherwise there's already a top level claim, so this must be a subdivision of that top level claim
else else