Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: (PR#2273) Server restart patch v3
Home

[Freeciv-Dev] Re: (PR#2273) Server restart patch v3

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2273) Server restart patch v3
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Tue, 12 Nov 2002 12:47:20 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Per I. Mathisen via RT wrote:
> On Tue, 12 Nov 2002, Jason Short via RT wrote:
> 
>>One thing I'm not entirely happy with conceptually is that autogames
>>(game.timeout==-1) will exit immediately after the game.
> 
> 
> This is how autogames work currently, and some things depend on it, or at
> least some of my scripts do... they need the ability to run multiple
> autogames from an sh script supplied with slightly varied options each
> time. The pitfighting script for instance dynamically rewrites the .serv
> script handed to the server for each iteration.
> 
> So please don't change this. At least don't mix such an idea into the
> current patch :-)

I'd like to change it with a later patch, so that server looping is a 
game option.

>>It seems like read_init_script should be called from within the loop.
> 
> 
> I am not sure. That means the next game would be the same as the previous
> (eg if first game is civ2, next would be civ2 as well unless explicitly
> changed). Maybe that is a good idea, at least for civserver. But the
> problem with it is that it may not be expected by the user and may come as
> a nasty surprise when starting the game, and there is no easy way to reset
> the options back to default again (eg there is no "default.serv" to load
> to get default options).

I think it is quite reasonable.  If you say "civserver -r rc" you should 
not be surprised when that rc file gives your game special settings.

>>Finally, it bothers me that game_init() is called at the end of the loop
>>instead of the beginning. IMO it would be cleaner to call this just
>>once, at the beginning of the loop. But I'm not sure if this would be
>>correct - currently the game data is initialized before the network and
>>other once-only initializations.
> 
> 
> That would require also putting loading scripts and loading savegames from
> command-line into the loop. The latter I am against - if you specify a
> savegame on command-line you usually do not want it repeated and certainly
> won't expect it to be. (If it is part of a scenario, it will use the
> "load" command from a script.)

Yes, I agree.

>>I changed the code around slightly so that autogames could be run
>>repeatedly. Then I did this.  After about 5 minutes (with 20 second
>>games) it crashed. I don't know if this is related to the patch (or my
>>changes) at all, though.
> 
> ...
> 
>>#20x080b28da in ai_data_turn_done (pplayer=0x401877c0) at aidata.c:193
> 
> ...
> 
>>#70x0804d7d6 in end_turn ()
>>#80x080501c6 in main_loop ()
>>#90x080509a1 in srv_loop ()
> 
> 
> No idea from me either.

Well, I ran the test twice more, and all three times it evenually 
crashed on the exact same line.  It is most likely that this happens 
because something is not reset when the game data is reset.

jason




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