The International Simutrans Forum

 

Author Topic: Expose pause_server_no_clients as a CLI argument  (Read 486 times)

0 Members and 1 Guest are viewing this topic.

Offline Michael 'Cruzer'

  • Devotee
  • *
  • Posts: 206
  • Founder of pak192.comic
    • Marktplatz für Parkplätze
  • Languages: DE, EN
Expose pause_server_no_clients as a CLI argument
« on: June 13, 2020, 11:02:34 AM »
Given that many of the server related options such as server name, server announcement or dns can currently be configured either as CLI parameter or as config value in the simuconf.tab, would it also be possible to expose the pause_server_no_clients option as CLI parameter too? Maybe as a new -server_pause_no_client CLI flag (that naming would be inconsistent with the simuconf.tab, but would be consistent with the other CLI options). Currently this option is only configurable over the simuconf.tab as far as I'm aware of it.

I don't think it should be too hard to implement: pause_server_no_clients seems to be a simple flag on the env_t singleton. Similar code to which already sets the env_t::announce flag in the simmain.c could also set the pause_server_no_clients flag. Thought, I amn't sure yet when/where the loading of the simuconf.tab values happens and how to ensure that these values don't override the CLI parameters.
« Last Edit: June 13, 2020, 11:57:35 AM by Michael 'Cruzer' »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10682
  • Languages: De,EN,JP
Re: Expose pause_server_no_clients as a CLI argument
« Reply #1 on: June 13, 2020, 11:58:50 AM »
Since the -pause flag is ignored for a server anyway, "-pause" on the command line will start a server wihich pauses without clients for r9131. The change is rather trivial and could be backported to the stable as well.

Offline Michael 'Cruzer'

  • Devotee
  • *
  • Posts: 206
  • Founder of pak192.comic
    • Marktplatz für Parkplätze
  • Languages: DE, EN
Re: Expose pause_server_no_clients as a CLI argument
« Reply #2 on: June 13, 2020, 12:35:01 PM »
Thanks! Yes, extracting commit 9131 as patch and applying it on the latest stable 121.0/r8870 seems to work without any issues.

Offline Vladki

  • Devotee
  • *
  • Posts: 3725
    • My addons, mostly roadsigns, pak128.cs
  • Languages: EN, CS