Archiviert
13
0

Make it possible to cancel packets for asynchronous processing.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-05-06 18:56:19 +02:00
Ursprung 8d814d2d9c
Commit a2b04e055a
2 geänderte Dateien mit 306 neuen und 304 gelöschten Zeilen

Datei anzeigen

@ -89,6 +89,7 @@ abstract class PacketSendingQueue {
PacketEvent copy = PacketEvent.fromSynchronous(packetUpdated, marker); PacketEvent copy = PacketEvent.fromSynchronous(packetUpdated, marker);
// "Cancel" the original event // "Cancel" the original event
packetUpdated.setReadOnly(false);
packetUpdated.setCancelled(true); packetUpdated.setCancelled(true);
// Enqueue the copy with the new sending index // Enqueue the copy with the new sending index

Datei anzeigen

@ -496,6 +496,7 @@ public final class PacketFilterManager implements ProtocolManager, ListenerInvok
asyncFilterManager.enqueueSyncPacket(event, event.getAsyncMarker()); asyncFilterManager.enqueueSyncPacket(event, event.getAsyncMarker());
// The above makes a copy of the event, so it's safe to cancel it // The above makes a copy of the event, so it's safe to cancel it
event.setReadOnly(false);
event.setCancelled(true); event.setCancelled(true);
} }
} }