Example #1
0
  /**
   * Connects to this game.
   *
   * @param gameBindName
   * @throws MalformedURLException
   * @throws RemoteException
   * @throws NotBoundException
   * @throws UnknownHostException
   */
  public void connectToGame(String gameBindName)
      throws MalformedURLException, RemoteException, NotBoundException, UnknownHostException {

    try {
      clientCore.connectToGame(gameBindName);

      clientWhiteboard.setGame(clientCore.getGame());

      clientCore.getGame().addListener(this);

      setClientMode(GuiClientMode.MONITOR);
      this.gameBindName = gameBindName;

    } catch (RuntimeException e) {

      // update info relative to the game.
      setClientMode(GuiClientMode.DISCONNECTED);
      this.gameBindName = null;

      throw e;
    }
  }