Patch: dedicated servers, reload config file

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Patch: dedicated servers, reload config file

Post by dihedral »

quite often did i want to not have to restart the dedicated server, but still have a different diff level or something of that sort...

here is a patch that adds a network setting
nextgame_reload_cfg which defaults to false

if set to true, next time you issue a newgame command, or the game just reaches it's restart_game_year
the game quits, reloads the config file (all settings, even newgrf, passwords, map size, landscape, difficulty - simply anything) and starts the new game

this way - clients that were playing when newgame was issued or restart_game_year was reached, will rejoin automatically once the server is ready to - just like they did before, but this time the game has some different options set.

as i have write protected my config file so that openttd cannot write to it, and have a web interface to make the desired changes (or for any other admin to make them) i, from now on, will not have to myself restart the game for these changes to take effect.

there are 2 patch files, one for 0.5 games

comments, feedback, opinions and hints are appreciated
Attachments
0.5.3_network_nextgame_reload_cfg_v2.patch
patch against 0.5.3 - was missing one line of code
(2.58 KiB) Downloaded 105 times
r11208_network_nextgame_reload_cfg_v2.patch
patch against svn r11216 - was missing one line of code
(2.85 KiB) Downloaded 100 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 23 guests