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

Reply via email to