Author: sveinung
Date: Mon Feb  1 22:57:07 2016
New Revision: 31707

URL: http://svn.gna.org/viewcvs/freeciv?rev=31707&view=rev
Log:
JSON: specify delta vector field address.

This makes the combination of the delta protocol and JSON work again.

Reported by Marko Lindqvist <cazfi>

See bug #24354

Modified:
    trunk/common/generate_packets.py

Modified: trunk/common/generate_packets.py
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/generate_packets.py?rev=31707&r1=31706&r2=31707&view=diff
==============================================================================
--- trunk/common/generate_packets.py    (original)
+++ trunk/common/generate_packets.py    Mon Feb  1 22:57:07 2016
@@ -1120,6 +1120,9 @@
 '''%self.get_dict(vars())
 
         body=body+'''
+  #ifdef FREECIV_JSON_CONNECTION
+  field_addr.name = "fields";
+  #endif /* FREECIV_JSON_CONNECTION */
   DIO_BV_PUT(&dout, \"fields\", &field_addr, fields);
 '''
 
@@ -1161,7 +1164,12 @@
   struct %(packet_name)s *old;
   struct genhash **hash = pc->phs.received + %(type)s;
 '''
-            delta_body1="\n  DIO_BV_GET(&din, \"fields\", &field_addr, 
fields);\n"
+            delta_body1='''
+  #ifdef FREECIV_JSON_CONNECTION
+  field_addr.name = "fields";
+  #endif /* FREECIV_JSON_CONNECTION */
+  DIO_BV_GET(&din, \"fields\", &field_addr, fields);
+  '''
             body1=""
             for field in self.key_fields:
                 body1=body1+prefix("  ",field.get_get())+"\n"


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

Reply via email to