Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2000:
[Freeciv-Dev] patch: make barbarian server options changeable (PR#311)
Home

[Freeciv-Dev] patch: make barbarian server options changeable (PR#311)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] patch: make barbarian server options changeable (PR#311)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Thu, 16 Mar 2000 23:29:08 -0800 (PST)

Is there any particular reason why one shouldn't be able to change 
the 'barbarians' and 'onsetbarbs' server options during a game?
(That is, after the game has started.)  Eg, you start a game and 
realize you want more/fewer barbarians sooner/later...

This patch allows this, and adds some altered and slightly more 
extensive comments about which options should be SSET_RULES_FLEXIBLE.

-- David

--- freeciv-cvs/server/stdinhand.c      Fri Mar 17 14:19:53 2000
+++ fc-adv/server/stdinhand.c   Fri Mar 17 17:51:30 2000
@@ -457,8 +457,31 @@
        "See also README.rulesets and the techs, units, buildings and "
        "terrain options.") },
 
-  { "barbarians", &game.barbarianrate,
+  { "occupychance", &game.occupychance,
     SSET_RULES, SSET_TO_CLIENT,
+    GAME_MIN_OCCUPYCHANCE, GAME_MAX_OCCUPYCHANCE, GAME_DEFAULT_OCCUPYCHANCE,
+    N_("Chance of moving into tile after attack"),
+    N_("If set to 0, combat is Civ1/2-style (when you attack, you remain in "
+       "place).  If set to 100, attacking units will always move into the "
+       "tile they attacked if they win the combat (and no enemy units remain "
+       "in the tile).  If set to a value between 0 and 100, this will be used "
+       "as the percent chance of \"occupying\" territory.") },
+
+/* Flexible rules: these can be changed after the game has started.
+ *
+ * The distinction between "rules" and "flexible rules" is not always
+ * clearcut, and some existing cases may be largely historical or
+ * accidental.  However some generalizations can be made:
+ *
+ *   -- Low-level game mechanics should not be flexible (eg, rulesets).
+ *   -- Options which would affect the game "state" (city production etc)
+ *      should not be flexible (eg, foodbox).
+ *   -- Options which are explicitly sent to the client (eg, in
+ *      packet_game_info) should probably not be flexible, or at
+ *      least need extra care to be flexible.
+ */
+  { "barbarians", &game.barbarianrate,
+    SSET_RULES_FLEXIBLE, SSET_TO_CLIENT,
     GAME_MIN_BARBARIANRATE, GAME_MAX_BARBARIANRATE, GAME_DEFAULT_BARBARIANRATE,
     N_("Barbarian appearance frequency"),
     N_("0 - no barbarians \n"
@@ -468,26 +491,11 @@
     "4 - raging hordes, lots of barbarians") },
 
   { "onsetbarbs", &game.onsetbarbarian,
-    SSET_RULES, SSET_TO_CLIENT,
+    SSET_RULES_FLEXIBLE, SSET_TO_CLIENT,
     GAME_MIN_ONSETBARBARIAN, GAME_MAX_ONSETBARBARIAN, 
GAME_DEFAULT_ONSETBARBARIAN,
     N_("Barbarian onset year"),
     N_("Barbarians will not appear before this year.") },
 
-  { "occupychance", &game.occupychance,
-    SSET_RULES, SSET_TO_CLIENT,
-    GAME_MIN_OCCUPYCHANCE, GAME_MAX_OCCUPYCHANCE, GAME_DEFAULT_OCCUPYCHANCE,
-    N_("Chance of moving into tile after attack"),
-    N_("If set to 0, combat is Civ1/2-style (when you attack, you remain in "
-       "place).  If set to 100, attacking units will always move into the "
-       "tile they attacked if they win the combat (and no enemy units remain "
-       "in the tile).  If set to a value between 0 and 100, this will be used "
-       "as the percent chance of \"occupying\" territory.") },
-
-/* Flexible rules: these can be changed after the game has started.
- * Should such flexible rules exist?  diplchance is included here
- * to duplicate its previous behaviour (and note diplchance is only used
- * in the server, so it is "safe" to change).  --dwp
- */
   { "fogofwar", &game.fogofwar,
     SSET_RULES_FLEXIBLE, SSET_TO_CLIENT,
     GAME_MIN_FOGOFWAR, GAME_MAX_FOGOFWAR, GAME_DEFAULT_FOGOFWAR,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] patch: make barbarian server options changeable (PR#311), David Pfitzner <=