Exemplo n.º 1
0
  private void clickCreateGame() {

    if (display.isDisposed()) return;

    GuiCreateGame guiCreateGame = new GuiCreateGame(display);
    guiCreateGame.init();
    guiCreateGame.run();

    String gameName = guiCreateGame.getGameName();
    //		.replaceAll("![a-zA-Z0-9_]", "_");
    // TODO constrain the format
    String gameTheme = guiCreateGame.getGameTheme();

    if (gameName == null) return;

    try {
      gameServer.createGame(gameName, gameTheme);
    } catch (Exception e) {
      displayError("Error while creating this game, sorry", e);
    }

    setServerMode(GuiServerMode.SERVER_WITH_GAME);

    // GuiCreateIdea guiCreateIdea = new GuiCreateIdea(compositeHost);
  }
Exemplo n.º 2
0
  private void clickShutdownServer() {

    if (gameServer != null) {
      gameServer.shutDown();
      gameServer = null;
      setServerMode(GuiServerMode.NO_SERVER);
    }
  }