Simutrans Chat Room
Where cool people of Simutrans can meet up.

-pause flag with -server

Started by Mariculous, April 16, 2020, 12:28:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I was about to start a paused server to prepare a new map. using the commandline
./simutrans-extended -server -objects Pak128.Britain-Ex/ -server_admin_pw "that's not the pw ;)" -load Vienna-Krakow-Budapest.sve -pause
It seems the -pause flag is simply ignored.

ceeac line 1440 (this is for Standard, but Extended is unchanged):

if(  !env_t::networkmode  &&  !env_t::server  ) {
welt->set_pause( pause_after_load );
pause_after_load = false;

It seems that it is disabled on purpose. For clients connecting to a server this is reasonable to prevent immediate desyncs, but I cannot think of a reason on the spot to disable pause on load for servers, too.


The server cannot "pause" but without clients it will immediately autopause. That is set with, not the commandline. Because the GUI pause mode is different from the network pause mode. (For the same reason networking clients cannot pause.)


I am aware of the pause_server_no_clients setting but that's not what I want to achieve here as it will only pause the game when nobody is connected.
Without being connected to the server one obviously cannot modify the map, so we can't prepare Vienna-Budapest-Krakow map as a team.

I see the point in not allowing pause/unpause being triggered by players in network mode but why can't the server stay paused after a player has connected when started with -pause?
Optimally, nettool or any connected player with access to the public player should be able to pause/unpause the server but that might be technically more difficult.


As prissi stated, the server cannot pause. There is no provision in the networking code to allow commands to be processed without time progressing. When a client performs an action, it sends a request to the server. The server marks a time in the future to execute the action, and broadcasts that to all connected clients. Once that time is reached, all clients (and the server) actually perform the action. Without time passing, the future action time will not be reached. Such a feature could be added, but there's really been no call for it...

For jointly preparing a map, you could set the map's starting year before the intended actual start year; And/Or set a high bits_per_month and just let time progress while preparing. Loading the game in singleplayer mode you can then run/fastforward/skip time until the desired start.