diff --git a/src/de/steamwar/bungeecore/commands/WhoisCommand.java b/src/de/steamwar/bungeecore/commands/WhoisCommand.java index c3b6f8d..5bd83d6 100644 --- a/src/de/steamwar/bungeecore/commands/WhoisCommand.java +++ b/src/de/steamwar/bungeecore/commands/WhoisCommand.java @@ -64,6 +64,7 @@ public class WhoisCommand extends BasicCommand { BungeeCore.send(player, "§7Username§8: §e" + user.getUserName()); BungeeCore.send(player, "§7UUID§8: §e" + user.getUuid().toString(), "", new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, user.getUuid().toString())); BungeeCore.send(player, "§7ID§8: §e" + user.getId()); + BungeeCore.send(player, "§7Beigetreten am§8: §e" + user.getFirstjoin().toString()); BungeeCore.send(player, "§7Online Time§8: §e" + new DecimalFormat("###.##").format(user.getOnlinetime() / (double) 3600) + "h"); Team team = Team.get(user.getTeam()); diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index 86bc27c..43d2398 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -244,4 +244,14 @@ public class SteamwarUser { } return 0; } + + public Timestamp getFirstjoin() { + ResultSet set = SQL.select("SELECT MIN(StartTime) AS FirstJoin FROM Session WHERE UserID = ?", id); + try { + set.next(); + return set.getTimestamp("FirstJoin"); + } catch (SQLException throwables) { + throw new SecurityException("Could not load First Join"); + } + } }