コード例 #1
0
ファイル: Server.java プロジェクト: pg1770/Minesweeper_JAVA
  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");
      }
    }
  }
コード例 #2
0
ファイル: Server.java プロジェクト: pg1770/Minesweeper_JAVA
 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();
 }