Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] Re: (PR#10695) /observe and game interaction
Home

[Freeciv-Dev] Re: (PR#10695) /observe and game interaction

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: imbaczek@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#10695) /observe and game interaction
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 24 Oct 2004 12:00:39 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10695 >

On Sat, Oct 23, 2004 at 07:32:34AM -0700, Marek \"Baczek\" Baczy????ski wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=10695 >
> 
> When I observe a player, I am able to e.g. click on a sentried unit
> and it loses it's sentry status in the client (at least.) This (and
> other things) should not be possible.

it does only lose it's status in the client. The server is not affected.
Here's a patch which avoids this and a couple of other annoying things I've
found. There are probably more.

o don't popup the new city name dialog.
o don't send city opts packets to the server.
o don't try to remove unit orders (so goto and patrol icons stay)
o don't set unit activity to IDLE (so sentry and fortify etc icons stay)

please test this! vasc founds some bugs, might be more.

-mike

? gamelog
Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.143.2.3
diff -u -r1.143.2.3 control.c
--- client/control.c    23 Oct 2004 19:18:35 -0000      1.143.2.3
+++ client/control.c    24 Oct 2004 18:56:59 -0000
@@ -145,7 +145,6 @@
       request_orders_cleared(punit);
     }
     if (punit->activity != ACTIVITY_IDLE || punit->ai.control)  {
-      punit->activity = ACTIVITY_IDLE;
       punit->ai.control = FALSE;
       refresh_unit_city_dialogs(punit);
       request_new_unit_activity(punit, ACTIVITY_IDLE);
Index: client/goto.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/goto.c,v
retrieving revision 1.74.2.3
diff -u -r1.74.2.3 goto.c
--- client/goto.c       18 Oct 2004 22:40:33 -0000      1.74.2.3
+++ client/goto.c       24 Oct 2004 18:56:59 -0000
@@ -25,6 +25,7 @@
 #include "pf_tools.h"
 #include "unit.h"
 
+#include "civclient.h"
 #include "clinet.h"
 #include "control.h"
 #include "mapview_g.h"
@@ -774,6 +775,10 @@
 {
   struct packet_unit_orders p;
 
+  if (!can_client_issue_orders()) {
+    return;
+  }
+
   /* Clear the orders by sending an empty orders path. */
   freelog(PACKET_LOG_LEVEL, "Clearing orders for unit %d.", punit->id);
   p.unit_id = punit->id;
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.408.2.4
diff -u -r1.408.2.4 packhand.c
--- client/packhand.c   23 Oct 2004 20:02:55 -0000      1.408.2.4
+++ client/packhand.c   24 Oct 2004 18:57:00 -0000
@@ -2658,6 +2658,10 @@
 {
   struct unit *punit = player_find_unit_by_id(game.player_ptr, unit_id);
 
+  if (!can_client_issue_orders()) {
+    return;
+  }
+
   if (punit) {
     if (ask_city_name) {
       popup_newcity_dialog(punit, name);
Index: client/gui-gtk-2.0/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/citydlg.c,v
retrieving revision 1.95.2.2
diff -u -r1.95.2.2 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        23 Oct 2004 21:03:36 -0000      1.95.2.2
+++ client/gui-gtk-2.0/citydlg.c        24 Oct 2004 18:57:00 -0000
@@ -2494,6 +2494,10 @@
 {
   struct city_dialog *pdialog = (struct city_dialog *) data;
 
+  if (!can_client_issue_orders()) {
+    return;
+  }
+
   if(!pdialog->misc.block_signal){
     int i, new_options = 0;
     struct city *pcity = pdialog->pcity;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#10695) /observe and game interaction, Mike Kaufman <=