Archiviert
13
0

Don't fetch NetworkMarker uncessarily.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2014-03-27 23:23:45 +01:00
Ursprung 3b26940385
Commit 485c3856c1
3 geänderte Dateien mit 4 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -257,16 +257,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
* @return The resulting message/packet.
*/
private PacketEvent processSending(Object message) {
return processSending(message, packetMarker.get(message));
}
/**
* Process a given message on the packet listeners.
* @param message - the message/packet.
* @return The resulting message/packet.
*/
private PacketEvent processSending(Object message, NetworkMarker marker) {
return channelListener.onPacketSending(ChannelInjector.this, message, marker);
return channelListener.onPacketSending(ChannelInjector.this, message);
}
/**
@ -315,7 +306,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
packet = null;
} else {
event = processSending(packet, marker);
event = processSending(packet);
// Handle the output
if (event != null) {

Datei anzeigen

@ -16,10 +16,9 @@ interface ChannelListener {
* This is invoked on the main thread.
* @param injector - the channel injector.
* @param packet - the packet.
* @param marker - the associated network marker, if any.
* @return The packet even that was passed to the listeners, with a possible packet change, or NULL.
*/
public PacketEvent onPacketSending(Injector injector, Object packet, NetworkMarker marker);
public PacketEvent onPacketSending(Injector injector, Object packet);
/**
* Invoked when a packet is being received from a client.

Datei anzeigen

@ -227,7 +227,7 @@ public class NettyProtocolInjector implements ChannelListener {
}
@Override
public PacketEvent onPacketSending(Injector injector, Object packet, NetworkMarker marker) {
public PacketEvent onPacketSending(Injector injector, Object packet) {
Class<?> clazz = packet.getClass();
if (sendingFilters.contains(clazz)) {