mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 08:56:29 +00:00
Fixed exploit that allows command blocker to be bypassed.
This commit is contained in:
parent
f635af5f95
commit
3ccab5f534
3 changed files with 23 additions and 2 deletions
|
@ -3,6 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
|
|||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_CommandBlocker;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Log;
|
||||
import net.minecraft.util.org.apache.commons.lang3.ArrayUtils;
|
||||
import net.minecraft.util.org.apache.commons.lang3.StringUtils;
|
||||
|
@ -44,6 +45,11 @@ public class Command_cbtool extends TFM_Command
|
|||
}
|
||||
matcher.appendTail(generatedCommand);
|
||||
|
||||
if (TFM_CommandBlocker.isCommandBlocked(generatedCommand.toString(), sender, false))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
server.dispatchCommand(sender, generatedCommand.toString());
|
||||
}
|
||||
catch (SubCommandFailureException ex)
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_CommandBlocker;
|
||||
import net.minecraft.util.org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
|
@ -68,6 +69,13 @@ public class Command_nf extends TFM_Command
|
|||
}
|
||||
|
||||
String newCommand = StringUtils.join(outputCommand, " ");
|
||||
|
||||
if (TFM_CommandBlocker.isCommandBlocked(newCommand, sender))
|
||||
{
|
||||
// CommandBlocker handles messages and broadcasts
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage("Sending command: \"" + newCommand + "\".");
|
||||
server.dispatchCommand(sender, newCommand);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_CommandBlocker;
|
||||
import net.minecraft.util.org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
|
@ -39,11 +40,17 @@ public class Command_wildcard extends TFM_Command
|
|||
return true;
|
||||
}
|
||||
|
||||
String base_command = StringUtils.join(args, " ");
|
||||
String baseCommand = StringUtils.join(args, " ");
|
||||
|
||||
if (TFM_CommandBlocker.isCommandBlocked(baseCommand, sender))
|
||||
{
|
||||
// CommandBlocker handles messages and broadcasts
|
||||
return true;
|
||||
}
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
String out_command = base_command.replaceAll("\\x3f", player.getName());
|
||||
String out_command = baseCommand.replaceAll("\\x3f", player.getName());
|
||||
playerMsg("Running Command: " + out_command);
|
||||
server.dispatchCommand(sender, out_command);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue