Actions

Difference between revisions of "Dedicated Server Guide"

From Unofficial Stationeers Wiki

m (Made a note that the VC++ 2015 runtime is needed if running on Windows (useful to know for those who have a fresh Windows VM set up as a dedicated server))
(Dedicated Server Setup after network rework)
Line 23: Line 23:
  
 
== Default ports ==
 
== Default ports ==
27500: Game port (UDP) and RCON port (TCP), set with <code>-gameport</code>.<br>
+
27516: Game port (UDP).<br>
27015: Steam update port (UDP), used for Steam to find your server, set with <code>-updateport</code>.
+
27015: Steam update port (UDP).
  
== Dedicated Server Commands ==
+
== Legacy Server Startup Arguments ==
 
String parameters can take space with double quotes.
 
String parameters can take space with double quotes.
 
{| class="wikitable"
 
{| class="wikitable"
Line 32: Line 32:
 
! parameter !! value !! etc
 
! parameter !! value !! etc
 
|-
 
|-
| -batchmode|| || Dedicated server runs without UI and start to listen port.
+
| -NEW
 +
| rowspan=2 | Worldname (string)
 +
| rowspan=2 | Starts a new game at specific world automatically from launch. Must provide world name as argument
 
|-
 
|-
| -nographics|| || When running in batch mode, do not initialize graphics device at all.
+
| -NEWGAME
 
|-
 
|-
| -logfile|| "path" || If no output_log.txt use this parameter. Check examples below for syntax
+
| -LOAD
|-
+
| rowspan=2 | savefolder (string)
| -autostart|| || Dedicated server start to listen port without player input.<br> It's always enabled on Linux dedicated server
+
| rowspan=2 | Loads a saved world file
|-
 
| -autosaveinterval|| integer || Save world in every interval.
 
|-
 
| -creator|| int64|| Set creator's steam id as gamedata and key-value.<br>
 
This is for future integration of server instancing.
 
 
|-
 
|-
| -worldname || string || Save game data automatically to existing file.
+
| -LOADGAME
 
|-
 
|-
| -worldtype || string  || Worldtype(Moon, Mars, Europa2, Mimas, Vulcan2, Space, Loulan)<br><u>Will overwrite actual map on server browser if you use rocket to travel beween maps etc</u>
+
| -JOIN
 +
| rowspan=2 | [address]:[port]
 +
| rowspan=2 | Joins a client to the server
 
|-
 
|-
| -loadworld
+
| -JOINGAME
| string  || Load world from saved file. If loadworld is enabled, worldname command is ignored.
 
 
|-
 
|-
| -gameport  || integer  || UDP port for game. Avoid to set 27015-27020. It's steam's local server query ports.
+
| -SETTINGSPATH
|-
+
| "path"
| -updateport
 
| integer
 
| UDP port for steam query
 
|-
 
| -servername
 
| string
 
| Server title. <br>''(Depreciated: commandline only uses the first word, use servername in default.ini instead)''
 
|-
 
| -basedirectory
 
| string
 
 
| Absolute base directory for custom profile Ex)<br> -basedirectory C:\Profile\Player1 <br> Config Path : default.ini <code>C:\Profile\Player1\</code> <br> Save Path : <code>C:\Profile\Player1\saves\[worldname]</code>
 
| Absolute base directory for custom profile Ex)<br> -basedirectory C:\Profile\Player1 <br> Config Path : default.ini <code>C:\Profile\Player1\</code> <br> Save Path : <code>C:\Profile\Player1\saves\[worldname]</code>
 
|-
 
|-
| -password
+
| -logfile|| "path" || If no output_log.txt use this parameter. Check examples below for syntax
| string
 
| set server password
 
|-
 
| -maxplayer
 
| integer
 
| set maxplayer of dedicated server
 
|-
 
| -clearallinterval
 
| integer
 
| set the interval to run clearall command.<br>Default and minimum value is 60 seconds.<br>clearall will delete all disconnected characters, even if they are in a sleeper. It is recommended you set this to a very high number, or 0 to disable completely.
 
|-
 
| -bindip
 
| string
 
| Bind specific IP address on dedicated server when it has multiple IP addresses.
 
 
|-
 
|-
| -modpath
 
| string
 
| Absolute base directory for mods (be sure to use \ or / depending on system and end with one as well)
 
 
|}
 
|}
 
batchmode, nographics and logfile are Unity3D commands.
 
batchmode, nographics and logfile are Unity3D commands.
Line 92: Line 63:
 
== Examples ==
 
== Examples ==
  
<span style="font-size: 120%;"> Dedicated server starts new Mars world. Autosave every 5 mins to Mars1. </span><br>
+
<span style="font-size: 120%;"> Dedicated server starts new Mars world. </span><br>
<code>rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -worldtype=Mars -worldname=Mars1 -basedirectory="C:\Server\User1"</code>
+
<code>rocketstation_DedicatedServer.exe -NEW=Mars -SETTINGSPATH="C:\Server\User1"</code>
  
  
<span style="font-size: 120%;"> Load Mothership file. Autosave every 5 mins. </span><br>
+
<span style="font-size: 120%;"> Load Mothership file.<br>
<code>rocketstation_DedicatedServer.exe -batchmode -nographics -autostart  -gameport=27500 -updateport=27015 -autosaveinterval=300 -loadworld=Mothership</code>
+
<code>rocketstation_DedicatedServer.exe -LOAD=Mothership</code>
  
  
<span style="font-size: 120%;"> Load . Autosave  every 5 mins. C:\Profile\Player1\saves\Mothership C:\Profile\Player1\saves\map1 </span><br>
+
<span style="font-size: 120%;"> Load Mothership file. C:\Profile\Player1\saves\Mothership C:\Profile\Player1\saves\map1 </span><br>
<code>rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -gameport=27500 -updateport=27015 -loadworld=Mothership -worldname=map1 -basedirectory="C:\Profile\Player1"</code>
+
<code>rocketstation_DedicatedServer.exe -LOAD=Mothership -SETTINGSPATH="C:\Profile\Player1"</code>
  
  
Line 108: Line 79:
  
  
<span style="font-size: 120%;"> Example <code>-loadworld="myworld"</code> directory structure. </span><br>
+
<span style="font-size: 120%;"> Example <code>-LOAD="myworld"</code> directory structure. </span><br>
 
'''Note:''' ''BaseDirectory'' is by default in SteamApps/common/Stationeers Dedicated Server/''<Contents of BaseDirectory>'' if installed with SteamCMD<br>
 
'''Note:''' ''BaseDirectory'' is by default in SteamApps/common/Stationeers Dedicated Server/''<Contents of BaseDirectory>'' if installed with SteamCMD<br>
  
  
 
<big>'''Linux:'''</big><br>
 
<big>'''Linux:'''</big><br>
<code>-loadworld="myworld"</code> will look for a folder named "myworld" in the ''saves'' directory like this:<br>
+
<code>-LOAD="myworld"</code> will look for a folder named "myworld" in the ''saves'' directory like this:<br>
 
''BaseDirectory''/saves/myworld/<br>
 
''BaseDirectory''/saves/myworld/<br>
  
  
 
<big>'''Windows:'''</big><br>
 
<big>'''Windows:'''</big><br>
<code>-loadworld="myworld"</code> will look for a folder named "myworld" in the ''saves'' directory like this:<br>
+
<code>-LOAD="myworld"</code> will look for a folder named "myworld" in the ''saves'' directory like this:<br>
 
''BaseDirectory''\saves\myworld\
 
''BaseDirectory''\saves\myworld\
  
  
 
<big>'''Details:'''</big><br>
 
<big>'''Details:'''</big><br>
In the world directory named "myworld", there must be a few files:
+
In the world directory named "myworld", these files must be present:
 
* world.bin
 
* world.bin
 
* world.xml
 
* world.xml
Line 132: Line 103:
 
* worldsettings.xml
 
* worldsettings.xml
  
===== Configuration from default.ini =====
+
===== Configuration from setting.xml =====
default.ini will be created once you start it up for the first time. <u>Command parameters override default.ini</u>
+
setting.xml will be created once you start it up for the first time. <u>Command parameters override setting.xml</u>
<hr><pre>
+
<hr>''The server is mostly a stripped down client as such it inherits certain features''
[SERVER]
+
<hr>
SERVERNAME=My First Stationeers Server
+
Example Setting.xml
GAMEPORT=27500
+
<pre>
UPDATERPORT=27015
+
  <?xml version="1.0" encoding="utf-8"?>
PASSWORD=
+
  <SettingData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
ADMINPASSWORD=
+
 
MAPNAME=Moon
+
  <AutoSave>true</AutoSave>
DESCRIPTION=Stationeers
+
  <SaveInterval>300</SaveInterval>
MAXPLAYER=10
+
  <SavePath />
[RCON]
+
 
RCONPASSWORD=stationeers
+
  <StartingConditions>Default</StartingConditions>
</pre><hr>
+
  <RespawnCondition>Easy</RespawnCondition>
''MAPNAME is always ignored''
+
  <HungerRate>0.5</HungerRate>
 +
  <SunOrbitPeriod>1</SunOrbitPeriod>
 +
 
 +
  <ResearchPoolKey>ResearchOff</ResearchPoolKey>
  
== Configuration from setting.xml ==
+
  <RoomControlTickSpeed>1</RoomControlTickSpeed>
'''Undocumented feature'''
+
  <WorldOrigin>false</WorldOrigin>
  
Note: as of version 0.2.2840, setting the starting conditions on a dedicated server will allways Default to the first key found in startingconditions.xml. Could probably be a bug.
+
<ServerName>Stationeers</ServerName>
 +
  <StartLocalHost>true</StartLocalHost>
 +
  <ServerVisible>true</ServerVisible>
 +
  <ServerPassword />
 +
  <AdminPassword>randomstringhere</AdminPassword>
 +
  <ServerMaxPlayers>10</ServerMaxPlayers>
 +
  <UpdatePort>27015</UpdatePort>
 +
  <GamePort>27016</GamePort>
 +
  <UPNPEnabled>true</UPNPEnabled>
 +
  <DisconnectTimeout>10000</DisconnectTimeout>
 +
  <NetworkDebugFrequency>500</NetworkDebugFrequency>
 +
</pre><hr>
  
''The server is mostly a stripped down client as such it inherits certain features''
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 204: Line 188:
 
|-
 
|-
 
|}
 
|}
 
Example Setting.xml
 
<pre>
 
<?xml version="1.0" encoding="utf-8"?>
 
<SettingData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
<RespawnCondition>Stationeer</RespawnCondition>
 
<StartingConditions>Mimimal</StartingConditions>
 
<ResearchPoolKey>ResearchOff</ResearchPoolKey>
 
<SunOrbitPeriod>1</SunOrbitPeriod>
 
</SettingData>
 
</pre>
 
 
  
 
== Savegames ==
 
== Savegames ==
Line 263: Line 235:
  
 
===In Game Admin===
 
===In Game Admin===
ADMINPASSWORD parameter must be added to default.ini and set a password. This is different from the RCON password.
+
ADMINPASSWORD parameter must be added to setting.xml and set a password.
  
 
All commands are typed in the chat (enter) by default, starting with /login
 
All commands are typed in the chat (enter) by default, starting with /login
  
 
+
=== Server Program Console===
 
+
You can type commands in the running application which acts like a console
===Browser Based RCON===
 
You can send commands on web browser, but this feature is currently broken. Login works, but all other commands are disabled.
 
<nowiki>Link : http://[dedicated server address]:[GamePort]</nowiki>
 
[[File:Dediserv1.png|frameless|735x735px]]
 
  
 
=== Command Lists ===
 
=== Command Lists ===
 
{| class="wikitable"
 
{| class="wikitable"
 
!Command
 
!Command
 +
!Details
 
!Parameter
 
!Parameter
!Details
 
 
|-
 
|-
|login
+
| HELP
|password
+
| Displays helpful stuff
|RCONPASSWORD is defined in default.ini. Default rcon password is stationeers.
+
| Arguments:
 +
* commands
 +
* list (l)
 +
* <key>
 +
* tofile: prints the help output to file
 +
|-
 +
| CLEAR
 +
| Clears all console text ||
 +
|-
 +
| QUIT
 +
| immediately quits the game without any prompts
 +
|
 +
|-
 +
| EXIT
 +
| rowspan=2 | Leaves a game session and goes back to 'StartMenu'
 +
| rowspan=2 |
 +
|-
 +
| LEAVE
 +
|-
 +
| NEW
 +
| rowspan=2 | Starts a new game at specific world automatically from launch.Must provide world name as argument
 +
| rowspan=2 | worldName
 +
|-
 +
| NEWGAME
 +
|-
 +
| LOAD
 +
| rowspan=2 | Loads a saved world file
 +
| rowspan=2 | <foldername>
 +
|-
 +
| LOADGAME
 +
|-
 +
| JOIN
 +
| rowspan=2 | Joins a client to the server
 +
| rowspan=2 | [address]:[port]
 +
|-
 +
| JOINGAME
 +
|-
 +
| STEAM
 +
| Commands to test Facepunch API. Just checks if steam is initialised and if DLC is purchased
 +
|
 +
|-
 +
| LISTNETWORKDEVICES
 +
| No help text :(
 +
| id
 +
|-
 +
| TESTBYTEARRAY
 +
| Tests every item in world to check its network read/write functions are parallel. Only enabled in Editor.
 +
Supply a reference Id to check ONLY that item
 +
|
 +
|-
 +
| ROCKETBINARY
 +
| Starts logging the size of each section of a delta update.
 +
| Arguments:
 +
* toggleloglength
 +
* togglelogbps
 +
|-
 +
| IMGUI
 +
| No help text :(
 +
|
 +
|-
 +
| ATMOS
 +
| Enables atmosphere debugging
 +
| Arguments:
 +
* pipe
 +
* world
 +
* room
 +
* global
 +
* thing
 +
|-
 +
| THING
 +
| Thing related commands
 +
| Arguments:
 +
* No args returns total thing count
 +
* find
 +
* delete
 +
* spawn
 +
|-
 +
| KEYBINDINGS
 +
| Displays all the keybindings bound to LocalHuman
 +
| Arguments:
 +
* reset (Resets the keybindings stack. Can help solve input issues)
 +
|-
 +
| RESET
 +
| Restarts the application
 +
|
 +
|-
 +
| VERSION
 +
| Returns the game version
 +
|
 +
|-
 +
| LOGTOCLIPBOARD
 +
| Copies the content of the console buffer to the system clipboard buffer
 +
|
 +
|-
 +
| KICK
 +
| Kick clients from server commands
 +
| clientId - disconnects the client from the game
 +
|-
 +
| BAN
 +
| Bans a client from the server (server only command)
 +
| clientId
 +
|-
 +
| UPNP
 +
| returns universal plug and play (upnp) state
 +
|
 +
|-
 +
| NETWORK
 +
| returns the current network status
 +
|
 
|-
 
|-
|save
 
|worldname
 
|Save world to basedirectory
 
  
When basedirectory is "C:\Profile\Player1",
+
| PAUSE
 
+
| will pause/unpause the game (including for clients)
>> save "Moon 2"
+
| Arguments:
 
+
* true
Save world to "C:\Profile\Player1\Moon 2"
+
* false
 
 
>> save Moon
 
 
 
Save world to "C:\Profile\Player1\Moon"
 
 
|-
 
|-
|shutdown
+
| SAY
|[-m message] [-t timeout in seconds]
+
| sends a message to all connected players
|Shutdown dedicated server. If you run this command without any parameters, dedicated server will shutdown immediately. Countdown starts from 10 seconds. >> shutdown -m "Server will shutdown in 30 seconds" -t 30
+
|  
 
|-
 
|-
|notice
+
| SAVE
|message
+
| Saves the current game to specified path
|Notice to all players. >> notice "Welcome to Stationeers!"
+
| Arguments:
 +
* <foldername>
 +
* delete <foldername>
 +
* list
 
|-
 
|-
|status
+
| LOG
|
+
| Dumps all the logs to a file
|Display game state and player lists.
+
| Arguments:
 +
<logname> (optional)
 +
clear
 
|-
 
|-
|ban
+
| DISCORD
|steamId timeout
+
| Interaction with the Discord SDK
|Ban player for specific time. Timeout is double in hour. 0.5 is 30 minutes. 0 is infinite. >> ban 76561198299941358 0.5
+
|  
 
|-
 
|-
|unban
+
| SETTINGS
|steamId
+
| Change the settings.xml. e.g settings servermaxplayers 5
|Remove player from the ban lists.
+
| Arguments:
 +
* list
 +
* print
 +
<PropertyName> <Value>
 
|-
 
|-
|kick
+
| NETCONFIG
|steamId
+
| Change the NetConfig.xml. e.g netconfig ip 127.0.0.1
|Kick player from the current server.
+
| Arguments:
 +
* list
 +
* print
 +
* <PropertyName> <Value>
 
|-
 
|-
|clearall
+
| SETTINGSPATH
|
+
| Sets the default settings path to a new location. Launch command only. If none found default is used.
|Delete disconnected players
+
| <full-directory-path>
 
|-
 
|-
|hungerRate
+
| TEST
|hunger rate
+
| No help text :(
|Set hunger rate of server. 0 to disable hunger, higher numbers to make hunger drop more quickly.
+
|  
 
|}
 
|}
Game client displays messages in the system message window at this moment.
 
[[File:Dediserv2.png|frameless|332x332px]]
 
  
 
== Modding on Servers ==
 
== Modding on Servers ==
Line 385: Line 463:
 
  \Steam\steamapps\common\Stationeers\rocketstation_Data\StreamingAssets\
 
  \Steam\steamapps\common\Stationeers\rocketstation_Data\StreamingAssets\
 
Look for ExampleMod.zip and AttributesExampleMod.zip .
 
Look for ExampleMod.zip and AttributesExampleMod.zip .
 
= Linux Server with LinuxGSM =
 
You could run a Linux Dedicated Server on these Distros:
 
* Ubuntu 16.04/18.04 LTS
 
* Debian 8
 
* CentOS 7
 
 
=== Installation on a Ubuntu 18.04 LTS Server ===
 
It's possible to download the iso-file for installation from here:<br>
 
https://ubuntu.com/download/server<br>
 
<br>
 
This should not be a tutorial on how to set up a VM and install Ubuntu. There are many of them already out there.
 
<br>
 
First it's necessary to install all the dependencies for LinuxGSM:
 
<br>
 
    sudo dpkg --add-architecture i386; sudo apt update; sudo apt install mailutils postfix curl wget file tar bzip2 gzip unzip bsdmainutils python util-linux ca-certificates binutils bc jq tmux lib32gcc1 libstdc++6 lib32stdc++6 steamcmd zlib1g
 
<br>
 
To not having the server running with root privileges, it is recommended to set up a new user for the game server.<br>
 
To create a new user in linux use:
 
    adduser stserver
 
 
'''For security best practice, ensure you set a strong password!'''
 
 
After installing the dependencies and creating a user, switch to that user and do the following steps:
 
    su - stserver
 
 
<br>Download linuxgsm.sh with wget.
 
  wget -O linuxgsm.sh https://linuxgsm.sh
 
 
<br>Make the script executable.
 
  chmod +x linuxgsm.sh
 
 
<br>Setup the Stationeers Server instance.
 
  bash linuxgsm.sh stserver
 
 
<br>Run the installer following the on-screen instructions.
 
  ./stserver install
 
 
<br>The script now downloads the server binaries and default configuration.
 
=== Start and Stop the Server ===
 
To start the server use this command.
 
  ./stserver start
 
<br>In Default the server will start a Moon map. To join the server use the local IP with the Port 27500.
 
<br>To join the server from a different location, it's necessary to forward the port 27500/tcp and 27015/udp to the local server.
 
<br>If it's not possible to connect make sure the Ubuntu Firewall is off or configured to let these ports open. To check this run this as root user.
 
  ufw status
 
<br>To disable it use:
 
  ufw disable
 
 
<br>To see the details use:
 
  ./stserver details
 
 
<br>To stop the server use:
 
  ./stserver stop
 
 
<br>This command shows all attributes
 
  ./stserver help
 
 
<br>To show the live console of the server use:
 
  ./stserver console
 
'''To exit the console pres CTRL+b and then "d"'''
 
 
== Edit configuration ==
 
The Configuration is stored under the folder lgsm/config-lgsm/stserver. There are three files:
 
* _default.cfg (contains the whole configuration with the default values '''Do not edit this file''')
 
* common.cfg (the settings for this server)
 
* stserver.cfg (the settings for this instance)
 
If there is only one instance/server running and there will not be any other server it doesn't matter if you change the settings in common.cfg or stserver.cfg. If you planing to run more than one server or instance on the same VM you have to consider if the setting should apply server wide (all instances), or just for a specific Stationeers instance.
 
 
=== Example: Change map to Mars ===
 
Use your favorite text editor (ex. vi or nano) and open the _default.cfg (remember not to do any changes here) search for the setting you want to change and copy the text. In our example it is this:
 
  worldtype="Moon"
 
  worldname="moon_save"
 
<br>Now open the file you want to configure. If you want any instance to run a Mars map use common.cfg or if only one instance should run this map use stserver.cfg (or stserver-2.cfg for the next instance). Paste the text at the end of the file and change "Moon" to "Mars"
 
  worldtype="Mars"
 
  worldname="mars_save"
 
<br>Now restart your server with ./stserver restart
 
<br>Make sure you also change the worldname (this is the folder where the savegame is). If the savegame-file is for a different world than the config is set to, the server will not start.
 

Revision as of 11:42, 15 June 2022


Requirements

  • Linux or Windows system, either physical or virtualised,
    • must NOT be being used to run a Stationeers client (the game will not permit this).
    • if running on Windows you must have the Microsoft Visual C++ 2015 runtime installed, click here to download it.
  • ~16GB RAM (Tested and confirmed on Linux). 8GB or less and the server won't load.

Getting the server files

SteamCmd on Windows and Linux
https://developer.valvesoftware.com/wiki/SteamCMD

This is a command line tool

For the stable branch:

steamcmd +login anonymous +app_update 600760 validate +quit


For the beta branch:

steamcmd +login anonymous +app_update 600760 -beta beta validate +quit

Default ports

27516: Game port (UDP).
27015: Steam update port (UDP).

Legacy Server Startup Arguments

String parameters can take space with double quotes.

parameter value etc
-NEW Worldname (string) Starts a new game at specific world automatically from launch. Must provide world name as argument
-NEWGAME
-LOAD savefolder (string) Loads a saved world file
-LOADGAME
-JOIN [address]:[port] Joins a client to the server
-JOINGAME
-SETTINGSPATH "path" Absolute base directory for custom profile Ex)
-basedirectory C:\Profile\Player1
Config Path : default.ini C:\Profile\Player1\
Save Path : C:\Profile\Player1\saves\[worldname]
-logfile "path" If no output_log.txt use this parameter. Check examples below for syntax

batchmode, nographics and logfile are Unity3D commands.

https://docs.unity3d.com/Manual/CommandLineArguments.html

Examples

Dedicated server starts new Mars world.
rocketstation_DedicatedServer.exe -NEW=Mars -SETTINGSPATH="C:\Server\User1"


Load Mothership file.
rocketstation_DedicatedServer.exe -LOAD=Mothership


Load Mothership file. C:\Profile\Player1\saves\Mothership C:\Profile\Player1\saves\map1
rocketstation_DedicatedServer.exe -LOAD=Mothership -SETTINGSPATH="C:\Profile\Player1"


Example -logfile syntax
-logFile "C:\Server_Path\rocketstation_DedicatedServer_Data\output_log.txt"


Example -LOAD="myworld" directory structure.
Note: BaseDirectory is by default in SteamApps/common/Stationeers Dedicated Server/<Contents of BaseDirectory> if installed with SteamCMD


Linux:
-LOAD="myworld" will look for a folder named "myworld" in the saves directory like this:
BaseDirectory/saves/myworld/


Windows:
-LOAD="myworld" will look for a folder named "myworld" in the saves directory like this:
BaseDirectory\saves\myworld\


Details:
In the world directory named "myworld", these files must be present:

  • world.bin
  • world.xml
  • world_meta.xml

Note: The names of these files do not correspond to your custom world name. These will always be called world.bin etc..
The server will automatically generate these upon first start. If you are importing another world, make sure these are in place in the correct directory for the server to load them.
There is also one more file that will be created:

  • worldsettings.xml
Configuration from setting.xml

setting.xml will be created once you start it up for the first time. Command parameters override setting.xml


The server is mostly a stripped down client as such it inherits certain features

Example Setting.xml

  <?xml version="1.0" encoding="utf-8"?>
  <SettingData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <AutoSave>true</AutoSave>
  <SaveInterval>300</SaveInterval>
  <SavePath />

  <StartingConditions>Default</StartingConditions>
  <RespawnCondition>Easy</RespawnCondition>
  <HungerRate>0.5</HungerRate>
  <SunOrbitPeriod>1</SunOrbitPeriod>

  <ResearchPoolKey>ResearchOff</ResearchPoolKey>

  <RoomControlTickSpeed>1</RoomControlTickSpeed>
  <WorldOrigin>false</WorldOrigin>

 <ServerName>Stationeers</ServerName>
  <StartLocalHost>true</StartLocalHost>
  <ServerVisible>true</ServerVisible>
  <ServerPassword />
  <AdminPassword>randomstringhere</AdminPassword>
  <ServerMaxPlayers>10</ServerMaxPlayers>
  <UpdatePort>27015</UpdatePort>
  <GamePort>27016</GamePort>
  <UPNPEnabled>true</UPNPEnabled>
  <DisconnectTimeout>10000</DisconnectTimeout>
  <NetworkDebugFrequency>500</NetworkDebugFrequency>


XML Attribute Parameter
Case Sensitive
Details
<RespawnCondition> Easy, Normal, Stationeer Or a custom key from a mod.
Seems to be used as spawn conditions instead for new players
<StartingConditions> Default, Minimal, Vulcan, Venus, BareBones Or a custom key from a mod.
Server ignores this, define custom worldtype
<ResearchPoolKey> ResearchOff, ResearchOn Or a custom key from a mod.
Server ignores this
<SunOrbitPeriod> default=1 Multiplier on the time it takes for the sun to orbit, default is 20 minutes, 10 minute day 10 night.
Undocumented
<UseCustomWorkThreadsCount>false</UseCustomWorkThreadsCount> true, false
<MinWorkerThreads> number default=8
<MinCompletionPortThreads> number default=8
<MaxWorkerThreads>100</MaxWorkerThreads> number default=100
<MaxCompletionPortThreads>50</MaxCompletionPortThreads> number default=50
<CoroutineTimeBudget>1</CoroutineTimeBudget> number default=1

Savegames

Configuration from worldsettings.xml

Undocumented feature

The server is mostly a stripped down client as such it inherits certain features

XML Attribute Parameter Details
<GameMode> Creative, Survival
<HungerRate> default=0.25 Multiplier on the amount of hunger generated per game tick.
<StartingCondition> N/A Can only be defined in custom world before generation

Configuration from world.xml

XML Attribute Parameter Details
<ResearchKey> ResearchOff, ResearchOn Or a custom key from a mod.
<RespawnCondition> Easy, Normal, Stationeer Or a custom key from a mod.
Seems to be used as spawn conditions instead for new players


Server Administrator

In Game Admin

ADMINPASSWORD parameter must be added to setting.xml and set a password.

All commands are typed in the chat (enter) by default, starting with /login

Server Program Console

You can type commands in the running application which acts like a console

Command Lists

Command Details Parameter
HELP Displays helpful stuff Arguments:
  • commands
  • list (l)
  • <key>
  • tofile: prints the help output to file
CLEAR Clears all console text
QUIT immediately quits the game without any prompts
EXIT Leaves a game session and goes back to 'StartMenu'
LEAVE
NEW Starts a new game at specific world automatically from launch.Must provide world name as argument worldName
NEWGAME
LOAD Loads a saved world file <foldername>
LOADGAME
JOIN Joins a client to the server [address]:[port]
JOINGAME
STEAM Commands to test Facepunch API. Just checks if steam is initialised and if DLC is purchased
LISTNETWORKDEVICES No help text :( id
TESTBYTEARRAY Tests every item in world to check its network read/write functions are parallel. Only enabled in Editor.

Supply a reference Id to check ONLY that item

ROCKETBINARY Starts logging the size of each section of a delta update. Arguments:
  • toggleloglength
  • togglelogbps
IMGUI No help text :(
ATMOS Enables atmosphere debugging Arguments:
  • pipe
  • world
  • room
  • global
  • thing
THING Thing related commands Arguments:
  • No args returns total thing count
  • find
  • delete
  • spawn
KEYBINDINGS Displays all the keybindings bound to LocalHuman Arguments:
  • reset (Resets the keybindings stack. Can help solve input issues)
RESET Restarts the application
VERSION Returns the game version
LOGTOCLIPBOARD Copies the content of the console buffer to the system clipboard buffer
KICK Kick clients from server commands clientId - disconnects the client from the game
BAN Bans a client from the server (server only command) clientId
UPNP returns universal plug and play (upnp) state
NETWORK returns the current network status
PAUSE will pause/unpause the game (including for clients) Arguments:
  • true
  • false
SAY sends a message to all connected players
SAVE Saves the current game to specified path Arguments:
  • <foldername>
  • delete <foldername>
  • list
LOG Dumps all the logs to a file Arguments:

<logname> (optional) clear

DISCORD Interaction with the Discord SDK
SETTINGS Change the settings.xml. e.g settings servermaxplayers 5 Arguments:
  • list
  • print

<PropertyName> <Value>

NETCONFIG Change the NetConfig.xml. e.g netconfig ip 127.0.0.1 Arguments:
  • list
  • print
  • <PropertyName> <Value>
SETTINGSPATH Sets the default settings path to a new location. Launch command only. If none found default is used. <full-directory-path>
TEST No help text :(

Modding on Servers

Undocumented feature
Mods are supported on Dedicated servers, however it requires additional manual configuration - Necessitating direct file access and editing on the dedicated server. To install mods, you'll need to manually obtain the mod data first - Either from the Steam Workshop, or built yourself. Upload/Store the mods in a specific folder on the server - You will also likely want to edit default.ini on the server to point to a particular server folder rather then the default directory, defined below. Then manually add ModConfig.xml in the root directory of the server executible files, and manually edit the file to add each individual mod.

modconfig.xml

Place a modconfig.xml in the serverfiles root (next to executable). Filename case is significant on Linux.


<?xml version="1.0" encoding="utf-8"?>
<ModConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Mods>
    <unsignedLong>1</unsignedLong>
    <unsignedLong>1001</unsignedLong>
    <unsignedLong>1002</unsignedLong>
  </Mods>
  <DisabledMods>
  </DisabledMods>
  <LocalMods>
    <LocalMod>
      <folder>YourFirstModFolderHere</folder>
      <modID>1001</modID>
    </LocalMod>
    <LocalMod>
      <folder>YourSecondModFolderHere</folder>
      <modID>1002</modID>
    </LocalMod>
  </LocalMods>
</ModConfig>

Assign a number to each entry you want to add.
Numbers seem to default to 4 digits for mods when generated by the client,
so try and keep the same structure in the server to prevent complications.
1 is core file and always need to be enabled

Storing Mods

WIN: C:\Users\USERNAME_HERE\Documents\My Games\Stationeers\mods\
LIN: /home/USERNAME_HERE/My Games/Stationeers/mods/
OSX: /Users/USERNAME_HERE/My Games/Stationeers/mods/


\Modname or workshopid\About\

(file containing description about mod and thumbnail)

\Modname or workshopid\GameData\

(files you want to append to the core gamedata)

It's recommended to only put entries in the mod files you want to add or replace,
do not try and replace the whole file for compatibility issues and errors.

There are some examples of how to make your own mods in:

\Steam\steamapps\common\Stationeers\rocketstation_Data\StreamingAssets\

Look for ExampleMod.zip and AttributesExampleMod.zip .