Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#8584) remove dio_[put|get]_city_map
Home

[Freeciv-Dev] Re: (PR#8584) remove dio_[put|get]_city_map

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8584) remove dio_[put|get]_city_map
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Sun, 25 Apr 2004 11:15:32 -0700
Reply-to: rt@xxxxxxxxxxx

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

On Sat, Apr 24, 2004 at 04:15:48PM -0700, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8584 >
> 
> Jason Short wrote:
> > This patch removes dio_put_citY_map and dio_get_city_map, along with the 
> > hard-coding of the city map indices in dataio.c.
> 
> Same patch, with the client and server parts.

Index: common/dataio.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/dataio.h,v
retrieving revision 1.5
diff -u -r1.5 dataio.h
--- common/dataio.h     10 Apr 2004 03:47:49 -0000      1.5
+++ common/dataio.h     24 Apr 2004 23:14:25 -0000
@@ -68,7 +68,6 @@
 void dio_get_string(struct data_in *din, char *dest, size_t max_dest_size);
 void dio_get_bit_string(struct data_in *din, char *dest,
                        size_t max_dest_size);
-void dio_get_city_map(struct data_in *din, char *dest, size_t max_dest_size);
 void dio_get_tech_list(struct data_in *din, int *dest);
 void dio_get_worklist(struct data_in *din, struct worklist *pwl);
 void dio_get_diplstate(struct data_in *din, struct player_diplstate *pds);

You forgot *_put_*.

Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.21
diff -u -r1.21 packets.def
--- common/packets.def  24 Apr 2004 17:32:47 -0000      1.21
+++ common/packets.def  24 Apr 2004 23:14:25 -0000
@@ -151,7 +151,6 @@
 type MEMORY            = memory(unsigned char)
 type STRING            = string(char)
 type BIT_STRING                = bit_string(char)
-type CITY_MAP          = city_map(char)
 type WORKLIST          = worklist(struct worklist)
 type TECH_LIST         = tech_list(int)
 type EFFECT            = effect(struct impr_effect)
@@ -169,6 +168,7 @@
 type RIVER_MOVE                = uint8(enum special_river_move)
 type REPORT_TYPE       = uint8(enum report_type)
 type AUTH_TYPE         = uint8(enum authentication_type)
+type CITY_MAP          = uint8(enum city_tile_type)
 type IMPR_RANGE                = uint8(enum impr_range)
 type DIRECTION         = uint8(enum direction8)
 type ORDERS            = uint8(enum unit_orders)
@@ -408,7 +408,7 @@
   WORKLIST worklist;
 
   BIT_STRING improvements[B_LAST+1];
-  CITY_MAP city_map[CITY_MAP_SIZE*CITY_MAP_SIZE+1];
+  CITY_MAP city_map[CITY_MAP_SIZE * CITY_MAP_SIZE];

You can do better here. Send the number of elements of the array. From
this the client can decide what the citymap positions are. I.e. you do
the old solution with an extra level of indirection.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "These download files are in Microsoft Word 6.0 format. After
  unzipping, these files can be viewed in any text editor, including
  all versions of Microsoft Word, WordPad, and Microsoft Word Viewer."
    -- http://www.microsoft.com/hwdev/pc99.htm




[Prev in Thread] Current Thread [Next in Thread]