[Freeciv-Dev] Re: Dedicated Civserver
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
> Ok, I think the easiest way to do this is the following:
>
> Create a cgi-script that allows people to start new servers at a specific
> port.
or just run
while :; do civserver; done
> Make the server load a standard file which sets "cmdlevel hack", that user
> can then change the cmdlevel again.
The 'ctrl' level was invented for this purpose. Maybe /quit needs to be
added to the 'ctrl' level.
> Then there are 2 options:
>
> 1) Make a little hack that kills the server when there are no-one logged
> on.
That's easy. I have a wrapper script 'impatiently' that starts a command,
then kills it if it doesn't produce any output soon. It could be adapted.
> 2) Make a little perl, sh, or such like script that looks up the
> metaserver and checks whether anyone are connected to the game, and if
> there aren't then kills the server.
Easy, too (a crontab entry parsing netstat output).
It should also kill it if the server
> is not listed on the metaserver (but can connect) as this means the server
> has hung.
OK.
> A nice little bonus feature would be that the cgi-script also could load
> savegames.
This is a must have, I think. One way to implement this without
explicit control is by running
while :; do
ls -t *.sav | if read f; then civserver -f $f; else civserver; fi; done
Several civservers can run on different ports. The ones on which games
have been finished or abandoned can eventually be killed by cron.
--
Reinier
|
|