Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] Re: (PR#3446) endgame report (fix)
Home

[Freeciv-Dev] Re: (PR#3446) endgame report (fix)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#3446) endgame report (fix)
From: "andrearo@xxxxxxxxxxxx" <andrearo@xxxxxxxxxxxx>
Date: Tue, 23 Sep 2003 09:08:48 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, 23 Sep 2003, Jason Short wrote:
> andrearo@xxxxxxxxxxxx wrote:
> > Here's a small fix to the endgame report:
> > The score-value of spaceship is 100 points per 10,000 citizens,
> > so a 32-bit integer should be sent in the packet.
>
> It needs a new (optional) capability.

Here's the patch, now with optional capability.


 Andreas Røsdal
diff -ruN -Xfreeciv-fixed/diff_ignore freeciv-cvs/common/capstr.c 
freeciv-fixed/common/capstr.c
--- freeciv-cvs/common/capstr.c 2003-09-23 16:53:46.000000000 +0200
+++ freeciv-fixed/common/capstr.c       2003-09-23 17:33:04.000000000 +0200
@@ -80,7 +80,7 @@
                    "+no_nation_selected +diplomacy +no_extra_tiles " \
                    "+diplomacy2 +citizens_style +root_tech auth " \
                    "+nat_ulimit +retake +goto_pack borders dip " \
-                   "+packet_short_unit +unit_occupied"
+                   "+packet_short_unit +unit_occupied endgame_rep"
 
 /* "+1.14.0" is protocol for 1.14.0 release.
  *
@@ -152,6 +152,8 @@
  *
  * "unit_occupied" means units occupying transporters are not sent to enemies.
  * instead an 'occupied' flag is set for the transporter.
+ *
+ * "endgame-rep" is an update of the report at endgame.
  */
 
 void init_our_capability(void)
diff -ruN -Xfreeciv-fixed/diff_ignore freeciv-cvs/common/packets.c 
freeciv-fixed/common/packets.c
--- freeciv-cvs/common/packets.c        2003-09-23 16:53:48.000000000 +0200
+++ freeciv-fixed/common/packets.c      2003-09-23 17:51:38.000000000 +0200
@@ -3330,7 +3330,11 @@
     dio_put_uint32(&dout, packet->landarea[i]);
     dio_put_uint32(&dout, packet->settledarea[i]);
     dio_put_uint16(&dout, packet->literacy[i]);
-    dio_put_uint8(&dout, packet->spaceship[i]);
+    if (has_capability("endgame_rep", pc->capability)) {
+      dio_put_uint32(&dout, packet->spaceship[i]);
+    } else {
+      dio_put_uint8(&dout, packet->spaceship[i]);
+    }
   }
 
   SEND_PACKET_END;
@@ -3361,7 +3365,11 @@
     dio_get_uint32(&din, &packet->landarea[i]);
     dio_get_uint32(&din, &packet->settledarea[i]);
     dio_get_uint16(&din, &packet->literacy[i]);
-    dio_get_uint8(&din, &packet->spaceship[i]);
+    if (has_capability("endgame_rep", pc->capability)) {
+      dio_get_uint32(&din, &packet->spaceship[i]);
+    } else {
+      dio_get_uint8(&din, &packet->spaceship[i]);
+    }
   }
                
   RECEIVE_PACKET_END(packet);

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