예제 #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();
      }
    }
예제 #2
0
 @Override
 public boolean test(PacketReceivedEvent event) {
   return typeFilter.test(event.getPacket()) && additionalTest((T) event.getPacket(), event);
 }
예제 #3
0
 @Override
 public void filteredPacketReceived(PacketReceivedEvent event) {
   packetReceived((T) event.getPacket(), event);
 }