From 371a6437aecf7fea59a3ba19060bb8454aa59f41 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 20 Dec 2012 19:50:59 +0000 Subject: Redundant tpaccept cost check. --- .../src/com/earth2me/essentials/commands/Commandtpaccept.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index 865492921..f15935053 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -52,14 +52,6 @@ public class Commandtpaccept extends EssentialsCommand } final Trade charge = new Trade(this.getName(), ess); - if (user.isTpRequestHere()) - { - charge.isAffordableFor(user); - } - else - { - charge.isAffordableFor(target); - } user.sendMessage(_("requestAccepted")); target.sendMessage(_("requestAcceptedFrom", user.getDisplayName())); -- cgit v1.2.3 From 10b972bd079fcdfc60d861d92cb20252c1089541 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 20 Dec 2012 20:01:43 +0000 Subject: Warn other party when teleport fails after tpaccept. --- .../earth2me/essentials/commands/Commandtpaccept.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java index f15935053..7c950ae96 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.ChargeException; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; @@ -55,13 +56,21 @@ public class Commandtpaccept extends EssentialsCommand user.sendMessage(_("requestAccepted")); target.sendMessage(_("requestAcceptedFrom", user.getDisplayName())); - if (user.isTpRequestHere()) + try { - target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND); + if (user.isTpRequestHere()) + { + target.getTeleport().teleportToMe(user, charge, TeleportCause.COMMAND); + } + else + { + target.getTeleport().teleport(user, charge, TeleportCause.COMMAND); + } } - else + catch (ChargeException ex) { - target.getTeleport().teleport(user, charge, TeleportCause.COMMAND); + user.sendMessage(_("pendingTeleportCancelled")); + ess.showError(target, ex, commandLabel); } user.requestTeleport(null, false); throw new NoChargeException(); -- cgit v1.2.3 From ce7812502885b10baab019859dfe9a672c540efe Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 20 Dec 2012 20:37:04 +0000 Subject: Add a little bit of extra information to /seen, this will show when user is online. --- .../com/earth2me/essentials/commands/Commandseen.java | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 24f1f9c41..fc5a1f033 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -35,12 +35,23 @@ public class Commandseen extends EssentialsCommand } try { - User player = getPlayer(server, args, 0); - player.setDisplayNick(); - sender.sendMessage(_("seenOnline", player.getDisplayName(), Util.formatDateDiff(player.getLastLogin()))); + User user = getPlayer(server, args, 0); + user.setDisplayNick(); + sender.sendMessage(_("seenOnline", user.getDisplayName(), Util.formatDateDiff(user.getLastLogin()))); + sender.sendMessage(_("whoisAFK", (user.isAfk() ? _("true") : _("false")))); + sender.sendMessage(_("whoisJail", (user.isJailed() + ? user.getJailTimeout() > 0 + ? Util.formatDateDiff(user.getJailTimeout()) + : _("true") + : _("false")))); + sender.sendMessage(_("whoisMuted", (user.isMuted() + ? user.getMuteTimeout() > 0 + ? Util.formatDateDiff(user.getMuteTimeout()) + : _("true") + : _("false")))); if (extra) { - sender.sendMessage(_("whoisIPAddress", player.getAddress().getAddress().toString())); + sender.sendMessage(_("whoisIPAddress", user.getAddress().getAddress().toString())); } } catch (NoSuchFieldException e) -- cgit v1.2.3