diff --git a/README.md b/README.md index 8bad8661..12216e73 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ typing commands or use the inventory. It can also kick players with uncommon lon
  • Username spoofing protection.
  • Countries Whitelist/Blacklist! (countries codes)
  • Built-in AntiBot System!
  • -
  • Passpartu Feature: Admin can login with all account more info here (Deprecated)
  • +
  • ForceLogin Feature: Admins can login with all account via console command!
  • Avoid the "Logged in from another location" message!
  • Session Login!
  • Editable translations and messages!
  • diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index 4937fcb1..fc719c3f 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -49,7 +49,6 @@ import fr.xephi.authme.commands.ConverterCommand; import fr.xephi.authme.commands.EmailCommand; import fr.xephi.authme.commands.LoginCommand; import fr.xephi.authme.commands.LogoutCommand; -import fr.xephi.authme.commands.PasspartuCommand; import fr.xephi.authme.commands.RegisterCommand; import fr.xephi.authme.commands.UnregisterCommand; import fr.xephi.authme.converter.Converter; @@ -243,7 +242,6 @@ public class AuthMe extends JavaPlugin { this.getCommand("changepassword").setExecutor(new ChangePasswordCommand(this)); this.getCommand("logout").setExecutor(new LogoutCommand(this)); this.getCommand("unregister").setExecutor(new UnregisterCommand(this)); - this.getCommand("passpartu").setExecutor(new PasspartuCommand(this)); this.getCommand("email").setExecutor(new EmailCommand(this)); this.getCommand("captcha").setExecutor(new CaptchaCommand(this)); this.getCommand("converter").setExecutor(new ConverterCommand(this)); diff --git a/src/main/java/fr/xephi/authme/Utils.java b/src/main/java/fr/xephi/authme/Utils.java index ee20c578..c1975486 100644 --- a/src/main/java/fr/xephi/authme/Utils.java +++ b/src/main/java/fr/xephi/authme/Utils.java @@ -1,9 +1,7 @@ package fr.xephi.authme; import java.io.File; -import java.util.ArrayList; import java.util.Iterator; -import java.util.List; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -14,7 +12,6 @@ import org.bukkit.entity.Player; import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.cache.limbo.LimboPlayer; import fr.xephi.authme.events.AuthMeTeleportEvent; -import fr.xephi.authme.security.RandomString; import fr.xephi.authme.settings.Settings; public class Utils { @@ -23,7 +20,6 @@ public class Utils { private static Utils singleton; int id; public AuthMe plugin; - private static List tokens = new ArrayList(); public Utils(AuthMe plugin) { this.plugin = plugin; @@ -161,40 +157,6 @@ public class Utils { }); } - /* - * Random Token for passpartu - */ - public boolean obtainToken() { - try { - final String token = new RandomString(10).nextString(); - tokens.add(token); - ConsoleLogger.info("[AuthMe] Security passpartu token: " + token); - Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() { - - @Override - public void run() { - tokens.remove(token); - } - - }, 600); - return true; - } catch (Exception e) { - e.printStackTrace(); - } - return false; - } - - /* - * Read Token - */ - public boolean readToken(String inputToken) { - boolean ret = false; - if (tokens.contains(inputToken)) - ret = true; - tokens.remove(inputToken); - return (ret); - } - /* * Used for force player GameMode */ diff --git a/src/main/java/fr/xephi/authme/commands/AdminCommand.java b/src/main/java/fr/xephi/authme/commands/AdminCommand.java index 1f6a15ef..10a4e950 100644 --- a/src/main/java/fr/xephi/authme/commands/AdminCommand.java +++ b/src/main/java/fr/xephi/authme/commands/AdminCommand.java @@ -15,7 +15,6 @@ import org.bukkit.OfflinePlayer; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; -import org.bukkit.command.ConsoleCommandSender; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; @@ -71,7 +70,6 @@ public class AdminCommand implements CommandExecutor { sender.sendMessage("/authme firstspawn - Teleport yourself to the first spawn point"); sender.sendMessage("/authme switchantibot on/off - Enable/Disable AntiBot feature"); sender.sendMessage("/authme forcelogin - Enforce the login of a connected player"); - sender.sendMessage("/authme passpartutoken - Generate a timed token to login with every player's account (CONSOLE ONLY)"); return true; } @@ -80,19 +78,6 @@ public class AdminCommand implements CommandExecutor { return true; } - if ((sender instanceof ConsoleCommandSender) && args[0].equalsIgnoreCase("passpartutoken")) { - if (args.length > 1) { - ConsoleLogger.info("[AuthMe] command usage: /authme passpartutoken"); - return true; - } - if (Utils.getInstance().obtainToken()) { - ConsoleLogger.info("[AuthMe] You have 30s to insert this token ingame with /passpartu "); - } else { - ConsoleLogger.info("[AuthMe] Security error on passpartu token, please redo the command."); - } - return true; - } - if (args[0].equalsIgnoreCase("version")) { sender.sendMessage("AuthMe Version: " + AuthMe.getInstance().getDescription().getVersion()); return true; diff --git a/src/main/java/fr/xephi/authme/commands/PasspartuCommand.java b/src/main/java/fr/xephi/authme/commands/PasspartuCommand.java deleted file mode 100644 index 0d7b059e..00000000 --- a/src/main/java/fr/xephi/authme/commands/PasspartuCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -package fr.xephi.authme.commands; - -import org.bukkit.command.Command; -import org.bukkit.command.CommandExecutor; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; - -import fr.xephi.authme.AuthMe; -import fr.xephi.authme.Utils; -import fr.xephi.authme.cache.auth.PlayerCache; -import fr.xephi.authme.settings.Messages; - -/** - * - * @author stefano - */ -public class PasspartuCommand implements CommandExecutor { - - private Utils utils = Utils.getInstance(); - public AuthMe plugin; - private Messages m = Messages.getInstance(); - - public PasspartuCommand(AuthMe plugin) { - this.plugin = plugin; - } - - @Override - public boolean onCommand(CommandSender sender, Command cmnd, String label, - String[] args) { - - if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) { - m.send(sender, "no_perm"); - return true; - } - - if (PlayerCache.getInstance().isAuthenticated(sender.getName().toLowerCase())) { - return true; - } - - if ((sender instanceof Player) && args.length == 1) { - if (utils.readToken(args[0])) { - // bypass login! - plugin.management.performLogin((Player) sender, "dontneed", true); - return true; - } - sender.sendMessage("Time is expired or Token is Wrong!"); - return true; - } - sender.sendMessage("usage: /passpartu token"); - return true; - } -} diff --git a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java index 2fff82fd..7f7c19c6 100644 --- a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java +++ b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java @@ -84,7 +84,7 @@ public class AuthMePlayerListener implements Listener { return; String cmd = msg.split(" ")[0]; - if (cmd.equalsIgnoreCase("/login") || cmd.equalsIgnoreCase("/register") || cmd.equalsIgnoreCase("/passpartu") || cmd.equalsIgnoreCase("/l") || cmd.equalsIgnoreCase("/reg") || cmd.equalsIgnoreCase("/email") || cmd.equalsIgnoreCase("/captcha")) + if (cmd.equalsIgnoreCase("/login") || cmd.equalsIgnoreCase("/register") || cmd.equalsIgnoreCase("/l") || cmd.equalsIgnoreCase("/reg") || cmd.equalsIgnoreCase("/email") || cmd.equalsIgnoreCase("/captcha")) return; if (Settings.useEssentialsMotd && cmd.equalsIgnoreCase("/motd")) return; @@ -411,7 +411,7 @@ public class AuthMePlayerListener implements Listener { if (event.getResult() != PlayerLoginEvent.Result.ALLOWED) return; - if (Settings.enablePasspartu && !Settings.countriesBlacklist.isEmpty()) { + if (!Settings.countriesBlacklist.isEmpty()) { String code = plugin.getCountryCode(event.getAddress().getHostAddress()); if (((code == null) || (Settings.countriesBlacklist.contains(code) && !isAuthAvailable)) && !plugin.authmePermissible(player, "authme.bypassantibot")) { event.setKickMessage(m.send("country_banned")[0]); diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index 6f513f60..6fc1aca6 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -62,7 +62,7 @@ public final class Settings extends YamlConfiguration { isResetInventoryIfCreative, isCachingEnabled, isKickOnWrongPasswordEnabled, getEnablePasswordVerifier, protectInventoryBeforeLogInEnabled, isBackupActivated, - isBackupOnStart, isBackupOnStop, enablePasspartu, isStopEnabled, + isBackupOnStart, isBackupOnStop, isStopEnabled, reloadSupport, rakamakUseIp, noConsoleSpam, removePassword, displayOtherAccounts, useCaptcha, emailRegistration, multiverse, chestshop, bungee, banUnsafeIp, doubleEmailCheck, @@ -187,7 +187,6 @@ public final class Settings extends YamlConfiguration { isBackupOnStart = configFile.getBoolean("BackupSystem.OnServerStart", false); isBackupOnStop = configFile.getBoolean("BackupSystem.OnServeStop", false); backupWindowsPath = configFile.getString("BackupSystem.MysqlWindowsPath", "C:\\Program Files\\MySQL\\MySQL Server 5.1\\"); - enablePasspartu = configFile.getBoolean("Passpartu.enablePasspartu", false); isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true); reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true); allowCommands = (List) configFile.getList("settings.restrictions.allowCommands"); @@ -200,8 +199,6 @@ public final class Settings extends YamlConfiguration { allowCommands.add("/l"); if (!allowCommands.contains("/reg")) allowCommands.add("/reg"); - if (!allowCommands.contains("/passpartu")) - allowCommands.add("/passpartu"); if (!allowCommands.contains("/email")) allowCommands.add("/email"); if (!allowCommands.contains("/captcha")) @@ -420,8 +417,16 @@ public final class Settings extends YamlConfiguration { } if (contains("Performances.useMultiThreading")) set("Performances.useMultiThreading", null); + if (contains("Performances")) set("Performances", null); + + if (contains("Passpartu.enablePasspartu")) + set("Passpartu.enablePasspartu", null); + + if (contains("Passpartu")) + set("Passpartu", null); + if (!contains("Email.emailWhitelisted")) { set("Email.emailWhitelisted", new ArrayList()); changes = true; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 0475c055..b98ce851 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -84,7 +84,6 @@ settings: - /register - /l - /reg - - /passpartu - /email - /captcha # Maximum Registration per IP default: 1 @@ -305,13 +304,6 @@ BackupSystem: OnServerStop: true # Windows only mysql installation Path MysqlWindowsPath: 'C:\\Program Files\\MySQL\\MySQL Server 5.1\\' -Passpartu: - # Enable or Disable Passpartu Feature, - # this feature let Admin Login with all registered - # Account they need, for example inspecting Player that - # is doing shit, they can login without know any - # Player password! More info on How TO - enablePasspartu: false Security: SQLProblem: # Stop the server if we can't contact the sql database diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c0bd7fb4..5028d255 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -22,10 +22,7 @@ commands: usage: /logout unregister: description: unregister your account - usage: /unregister password - passpartu: - description: compare passpartu token - usage: /passpartu token + usage: /unregister password authme: description: AuthMe op commands usage: '/authme reload|register playername password|changepassword playername password|unregister playername|version' @@ -48,7 +45,6 @@ permissions: authme.changepassword: true authme.logout: true authme.unregister: true - authme.passpartu: true authme.l: true authme.reg: true authme.email: true @@ -87,9 +83,6 @@ permissions: authme.email: description: Email default: true - authme.passpartu: - description: passpartu - default: true authme.allow2accounts: description: allow more accounts for same ip default: false