Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2006:
[Freeciv-Dev] (PR#15083) flatten ggz_initialize
Home

[Freeciv-Dev] (PR#15083) flatten ggz_initialize

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15083) flatten ggz_initialize
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Jan 2006 21:31:43 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15083 >

Turns out it is desirable to do the with_ggz check outside of 
ggz_initialize.  This allows ggz_initialize to be called in certain 
cases when this value is not set.

-jason

Index: client/ggzclient.c
===================================================================
--- client/ggzclient.c  (revision 11418)
+++ client/ggzclient.c  (working copy)
@@ -53,23 +53,21 @@
 ****************************************************************************/
 void ggz_initialize(void)
 {
-  if (with_ggz) {
-    int ggz_socket;
+  int ggz_socket;
 
-    /* We're in GGZ mode */
-    ggzmod = ggzmod_new(GGZMOD_GAME);
-    ggzmod_set_handler(ggzmod, GGZMOD_EVENT_SERVER, &handle_ggzmod_server);
-    if (ggzmod_connect(ggzmod) < 0) {
-      exit(EXIT_FAILURE);
-    }
-    ggz_socket = ggzmod_get_fd(ggzmod);
-    if (ggz_socket < 0) {
-      fc_fprintf(stderr, _("Only the GGZ client must call civclient"
-                          " in ggz mode!\n"));
-      exit(EXIT_FAILURE);
-    }
-    add_ggz_input(ggz_socket);
+  /* We're in GGZ mode */
+  ggzmod = ggzmod_new(GGZMOD_GAME);
+  ggzmod_set_handler(ggzmod, GGZMOD_EVENT_SERVER, &handle_ggzmod_server);
+  if (ggzmod_connect(ggzmod) < 0) {
+    exit(EXIT_FAILURE);
   }
+  ggz_socket = ggzmod_get_fd(ggzmod);
+  if (ggz_socket < 0) {
+    fc_fprintf(stderr, _("Only the GGZ client must call civclient"
+                        " in ggz mode!\n"));
+    exit(EXIT_FAILURE);
+  }
+  add_ggz_input(ggz_socket);
 }
 
 /****************************************************************************
Index: client/civclient.c
===================================================================
--- client/civclient.c  (revision 11418)
+++ client/civclient.c  (working copy)
@@ -355,7 +355,9 @@
   audio_real_init(sound_set_name, sound_plugin_name);
   audio_play_music("music_start", NULL);
 
-  ggz_initialize();
+  if (with_ggz) {
+    ggz_initialize();
+  }
 
   /* run gui-specific client */
   ui_main(argc, argv);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#15083) flatten ggz_initialize, Jason Short <=