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

> [EMAIL PROTECTED] - Di 13. Nov 2007, 07:05:50]:
> 
> Daniel Markstedt wrote:
> > <URL: http://bugs.freeciv.org/Ticket/Display.html?id=39855 >
> >
> > We ought to have a windows gtk package with embedded ggz client. Was
> told
> > on #ggz that the code is portable, with win32 binaries available
> from http://
> > ggzgamingzone.org/~oojah/
> >
> > Maybe we could make a special test package for 2.1.0.
> 
> Yes, the windows package should absolutely have GGZ built-in.
> 
> -jason
> 

Here's a package with GGZ support:

ftp://ftp.freeciv.org/freeciv/packages/windows/testing/Freeciv-2.1.0-win32-gtk2-ggz-setup.exe

but for some reason the Freeciv client doesn't connect to the Freeciv
server. With the internal GGZ-GTK client the client freezes when trying
to launch or join a Freeciv game and with the external GGZ-GTK client
the Freeciv client gets started and shows the start page, but no message
from the Freeciv server appears. According to the ggzd debug log
(DumpFile option in ggzd.conf), the GGZ server didn't even receive the
launch/join request from the client. Other GGZ games work fine, though,
and there's also no problem with a linux client connecting to the same
server, so I'm a little clueless about this problem at the moment.

The attached patch was necessary to get the Freeciv client running at
all with GGZ support on Windows. It sets the HOME environment variable
before GGZ-GTK initialization, because GGZ-GTK depends on HOME for its
configuration file (crashes otherwise).

Index: client/gui-gtk-2.0/gui_main.c
===================================================================
--- client/gui-gtk-2.0/gui_main.c	(revision 13944)
+++ client/gui-gtk-2.0/gui_main.c	(working copy)
@@ -1253,6 +1253,18 @@
 void ui_init(void)
 {
 #ifdef GGZ_GTK
+
+  /* make sure the HOME variable is set on Windows, because
+   * ggz_gtk_initialize() uses it for the gtk-ggz configuration file */
+#ifdef WIN32_NATIVE
+  char *uhd = user_home_dir();
+  if (uhd) {
+    char home_string[strlen("HOME=") + strlen(uhd) + 1];
+    my_snprintf(home_string, sizeof(home_string), "HOME=%s", uhd);
+    putenv(home_string);
+  }
+#endif /* WIN32_NATIVE */
+    
   /* Engine and version match what is provided in civclient.dsc.in and
    * civserver.dsc.in. */
   ggz_gtk_initialize(FALSE,
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to