Author: cazfi
Date: Wed Apr 27 21:00:04 2016
New Revision: 32506

URL: http://svn.gna.org/viewcvs/freeciv?rev=32506&view=rev
Log:
Changed network protocol so that only those policies slots that are in use in 
current ruleset are
being sent as part of player info packet.

See bug #24611

Modified:
    branches/S2_6/client/packhand.c
    branches/S2_6/common/packets.def
    branches/S2_6/fc_version
    branches/S2_6/server/plrhand.c

Modified: branches/S2_6/client/packhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/packhand.c?rev=32506&r1=32505&r2=32506&view=diff
==============================================================================
--- branches/S2_6/client/packhand.c     (original)
+++ branches/S2_6/client/packhand.c     Wed Apr 27 21:00:04 2016
@@ -1,4 +1,4 @@
-/********************************************************************** 
+/***********************************************************************
  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -2271,6 +2271,8 @@
   pplayer->revolution_finishes = pinfo->revolution_finishes;
   pplayer->ai_common.skill_level = pinfo->ai_skill_level;
 
+  fc_assert(pinfo->multip_count == multiplier_count());
+  game.control.num_multipliers = pinfo->multip_count;
   multipliers_iterate(pmul) {
     pplayer->multipliers[multiplier_index(pmul)] =
         pinfo->multiplier[multiplier_index(pmul)];

Modified: branches/S2_6/common/packets.def
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/packets.def?rev=32506&r1=32505&r2=32506&view=diff
==============================================================================
--- branches/S2_6/common/packets.def    (original)
+++ branches/S2_6/common/packets.def    Wed Apr 27 21:00:04 2016
@@ -828,8 +828,9 @@
 
   CITYSPE wonders[B_LAST]; diff
 
-  SINT32 multiplier[MAX_NUM_MULTIPLIERS];
-  SINT32 multiplier_target[MAX_NUM_MULTIPLIERS];
+  UINT8  multip_count;
+  SINT32 multiplier[MAX_NUM_MULTIPLIERS:multip_count];
+  SINT32 multiplier_target[MAX_NUM_MULTIPLIERS:multip_count];
 end
 
 PACKET_PLAYER_PHASE_DONE = 52; cs, dsend

Modified: branches/S2_6/fc_version
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/fc_version?rev=32506&r1=32505&r2=32506&view=diff
==============================================================================
--- branches/S2_6/fc_version    (original)
+++ branches/S2_6/fc_version    Wed Apr 27 21:00:04 2016
@@ -55,7 +55,7 @@
 #   - Avoid adding a new mandatory capability to the development branch for
 #     as long as possible.  We want to maintain network compatibility with
 #     the stable branch for as long as possible.
-NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-2.6-2016.Apr.21"
+NETWORK_CAPSTRING_MANDATORY="+Freeciv.Devel-2.6-2016.Apr.27"
 NETWORK_CAPSTRING_OPTIONAL=""
 
 FREECIV_DISTRIBUTOR=""

Modified: branches/S2_6/server/plrhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/plrhand.c?rev=32506&r1=32505&r2=32506&view=diff
==============================================================================
--- branches/S2_6/server/plrhand.c      (original)
+++ branches/S2_6/server/plrhand.c      Wed Apr 27 21:00:04 2016
@@ -1094,6 +1094,7 @@
   }
 
   /* multipliers */
+  packet->multip_count = multiplier_count();
   if (info_level >= INFO_FULL) {
     multipliers_iterate(pmul) {
       packet->multiplier[multiplier_index(pmul)] =


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to