Hi,
I'm trying to adjust NetworkCheckRestartMap() in network_server.cpp to end the server rather than restart the map, so that a simple shell script will run the server with a different configuration file each time. I just need a way to end the server nicely - exit(0) works, but doesn't shut down the server properly, and would leave an advertisement on the list server.
Thanks,
--James.
Endgame code
Moderator: OpenTTD Developers
Re: Endgame code
See http://hg.openttd.org/openttd/trunk.hg/ ... .cpp#l1319. That's the code that handles the console command "exit". In short, just set _exit_game = true;
Re: Endgame code
Thanks, will post back when I've written the new function
Re: Endgame code
Just wrote the new function, but I had to #include openttd.h to get _exit_game. Also added a warning a year before the game ends.
Thanks,
--James.
Thanks,
--James.
Re: Endgame code
How does OpenTTD determine when the game (will) end?JamesG wrote:Also added a warning a year before the game ends.
Re: Endgame code
The setting network.restart_game_yearpetert wrote:How does OpenTTD determine when the game (will) end?JamesG wrote:Also added a warning a year before the game ends.
Re: Endgame code
No; I created a new setting network.end_game_year, so the game will still restart if the restart year is the same or earlier.
Who is online
Users browsing this forum: No registered users and 2 guests