Beispiel #1
0
    @Override
    public void packetReceived(PacketReceivedEvent event) {
      if (replyPacket != null) {
        logger.warn("received more than one synchronous reply");
        return;
      }

      if (!filter.test(event.getPacket())) return;

      replyPacket = event.getPacket();
      synchronized (lock) {
        lock.notify();
      }
    }
Beispiel #2
0
 @Override
 public boolean test(PacketReceivedEvent event) {
   return typeFilter.test(event.getPacket()) && additionalTest((T) event.getPacket(), event);
 }
Beispiel #3
0
 @Override
 public void filteredPacketReceived(PacketReceivedEvent event) {
   packetReceived((T) event.getPacket(), event);
 }