/** * Sends a packet to all <code>clients</code> who are playing, except those on the <code> * excludeList</code>. */ void sendPacketToMostPlayers(ByteOutputStream stream, Set<ClientMachine> excludeList) throws IOException { byte[] message = stream.toByteArray(); for (ClientMachine c : clients) { if (!excludeList.contains(c)) { if (c.isInGame()) sendPacket(c, message); } } }
/** Sends a packet to all <code>clients</code> who are playing. */ void sendPacketToAllPlayers(ByteOutputStream stream) throws IOException { if (clients == null) return; byte[] message = stream.toByteArray(); for (ClientMachine c : clients) if (c.isInGame()) sendPacket(c, message); }