diff --git a/README.md b/README.md index de07e8d..a542bcf 100644 --- a/README.md +++ b/README.md @@ -30,15 +30,7 @@ AntiCheat helps server admins easily identify and block malicious users by monit Usage ------- -Simply drag and drop the plugin into your Plugins folder. Optional configuration and permissions are available: - -http://dev.bukkit.org/server-mods/anticheat/pages/configuration/ - -http://dev.bukkit.org/server-mods/anticheat/pages/permissions/ - -Developer Resources -------- -API Usage: http://dev.bukkit.org/server-mods/anticheat/pages/api-documentation/ (might be outdated) +Simply drag and drop the plugin and the ProtoclLib into your Plugins folder. Bug Reporting/Support/Questions ------------ diff --git a/src/main/java/net/gravitydevelopment/anticheat/command/CommandHandler.java b/src/main/java/net/gravitydevelopment/anticheat/command/CommandHandler.java index a43a44b..cb2ec1f 100644 --- a/src/main/java/net/gravitydevelopment/anticheat/command/CommandHandler.java +++ b/src/main/java/net/gravitydevelopment/anticheat/command/CommandHandler.java @@ -33,7 +33,6 @@ import net.gravitydevelopment.anticheat.command.executors.CommandLog; import net.gravitydevelopment.anticheat.command.executors.CommandReload; import net.gravitydevelopment.anticheat.command.executors.CommandReport; import net.gravitydevelopment.anticheat.command.executors.CommandReset; -import net.gravitydevelopment.anticheat.command.executors.CommandSpy; public class CommandHandler implements CommandExecutor { @@ -48,7 +47,6 @@ public class CommandHandler implements CommandExecutor { commands.add(new CommandReload()); commands.add(new CommandReport()); commands.add(new CommandReset()); - commands.add(new CommandSpy()); } @Override diff --git a/src/main/java/net/gravitydevelopment/anticheat/command/executors/CommandSpy.java b/src/main/java/net/gravitydevelopment/anticheat/command/executors/CommandSpy.java deleted file mode 100644 index 0ded466..0000000 --- a/src/main/java/net/gravitydevelopment/anticheat/command/executors/CommandSpy.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * AntiCheat for Bukkit. - * Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.gravitydevelopment.anticheat.command.executors; - -import net.gravitydevelopment.anticheat.AntiCheat; -import net.gravitydevelopment.anticheat.command.CommandBase; -import net.gravitydevelopment.anticheat.util.Permission; -import net.gravitydevelopment.anticheat.util.SpyState; -import net.gravitydevelopment.anticheat.util.Utilities; -import org.bukkit.Bukkit; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.bukkit.metadata.FixedMetadataValue; - -public class CommandSpy extends CommandBase { - - private static final String NAME = "AntiCheat Spying"; - private static final String COMMAND = "spy"; - private static final String USAGE = "anticheat spy [user]"; - private static final Permission PERMISSION = Permission.SYSTEM_SPY; - private static final String[] HELP = { - GRAY + "Use: " + AQUA + "/anticheat spy [user]" + GRAY + " to spy on a user", - }; - - public CommandSpy() { - super(NAME, COMMAND, USAGE, HELP, PERMISSION); - } - - @Override - protected void execute(CommandSender cs, String[] args) { - if (args.length == 1) { - if (cs instanceof Player) { - Player sender = (Player) cs; - if (!args[0].equalsIgnoreCase("off")) { - Player player = Bukkit.getPlayer(args[0]); - if (player != null) { - for (Player p : cs.getServer().getOnlinePlayers()) { - if (!Permission.SYSTEM_SPY.get(p)) { - p.hidePlayer(sender); - } - } - if (!sender.hasMetadata(Utilities.SPY_METADATA)) // Maintain ORIGINAL location and other data - { - SpyState state = new SpyState(sender.getAllowFlight(), sender.isFlying(), sender.getLocation()); - sender.setMetadata(Utilities.SPY_METADATA, new FixedMetadataValue(AntiCheat.getPlugin(), state)); - } - sender.setAllowFlight(true); - sender.setFlying(true); - sender.teleport(player); - sender.sendMessage(GREEN + "You have been teleported to " + player.getName() + " and made invisible."); - sender.sendMessage(GREEN + "To stop spying, type " + WHITE + " /anti spy off"); - } else { - cs.sendMessage(RED + "Player: " +args[0] + " not found."); - } - } else { - if (sender.hasMetadata(Utilities.SPY_METADATA)) { - SpyState state = ((SpyState) sender.getMetadata(Utilities.SPY_METADATA).get(0).value()); - sender.setAllowFlight(state.getAllowFlight()); - sender.setFlying(state.getFlying()); - sender.teleport(state.getLocation()); - sender.removeMetadata(Utilities.SPY_METADATA, AntiCheat.getPlugin()); - for (Player p : cs.getServer().getOnlinePlayers()) { - p.showPlayer(sender); - } - sender.sendMessage(GREEN + "Done spying! Brought you back to where you started!"); - } else { - sender.sendMessage(RED + "You were not spying."); - } - } - } else { - cs.sendMessage(RED + "Sorry, but you can't spy on a player from the console."); - } - } else { - sendHelp(cs); - } - } -} diff --git a/src/main/java/net/gravitydevelopment/anticheat/util/Calibrator.java b/src/main/java/net/gravitydevelopment/anticheat/util/Calibrator.java deleted file mode 100644 index fdf7817..0000000 --- a/src/main/java/net/gravitydevelopment/anticheat/util/Calibrator.java +++ /dev/null @@ -1,83 +0,0 @@ -// Not production code yet. Still experimental and needs a lot of work. - -package net.gravitydevelopment.anticheat.util; - -import net.gravitydevelopment.anticheat.AntiCheat; -import org.bukkit.Server; -import org.bukkit.entity.Player; -import org.bukkit.event.HandlerList; -import org.bukkit.event.Listener; - -import java.util.HashMap; - -public class Calibrator { - - private final AntiCheat plugin; - private final Server server; - private final Player player; - - private HashMap ints = new HashMap(); - private HashMap doubles = new HashMap(); - - public Calibrator(AntiCheat plugin, Player player) { - this.plugin = plugin; - this.server = plugin.getServer(); - this.player = player; - - player.sendMessage("You have entered calibration mode."); - } - - public Player getPlayer() { - return player; - } - - private void registerEvents(CalibrationStep step) { - server.getPluginManager().registerEvents(step, plugin); - } - - private void unregisterEvents(CalibrationStep step) { - HandlerList.unregisterAll(step); - } - - public class CalibrationStep implements Listener { - - private final String key; - - private int trials = 0; - public static final int MAX_TRIALS = 10; - - public CalibrationStep(String key, String instruction) { - this.key = key; - registerEvents(this); - getPlayer().sendMessage(instruction); - } - - public void end() { - unregisterEvents(this); - } - - public long getTime() { - return System.currentTimeMillis(); - } - - public String getKey() { - return key; - } - - public int addTrial() { - return trials++; - } - } - - public class MinimumCalibrationStep extends CalibrationStep { - - public MinimumCalibrationStep(String key, String instruction) { - super(key, instruction); - } - - public void value() { - - } - } - -} diff --git a/src/main/java/net/gravitydevelopment/anticheat/util/SpyState.java b/src/main/java/net/gravitydevelopment/anticheat/util/SpyState.java deleted file mode 100644 index 7a4816c..0000000 --- a/src/main/java/net/gravitydevelopment/anticheat/util/SpyState.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * AntiCheat for Bukkit. - * Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.gravitydevelopment.anticheat.util; - -import org.bukkit.Location; - -public class SpyState { - private boolean allowFlight; - private boolean flying; - private Location location; - - public SpyState(boolean allowFlight, boolean flying, Location location) { - this.allowFlight = allowFlight; - this.flying = flying; - this.location = location; - } - - public boolean getAllowFlight() { - return this.allowFlight; - } - - public boolean getFlying() { - return this.flying; - } - - public Location getLocation() { - return this.location; - } -}