mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Move orphan-handling code down to bottom
This commit is contained in:
parent
43f8f7b76e
commit
f63c5e3310
@ -353,8 +353,23 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
}
|
}
|
||||||
catch (SQLException e) {}
|
catch (SQLException e) {}
|
||||||
}
|
}
|
||||||
// Problem, no rows returned
|
|
||||||
result.close();
|
result.close();
|
||||||
|
}
|
||||||
|
catch (SQLException ex) {
|
||||||
|
printErrors(ex);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
if (statement != null) {
|
||||||
|
try {
|
||||||
|
statement.close();
|
||||||
|
}
|
||||||
|
catch (SQLException e) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Problem, nothing was returned
|
||||||
|
|
||||||
// First, read User Id - this is to check for orphans
|
// First, read User Id - this is to check for orphans
|
||||||
|
|
||||||
@ -375,28 +390,6 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
// Retry, and abort on re-failure
|
// Retry, and abort on re-failure
|
||||||
return loadPlayerProfile(playerName, false);
|
return loadPlayerProfile(playerName, false);
|
||||||
}
|
}
|
||||||
catch (SQLException ex) {
|
|
||||||
printErrors(ex);
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
if (statement != null) {
|
|
||||||
try {
|
|
||||||
statement.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e) {
|
|
||||||
// Ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!create) {
|
|
||||||
return new PlayerProfile(playerName, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
newUser(playerName);
|
|
||||||
|
|
||||||
return new PlayerProfile(playerName, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void convertUsers(DatabaseManager destination) {
|
public void convertUsers(DatabaseManager destination) {
|
||||||
PreparedStatement statement = null;
|
PreparedStatement statement = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user