Ensure sendServerPacket() works in the channel thread as well.
If we're already in the channel event thread, we won't go through the ChannelProxy code, so, check scheduledProcessing in the write method as well.
Dieser Commit ist enthalten in:
Ursprung
4259a86740
Commit
38c62c4cfd
@ -300,7 +300,7 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
|
|||||||
NetworkMarker marker = null;
|
NetworkMarker marker = null;
|
||||||
|
|
||||||
// This packet has not been seen by the main thread
|
// This packet has not been seen by the main thread
|
||||||
if (event == null) {
|
if (event == null && scheduleProcessPackets.get()) {
|
||||||
Class<?> clazz = packet.getClass();
|
Class<?> clazz = packet.getClass();
|
||||||
|
|
||||||
// Schedule the transmission on the main thread instead
|
// Schedule the transmission on the main thread instead
|
||||||
@ -459,9 +459,12 @@ class ChannelInjector extends ByteToMessageDecoder implements Injector {
|
|||||||
public void sendServerPacket(Object packet, NetworkMarker marker, boolean filtered) {
|
public void sendServerPacket(Object packet, NetworkMarker marker, boolean filtered) {
|
||||||
saveMarker(packet, marker);
|
saveMarker(packet, marker);
|
||||||
|
|
||||||
scheduleProcessPackets.set(filtered);
|
try {
|
||||||
invokeSendPacket(packet);
|
scheduleProcessPackets.set(filtered);
|
||||||
scheduleProcessPackets.set(true);
|
invokeSendPacket(packet);
|
||||||
|
} finally {
|
||||||
|
scheduleProcessPackets.set(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,8 +4,6 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import com.comphenix.protocol.PacketType.Protocol;
|
import com.comphenix.protocol.PacketType.Protocol;
|
||||||
import com.comphenix.protocol.events.NetworkMarker;
|
import com.comphenix.protocol.events.NetworkMarker;
|
||||||
import com.comphenix.protocol.events.PacketEvent;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a closed injector.
|
* Represents a closed injector.
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren