Author: cazfi
Date: Wed Feb 25 19:47:46 2015
New Revision: 28309

URL: http://svn.gna.org/viewcvs/freeciv?rev=28309&view=rev
Log:
Also send packet type using key "pid" in json protocol.

See patch #5850

Modified:
    trunk/common/packets_json.c

Modified: trunk/common/packets_json.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/packets_json.c?rev=28309&r1=28308&r2=28309&view=diff
==============================================================================
--- trunk/common/packets_json.c (original)
+++ trunk/common/packets_json.c Wed Feb 25 19:47:46 2015
@@ -201,6 +201,8 @@
 #endif
   void *data;
   void *(*receive_handler)(struct connection *);
+  json_error_t error;
+  json_t *pint;
 
   if (!pc->used) {
     return NULL;               /* connection was closed, stop reading */
@@ -323,7 +325,6 @@
   }
 
   /* Parse JSON packet. */
-  json_error_t error;
 
   pc->json_packet = json_loadb((char*)pc->buffer->data + 4, whole_packet_len, 
0, &error);
 
@@ -335,7 +336,7 @@
     return NULL;
   }
 
-  json_t *pint = json_object_get(pc->json_packet, "type");
+  pint = json_object_get(pc->json_packet, "pid");
 
   if (!pint) {
     log_error("ERROR: Unable to get packet type.");


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

Reply via email to