Esempio n. 1
0
void
on_network_game (void)
{
  GtkWidget *ggzbox;
  struct passwd *pwent;  
  static gboolean ggz_initialized = FALSE;

  if (ggz_network_mode) {
    gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), NETWORK_PAGE);
    return;
  }

  game_reset ();
  ggz_network_mode = TRUE;
  prompt_player ();

  if (ggz_initialized == FALSE) {
    ggz_initialized = TRUE;
    ggz_gtk_initialize (FALSE,
		      ggz_connected, ggz_game_launched, ggz_closed,
		      NETWORK_ENGINE, NETWORK_VERSION, "gnect.xml",
		      "GGZ Gaming Zone");

    ggzbox = ggz_gtk_create_main_area (app);
    gtk_notebook_append_page (GTK_NOTEBOOK (notebook), ggzbox, NULL);
  }
  pwent = getpwuid(getuid());
  ggz_embed_ensure_server ("GGZ Gaming Zone", "gnome.ggzgamingzone.org",
			   5688, pwent->pw_name);

  gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), NETWORK_PAGE);
}
Esempio n. 2
0
/****************************************************************
  Call ggz_embed_ensure_server() if ggz enabled.
*****************************************************************/
void gui_ggz_embed_ensure_server(void)
{
#ifdef GGZ_GTK
  {
    char buf[128];

    user_username(buf, sizeof(buf));
    cat_snprintf(buf, sizeof(buf), "%d", myrand(100));
    ggz_embed_ensure_server("Pubserver", "freeciv.ggzgamingzone.org",
                           5688, buf);
  }
#endif /* GGZ_GTK */
}