[Freeciv-commits] r33448 - in /trunk: Makefile.am client/Makefile.am configure.ac server/Makefile.am tools/Makefile.am win32/ windows/

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 22:04:29 2016
New Revision: 33448

URL: http://svn.gna.org/viewcvs/freeciv?rev=33448&view=rev
Log:
Renamed win32/ directory as windows/

See patch #7524

Added:
trunk/windows/
  - copied from r33447, trunk/win32/
Removed:
trunk/win32/
Modified:
trunk/Makefile.am
trunk/client/Makefile.am
trunk/configure.ac
trunk/server/Makefile.am
trunk/tools/Makefile.am

Modified: trunk/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/Makefile.am?rev=33448&r1=33447&r2=33448&view=diff
==
--- trunk/Makefile.am   (original)
+++ trunk/Makefile.am   Wed Aug  3 22:04:29 2016
@@ -25,7 +25,7 @@
 DSUBDIRS =
 endif
 
-SUBDIRS = $(DSUBDIRS) dependencies utility common tests win32 $(SSUBDIRS) 
$(CSUBDIRS) translations doc tools gen_headers lua bootstrap
+SUBDIRS = $(DSUBDIRS) dependencies utility common tests windows $(SSUBDIRS) 
$(CSUBDIRS) translations doc tools gen_headers lua bootstrap
 
 ## Automake should distribute config.rpath automatically - and new
 ## versions probably do. We still support versions that do not, so

Modified: trunk/client/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/Makefile.am?rev=33448&r1=33447&r2=33448&view=diff
==
--- trunk/client/Makefile.am(original)
+++ trunk/client/Makefile.amWed Aug  3 22:04:29 2016
@@ -51,7 +51,7 @@
 endif
 
 if MINGW
-CLIENTICON=../win32/clienticon.o
+CLIENTICON=../windows/clienticon.o
 endif
 
 EXTRA_DIST= $(ALL_AUDIO_SDL_FILES)

Modified: trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=33448&r1=33447&r2=33448&view=diff
==
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Wed Aug  3 22:04:29 2016
@@ -1742,7 +1742,7 @@
   ai/threaded/Makefile
   ai/threxpr/Makefile
  tests/Makefile
- win32/Makefile
+ windows/Makefile
  client/Makefile
  client/agents/Makefile
  client/include/Makefile

Modified: trunk/server/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/Makefile.am?rev=33448&r1=33447&r2=33448&view=diff
==
--- trunk/server/Makefile.am(original)
+++ trunk/server/Makefile.amWed Aug  3 22:04:29 2016
@@ -28,7 +28,7 @@
$(FCDB_MYSQL_CFLAGS) $(FCDB_POSTGRES_CFLAGS) $(FCDB_SQLITE3_CFLAGS)
 
 if MINGW
-SERVERICON=../win32/servericon.o
+SERVERICON=../windows/servericon.o
 endif
 
 exe_sources = \

Modified: trunk/tools/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/tools/Makefile.am?rev=33448&r1=33447&r2=33448&view=diff
==
--- trunk/tools/Makefile.am (original)
+++ trunk/tools/Makefile.am Wed Aug  3 22:04:29 2016
@@ -54,7 +54,7 @@
 AM_CPPFLAGS = $(common_cppflags)
 
 if MINGW
-MPICON = $(top_builddir)/win32/mpicon.o
+MPICON = $(top_builddir)/windows/mpicon.o
 else
 desktopfiledir = @DESKTOPDIR@
 desktopfile_DATA =


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33447 - in /trunk: bootstrap/fcser.in configure.ac

2016-08-03 Thread sveinung84
Author: sveinung
Date: Wed Aug  3 16:08:42 2016
New Revision: 33447

URL: http://svn.gna.org/viewcvs/freeciv?rev=33447&view=rev
Log:
Make ./fcser work with the freeciv-web server.

See patch #7536

Modified:
trunk/bootstrap/fcser.in
trunk/configure.ac

Modified: trunk/bootstrap/fcser.in
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/bootstrap/fcser.in?rev=33447&r1=33446&r2=33447&view=diff
==
--- trunk/bootstrap/fcser.in(original)
+++ trunk/bootstrap/fcser.inWed Aug  3 16:08:42 2016
@@ -15,7 +15,7 @@
 #***/
 
 BUILDDIR=`dirname $0`
-EXENAME=freeciv-server@EXEEXT@
+EXENAME=@SRVBIN@@EXEEXT@
 
 if test "x$FREECIV_DATA_PATH" = "x" ; then
   
FREECIV_DATA_PATH=".@HOST_PATH_SEPARATOR@data@HOST_PATH_SEPARATOR@@FREECIV_STORAGE_DIR@@HOST_DIR_SEPARATOR@@DATASUBDIR@"

Modified: trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=33447&r1=33446&r2=33447&view=diff
==
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Wed Aug  3 16:08:42 2016
@@ -394,6 +394,10 @@
 esac], [fcweb=false])
 
 FC_WEB_CLIENT
+
+AS_IF([test "x$fcweb" = "xtrue"],
+  AC_SUBST([SRVBIN], [freeciv-web]),
+  AC_SUBST([SRVBIN], [freeciv-server]))
 
 FC_TESTMATIC
 


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33445 - /trunk/server/settings.c

2016-08-03 Thread sveinung84
Author: sveinung
Date: Wed Aug  3 16:08:26 2016
New Revision: 33445

URL: http://svn.gna.org/viewcvs/freeciv?rev=33445&view=rev
Log:
Freeciv-web: prevent unsupported topologies.

The Freeciv-web client is capable of displaying non wrapped maps and maps
that wrap in the east-west direction. Have the Freeciv-web server refuse to
accept other topologies to the topology server setting.

See patch #7534

Modified:
trunk/server/settings.c

Modified: trunk/server/settings.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/settings.c?rev=33445&r1=33444&r2=33445&view=diff
==
--- trunk/server/settings.c (original)
+++ trunk/server/settings.c Wed Aug  3 16:08:26 2016
@@ -1210,6 +1210,22 @@
 return FALSE;
   }
 
+#ifdef FREECIV_WEB
+  /* Remember to update the help text too if Freeciv-web gets the ability
+   * to display other map topologies. */
+  if ((value & (TF_WRAPY)) != 0
+  /* Are you removing this because Freeciv-web gained the ability to
+   * display isometric maps? Why don't you remove the Freeciv-web
+   * specific MAP_DEFAULT_TOPO too? */
+  || (value & (TF_ISO)) != 0
+  || (value & (TF_HEX)) != 0) {
+/* The Freeciv-web client can't display these topologies yet. */
+settings_snprintf(reject_msg, reject_msg_len,
+  _("Freeciv-web doesn't support this topology."));
+return FALSE;
+  }
+#endif /* FREECIV_WEB */
+
   return TRUE;
 }
 
@@ -1374,6 +1390,12 @@
   GEN_BITWISE("topology", game.map.topology_id, SSET_MAP_SIZE,
   SSET_GEOLOGY, SSET_VITAL, ALLOW_NONE, ALLOW_BASIC,
   N_("Map topology index"),
+#ifdef FREECIV_WEB
+  /* TRANS: Freeciv-web version of the help text. */
+  N_("Freeciv maps are always two-dimensional. They may wrap "
+ "at the east-west directions to form a flat map or a "
+ "cylinder.\n"),
+#else /* FREECIV_WEB */
   /* TRANS: do not edit the ugly ASCII art */
   N_("Freeciv maps are always two-dimensional. They may wrap at "
  "the north-south and east-west directions to form a flat "
@@ -1395,6 +1417,7 @@
  "   | | | | | | |/ \\_/ \\_/ \\_/ \\_/ \\\n"
  "   \\/\\/\\/\\/\\/\\/"
  " \\_/ \\_/ \\_/ \\_/ \\_/\n"),
+#endif /* FREECIV_WEB */
   topology_callback, topology_action, topology_name, 
MAP_DEFAULT_TOPO)
 
   GEN_ENUM("generator", game.map.server.generator,


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33443 - /trunk/server/savecompat.c

2016-08-03 Thread sveinung84
Author: sveinung
Date: Wed Aug  3 16:08:09 2016
New Revision: 33443

URL: http://svn.gna.org/viewcvs/freeciv?rev=33443&view=rev
Log:
Freeciv-web: load fcweb saves using classic.

The fcweb ruleset was classic with some Freeciv-web client specific
workarounds. It has now been replaced with the classic ruleset in
Freeciv-web.

Freeciv-web uses trunk. Its savegames will therefore be upgraded with the
development version compatibility code.

Have the savegame compatibility code upgrade fcweb savegames to classic
savegames when the server is Freeciv-web. (A regular Freeciv server build
that encounters a fcweb savegame may have a ruleset names fcweb installed
locally)

See patch #7532

Modified:
trunk/server/savecompat.c

Modified: trunk/server/savecompat.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/savecompat.c?rev=33443&r1=33442&r2=33443&view=diff
==
--- trunk/server/savecompat.c   (original)
+++ trunk/server/savecompat.c   Wed Aug  3 16:08:09 2016
@@ -1567,6 +1567,24 @@
 
   /* Since version number bump to 2.91.99 */
 
+#ifdef FREECIV_WEB
+  {
+/* Freeciv-web has replaced fcweb with classic. Only done for
+ * Freeciv-web because a regular Freeciv server build that encounters a
+ * fcweb savegame may have a ruleset names fcweb installed locally. */
+
+const char *ruleset;
+
+ruleset = secfile_lookup_str_default(loading->file,
+ GAME_DEFAULT_RULESETDIR,
+ "savefile.rulesetdir");
+
+if (strcmp("fcweb", ruleset) == 0) {
+  secfile_replace_str(loading->file, "classic", "savefile.rulesetdir");
+}
+  }
+#endif /* FREECIV_WEB */
+
   /* Idle turns */
   player_slots_iterate(pslot) {
 int plrno = player_slot_index(pslot);


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33446 - /trunk/data/webperimental/game.ruleset

2016-08-03 Thread sveinung84
Author: sveinung
Date: Wed Aug  3 16:08:34 2016
New Revision: 33446

URL: http://svn.gna.org/viewcvs/freeciv?rev=33446&view=rev
Log:
webperimental: allow use on non wrapping maps.

Unlock the topology ruleset setting so webperimental can be used to play
games on non wrapping maps.

See patch #7535

Modified:
trunk/data/webperimental/game.ruleset

Modified: trunk/data/webperimental/game.ruleset
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/webperimental/game.ruleset?rev=33446&r1=33445&r2=33446&view=diff
==
--- trunk/data/webperimental/game.ruleset   (original)
+++ trunk/data/webperimental/game.ruleset   Wed Aug  3 16:08:34 2016
@@ -1059,7 +1059,7 @@
 set =
   { "name", "value", "lock"
 "autosaves", "", TRUE
-"topology", "WRAPX", TRUE
+"topology", "WRAPX", FALSE
 "nationset", "all", TRUE
 "compresstype", "xz", TRUE
 "traitdistribution", "EVEN", FALSE


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33444 - /trunk/common/map.h

2016-08-03 Thread sveinung84
Author: sveinung
Date: Wed Aug  3 16:08:18 2016
New Revision: 33444

URL: http://svn.gna.org/viewcvs/freeciv?rev=33444&view=rev
Log:
Freeciv-web: non isometric maps by default.

Freeciv-web can't display isometric maps.

See patch #7533

Modified:
trunk/common/map.h

Modified: trunk/common/map.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/map.h?rev=33444&r1=33443&r2=33444&view=diff
==
--- trunk/common/map.h  (original)
+++ trunk/common/map.h  Wed Aug  3 16:08:18 2016
@@ -592,7 +592,12 @@
 #define MAP_MIN_LINEAR_SIZE  16
 
 #define MAP_ORIGINAL_TOPOTF_WRAPX
+#ifdef FREECIV_WEB
+/* Freeciv-web doesn't support isometric maps yet. */
+#define MAP_DEFAULT_TOPO TF_WRAPX
+#else /* FREECIV_WEB */
 #define MAP_DEFAULT_TOPO (TF_WRAPX|TF_ISO)
+#endif /* FREECIV_WEB */
 
 #define MAP_DEFAULT_SEED 0
 #define MAP_MIN_SEED 0


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33442 - /branches/S2_6/server/settings.c

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 14:09:53 2016
New Revision: 33442

URL: http://svn.gna.org/viewcvs/freeciv?rev=33442&view=rev
Log:
Use INIT_BRACE_BEGIN and INIT_BRACE_END in settings.c as needed.

See patch #7519

Modified:
branches/S2_6/server/settings.c

Modified: branches/S2_6/server/settings.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/settings.c?rev=33442&r1=33441&r2=33442&view=diff
==
--- branches/S2_6/server/settings.c (original)
+++ branches/S2_6/server/settings.c Wed Aug  3 14:09:53 2016
@@ -1216,8 +1216,9 @@
  _default)  \
   {name, sclass, to_client, short_help, extra_help, NULL, SSET_BOOL,\
   scateg, slevel,   \
+  INIT_BRACE_BEGIN  \
   .boolean = {&value, _default, func_validate, bool_name,   \
-   FALSE}, func_action, FALSE},
+  FALSE} INIT_BRACE_END , func_action, FALSE},
 
 #define GEN_INT(name, value, sclass, scateg, slevel, to_client, \
 short_help, extra_help, func_help,  \
@@ -1225,8 +1226,9 @@
 _min, _max, _default)   \
   {name, sclass, to_client, short_help, extra_help, func_help, SSET_INT, \
   scateg, slevel,   \
+  INIT_BRACE_BEGIN  \
   .integer = {(int *) &value, _default, _min, _max, func_validate,  \
-   0},  \
+  0} INIT_BRACE_END,\
   func_action, FALSE},
 
 #define GEN_STRING(name, value, sclass, scateg, slevel, to_client,  \
@@ -1234,7 +1236,9 @@
_default)\
   {name, sclass, to_client, short_help, extra_help, NULL, SSET_STRING,  \
   scateg, slevel,   \
-  .string = {value, _default, sizeof(value), func_validate, ""},\
+  INIT_BRACE_BEGIN  \
+  .string = {value, _default, sizeof(value), func_validate, ""} \
+  INIT_BRACE_END,   \
   func_action, FALSE},
 
 #define GEN_ENUM(name, value, sclass, scateg, slevel, to_client,\
@@ -1242,17 +1246,20 @@
  func_action, func_name, _default)  \
   { name, sclass, to_client, short_help, extra_help, func_help, SSET_ENUM,  \
   scateg, slevel,   \
+  INIT_BRACE_BEGIN  \
.enumerator = {  &value, sizeof(value), _default,\
 func_validate,  \
-   (val_name_func_t) func_name, 0 }, func_action, FALSE},
+   (val_name_func_t) func_name, 0 } INIT_BRACE_END, \
+  func_action, FALSE},
 
 #define GEN_BITWISE(name, value, sclass, scateg, slevel, to_client, \
short_help, extra_help, func_validate, func_action,  \
func_name, _default) \
   { name, sclass, to_client, short_help, extra_help, NULL, SSET_BITWISE,\
 scateg, slevel, \
+  INIT_BRACE_BEGIN  \
   .bitwise = { (unsigned *) (void *) &value, _default, func_validate,   \
-   func_name, 0 }, func_action, FALSE},
+   func_name, 0 } INIT_BRACE_END, func_action, FALSE},
 
 /* game settings */
 static struct setting settings[] = {


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33441 - /trunk/server/settings.c

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 14:09:46 2016
New Revision: 33441

URL: http://svn.gna.org/viewcvs/freeciv?rev=33441&view=rev
Log:
Use INIT_BRACE_BEGIN and INIT_BRACE_END in settings.c as needed.

See patch #7519

Modified:
trunk/server/settings.c

Modified: trunk/server/settings.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/settings.c?rev=33441&r1=33440&r2=33441&view=diff
==
--- trunk/server/settings.c (original)
+++ trunk/server/settings.c Wed Aug  3 14:09:46 2016
@@ -1240,8 +1240,9 @@
  _default)  \
   {name, sclass, al_read, al_write, short_help, extra_help, NULL, SSET_BOOL,\
   scateg, slevel,   \
+  INIT_BRACE_BEGIN  \
   .boolean = {&value, _default, func_validate, bool_name,   \
-   FALSE}, func_action, FALSE},
+  FALSE} INIT_BRACE_END , func_action, FALSE},
 
 #define GEN_INT(name, value, sclass, scateg, slevel, al_read, al_write, \
 short_help, extra_help, func_help,  \
@@ -1249,8 +1250,9 @@
 _min, _max, _default)   \
   {name, sclass, al_read, al_write, short_help, extra_help, func_help,  \
   SSET_INT, scateg, slevel, \
+  INIT_BRACE_BEGIN  \
   .integer = {(int *) &value, _default, _min, _max, func_validate,  \
-   0},  \
+  0} INIT_BRACE_END,\
   func_action, FALSE},
 
 #define GEN_STRING(name, value, sclass, scateg, slevel, al_read, al_write, \
@@ -1258,7 +1260,9 @@
_default)\
   {name, sclass, al_read, al_write, short_help, extra_help, NULL,   \
   SSET_STRING, scateg, slevel,  \
-  .string = {value, _default, sizeof(value), func_validate, ""},\
+  INIT_BRACE_BEGIN  \
+  .string = {value, _default, sizeof(value), func_validate, ""} \
+  INIT_BRACE_END,   \
   func_action, FALSE},
 
 #define GEN_ENUM(name, value, sclass, scateg, slevel, al_read, al_write,\
@@ -1266,17 +1270,21 @@
  func_action, func_name, _default)  \
   { name, sclass, al_read, al_write, short_help, extra_help, func_help, \
   SSET_ENUM, scateg, slevel,\
+  INIT_BRACE_BEGIN  \
   .enumerator = {  &value, sizeof(value), _default, \
- func_validate, \
-   (val_name_func_t) func_name, 0 }, func_action, FALSE},
+   func_validate,   \
+   (val_name_func_t) func_name, 0 } INIT_BRACE_END, \
+ func_action, FALSE},
 
 #define GEN_BITWISE(name, value, sclass, scateg, slevel, al_read, al_write, \
short_help, extra_help, func_validate, func_action,  \
func_name, _default) \
   { name, sclass, al_read, al_write, short_help, extra_help, NULL,  \
 SSET_BITWISE, scateg, slevel,   \
+  INIT_BRACE_BEGIN  \
   .bitwise = { (unsigned *) (void *) &value, _default, func_validate,   \
-   func_name, 0 }, func_action, FALSE},
+   func_name, 0 } INIT_BRACE_END,   \
+  func_action, FALSE},
 
 /* game settings */
 static struct setting settings[] = {


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33440 - /branches/S2_5/server/ruleset.c

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 11:59:13 2016
New Revision: 33440

URL: http://svn.gna.org/viewcvs/freeciv?rev=33440&view=rev
Log:
Give sensible error about unknown default_government in ruleset.

See bug #24905

Modified:
branches/S2_5/server/ruleset.c

Modified: branches/S2_5/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/ruleset.c?rev=33440&r1=33439&r2=33440&view=diff
==
--- branches/S2_5/server/ruleset.c  (original)
+++ branches/S2_5/server/ruleset.c  Wed Aug  3 11:59:13 2016
@@ -3743,35 +3743,43 @@
* a specific ruleset to a gov not explicitly known by the nation set. */
   if (sval != NULL) {
 default_government = government_by_rule_name(sval);
-  }
-
-  sec = secfile_sections_by_name_prefix(file, NATION_SET_SECTION_PREFIX);
-  if (sec) {
-section_list_iterate(sec, psection) {
-  const char *set_name, *set_rule_name, *set_description;
-
-  set_name = secfile_lookup_str(file, "%s.name", section_name(psection));
-  set_rule_name =
-secfile_lookup_str(file, "%s.rule_name", section_name(psection));
-  set_description = secfile_lookup_str_default(file, "", "%s.description",
-   section_name(psection));
-  if (NULL == set_name || NULL == set_rule_name) {
-ruleset_error(LOG_ERROR, "Error: %s", secfile_error());
-ok = FALSE;
-break;
-  }
-  if (nation_set_new(set_name, set_rule_name, set_description) == NULL) {
-ok = FALSE;
-break;
-  }
-} section_list_iterate_end;
-section_list_destroy(sec);
-sec = NULL;
-  } else {
-ruleset_error(LOG_ERROR,
-  "At least one nation set [" NATION_SET_SECTION_PREFIX "_*] "
-  "must be defined.");
-ok = FALSE;
+if (default_government == NULL) {
+  ruleset_error(LOG_ERROR,
+"Tried to set unknown government type \"%s\" as 
default_government!",
+sval);
+  ok = FALSE;
+}
+  }
+
+  if (ok) {
+sec = secfile_sections_by_name_prefix(file, NATION_SET_SECTION_PREFIX);
+if (sec) {
+  section_list_iterate(sec, psection) {
+const char *set_name, *set_rule_name, *set_description;
+
+set_name = secfile_lookup_str(file, "%s.name", section_name(psection));
+set_rule_name =
+  secfile_lookup_str(file, "%s.rule_name", section_name(psection));
+set_description = secfile_lookup_str_default(file, "", 
"%s.description",
+ section_name(psection));
+if (NULL == set_name || NULL == set_rule_name) {
+  ruleset_error(LOG_ERROR, "Error: %s", secfile_error());
+  ok = FALSE;
+  break;
+}
+if (nation_set_new(set_name, set_rule_name, set_description) == NULL) {
+  ok = FALSE;
+  break;
+}
+  } section_list_iterate_end;
+  section_list_destroy(sec);
+  sec = NULL;
+} else {
+  ruleset_error(LOG_ERROR,
+"At least one nation set [" NATION_SET_SECTION_PREFIX "_*] 
"
+"must be defined.");
+  ok = FALSE;
+}
   }
 
   if (ok) {


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33438 - /trunk/server/ruleset.c

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 11:59:03 2016
New Revision: 33438

URL: http://svn.gna.org/viewcvs/freeciv?rev=33438&view=rev
Log:
Give sensible error about unknown default_government in ruleset.

See bug #24905

Modified:
trunk/server/ruleset.c

Modified: trunk/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/ruleset.c?rev=33438&r1=33437&r2=33438&view=diff
==
--- trunk/server/ruleset.c  (original)
+++ trunk/server/ruleset.c  Wed Aug  3 11:59:03 2016
@@ -4275,10 +4275,19 @@
  * a specific ruleset to a gov not explicitly known by the nation set. */
 if (sval != NULL) {
   game.default_government = government_by_rule_name(sval);
-  game.info.default_government_id
-= government_number(game.default_government);
-}
-
+  if (game.default_government == NULL) {
+ruleset_error(LOG_ERROR,
+  "Tried to set unknown government type \"%s\" as 
default_government!",
+  sval);
+ok = FALSE;
+  } else {
+game.info.default_government_id
+  = government_number(game.default_government);
+  }
+}
+  }
+
+  if (ok) {
 sec = secfile_sections_by_name_prefix(file, NATION_SET_SECTION_PREFIX);
 if (sec) {
   section_list_iterate(sec, psection) {


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33439 - /branches/S2_6/server/ruleset.c

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 11:59:08 2016
New Revision: 33439

URL: http://svn.gna.org/viewcvs/freeciv?rev=33439&view=rev
Log:
Give sensible error about unknown default_government in ruleset.

See bug #24905

Modified:
branches/S2_6/server/ruleset.c

Modified: branches/S2_6/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/ruleset.c?rev=33439&r1=33438&r2=33439&view=diff
==
--- branches/S2_6/server/ruleset.c  (original)
+++ branches/S2_6/server/ruleset.c  Wed Aug  3 11:59:08 2016
@@ -3997,10 +3997,19 @@
  * a specific ruleset to a gov not explicitly known by the nation set. */
 if (sval != NULL) {
   game.default_government = government_by_rule_name(sval);
-  game.info.default_government_id
-= government_number(game.default_government);
-}
-
+  if (game.default_government == NULL) {
+ruleset_error(LOG_ERROR,
+  "Tried to set unknown government type \"%s\" as 
default_government!",
+  sval);
+ok = FALSE;
+  } else {
+game.info.default_government_id
+  = government_number(game.default_government);
+  }
+}
+  }
+
+  if (ok) {
 sec = secfile_sections_by_name_prefix(file, NATION_SET_SECTION_PREFIX);
 if (sec) {
   section_list_iterate(sec, psection) {


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33437 - in /branches/S2_6/client/gui-gtk-3.0: unitselect.c unitselect.h unitselunitdlg.c

2016-08-03 Thread sveinung84
Author: sveinung
Date: Wed Aug  3 10:34:49 2016
New Revision: 33437

URL: http://svn.gna.org/viewcvs/freeciv?rev=33437&view=rev
Log:
Gtk 3 clients: standardize unit selection icon.

Standardize on the unit selection dialog's unit icon in unit selection
items. Use it in the transport dialog and in the action selection dialog's
unit target switcher. (The last two both use the unit selects unit dialog)

This adds information like nationality, hit points and veteran status to the
transport dialog and in the action selection dialog. It therefore becomes
easier to tell the units apart.

See patch #7531

Modified:
branches/S2_6/client/gui-gtk-3.0/unitselect.c
branches/S2_6/client/gui-gtk-3.0/unitselect.h
branches/S2_6/client/gui-gtk-3.0/unitselunitdlg.c

Modified: branches/S2_6/client/gui-gtk-3.0/unitselect.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/unitselect.c?rev=33437&r1=33436&r2=33437&view=diff
==
--- branches/S2_6/client/gui-gtk-3.0/unitselect.c   (original)
+++ branches/S2_6/client/gui-gtk-3.0/unitselect.c   Wed Aug  3 10:34:49 2016
@@ -761,6 +761,28 @@
  -1);
 }
 
+/**
+  Get an unit selection list item suitable image of the specified unit.
+
+  Caller is responsible for getting rid of the returned image after use.
+**/
+GdkPixbuf *usdlg_get_unit_image(const struct unit *punit)
+{
+  GdkPixbuf *out;
+  struct canvas canvas_store = FC_STATIC_CANVAS_INIT;
+
+  canvas_store.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
+  tileset_full_tile_width(tileset), tileset_full_tile_height(tileset));
+
+  put_unit(punit, &canvas_store, 1.0, 0, 0);
+  out = surface_get_pixbuf(canvas_store.surface,
+   tileset_full_tile_width(tileset),
+   tileset_full_tile_height(tileset));
+  cairo_surface_destroy(canvas_store.surface);
+
+  return out;
+}
+
 /*
   Append units (recursively).
 */
@@ -789,17 +811,7 @@
   gtk_tree_store_append(GTK_TREE_STORE(store), it, parent);
 
   /* Unit gfx */
-  {
-struct canvas canvas_store = FC_STATIC_CANVAS_INIT;
-
-canvas_store.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-tileset_full_tile_width(tileset), tileset_full_tile_height(tileset));
-
-put_unit(punit, &canvas_store, 1.0, 0, 0);
-pix = surface_get_pixbuf(canvas_store.surface, 
tileset_full_tile_width(tileset),
-tileset_full_tile_height(tileset));
-cairo_surface_destroy(canvas_store.surface);
-  }
+  pix = usdlg_get_unit_image(punit);
 
   phome = game_city_by_number(punit->homecity);
   if (phome) {

Modified: branches/S2_6/client/gui-gtk-3.0/unitselect.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/unitselect.h?rev=33437&r1=33436&r2=33437&view=diff
==
--- branches/S2_6/client/gui-gtk-3.0/unitselect.h   (original)
+++ branches/S2_6/client/gui-gtk-3.0/unitselect.h   Wed Aug  3 10:34:49 2016
@@ -21,4 +21,6 @@
 
 void unit_select_dialog_popdown(void);
 
+GdkPixbuf *usdlg_get_unit_image(const struct unit *punit);
+
 #endif  /* FC__UNITSELECT_H */

Modified: branches/S2_6/client/gui-gtk-3.0/unitselunitdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/unitselunitdlg.c?rev=33437&r1=33436&r2=33437&view=diff
==
--- branches/S2_6/client/gui-gtk-3.0/unitselunitdlg.c   (original)
+++ branches/S2_6/client/gui-gtk-3.0/unitselunitdlg.c   Wed Aug  3 10:34:49 2016
@@ -29,10 +29,11 @@
 #include "control.h"
 #include "tilespec.h"
 
-/* client/gui-gtk-3.x */
+/* client/gui-gtk-3.0 */
 #include "gui_main.h"
 #include "gui_stuff.h"
 #include "sprite.h"
+#include "unitselect.h"
 
 #include "unitselunitdlg.h"
 
@@ -128,6 +129,8 @@
 
   tcount = 0;
   unit_list_iterate(potential_tgt_units, ptgt) {
+GdkPixbuf *tubuf;
+
 struct unit_type *tgt_type = unit_type_get(ptgt);
 struct unit_sel_unit_cb_data *cbdata
 = fc_malloc(sizeof(struct unit_sel_unit_cb_data));
@@ -146,10 +149,10 @@
  G_CALLBACK(unit_sel_unit_destroyed), cbdata);
 gtk_grid_attach(GTK_GRID(box), radio, 0, tcount, 1, 1);
 
-spr = get_unittype_sprite(tileset, tgt_type,
-  direction8_invalid(), TRUE);
-if (spr != NULL) {
-  icon = gtk_image_new_from_pixbuf(sprite_get_pixbuf(spr));
+tubuf = usdlg_get_unit_image(ptgt);
+if (tubuf != NULL) {
+  icon = gtk_image_new_from_pixbuf(tubuf);
+  g_object_unref(tubuf);
 } else {
   icon = gtk

[Freeciv-commits] r33436 - in /trunk/client: gui-gtk-3.0/ gui-gtk-3.x/

2016-08-03 Thread sveinung84
Author: sveinung
Date: Wed Aug  3 10:33:47 2016
New Revision: 33436

URL: http://svn.gna.org/viewcvs/freeciv?rev=33436&view=rev
Log:
Gtk 3 clients: standardize unit selection icon.

Standardize on the unit selection dialog's unit icon in unit selection
items. Use it in the transport dialog and in the action selection dialog's
unit target switcher. (The last two both use the unit selects unit dialog)

This adds information like nationality, hit points and veteran status to the
transport dialog and in the action selection dialog. It therefore becomes
easier to tell the units apart.

See patch #7531

Modified:
trunk/client/gui-gtk-3.0/unitselect.c
trunk/client/gui-gtk-3.0/unitselect.h
trunk/client/gui-gtk-3.0/unitselunitdlg.c
trunk/client/gui-gtk-3.x/unitselect.c
trunk/client/gui-gtk-3.x/unitselect.h
trunk/client/gui-gtk-3.x/unitselunitdlg.c

Modified: trunk/client/gui-gtk-3.0/unitselect.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/unitselect.c?rev=33436&r1=33435&r2=33436&view=diff
==
--- trunk/client/gui-gtk-3.0/unitselect.c   (original)
+++ trunk/client/gui-gtk-3.0/unitselect.c   Wed Aug  3 10:33:47 2016
@@ -761,6 +761,28 @@
  -1);
 }
 
+/**
+  Get an unit selection list item suitable image of the specified unit.
+
+  Caller is responsible for getting rid of the returned image after use.
+**/
+GdkPixbuf *usdlg_get_unit_image(const struct unit *punit)
+{
+  GdkPixbuf *out;
+  struct canvas canvas_store = FC_STATIC_CANVAS_INIT;
+
+  canvas_store.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
+  tileset_full_tile_width(tileset), tileset_full_tile_height(tileset));
+
+  put_unit(punit, &canvas_store, 1.0, 0, 0);
+  out = surface_get_pixbuf(canvas_store.surface,
+   tileset_full_tile_width(tileset),
+   tileset_full_tile_height(tileset));
+  cairo_surface_destroy(canvas_store.surface);
+
+  return out;
+}
+
 /*
   Append units (recursively).
 */
@@ -789,17 +811,7 @@
   gtk_tree_store_append(GTK_TREE_STORE(store), it, parent);
 
   /* Unit gfx */
-  {
-struct canvas canvas_store = FC_STATIC_CANVAS_INIT;
-
-canvas_store.surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
-tileset_full_tile_width(tileset), tileset_full_tile_height(tileset));
-
-put_unit(punit, &canvas_store, 1.0, 0, 0);
-pix = surface_get_pixbuf(canvas_store.surface, 
tileset_full_tile_width(tileset),
-tileset_full_tile_height(tileset));
-cairo_surface_destroy(canvas_store.surface);
-  }
+  pix = usdlg_get_unit_image(punit);
 
   phome = game_city_by_number(punit->homecity);
   if (phome) {

Modified: trunk/client/gui-gtk-3.0/unitselect.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/unitselect.h?rev=33436&r1=33435&r2=33436&view=diff
==
--- trunk/client/gui-gtk-3.0/unitselect.h   (original)
+++ trunk/client/gui-gtk-3.0/unitselect.h   Wed Aug  3 10:33:47 2016
@@ -21,4 +21,6 @@
 
 void unit_select_dialog_popdown(void);
 
+GdkPixbuf *usdlg_get_unit_image(const struct unit *punit);
+
 #endif  /* FC__UNITSELECT_H */

Modified: trunk/client/gui-gtk-3.0/unitselunitdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/unitselunitdlg.c?rev=33436&r1=33435&r2=33436&view=diff
==
--- trunk/client/gui-gtk-3.0/unitselunitdlg.c   (original)
+++ trunk/client/gui-gtk-3.0/unitselunitdlg.c   Wed Aug  3 10:33:47 2016
@@ -29,10 +29,11 @@
 #include "control.h"
 #include "tilespec.h"
 
-/* client/gui-gtk-3.x */
+/* client/gui-gtk-3.0 */
 #include "gui_main.h"
 #include "gui_stuff.h"
 #include "sprite.h"
+#include "unitselect.h"
 
 #include "unitselunitdlg.h"
 
@@ -127,6 +128,8 @@
 
   tcount = 0;
   unit_list_iterate(potential_tgt_units, ptgt) {
+GdkPixbuf *tubuf;
+
 struct unit_type *tgt_type = unit_type_get(ptgt);
 struct unit_sel_unit_cb_data *cbdata
 = fc_malloc(sizeof(struct unit_sel_unit_cb_data));
@@ -145,9 +148,10 @@
  G_CALLBACK(unit_sel_unit_destroyed), cbdata);
 gtk_grid_attach(GTK_GRID(box), radio, 0, tcount, 1, 1);
 
-spr = get_unittype_sprite(tileset, tgt_type, direction8_invalid());
-if (spr != NULL) {
-  icon = gtk_image_new_from_pixbuf(sprite_get_pixbuf(spr));
+tubuf = usdlg_get_unit_image(ptgt);
+if (tubuf != NULL) {
+  icon = gtk_image_new_from_pixbuf(tubuf);
+  g_object_unref(tubuf);
 } else {
   icon = gtk_image_new();
 }

Modifi

[Freeciv-commits] r33435 - in /branches/S2_5/common: featured_text.c featured_text.h

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 10:32:35 2016
New Revision: 33435

URL: http://svn.gna.org/viewcvs/freeciv?rev=33435&view=rev
Log:
Do not pass const parameter as va_arg.

See patch #7526

Modified:
branches/S2_5/common/featured_text.c
branches/S2_5/common/featured_text.h

Modified: branches/S2_5/common/featured_text.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/common/featured_text.c?rev=33435&r1=33434&r2=33435&view=diff
==
--- branches/S2_5/common/featured_text.c(original)
+++ branches/S2_5/common/featured_text.cWed Aug  3 10:32:35 2016
@@ -77,7 +77,7 @@
 const struct ft_color ftc_client= FT_COLOR("#EF7F00",   NULL);
 const struct ft_color ftc_editor= FT_COLOR("#FF",   NULL);
 const struct ft_color ftc_command   = FT_COLOR("#006400",   NULL);
-const struct ft_color ftc_changed   = FT_COLOR("#FF",   NULL);
+  struct ft_color ftc_changed   = FT_COLOR("#FF",   NULL);
 const struct ft_color ftc_server_prompt = FT_COLOR("#FF",   "#BEBEBE");
 const struct ft_color ftc_player_lost   = FT_COLOR("#FF",   "#00");
 const struct ft_color ftc_game_start= FT_COLOR("#00FF00",   "#115511");
@@ -399,7 +399,7 @@
 return TRUE;
   case TTT_COLOR:
 {
-  struct ft_color color = va_arg(args, struct ft_color);
+  const struct ft_color color = va_arg(args, struct ft_color);
 
   if ((NULL == color.foreground || '\0' == color.foreground[0])
   && (NULL == color.background || '\0' == color.background[0])) {

Modified: branches/S2_5/common/featured_text.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/common/featured_text.h?rev=33435&r1=33434&r2=33435&view=diff
==
--- branches/S2_5/common/featured_text.h(original)
+++ branches/S2_5/common/featured_text.hWed Aug  3 10:32:35 2016
@@ -171,7 +171,7 @@
 extern const struct ft_color ftc_client;
 extern const struct ft_color ftc_editor;
 extern const struct ft_color ftc_command;
-extern const struct ft_color ftc_changed;
+extern   struct ft_color ftc_changed;
 extern const struct ft_color ftc_server_prompt;
 extern const struct ft_color ftc_player_lost;
 extern const struct ft_color ftc_game_start;


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33433 - in /trunk/common: featured_text.c featured_text.h

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 10:32:21 2016
New Revision: 33433

URL: http://svn.gna.org/viewcvs/freeciv?rev=33433&view=rev
Log:
Do not pass const parameter as va_arg.

See patch #7526

Modified:
trunk/common/featured_text.c
trunk/common/featured_text.h

Modified: trunk/common/featured_text.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/featured_text.c?rev=33433&r1=33432&r2=33433&view=diff
==
--- trunk/common/featured_text.c(original)
+++ trunk/common/featured_text.cWed Aug  3 10:32:21 2016
@@ -77,7 +77,7 @@
 const struct ft_color ftc_client= FT_COLOR("#EF7F00",   NULL);
 const struct ft_color ftc_editor= FT_COLOR("#FF",   NULL);
 const struct ft_color ftc_command   = FT_COLOR("#006400",   NULL);
-const struct ft_color ftc_changed   = FT_COLOR("#FF",   NULL);
+  struct ft_color ftc_changed   = FT_COLOR("#FF",   NULL);
 const struct ft_color ftc_server_prompt = FT_COLOR("#FF",   "#BEBEBE");
 const struct ft_color ftc_player_lost   = FT_COLOR("#FF",   "#00");
 const struct ft_color ftc_game_start= FT_COLOR("#00FF00",   "#115511");
@@ -399,7 +399,7 @@
 return TRUE;
   case TTT_COLOR:
 {
-  struct ft_color color = va_arg(args, struct ft_color);
+  const struct ft_color color = va_arg(args, struct ft_color);
 
   if ((NULL == color.foreground || '\0' == color.foreground[0])
   && (NULL == color.background || '\0' == color.background[0])) {

Modified: trunk/common/featured_text.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/featured_text.h?rev=33433&r1=33432&r2=33433&view=diff
==
--- trunk/common/featured_text.h(original)
+++ trunk/common/featured_text.hWed Aug  3 10:32:21 2016
@@ -172,7 +172,7 @@
 extern const struct ft_color ftc_client;
 extern const struct ft_color ftc_editor;
 extern const struct ft_color ftc_command;
-extern const struct ft_color ftc_changed;
+extern   struct ft_color ftc_changed;
 extern const struct ft_color ftc_server_prompt;
 extern const struct ft_color ftc_player_lost;
 extern const struct ft_color ftc_game_start;


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits


[Freeciv-commits] r33434 - in /branches/S2_6/common: featured_text.c featured_text.h

2016-08-03 Thread cazfi74
Author: cazfi
Date: Wed Aug  3 10:32:26 2016
New Revision: 33434

URL: http://svn.gna.org/viewcvs/freeciv?rev=33434&view=rev
Log:
Do not pass const parameter as va_arg.

See patch #7526

Modified:
branches/S2_6/common/featured_text.c
branches/S2_6/common/featured_text.h

Modified: branches/S2_6/common/featured_text.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/featured_text.c?rev=33434&r1=33433&r2=33434&view=diff
==
--- branches/S2_6/common/featured_text.c(original)
+++ branches/S2_6/common/featured_text.cWed Aug  3 10:32:26 2016
@@ -77,7 +77,7 @@
 const struct ft_color ftc_client= FT_COLOR("#EF7F00",   NULL);
 const struct ft_color ftc_editor= FT_COLOR("#FF",   NULL);
 const struct ft_color ftc_command   = FT_COLOR("#006400",   NULL);
-const struct ft_color ftc_changed   = FT_COLOR("#FF",   NULL);
+  struct ft_color ftc_changed   = FT_COLOR("#FF",   NULL);
 const struct ft_color ftc_server_prompt = FT_COLOR("#FF",   "#BEBEBE");
 const struct ft_color ftc_player_lost   = FT_COLOR("#FF",   "#00");
 const struct ft_color ftc_game_start= FT_COLOR("#00FF00",   "#115511");
@@ -399,7 +399,7 @@
 return TRUE;
   case TTT_COLOR:
 {
-  struct ft_color color = va_arg(args, struct ft_color);
+  const struct ft_color color = va_arg(args, struct ft_color);
 
   if ((NULL == color.foreground || '\0' == color.foreground[0])
   && (NULL == color.background || '\0' == color.background[0])) {

Modified: branches/S2_6/common/featured_text.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/featured_text.h?rev=33434&r1=33433&r2=33434&view=diff
==
--- branches/S2_6/common/featured_text.h(original)
+++ branches/S2_6/common/featured_text.hWed Aug  3 10:32:26 2016
@@ -172,7 +172,7 @@
 extern const struct ft_color ftc_client;
 extern const struct ft_color ftc_editor;
 extern const struct ft_color ftc_command;
-extern const struct ft_color ftc_changed;
+extern   struct ft_color ftc_changed;
 extern const struct ft_color ftc_server_prompt;
 extern const struct ft_color ftc_player_lost;
 extern const struct ft_color ftc_game_start;


___
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits