[Freeciv-Dev] (PR#4631) initialize network data
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
The attached patch initializes all of the packet data for
send_packet_generic_message and send_packet_unit_request calls, except
in the GUI code.
This should be slightly helpful in general debugging.
jason
? rc
? client/gui-gtk/diff
Index: client/civclient.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/civclient.c,v
retrieving revision 1.173
diff -u -r1.173 civclient.c
--- client/civclient.c 2003/07/17 04:43:03 1.173
+++ client/civclient.c 2003/07/21 04:07:02
@@ -527,7 +527,7 @@
gen_packet.message[0] = '\0';
gen_packet.x = gen_packet.y = -1;
-
+ gen_packet.event = E_NOEVENT;
send_packet_generic_message(&aconnection, PACKET_TURN_DONE, &gen_packet);
update_turn_done_button_state();
@@ -601,6 +601,7 @@
struct packet_unit_request req;
req.unit_id = punit->id;
+ req.city_id = -1;
req.name[0] = '\0';
req.x = dest_x;
req.y = dest_y;
Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.105
diff -u -r1.105 control.c
--- client/control.c 2003/07/19 20:56:53 1.105
+++ client/control.c 2003/07/21 04:07:02
@@ -638,6 +638,7 @@
request_unit_wait(punit); /* RP: unfocus the ship */
req.unit_id=punit->id;
+ req.city_id = req.x = req.y = -1;
req.name[0]='\0';
send_packet_unit_request(&aconnection, &req, PACKET_UNIT_UNLOAD);
}
@@ -649,8 +650,10 @@
{
struct packet_unit_request p;
p.unit_id = punit->id;
+ p.city_id = -1;
p.x = pcity->x;
p.y = pcity->y;
+ p.name[0] = '\0';
send_packet_unit_request(&aconnection, &p, PACKET_UNIT_AIRLIFT);
}
@@ -731,6 +734,7 @@
else {
struct packet_unit_request req;
req.unit_id=punit->id;
+ req.city_id = req.x = req.y = -1;
req.name[0]='\0';
send_packet_unit_request(&aconnection, &req, PACKET_UNIT_BUILD_CITY);
return;
@@ -800,6 +804,7 @@
{
struct packet_unit_request req;
req.unit_id=punit->id;
+ req.city_id = req.x = req.y = -1;
req.name[0]='\0';
send_packet_unit_request(&aconnection, &req, PACKET_UNIT_DISBAND);
}
@@ -815,6 +820,7 @@
struct packet_unit_request req;
req.unit_id=punit->id;
req.city_id=pcity->id;
+ req.x = req.y = -1;
req.name[0]='\0';
send_packet_unit_request(&aconnection, &req, PACKET_UNIT_CHANGE_HOMECITY);
}
@@ -831,6 +837,7 @@
struct packet_unit_request req;
req.unit_id=punit->id;
req.city_id=pcity->id;
+ req.x = req.y = -1;
req.name[0]='\0';
send_packet_unit_request(&aconnection, &req, PACKET_UNIT_UPGRADE);
}
@@ -844,6 +851,7 @@
if (can_unit_do_auto(punit)) {
struct packet_unit_request req;
req.unit_id=punit->id;
+ req.x = req.y = -1;
req.name[0]='\0';
send_packet_unit_request(&aconnection, &req, PACKET_UNIT_AUTO);
} else {
@@ -870,6 +878,7 @@
req.unit_id = punit->id;
req.city_id = pcity->id;
+ req.x = req.y = -1;
req.name[0]='\0';
send_packet_unit_request(&aconnection, &req, action);
}
@@ -1383,6 +1392,7 @@
struct packet_unit_request req;
req.unit_id=punit->id;
+ req.city_id = req.x = req.y = -1;
req.name[0]='\0';
send_packet_unit_request(&aconnection, &req, PACKET_UNIT_NUKE);
}
@@ -1395,6 +1405,7 @@
struct packet_unit_request req;
req.unit_id=punit->id;
+ req.city_id = -1;
req.x = x;
req.y = y;
req.name[0]='\0';
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.317
diff -u -r1.317 packhand.c
--- client/packhand.c 2003/07/21 01:43:51 1.317
+++ client/packhand.c 2003/07/21 04:07:02
@@ -2426,6 +2426,7 @@
struct packet_unit_request req;
req.unit_id = packet->id;
+ req.city_id = req.x = req.y = -1;
sz_strlcpy(req.name, packet->name);
send_packet_unit_request(&aconnection, &req, PACKET_UNIT_BUILD_CITY);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#4631) initialize network data,
Jason Short <=
|
|