hw1/src/main/java/controllers/PlayGame.java
/**
   * Send message to all players.
   * @param gameBoardJson Gameboard JSON
   * @throws IOException Websocket message send IO Exception
   */
Send message to all players.
@param gameBoardJson Gameboard JSON
@throws IOException Websocket message send IO Exception
Send message to all players . @param gameBoardJson Gameboard JSON @throws IOException Websocket message send IO Exception
private static void sendGameBoardToAllPlayers(final String gameBoardJson) {
    Queue<Session> sessions = UiWebSocket.getSessions();
    for (Session sessionPlayer : sessions) {
      try {
        sessionPlayer.getRemote().sendString(gameBoardJson);
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
  }
private static void sendGameBoardToAllPlayers ( final String gameBoardJson ) { Queue < Session > sessions = UiWebSocket . getSessions ( ) ; for ( Session sessionPlayer : sessions ) { try { sessionPlayer . getRemote ( ) . sendString ( gameBoardJson ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } }
Send message to all players.
Send message to all players .