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

The current capability sets are not enough for GGZ.

Specifically, GGZ does its own capability checking (or prechecking), 
comparing capability strings to see if a game is "supported".  Each GGZ 
room supports one game so there is a 2.1 room which should support the 
whole 2.1 collection (the bizarre broken capability in 2.1 notwithstanding).

This string is provided in several places: data/civclient.dsc.in, 
data/civserver.dsc.in, and is used in ggz_gtk_init in gui_main.c.

But with our optional capabilities the regular capstring cannot be used 
here.  Doing so means GGZ sees compatible releases as incompatible if 
they contain different optional capabilities.  When NETWORK_CAPSTRING 
was first added to the bootstrap (AC_SUBST and AC_DEFINE) it was to 
allow ggz support but I completely missed this nuance.

The easiest way I think is to separate the capstring into two strings, 
one for mandatory and one for optional capabilities.  The attached patch 
does this; it's pretty simple really.

For 2.1 to get GGZ support working again (since an optional capability 
was present there) a similar change (probably more complicated since the 
2.1 system is different) will be needed for that branch along with a new 
2.1 release.

-jason

Index: version.in
===================================================================
--- version.in	(revision 14848)
+++ version.in	(working copy)
@@ -23,4 +23,5 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING="+Freeciv.Devel.2008.May.08"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel.2008.May.08"
+NETWORK_CAPSTRING_OPTIONAL=""
Index: configure.ac
===================================================================
--- configure.ac	(revision 14848)
+++ configure.ac	(working copy)
@@ -44,9 +44,14 @@
 AC_SUBST([MAJOR_VERSION])
 AC_SUBST([MINOR_VERSION])
 
-AC_DEFINE_UNQUOTED([NETWORK_CAPSTRING], ["$NETWORK_CAPSTRING"],
+AC_DEFINE_UNQUOTED([NETWORK_CAPSTRING_MANDATORY],
+		   ["$NETWORK_CAPSTRING_MANDATORY"],
 		   [Network capability string])
-AC_SUBST([NETWORK_CAPSTRING])
+AC_SUBST([NETWORK_CAPSTRING_MANDATORY])
+AC_DEFINE_UNQUOTED([NETWORK_CAPSTRING_OPTIONAL],
+		   ["$NETWORK_CAPSTRING_OPTIONAL"],
+		   [Additional optional network capabilities])
+AC_SUBST([NETWORK_CAPSTRING_OPTIONAL])
 
 dnl Initialize automake stuff
 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
Index: data/civserver.dsc.in
===================================================================
--- data/civserver.dsc.in	(revision 14848)
+++ data/civserver.dsc.in	(working copy)
@@ -12,7 +12,7 @@
 
 [Protocol]
 Engine = Freeciv
-Version = @NETWORK_CAPSTRING@
+Version = @NETWORK_CAPSTRING_MANDATORY@
 
 [TableOptions]
 AllowLeave = 1
Index: data/civclient.dsc.in
===================================================================
--- data/civclient.dsc.in	(revision 14848)
+++ data/civclient.dsc.in	(working copy)
@@ -7,5 +7,5 @@
 Homepage = http://www.freeciv.org/
 Name = Freeciv
 ProtocolEngine = Freeciv
-ProtocolVersion = @NETWORK_CAPSTRING@
+ProtocolVersion = @NETWORK_CAPSTRING_MANDATORY@
 Version = @VERSION@
Index: common/capstr.h
===================================================================
--- common/capstr.h	(revision 14848)
+++ common/capstr.h	(working copy)
@@ -13,6 +13,9 @@
 #ifndef FC__CAPSTR_H
 #define FC__CAPSTR_H
 
+#define NETWORK_CAPSTRING (NETWORK_CAPSTRING_MANDATORY " "	\
+			   NETWORK_CAPSTRING_OPTIONAL)
+
 extern const char * const our_capability;
 
 void init_our_capability(void);
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
--- client/gui-gtk-2.0/gui_main.c	(revision 14848)
+++ client/gui-gtk-2.0/gui_main.c	(working copy)
@@ -1412,7 +1412,7 @@
    * civserver.dsc.in. */
   ggz_gtk_initialize(FALSE,
 		     ggz_connected, ggz_game_launched, ggz_closed,
-		     "Freeciv", NETWORK_CAPSTRING, "Pubserver");
+		     "Freeciv", NETWORK_CAPSTRING_MANDATORY, "Pubserver");
 #endif
 
   log_set_callback(log_callback_utf8);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to