Set the queued index before enqueuing, not after.

This commit is contained in:
Kristian S. Stangeland 2012-10-10 06:00:42 +02:00
parent cf68d229b0
commit 17b7526fe9
2 changed files with 7 additions and 1 deletions

View File

@ -186,12 +186,13 @@ public class AsyncFilterManager implements AsynchronousManager {
if (asyncMarker.isQueued() || asyncMarker.isTransmitted()) if (asyncMarker.isQueued() || asyncMarker.isTransmitted())
throw new IllegalArgumentException("Cannot queue a packet that has already been queued."); throw new IllegalArgumentException("Cannot queue a packet that has already been queued.");
asyncMarker.setQueuedSendingIndex(asyncMarker.getNewSendingIndex());
// Start the process // Start the process
getSendingQueue(syncPacket).enqueue(newEvent); getSendingQueue(syncPacket).enqueue(newEvent);
// We know this is occuring on the main thread, so pass TRUE // We know this is occuring on the main thread, so pass TRUE
getProcessingQueue(syncPacket).enqueue(newEvent, true); getProcessingQueue(syncPacket).enqueue(newEvent, true);
asyncMarker.setQueuedSendingIndex(asyncMarker.getNewSendingIndex());
} }
@Override @Override

View File

@ -4,6 +4,11 @@ import net.minecraft.server.Packet;
import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.events.PacketEvent;
/**
* Represents an object that initiate the packet listeners.
*
* @author Kristian
*/
public interface ListenerInvoker { public interface ListenerInvoker {
/** /**