mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-31 03:07:34 +02:00
Fix receiving login packet twice with ProtocolLib
Fixes #578
Commit that introduces the bug:
1f4757669c
This commit is contained in:
@ -209,6 +209,7 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean enableEncryption(SecretKey loginKey) throws IllegalArgumentException {
|
private boolean enableEncryption(SecretKey loginKey) throws IllegalArgumentException {
|
||||||
|
plugin.getLog().info("Enabling onlinemode encryption for {}", player.getName());
|
||||||
// Initialize method reflections
|
// Initialize method reflections
|
||||||
if (encryptMethod == null) {
|
if (encryptMethod == null) {
|
||||||
Class<?> networkManagerClass = MinecraftReflection.getNetworkManagerClass();
|
Class<?> networkManagerClass = MinecraftReflection.getNetworkManagerClass();
|
||||||
@ -285,8 +286,8 @@ public class VerifyResponseTask implements Runnable {
|
|||||||
startPacket.getGameProfiles().write(0, fakeProfile);
|
startPacket.getGameProfiles().write(0, fakeProfile);
|
||||||
try {
|
try {
|
||||||
//we don't want to handle our own packets so ignore filters
|
//we don't want to handle our own packets so ignore filters
|
||||||
ProtocolLibrary.getProtocolManager().recieveClientPacket(player, startPacket, true);
|
|
||||||
startPacket.setMeta(ProtocolLibListener.SOURCE_META_KEY, plugin.getName());
|
startPacket.setMeta(ProtocolLibListener.SOURCE_META_KEY, plugin.getName());
|
||||||
|
ProtocolLibrary.getProtocolManager().recieveClientPacket(player, startPacket, true);
|
||||||
} catch (InvocationTargetException | IllegalAccessException ex) {
|
} catch (InvocationTargetException | IllegalAccessException ex) {
|
||||||
plugin.getLog().warn("Failed to fake a new start packet for: {}", username, ex);
|
plugin.getLog().warn("Failed to fake a new start packet for: {}", username, ex);
|
||||||
//cancel the event in order to prevent the server receiving an invalid packet
|
//cancel the event in order to prevent the server receiving an invalid packet
|
||||||
|
Reference in New Issue
Block a user