mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Add Debug and change a line
This commit is contained in:
parent
d9aacfa059
commit
981523789e
@ -572,6 +572,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
public boolean saveUserUUID(String userName, UUID uuid) {
|
public boolean saveUserUUID(String userName, UUID uuid) {
|
||||||
boolean worked = false;
|
boolean worked = false;
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
BufferedReader in = null;
|
BufferedReader in = null;
|
||||||
FileWriter out = null;
|
FileWriter out = null;
|
||||||
String usersFilePath = mcMMO.getUsersFilePath();
|
String usersFilePath = mcMMO.getUsersFilePath();
|
||||||
@ -588,13 +589,14 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
if (character.length < 42) {
|
if (character.length < 42) {
|
||||||
mcMMO.p.getLogger().severe("Could not update UUID for " + userName + "!");
|
mcMMO.p.getLogger().severe("Could not update UUID for " + userName + "!");
|
||||||
mcMMO.p.getLogger().severe("Database entry is invalid.");
|
mcMMO.p.getLogger().severe("Database entry is invalid.");
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
line = line.replace(character[41], uuid.toString());
|
line = line.replace(character[41], uuid.toString());
|
||||||
worked = true;
|
worked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
writer.append(line).append("\r\n");
|
writer.append(line).append("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,6 +607,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString());
|
mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString());
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
mcMMO.p.getLogger().info(i + " entries written while saving UUID for " + userName);
|
||||||
if (in != null) {
|
if (in != null) {
|
||||||
try {
|
try {
|
||||||
in.close();
|
in.close();
|
||||||
@ -631,6 +634,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
BufferedReader in = null;
|
BufferedReader in = null;
|
||||||
FileWriter out = null;
|
FileWriter out = null;
|
||||||
String usersFilePath = mcMMO.getUsersFilePath();
|
String usersFilePath = mcMMO.getUsersFilePath();
|
||||||
|
int i = 0;
|
||||||
|
|
||||||
synchronized (fileWritingLock) {
|
synchronized (fileWritingLock) {
|
||||||
try {
|
try {
|
||||||
@ -651,6 +655,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
line = new StringBuilder(org.apache.commons.lang.StringUtils.join(character, ":")).append(":").toString();
|
line = new StringBuilder(org.apache.commons.lang.StringUtils.join(character, ":")).append(":").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
writer.append(line).append("\r\n");
|
writer.append(line).append("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -661,6 +666,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
|||||||
mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString());
|
mcMMO.p.getLogger().severe("Exception while reading " + usersFilePath + " (Are you sure you formatted it correctly?)" + e.toString());
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
mcMMO.p.getLogger().info(i + " entries written while saving UUID batch");
|
||||||
if (in != null) {
|
if (in != null) {
|
||||||
try {
|
try {
|
||||||
in.close();
|
in.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user