mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Update player name in case it has changed.
TODO: Check for double names if that happens? In general?
This commit is contained in:
parent
7d0fd36a2a
commit
d02058ca13
@ -481,9 +481,21 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
|
|
||||||
if (result.next()) {
|
if (result.next()) {
|
||||||
try {
|
try {
|
||||||
PlayerProfile ret = loadFromResult(playerName, result);
|
PlayerProfile profile = loadFromResult(playerName, result);
|
||||||
result.close();
|
result.close();
|
||||||
return ret;
|
|
||||||
|
if (!playerName.isEmpty() && !profile.getPlayerName().isEmpty()) {
|
||||||
|
statement = connection.prepareStatement(
|
||||||
|
"UPDATE `" + tablePrefix + "users` "
|
||||||
|
+ "SET user = ? "
|
||||||
|
+ "WHERE UUID = ?");
|
||||||
|
statement.setString(1, playerName);
|
||||||
|
statement.setString(2, uuid);
|
||||||
|
result = statement.executeQuery();
|
||||||
|
result.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
return profile;
|
||||||
}
|
}
|
||||||
catch (SQLException e) {
|
catch (SQLException e) {
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user