diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java index b2bc397c..9b8526f0 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java @@ -25,7 +25,6 @@ */ package com.github.games647.fastlogin.bukkit; -import com.comphenix.protocol.ProtocolLibrary; import com.github.games647.fastlogin.bukkit.command.CrackedCommand; import com.github.games647.fastlogin.bukkit.command.PremiumCommand; import com.github.games647.fastlogin.bukkit.listener.ConnectionListener; @@ -164,9 +163,9 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugin getCore() { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ManualNameChange.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ManualNameChange.java index d62dbf03..cbe0d35a 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ManualNameChange.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/ManualNameChange.java @@ -25,7 +25,6 @@ */ package com.github.games647.fastlogin.bukkit.listener.protocollib; -import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; @@ -62,10 +61,10 @@ public class ManualNameChange extends PacketAdapter { public static void register(FastLoginBukkit plugin, FloodgateService floodgate) { // they will be created with a static builder, because otherwise it will throw a NoClassDefFoundError - ProtocolLibrary.getProtocolManager() - .getAsynchronousManager() - .registerAsyncHandler(new ManualNameChange(plugin, floodgate)) - .start(); + // ProtocolLibrary.getProtocolManager() + // .getAsynchronousManager() + // .registerAsyncHandler(new ManualNameChange(plugin, floodgate)) + // .start(); } @Override diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java index b210feae..c78e9aa2 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java @@ -25,7 +25,6 @@ */ package com.github.games647.fastlogin.bukkit.listener.protocollib; -import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketEvent; import com.github.games647.fastlogin.bukkit.BukkitLoginSession; import com.github.games647.fastlogin.bukkit.FastLoginBukkit; @@ -42,7 +41,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class NameCheckTask extends JoinManagement - implements Runnable { + implements Runnable { private final FastLoginBukkit plugin; private final PacketEvent packetEvent; @@ -70,11 +69,11 @@ public class NameCheckTask extends JoinManagement verifyPublicKey(WrappedProfileKeyData profileKey) { 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 index 5876d139..214efb95 100644 --- 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 @@ -74,7 +74,7 @@ public class VerifyResponseTask implements Runnable { static { ENCRYPTION_CLASS = MinecraftReflection.getMinecraftClass( - "util." + ENCRYPTION_CLASS_NAME, ENCRYPTION_CLASS_NAME + "util." + ENCRYPTION_CLASS_NAME, ENCRYPTION_CLASS_NAME ); } @@ -108,11 +108,11 @@ public class VerifyResponseTask implements Runnable { verifyResponse(session); } finally { //this is a fake packet; it shouldn't be sent to the server - synchronized (packetEvent.getAsyncMarker().getProcessingLock()) { - packetEvent.setCancelled(true); - } + // synchronized (packetEvent.getAsyncMarker().getProcessingLock()) { + packetEvent.setCancelled(true); + // } - ProtocolLibrary.getProtocolManager().getAsynchronousManager().signalPacketTransmission(packetEvent); + // ProtocolLibrary.getProtocolManager().getAsynchronousManager().signalPacketTransmission(packetEvent); } } @@ -149,9 +149,9 @@ public class VerifyResponseTask implements Runnable { } else { //user tried to fake an authentication disconnect( - "invalid-session", - "GameProfile {} ({}) tried to log in with an invalid session. ServerId: {}", - session.getRequestUsername(), socketAddress, serverId + "invalid-session", + "GameProfile {} ({}) tried to log in with an invalid session. ServerId: {}", + session.getRequestUsername(), socketAddress, serverId ); } } catch (IOException ioEx) { @@ -217,15 +217,15 @@ public class VerifyResponseTask implements Runnable { try { // Try to get the old (pre MC 1.16.4) encryption method encryptMethod = FuzzyReflection.fromClass(networkManagerClass) - .getMethodByParameters("a", SecretKey.class); + .getMethodByParameters("a", SecretKey.class); } catch (IllegalArgumentException exception) { // Get the new encryption method encryptMethod = FuzzyReflection.fromClass(networkManagerClass) - .getMethodByParameters("a", Cipher.class, Cipher.class); + .getMethodByParameters("a", Cipher.class, Cipher.class); // Get the needed Cipher helper method (used to generate ciphers from login key) cipherMethod = FuzzyReflection.fromClass(ENCRYPTION_CLASS) - .getMethodByParameters("a", int.class, Key.class); + .getMethodByParameters("a", int.class, Key.class); } } @@ -277,7 +277,7 @@ public class VerifyResponseTask implements Runnable { EquivalentConverter converter = BukkitConverters.getWrappedPublicKeyDataConverter(); val wrappedKey = Optional.ofNullable(clientKey).map(key -> - new WrappedProfileKeyData(clientKey.expiry(), clientKey.key(), clientKey.signature()) + new WrappedProfileKeyData(clientKey.expiry(), clientKey.key(), clientKey.signature()) ); startPacket.getOptionals(converter).write(0, wrappedKey);