Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] (PR#712) Unit list not updated
Home

[Freeciv-Dev] (PR#712) Unit list not updated

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: sigra@xxxxxxx
Subject: [Freeciv-Dev] (PR#712) Unit list not updated
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Jul 2003 20:04:57 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[ChrisK@xxxxxxxx - Thu Jul 17 07:56:28 2003]:

> On Wed, Jul 16, 2003 at 04:11:28PM -0700, Jason Short wrote:
> >
> > Did I miss any cases?  When government changes?
> 
> Government change will change the city report (F/S/T)

Ok, here...

However, upon further review I see that when a "thaw" is done (which is
quite often) all dialogs will be updated via update_report_dialogs.

This makes me rethink the whole situation.  The current design is QUITE
POOR, leading to dialogs being unnecessarily updated very often (these
updates are VERY expensive!).  I think we should fix the design by
adding a function queue_units_dialog_update (and the same for other
dialogs); the unqueue can be done when we leave the network code or (if
we're frozen) when we thaw.  And only dialogs whose updates have been
queued should be updated.  These changes should come from within the
core client code; the GUI code should DEFINITELY NOT make checks on the
frozen status [1].

The queue() method has the advantage that it keeps the code structure
simple.  Instead of

  bool update_units_dlg = test_something();

  ...100 lines of code...

  if (update_units_dlg) {
    activeunits_dialog_update();
  }

all we need is

  if (test_something()) {
    queue_units_dialog_update();
  }

  ...100 lines of code...

[1] Consider when there is a huge network lag and the player wants to
refresh the dialog manually.  But he cannot, because the server has
frozen it.

[2] Sorry for the unnecessary caps-lock, but I was quite surprised to
find the poorness of the current system.

jason

Attachment: units_dialog_update-2.diff
Description: units_dialog_update-2.diff


[Prev in Thread] Current Thread [Next in Thread]