Don't fetch NetworkMarker uncessarily.
Dieser Commit ist enthalten in:
Ursprung
3b26940385
Commit
485c3856c1
@ -257,16 +257,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
|
|||||||
* @return The resulting message/packet.
|
* @return The resulting message/packet.
|
||||||
*/
|
*/
|
||||||
private PacketEvent processSending(Object message) {
|
private PacketEvent processSending(Object message) {
|
||||||
return processSending(message, packetMarker.get(message));
|
return channelListener.onPacketSending(ChannelInjector.this, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -315,7 +306,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
|
|||||||
packet = null;
|
packet = null;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
event = processSending(packet, marker);
|
event = processSending(packet);
|
||||||
|
|
||||||
// Handle the output
|
// Handle the output
|
||||||
if (event != null) {
|
if (event != null) {
|
||||||
|
@ -16,10 +16,9 @@ interface ChannelListener {
|
|||||||
* This is invoked on the main thread.
|
* This is invoked on the main thread.
|
||||||
* @param injector - the channel injector.
|
* @param injector - the channel injector.
|
||||||
* @param packet - the packet.
|
* @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.
|
* @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.
|
* Invoked when a packet is being received from a client.
|
||||||
|
@ -227,7 +227,7 @@ public class NettyProtocolInjector implements ChannelListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PacketEvent onPacketSending(Injector injector, Object packet, NetworkMarker marker) {
|
public PacketEvent onPacketSending(Injector injector, Object packet) {
|
||||||
Class<?> clazz = packet.getClass();
|
Class<?> clazz = packet.getClass();
|
||||||
|
|
||||||
if (sendingFilters.contains(clazz)) {
|
if (sendingFilters.contains(clazz)) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren