Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#9839) cut down capstring
Home

[Freeciv-Dev] (PR#9839) cut down capstring

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#9839) cut down capstring
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Sep 2004 14:48:50 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9839 >

> [per - Tue Aug 31 11:06:37 2004]:
> 
> On Mon, 30 Aug 2004, Jason Short wrote:
> > > I think we should seriously consider ditching capabilities. It is
> a
> > > seriously cute concept, but it never really had any practical use,
> and it
> > > makes the code much more complicated when used.
> >
> > Um, well.
> >
> > Optional capabilities get heavy use in savegames loading. They have
> > some use in tileset and ruleset loading.
> 
> Get me right, I was not suggesting we use nothing. However, atomistic
> capabilities may not be the solution that best fits our needs. A
> simple
> version number may do the job better. At least for the network.
> Capabilities make more sense for rulesets and tilesets, although they
> are
> not used much there now.

Except for compatibility with releases, I agree.  However the capability
system is quite capable of doing this.

> > I'd like to suggest a new versioning method for manditory
> capabilities
> > in the deveopment version. Just use a single capability
> > "+CVS.August.30.2004". Any time network compatibility is broken we
> > don't add to this string just update it.
> 
> This is a step forward. I agree.

Here's a patch.  (Nothing's changed except the capstr.c part.)

jason

? diff
Index: common/capstr.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v
retrieving revision 1.181
diff -u -r1.181 capstr.c
--- common/capstr.c     2 Sep 2004 18:36:14 -0000       1.181
+++ common/capstr.c     2 Sep 2004 21:42:42 -0000
@@ -73,84 +73,7 @@
  * are not directly related to the capability strings discussed here.)
  */
 
-#define CAPABILITY "+1.14.delta +last_turns_shield_surplus veteran +orders " \
-                   "+starter +union +iso_maps +big_map_size +orders2client " \
-                   "+change_production +tilespec1 +no_earth +trans " \
-                   "+want_hack invasions bombard +killstack2 spec +spec2 " \
-                   "+city_map startunits +turn_last_built +happyborders " \
-                   "+connid +love2 +ocean_num +govclean +orders3 +rev_fin " \
-                   "+terr16"
-
-/* "+1.14.delta" is the new delta protocol for 1.14.0-dev.
- *
- * "last_turns_shield_surplus" means the surplus from the previous turn is
- * tracked by the server and sent to the client.  This information is used
- * in determining penalties when switching production.
- *
- * "orders" means client orders is used for client-side goto and patrol.
- *
- * "veteran" means the extended veteran system.
- *
- * "starter" means the Starter terrain flag is supported.
- *
- * "union" is team research ability
- *
- * "iso_maps" means iso-maps are supported by both server and client!
- *
- * "big_map_size" means [xy]size info is sent as UINT16 
- *
- * "orders2client" means that the server sends back the orders to the client.
- *
- * "change_production" is the E_CITY_PRODUCTION_CHANGED event.
- *
- * "tilespec1" means changed graphic strings in terrain.ruleset.
- *
- * "no_earth" means that the map.is_earth value is gone; replaced by
- * ptile->spec_sprite
- *
- * "trans" means that the transported_by field is sent to the client.
- *
- * "want_hack" means that the client is capable of asking for hack properly.
- * 
- * "invasions" means ground units moving from ocean to land now lose all
- * their movement; changable by ruleset option.
- * 
- * "killstack2" means ruleset option to ignore unit killstack effect, and now
- * it's a boolean.
- *
- * "bombard" means units support the bombard ability.
- * 
- * "spec" is configurable specialists
- *
- * "spec2" is semi-configurable specialists in an array
- *
- * "city_map" means the city_map is sent as an array instead of a bitfield.
- *
- * "startunits" means the initial units are stored as a server string var.
- *
- * "turn_last_built" means that turn_last_built is stored as a turn
- * 
- * "happyborders" means that units may not cause unhappiness inside
- * our own borders.
- * 
- * "connid" adds the connection id of whoever sends a message to the 
- * info sent to clients.
- * 
- * "love" means that we show the AI love for you in the client
- * "love2" includes a bugfix
- *
- * "ocean_num" means that the oceans are numbered by negative numbers
- * which are stored in ptile->continent and sent to client.
- * 
- * "govclean" removes corruption|waste_modifier
- *
- * "orders3" provides some additional orders that can be given
- *
- * "rev_fin" means the revolution_finishes value replaces the revolution
- * value.
- *
- * "terr16" is 16-bit terrain values
- */
+#define CAPABILITY "+Freeciv.Devel.2004.Sep.2"
 
 void init_our_capability(void)
 {
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.44
diff -u -r1.44 packets.def
--- common/packets.def  2 Sep 2004 18:36:14 -0000       1.44
+++ common/packets.def  2 Sep 2004 21:42:42 -0000
@@ -545,7 +545,7 @@
   GOLD gold;
   PERCENT tax, science,luxury;
 
-  UINT16 bulbs_last_turn; add-cap(union)
+  UINT16 bulbs_last_turn;
   UINT32 bulbs_researched;
   UINT32 techs_researched;
   UINT8 researching;
@@ -604,8 +604,7 @@
   COORD x,y;
   CITY homecity;
 
-  UINT8 veteran; add-cap(veteran)
-  BOOL veteran_old; remove-cap(veteran)
+  UINT8 veteran;
   BOOL ai, paradropped, connecting, transported, done_moving;
 
   UNIT_TYPE type;
@@ -630,8 +629,7 @@
   COORD x,y;
   UNIT_TYPE type;
 
-  UINT8 veteran; add-cap(veteran)
-  BOOL veteran_old; remove-cap(veteran)
+  UINT8 veteran;
   BOOL occupied, goes_out_of_sight, transported;
 
   UINT8 hp, activity;
@@ -956,11 +954,11 @@
   UINT8 paratroopers_mr_req;
   UINT8 paratroopers_mr_sub;
 
-  STRING veteran_name[MAX_VET_LEVELS][MAX_LEN_NAME]; add-cap(veteran)
-  FLOAT power_fact[MAX_VET_LEVELS]; add-cap(veteran)
-  UINT8 move_bonus[MAX_VET_LEVELS]; add-cap(veteran)
+  STRING veteran_name[MAX_VET_LEVELS][MAX_LEN_NAME];
+  FLOAT power_fact[MAX_VET_LEVELS];
+  UINT8 move_bonus[MAX_VET_LEVELS];
 
-  UINT8 bombard_rate; add-cap(bombard)
+  UINT8 bombard_rate;
 
   STRING helptext[MAX_LEN_PACKET];
 
@@ -972,10 +970,10 @@
   STRING specialist_name[SP_COUNT][MAX_LEN_NAME];
   UINT8 specialist_min_size[SP_COUNT];
   UINT8 specialist_bonus[SP_COUNT];
-  BOOL changable_tax; add-cap(spec)
-  UINT8 forced_science; add-cap(spec)
-  UINT8 forced_luxury; add-cap(spec)
-  UINT8 forced_gold; add-cap(spec)
+  BOOL changable_tax;
+  UINT8 forced_science;
+  UINT8 forced_luxury;
+  UINT8 forced_gold;
   UINT8 min_city_center_food;
   UINT8 min_city_center_shield;
   UINT8 min_city_center_trade;
@@ -994,9 +992,9 @@
 
   BOOL killstack;
 
-  UINT8 trireme_loss_chance[MAX_VET_LEVELS]; add-cap(veteran)
-  UINT8 work_veteran_chance[MAX_VET_LEVELS]; add-cap(veteran)
-  UINT8 veteran_chance[MAX_VET_LEVELS]; add-cap(veteran)
+  UINT8 trireme_loss_chance[MAX_VET_LEVELS];
+  UINT8 work_veteran_chance[MAX_VET_LEVELS];
+  UINT8 veteran_chance[MAX_VET_LEVELS];
 end
 
 PACKET_RULESET_GOVERNMENT_RULER_TITLE=98;sc,lsend
@@ -1244,7 +1242,7 @@
   UINT8 style_count;
   UINT8 borders;
   BOOL happyborders;
-  BOOL slow_invasions; add-cap(slow_invasions)
+  BOOL slow_invasions;
 
   STRING team_name[MAX_NUM_TEAMS][MAX_LEN_NAME];
 end
Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.300
diff -u -r1.300 unittools.c
--- server/unittools.c  26 Aug 2004 18:37:53 -0000      1.300
+++ server/unittools.c  2 Sep 2004 21:42:43 -0000
@@ -1810,7 +1810,6 @@
   packet->y = punit->y;
   packet->homecity = punit->homecity;
   packet->veteran = punit->veteran;
-  packet->veteran_old = (punit->veteran > 0);
   packet->type = punit->type;
   packet->movesleft = punit->moves_left;
   packet->hp = punit->hp;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#9839) cut down capstring, Jason Short <=