From dc75f34e11b96c9a00dbc1be62d5851d56b4a2ef Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Wed, 10 Oct 2012 22:12:29 +0200 Subject: [PATCH] Add a warning message for lost packets. --- ItemDisguise/.classpath | 2 +- .../com/comphenix/protocol/async/PacketSendingQueue.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ItemDisguise/.classpath b/ItemDisguise/.classpath index b4cf4f7f..24f68324 100644 --- a/ItemDisguise/.classpath +++ b/ItemDisguise/.classpath @@ -3,6 +3,6 @@ - + diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/async/PacketSendingQueue.java b/ProtocolLib/src/main/java/com/comphenix/protocol/async/PacketSendingQueue.java index c90f5b9d..8c947c90 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/async/PacketSendingQueue.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/async/PacketSendingQueue.java @@ -9,6 +9,7 @@ import java.util.concurrent.PriorityBlockingQueue; import org.bukkit.entity.Player; import com.comphenix.protocol.events.PacketEvent; +import com.comphenix.protocol.injector.PlayerLoggedOutException; import com.comphenix.protocol.reflect.FieldAccessException; /** @@ -184,6 +185,12 @@ class PacketSendingQueue { if (marker != null && !marker.isTransmitted()) { marker.sendPacket(event); } + + } catch (PlayerLoggedOutException e) { + System.out.println(String.format( + "Warning: Dropped packet index %s of ID %s", + marker.getOriginalSendingIndex(), event.getPacketID() + )); } catch (IOException e) { // Just print the error