Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2002:
[Freeciv-Dev] Re: [PATCH] Improvement effects speedup (PR#1094)
Home

[Freeciv-Dev] Re: [PATCH] Improvement effects speedup (PR#1094)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Vasco Alexandre Da Silva Costa <vasc@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Improvement effects speedup (PR#1094)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Jan 2002 17:33:11 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Jan 15, 2002 at 10:53:27AM +0100, Raimar Falke wrote:
> On Mon, Jan 14, 2002 at 05:54:56PM -0800, Vasco Alexandre Da Silva Costa 
> wrote:
> > On Mon, 14 Jan 2002, Ben Webb wrote:
> > > P.S. I set out to use the START_TURN packet to signal "all deferred 
> > > effect 
> > >      updates should now be performed" for (2) since this seemed to be the 
> > >      purpose of the packet. However, I found I had to add extra handling 
> > >      to handle_game_state() and handle_new_year(), since the START_TURN 
> > >      packet does not seem to get sent under all circumstances (e.g. 
> > >      restarting from a savegame, reconnecting to a running game, etc.) 
> > > Can 
> > >      the START_TURN packet be sent under these circumstances too, or 
> > > would 
> > >      this break agents? If the latter, perhaps we could add a suitable 
> > > "do 
> > >      all updates at start of turn" packet.
> > 
> > Well Raimar is the knowledgeable person in this case. What do you think
> > Raimar?
> 
> Short answer: it is currently a mess.
> 
> Long answer: I had similar problems for the the auto-connect and the
> agents. Either we add a hack to send the START_TURN every time or we
> take a step back and make it the right way. This would include a
> documentation which packet are sent in which order for which type of
> game (complete new game, reconnect, savegame). And than making these
> changes.
> 
> I'm for the latter because it provides a better cost/benefit ratio in
> the long run.

Or another way: the current CMA has also problems in this area.

With the attached patch you can be sure that if you got
client_game_running_state_via_connect that you will get an START_TURN
soon. client_game_running_state_via_reconnect stats for "no START_TURN
till you sent a new year packet first".

So you can do something like:

  if(get_client_state()==CLIENT_GAME_RUNNING_STATE) {
    ...
    free_intro_radar_sprites();
+ if(client_game_running_state_via_reconnect) {
+   do some updating
+ }
  }

This would solve the problem I have with the CMA. Does it solve yours?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "I was dead ... but I'm better now."
    -- Capitain Sheridan in Babylon 5


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