public boolean accept(Packet packet) { for (int i=0; i<size; i++) { if (filters[i].accept(packet)) { return true; } } return false; }
public boolean accept(Packet packet) { for (int i=0; i<size; i++) { if (filters[i].accept(packet)) { return true; } } return false; }
public boolean accept(Packet packet) { for (int i=0; i<size; i++) { if (!filters[i].accept(packet)) { return false; } } return true; }
public boolean accept(Packet packet) { for (PacketFilter filter : filters) { if (!filter.accept(packet)) { return false; } } return true; }
public boolean accept(Packet packet) { for (int i=0; i<size; i++) { if (filters[i].accept(packet)) { return true; } } return false; }
public boolean accept(Packet packet) { return !filter.accept(packet); } }
public boolean accept(Packet packet) { for (PacketFilter filter : filters) { if (!filter.accept(packet)) { return false; } } return true; }
public boolean accept(Packet packet) { return !filter.accept(packet); } }
public boolean accept(Packet packet) { for (int i=0; i<size; i++) { if (filters[i].accept(packet)) { return true; } } return false; }
public boolean accept(Packet packet) { for (PacketFilter filter : filters) { if (!filter.accept(packet)) { return false; } } return true; }
/** * Notify and process the packet listener if the filter matches the packet. * * @param packet the packet which was sent or received. */ public void notifyListener(Packet packet) { if (packetFilter == null || packetFilter.accept(packet)) { packetListener.processPacket(packet); } } }
/** * Notify and process the packet listener if the filter matches the packet. * * @param packet the packet which was sent or received. */ public void notifyListener(Packet packet) { if (packetFilter == null || packetFilter.accept(packet)) { packetListener.processPacket(packet); } } }
/** * Notify and process the packet listener if the filter matches the packet. * * @param packet the packet which was sent or received. */ public void notifyListener(Packet packet) { if (packetFilter == null || packetFilter.accept(packet)) { packetListener.processPacket(packet); } } }
public boolean accept(Packet packet) { if (delegate == null) { delegate = createFilter(); } return delegate.accept(packet); }
public void notifyListener(Packet packet) { if (packetFilter == null || packetFilter.accept(packet)) { packetListener.processPacket(packet); } } }
public void notifyListener(Packet packet) { if (packetFilter == null || packetFilter.accept(packet)) { packetInterceptor.interceptPacket(packet); } } }
/** * Notify and process the packet interceptor if the filter matches the packet. * * @param packet the packet which will be sent. */ public void notifyListener(Packet packet) { if (packetFilter == null || packetFilter.accept(packet)) { packetInterceptor.interceptPacket(packet); } } }
/** * Notify and process the packet interceptor if the filter matches the packet. * * @param packet the packet which will be sent. */ public void notifyListener(Packet packet) { if (packetFilter == null || packetFilter.accept(packet)) { packetInterceptor.interceptPacket(packet); } } }
/** * Notify and process the packet interceptor if the filter matches the packet. * * @param packet the packet which will be sent. */ public void notifyListener(Packet packet) { if (packetFilter == null || packetFilter.accept(packet)) { packetInterceptor.interceptPacket(packet); } } }
void sendMessage(Chat chat, Message message) { for(Map.Entry<PacketInterceptor, PacketFilter> interceptor : interceptors.entrySet()) { PacketFilter filter = interceptor.getValue(); if(filter != null && filter.accept(message)) { interceptor.getKey().interceptPacket(message); } } // Ensure that messages being sent have a proper FROM value if (message.getFrom() == null) { message.setFrom(connection.getUser()); } connection.sendPacket(message); }