diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 6e9ffdf82..a8149e773 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -453,6 +453,10 @@ public class User extends UserData implements Comparable, IReplyTo, IUser public void setHidden(final boolean hidden) { this.hidden = hidden; + if (hidden == true) + { + setLastLogout(getLastOnlineActivity()); + } } //Returns true if status expired during this check diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index a8c3bc8cc..75f04da33 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; +import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.command.CommandSender; @@ -17,16 +18,16 @@ public class Commandseen extends EssentialsCommand @Override protected void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception { - seen(server, sender, args, true); + seen(server, sender, args, true, true); } @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { - seen(server, user, args, user.isAuthorized("essentials.seen.banreason")); + seen(server, user, args, user.isAuthorized("essentials.seen.banreason"), user.isAuthorized("essentials.seen.extra")); } - protected void seen(final Server server, final CommandSender sender, final String[] args, final boolean show) throws Exception + protected void seen(final Server server, final CommandSender sender, final String[] args, final boolean showBan, final boolean extra) throws Exception { if (args.length < 1) { @@ -37,6 +38,10 @@ public class Commandseen extends EssentialsCommand User player = getPlayer(server, args, 0); player.setDisplayNick(); sender.sendMessage(_("seenOnline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogin()))); + if (extra) + { + sender.sendMessage(_("whoisIPAddress", player.getAddress().getAddress().toString())); + } } catch (NoSuchFieldException e) { @@ -49,7 +54,13 @@ public class Commandseen extends EssentialsCommand sender.sendMessage(_("seenOffline", player.getName(), Util.formatDateDiff(player.getLastLogout()))); if (player.isBanned()) { - sender.sendMessage(_("whoisBanned", show ? player.getBanReason() : _("true"))); + sender.sendMessage(_("whoisBanned", showBan ? player.getBanReason() : _("true"))); + } + if (extra) + { + sender.sendMessage(_("whoisIPAddress", player.getLastLoginAddress())); + final Location loc = player.getLastLocation(); + sender.sendMessage(_("whoisLocation", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); } } }