Jump to content

Dedicated Server Command Line Options Guide


Recommended Posts

  • Developer

-persistent_storage_root

  • Change the directory that your configuration directory resides in. This must be an absolute path. The full path to your files will be <persistent_storage_root>/<conf_dir>/ where <conf_dir> is the value set by -conf_dir. The default for this option depends on the platform:
  • Windows: <Your documents folder>/Klei
    Mac OSX: <Your home folder>/Documents/Klei
    Linux: ~/.klei

-conf_dir

  • Change the name of your configuration directory. This name should not contain any slashes. The full path to your files will be <persistent_storage_root>/<conf_dir> where <persistent_storage_root> is the value set by the -persistent_storage_root option. The default is: "DoNotStarveTogether".

-cluster

  • Set the name of the cluster directory that this server will use. The server will expect to find the cluster.ini file in the following location: <persistent_storage_root>/<conf_dir>/<cluster>/cluster.ini, where <persistent_storage_root> and <conf_dir> are the values set by the -persistent_storage_root and -conf_dir options. The default is "Cluster_1".

-shard

  • Set the name of the shard directory that this server will use. The server will expect to find the server.ini file in the following location:<persistent_storage_root>/<conf_dir>/<cluster>/<shard>/server.ini, where <persistent_storage_root>, <conf_dir>, and <cluster> are the values set by the -persistent_storage_root, -conf_dir, and -cluster options. The default is "Master".

-offline

  • Start the server in offline mode. In offline mode, the server will not be listed publicly, only players on the local network will be able to join, and any steam-related functionality will not work.

-disabledatacollection

  • Disable data collection for the server.
  • We require the collection of user data to provide online services. Servers with disabled data collection will only have access to play in offline mode. For more details on our privacy policy and how we use the data we collect, please see our official privacy policy. https://klei.com/privacy-policy

-bind_ip  <bind_ip>

  • Change the address that the server binds to when listening for player connections. This is an advanced feature that most people will not need to use.

-port <port_number>

  • Valid values: 1..65535
  • The UDP port that this server will listen for connections on. This option overrides the [NETWORK] / server_port setting in server.ini. If you are running a multi-level cluster, this port must be different for each server. This port must be between 10998 and 11018 inclusive in order for players on the same LAN to see it in their server listing. Ports below 1024 are restricted to privileged users on some operating systems.

-players <max_players>

  • Valid values: 1..64
  • Set the maximum number of players that will be allowed to join the game. This option overrides the [GAMEPLAY] / max_players setting in cluster.ini.

-steam_master_server_port <port_number>

  • Valid values: 1..65535
  • Internal port used by steam. This option overrides the [STEAM] / master_server_port setting in server.ini. Make sure that this is different for each server you run on the same machine.

-steam_authentication_port <port_number>

  • Valid values: 1..65535
  • Internal port used by steam. This option overrides the [STEAM] / authentication_port setting in server.ini. Make sure that this is different for each server you run on the same machine.

-backup_logs

  • Create a backup of the previous log files each time the server is run. The backups will be stored in a directory called "backup" in the same directory as server.ini.

-tick <tick_rate>

  • Valid values: 15 .. 60
  • This is the number of times per-second that the server sends updates to clients. Increasing this may improve precision, but will result in more network traffic. This option overrides the [NETWORK] / tick_rate setting in cluster.ini. It is recommended to leave this at the default value of 15. If you do change this option, it is recommended that you do so only for LAN games, and use a number evenly divisible into 60 (15, 20, 30).

Examples:

The recommended way to run a two level server is with the following commands:

dontstarve_dedicated_server_nullrenderer -console -cluster MyClusterName -shard Master
dontstarve_dedicated_server_nullrenderer -console -cluster MyClusterName -shard Caves

These two commands will run two  dedicated servers using the following configuration files: 
 

<Your Klei Folder>/MyClusterName/cluster.ini
<Your Klei Folder>/MyClusterName/Master/server.ini
<Your Klei Folder>/MyClusterName/Caves/server.ini

For the location of <Your Klei Folder>, see the explanation of the -persistent_storage_root and -conf_dir options above. For information on setting up a dedicated server, see one of the following guides:

Dedicated Server Quick Setup Guide: Windows

Dedicated Server Quick Setup Guide: Linux

Dedicated Server Quick Setup Guide: Mac OS X

  • Like 6
  • Sanity 1
Link to comment
Share on other sites

Wow, I like the effort to document all that you are doing. This help a lot! There is a flag that is used in the Linux guide but is not listed here "-monitor_parent_process". Can you add it to the list with a little explanation :)

  • Like 1
Link to comment
Share on other sites

Today I Noticed this waning in the server logs:

[WARNING] -console has been deprecated: Use the [MISC] / console_enabled setting instead.

In my experiments the '-console' command line option does not work any more.

But since the '[MISC]/console_enabled' option has a default value of 'true' the console works any way (with or without the '-console' flag).

  • Like 1
Link to comment
Share on other sites

For those that care about it, id like to add for those who do not know it.

"-only_update_server_mods" -  Updates server mods listed in the dedicated_server_mods_setup.lua file but does not launch a server.

"-skip_update_server_mods" -  Skips mod updates.

I use these in my batch file.

  • Sanity 1
Link to comment
Share on other sites

On 2/24/2016 at 8:07 PM, 255 said:

 

Examples:

The recommended way to run a two level server is with the following commands:


dontstarve_dedicated_server_nullrenderer -console -cluster MyClusterName -shard Master
dontstarve_dedicated_server_nullrenderer -console -cluster MyClusterName -shard Caves

 

In the example above, are the names "master" and "caves" reference to the folder name or the shard name in the ini file?  I ask because I want to set up a server with 4 shards (2 caves, 2 overworlds) and I need to rename existing Caves folder to Caves_1 and create another for Caves_2.  Would I need to change the command above to Caves_1 and add Caves_2, or just make sure that the server name in the ini file matches what's in the command line above?


 

Link to comment
Share on other sites

@justacpa, I gave a sorta-detailed explanation on how to add more shards to a cluster over in my thread. The instructions should help you regardless of how you set up your servers, whether you followed my guide or a different one. Feel free to ask if you need more info.

The -shard parameter does indeed refer to the folder where the shard is located. So if you add a new line to your batch file with -shard Caves_2 for a new shard, you'll need a Caves_2 folder in your cluster folder with the necessary server.ini, leveldataoverride.lua and modoverrides.lua files.

Link to comment
Share on other sites

Is there any way to start up a server in the same terminal as I run these commands, it's quite tricky to keep track of which window it connected to which server when running multiple servers on the same machine, thanks!

 

Link to comment
Share on other sites

When I saw examples of other parameters in other people's scripts, such as - console, - skip_update_server_mods, - registry sing, - monitor_parentProcess, they did not appear in the posts posted by the developers above. So I would like to ask if there have been any changes in these parameters. If so, can we update it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...