mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-09-25 14:41:33 +02:00
Fix equality null test
This commit is contained in:
@@ -59,6 +59,7 @@ import javax.crypto.NoSuchPaddingException;
|
|||||||
|
|
||||||
import lombok.var;
|
import lombok.var;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import static com.comphenix.protocol.PacketType.Login.Client.ENCRYPTION_BEGIN;
|
import static com.comphenix.protocol.PacketType.Login.Client.ENCRYPTION_BEGIN;
|
||||||
import static com.comphenix.protocol.PacketType.Login.Client.START;
|
import static com.comphenix.protocol.PacketType.Login.Client.START;
|
||||||
@@ -76,6 +77,7 @@ public class ProtocolLibListener extends PacketAdapter {
|
|||||||
|
|
||||||
private final boolean verifyClientKeys;
|
private final boolean verifyClientKeys;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private PacketContainer lastStartPacket;
|
private PacketContainer lastStartPacket;
|
||||||
|
|
||||||
public ProtocolLibListener(FastLoginBukkit plugin, AntiBotService antiBotService, boolean verifyClientKeys) {
|
public ProtocolLibListener(FastLoginBukkit plugin, AntiBotService antiBotService, boolean verifyClientKeys) {
|
||||||
@@ -105,9 +107,15 @@ public class ProtocolLibListener extends PacketAdapter {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (packetEvent.getPacketType() == START) {
|
if (packetEvent.getPacketType() == START) {
|
||||||
|
if (lastStartPacket != null) {
|
||||||
plugin.getLog().info("Start-packet equality (Last/New): {}/{}, {}",
|
plugin.getLog().info("Start-packet equality (Last/New): {}/{}, {}",
|
||||||
lastStartPacket.hashCode(), packet.hashCode(), Objects.equals(lastStartPacket, packet)
|
lastStartPacket.getHandle().hashCode(), packet.getHandle().hashCode(),
|
||||||
|
Objects.equals(lastStartPacket.getHandle(), packet.getHandle())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
plugin.getLog().info("Content: {}, {}", lastStartPacket.getHandle(), packet.getHandle());
|
||||||
|
}
|
||||||
|
|
||||||
lastStartPacket = packet;
|
lastStartPacket = packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user