The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Ashley on January 02, 2011, 12:33:15 AM

Title: Network suggestion - Automatic savegame naming
Post by: Ashley on January 02, 2011, 12:33:15 AM
Currently in network mode (e.g. running Simutrans as a server) the game is automatically saved to a file called "server-network.sve" in the main Simutrans folder. This means that you can't run more than one server instance from the same set of files, which is kind of annoying if you want to run multiple server maps (e.g. one for pak64, one for pak128) without duplicating all the files. Would it be possible to either:

a) allow the location of this file to be specified on the command line, e.g. -savefile
b) Prepend the name of the base savefile from the -load command to the name of the network autosave file, e.g. if you use the -load flag with a file called "network1.sve" the autosave will be called "network1-server-network.sve"

I'd swing more in favour of the slightly more automatic option b, since in cases where the game isn't already saved you can use the behaviour as it is now.
Title: Re: Network suggestion - Automatic savegame naming
Post by: jonasbb on January 02, 2011, 12:38:55 AM
You can run at least two servers.

You have to start one normal and the other with -singleuser

Then they use different save files and locations.
Maybe you can run with this method as many servers as you can, if you start all with -singleuser because all should save the file in their exe folder.
Title: Re: Network suggestion - Automatic savegame naming
Post by: Ashley on January 02, 2011, 12:48:26 AM
That's what I'm doing at the moment, but it requires having multiple copies of the game in order to run multiple servers, which is a bit of a headache for maintenance (not to mention being quite untidy).
Title: Re: Network suggestion - Automatic savegame naming
Post by: prissi on January 02, 2011, 08:24:01 PM
Imho, using the port number (which must be unique) seems most sensible. This would also work with automatic recovering after crashes, as the port number will staty the same.
Title: Re: Network suggestion - Automatic savegame naming
Post by: Ashley on January 11, 2011, 09:50:44 PM
I just noticed that this has been implemented, very useful change and will simplify server maintenance a lot, thanks Prissi :)