Remove HudType from Flatfile records.

This commit is contained in:
GJ 2013-09-18 11:54:23 -04:00
parent 15f5dcf860
commit a8e23e08ee

View File

@ -593,18 +593,30 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
continue;
}
if (character.length < 33) {
// Before Version 1.0 - Drop
mcMMO.p.getLogger().warning("Dropping malformed or before version 1.0 line from database - " + line);
continue;
}
String oldVersion = null;
if (!character[33].isEmpty()) {
// Removal of Spout Support
// Version 1.4.07-dev2
// commit 7bac0e2ca5143bce84dc160617fed97f0b1cb968
line = line.replace(character[33], "");
oldVersion = "1.4.07";
}
// If they're valid, rewrite them to the file.
if (character.length > 38) {
writer.append(line).append("\r\n");
continue;
}
else if (character.length < 33) {
// Before Version 1.0 - Drop
mcMMO.p.getLogger().warning("Dropping malformed or before version 1.0 line from database - " + line);
}
else {
String oldVersion = null;
StringBuilder newLine = new StringBuilder(line);
boolean announce = false;
if (character.length <= 33) {
// Introduction of HUDType
// Version 1.1.06
@ -637,7 +649,6 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
// commmit 3f6c07ba6aaf44e388cc3b882cac3d8f51d0ac28
// XXX Cannot create an OfflinePlayer at startup, use 0 and fix in purge
newLine.append("0").append(":");
announce = true; // TODO move this down
if (oldVersion == null) {
oldVersion = "1.4.00";
}
@ -652,12 +663,12 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
}
}
if (announce) {
if (oldVersion != null) {
mcMMO.p.debug("Updating database line for player " + character[0] + " from before version " + oldVersion);
}
writer.append(newLine).append("\r\n");
}
}
// Write the new file
out = new FileWriter(usersFilePath);