Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: [PATCH] Unit movement
Home

[Freeciv-Dev] Re: [PATCH] Unit movement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ccrayne@xxxxxxxxxxx
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [PATCH] Unit movement
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Jan 2001 01:14:50 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxxxx

On Sat, Jan 13, 2001 at 12:17:00PM +0100, Raimar Falke wrote:
> On Fri, Jan 12, 2001 at 06:37:56PM -0800, ccrayne@xxxxxxxxxxx wrote:
> > In <20010113013221.A28912@xxxxxxxxxxxxxxxxxxxxxxx>, on 01/13/01 
> >    at 01:32 AM, Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> said:
> > 
> >:The other introduces a feedback mechanism. Currently there is no easy way
> >:on the client side to get the result of an operation carried out by the
> >:server.
> > 
> > As someone who is actively developing an AI client, I agree that there are
> > areas in which my task would be made easier if there were more feedback.
> > However -- in its current form -- your patch does not help me at all.
> > 
> > The most serious problem is that the client has no way of associating your
> > results packet with any specific event. Even if the client serializes its
> > requests to the server [which should NOT be required], at the time that
> > the client sends a unit move request, there may already be several
> > messages from the server queued for delivery to the client. To be useful,
> > the results packet must at least identify the id of the unit to which the
> > result code applies.
> 
> I also tought about this. I came to the conclusion that implementing a
> generic packet number would be too much changes at one time. This
> number would be mentioned in the result packet. The patch is only the
> first step. The next step would be to add a "receive packets and
> handle them but stop after you receive a packet foobar". So
> send_move_unit() set report_result, send the request, jump to this
> function and if the result packet comes if will be passed to
> send_move_unit() and send_move_unit() will return the result. So
> results wouldn't mixed up since there is only one result packet
> outstanding.
>
> The easiest interface for the code which calls send_move_unit() would
> that the result of the move request is the return code of this
> method. However if you allow more than one outstanding request (with
> report_result set) how do you associate the result packet if the call
> to send_move_unit(). The only answer I can think of are multiple
> threads. Or you can change the interface. This would put the problems
> on the methods which calls send_move_unit().

Attached is a patch which implements the second step mentioned
above. Is there any easier way to do this in C without using multiple
threads?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  What's nice about GUI is that you see what you manipulate.
  What's bad about GUI is that you can only manipulate what you see.

Attachment: waiting_for_result.diff
Description: Text document


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