From 2c019d4ed1b3b8fb1f18e3798ce9c8b4d1892efa Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Tue, 15 Jun 2021 02:30:29 +0400 Subject: [PATCH 01/13] removed all auth hooks stuff --- ...removed-hooks-and-commented-them-out.patch | 68 +++ .../0004-deleted-unwanted-classes.patch | 263 +++++++++ ...0005-Removing-all-Auth-related-stuff.patch | 535 ++++++++++++++++++ 3 files changed, 866 insertions(+) create mode 100644 FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch create mode 100644 FastLogin-Patches/0004-deleted-unwanted-classes.patch create mode 100644 FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch new file mode 100644 index 0000000..a39306f --- /dev/null +++ b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch @@ -0,0 +1,68 @@ +From d85a4cd57426f484fa46c9149dd9ace7ebc77170 Mon Sep 17 00:00:00 2001 +From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> +Date: Tue, 15 Jun 2021 02:09:53 +0400 +Subject: [PATCH] removed hooks and commented them out + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +index e26b271..25f1ac2 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +@@ -25,9 +25,6 @@ + */ + package com.github.games647.fastlogin.bungee; + +-import com.github.games647.fastlogin.bungee.hook.BungeeAuthHook; +-import com.github.games647.fastlogin.bungee.hook.BungeeCordAuthenticatorBungeeHook; +-import com.github.games647.fastlogin.bungee.hook.SodionAuthHook; + import com.github.games647.fastlogin.bungee.listener.ConnectListener; + import com.github.games647.fastlogin.bungee.listener.PluginMessageListener; + import com.github.games647.fastlogin.core.AsyncScheduler; +@@ -50,7 +47,6 @@ import java.util.List; + import java.util.concurrent.ConcurrentMap; + import java.util.concurrent.ThreadFactory; + +-import net.md_5.bungee.BungeeServerInfo; + import net.md_5.bungee.api.CommandSender; + import net.md_5.bungee.api.chat.TextComponent; + import net.md_5.bungee.api.connection.PendingConnection; +@@ -102,8 +98,9 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin>> hooks = Arrays.asList( +- BungeeAuthHook.class, BungeeCordAuthenticatorBungeeHook.class, SodionAuthHook.class); ++ try { ++ List>> hooks = Arrays.asList(); + + for (Class> clazz : hooks) { + String pluginName = clazz.getSimpleName(); +@@ -141,7 +139,8 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin +Date: Tue, 15 Jun 2021 02:10:12 +0400 +Subject: [PATCH] deleted unwanted classes + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java +deleted file mode 100644 +index abddb17..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java ++++ /dev/null +@@ -1,65 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +- +-import me.vik1395.BungeeAuth.Main; +-import me.vik1395.BungeeAuthAPI.RequestHandler; +- +-import net.md_5.bungee.api.connection.ProxiedPlayer; +- +-/** +- * GitHub: https://github.com/vik1395/BungeeAuth-Minecraft +- * +- * Project page: +- * +- * Spigot: https://www.spigotmc.org/resources/bungeeauth.493/ +- */ +-public class BungeeAuthHook implements AuthPlugin { +- +- private final RequestHandler requestHandler = new RequestHandler(); +- +- public BungeeAuthHook(FastLoginBungee plugin) { +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- String playerName = player.getName(); +- return Main.plonline.contains(playerName) || requestHandler.forceLogin(playerName); +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- return requestHandler.isRegistered(playerName); +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- return requestHandler.forceRegister(player, password); +- } +-} +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java +deleted file mode 100644 +index beb56d9..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java ++++ /dev/null +@@ -1,93 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import java.sql.SQLException; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +- +-import de.xxschrandxx.bca.bungee.BungeeCordAuthenticatorBungee; +-import de.xxschrandxx.bca.bungee.api.BungeeCordAuthenticatorBungeeAPI; +- +-import net.md_5.bungee.api.connection.ProxiedPlayer; +- +-/** +- * GitHub: +- * https://github.com/xXSchrandXx/SpigotPlugins/tree/master/BungeeCordAuthenticator +- * +- * Project page: +- * +- * Spigot: https://www.spigotmc.org/resources/bungeecordauthenticator.87669/ +- */ +-public class BungeeCordAuthenticatorBungeeHook implements AuthPlugin { +- +- public final BungeeCordAuthenticatorBungeeAPI api; +- +- public BungeeCordAuthenticatorBungeeHook(FastLoginBungee plugin) { +- api = ((BungeeCordAuthenticatorBungee) plugin.getProxy().getPluginManager() +- .getPlugin("BungeeCordAuthenticatorBungee")).getAPI(); +- plugin.getLog().info("BungeeCordAuthenticatorHook | Hooked successful!"); +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- if (api.isAuthenticated(player)) { +- return true; +- } else { +- try { +- api.setAuthenticated(player); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- return true; +- } +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- try { +- return api.getSQL().checkPlayerEntry(playerName); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- try { +- return api.createPlayerEntry(player, password); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- } +-} +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java +deleted file mode 100644 +index c12f2b0..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java ++++ /dev/null +@@ -1,78 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import red.mohist.sodionauth.bungee.implementation.BungeePlayer; +-import red.mohist.sodionauth.core.SodionAuthApi; +-import red.mohist.sodionauth.core.exception.AuthenticatedException; +- +-/** +- * GitHub: https://github.com/Mohist-Community/SodionAuth +- *

+- * Project page: https://gitea.e-loli.com/SodionAuth/SodionAuth +- *

+- * Bukkit: Unknown +- *

+- * Spigot: https://www.spigotmc.org/resources/sodionauth.76944/ +- */ +-public class SodionAuthHook implements AuthPlugin { +- +- private final FastLoginBungee plugin; +- +- public SodionAuthHook(FastLoginBungee plugin) { +- this.plugin = plugin; +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- try { +- SodionAuthApi.login(new BungeePlayer(player)); +- } catch (AuthenticatedException e) { +- plugin.getLog().warn(ALREADY_AUTHENTICATED, player); +- return false; +- } +- return true; +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- try{ +- return SodionAuthApi.register(new BungeePlayer(player), password); +- } catch (UnsupportedOperationException e){ +- plugin.getLog().warn("Currently SodionAuth is not accepting forceRegister, " + +- "It may be caused by unsupported AuthBackend"); +- return false; +- } +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- return SodionAuthApi.isRegistered(playerName); +- } +-} +-- +2.32.0.windows.1 + diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch new file mode 100644 index 0000000..5d3a766 --- /dev/null +++ b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch @@ -0,0 +1,535 @@ +From 4975802f5fcea2ef9cfa06df8b9a0939961ff935 Mon Sep 17 00:00:00 2001 +From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> +Date: Tue, 15 Jun 2021 02:28:50 +0400 +Subject: [PATCH] Removing all Auth related stuff + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +index 25f1ac2..ec6f74a 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +@@ -29,7 +29,6 @@ import com.github.games647.fastlogin.bungee.listener.ConnectListener; + import com.github.games647.fastlogin.bungee.listener.PluginMessageListener; + import com.github.games647.fastlogin.core.AsyncScheduler; + import com.github.games647.fastlogin.core.CommonUtil; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.message.ChangePremiumMessage; + import com.github.games647.fastlogin.core.message.ChannelMessage; + import com.github.games647.fastlogin.core.message.NamespaceKey; +@@ -42,8 +41,6 @@ import com.google.common.io.ByteStreams; + import com.google.common.util.concurrent.ThreadFactoryBuilder; + + import java.nio.file.Path; +-import java.util.Arrays; +-import java.util.List; + import java.util.concurrent.ConcurrentMap; + import java.util.concurrent.ThreadFactory; + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java +index db8f269..07df30a 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java +@@ -32,7 +32,6 @@ import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateHook; + import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateV1Hook; + import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateV2Hook; + import com.github.games647.fastlogin.bungee.task.AsyncPremiumCheck; +-import com.github.games647.fastlogin.bungee.task.ForceLoginTask; + import com.github.games647.fastlogin.core.RateLimiter; + import com.github.games647.fastlogin.core.StoredProfile; + import com.github.games647.fastlogin.core.shared.LoginSession; +@@ -249,8 +248,12 @@ public class ConnectListener implements Listener { + // delay sending force command, because Paper will process the login event asynchronously + // In this case it means that the force command (plugin message) is already received and processed while + // player is still in the login phase and reported to be offline. +- Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); +- plugin.getScheduler().runAsync(loginTask); ++ ++ // LimeLogin start ++ //Disabled... ++ //Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); ++ //plugin.getScheduler().runAsync(loginTask); ++ // LimeLogin stop + } + + @EventHandler +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java +index 410b1e4..0136f09 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java +@@ -49,8 +49,9 @@ public class AsyncPremiumCheck extends JoinManagement +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.task; +- +-import com.github.games647.fastlogin.bungee.BungeeLoginSession; +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.bungee.event.BungeeFastLoginAutoLoginEvent; +-import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.message.ChannelMessage; +-import com.github.games647.fastlogin.core.message.LoginActionMessage; +-import com.github.games647.fastlogin.core.message.LoginActionMessage.Type; +-import com.github.games647.fastlogin.core.shared.FastLoginCore; +-import com.github.games647.fastlogin.core.shared.ForceLoginManagement; +-import com.github.games647.fastlogin.core.shared.LoginSession; +-import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent; +- +-import java.util.UUID; +- +-import net.md_5.bungee.api.CommandSender; +-import net.md_5.bungee.api.ProxyServer; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.api.connection.Server; +- +-public class ForceLoginTask +- extends ForceLoginManagement { +- +- private final Server server; +- +- public ForceLoginTask(FastLoginCore core, +- ProxiedPlayer player, Server server, BungeeLoginSession session) { +- super(core, player, session); +- +- this.server = server; +- } +- +- @Override +- public void run() { +- if (session == null) { +- return; +- } +- +- super.run(); +- +- if (!isOnlineMode()) { +- session.setAlreadySaved(true); +- } +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- if (session.isAlreadyLogged()) { +- return true; +- } +- +- session.setAlreadyLogged(true); +- return super.forceLogin(player); +- } +- +- @Override +- public FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile) { +- return core.getPlugin().getProxy().getPluginManager() +- .callEvent(new BungeeFastLoginAutoLoginEvent(session, profile)); +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player) { +- return session.isAlreadyLogged() || super.forceRegister(player); +- } +- +- @Override +- public void onForceActionSuccess(LoginSession session) { +- //sub channel name +- Type type = Type.LOGIN; +- if (session.needsRegistration()) { +- type = Type.REGISTER; +- } +- +- UUID proxyId = UUID.fromString(ProxyServer.getInstance().getConfig().getUuid()); +- ChannelMessage loginMessage = new LoginActionMessage(type, player.getName(), proxyId); +- +- core.getPlugin().sendPluginMessage(server, loginMessage); +- } +- +- @Override +- public String getName(ProxiedPlayer player) { +- return player.getName(); +- } +- +- @Override +- public boolean isOnline(ProxiedPlayer player) { +- return player.isConnected(); +- } +- +- @Override +- public boolean isOnlineMode() { +- return player.getPendingConnection().isOnlineMode(); +- } +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java b/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java +deleted file mode 100644 +index 1a614ba..0000000 +--- a/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java ++++ /dev/null +@@ -1,87 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.core.hooks; +- +-/** +- * Represents a supporting authentication plugin in BungeeCord and Bukkit/Spigot/... servers +- * +- * @param

either {@link org.bukkit.entity.Player} for Bukkit or {@link net.md_5.bungee.api.connection.ProxiedPlayer} +- * for BungeeCord +- */ +-public interface AuthPlugin

{ +- +- String ALREADY_AUTHENTICATED = "Player {} is already authenticated. Cancelling force login."; +- +- /** +- * Login the premium (paid account) player after the player joined successfully the server. +- * +- * This operation will be performed async while the player successfully +- * joined the server. +- * +- * @param player the player that needs to be logged in +- * @return if the operation was successful +- */ +- boolean forceLogin(P player); +- +- /** +- * Forces a register in order to protect the paid account. +- * +- * This operation will be performed async while the player successfully +- * 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 +- * if possible. +- * +- * Background: If we don't register an account, cracked players +- * could steal the unregistered account from the paid +- * player account +- * +- * @param player the premium account +- * @param password a strong random generated password +- * @return if the operation was successful +- */ +- boolean forceRegister(P player, String password); +- +- /** +- * Checks whether an account exists for this player name. +- * +- * This check should check if a cracked player account exists +- * 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 +- * @throws Exception if an error occurred +- */ +- boolean isRegistered(String playerName) throws Exception; +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java +index ec3f924..90c9add 100644 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java ++++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java +@@ -30,7 +30,6 @@ import com.github.games647.craftapi.resolver.http.RotatingProxySelector; + import com.github.games647.fastlogin.core.AuthStorage; + import com.github.games647.fastlogin.core.CommonUtil; + import com.github.games647.fastlogin.core.RateLimiter; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.hooks.DefaultPasswordGenerator; + import com.github.games647.fastlogin.core.hooks.PasswordGenerator; + import com.google.common.net.HostAndPort; +@@ -85,8 +84,9 @@ public class FastLoginCore

> { + private AuthStorage storage; + private RateLimiter rateLimiter; + private PasswordGenerator

passwordGenerator = new DefaultPasswordGenerator<>(); +- private AuthPlugin

authPlugin; +- ++ // LimeLogin start ++ //private AuthPlugin

authPlugin; ++ // LimeLogin stop + public FastLoginCore(T plugin) { + this.plugin = plugin; + } +@@ -251,17 +251,25 @@ public class FastLoginCore

> { + return pendingConfirms; + } + ++ // LimeLogin start ++ /* + public AuthPlugin

getAuthPluginHook() { + return authPlugin; + } ++ */ ++ // LimeLogin stop + + public RateLimiter getRateLimiter() { + return rateLimiter; + } + ++ // LimeLogin start ++ /* + public void setAuthPluginHook(AuthPlugin

authPlugin) { + this.authPlugin = authPlugin; + } ++ */ ++ // LimeLogin stop + + public void saveDefaultFile(String fileName) { + Path dataFolder = plugin.getPluginFolder(); +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java +deleted file mode 100644 +index b417e64..0000000 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java ++++ /dev/null +@@ -1,143 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.core.shared; +- +-import com.github.games647.fastlogin.core.AuthStorage; +-import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +-import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent; +- +-public abstract class ForceLoginManagement

> +- implements Runnable { +- +- protected final FastLoginCore core; +- protected final P player; +- protected final L session; +- +- public ForceLoginManagement(FastLoginCore core, P player, L session) { +- this.core = core; +- this.player = player; +- this.session = session; +- } +- +- @Override +- public void run() { +- if (!isOnline(player)) { +- core.getPlugin().getLog().info("Player {} disconnected", player); +- return; +- } +- +- if (session == null) { +- core.getPlugin().getLog().info("No valid session found for {}", player); +- return; +- } +- +- AuthStorage storage = core.getStorage(); +- StoredProfile playerProfile = session.getProfile(); +- try { +- if (isOnlineMode()) { +- //premium player +- AuthPlugin

authPlugin = core.getAuthPluginHook(); +- if (authPlugin == null) { +- //maybe only bungeecord plugin +- onForceActionSuccess(session); +- } else { +- boolean success = true; +- String playerName = getName(player); +- if (core.getConfig().get("autoLogin", true)) { +- if (session.needsRegistration() +- || (core.getConfig().get("auto-register-unknown", false) +- && !authPlugin.isRegistered(playerName))) { +- success = forceRegister(player); +- } else if (!callFastLoginAutoLoginEvent(session, playerProfile).isCancelled()) { +- success = forceLogin(player); +- } +- } +- +- if (success) { +- //update only on success to prevent corrupt data +- if (playerProfile != null) { +- playerProfile.setId(session.getUuid()); +- playerProfile.setPremium(true); +- storage.save(playerProfile); +- } +- +- onForceActionSuccess(session); +- } +- } +- } else if (playerProfile != null) { +- //cracked player +- playerProfile.setId(null); +- playerProfile.setPremium(false); +- // LimeLogin start +- +- //Govindas comment - don't save cracked player profiles, I found it to be useless +- //storage.save(playerProfile); +- //end of Govindas comment +- +- // LimeLogin stop +- } +- } catch (Exception ex) { +- core.getPlugin().getLog().warn("ERROR ON FORCE LOGIN of {}", getName(player), ex); +- } +- } +- +- public boolean forceRegister(P player) { +- core.getPlugin().getLog().info("Register player {}", getName(player)); +- +- String generatedPassword = core.getPasswordGenerator().getRandomPassword(player); +- boolean success = core.getAuthPluginHook().forceRegister(player, generatedPassword); +- +- String message = core.getMessage("auto-register"); +- if (success && message != null) { +- message = message.replace("%password", generatedPassword); +- core.getPlugin().sendMessage(player, message); +- } +- +- return success; +- } +- +- public boolean forceLogin(P player) { +- core.getPlugin().getLog().info("Logging player {} in", getName(player)); +- +- boolean success = core.getAuthPluginHook().forceLogin(player); +- if (success) { +- core.sendLocaleMessage("auto-login", player); +- } +- +- return success; +- } +- +- public abstract FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile); +- +- public abstract void onForceActionSuccess(LoginSession session); +- +- public abstract String getName(P player); +- +- public abstract boolean isOnline(P player); +- +- public abstract boolean isOnlineMode(); +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +index 5490673..dabe324 100644 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java ++++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +@@ -28,7 +28,6 @@ package com.github.games647.fastlogin.core.shared; + import com.github.games647.craftapi.model.Profile; + import com.github.games647.craftapi.resolver.RateLimitException; + import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.hooks.FloodgateHook; + import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent; + +@@ -43,14 +42,18 @@ import net.md_5.bungee.config.Configuration; + public abstract class JoinManagement

{ + + protected final FastLoginCore core; +- protected final AuthPlugin

authHook; ++ // LimeLogin start ++ //protected final AuthPlugin

authHook; ++ // LimeLogin stop + private final FloodgateHook floodgateHook; + +- public JoinManagement(FastLoginCore core, AuthPlugin

authHook) { ++ // LimeLogin start ++ public JoinManagement(FastLoginCore core) { + this.core = core; +- this.authHook = authHook; + this.floodgateHook = new FloodgateHook<>(core); + } ++ // LimeLogin stop ++ + + public void onLogin(String username, S source) { + core.getPlugin().getLog().info("Handling player {}", username); +@@ -130,7 +133,7 @@ public abstract class JoinManagement

{ + //end of Govindas comment + + // LimeLogin stop +- if (core.getConfig().get("autoRegister", false) && (authHook == null)) { ++ if (core.getConfig().get("autoRegister", false)) { + // LimeLogin start + requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD + // LimeLogin stop +-- +2.32.0.windows.1 + -- 2.45.0 From b8a734a80e3573d3a52110e72e8e66b9ba370dd5 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:37:29 +0400 Subject: [PATCH 02/13] oops wrong use --- ...ed-old-commits-from-forked-repo-Fastlogin.patch | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/FastLogin-Patches/0002-Added-old-commits-from-forked-repo-Fastlogin.patch b/FastLogin-Patches/0002-Added-old-commits-from-forked-repo-Fastlogin.patch index 2ec4b69..dfed89f 100644 --- a/FastLogin-Patches/0002-Added-old-commits-from-forked-repo-Fastlogin.patch +++ b/FastLogin-Patches/0002-Added-old-commits-from-forked-repo-Fastlogin.patch @@ -82,7 +82,7 @@ index 8a81b14..db8f269 100644 + } + } + //end of Govindas code -+ // LimeLogin stop ++ // LimeLogin end } private void setOfflineId(InitialHandler connection, String username) { @@ -156,7 +156,7 @@ index 94500cb..b304559 100644 + if (!playerProfile.getName().contains("-")) { playerProfile.setPremium(true); } + //end of Govindas code + -+ // LimeLogin stop ++ // LimeLogin end playerProfile.getSaveLock().lock(); try { if (playerProfile.isSaved()) { @@ -170,7 +170,7 @@ index 94500cb..b304559 100644 + if (!playerProfile.getName().contains("-")) { playerProfile.setPremium(true); } + //end of Govindas code + -+ // LimeLogin stop ++ // LimeLogin end try (PreparedStatement saveStmt = con.prepareStatement(INSERT_PROFILE, RETURN_GENERATED_KEYS)) { saveStmt.setString(1, uuid); @@ -189,7 +189,7 @@ index 7efb157..b417e64 100644 + //storage.save(playerProfile); + //end of Govindas comment + -+ // LimeLogin stop ++ // LimeLogin end } } catch (Exception ex) { core.getPlugin().getLog().warn("ERROR ON FORCE LOGIN of {}", getName(player), ex); @@ -240,11 +240,11 @@ index ec129a8..5490673 100644 + //if (core.getConfig().get("autoRegister", false) && (authHook == null || !authHook.isRegistered(username))) { + //end of Govindas comment + -+ // LimeLogin stop ++ // LimeLogin end + if (core.getConfig().get("autoRegister", false) && (authHook == null)) { + // LimeLogin start + requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD -+ // LimeLogin stop ++ // LimeLogin end return true; } @@ -289,7 +289,7 @@ index 0000000..007083e + this.cancelled = cancelled; + } +} -+// LimeLogin stop ++// LimeLogin end \ No newline at end of file diff --git a/core/src/main/resources/config.yml b/core/src/main/resources/config.yml index ecb1c44..477c026 100644 -- 2.45.0 From 654e137359f1b57a5dc9b4ffb98868f537c02c66 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:38:57 +0400 Subject: [PATCH 03/13] related to main --- ...removed-hooks-and-commented-them-out.patch | 4 ++-- ...0005-Removing-all-Auth-related-stuff.patch | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch index a39306f..b2c2a1f 100644 --- a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch +++ b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch @@ -34,7 +34,7 @@ index e26b271..25f1ac2 100644 - registerHook(); + // LimeLogin start + //registerHook(); -+ // LimeLogin stop ++ // LimeLogin end } @Override @@ -59,7 +59,7 @@ index e26b271..25f1ac2 100644 } - } + } */ -+ // LimeLogin stop ++ // LimeLogin end public void sendPluginMessage(Server server, ChannelMessage message) { if (server != null) { diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch index 5d3a766..394ce3d 100644 --- a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch +++ b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch @@ -48,7 +48,7 @@ index db8f269..07df30a 100644 + //Disabled... + //Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); + //plugin.getScheduler().runAsync(loginTask); -+ // LimeLogin stop ++ // LimeLogin end } @EventHandler @@ -64,7 +64,7 @@ index 410b1e4..0136f09 100644 - + // LimeLogin start + super(plugin.getCore()); -+ // LimeLogin stop ++ // LimeLogin end this.plugin = plugin; this.preLoginEvent = preLoginEvent; this.connection = connection; @@ -308,7 +308,7 @@ index ec3f924..90c9add 100644 - + // LimeLogin start + //private AuthPlugin

authPlugin; -+ // LimeLogin stop ++ // LimeLogin end public FastLoginCore(T plugin) { this.plugin = plugin; } @@ -322,7 +322,7 @@ index ec3f924..90c9add 100644 return authPlugin; } + */ -+ // LimeLogin stop ++ // LimeLogin end public RateLimiter getRateLimiter() { return rateLimiter; @@ -334,7 +334,7 @@ index ec3f924..90c9add 100644 this.authPlugin = authPlugin; } + */ -+ // LimeLogin stop ++ // LimeLogin end public void saveDefaultFile(String fileName) { Path dataFolder = plugin.getPluginFolder(); @@ -444,7 +444,7 @@ index b417e64..0000000 - //storage.save(playerProfile); - //end of Govindas comment - -- // LimeLogin stop +- // LimeLogin end - } - } catch (Exception ex) { - core.getPlugin().getLog().warn("ERROR ON FORCE LOGIN of {}", getName(player), ex); @@ -506,7 +506,7 @@ index 5490673..dabe324 100644 - protected final AuthPlugin

authHook; + // LimeLogin start + //protected final AuthPlugin

authHook; -+ // LimeLogin stop ++ // LimeLogin end private final FloodgateHook floodgateHook; - public JoinManagement(FastLoginCore core, AuthPlugin

authHook) { @@ -516,7 +516,7 @@ index 5490673..dabe324 100644 - this.authHook = authHook; this.floodgateHook = new FloodgateHook<>(core); } -+ // LimeLogin stop ++ // LimeLogin end + public void onLogin(String username, S source) { @@ -524,12 +524,12 @@ index 5490673..dabe324 100644 @@ -130,7 +133,7 @@ public abstract class JoinManagement

{ //end of Govindas comment - // LimeLogin stop + // LimeLogin end - if (core.getConfig().get("autoRegister", false) && (authHook == null)) { + if (core.getConfig().get("autoRegister", false)) { // LimeLogin start requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD - // LimeLogin stop + // LimeLogin end -- 2.32.0.windows.1 -- 2.45.0 From 3d255be565fb782b888654238f07c27f2d9f20bf Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:44:35 +0400 Subject: [PATCH 04/13] class GovindasPreSecondAttemptEvent to LimePreLoginSecondAttemptEvent --- ...vindasPreSecondAttemptEvent-to-LimeP.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 FastLogin-Patches/0003-renamed-class-GovindasPreSecondAttemptEvent-to-LimeP.patch diff --git a/FastLogin-Patches/0003-renamed-class-GovindasPreSecondAttemptEvent-to-LimeP.patch b/FastLogin-Patches/0003-renamed-class-GovindasPreSecondAttemptEvent-to-LimeP.patch new file mode 100644 index 0000000..a78345c --- /dev/null +++ b/FastLogin-Patches/0003-renamed-class-GovindasPreSecondAttemptEvent-to-LimeP.patch @@ -0,0 +1,55 @@ +From c9c01ec47ebcf745765f9c086083315fb791e170 Mon Sep 17 00:00:00 2001 +From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> +Date: Wed, 16 Jun 2021 18:43:32 +0400 +Subject: [PATCH] renamed class GovindasPreSecondAttemptEvent to + LimePreLoginSecondAttemptEvent + + +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +index 3f05090..099df66 100644 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java ++++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +@@ -34,7 +34,7 @@ import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent; + + import java.util.Optional; + +-import com.github.games647.fastlogin.core.shared.event.GovindasPreSecondAttemptEvent; ++import com.github.games647.fastlogin.core.shared.event.LimePreLoginSecondAttemptEvent; + import net.md_5.bungee.api.ProxyServer; + import org.geysermc.floodgate.api.player.FloodgatePlayer; + +@@ -83,7 +83,7 @@ public abstract class JoinManagement

{ + } else { + if (core.getPendingLogin().remove(ip + username) != null && config.get("secondAttemptCracked", false)) { + // LimeLogin start +- GovindasPreSecondAttemptEvent event = new GovindasPreSecondAttemptEvent(ip, username); ++ LimePreLoginSecondAttemptEvent event = new LimePreLoginSecondAttemptEvent(ip, username); + ProxyServer.getInstance().getPluginManager().callEvent(event); + if (!event.isCancelled()) { + core.getPlugin().getLog().info("Second attempt login -> cracked {}", username); +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/event/GovindasPreSecondAttemptEvent.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/event/LimePreLoginSecondAttemptEvent.java +similarity index 78% +rename from core/src/main/java/com/github/games647/fastlogin/core/shared/event/GovindasPreSecondAttemptEvent.java +rename to core/src/main/java/com/github/games647/fastlogin/core/shared/event/LimePreLoginSecondAttemptEvent.java +index 5ac3cc9..1f9807d 100644 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/event/GovindasPreSecondAttemptEvent.java ++++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/event/LimePreLoginSecondAttemptEvent.java +@@ -4,13 +4,13 @@ package com.github.games647.fastlogin.core.shared.event; + import net.md_5.bungee.api.plugin.Cancellable; + import net.md_5.bungee.api.plugin.Event; + +-public class GovindasPreSecondAttemptEvent extends Event implements Cancellable { ++public class LimePreLoginSecondAttemptEvent extends Event implements Cancellable { + + private final String ip; + private final String username; + private boolean cancelled; + +- public GovindasPreSecondAttemptEvent(String ip, String username) { ++ public LimePreLoginSecondAttemptEvent(String ip, String username) { + this.ip = ip; + this.username = username; + } +-- +2.32.0.windows.1 + -- 2.45.0 From e7b85e498c1a3d9c49000b4b8e5ca258a60a8eb9 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Tue, 15 Jun 2021 02:30:29 +0400 Subject: [PATCH 05/13] removed all auth hooks stuff --- ...removed-hooks-and-commented-them-out.patch | 68 +++ .../0004-deleted-unwanted-classes.patch | 263 +++++++++ ...0005-Removing-all-Auth-related-stuff.patch | 535 ++++++++++++++++++ 3 files changed, 866 insertions(+) create mode 100644 FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch create mode 100644 FastLogin-Patches/0004-deleted-unwanted-classes.patch create mode 100644 FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch new file mode 100644 index 0000000..a39306f --- /dev/null +++ b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch @@ -0,0 +1,68 @@ +From d85a4cd57426f484fa46c9149dd9ace7ebc77170 Mon Sep 17 00:00:00 2001 +From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> +Date: Tue, 15 Jun 2021 02:09:53 +0400 +Subject: [PATCH] removed hooks and commented them out + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +index e26b271..25f1ac2 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +@@ -25,9 +25,6 @@ + */ + package com.github.games647.fastlogin.bungee; + +-import com.github.games647.fastlogin.bungee.hook.BungeeAuthHook; +-import com.github.games647.fastlogin.bungee.hook.BungeeCordAuthenticatorBungeeHook; +-import com.github.games647.fastlogin.bungee.hook.SodionAuthHook; + import com.github.games647.fastlogin.bungee.listener.ConnectListener; + import com.github.games647.fastlogin.bungee.listener.PluginMessageListener; + import com.github.games647.fastlogin.core.AsyncScheduler; +@@ -50,7 +47,6 @@ import java.util.List; + import java.util.concurrent.ConcurrentMap; + import java.util.concurrent.ThreadFactory; + +-import net.md_5.bungee.BungeeServerInfo; + import net.md_5.bungee.api.CommandSender; + import net.md_5.bungee.api.chat.TextComponent; + import net.md_5.bungee.api.connection.PendingConnection; +@@ -102,8 +98,9 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin>> hooks = Arrays.asList( +- BungeeAuthHook.class, BungeeCordAuthenticatorBungeeHook.class, SodionAuthHook.class); ++ try { ++ List>> hooks = Arrays.asList(); + + for (Class> clazz : hooks) { + String pluginName = clazz.getSimpleName(); +@@ -141,7 +139,8 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin +Date: Tue, 15 Jun 2021 02:10:12 +0400 +Subject: [PATCH] deleted unwanted classes + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java +deleted file mode 100644 +index abddb17..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java ++++ /dev/null +@@ -1,65 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +- +-import me.vik1395.BungeeAuth.Main; +-import me.vik1395.BungeeAuthAPI.RequestHandler; +- +-import net.md_5.bungee.api.connection.ProxiedPlayer; +- +-/** +- * GitHub: https://github.com/vik1395/BungeeAuth-Minecraft +- * +- * Project page: +- * +- * Spigot: https://www.spigotmc.org/resources/bungeeauth.493/ +- */ +-public class BungeeAuthHook implements AuthPlugin { +- +- private final RequestHandler requestHandler = new RequestHandler(); +- +- public BungeeAuthHook(FastLoginBungee plugin) { +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- String playerName = player.getName(); +- return Main.plonline.contains(playerName) || requestHandler.forceLogin(playerName); +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- return requestHandler.isRegistered(playerName); +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- return requestHandler.forceRegister(player, password); +- } +-} +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java +deleted file mode 100644 +index beb56d9..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java ++++ /dev/null +@@ -1,93 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import java.sql.SQLException; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +- +-import de.xxschrandxx.bca.bungee.BungeeCordAuthenticatorBungee; +-import de.xxschrandxx.bca.bungee.api.BungeeCordAuthenticatorBungeeAPI; +- +-import net.md_5.bungee.api.connection.ProxiedPlayer; +- +-/** +- * GitHub: +- * https://github.com/xXSchrandXx/SpigotPlugins/tree/master/BungeeCordAuthenticator +- * +- * Project page: +- * +- * Spigot: https://www.spigotmc.org/resources/bungeecordauthenticator.87669/ +- */ +-public class BungeeCordAuthenticatorBungeeHook implements AuthPlugin { +- +- public final BungeeCordAuthenticatorBungeeAPI api; +- +- public BungeeCordAuthenticatorBungeeHook(FastLoginBungee plugin) { +- api = ((BungeeCordAuthenticatorBungee) plugin.getProxy().getPluginManager() +- .getPlugin("BungeeCordAuthenticatorBungee")).getAPI(); +- plugin.getLog().info("BungeeCordAuthenticatorHook | Hooked successful!"); +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- if (api.isAuthenticated(player)) { +- return true; +- } else { +- try { +- api.setAuthenticated(player); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- return true; +- } +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- try { +- return api.getSQL().checkPlayerEntry(playerName); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- try { +- return api.createPlayerEntry(player, password); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- } +-} +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java +deleted file mode 100644 +index c12f2b0..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java ++++ /dev/null +@@ -1,78 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import red.mohist.sodionauth.bungee.implementation.BungeePlayer; +-import red.mohist.sodionauth.core.SodionAuthApi; +-import red.mohist.sodionauth.core.exception.AuthenticatedException; +- +-/** +- * GitHub: https://github.com/Mohist-Community/SodionAuth +- *

+- * Project page: https://gitea.e-loli.com/SodionAuth/SodionAuth +- *

+- * Bukkit: Unknown +- *

+- * Spigot: https://www.spigotmc.org/resources/sodionauth.76944/ +- */ +-public class SodionAuthHook implements AuthPlugin { +- +- private final FastLoginBungee plugin; +- +- public SodionAuthHook(FastLoginBungee plugin) { +- this.plugin = plugin; +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- try { +- SodionAuthApi.login(new BungeePlayer(player)); +- } catch (AuthenticatedException e) { +- plugin.getLog().warn(ALREADY_AUTHENTICATED, player); +- return false; +- } +- return true; +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- try{ +- return SodionAuthApi.register(new BungeePlayer(player), password); +- } catch (UnsupportedOperationException e){ +- plugin.getLog().warn("Currently SodionAuth is not accepting forceRegister, " + +- "It may be caused by unsupported AuthBackend"); +- return false; +- } +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- return SodionAuthApi.isRegistered(playerName); +- } +-} +-- +2.32.0.windows.1 + diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch new file mode 100644 index 0000000..5d3a766 --- /dev/null +++ b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch @@ -0,0 +1,535 @@ +From 4975802f5fcea2ef9cfa06df8b9a0939961ff935 Mon Sep 17 00:00:00 2001 +From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> +Date: Tue, 15 Jun 2021 02:28:50 +0400 +Subject: [PATCH] Removing all Auth related stuff + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +index 25f1ac2..ec6f74a 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +@@ -29,7 +29,6 @@ import com.github.games647.fastlogin.bungee.listener.ConnectListener; + import com.github.games647.fastlogin.bungee.listener.PluginMessageListener; + import com.github.games647.fastlogin.core.AsyncScheduler; + import com.github.games647.fastlogin.core.CommonUtil; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.message.ChangePremiumMessage; + import com.github.games647.fastlogin.core.message.ChannelMessage; + import com.github.games647.fastlogin.core.message.NamespaceKey; +@@ -42,8 +41,6 @@ import com.google.common.io.ByteStreams; + import com.google.common.util.concurrent.ThreadFactoryBuilder; + + import java.nio.file.Path; +-import java.util.Arrays; +-import java.util.List; + import java.util.concurrent.ConcurrentMap; + import java.util.concurrent.ThreadFactory; + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java +index db8f269..07df30a 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java +@@ -32,7 +32,6 @@ import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateHook; + import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateV1Hook; + import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateV2Hook; + import com.github.games647.fastlogin.bungee.task.AsyncPremiumCheck; +-import com.github.games647.fastlogin.bungee.task.ForceLoginTask; + import com.github.games647.fastlogin.core.RateLimiter; + import com.github.games647.fastlogin.core.StoredProfile; + import com.github.games647.fastlogin.core.shared.LoginSession; +@@ -249,8 +248,12 @@ public class ConnectListener implements Listener { + // delay sending force command, because Paper will process the login event asynchronously + // In this case it means that the force command (plugin message) is already received and processed while + // player is still in the login phase and reported to be offline. +- Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); +- plugin.getScheduler().runAsync(loginTask); ++ ++ // LimeLogin start ++ //Disabled... ++ //Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); ++ //plugin.getScheduler().runAsync(loginTask); ++ // LimeLogin stop + } + + @EventHandler +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java +index 410b1e4..0136f09 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java +@@ -49,8 +49,9 @@ public class AsyncPremiumCheck extends JoinManagement +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.task; +- +-import com.github.games647.fastlogin.bungee.BungeeLoginSession; +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.bungee.event.BungeeFastLoginAutoLoginEvent; +-import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.message.ChannelMessage; +-import com.github.games647.fastlogin.core.message.LoginActionMessage; +-import com.github.games647.fastlogin.core.message.LoginActionMessage.Type; +-import com.github.games647.fastlogin.core.shared.FastLoginCore; +-import com.github.games647.fastlogin.core.shared.ForceLoginManagement; +-import com.github.games647.fastlogin.core.shared.LoginSession; +-import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent; +- +-import java.util.UUID; +- +-import net.md_5.bungee.api.CommandSender; +-import net.md_5.bungee.api.ProxyServer; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.api.connection.Server; +- +-public class ForceLoginTask +- extends ForceLoginManagement { +- +- private final Server server; +- +- public ForceLoginTask(FastLoginCore core, +- ProxiedPlayer player, Server server, BungeeLoginSession session) { +- super(core, player, session); +- +- this.server = server; +- } +- +- @Override +- public void run() { +- if (session == null) { +- return; +- } +- +- super.run(); +- +- if (!isOnlineMode()) { +- session.setAlreadySaved(true); +- } +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- if (session.isAlreadyLogged()) { +- return true; +- } +- +- session.setAlreadyLogged(true); +- return super.forceLogin(player); +- } +- +- @Override +- public FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile) { +- return core.getPlugin().getProxy().getPluginManager() +- .callEvent(new BungeeFastLoginAutoLoginEvent(session, profile)); +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player) { +- return session.isAlreadyLogged() || super.forceRegister(player); +- } +- +- @Override +- public void onForceActionSuccess(LoginSession session) { +- //sub channel name +- Type type = Type.LOGIN; +- if (session.needsRegistration()) { +- type = Type.REGISTER; +- } +- +- UUID proxyId = UUID.fromString(ProxyServer.getInstance().getConfig().getUuid()); +- ChannelMessage loginMessage = new LoginActionMessage(type, player.getName(), proxyId); +- +- core.getPlugin().sendPluginMessage(server, loginMessage); +- } +- +- @Override +- public String getName(ProxiedPlayer player) { +- return player.getName(); +- } +- +- @Override +- public boolean isOnline(ProxiedPlayer player) { +- return player.isConnected(); +- } +- +- @Override +- public boolean isOnlineMode() { +- return player.getPendingConnection().isOnlineMode(); +- } +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java b/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java +deleted file mode 100644 +index 1a614ba..0000000 +--- a/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java ++++ /dev/null +@@ -1,87 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.core.hooks; +- +-/** +- * Represents a supporting authentication plugin in BungeeCord and Bukkit/Spigot/... servers +- * +- * @param

either {@link org.bukkit.entity.Player} for Bukkit or {@link net.md_5.bungee.api.connection.ProxiedPlayer} +- * for BungeeCord +- */ +-public interface AuthPlugin

{ +- +- String ALREADY_AUTHENTICATED = "Player {} is already authenticated. Cancelling force login."; +- +- /** +- * Login the premium (paid account) player after the player joined successfully the server. +- * +- * This operation will be performed async while the player successfully +- * joined the server. +- * +- * @param player the player that needs to be logged in +- * @return if the operation was successful +- */ +- boolean forceLogin(P player); +- +- /** +- * Forces a register in order to protect the paid account. +- * +- * This operation will be performed async while the player successfully +- * 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 +- * if possible. +- * +- * Background: If we don't register an account, cracked players +- * could steal the unregistered account from the paid +- * player account +- * +- * @param player the premium account +- * @param password a strong random generated password +- * @return if the operation was successful +- */ +- boolean forceRegister(P player, String password); +- +- /** +- * Checks whether an account exists for this player name. +- * +- * This check should check if a cracked player account exists +- * 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 +- * @throws Exception if an error occurred +- */ +- boolean isRegistered(String playerName) throws Exception; +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java +index ec3f924..90c9add 100644 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java ++++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java +@@ -30,7 +30,6 @@ import com.github.games647.craftapi.resolver.http.RotatingProxySelector; + import com.github.games647.fastlogin.core.AuthStorage; + import com.github.games647.fastlogin.core.CommonUtil; + import com.github.games647.fastlogin.core.RateLimiter; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.hooks.DefaultPasswordGenerator; + import com.github.games647.fastlogin.core.hooks.PasswordGenerator; + import com.google.common.net.HostAndPort; +@@ -85,8 +84,9 @@ public class FastLoginCore

> { + private AuthStorage storage; + private RateLimiter rateLimiter; + private PasswordGenerator

passwordGenerator = new DefaultPasswordGenerator<>(); +- private AuthPlugin

authPlugin; +- ++ // LimeLogin start ++ //private AuthPlugin

authPlugin; ++ // LimeLogin stop + public FastLoginCore(T plugin) { + this.plugin = plugin; + } +@@ -251,17 +251,25 @@ public class FastLoginCore

> { + return pendingConfirms; + } + ++ // LimeLogin start ++ /* + public AuthPlugin

getAuthPluginHook() { + return authPlugin; + } ++ */ ++ // LimeLogin stop + + public RateLimiter getRateLimiter() { + return rateLimiter; + } + ++ // LimeLogin start ++ /* + public void setAuthPluginHook(AuthPlugin

authPlugin) { + this.authPlugin = authPlugin; + } ++ */ ++ // LimeLogin stop + + public void saveDefaultFile(String fileName) { + Path dataFolder = plugin.getPluginFolder(); +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java +deleted file mode 100644 +index b417e64..0000000 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java ++++ /dev/null +@@ -1,143 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.core.shared; +- +-import com.github.games647.fastlogin.core.AuthStorage; +-import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +-import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent; +- +-public abstract class ForceLoginManagement

> +- implements Runnable { +- +- protected final FastLoginCore core; +- protected final P player; +- protected final L session; +- +- public ForceLoginManagement(FastLoginCore core, P player, L session) { +- this.core = core; +- this.player = player; +- this.session = session; +- } +- +- @Override +- public void run() { +- if (!isOnline(player)) { +- core.getPlugin().getLog().info("Player {} disconnected", player); +- return; +- } +- +- if (session == null) { +- core.getPlugin().getLog().info("No valid session found for {}", player); +- return; +- } +- +- AuthStorage storage = core.getStorage(); +- StoredProfile playerProfile = session.getProfile(); +- try { +- if (isOnlineMode()) { +- //premium player +- AuthPlugin

authPlugin = core.getAuthPluginHook(); +- if (authPlugin == null) { +- //maybe only bungeecord plugin +- onForceActionSuccess(session); +- } else { +- boolean success = true; +- String playerName = getName(player); +- if (core.getConfig().get("autoLogin", true)) { +- if (session.needsRegistration() +- || (core.getConfig().get("auto-register-unknown", false) +- && !authPlugin.isRegistered(playerName))) { +- success = forceRegister(player); +- } else if (!callFastLoginAutoLoginEvent(session, playerProfile).isCancelled()) { +- success = forceLogin(player); +- } +- } +- +- if (success) { +- //update only on success to prevent corrupt data +- if (playerProfile != null) { +- playerProfile.setId(session.getUuid()); +- playerProfile.setPremium(true); +- storage.save(playerProfile); +- } +- +- onForceActionSuccess(session); +- } +- } +- } else if (playerProfile != null) { +- //cracked player +- playerProfile.setId(null); +- playerProfile.setPremium(false); +- // LimeLogin start +- +- //Govindas comment - don't save cracked player profiles, I found it to be useless +- //storage.save(playerProfile); +- //end of Govindas comment +- +- // LimeLogin stop +- } +- } catch (Exception ex) { +- core.getPlugin().getLog().warn("ERROR ON FORCE LOGIN of {}", getName(player), ex); +- } +- } +- +- public boolean forceRegister(P player) { +- core.getPlugin().getLog().info("Register player {}", getName(player)); +- +- String generatedPassword = core.getPasswordGenerator().getRandomPassword(player); +- boolean success = core.getAuthPluginHook().forceRegister(player, generatedPassword); +- +- String message = core.getMessage("auto-register"); +- if (success && message != null) { +- message = message.replace("%password", generatedPassword); +- core.getPlugin().sendMessage(player, message); +- } +- +- return success; +- } +- +- public boolean forceLogin(P player) { +- core.getPlugin().getLog().info("Logging player {} in", getName(player)); +- +- boolean success = core.getAuthPluginHook().forceLogin(player); +- if (success) { +- core.sendLocaleMessage("auto-login", player); +- } +- +- return success; +- } +- +- public abstract FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile); +- +- public abstract void onForceActionSuccess(LoginSession session); +- +- public abstract String getName(P player); +- +- public abstract boolean isOnline(P player); +- +- public abstract boolean isOnlineMode(); +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +index 5490673..dabe324 100644 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java ++++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +@@ -28,7 +28,6 @@ package com.github.games647.fastlogin.core.shared; + import com.github.games647.craftapi.model.Profile; + import com.github.games647.craftapi.resolver.RateLimitException; + import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.hooks.FloodgateHook; + import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent; + +@@ -43,14 +42,18 @@ import net.md_5.bungee.config.Configuration; + public abstract class JoinManagement

{ + + protected final FastLoginCore core; +- protected final AuthPlugin

authHook; ++ // LimeLogin start ++ //protected final AuthPlugin

authHook; ++ // LimeLogin stop + private final FloodgateHook floodgateHook; + +- public JoinManagement(FastLoginCore core, AuthPlugin

authHook) { ++ // LimeLogin start ++ public JoinManagement(FastLoginCore core) { + this.core = core; +- this.authHook = authHook; + this.floodgateHook = new FloodgateHook<>(core); + } ++ // LimeLogin stop ++ + + public void onLogin(String username, S source) { + core.getPlugin().getLog().info("Handling player {}", username); +@@ -130,7 +133,7 @@ public abstract class JoinManagement

{ + //end of Govindas comment + + // LimeLogin stop +- if (core.getConfig().get("autoRegister", false) && (authHook == null)) { ++ if (core.getConfig().get("autoRegister", false)) { + // LimeLogin start + requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD + // LimeLogin stop +-- +2.32.0.windows.1 + -- 2.45.0 From b97bf39a9d3d4f9eb3cbdd5a0be7ab894b2698f0 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:38:57 +0400 Subject: [PATCH 06/13] related to main --- ...removed-hooks-and-commented-them-out.patch | 4 ++-- ...0005-Removing-all-Auth-related-stuff.patch | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch index a39306f..b2c2a1f 100644 --- a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch +++ b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch @@ -34,7 +34,7 @@ index e26b271..25f1ac2 100644 - registerHook(); + // LimeLogin start + //registerHook(); -+ // LimeLogin stop ++ // LimeLogin end } @Override @@ -59,7 +59,7 @@ index e26b271..25f1ac2 100644 } - } + } */ -+ // LimeLogin stop ++ // LimeLogin end public void sendPluginMessage(Server server, ChannelMessage message) { if (server != null) { diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch index 5d3a766..394ce3d 100644 --- a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch +++ b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch @@ -48,7 +48,7 @@ index db8f269..07df30a 100644 + //Disabled... + //Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); + //plugin.getScheduler().runAsync(loginTask); -+ // LimeLogin stop ++ // LimeLogin end } @EventHandler @@ -64,7 +64,7 @@ index 410b1e4..0136f09 100644 - + // LimeLogin start + super(plugin.getCore()); -+ // LimeLogin stop ++ // LimeLogin end this.plugin = plugin; this.preLoginEvent = preLoginEvent; this.connection = connection; @@ -308,7 +308,7 @@ index ec3f924..90c9add 100644 - + // LimeLogin start + //private AuthPlugin

authPlugin; -+ // LimeLogin stop ++ // LimeLogin end public FastLoginCore(T plugin) { this.plugin = plugin; } @@ -322,7 +322,7 @@ index ec3f924..90c9add 100644 return authPlugin; } + */ -+ // LimeLogin stop ++ // LimeLogin end public RateLimiter getRateLimiter() { return rateLimiter; @@ -334,7 +334,7 @@ index ec3f924..90c9add 100644 this.authPlugin = authPlugin; } + */ -+ // LimeLogin stop ++ // LimeLogin end public void saveDefaultFile(String fileName) { Path dataFolder = plugin.getPluginFolder(); @@ -444,7 +444,7 @@ index b417e64..0000000 - //storage.save(playerProfile); - //end of Govindas comment - -- // LimeLogin stop +- // LimeLogin end - } - } catch (Exception ex) { - core.getPlugin().getLog().warn("ERROR ON FORCE LOGIN of {}", getName(player), ex); @@ -506,7 +506,7 @@ index 5490673..dabe324 100644 - protected final AuthPlugin

authHook; + // LimeLogin start + //protected final AuthPlugin

authHook; -+ // LimeLogin stop ++ // LimeLogin end private final FloodgateHook floodgateHook; - public JoinManagement(FastLoginCore core, AuthPlugin

authHook) { @@ -516,7 +516,7 @@ index 5490673..dabe324 100644 - this.authHook = authHook; this.floodgateHook = new FloodgateHook<>(core); } -+ // LimeLogin stop ++ // LimeLogin end + public void onLogin(String username, S source) { @@ -524,12 +524,12 @@ index 5490673..dabe324 100644 @@ -130,7 +133,7 @@ public abstract class JoinManagement

{ //end of Govindas comment - // LimeLogin stop + // LimeLogin end - if (core.getConfig().get("autoRegister", false) && (authHook == null)) { + if (core.getConfig().get("autoRegister", false)) { // LimeLogin start requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD - // LimeLogin stop + // LimeLogin end -- 2.32.0.windows.1 -- 2.45.0 From 01afa297098216a698857b80e79b56a556f8da38 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 21:03:29 +0400 Subject: [PATCH 07/13] Update 0001-preparing-for-first-patch.patch --- .../0001-preparing-for-first-patch.patch | 80 ++++++++++++++----- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/FastLogin-Patches/0001-preparing-for-first-patch.patch b/FastLogin-Patches/0001-preparing-for-first-patch.patch index 5e95d1b..3dc87b2 100644 --- a/FastLogin-Patches/0001-preparing-for-first-patch.patch +++ b/FastLogin-Patches/0001-preparing-for-first-patch.patch @@ -1,6 +1,6 @@ -From 8d20670f827b3ff5ba81e967c5e60f97f29b14bf Mon Sep 17 00:00:00 2001 +From d545aec339fe904999ead07c9222f0310f4c5812 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> -Date: Mon, 14 Jun 2021 21:12:13 +0400 +Date: Wed, 16 Jun 2021 20:58:08 +0400 Subject: [PATCH] preparing for first patch @@ -14587,10 +14587,10 @@ index 46321d3..0000000 -} 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 deleted file mode 100644 -index 02cf086..0000000 +index 74d4220..0000000 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java +++ /dev/null -@@ -1,305 +0,0 @@ +@@ -1,306 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * @@ -14849,6 +14849,7 @@ index 02cf086..0000000 - *

    - *
  • allowFloodgateNameConflict - *
  • autoLoginFloodgate +- *
  • autoRegisterFloodgate - *
- *

- * @@ -14857,7 +14858,7 @@ index 02cf086..0000000 - */ - private boolean isValidFloodgateConfigString(String key) { - String value = core.getConfig().get(key).toString().toLowerCase(); -- if (!value.equals("true") && !value.equals("linked") && !value.equals("false")) { +- if (!value.equals("true") && !value.equals("linked") && !value.equals("false") && !value.equals("no-conflict")) { - logger.error("Invalid value detected for {} in FastLogin/config.yml.", key); - return false; - } @@ -17289,10 +17290,10 @@ index 042950b..0000000 -} diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java deleted file mode 100644 -index e126637..0000000 +index 10239f0..0000000 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/VerifyResponseTask.java +++ /dev/null -@@ -1,287 +0,0 @@ +@@ -1,295 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * @@ -17334,10 +17335,7 @@ index e126637..0000000 -import com.github.games647.craftapi.resolver.MojangResolver; -import com.github.games647.fastlogin.bukkit.BukkitLoginSession; -import com.github.games647.fastlogin.bukkit.FastLoginBukkit; --import org.bukkit.entity.Player; - --import javax.crypto.Cipher; --import javax.crypto.SecretKey; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; @@ -17351,11 +17349,23 @@ index e126637..0000000 -import java.util.Optional; -import java.util.UUID; - +-import javax.crypto.Cipher; +-import javax.crypto.SecretKey; +- +-import org.bukkit.entity.Player; +- -import static com.comphenix.protocol.PacketType.Login.Client.START; -import static com.comphenix.protocol.PacketType.Login.Server.DISCONNECT; - -public class VerifyResponseTask implements Runnable { - +- private static final String ENCRYPTION_CLASS_NAME = "MinecraftEncryption"; +- private static final Class ENCRYPTION_CLASS; +- +- static { +- ENCRYPTION_CLASS = MinecraftReflection.getMinecraftClass("util." + ENCRYPTION_CLASS_NAME, ENCRYPTION_CLASS_NAME); +- } +- - private final FastLoginBukkit plugin; - private final PacketEvent packetEvent; - private final KeyPair serverKey; @@ -17509,8 +17519,7 @@ index e126637..0000000 - .getMethodByParameters("a", Cipher.class, Cipher.class); - - // Get the needed Cipher helper method (used to generate ciphers from login key) -- Class encryptionClass = MinecraftReflection.getMinecraftClass("MinecraftEncryption"); -- cipherMethod = FuzzyReflection.fromClass(encryptionClass) +- cipherMethod = FuzzyReflection.fromClass(ENCRYPTION_CLASS) - .getMethodByParameters("a", int.class, Key.class); - } - } @@ -17922,10 +17931,10 @@ index c5dcc9c..0000000 -} diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/task/FloodgateAuthTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/task/FloodgateAuthTask.java deleted file mode 100644 -index 45c74a7..0000000 +index 2900256..0000000 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/task/FloodgateAuthTask.java +++ /dev/null -@@ -1,96 +0,0 @@ +@@ -1,127 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * @@ -17953,10 +17962,15 @@ index 45c74a7..0000000 - */ -package com.github.games647.fastlogin.bukkit.task; - +-import java.io.IOException; +-import java.util.Optional; +- -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; -import org.geysermc.floodgate.api.player.FloodgatePlayer; - +-import com.github.games647.craftapi.model.Profile; +-import com.github.games647.craftapi.resolver.RateLimitException; -import com.github.games647.fastlogin.bukkit.BukkitLoginSession; -import com.github.games647.fastlogin.bukkit.FastLoginBukkit; -import com.github.games647.fastlogin.core.StoredProfile; @@ -17982,11 +17996,11 @@ index 45c74a7..0000000 - - // check if the Bedrock player is linked to a Java account - boolean isLinked = floodgatePlayer.getLinkedPlayer() != null; -- - AuthPlugin authPlugin = plugin.getCore().getAuthPluginHook(); - - String autoLoginFloodgate = plugin.getCore().getConfig().get("autoLoginFloodgate").toString().toLowerCase(); -- boolean autoRegisterFloodgate = plugin.getCore().getConfig().getBoolean("autoRegisterFloodgate"); +- String autoRegisterFloodgate = plugin.getCore().getConfig().get("autoRegisterFloodgate").toString().toLowerCase(); +- String allowNameConflict = plugin.getCore().getConfig().get("allowFloodgateNameConflict").toString().toLowerCase(); - - boolean isRegistered; - try { @@ -17997,13 +18011,39 @@ index 45c74a7..0000000 - player.getName()); - return; - } -- -- if (!isRegistered && !autoRegisterFloodgate) { +- +- //decide if checks should be made for conflicting Java player names +- if (!isLinked //linked players have the same name as their Java profile +- // if allowNameConflict is 'false' or 'linked' and the player had a conflicting +- // name, than they would have been kicked in FloodgateHook#checkNameConflict +- && allowNameConflict.equals("true") && +- ( +- autoLoginFloodgate.equals("no-conflict") +- || !isRegistered && autoRegisterFloodgate.equals("no-conflict")) +- ) { +- // check for conflicting Premium Java name +- Optional premiumUUID = Optional.empty(); +- try { +- premiumUUID = plugin.getCore().getResolver().findProfile(player.getName()); +- } catch (IOException | RateLimitException e) { +- plugin.getLog().error( +- "Could not check wether Floodgate Player {}'s name conflits a premium Java player's name.", +- player.getName()); +- return; +- } +- +- //stop execution if player's name is conflicting +- if (premiumUUID.isPresent()) { +- return; +- } +- } +- +- if (!isRegistered && autoRegisterFloodgate.equals("false")) { - plugin.getLog().info( - "Auto registration is disabled for Floodgate players in config.yml"); - return; - } -- +- - // logging in from bedrock for a second time threw an error with UUID - StoredProfile profile = plugin.getCore().getStorage().loadProfile(player.getName()); - if (profile == null) { @@ -18011,7 +18051,7 @@ index 45c74a7..0000000 - } - - BukkitLoginSession session = new BukkitLoginSession(player.getName(), isRegistered, profile); -- +- - // enable auto login based on the value of 'autoLoginFloodgate' in config.yml - session.setVerified(autoLoginFloodgate.equals("true") - || (autoLoginFloodgate.equals("linked") && isLinked)); -- 2.45.0 From 80af642a40e0850a10949740dcc17eb0fc1ee602 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Tue, 15 Jun 2021 02:30:29 +0400 Subject: [PATCH 08/13] removed all auth hooks stuff --- ...removed-hooks-and-commented-them-out.patch | 68 +++ .../0004-deleted-unwanted-classes.patch | 263 +++++++++ ...0005-Removing-all-Auth-related-stuff.patch | 535 ++++++++++++++++++ 3 files changed, 866 insertions(+) create mode 100644 FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch create mode 100644 FastLogin-Patches/0004-deleted-unwanted-classes.patch create mode 100644 FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch new file mode 100644 index 0000000..a39306f --- /dev/null +++ b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch @@ -0,0 +1,68 @@ +From d85a4cd57426f484fa46c9149dd9ace7ebc77170 Mon Sep 17 00:00:00 2001 +From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> +Date: Tue, 15 Jun 2021 02:09:53 +0400 +Subject: [PATCH] removed hooks and commented them out + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +index e26b271..25f1ac2 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +@@ -25,9 +25,6 @@ + */ + package com.github.games647.fastlogin.bungee; + +-import com.github.games647.fastlogin.bungee.hook.BungeeAuthHook; +-import com.github.games647.fastlogin.bungee.hook.BungeeCordAuthenticatorBungeeHook; +-import com.github.games647.fastlogin.bungee.hook.SodionAuthHook; + import com.github.games647.fastlogin.bungee.listener.ConnectListener; + import com.github.games647.fastlogin.bungee.listener.PluginMessageListener; + import com.github.games647.fastlogin.core.AsyncScheduler; +@@ -50,7 +47,6 @@ import java.util.List; + import java.util.concurrent.ConcurrentMap; + import java.util.concurrent.ThreadFactory; + +-import net.md_5.bungee.BungeeServerInfo; + import net.md_5.bungee.api.CommandSender; + import net.md_5.bungee.api.chat.TextComponent; + import net.md_5.bungee.api.connection.PendingConnection; +@@ -102,8 +98,9 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin>> hooks = Arrays.asList( +- BungeeAuthHook.class, BungeeCordAuthenticatorBungeeHook.class, SodionAuthHook.class); ++ try { ++ List>> hooks = Arrays.asList(); + + for (Class> clazz : hooks) { + String pluginName = clazz.getSimpleName(); +@@ -141,7 +139,8 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin +Date: Tue, 15 Jun 2021 02:10:12 +0400 +Subject: [PATCH] deleted unwanted classes + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java +deleted file mode 100644 +index abddb17..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java ++++ /dev/null +@@ -1,65 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +- +-import me.vik1395.BungeeAuth.Main; +-import me.vik1395.BungeeAuthAPI.RequestHandler; +- +-import net.md_5.bungee.api.connection.ProxiedPlayer; +- +-/** +- * GitHub: https://github.com/vik1395/BungeeAuth-Minecraft +- * +- * Project page: +- * +- * Spigot: https://www.spigotmc.org/resources/bungeeauth.493/ +- */ +-public class BungeeAuthHook implements AuthPlugin { +- +- private final RequestHandler requestHandler = new RequestHandler(); +- +- public BungeeAuthHook(FastLoginBungee plugin) { +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- String playerName = player.getName(); +- return Main.plonline.contains(playerName) || requestHandler.forceLogin(playerName); +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- return requestHandler.isRegistered(playerName); +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- return requestHandler.forceRegister(player, password); +- } +-} +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java +deleted file mode 100644 +index beb56d9..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java ++++ /dev/null +@@ -1,93 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import java.sql.SQLException; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +- +-import de.xxschrandxx.bca.bungee.BungeeCordAuthenticatorBungee; +-import de.xxschrandxx.bca.bungee.api.BungeeCordAuthenticatorBungeeAPI; +- +-import net.md_5.bungee.api.connection.ProxiedPlayer; +- +-/** +- * GitHub: +- * https://github.com/xXSchrandXx/SpigotPlugins/tree/master/BungeeCordAuthenticator +- * +- * Project page: +- * +- * Spigot: https://www.spigotmc.org/resources/bungeecordauthenticator.87669/ +- */ +-public class BungeeCordAuthenticatorBungeeHook implements AuthPlugin { +- +- public final BungeeCordAuthenticatorBungeeAPI api; +- +- public BungeeCordAuthenticatorBungeeHook(FastLoginBungee plugin) { +- api = ((BungeeCordAuthenticatorBungee) plugin.getProxy().getPluginManager() +- .getPlugin("BungeeCordAuthenticatorBungee")).getAPI(); +- plugin.getLog().info("BungeeCordAuthenticatorHook | Hooked successful!"); +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- if (api.isAuthenticated(player)) { +- return true; +- } else { +- try { +- api.setAuthenticated(player); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- return true; +- } +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- try { +- return api.getSQL().checkPlayerEntry(playerName); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- try { +- return api.createPlayerEntry(player, password); +- } +- catch (SQLException e) { +- e.printStackTrace(); +- return false; +- } +- } +-} +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java +deleted file mode 100644 +index c12f2b0..0000000 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java ++++ /dev/null +@@ -1,78 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.hook; +- +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import red.mohist.sodionauth.bungee.implementation.BungeePlayer; +-import red.mohist.sodionauth.core.SodionAuthApi; +-import red.mohist.sodionauth.core.exception.AuthenticatedException; +- +-/** +- * GitHub: https://github.com/Mohist-Community/SodionAuth +- *

+- * Project page: https://gitea.e-loli.com/SodionAuth/SodionAuth +- *

+- * Bukkit: Unknown +- *

+- * Spigot: https://www.spigotmc.org/resources/sodionauth.76944/ +- */ +-public class SodionAuthHook implements AuthPlugin { +- +- private final FastLoginBungee plugin; +- +- public SodionAuthHook(FastLoginBungee plugin) { +- this.plugin = plugin; +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- try { +- SodionAuthApi.login(new BungeePlayer(player)); +- } catch (AuthenticatedException e) { +- plugin.getLog().warn(ALREADY_AUTHENTICATED, player); +- return false; +- } +- return true; +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player, String password) { +- try{ +- return SodionAuthApi.register(new BungeePlayer(player), password); +- } catch (UnsupportedOperationException e){ +- plugin.getLog().warn("Currently SodionAuth is not accepting forceRegister, " + +- "It may be caused by unsupported AuthBackend"); +- return false; +- } +- } +- +- @Override +- public boolean isRegistered(String playerName) { +- return SodionAuthApi.isRegistered(playerName); +- } +-} +-- +2.32.0.windows.1 + diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch new file mode 100644 index 0000000..5d3a766 --- /dev/null +++ b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch @@ -0,0 +1,535 @@ +From 4975802f5fcea2ef9cfa06df8b9a0939961ff935 Mon Sep 17 00:00:00 2001 +From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> +Date: Tue, 15 Jun 2021 02:28:50 +0400 +Subject: [PATCH] Removing all Auth related stuff + + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +index 25f1ac2..ec6f74a 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java +@@ -29,7 +29,6 @@ import com.github.games647.fastlogin.bungee.listener.ConnectListener; + import com.github.games647.fastlogin.bungee.listener.PluginMessageListener; + import com.github.games647.fastlogin.core.AsyncScheduler; + import com.github.games647.fastlogin.core.CommonUtil; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.message.ChangePremiumMessage; + import com.github.games647.fastlogin.core.message.ChannelMessage; + import com.github.games647.fastlogin.core.message.NamespaceKey; +@@ -42,8 +41,6 @@ import com.google.common.io.ByteStreams; + import com.google.common.util.concurrent.ThreadFactoryBuilder; + + import java.nio.file.Path; +-import java.util.Arrays; +-import java.util.List; + import java.util.concurrent.ConcurrentMap; + import java.util.concurrent.ThreadFactory; + +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java +index db8f269..07df30a 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java +@@ -32,7 +32,6 @@ import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateHook; + import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateV1Hook; + import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateV2Hook; + import com.github.games647.fastlogin.bungee.task.AsyncPremiumCheck; +-import com.github.games647.fastlogin.bungee.task.ForceLoginTask; + import com.github.games647.fastlogin.core.RateLimiter; + import com.github.games647.fastlogin.core.StoredProfile; + import com.github.games647.fastlogin.core.shared.LoginSession; +@@ -249,8 +248,12 @@ public class ConnectListener implements Listener { + // delay sending force command, because Paper will process the login event asynchronously + // In this case it means that the force command (plugin message) is already received and processed while + // player is still in the login phase and reported to be offline. +- Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); +- plugin.getScheduler().runAsync(loginTask); ++ ++ // LimeLogin start ++ //Disabled... ++ //Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); ++ //plugin.getScheduler().runAsync(loginTask); ++ // LimeLogin stop + } + + @EventHandler +diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java +index 410b1e4..0136f09 100644 +--- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java ++++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java +@@ -49,8 +49,9 @@ public class AsyncPremiumCheck extends JoinManagement +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.bungee.task; +- +-import com.github.games647.fastlogin.bungee.BungeeLoginSession; +-import com.github.games647.fastlogin.bungee.FastLoginBungee; +-import com.github.games647.fastlogin.bungee.event.BungeeFastLoginAutoLoginEvent; +-import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.message.ChannelMessage; +-import com.github.games647.fastlogin.core.message.LoginActionMessage; +-import com.github.games647.fastlogin.core.message.LoginActionMessage.Type; +-import com.github.games647.fastlogin.core.shared.FastLoginCore; +-import com.github.games647.fastlogin.core.shared.ForceLoginManagement; +-import com.github.games647.fastlogin.core.shared.LoginSession; +-import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent; +- +-import java.util.UUID; +- +-import net.md_5.bungee.api.CommandSender; +-import net.md_5.bungee.api.ProxyServer; +-import net.md_5.bungee.api.connection.ProxiedPlayer; +-import net.md_5.bungee.api.connection.Server; +- +-public class ForceLoginTask +- extends ForceLoginManagement { +- +- private final Server server; +- +- public ForceLoginTask(FastLoginCore core, +- ProxiedPlayer player, Server server, BungeeLoginSession session) { +- super(core, player, session); +- +- this.server = server; +- } +- +- @Override +- public void run() { +- if (session == null) { +- return; +- } +- +- super.run(); +- +- if (!isOnlineMode()) { +- session.setAlreadySaved(true); +- } +- } +- +- @Override +- public boolean forceLogin(ProxiedPlayer player) { +- if (session.isAlreadyLogged()) { +- return true; +- } +- +- session.setAlreadyLogged(true); +- return super.forceLogin(player); +- } +- +- @Override +- public FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile) { +- return core.getPlugin().getProxy().getPluginManager() +- .callEvent(new BungeeFastLoginAutoLoginEvent(session, profile)); +- } +- +- @Override +- public boolean forceRegister(ProxiedPlayer player) { +- return session.isAlreadyLogged() || super.forceRegister(player); +- } +- +- @Override +- public void onForceActionSuccess(LoginSession session) { +- //sub channel name +- Type type = Type.LOGIN; +- if (session.needsRegistration()) { +- type = Type.REGISTER; +- } +- +- UUID proxyId = UUID.fromString(ProxyServer.getInstance().getConfig().getUuid()); +- ChannelMessage loginMessage = new LoginActionMessage(type, player.getName(), proxyId); +- +- core.getPlugin().sendPluginMessage(server, loginMessage); +- } +- +- @Override +- public String getName(ProxiedPlayer player) { +- return player.getName(); +- } +- +- @Override +- public boolean isOnline(ProxiedPlayer player) { +- return player.isConnected(); +- } +- +- @Override +- public boolean isOnlineMode() { +- return player.getPendingConnection().isOnlineMode(); +- } +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java b/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java +deleted file mode 100644 +index 1a614ba..0000000 +--- a/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java ++++ /dev/null +@@ -1,87 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.core.hooks; +- +-/** +- * Represents a supporting authentication plugin in BungeeCord and Bukkit/Spigot/... servers +- * +- * @param

either {@link org.bukkit.entity.Player} for Bukkit or {@link net.md_5.bungee.api.connection.ProxiedPlayer} +- * for BungeeCord +- */ +-public interface AuthPlugin

{ +- +- String ALREADY_AUTHENTICATED = "Player {} is already authenticated. Cancelling force login."; +- +- /** +- * Login the premium (paid account) player after the player joined successfully the server. +- * +- * This operation will be performed async while the player successfully +- * joined the server. +- * +- * @param player the player that needs to be logged in +- * @return if the operation was successful +- */ +- boolean forceLogin(P player); +- +- /** +- * Forces a register in order to protect the paid account. +- * +- * This operation will be performed async while the player successfully +- * 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 +- * if possible. +- * +- * Background: If we don't register an account, cracked players +- * could steal the unregistered account from the paid +- * player account +- * +- * @param player the premium account +- * @param password a strong random generated password +- * @return if the operation was successful +- */ +- boolean forceRegister(P player, String password); +- +- /** +- * Checks whether an account exists for this player name. +- * +- * This check should check if a cracked player account exists +- * 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 +- * @throws Exception if an error occurred +- */ +- boolean isRegistered(String playerName) throws Exception; +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java +index ec3f924..90c9add 100644 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java ++++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java +@@ -30,7 +30,6 @@ import com.github.games647.craftapi.resolver.http.RotatingProxySelector; + import com.github.games647.fastlogin.core.AuthStorage; + import com.github.games647.fastlogin.core.CommonUtil; + import com.github.games647.fastlogin.core.RateLimiter; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.hooks.DefaultPasswordGenerator; + import com.github.games647.fastlogin.core.hooks.PasswordGenerator; + import com.google.common.net.HostAndPort; +@@ -85,8 +84,9 @@ public class FastLoginCore

> { + private AuthStorage storage; + private RateLimiter rateLimiter; + private PasswordGenerator

passwordGenerator = new DefaultPasswordGenerator<>(); +- private AuthPlugin

authPlugin; +- ++ // LimeLogin start ++ //private AuthPlugin

authPlugin; ++ // LimeLogin stop + public FastLoginCore(T plugin) { + this.plugin = plugin; + } +@@ -251,17 +251,25 @@ public class FastLoginCore

> { + return pendingConfirms; + } + ++ // LimeLogin start ++ /* + public AuthPlugin

getAuthPluginHook() { + return authPlugin; + } ++ */ ++ // LimeLogin stop + + public RateLimiter getRateLimiter() { + return rateLimiter; + } + ++ // LimeLogin start ++ /* + public void setAuthPluginHook(AuthPlugin

authPlugin) { + this.authPlugin = authPlugin; + } ++ */ ++ // LimeLogin stop + + public void saveDefaultFile(String fileName) { + Path dataFolder = plugin.getPluginFolder(); +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java +deleted file mode 100644 +index b417e64..0000000 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java ++++ /dev/null +@@ -1,143 +0,0 @@ +-/* +- * SPDX-License-Identifier: MIT +- * +- * The MIT License (MIT) +- * +- * Copyright (c) 2015-2021 +- * +- * Permission is hereby granted, free of charge, to any person obtaining a copy +- * of this software and associated documentation files (the "Software"), to deal +- * in the Software without restriction, including without limitation the rights +- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +- * copies of the Software, and to permit persons to whom the Software is +- * furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be included in all +- * copies or substantial portions of the Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +- * SOFTWARE. +- */ +-package com.github.games647.fastlogin.core.shared; +- +-import com.github.games647.fastlogin.core.AuthStorage; +-import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; +-import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent; +- +-public abstract class ForceLoginManagement

> +- implements Runnable { +- +- protected final FastLoginCore core; +- protected final P player; +- protected final L session; +- +- public ForceLoginManagement(FastLoginCore core, P player, L session) { +- this.core = core; +- this.player = player; +- this.session = session; +- } +- +- @Override +- public void run() { +- if (!isOnline(player)) { +- core.getPlugin().getLog().info("Player {} disconnected", player); +- return; +- } +- +- if (session == null) { +- core.getPlugin().getLog().info("No valid session found for {}", player); +- return; +- } +- +- AuthStorage storage = core.getStorage(); +- StoredProfile playerProfile = session.getProfile(); +- try { +- if (isOnlineMode()) { +- //premium player +- AuthPlugin

authPlugin = core.getAuthPluginHook(); +- if (authPlugin == null) { +- //maybe only bungeecord plugin +- onForceActionSuccess(session); +- } else { +- boolean success = true; +- String playerName = getName(player); +- if (core.getConfig().get("autoLogin", true)) { +- if (session.needsRegistration() +- || (core.getConfig().get("auto-register-unknown", false) +- && !authPlugin.isRegistered(playerName))) { +- success = forceRegister(player); +- } else if (!callFastLoginAutoLoginEvent(session, playerProfile).isCancelled()) { +- success = forceLogin(player); +- } +- } +- +- if (success) { +- //update only on success to prevent corrupt data +- if (playerProfile != null) { +- playerProfile.setId(session.getUuid()); +- playerProfile.setPremium(true); +- storage.save(playerProfile); +- } +- +- onForceActionSuccess(session); +- } +- } +- } else if (playerProfile != null) { +- //cracked player +- playerProfile.setId(null); +- playerProfile.setPremium(false); +- // LimeLogin start +- +- //Govindas comment - don't save cracked player profiles, I found it to be useless +- //storage.save(playerProfile); +- //end of Govindas comment +- +- // LimeLogin stop +- } +- } catch (Exception ex) { +- core.getPlugin().getLog().warn("ERROR ON FORCE LOGIN of {}", getName(player), ex); +- } +- } +- +- public boolean forceRegister(P player) { +- core.getPlugin().getLog().info("Register player {}", getName(player)); +- +- String generatedPassword = core.getPasswordGenerator().getRandomPassword(player); +- boolean success = core.getAuthPluginHook().forceRegister(player, generatedPassword); +- +- String message = core.getMessage("auto-register"); +- if (success && message != null) { +- message = message.replace("%password", generatedPassword); +- core.getPlugin().sendMessage(player, message); +- } +- +- return success; +- } +- +- public boolean forceLogin(P player) { +- core.getPlugin().getLog().info("Logging player {} in", getName(player)); +- +- boolean success = core.getAuthPluginHook().forceLogin(player); +- if (success) { +- core.sendLocaleMessage("auto-login", player); +- } +- +- return success; +- } +- +- public abstract FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile); +- +- public abstract void onForceActionSuccess(LoginSession session); +- +- public abstract String getName(P player); +- +- public abstract boolean isOnline(P player); +- +- public abstract boolean isOnlineMode(); +-} +diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +index 5490673..dabe324 100644 +--- a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java ++++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java +@@ -28,7 +28,6 @@ package com.github.games647.fastlogin.core.shared; + import com.github.games647.craftapi.model.Profile; + import com.github.games647.craftapi.resolver.RateLimitException; + import com.github.games647.fastlogin.core.StoredProfile; +-import com.github.games647.fastlogin.core.hooks.AuthPlugin; + import com.github.games647.fastlogin.core.hooks.FloodgateHook; + import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent; + +@@ -43,14 +42,18 @@ import net.md_5.bungee.config.Configuration; + public abstract class JoinManagement

{ + + protected final FastLoginCore core; +- protected final AuthPlugin

authHook; ++ // LimeLogin start ++ //protected final AuthPlugin

authHook; ++ // LimeLogin stop + private final FloodgateHook floodgateHook; + +- public JoinManagement(FastLoginCore core, AuthPlugin

authHook) { ++ // LimeLogin start ++ public JoinManagement(FastLoginCore core) { + this.core = core; +- this.authHook = authHook; + this.floodgateHook = new FloodgateHook<>(core); + } ++ // LimeLogin stop ++ + + public void onLogin(String username, S source) { + core.getPlugin().getLog().info("Handling player {}", username); +@@ -130,7 +133,7 @@ public abstract class JoinManagement

{ + //end of Govindas comment + + // LimeLogin stop +- if (core.getConfig().get("autoRegister", false) && (authHook == null)) { ++ if (core.getConfig().get("autoRegister", false)) { + // LimeLogin start + requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD + // LimeLogin stop +-- +2.32.0.windows.1 + -- 2.45.0 From ca353868710ad0e3dcd7e6abd2e8c1cdd59161b7 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:38:57 +0400 Subject: [PATCH 09/13] related to main --- ...removed-hooks-and-commented-them-out.patch | 4 ++-- ...0005-Removing-all-Auth-related-stuff.patch | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch index a39306f..b2c2a1f 100644 --- a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch +++ b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch @@ -34,7 +34,7 @@ index e26b271..25f1ac2 100644 - registerHook(); + // LimeLogin start + //registerHook(); -+ // LimeLogin stop ++ // LimeLogin end } @Override @@ -59,7 +59,7 @@ index e26b271..25f1ac2 100644 } - } + } */ -+ // LimeLogin stop ++ // LimeLogin end public void sendPluginMessage(Server server, ChannelMessage message) { if (server != null) { diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch index 5d3a766..394ce3d 100644 --- a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch +++ b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch @@ -48,7 +48,7 @@ index db8f269..07df30a 100644 + //Disabled... + //Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); + //plugin.getScheduler().runAsync(loginTask); -+ // LimeLogin stop ++ // LimeLogin end } @EventHandler @@ -64,7 +64,7 @@ index 410b1e4..0136f09 100644 - + // LimeLogin start + super(plugin.getCore()); -+ // LimeLogin stop ++ // LimeLogin end this.plugin = plugin; this.preLoginEvent = preLoginEvent; this.connection = connection; @@ -308,7 +308,7 @@ index ec3f924..90c9add 100644 - + // LimeLogin start + //private AuthPlugin

authPlugin; -+ // LimeLogin stop ++ // LimeLogin end public FastLoginCore(T plugin) { this.plugin = plugin; } @@ -322,7 +322,7 @@ index ec3f924..90c9add 100644 return authPlugin; } + */ -+ // LimeLogin stop ++ // LimeLogin end public RateLimiter getRateLimiter() { return rateLimiter; @@ -334,7 +334,7 @@ index ec3f924..90c9add 100644 this.authPlugin = authPlugin; } + */ -+ // LimeLogin stop ++ // LimeLogin end public void saveDefaultFile(String fileName) { Path dataFolder = plugin.getPluginFolder(); @@ -444,7 +444,7 @@ index b417e64..0000000 - //storage.save(playerProfile); - //end of Govindas comment - -- // LimeLogin stop +- // LimeLogin end - } - } catch (Exception ex) { - core.getPlugin().getLog().warn("ERROR ON FORCE LOGIN of {}", getName(player), ex); @@ -506,7 +506,7 @@ index 5490673..dabe324 100644 - protected final AuthPlugin

authHook; + // LimeLogin start + //protected final AuthPlugin

authHook; -+ // LimeLogin stop ++ // LimeLogin end private final FloodgateHook floodgateHook; - public JoinManagement(FastLoginCore core, AuthPlugin

authHook) { @@ -516,7 +516,7 @@ index 5490673..dabe324 100644 - this.authHook = authHook; this.floodgateHook = new FloodgateHook<>(core); } -+ // LimeLogin stop ++ // LimeLogin end + public void onLogin(String username, S source) { @@ -524,12 +524,12 @@ index 5490673..dabe324 100644 @@ -130,7 +133,7 @@ public abstract class JoinManagement

{ //end of Govindas comment - // LimeLogin stop + // LimeLogin end - if (core.getConfig().get("autoRegister", false) && (authHook == null)) { + if (core.getConfig().get("autoRegister", false)) { // LimeLogin start requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD - // LimeLogin stop + // LimeLogin end -- 2.32.0.windows.1 -- 2.45.0 From f5ad62856cc8b5db30d6707e71d2c146ea7a53f7 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Tue, 15 Jun 2021 02:30:29 +0400 Subject: [PATCH 10/13] removed all auth hooks stuff --- .../0003-removed-hooks-and-commented-them-out.patch | 7 ++++--- .../0005-Removing-all-Auth-related-stuff.patch | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch index b2c2a1f..af89340 100644 --- a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch +++ b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch @@ -34,7 +34,7 @@ index e26b271..25f1ac2 100644 - registerHook(); + // LimeLogin start + //registerHook(); -+ // LimeLogin end ++ // LimeLogin stop } @Override @@ -57,8 +57,9 @@ index e26b271..25f1ac2 100644 } catch (ReflectiveOperationException ex) { logger.error("Couldn't load the auth hook class", ex); } -- } -+ } */ + ++ } + + // LimeLogin end public void sendPluginMessage(Server server, ChannelMessage message) { diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch index 394ce3d..4681333 100644 --- a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch +++ b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch @@ -65,6 +65,7 @@ index 410b1e4..0136f09 100644 + // LimeLogin start + super(plugin.getCore()); + // LimeLogin end + this.plugin = plugin; this.preLoginEvent = preLoginEvent; this.connection = connection; @@ -309,6 +310,7 @@ index ec3f924..90c9add 100644 + // LimeLogin start + //private AuthPlugin

authPlugin; + // LimeLogin end + public FastLoginCore(T plugin) { this.plugin = plugin; } @@ -323,6 +325,8 @@ index ec3f924..90c9add 100644 } + */ + // LimeLogin end + + public RateLimiter getRateLimiter() { return rateLimiter; @@ -516,6 +520,7 @@ index 5490673..dabe324 100644 - this.authHook = authHook; this.floodgateHook = new FloodgateHook<>(core); } + + // LimeLogin end + @@ -523,13 +528,15 @@ index 5490673..dabe324 100644 core.getPlugin().getLog().info("Handling player {}", username); @@ -130,7 +133,7 @@ public abstract class JoinManagement

{ //end of Govindas comment - + // LimeLogin end + - if (core.getConfig().get("autoRegister", false) && (authHook == null)) { + if (core.getConfig().get("autoRegister", false)) { // LimeLogin start requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD // LimeLogin end + -- 2.32.0.windows.1 -- 2.45.0 From 8753b355e8e037ab8b0c734059c24f1089664091 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 18:38:57 +0400 Subject: [PATCH 11/13] related to main --- ...removed-hooks-and-commented-them-out.patch | 7 ++++++- ...0005-Removing-all-Auth-related-stuff.patch | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch index af89340..b9a9c73 100644 --- a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch +++ b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch @@ -34,7 +34,7 @@ index e26b271..25f1ac2 100644 - registerHook(); + // LimeLogin start + //registerHook(); -+ // LimeLogin stop ++ // LimeLogin end } @Override @@ -57,9 +57,14 @@ index e26b271..25f1ac2 100644 } catch (ReflectiveOperationException ex) { logger.error("Couldn't load the auth hook class", ex); } +<<<<<<< HEAD + } +======= +- } ++ } */ +>>>>>>> 654e137 (related to main) + // LimeLogin end public void sendPluginMessage(Server server, ChannelMessage message) { diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch index 4681333..1b875c5 100644 --- a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch +++ b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch @@ -65,7 +65,10 @@ index 410b1e4..0136f09 100644 + // LimeLogin start + super(plugin.getCore()); + // LimeLogin end +<<<<<<< HEAD +======= +>>>>>>> 654e137 (related to main) this.plugin = plugin; this.preLoginEvent = preLoginEvent; this.connection = connection; @@ -310,7 +313,10 @@ index ec3f924..90c9add 100644 + // LimeLogin start + //private AuthPlugin

authPlugin; + // LimeLogin end +<<<<<<< HEAD +======= +>>>>>>> 654e137 (related to main) public FastLoginCore(T plugin) { this.plugin = plugin; } @@ -325,8 +331,11 @@ index ec3f924..90c9add 100644 } + */ + // LimeLogin end +<<<<<<< HEAD +======= +>>>>>>> 654e137 (related to main) public RateLimiter getRateLimiter() { return rateLimiter; @@ -520,7 +529,10 @@ index 5490673..dabe324 100644 - this.authHook = authHook; this.floodgateHook = new FloodgateHook<>(core); } +<<<<<<< HEAD +======= +>>>>>>> 654e137 (related to main) + // LimeLogin end + @@ -528,15 +540,23 @@ index 5490673..dabe324 100644 core.getPlugin().getLog().info("Handling player {}", username); @@ -130,7 +133,7 @@ public abstract class JoinManagement

{ //end of Govindas comment +<<<<<<< HEAD // LimeLogin end +======= + + // LimeLogin end +>>>>>>> 654e137 (related to main) - if (core.getConfig().get("autoRegister", false) && (authHook == null)) { + if (core.getConfig().get("autoRegister", false)) { // LimeLogin start requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD // LimeLogin end +<<<<<<< HEAD +======= +>>>>>>> 654e137 (related to main) -- 2.32.0.windows.1 -- 2.45.0 From 8ce106f97fd6fcf08327275993fcce18553c7a71 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 21:08:54 +0400 Subject: [PATCH 12/13] renumber patches --- ...-out.patch => 0004-removed-hooks-and-commented-them-out.patch} | 0 ...unwanted-classes.patch => 0005-deleted-unwanted-classes.patch} | 0 ...ted-stuff.patch => 0006-Removing-all-Auth-related-stuff.patch} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename FastLogin-Patches/{0003-removed-hooks-and-commented-them-out.patch => 0004-removed-hooks-and-commented-them-out.patch} (100%) rename FastLogin-Patches/{0004-deleted-unwanted-classes.patch => 0005-deleted-unwanted-classes.patch} (100%) rename FastLogin-Patches/{0005-Removing-all-Auth-related-stuff.patch => 0006-Removing-all-Auth-related-stuff.patch} (100%) diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0004-removed-hooks-and-commented-them-out.patch similarity index 100% rename from FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch rename to FastLogin-Patches/0004-removed-hooks-and-commented-them-out.patch diff --git a/FastLogin-Patches/0004-deleted-unwanted-classes.patch b/FastLogin-Patches/0005-deleted-unwanted-classes.patch similarity index 100% rename from FastLogin-Patches/0004-deleted-unwanted-classes.patch rename to FastLogin-Patches/0005-deleted-unwanted-classes.patch diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0006-Removing-all-Auth-related-stuff.patch similarity index 100% rename from FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch rename to FastLogin-Patches/0006-Removing-all-Auth-related-stuff.patch -- 2.45.0 From bff2ad8124d795ea4620903f7a83aa673ad18fb3 Mon Sep 17 00:00:00 2001 From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> Date: Wed, 16 Jun 2021 21:17:09 +0400 Subject: [PATCH 13/13] DELETE....... --- ...removed-hooks-and-commented-them-out.patch | 68 --- .../0004-deleted-unwanted-classes.patch | 263 --------- ...0005-Removing-all-Auth-related-stuff.patch | 535 ------------------ 3 files changed, 866 deletions(-) delete mode 100644 FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch delete mode 100644 FastLogin-Patches/0004-deleted-unwanted-classes.patch delete mode 100644 FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch diff --git a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch b/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch deleted file mode 100644 index b2c2a1f..0000000 --- a/FastLogin-Patches/0003-removed-hooks-and-commented-them-out.patch +++ /dev/null @@ -1,68 +0,0 @@ -From d85a4cd57426f484fa46c9149dd9ace7ebc77170 Mon Sep 17 00:00:00 2001 -From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> -Date: Tue, 15 Jun 2021 02:09:53 +0400 -Subject: [PATCH] removed hooks and commented them out - - -diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java -index e26b271..25f1ac2 100644 ---- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java -+++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java -@@ -25,9 +25,6 @@ - */ - package com.github.games647.fastlogin.bungee; - --import com.github.games647.fastlogin.bungee.hook.BungeeAuthHook; --import com.github.games647.fastlogin.bungee.hook.BungeeCordAuthenticatorBungeeHook; --import com.github.games647.fastlogin.bungee.hook.SodionAuthHook; - import com.github.games647.fastlogin.bungee.listener.ConnectListener; - import com.github.games647.fastlogin.bungee.listener.PluginMessageListener; - import com.github.games647.fastlogin.core.AsyncScheduler; -@@ -50,7 +47,6 @@ import java.util.List; - import java.util.concurrent.ConcurrentMap; - import java.util.concurrent.ThreadFactory; - --import net.md_5.bungee.BungeeServerInfo; - import net.md_5.bungee.api.CommandSender; - import net.md_5.bungee.api.chat.TextComponent; - import net.md_5.bungee.api.connection.PendingConnection; -@@ -102,8 +98,9 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin>> hooks = Arrays.asList( -- BungeeAuthHook.class, BungeeCordAuthenticatorBungeeHook.class, SodionAuthHook.class); -+ try { -+ List>> hooks = Arrays.asList(); - - for (Class> clazz : hooks) { - String pluginName = clazz.getSimpleName(); -@@ -141,7 +139,8 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin -Date: Tue, 15 Jun 2021 02:10:12 +0400 -Subject: [PATCH] deleted unwanted classes - - -diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java -deleted file mode 100644 -index abddb17..0000000 ---- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeAuthHook.java -+++ /dev/null -@@ -1,65 +0,0 @@ --/* -- * SPDX-License-Identifier: MIT -- * -- * The MIT License (MIT) -- * -- * Copyright (c) 2015-2021 -- * -- * Permission is hereby granted, free of charge, to any person obtaining a copy -- * of this software and associated documentation files (the "Software"), to deal -- * in the Software without restriction, including without limitation the rights -- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- * copies of the Software, and to permit persons to whom the Software is -- * furnished to do so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included in all -- * copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- * SOFTWARE. -- */ --package com.github.games647.fastlogin.bungee.hook; -- --import com.github.games647.fastlogin.bungee.FastLoginBungee; --import com.github.games647.fastlogin.core.hooks.AuthPlugin; -- --import me.vik1395.BungeeAuth.Main; --import me.vik1395.BungeeAuthAPI.RequestHandler; -- --import net.md_5.bungee.api.connection.ProxiedPlayer; -- --/** -- * GitHub: https://github.com/vik1395/BungeeAuth-Minecraft -- * -- * Project page: -- * -- * Spigot: https://www.spigotmc.org/resources/bungeeauth.493/ -- */ --public class BungeeAuthHook implements AuthPlugin { -- -- private final RequestHandler requestHandler = new RequestHandler(); -- -- public BungeeAuthHook(FastLoginBungee plugin) { -- } -- -- @Override -- public boolean forceLogin(ProxiedPlayer player) { -- String playerName = player.getName(); -- return Main.plonline.contains(playerName) || requestHandler.forceLogin(playerName); -- } -- -- @Override -- public boolean isRegistered(String playerName) { -- return requestHandler.isRegistered(playerName); -- } -- -- @Override -- public boolean forceRegister(ProxiedPlayer player, String password) { -- return requestHandler.forceRegister(player, password); -- } --} -diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java -deleted file mode 100644 -index beb56d9..0000000 ---- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/BungeeCordAuthenticatorBungeeHook.java -+++ /dev/null -@@ -1,93 +0,0 @@ --/* -- * SPDX-License-Identifier: MIT -- * -- * The MIT License (MIT) -- * -- * Copyright (c) 2015-2021 -- * -- * Permission is hereby granted, free of charge, to any person obtaining a copy -- * of this software and associated documentation files (the "Software"), to deal -- * in the Software without restriction, including without limitation the rights -- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- * copies of the Software, and to permit persons to whom the Software is -- * furnished to do so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included in all -- * copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- * SOFTWARE. -- */ --package com.github.games647.fastlogin.bungee.hook; -- --import java.sql.SQLException; -- --import com.github.games647.fastlogin.bungee.FastLoginBungee; --import com.github.games647.fastlogin.core.hooks.AuthPlugin; -- --import de.xxschrandxx.bca.bungee.BungeeCordAuthenticatorBungee; --import de.xxschrandxx.bca.bungee.api.BungeeCordAuthenticatorBungeeAPI; -- --import net.md_5.bungee.api.connection.ProxiedPlayer; -- --/** -- * GitHub: -- * https://github.com/xXSchrandXx/SpigotPlugins/tree/master/BungeeCordAuthenticator -- * -- * Project page: -- * -- * Spigot: https://www.spigotmc.org/resources/bungeecordauthenticator.87669/ -- */ --public class BungeeCordAuthenticatorBungeeHook implements AuthPlugin { -- -- public final BungeeCordAuthenticatorBungeeAPI api; -- -- public BungeeCordAuthenticatorBungeeHook(FastLoginBungee plugin) { -- api = ((BungeeCordAuthenticatorBungee) plugin.getProxy().getPluginManager() -- .getPlugin("BungeeCordAuthenticatorBungee")).getAPI(); -- plugin.getLog().info("BungeeCordAuthenticatorHook | Hooked successful!"); -- } -- -- @Override -- public boolean forceLogin(ProxiedPlayer player) { -- if (api.isAuthenticated(player)) { -- return true; -- } else { -- try { -- api.setAuthenticated(player); -- } -- catch (SQLException e) { -- e.printStackTrace(); -- return false; -- } -- return true; -- } -- } -- -- @Override -- public boolean isRegistered(String playerName) { -- try { -- return api.getSQL().checkPlayerEntry(playerName); -- } -- catch (SQLException e) { -- e.printStackTrace(); -- return false; -- } -- } -- -- @Override -- public boolean forceRegister(ProxiedPlayer player, String password) { -- try { -- return api.createPlayerEntry(player, password); -- } -- catch (SQLException e) { -- e.printStackTrace(); -- return false; -- } -- } --} -diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java -deleted file mode 100644 -index c12f2b0..0000000 ---- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/hook/SodionAuthHook.java -+++ /dev/null -@@ -1,78 +0,0 @@ --/* -- * SPDX-License-Identifier: MIT -- * -- * The MIT License (MIT) -- * -- * Copyright (c) 2015-2021 -- * -- * Permission is hereby granted, free of charge, to any person obtaining a copy -- * of this software and associated documentation files (the "Software"), to deal -- * in the Software without restriction, including without limitation the rights -- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- * copies of the Software, and to permit persons to whom the Software is -- * furnished to do so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included in all -- * copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- * SOFTWARE. -- */ --package com.github.games647.fastlogin.bungee.hook; -- --import com.github.games647.fastlogin.bungee.FastLoginBungee; --import com.github.games647.fastlogin.core.hooks.AuthPlugin; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import red.mohist.sodionauth.bungee.implementation.BungeePlayer; --import red.mohist.sodionauth.core.SodionAuthApi; --import red.mohist.sodionauth.core.exception.AuthenticatedException; -- --/** -- * GitHub: https://github.com/Mohist-Community/SodionAuth -- *

-- * Project page: https://gitea.e-loli.com/SodionAuth/SodionAuth -- *

-- * Bukkit: Unknown -- *

-- * Spigot: https://www.spigotmc.org/resources/sodionauth.76944/ -- */ --public class SodionAuthHook implements AuthPlugin { -- -- private final FastLoginBungee plugin; -- -- public SodionAuthHook(FastLoginBungee plugin) { -- this.plugin = plugin; -- } -- -- @Override -- public boolean forceLogin(ProxiedPlayer player) { -- try { -- SodionAuthApi.login(new BungeePlayer(player)); -- } catch (AuthenticatedException e) { -- plugin.getLog().warn(ALREADY_AUTHENTICATED, player); -- return false; -- } -- return true; -- } -- -- @Override -- public boolean forceRegister(ProxiedPlayer player, String password) { -- try{ -- return SodionAuthApi.register(new BungeePlayer(player), password); -- } catch (UnsupportedOperationException e){ -- plugin.getLog().warn("Currently SodionAuth is not accepting forceRegister, " + -- "It may be caused by unsupported AuthBackend"); -- return false; -- } -- } -- -- @Override -- public boolean isRegistered(String playerName) { -- return SodionAuthApi.isRegistered(playerName); -- } --} --- -2.32.0.windows.1 - diff --git a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch b/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch deleted file mode 100644 index 394ce3d..0000000 --- a/FastLogin-Patches/0005-Removing-all-Auth-related-stuff.patch +++ /dev/null @@ -1,535 +0,0 @@ -From 4975802f5fcea2ef9cfa06df8b9a0939961ff935 Mon Sep 17 00:00:00 2001 -From: mohammed jasem alaajel <34905970+ham1255@users.noreply.github.com> -Date: Tue, 15 Jun 2021 02:28:50 +0400 -Subject: [PATCH] Removing all Auth related stuff - - -diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java -index 25f1ac2..ec6f74a 100644 ---- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java -+++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/FastLoginBungee.java -@@ -29,7 +29,6 @@ import com.github.games647.fastlogin.bungee.listener.ConnectListener; - import com.github.games647.fastlogin.bungee.listener.PluginMessageListener; - import com.github.games647.fastlogin.core.AsyncScheduler; - import com.github.games647.fastlogin.core.CommonUtil; --import com.github.games647.fastlogin.core.hooks.AuthPlugin; - import com.github.games647.fastlogin.core.message.ChangePremiumMessage; - import com.github.games647.fastlogin.core.message.ChannelMessage; - import com.github.games647.fastlogin.core.message.NamespaceKey; -@@ -42,8 +41,6 @@ import com.google.common.io.ByteStreams; - import com.google.common.util.concurrent.ThreadFactoryBuilder; - - import java.nio.file.Path; --import java.util.Arrays; --import java.util.List; - import java.util.concurrent.ConcurrentMap; - import java.util.concurrent.ThreadFactory; - -diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java -index db8f269..07df30a 100644 ---- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java -+++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/ConnectListener.java -@@ -32,7 +32,6 @@ import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateHook; - import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateV1Hook; - import com.github.games647.fastlogin.bungee.hook.floodgate.FloodgateV2Hook; - import com.github.games647.fastlogin.bungee.task.AsyncPremiumCheck; --import com.github.games647.fastlogin.bungee.task.ForceLoginTask; - import com.github.games647.fastlogin.core.RateLimiter; - import com.github.games647.fastlogin.core.StoredProfile; - import com.github.games647.fastlogin.core.shared.LoginSession; -@@ -249,8 +248,12 @@ public class ConnectListener implements Listener { - // delay sending force command, because Paper will process the login event asynchronously - // In this case it means that the force command (plugin message) is already received and processed while - // player is still in the login phase and reported to be offline. -- Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); -- plugin.getScheduler().runAsync(loginTask); -+ -+ // LimeLogin start -+ //Disabled... -+ //Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session); -+ //plugin.getScheduler().runAsync(loginTask); -+ // LimeLogin end - } - - @EventHandler -diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java -index 410b1e4..0136f09 100644 ---- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java -+++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/task/AsyncPremiumCheck.java -@@ -49,8 +49,9 @@ public class AsyncPremiumCheck extends JoinManagement -- * -- * Permission is hereby granted, free of charge, to any person obtaining a copy -- * of this software and associated documentation files (the "Software"), to deal -- * in the Software without restriction, including without limitation the rights -- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- * copies of the Software, and to permit persons to whom the Software is -- * furnished to do so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included in all -- * copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- * SOFTWARE. -- */ --package com.github.games647.fastlogin.bungee.task; -- --import com.github.games647.fastlogin.bungee.BungeeLoginSession; --import com.github.games647.fastlogin.bungee.FastLoginBungee; --import com.github.games647.fastlogin.bungee.event.BungeeFastLoginAutoLoginEvent; --import com.github.games647.fastlogin.core.StoredProfile; --import com.github.games647.fastlogin.core.message.ChannelMessage; --import com.github.games647.fastlogin.core.message.LoginActionMessage; --import com.github.games647.fastlogin.core.message.LoginActionMessage.Type; --import com.github.games647.fastlogin.core.shared.FastLoginCore; --import com.github.games647.fastlogin.core.shared.ForceLoginManagement; --import com.github.games647.fastlogin.core.shared.LoginSession; --import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent; -- --import java.util.UUID; -- --import net.md_5.bungee.api.CommandSender; --import net.md_5.bungee.api.ProxyServer; --import net.md_5.bungee.api.connection.ProxiedPlayer; --import net.md_5.bungee.api.connection.Server; -- --public class ForceLoginTask -- extends ForceLoginManagement { -- -- private final Server server; -- -- public ForceLoginTask(FastLoginCore core, -- ProxiedPlayer player, Server server, BungeeLoginSession session) { -- super(core, player, session); -- -- this.server = server; -- } -- -- @Override -- public void run() { -- if (session == null) { -- return; -- } -- -- super.run(); -- -- if (!isOnlineMode()) { -- session.setAlreadySaved(true); -- } -- } -- -- @Override -- public boolean forceLogin(ProxiedPlayer player) { -- if (session.isAlreadyLogged()) { -- return true; -- } -- -- session.setAlreadyLogged(true); -- return super.forceLogin(player); -- } -- -- @Override -- public FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile) { -- return core.getPlugin().getProxy().getPluginManager() -- .callEvent(new BungeeFastLoginAutoLoginEvent(session, profile)); -- } -- -- @Override -- public boolean forceRegister(ProxiedPlayer player) { -- return session.isAlreadyLogged() || super.forceRegister(player); -- } -- -- @Override -- public void onForceActionSuccess(LoginSession session) { -- //sub channel name -- Type type = Type.LOGIN; -- if (session.needsRegistration()) { -- type = Type.REGISTER; -- } -- -- UUID proxyId = UUID.fromString(ProxyServer.getInstance().getConfig().getUuid()); -- ChannelMessage loginMessage = new LoginActionMessage(type, player.getName(), proxyId); -- -- core.getPlugin().sendPluginMessage(server, loginMessage); -- } -- -- @Override -- public String getName(ProxiedPlayer player) { -- return player.getName(); -- } -- -- @Override -- public boolean isOnline(ProxiedPlayer player) { -- return player.isConnected(); -- } -- -- @Override -- public boolean isOnlineMode() { -- return player.getPendingConnection().isOnlineMode(); -- } --} -diff --git a/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java b/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java -deleted file mode 100644 -index 1a614ba..0000000 ---- a/core/src/main/java/com/github/games647/fastlogin/core/hooks/AuthPlugin.java -+++ /dev/null -@@ -1,87 +0,0 @@ --/* -- * SPDX-License-Identifier: MIT -- * -- * The MIT License (MIT) -- * -- * Copyright (c) 2015-2021 -- * -- * Permission is hereby granted, free of charge, to any person obtaining a copy -- * of this software and associated documentation files (the "Software"), to deal -- * in the Software without restriction, including without limitation the rights -- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- * copies of the Software, and to permit persons to whom the Software is -- * furnished to do so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included in all -- * copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- * SOFTWARE. -- */ --package com.github.games647.fastlogin.core.hooks; -- --/** -- * Represents a supporting authentication plugin in BungeeCord and Bukkit/Spigot/... servers -- * -- * @param

either {@link org.bukkit.entity.Player} for Bukkit or {@link net.md_5.bungee.api.connection.ProxiedPlayer} -- * for BungeeCord -- */ --public interface AuthPlugin

{ -- -- String ALREADY_AUTHENTICATED = "Player {} is already authenticated. Cancelling force login."; -- -- /** -- * Login the premium (paid account) player after the player joined successfully the server. -- * -- * This operation will be performed async while the player successfully -- * joined the server. -- * -- * @param player the player that needs to be logged in -- * @return if the operation was successful -- */ -- boolean forceLogin(P player); -- -- /** -- * Forces a register in order to protect the paid account. -- * -- * This operation will be performed async while the player successfully -- * 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 -- * if possible. -- * -- * Background: If we don't register an account, cracked players -- * could steal the unregistered account from the paid -- * player account -- * -- * @param player the premium account -- * @param password a strong random generated password -- * @return if the operation was successful -- */ -- boolean forceRegister(P player, String password); -- -- /** -- * Checks whether an account exists for this player name. -- * -- * This check should check if a cracked player account exists -- * 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 -- * @throws Exception if an error occurred -- */ -- boolean isRegistered(String playerName) throws Exception; --} -diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java -index ec3f924..90c9add 100644 ---- a/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java -+++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/FastLoginCore.java -@@ -30,7 +30,6 @@ import com.github.games647.craftapi.resolver.http.RotatingProxySelector; - import com.github.games647.fastlogin.core.AuthStorage; - import com.github.games647.fastlogin.core.CommonUtil; - import com.github.games647.fastlogin.core.RateLimiter; --import com.github.games647.fastlogin.core.hooks.AuthPlugin; - import com.github.games647.fastlogin.core.hooks.DefaultPasswordGenerator; - import com.github.games647.fastlogin.core.hooks.PasswordGenerator; - import com.google.common.net.HostAndPort; -@@ -85,8 +84,9 @@ public class FastLoginCore

> { - private AuthStorage storage; - private RateLimiter rateLimiter; - private PasswordGenerator

passwordGenerator = new DefaultPasswordGenerator<>(); -- private AuthPlugin

authPlugin; -- -+ // LimeLogin start -+ //private AuthPlugin

authPlugin; -+ // LimeLogin end - public FastLoginCore(T plugin) { - this.plugin = plugin; - } -@@ -251,17 +251,25 @@ public class FastLoginCore

> { - return pendingConfirms; - } - -+ // LimeLogin start -+ /* - public AuthPlugin

getAuthPluginHook() { - return authPlugin; - } -+ */ -+ // LimeLogin end - - public RateLimiter getRateLimiter() { - return rateLimiter; - } - -+ // LimeLogin start -+ /* - public void setAuthPluginHook(AuthPlugin

authPlugin) { - this.authPlugin = authPlugin; - } -+ */ -+ // LimeLogin end - - public void saveDefaultFile(String fileName) { - Path dataFolder = plugin.getPluginFolder(); -diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java -deleted file mode 100644 -index b417e64..0000000 ---- a/core/src/main/java/com/github/games647/fastlogin/core/shared/ForceLoginManagement.java -+++ /dev/null -@@ -1,143 +0,0 @@ --/* -- * SPDX-License-Identifier: MIT -- * -- * The MIT License (MIT) -- * -- * Copyright (c) 2015-2021 -- * -- * Permission is hereby granted, free of charge, to any person obtaining a copy -- * of this software and associated documentation files (the "Software"), to deal -- * in the Software without restriction, including without limitation the rights -- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- * copies of the Software, and to permit persons to whom the Software is -- * furnished to do so, subject to the following conditions: -- * -- * The above copyright notice and this permission notice shall be included in all -- * copies or substantial portions of the Software. -- * -- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- * SOFTWARE. -- */ --package com.github.games647.fastlogin.core.shared; -- --import com.github.games647.fastlogin.core.AuthStorage; --import com.github.games647.fastlogin.core.StoredProfile; --import com.github.games647.fastlogin.core.hooks.AuthPlugin; --import com.github.games647.fastlogin.core.shared.event.FastLoginAutoLoginEvent; -- --public abstract class ForceLoginManagement

> -- implements Runnable { -- -- protected final FastLoginCore core; -- protected final P player; -- protected final L session; -- -- public ForceLoginManagement(FastLoginCore core, P player, L session) { -- this.core = core; -- this.player = player; -- this.session = session; -- } -- -- @Override -- public void run() { -- if (!isOnline(player)) { -- core.getPlugin().getLog().info("Player {} disconnected", player); -- return; -- } -- -- if (session == null) { -- core.getPlugin().getLog().info("No valid session found for {}", player); -- return; -- } -- -- AuthStorage storage = core.getStorage(); -- StoredProfile playerProfile = session.getProfile(); -- try { -- if (isOnlineMode()) { -- //premium player -- AuthPlugin

authPlugin = core.getAuthPluginHook(); -- if (authPlugin == null) { -- //maybe only bungeecord plugin -- onForceActionSuccess(session); -- } else { -- boolean success = true; -- String playerName = getName(player); -- if (core.getConfig().get("autoLogin", true)) { -- if (session.needsRegistration() -- || (core.getConfig().get("auto-register-unknown", false) -- && !authPlugin.isRegistered(playerName))) { -- success = forceRegister(player); -- } else if (!callFastLoginAutoLoginEvent(session, playerProfile).isCancelled()) { -- success = forceLogin(player); -- } -- } -- -- if (success) { -- //update only on success to prevent corrupt data -- if (playerProfile != null) { -- playerProfile.setId(session.getUuid()); -- playerProfile.setPremium(true); -- storage.save(playerProfile); -- } -- -- onForceActionSuccess(session); -- } -- } -- } else if (playerProfile != null) { -- //cracked player -- playerProfile.setId(null); -- playerProfile.setPremium(false); -- // LimeLogin start -- -- //Govindas comment - don't save cracked player profiles, I found it to be useless -- //storage.save(playerProfile); -- //end of Govindas comment -- -- // LimeLogin end -- } -- } catch (Exception ex) { -- core.getPlugin().getLog().warn("ERROR ON FORCE LOGIN of {}", getName(player), ex); -- } -- } -- -- public boolean forceRegister(P player) { -- core.getPlugin().getLog().info("Register player {}", getName(player)); -- -- String generatedPassword = core.getPasswordGenerator().getRandomPassword(player); -- boolean success = core.getAuthPluginHook().forceRegister(player, generatedPassword); -- -- String message = core.getMessage("auto-register"); -- if (success && message != null) { -- message = message.replace("%password", generatedPassword); -- core.getPlugin().sendMessage(player, message); -- } -- -- return success; -- } -- -- public boolean forceLogin(P player) { -- core.getPlugin().getLog().info("Logging player {} in", getName(player)); -- -- boolean success = core.getAuthPluginHook().forceLogin(player); -- if (success) { -- core.sendLocaleMessage("auto-login", player); -- } -- -- return success; -- } -- -- public abstract FastLoginAutoLoginEvent callFastLoginAutoLoginEvent(LoginSession session, StoredProfile profile); -- -- public abstract void onForceActionSuccess(LoginSession session); -- -- public abstract String getName(P player); -- -- public abstract boolean isOnline(P player); -- -- public abstract boolean isOnlineMode(); --} -diff --git a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java -index 5490673..dabe324 100644 ---- a/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java -+++ b/core/src/main/java/com/github/games647/fastlogin/core/shared/JoinManagement.java -@@ -28,7 +28,6 @@ package com.github.games647.fastlogin.core.shared; - import com.github.games647.craftapi.model.Profile; - import com.github.games647.craftapi.resolver.RateLimitException; - import com.github.games647.fastlogin.core.StoredProfile; --import com.github.games647.fastlogin.core.hooks.AuthPlugin; - import com.github.games647.fastlogin.core.hooks.FloodgateHook; - import com.github.games647.fastlogin.core.shared.event.FastLoginPreLoginEvent; - -@@ -43,14 +42,18 @@ import net.md_5.bungee.config.Configuration; - public abstract class JoinManagement

{ - - protected final FastLoginCore core; -- protected final AuthPlugin

authHook; -+ // LimeLogin start -+ //protected final AuthPlugin

authHook; -+ // LimeLogin end - private final FloodgateHook floodgateHook; - -- public JoinManagement(FastLoginCore core, AuthPlugin

authHook) { -+ // LimeLogin start -+ public JoinManagement(FastLoginCore core) { - this.core = core; -- this.authHook = authHook; - this.floodgateHook = new FloodgateHook<>(core); - } -+ // LimeLogin end -+ - - public void onLogin(String username, S source) { - core.getPlugin().getLog().info("Handling player {}", username); -@@ -130,7 +133,7 @@ public abstract class JoinManagement

{ - //end of Govindas comment - - // LimeLogin end -- if (core.getConfig().get("autoRegister", false) && (authHook == null)) { -+ if (core.getConfig().get("autoRegister", false)) { - // LimeLogin start - requestPremiumLogin(source, profile, username, false); //Comment: always use false to fix an error XD - // LimeLogin end --- -2.32.0.windows.1 - -- 2.45.0