From 8669582e8f312cf7b765713e72df42fa48b0cfd3 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 8 Mar 2012 18:00:43 -0800 Subject: [PATCH] PTP exploit fix --- Changelog.txt | 1 + .../com/gmail/nossr50/commands/party/PtpCommand.java | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index 6fe4cf712..14ac51856 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -18,6 +18,7 @@ Version 2.0.00-dev = Fixed issue where every block broken had a mining check applied = Fixed issue where every block broken had a herbalism check applied = Fixed issue where blocks weren't being removed from the watchlist + = Fixed exploit where you could use /ptp to teleport to anyone ! Changed inspect failed message to say inspect rather than whois ! Changed Call of the Wild to activate on left-click rather than right-click ! Changed Blast Mining to track based on Entity ID vs. Location diff --git a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java index bb8e50692..138fdc8ee 100644 --- a/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java @@ -34,10 +34,17 @@ public class PtpCommand implements CommandExecutor { player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission")); return true; } + + if(PP.getParty() == null || PP.getParty() == "") + { + player.sendMessage(ChatColor.RED+"You are not in a party!"); + return true; + } if (args.length < 1) { player.sendMessage(ChatColor.RED + "Usage is /ptp "); return true; } + if (plugin.getServer().getPlayer(args[0]) == null) { player.sendMessage("That is not a valid player"); } @@ -49,6 +56,8 @@ public class PtpCommand implements CommandExecutor { player.teleport(target); player.sendMessage(ChatColor.GREEN + "You have teleported to " + target.getName()); target.sendMessage(ChatColor.GREEN + player.getName() + " has teleported to you."); + } else { + player.sendMessage(ChatColor.RED + "That player is in a different party than you."); } }