Fixed formatting!

This commit is contained in:
TfT_02 2014-07-23 23:35:05 +02:00
parent bab99babcc
commit e459eaa547
4 changed files with 11 additions and 14 deletions

View File

@ -124,7 +124,7 @@ public interface DatabaseManager {
public boolean saveUserUUID(String userName, UUID uuid); public boolean saveUserUUID(String userName, UUID uuid);
public boolean saveUserUUIDs(Map<String, UUID> user_info); public boolean saveUserUUIDs(Map<String, UUID> fetchedUUIDs);
/** /**
* Retrieve the type of database in use. Custom databases should return CUSTOM. * Retrieve the type of database in use. Custom databases should return CUSTOM.

View File

@ -542,8 +542,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
return worked; return worked;
} }
public boolean saveUserUUIDs(Map<String, UUID> user_data) { public boolean saveUserUUIDs(Map<String, UUID> fetchedUUIDs) {
BufferedReader in = null; BufferedReader in = null;
FileWriter out = null; FileWriter out = null;
String usersFilePath = mcMMO.getUsersFilePath(); String usersFilePath = mcMMO.getUsersFilePath();
@ -554,16 +553,16 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
StringBuilder writer = new StringBuilder(); StringBuilder writer = new StringBuilder();
String line; String line;
while (((line = in.readLine()) != null) && !user_data.isEmpty()) { while (((line = in.readLine()) != null) && !fetchedUUIDs.isEmpty()) {
String[] character = line.split(":"); String[] character = line.split(":");
if (user_data.containsKey(character[0])) { if (fetchedUUIDs.containsKey(character[0])) {
if (character.length < 42) { if (character.length < 42) {
mcMMO.p.getLogger().severe("Could not update UUID for " + character[0] + "!"); mcMMO.p.getLogger().severe("Could not update UUID for " + character[0] + "!");
mcMMO.p.getLogger().severe("Database entry is invalid."); mcMMO.p.getLogger().severe("Database entry is invalid.");
return false; return false;
} }
line = line.replace(character[41], user_data.remove(character[0]).toString()); line = line.replace(character[41], fetchedUUIDs.remove(character[0]).toString());
} }
writer.append(line).append("\r\n"); writer.append(line).append("\r\n");

View File

@ -621,7 +621,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
// Problem, nothing was returned // Problem, nothing was returned
} }
public boolean saveUserUUIDs(Map<String,UUID> player_info) { public boolean saveUserUUIDs(Map<String, UUID> fetchedUUIDs) {
if (!checkConnected()) { if (!checkConnected()) {
// return false // return false
return false; return false;
@ -633,7 +633,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
try { try {
statement = connection.prepareStatement("UPDATE " + tablePrefix + "users SET uuid = ? WHERE user = ?"); statement = connection.prepareStatement("UPDATE " + tablePrefix + "users SET uuid = ? WHERE user = ?");
for (Map.Entry<String,UUID> entry : player_info.entrySet()) { for (Map.Entry<String, UUID> entry : fetchedUUIDs.entrySet()) {
statement.setString(1, entry.getValue().toString()); statement.setString(1, entry.getValue().toString());
statement.setString(2, entry.getKey()); statement.setString(2, entry.getKey());

View File

@ -59,9 +59,7 @@ public class UUIDUpdateAsyncTask extends BukkitRunnable {
} }
checkedUsers += userNamesSection.size(); checkedUsers += userNamesSection.size();
userNamesSection.clear(); userNamesSection.clear();
size = userNames.size(); size = userNames.size();
Misc.printProgress(checkedUsers, DatabaseManager.progressInterval, startMillis); Misc.printProgress(checkedUsers, DatabaseManager.progressInterval, startMillis);