From 17b7526fe9f448f3995228b77833fe6ab0e21ca3 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Wed, 10 Oct 2012 06:00:42 +0200 Subject: [PATCH] Set the queued index before enqueuing, not after. --- .../src/com/comphenix/protocol/async/AsyncFilterManager.java | 3 ++- .../src/com/comphenix/protocol/injector/ListenerInvoker.java | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ProtocolLib/src/com/comphenix/protocol/async/AsyncFilterManager.java b/ProtocolLib/src/com/comphenix/protocol/async/AsyncFilterManager.java index f7933f0d..bda4082d 100644 --- a/ProtocolLib/src/com/comphenix/protocol/async/AsyncFilterManager.java +++ b/ProtocolLib/src/com/comphenix/protocol/async/AsyncFilterManager.java @@ -186,12 +186,13 @@ public class AsyncFilterManager implements AsynchronousManager { if (asyncMarker.isQueued() || asyncMarker.isTransmitted()) throw new IllegalArgumentException("Cannot queue a packet that has already been queued."); + asyncMarker.setQueuedSendingIndex(asyncMarker.getNewSendingIndex()); + // Start the process getSendingQueue(syncPacket).enqueue(newEvent); // We know this is occuring on the main thread, so pass TRUE getProcessingQueue(syncPacket).enqueue(newEvent, true); - asyncMarker.setQueuedSendingIndex(asyncMarker.getNewSendingIndex()); } @Override diff --git a/ProtocolLib/src/com/comphenix/protocol/injector/ListenerInvoker.java b/ProtocolLib/src/com/comphenix/protocol/injector/ListenerInvoker.java index e5bc0e4b..e3b6eaee 100644 --- a/ProtocolLib/src/com/comphenix/protocol/injector/ListenerInvoker.java +++ b/ProtocolLib/src/com/comphenix/protocol/injector/ListenerInvoker.java @@ -4,6 +4,11 @@ import net.minecraft.server.Packet; import com.comphenix.protocol.events.PacketEvent; +/** + * Represents an object that initiate the packet listeners. + * + * @author Kristian + */ public interface ListenerInvoker { /**