From 5608821fe3894f831792d17560cce8a333b40abb Mon Sep 17 00:00:00 2001 From: games647 Date: Sun, 20 Mar 2016 11:30:52 +0100 Subject: [PATCH] Fixed BungeeCord support --- CHANGELOG.md | 8 ++- README.md | 11 ++-- bukkit/pom.xml | 2 +- .../fastlogin/bukkit/FastLoginBukkit.java | 4 +- .../fastlogin/bukkit/PlayerSession.java | 8 +++ .../bukkit/commands/CrackedCommand.java | 20 +++++-- .../bukkit/commands/PremiumCommand.java | 5 ++ .../fastlogin/bukkit/hooks/AuthMeHook.java | 5 +- .../fastlogin/bukkit/hooks/AuthPlugin.java | 10 +++- .../bukkit/hooks/CrazyLoginHook.java | 7 ++- .../bukkit/hooks/LoginSecurityHook.java | 9 ++-- .../fastlogin/bukkit/hooks/RoyalAuthHook.java | 7 +++ .../fastlogin/bukkit/hooks/UltraAuthHook.java | 20 ++++++- .../fastlogin/bukkit/hooks/xAuthHook.java | 5 +- .../bukkit/listener/BukkitJoinListener.java | 6 ++- .../bukkit/listener/BungeeCordListener.java | 5 +- .../listener/HandshakePacketListener.java | 5 +- .../listener/ProtcolSupportListener.java | 52 +------------------ bukkit/src/main/resources/config.yml | 4 +- bungee/pom.xml | 2 +- pom.xml | 2 +- universal/pom.xml | 2 +- 22 files changed, 119 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fabfe2e..e82de12a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ -######0.6 +######0.7 * Added /premium [player] command with optional player parameter +* Fixed BungeeCord support +* Changed config option autologin to autoregister to clarify the usage +* Updated to the newest changes of Spigot + +######0.6 + * Fixed 1.9 bugs * Added UltraAuth support diff --git a/README.md b/README.md index 2da50d3a..d0a0d7cb 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,11 @@ So they don't need to enter passwords. This is also called auto login (auto-logi * Detect paid accounts from others * Automatically login paid accounts (premium) * Support various of auth plugins -* Experimental Cauldron support +* Cauldron support +* Forge/Sponge message support * BungeeCord support +* Auto register new premium players +* Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib * No client modifications needed * Good performance by using async non blocking operations * Free @@ -27,9 +30,9 @@ So they don't need to enter passwords. This is also called auto login (auto-logi ###Requirements: * Plugin: [ProtocolLib](http://www.spigotmc.org/resources/protocollib.1997/) -* Tested Bukkit/[Spigot](https://www.spigotmc.org) 1.8.8 (could also work with other versions) -* Java 7 or above -* Run in offline mode (see server.properties) +* Tested Bukkit/[Spigot](https://www.spigotmc.org) 1.9 (could also work with other versions) +* Java 7+ +* Run Spigot and/or BungeeCord in offline mode (see server.properties or config.yml) * An auth plugin. Supported Plugins: * [AuthMe](http://dev.bukkit.org/bukkit-plugins/authme-reloaded/) * [xAuth](http://dev.bukkit.org/bukkit-plugins/xauth/) diff --git a/bukkit/pom.xml b/bukkit/pom.xml index 27b44cda..1e20137f 100644 --- a/bukkit/pom.xml +++ b/bukkit/pom.xml @@ -5,7 +5,7 @@ com.github.games647 fastlogin-parent - 0.6 + 0.7 ../pom.xml diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java index 534af7ff..0b600578 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java @@ -82,10 +82,10 @@ public class FastLoginBukkit extends JavaPlugin { AsynchronousManager asynchronousManager = protocolManager.getAsynchronousManager(); asynchronousManager.registerAsyncHandler(new StartPacketListener(this, protocolManager)).start(); asynchronousManager.registerAsyncHandler(new EncryptionPacketListener(this, protocolManager)).start(); - - getServer().getPluginManager().registerEvents(new BukkitJoinListener(this), this); } + getServer().getPluginManager().registerEvents(new BukkitJoinListener(this), this); + //register commands using a unique name getCommand("premium").setExecutor(new PremiumCommand(this)); getCommand("cracked").setExecutor(new CrackedCommand(this)); diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/PlayerSession.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/PlayerSession.java index 43000f49..cf421235 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/PlayerSession.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/PlayerSession.java @@ -25,6 +25,10 @@ public class PlayerSession { this.verifyToken = ArrayUtils.clone(verifyToken); } + public PlayerSession(String username) { + this(username, "", ArrayUtils.EMPTY_BYTE_ARRAY); + } + /** * Gets the random generated server id. This makes sure the request * sent from the client is just for this server. @@ -32,6 +36,8 @@ public class PlayerSession { * See this for details * http://www.sk89q.com/2011/09/minecraft-name-spoofing-exploit/ * + * Empty if it's a BungeeCord connection + * * @return random generated server id */ public String getServerId() { @@ -41,6 +47,8 @@ public class PlayerSession { /** * Gets the verify token the server sent to the client. * + * Empty if it's a BungeeCord connection + * * @return the verify token from the server */ public byte[] getVerifyToken() { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java index 738aefb1..c4e6b524 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java @@ -28,10 +28,24 @@ public class CrackedCommand implements CommandExecutor { } String playerName = sender.getName(); - plugin.getEnabledPremium().remove(playerName); - sender.sendMessage(ChatColor.DARK_GREEN + "Removed to the list of premium players"); - notifiyBungeeCord((Player) sender); + boolean existed = plugin.getEnabledPremium().remove(playerName); + if (existed) { + sender.sendMessage(ChatColor.DARK_GREEN + "Removed from the list of premium players"); + notifiyBungeeCord((Player) sender); + } else { + sender.sendMessage(ChatColor.DARK_RED + "You are not in the premium list"); + } + return true; + } else { + String playerName = args[0]; + boolean existed = plugin.getEnabledPremium().remove(playerName); + if (existed) { + sender.sendMessage(ChatColor.DARK_GREEN + "Removed from the list of premium players"); +// notifiyBungeeCord((Player) sender); + } else { + sender.sendMessage(ChatColor.DARK_RED + "User is not in the premium list"); + } } return true; diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java index 25f9461a..322d7fec 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java @@ -37,6 +37,11 @@ public class PremiumCommand implements CommandExecutor { sender.sendMessage(ChatColor.DARK_GREEN + "Added to the list of premium players"); notifiyBungeeCord((Player) sender); return true; + } else { + String playerName = args[0]; + plugin.getEnabledPremium().add(playerName); + sender.sendMessage(ChatColor.DARK_GREEN + "Added player to the list of premium players"); +// notifiyBungeeCord(); } return true; diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java index d0f58908..449f3f09 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java @@ -6,7 +6,10 @@ import org.bukkit.entity.Player; /** * Github: https://github.com/Xephi/AuthMeReloaded/ - * Project page: http://dev.bukkit.org/bukkit-plugins/authme-reloaded/ + * Project page: + * + * Bukkit: http://dev.bukkit.org/bukkit-plugins/authme-reloaded/ + * Spigot: https://www.spigotmc.org/resources/authme-reloaded.6269/ */ public class AuthMeHook implements AuthPlugin { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthPlugin.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthPlugin.java index 0992105f..a5aa26aa 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthPlugin.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthPlugin.java @@ -8,7 +8,8 @@ import org.bukkit.entity.Player; public interface AuthPlugin { /** - * Login the premium (paid account) player + * Login the premium (paid account) player after + * the player joined successfully the server. * * @param player the player that needs to be logged in */ @@ -21,6 +22,9 @@ public interface AuthPlugin { * so we can be sure the premium player doesn't steal the account * of that player. * + * This operation will be performed async while the player is + * connecting + * * @param playerName player name * @return if the player has an account */ @@ -28,6 +32,10 @@ public interface AuthPlugin { /** * Forces a register in order to protect the paid account. + * The method will be invoked after the player joined the server. + * + * After a successful registration the player should be logged + * in too. * * The method will be called only for premium accounts. * So it's recommended to set additionally premium property diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/CrazyLoginHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/CrazyLoginHook.java index 6725012a..2b438b25 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/CrazyLoginHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/CrazyLoginHook.java @@ -15,7 +15,10 @@ import org.bukkit.entity.Player; /** * Github: https://github.com/ST-DDT/CrazyLogin - * Project page: http://dev.bukkit.org/server-mods/crazylogin/ + * + * Project page: + * + * Bukkit: http://dev.bukkit.org/server-mods/crazylogin/ */ public class CrazyLoginHook implements AuthPlugin { @@ -32,7 +35,7 @@ public class CrazyLoginHook implements AuthPlugin { String ip = player.getAddress().getAddress().getHostAddress(); //this should be done after login to restore the inventory, unhide players, prevent potential memory leaks... -//extracted from: https://github.com/ST-DDT/CrazyLogin/blob/master/src/main/java/de/st_ddt/crazylogin/CrazyLogin.java#L1948 +//from: https://github.com/ST-DDT/CrazyLogin/blob/master/src/main/java/de/st_ddt/crazylogin/CrazyLogin.java#L1948 playerData.resetLoginFails(); player.setFireTicks(0); diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/LoginSecurityHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/LoginSecurityHook.java index 91904390..469f5ffe 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/LoginSecurityHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/LoginSecurityHook.java @@ -12,8 +12,11 @@ import org.bukkit.Bukkit; import org.bukkit.entity.Player; /** - * Github: http://dev.bukkit.org/bukkit-plugins/loginsecurity/ - * Project page: https://github.com/lenis0012/LoginSecurity-2 + * Github: https://github.com/lenis0012/LoginSecurity-2 + * Project page: + * + * Bukkit: http://dev.bukkit.org/bukkit-plugins/loginsecurity/ + * Spigot: https://www.spigotmc.org/resources/loginsecurity.19362/ * * on join: * https://github.com/lenis0012/LoginSecurity-2/blob/master/src/main/java/com/lenis0012/bukkit/ls/LoginSecurity.java#L282 @@ -44,7 +47,7 @@ public class LoginSecurityHook implements AuthPlugin { //https://github.com/lenis0012/LoginSecurity-2/blob/master/src/main/java/com/lenis0012/bukkit/ls/LoginSecurity.java#L283 UUID offlineUuid = UUID.nameUUIDFromBytes(playerName.getBytes(Charsets.UTF_8)); return dataManager.isRegistered(offlineUuid.toString().replace("-", "")); - //check for sessions in order to prevent a sql query? + //check for loginsecurity sessions in order to prevent a sql query? //sesUse && thread.getSession().containsKey(uuid) && checkLastIp(player)) { } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/RoyalAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/RoyalAuthHook.java index ace7a02e..07e39ac3 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/RoyalAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/RoyalAuthHook.java @@ -4,6 +4,13 @@ import org.bukkit.entity.Player; import org.royaldev.royalauth.AuthPlayer; import org.royaldev.royalauth.Config; +/** + * Github: https://github.com/RoyalDev/RoyalAuth + * + * Project page: + * + * Bukkit: http://dev.bukkit.org/bukkit-plugins/royalauth/ + */ public class RoyalAuthHook implements AuthPlugin { @Override diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java index 7c29f9d8..de21005d 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/UltraAuthHook.java @@ -40,6 +40,7 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.InventoryView.Property; import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.MainHand; import org.bukkit.inventory.PlayerInventory; import org.bukkit.map.MapView; import org.bukkit.metadata.MetadataValue; @@ -55,7 +56,10 @@ import org.bukkit.util.Vector; import ultraauth.api.UltraAuthAPI; /** - * Project page: http://dev.bukkit.org/bukkit-plugins/ultraauth-aa/ + * Project page: + * + * Bukkit: http://dev.bukkit.org/bukkit-plugins/ultraauth-aa/ + * Spigot: https://www.spigotmc.org/resources/ultraauth.17044/ */ public class UltraAuthHook implements AuthPlugin { @@ -1402,5 +1406,19 @@ public class UltraAuthHook implements AuthPlugin { throw new UnsupportedOperationException("Not supported yet."); } + @Override + public MainHand getMainHand() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean isGliding() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public void setGliding(boolean arg0) { + throw new UnsupportedOperationException("Not supported yet."); + } } } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/xAuthHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/xAuthHook.java index cf32a176..7d011b1c 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/xAuthHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/xAuthHook.java @@ -7,7 +7,10 @@ import org.bukkit.entity.Player; /** * Github: https://github.com/LycanDevelopment/xAuth/ - * Project page: http://dev.bukkit.org/bukkit-plugins/xauth/ + * + * Project page: + * + * Bukkit: http://dev.bukkit.org/bukkit-plugins/xauth/ */ public class xAuthHook implements AuthPlugin { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java index 37e50d58..7eefa6b5 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java @@ -35,7 +35,7 @@ public class BukkitJoinListener implements Listener { final Player player = joinEvent.getPlayer(); //removing the session because we now use it - final PlayerSession session = plugin.getSessions().remove(player.getAddress().toString()); + final PlayerSession session = plugin.getSessions().get(player.getAddress().toString()); if (session != null) { WrappedGameProfile gameProfile = WrappedGameProfile.fromPlayer(player); WrappedSignedProperty skin = session.getSkin(); @@ -49,6 +49,10 @@ public class BukkitJoinListener implements Listener { @Override public void run() { if (player.isOnline()) { + //remove the bungeecord identifier + String id = '/' + player.getAddress().getHostString() + ':' + player.getAddress().getPort(); + PlayerSession session = plugin.getSessions().get(id); + //blacklist this target player for BungeeCord Id brute force attacks player.setMetadata(plugin.getName(), new FixedMetadataValue(plugin, true)); //check if it's the same player as we checked before diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java index 241d3089..33928a05 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BungeeCordListener.java @@ -61,10 +61,13 @@ public class BungeeCordListener implements PluginMessageListener { //fail if BungeeCord support is disabled (id = null) if (sourceId.equals(proxyId)) { - PlayerSession playerSession = new PlayerSession(playerName, null, null); + PlayerSession playerSession = new PlayerSession(playerName); playerSession.setVerified(true); + playerSession.setRegistered(true); + //put it only if the user doesn't has a session open //so that the player have to send the bungeecord packet and cannot skip the verification then + plugin.getSessions().putIfAbsent(checkedPlayer.getAddress().toString(), playerSession); } else { //blacklist target for the current login diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/HandshakePacketListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/HandshakePacketListener.java index 425d3436..ec793942 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/HandshakePacketListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/HandshakePacketListener.java @@ -1,6 +1,7 @@ package com.github.games647.fastlogin.bukkit.listener; import com.comphenix.protocol.PacketType; +import com.comphenix.protocol.PacketType.Protocol; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; @@ -34,10 +35,10 @@ public class HandshakePacketListener extends PacketAdapter { @Override public void onPacketReceiving(PacketEvent packetEvent) { PacketContainer packet = packetEvent.getPacket(); - PacketType.Protocol nextProtocol = packet.getProtocols().read(0); + Protocol nextProtocol = packet.getProtocols().read(0); //we don't want to listen for server ping. - if (nextProtocol == PacketType.Protocol.LOGIN) { + if (nextProtocol == Protocol.LOGIN) { //here are the information written separated by a space String hostname = packet.getStrings().read(0); //https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/browse/CraftBukkit-Patches/0055-BungeeCord-Support.patch diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtcolSupportListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtcolSupportListener.java index 9c46ef80..811fb55c 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtcolSupportListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtcolSupportListener.java @@ -1,27 +1,18 @@ package com.github.games647.fastlogin.bukkit.listener; -import com.comphenix.protocol.wrappers.WrappedSignedProperty; import com.github.games647.fastlogin.bukkit.FastLoginBukkit; import com.github.games647.fastlogin.bukkit.PlayerSession; import java.net.InetSocketAddress; -import java.util.logging.Level; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerJoinEvent; import protocolsupport.api.events.PlayerLoginStartEvent; import protocolsupport.api.events.PlayerPropertiesResolveEvent; -import protocolsupport.api.events.PlayerPropertiesResolveEvent.ProfileProperty; public class ProtcolSupportListener implements Listener { - private static final long DELAY_LOGIN = 1 * 20L / 2; - protected final FastLoginBukkit plugin; public ProtcolSupportListener(FastLoginBukkit plugin) { @@ -41,7 +32,7 @@ public class ProtcolSupportListener implements Listener { if (plugin.getEnabledPremium().contains(playerName)) { //the player have to be registered in order to invoke the command startPremiumSession(playerName, loginStartEvent, true); - } else if (plugin.getConfig().getBoolean("autologin") && !plugin.getAuthPlugin().isRegistered(playerName)) { + } else if (plugin.getConfig().getBoolean("autoRegister") && !plugin.getAuthPlugin().isRegistered(playerName)) { startPremiumSession(playerName, loginStartEvent, false); plugin.getEnabledPremium().add(playerName); } @@ -53,50 +44,9 @@ public class ProtcolSupportListener implements Listener { PlayerSession session = plugin.getSessions().get(address.toString()); if (session != null) { session.setVerified(true); - - ProfileProperty skinProperty = propertiesResolveEvent.getProperties().get("textures"); - if (skinProperty != null) { - WrappedSignedProperty signedProperty = WrappedSignedProperty - .fromValues(skinProperty.getName(), skinProperty.getValue(), skinProperty.getSignature()); - session.setSkin(signedProperty); - } } } - @EventHandler(ignoreCancelled = true) - public void onJoin(PlayerJoinEvent joinEvent) { - final Player player = joinEvent.getPlayer(); - Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { - - @Override - public void run() { - String address = player.getAddress().getAddress().toString(); - //removing the session because we now use it - PlayerSession session = plugin.getSessions().remove(address); - - if (player.isOnline()) { - //check if it's the same player as we checked before - if (session != null && player.getName().equals(session.getUsername()) && session.isVerified()) { - if (session.needsRegistration()) { - plugin.getLogger().log(Level.FINE, "Register player {0}", player.getName()); - - String generatedPassword = plugin.generateStringPassword(); - plugin.getAuthPlugin().forceRegister(player, generatedPassword); - player.sendMessage(ChatColor.DARK_GREEN + "Auto registered with password: " - + generatedPassword); - player.sendMessage(ChatColor.DARK_GREEN + "You may want change it?"); - } else { - plugin.getLogger().log(Level.FINE, "Logging player {0} in", player.getName()); - plugin.getAuthPlugin().forceLogin(player); - player.sendMessage(ChatColor.DARK_GREEN + "Auto logged in"); - } - } - } - } - //Wait before auth plugin and we received a message from BungeeCord initializes the player - }, DELAY_LOGIN); - } - private void startPremiumSession(String playerName, PlayerLoginStartEvent loginStartEvent, boolean registered) { if (plugin.getApiConnector().isPremiumName(playerName)) { loginStartEvent.setOnlineMode(true); diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index 1e17f4a4..67eb5004 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -4,7 +4,7 @@ # Request a premium login without forcing the player to type a command # -# If you activate autologin, this plugin will check/do these points on login: +# If you activate autoRegister, this plugin will check/do these points on login: # 1. An existing cracked account shouldn't exist # -> paid accounts cannot steal the existing account of cracked players # - (Already registered players could still use the /premium command to activate premium checks) @@ -16,4 +16,4 @@ # the player just disconnect and sees the message: 'bad login' # There is no way to change this message # For more information: https://github.com/games647/FastLogin#why-do-players-have-to-invoke-a-command -autologin: false \ No newline at end of file +autoRegister: false \ No newline at end of file diff --git a/bungee/pom.xml b/bungee/pom.xml index 70d629c4..46e167dd 100644 --- a/bungee/pom.xml +++ b/bungee/pom.xml @@ -5,7 +5,7 @@ com.github.games647 fastlogin-parent - 0.6 + 0.7 ../pom.xml diff --git a/pom.xml b/pom.xml index 895f3bc3..e3fb2d69 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ pom FastLogin - 0.6 + 0.7 2015 https://www.spigotmc.org/resources/fastlogin.14153/ diff --git a/universal/pom.xml b/universal/pom.xml index ed7fb7df..349b98d5 100644 --- a/universal/pom.xml +++ b/universal/pom.xml @@ -5,7 +5,7 @@ com.github.games647 fastlogin-parent - 0.6 + 0.7 ../pom.xml