Beispiel #1
0
  void checkToGameStart() throws IOException {
    if (gameStarted == false) {
      if (players.sameTableSize()) {

        ctrl.GameStart(players.getTableSize());
        gameStarted = true;
        if (players.getTableSize() == 1)
          ctrl.printServerMessage("GameStarted in server with small table");
        if (players.getTableSize() == 2)
          ctrl.printServerMessage("GameStarted in server with medium table");
        if (players.getTableSize() == 3)
          ctrl.printServerMessage("GameStarted in server with large table");
      }
    }
  }
Beispiel #2
0
 void connect() {
   ctrl.printServerMessage("Server started!");
   receiverList = new ArrayList<ReceiverThread>();
   players = new PlayersList();
   disconnect();
   try {
     serverSocket = new ServerSocket(NetworkDefines.port);
   } catch (IOException e) {
     ctrl.serverError("Could not listen on port: " + NetworkDefines.port);
   }
   Thread t = new Thread(this);
   t.start();
 }