Follow-up Comment #3, bug #20842 (project freeciv): Your helpful answer, and further testing, led me to investigate again the issue which did not actually disappear after my first patch. As you rightfully indicated, the client should not expect the server to accept requests unilaterally, and thus should not update the state of an unit before receiving the server update. There seems to be one exception to that rule (see comments of function `handle_unit_packet_common` in client/packhand.c), but it doesn't concern the issue at hand.
Basically, whenever a group of units is being awaken, the server will send a batch of packets to indicate that change to the client. In certain situations, the client will then put these units in the `client/control.c:urgent_focus_queue` list, so that these units get the player attention. However, when these units are put in sentry mode, they are not removed from that queue. Later, when the client looks for a unit to be put in focus, it will check `urgent_focus_queue` (see the `client/control.c:advance_unit_focus` function). My original patch was not far off it seems, and the new patch I hereby propose simply removes any unit put in sentry mode from the urgent queue. I provide also a minimal map to test the issue on the client before and after the patch. Let me restate the steps to reproduce the bug: - load up the map, - click on the sole unit stack there, - click on the 'ready all' button of the select dialog, - press 'shift-v' to select the whole unit stack, - press 's' to put them all in sentry again The above steps consistently produce the issue on my computer. Also, a small log of the packets exchanged between the client and the server is provided, with light annotations (and a few more debugging messages which I added to my own build) of the packet stream. It shows the packets which made units to be added to the urgent list (see packets '10' to '20', which correspond to the idle activity change notification from the server after pressing 'shift-v'), and the selection of the next focused unit (after packet '29'). (file #18034, file #18035) _______________________________________________________ Additional Item Attachment: File name: 0001-fix-focus-unit-list-when-unit-put-in-sentry.patch.gz Size:0 KB File name: test_case.tgz Size:10 KB _______________________________________________________ Reply to this item at: <http://gna.org/bugs/?20842> _______________________________________________ Message posté via/par Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev