Exemple #1
0
 /**
  * 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);
     }
   }
 }
Exemple #2
0
  /** 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);
  }