public boolean waitForPlayers() {
    boolean running = false;

    while (!running) {
      String msg = receive();

      if (msg.equals("exit")) {
        try { // falls der Client beenden Button gedrueckt wurde
          connection.close(); // macht das Socket wieder zu und gibt
        } catch (IOException e) { // false zurueck
          System.out.println("communicator: error while closing connection");
          return false;
        }

        return false;
      }

      if (msg.equals("go")) {
        running = true;
      } else {
        try {
          StringTokenizer ST = new StringTokenizer(msg);
          playerNumber = Integer.parseInt(ST.nextToken());
          System.out.println("communicator: number of players " + playerNumber);
          myNumber = Integer.parseInt(ST.nextToken());
          myClient.playerNumberChanged(playerNumber);
          System.out.println("communicator: my number " + myNumber);
        } catch (NoSuchElementException e) {
          System.out.println("communicator: corrupt message in method waitForPlayers");
          sendTo(-2, String.valueOf(myNumber()));

          try {
            connection.close();
          } catch (IOException ex) {
          }

          return false;
        }
      }
    }

    return true;
  } // waitForPlayers