Update 0001-preparing-for-first-patch.patch

This commit is contained in:
mohammed jasem alaajel 2021-06-16 21:03:29 +04:00
parent 3d255be565
commit 01afa29709

View File

@ -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
- * <ul>
- * <li>allowFloodgateNameConflict
- * <li>autoLoginFloodgate
- * <li>autoRegisterFloodgate
- * </ul>
- * </p>
- *
@ -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<Player> 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<Profile> 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));