mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 04:02:10 +01:00
update realName
This commit is contained in:
parent
50b41effa6
commit
c1ffe47468
@ -588,6 +588,18 @@ public class AdminCommand implements CommandExecutor {
|
||||
} catch (Exception e) {
|
||||
sender.sendMessage("An error occured while trying to get that player!");
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("resetname")) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
List<PlayerAuth> auths = plugin.database.getAllAuths();
|
||||
for (PlayerAuth auth : auths) {
|
||||
auth.setRealName("Player");
|
||||
plugin.database.updateSession(auth);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
sender.sendMessage("Usage: /authme reload|register playername password|changepassword playername password|unregister playername");
|
||||
}
|
||||
|
@ -70,6 +70,7 @@ public class CacheDataSource implements DataSource {
|
||||
if (cache.containsKey(auth.getNickname())) {
|
||||
cache.get(auth.getNickname()).setIp(auth.getIp());
|
||||
cache.get(auth.getNickname()).setLastLogin(auth.getLastLogin());
|
||||
cache.get(auth.getNickname()).setRealName(auth.getRealName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -517,10 +517,11 @@ public class MySQL implements DataSource {
|
||||
PreparedStatement pst = null;
|
||||
try {
|
||||
con = makeSureConnectionIsReady();
|
||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnIp + "=?, " + columnLastLogin + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||
pst = con.prepareStatement("UPDATE " + tableName + " SET " + columnIp + "=?, " + columnLastLogin + "=?, " + columnRealName + "=? WHERE LOWER(" + columnName + ")=?;");
|
||||
pst.setString(1, auth.getIp());
|
||||
pst.setLong(2, auth.getLastLogin());
|
||||
pst.setString(3, auth.getNickname());
|
||||
pst.setString(3, auth.getRealName());
|
||||
pst.setString(4, auth.getNickname());
|
||||
pst.executeUpdate();
|
||||
} catch (SQLException ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user