Actions

Difference between revisions of "Dedicated Server Guide"

From Unofficial Stationeers Wiki

(Dedicated Server Commands)
(Added a container based quick start)
 
(58 intermediate revisions by 23 users not shown)
Line 1: Line 1:
<!-- This guide is moved with permission of Discord user(and owner of real version of this guide): @MaddoScientisto#1170 -->
 
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]
  
== Dedicated Server Commands ==
+
== Requirements ==
 +
* Linux or Windows system, either physical or virtualised,
 +
** NOT recommended also running a Stationeers client (there will be issues with router NAT-loopback).
 +
** Linux Glibcxx 3.4.29 & Glibc 2.34 (Ubuntu 22.04 LTS)
 +
** if running on Windows you must have the Microsoft Visual C++ 2015, 2017 and 2019 runtime installed, [https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 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<br>
 +
https://developer.valvesoftware.com/wiki/SteamCMD
 +
 
 +
''This is a command line tool''
 +
 
 +
For the stable branch:
 +
 
 +
<code>steamcmd +login anonymous +app_update 600760 validate +quit</code>
 +
 
 +
 
 +
For the beta branch:
 +
 
 +
<code>steamcmd +login anonymous +app_update 600760 -beta beta validate +quit</code>
 +
 
 +
<i>For getting back from beta to public use -beta public ,steamcmd has trouble with caching</i>
 +
 
 +
== Default ports ==
 +
8081: Meta Server port (TCP).<br>
 +
27016: Game port (UDP).<br>
 +
27015: Steam update port (UDP).
 +
 
 +
== 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 8: Line 36:
 
! parameter !! value !! etc
 
! parameter !! value !! etc
 
|-
 
|-
| -batchmode|| || Dedicated server runs without UI and start to listen port.
+
| -NEW
|-
+
| rowspan=2 | Worldtype (string)
| -nographics|| || When running in batch mode, do not initialize graphics device at all.
+
| rowspan=2 | Starts a new game at specific world automatically from launch. Must provide world type as argument<br>
|-
+
<code>moon, mars, europa, europa2, mimas, vulcan, vulcan2, space, loulan, venus</code>
| -logfile|| "path" || If no output_log.txt use this parameter. Check examples below for syntax
 
|-
 
| -autostart|| || Dedicated server start to listen port without player input. It's always enabled on Linux dedicated server
 
 
|-
 
|-
| -autosaveinterval|| integer || Save world in every interval.
+
| -NEWGAME
 
|-
 
|-
| -creator|| int64|| Set creator's steam id as gamedata and key-value.
+
| -LOAD
This is for future integration of server instancing.
+
| rowspan=2 | savefolder (string)
 +
| rowspan=2 | Loads a saved world file, a second argument can be given with worldtype when loading fails it will make a new world instead.
 
|-
 
|-
| -worldname || string || Load and save game data automatically from existing file.
+
| -LOADGAME
 
|-
 
|-
| -worldtype || string  || Worldtype(Space, Mars, Terrain)
+
| -LOADLATEST
 +
|  
 +
| Loads the last save or backup from the save name\folder specified (checking world.xml datestamp), second argument is worldtype to fallback to when loading fails.
 
|-
 
|-
|<nowiki>-loadworld</nowiki>
+
| -JOIN
| string  || Load world from saved file. If loadworld is enabled, worldname command is ignored.
+
| rowspan=2 | [address]:[port]
 +
| rowspan=2 | Joins a client to the server
 
|-
 
|-
| -gameport  || integer  || UDP port for game. Avoid to set 27015-27020. It's steam's local server query ports.
+
| -JOINGAME
 
|-
 
|-
|<nowiki>-updateport</nowiki>
+
| -SETTINGSPATH
|integer
+
| "path"
|UDP port for steam query
+
| 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>
 
|-
 
|-
|<nowiki>-servername</nowiki>
+
| -logfile|| "path" || If no output_log.txt use this parameter. Check examples below for syntax.
|string
 
|Server title.
 
 
|-
 
|-
|<nowiki>-basedirectory</nowiki>
 
|string
 
|<nowiki>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]</nowiki>
 
 
|}
 
|}
 
batchmode, nographics and logfile are Unity3D commands.
 
batchmode, nographics and logfile are Unity3D commands.
  
 
https://docs.unity3d.com/Manual/CommandLineArguments.html
 
https://docs.unity3d.com/Manual/CommandLineArguments.html
 +
 +
[[https://github.com/rocket2guns/StationeersDedicatedServerGuide/blob/main/README.md Official Server Guide]]
 +
 +
=== Logging Alternates ===
 +
Logging seems to be broken, here are some old skool alternatives.<br>
 +
Small downside is they break the input of the console but it doesn't seem to throw warnings like usual.
 +
 +
* Linux <code>rocketstation_DedicatedServer.x86_64 2>&1 | tee filename.txt</code>
 +
** extra options would be --a or --append in front of the filename to keep appending to the logfile
 +
* Windows (powershell) <code>rocketstation_DedicatedServer.exe &> | tee -file filename.txt</code>
 +
** extra options would be -Append at the end to keep appending to the logfile
 +
** Command Prompt <code>powershell rocketstation_DedicatedServer.exe ^| tee -File filename.txt</code>
 +
 +
== Quickstart ==
 +
https://github.com/mandusm/stationeers-dedicated-server/tree/main
  
 
== Examples ==
 
== Examples ==
  
====== Dedicated server starts new Mars world. Autosave every 5 mins to Mars1. ======
+
<span style="font-size: 120%;"> Dedicated server starts new Mars world. Autosave every 5 mins to Mars1. </span><br>
rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -worldtype=Mars -worldname=Mars1 -basedirectory="C:\Server\User1"
+
<code>rocketstation_DedicatedServer.exe -LOAD Mars1 Mars -SETTINGSPATH "C:\Server\User1" -settings StartLocalHost true ServerVisible true GamePort 27016 UpdatePort 27015 AutoSave true SaveInterval 300</code>
 +
 
 +
 
 +
<span style="font-size: 120%;"> Load Mothership file. Autosave every 5 mins. </span><br>
 +
<code>rocketstation_DedicatedServer.exe -LOAD Mothership -settings StartLocalHost true ServerVisible true GamePort 27016 UpdatePort 27015 AutoSave true SaveInterval 300</code>
 +
 
 +
 
 +
<span style="font-size: 120%;"> Load Mothership file. Autosave  every 5 mins. C:\Profile\Player1\saves\Mothership </span><br>
 +
<code>rocketstation_DedicatedServer.exe -LOAD Mothership -SETTINGSPATH "C:\Profile\Player1" -settings StartLocalHost true ServerVisible true GamePort 27016 UpdatePort 27015 AutoSave true SaveInterval 300</code>
 +
 
 +
 
 +
<span style="font-size: 120%;"> Example <code>-logfile</code> syntax </span><br>
 +
<code>-logFile "C:\Server_Path\rocketstation_DedicatedServer_Data\output_log.txt"</code>
 +
 
 +
 
 +
<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>
 +
 
 +
 
 +
<big>'''Linux:'''</big><br>
 +
<code>-LOAD "myworld"</code> will look for a folder named "myworld" in the ''saves'' directory like this:<br>
 +
''BaseDirectory''/saves/myworld/<br>
 +
 
 +
 
 +
<big>'''Windows:'''</big><br>
 +
<code>-LOAD "myworld"</code> will look for a folder named "myworld" in the ''saves'' directory like this:<br>
 +
''BaseDirectory''\saves\myworld\
 +
 
 +
 
 +
<big>'''Details:'''</big><br>
 +
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..<br>
 +
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.<br>
 +
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. <u>Command parameters reset setting.xml to default</u>
 +
<hr>''The server is mostly a stripped down client as such it inherits certain features''
 +
<hr>
 +
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">
  
====== Load Mothership file. Autosave every 5 mins. ======
+
  <AutoSave>true</AutoSave>
rocketstation_DedicatedServer.exe -batchmode -nographics -autostart  -gameport=27200 -updateport=27016 -autosaveinterval=300 -loadworld=Mothership -servername="Official Dedicated Server"
+
  <SaveInterval>300</SaveInterval>
 +
  <SavePath />
  
====== Load . Autosave  every 5 mins. C:\Profile\Player1\saves\Mothership C:\Profile\Player1\saves\map1 ======
+
  <StartingConditions>Default</StartingConditions>
rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -gameport=27200 -updateport=27016 -loadwo
+
  <RespawnCondition>Easy</RespawnCondition>
rld=Mothership -worldname=map1 -basedirectory="C:\Profile\Player1" -servername "Official Dedicated Server"
+
  <HungerRate>0.5</HungerRate>
 +
  <SunOrbitPeriod>1</SunOrbitPeriod>
  
====== Example -logfile syntax ======
+
  <ResearchPoolKey>ResearchOff</ResearchPoolKey>
-logFile "C:\Server_Path\rocketstation_DedicatedServer_Data\output_log.txt"
 
  
 +
  <RoomControlTickSpeed>1</RoomControlTickSpeed>
 +
  <WorldOrigin>false</WorldOrigin>
  
====== Configuration from default.ini ======
+
<ServerName>Stationeers</ServerName>
default.ini will be created once you start game. Command parameters override defaut.ini
+
  <StartLocalHost>true</StartLocalHost>
[SERVER]
+
  <ServerVisible>true</ServerVisible>
SERVERNAME=Stationeers
+
  <ServerPassword />
GAMEPORT=27500
+
  <AdminPassword>randomstringhere</AdminPassword>
UPDATERPORT=27015
+
  <ServerMaxPlayers>10</ServerMaxPlayers>
PASSWORD=
+
  <UpdatePort>27015</UpdatePort>
MAPNAME=BASE
+
  <GamePort>27016</GamePort>
DESCRIPTION=Stationeers
+
  <UPNPEnabled>true</UPNPEnabled>
MAXPLAYER=30
+
  <DisconnectTimeout>10000</DisconnectTimeout>
[RCON]
+
  <NetworkDebugFrequency>500</NetworkDebugFrequency>
RCONPASSWORD=stationeers
+
</pre><hr>
  
== Remote Administrator ==
 
You can send commands on web browser.
 
<nowiki>Link : http://[dedicated server address]:[GamePort]</nowiki>
 
[[File:Dediserv1.png|frameless|735x735px]]
 
  
== Command Lists ==
 
 
{| class="wikitable"
 
{| class="wikitable"
!Command
+
! XML Attribute
!Parameter
+
! Parameter<br>''Case Sensitive''
!Details
+
! Details
 +
|-
 +
| <RespawnCondition>
 +
| Easy, Normal, Stationeer
 +
| Or a custom key from a mod.<br>''Seems to be used as spawn conditions instead for new players''
 +
|-
 +
| <StartingConditions>
 +
| Default, Minimal, Vulcan, Venus, BareBones
 +
| Or a custom key from a mod.<br>''Server ignores this, define custom worldtype''
 +
|-
 +
| <ResearchPoolKey>
 +
| ResearchOff, ResearchOn
 +
| Or a custom key from a mod.<br>''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.
 +
|-
 +
! colspan=3 | 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''
 +
 
 +
{| class="wikitable"
 +
! 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 ===
 +
 
 +
{| class="wikitable"
 +
! XML Attribute
 +
! Parameter
 +
! Details
 +
|-
 +
| <ResearchKey>
 +
| ResearchOff, ResearchOn
 +
| Or a custom key from a mod.
 
|-
 
|-
|login
+
| <RespawnCondition>
|password
+
| Easy, Normal, Stationeer
|RCONPASSWORD is defined in default.ini. Default rcon password is stationeers.
+
| Or a custom key from a mod.<br>''Seems to be used as spawn conditions instead for new players''
 
|-
 
|-
|save
+
|}
|worldname
+
 
|Save world to basedirectory
 
  
When basedirectory is "C:\Profile\Player1",
+
== Server Administrator ==
  
>> save "Moon 2"
+
===In Game Admin===
 +
<ServerAuthSecret/> parameter must be added to setting.xml on both server and client and be the same token.
  
Save world to "C:\Profile\Player1\Moon 2"
+
All commands are typed in the chat (F3) by default and prefixed by <code>serverrun</code>
  
>> save Moon
+
=== Server Program Console===
 +
You can type commands in the running application which acts like a console
  
Save world to "C:\Profile\Player1\Moon"
+
=== Command Lists ===
 +
{| class="wikitable"
 +
!Command
 +
!Details
 +
!Parameter
 
|-
 
|-
|shutdown
+
| HELP
|[-m message] [-t timeout in seconds]
+
| Displays helpful stuff
|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
+
| Arguments:
 +
* commands
 +
* list (l)
 +
* <key>
 +
* tofile: prints the help output to file
 
|-
 
|-
|notice
+
| CLEAR
|message
+
| Clears all console text ||
|Notice to all players. >> notice "Welcome to Stationeers!"
 
 
|-
 
|-
|status
+
| QUIT
 +
| immediately quits the game without any prompts
 
|
 
|
|Display game state and player lists.
 
 
|-
 
|-
|ban
+
| EXIT
|steamId timeout
+
| rowspan=2 | Leaves a game session and goes back to 'StartMenu'
|Ban player for specific time. Timeout is double in hour. 0.5 is 30 minutes. 0 is infinite. >> ban 76561198299941358 0.5
+
| 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
 +
|-
 +
| LOADLATEST
 +
| Loads the latest saved file, including auto saves
 +
| <foldername>
 
|-
 
|-
|unban
+
| JOIN
|steamId
+
| rowspan=2 | Joins a client to the server
|Remove player from the ban lists.
+
| rowspan=2 | [address]:[port]
 
|-
 
|-
|kick
+
| JOINGAME
|steamId
 
|Kick player from the current server.
 
 
|-
 
|-
|clearall
+
| STEAM
 +
| Commands to test Facepunch API. Just checks if steam is initialised and if DLC is purchased
 
|
 
|
|Delete disconnected players
 
 
|-
 
|-
|hungerRate
+
| LISTNETWORKDEVICES
|hunger rate
+
| No help text :(
|Set hunger rate of server. 0 to disable hunger, higher numbers to make hunger drop more quickly.
+
| 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
 +
| Toggles ImguiInWorldTestCube on/off
 +
|
 +
|-
 +
| 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 master server setting in 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>
 +
|-
 +
|  DIFFICULTY
 +
| Sets game difficulty to one of the predefined settings
 +
|  -DIFFICULTY [<difficulty>]
 +
|-
 +
| REGENERATEROOMS
 +
| Regenerates all rooms for the world
 +
|
 +
|-
 +
| STORMBEGIN
 +
| Starts weather event
 +
|
 +
|-
 +
| STORMEND
 +
| Stops weather event
 +
|
 +
|-
 +
| DEBUGTHREADS
 +
| Show the times that the worker threads take to run.
 +
| GameTick
 +
|-
 +
| STATUS
 +
| Displays a bunch of info to give insight into state of server.
 +
|
 +
|-
 +
| MASTERSERVER
 +
| Commands to help with interacting with the Master Server.
 +
| refresh
 +
|-
 +
| DELETELOOSEITEMS
 +
| Removes all items in world that isn't in a slot
 +
|
 +
|-
 +
| SUNTIME
 +
| Set the time of day between 0 and 1 (e.g. 0 is sunrise, 0.5 is sunset)
 +
| Arguments:
 +
* time
 +
|-
 +
| CLEANUPPLAYERS
 +
| Cleans up player bodies
 +
| Arguments:
 +
* dead
 +
* disconnected
 +
* all
 +
|-
 +
| TEST
 +
| No help text :(
 +
|
 
|}
 
|}
Game client displays messages in the system message window at this moment.
 
[[File:Dediserv2.png|frameless|332x332px]]
 
  
 
== Modding on Servers ==
 
== Modding on Servers ==
'''Undocumented feature'''
+
'''Undocumented feature'''<br>
 +
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.<br>
  
=== ModConfig.xml ===
+
=== modconfig.xml ===
Place a ModConfig.xml in the serverfiles root (next to executable).
+
Place a modconfig.xml in the serverfiles root (next to executable).  Filename case is significant on Linux.
  
 
<HR><pre>
 
<HR><pre>
 
<?xml version="1.0" encoding="utf-8"?>
 
<?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">
+
<ModConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
   <Mods>
 
   <Mods>
     <unsignedLong>1</unsignedLong>
+
     <ModData>
     <unsignedLong>1001</unsignedLong>
+
      <Id>1</Id>
     <unsignedLong>1002</unsignedLong>
+
      <IsEnabled>true</IsEnabled>
 +
      <LocalPath />
 +
     </ModData>
 +
    <ModData>
 +
      <Id>0</Id>
 +
      <IsEnabled>true</IsEnabled>
 +
      <LocalPath>YourFirstModFolderHere</LocalPath>
 +
     </ModData>
 +
    <ModData>
 +
      <Id>0</Id>
 +
      <IsEnabled>true</IsEnabled>
 +
      <LocalPath>YourSecondModFolderHere</LocalPath>
 +
    </ModData>
 
   </Mods>
 
   </Mods>
  <DisabledMods>
 
  </DisabledMods>
 
  <LocalMods>
 
    <LocalMod>
 
      <folder>YourFirstModFolderHere</folder>
 
      <modID>1001</modID>
 
    </LocalMod>
 
    <LocalMod>
 
      <folder>YourSecondModFolderHere</folder>
 
      <modID>1002</modID>
 
    </LocalMod>
 
  </LocalMods>
 
 
</ModConfig>
 
</ModConfig>
 
</pre><HR>
 
</pre><HR>
  
Assign a number to each entry you want to add.<br>
+
Local mods have Id 0.<br>
Numbers seem to default to 4 digits for mods when generated by the client,<br>
+
So try and keep the same structure in the server to prevent complications.<br>
so try and keep the same structure in the server to prevent complications.<br>
 
 
''1 is core file and always need to be enabled''
 
''1 is core file and always need to be enabled''
 +
 +
===Alternate ModConfig.xml===
 +
If the above modconfig don't work, try this one:
 +
 +
<HR><pre>
 +
<?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>"FirstModFolderPath"</folder>
 +
            <modID>1001</modID>
 +
        </LocalMod>
 +
        <LocalMod>
 +
            <folder>"SecondModFolderPath"</folder>
 +
            <modID>1002</modID>
 +
        </LocalMod>
 +
    </LocalMods>
 +
</ModConfig>
 +
</pre>
  
 
=== Storing Mods ===
 
=== Storing Mods ===
 +
 
  WIN: C:\Users\'''USERNAME_HERE'''\Documents\My Games\Stationeers\mods\
 
  WIN: C:\Users\'''USERNAME_HERE'''\Documents\My Games\Stationeers\mods\
 
  LIN: /home/'''USERNAME_HERE'''/My Games/Stationeers/mods/
 
  LIN: /home/'''USERNAME_HERE'''/My Games/Stationeers/mods/
 
  OSX: /Users/'''USERNAME_HERE'''/My Games/Stationeers/mods/
 
  OSX: /Users/'''USERNAME_HERE'''/My Games/Stationeers/mods/
  
 +
Mods folder root is displaced by the <SavePath> setting in setting.xml,<br>
 +
not sure if it's a bug or feature
  
 
  \Modname or workshopid\About\
 
  \Modname or workshopid\About\
Line 190: Line 562:
 
  \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 .
 +
 +
 +
Note: There seems to be some changes as to how where the dedicated server loads mods from. The above solution seems to be deprecated, see below if above solution doesn't work.
 +
 +
WIN:[Where you've installed the server]/Steam/steamapps/common/Stationeers Dedicated Server/rocketstation_DedicatedServer_Data/StreamingAssets/Data/Mods <br>
 +
LIN:/home/'''USERNAME_HERE'''/Steam/steamapps/common/Stationeers Dedicated Server/rocketstation_DedicatedServer_Data/StreamingAssets/Data/Mods <br>
 +
OSX:[Where you've installed the server]/Steam/steamapps/common/Stationeers Dedicated Server/rocketstation_DedicatedServer_Data/StreamingAssets/Data/Mods <br>
 +
 +
The Mods folder in /StreamingAssets/ is not premade, but needs to be added manually. Put the mods you want in here, and the server will load them. It is unknown if a ModConfig is even needed when doing it this way.

Latest revision as of 12:37, 27 September 2024


Requirements[edit]

  • Linux or Windows system, either physical or virtualised,
    • NOT recommended also running a Stationeers client (there will be issues with router NAT-loopback).
    • Linux Glibcxx 3.4.29 & Glibc 2.34 (Ubuntu 22.04 LTS)
    • if running on Windows you must have the Microsoft Visual C++ 2015, 2017 and 2019 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[edit]

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

For getting back from beta to public use -beta public ,steamcmd has trouble with caching

Default ports[edit]

8081: Meta Server port (TCP).
27016: Game port (UDP).
27015: Steam update port (UDP).

Legacy Server Startup Arguments[edit]

String parameters can take space with double quotes.

parameter value etc
-NEW Worldtype (string) Starts a new game at specific world automatically from launch. Must provide world type as argument

moon, mars, europa, europa2, mimas, vulcan, vulcan2, space, loulan, venus

-NEWGAME
-LOAD savefolder (string) Loads a saved world file, a second argument can be given with worldtype when loading fails it will make a new world instead.
-LOADGAME
-LOADLATEST Loads the last save or backup from the save name\folder specified (checking world.xml datestamp), second argument is worldtype to fallback to when loading fails.
-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

[Official Server Guide]

Logging Alternates[edit]

Logging seems to be broken, here are some old skool alternatives.
Small downside is they break the input of the console but it doesn't seem to throw warnings like usual.

  • Linux rocketstation_DedicatedServer.x86_64 2>&1 | tee filename.txt
    • extra options would be --a or --append in front of the filename to keep appending to the logfile
  • Windows (powershell) rocketstation_DedicatedServer.exe &> | tee -file filename.txt
    • extra options would be -Append at the end to keep appending to the logfile
    • Command Prompt powershell rocketstation_DedicatedServer.exe ^| tee -File filename.txt

Quickstart[edit]

https://github.com/mandusm/stationeers-dedicated-server/tree/main

Examples[edit]

Dedicated server starts new Mars world. Autosave every 5 mins to Mars1.
rocketstation_DedicatedServer.exe -LOAD Mars1 Mars -SETTINGSPATH "C:\Server\User1" -settings StartLocalHost true ServerVisible true GamePort 27016 UpdatePort 27015 AutoSave true SaveInterval 300


Load Mothership file. Autosave every 5 mins.
rocketstation_DedicatedServer.exe -LOAD Mothership -settings StartLocalHost true ServerVisible true GamePort 27016 UpdatePort 27015 AutoSave true SaveInterval 300


Load Mothership file. Autosave every 5 mins. C:\Profile\Player1\saves\Mothership
rocketstation_DedicatedServer.exe -LOAD Mothership -SETTINGSPATH "C:\Profile\Player1" -settings StartLocalHost true ServerVisible true GamePort 27016 UpdatePort 27015 AutoSave true SaveInterval 300


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[edit]

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


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[edit]

Configuration from worldsettings.xml[edit]

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[edit]

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[edit]

In Game Admin[edit]

<ServerAuthSecret/> parameter must be added to setting.xml on both server and client and be the same token.

All commands are typed in the chat (F3) by default and prefixed by serverrun

Server Program Console[edit]

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

Command Lists[edit]

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
LOADLATEST Loads the latest saved file, including auto saves <foldername>
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 Toggles ImguiInWorldTestCube on/off
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 master server setting in 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>
DIFFICULTY Sets game difficulty to one of the predefined settings -DIFFICULTY [<difficulty>]
REGENERATEROOMS Regenerates all rooms for the world
STORMBEGIN Starts weather event
STORMEND Stops weather event
DEBUGTHREADS Show the times that the worker threads take to run. GameTick
STATUS Displays a bunch of info to give insight into state of server.
MASTERSERVER Commands to help with interacting with the Master Server. refresh
DELETELOOSEITEMS Removes all items in world that isn't in a slot
SUNTIME Set the time of day between 0 and 1 (e.g. 0 is sunrise, 0.5 is sunset) Arguments:
  • time
CLEANUPPLAYERS Cleans up player bodies Arguments:
  • dead
  • disconnected
  • all
TEST No help text :(

Modding on Servers[edit]

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[edit]

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:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Mods>
    <ModData>
      <Id>1</Id>
      <IsEnabled>true</IsEnabled>
      <LocalPath />
    </ModData>
    <ModData>
      <Id>0</Id>
      <IsEnabled>true</IsEnabled>
      <LocalPath>YourFirstModFolderHere</LocalPath>
    </ModData>
    <ModData>
      <Id>0</Id>
      <IsEnabled>true</IsEnabled>
      <LocalPath>YourSecondModFolderHere</LocalPath>
    </ModData>
  </Mods>
</ModConfig>

Local mods have Id 0.
So try and keep the same structure in the server to prevent complications.
1 is core file and always need to be enabled

Alternate ModConfig.xml[edit]

If the above modconfig don't work, try this one:


<?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>"FirstModFolderPath"</folder>
            <modID>1001</modID>
        </LocalMod>
        <LocalMod>
            <folder>"SecondModFolderPath"</folder>
            <modID>1002</modID>
        </LocalMod>
    </LocalMods>
</ModConfig>

Storing Mods[edit]

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/

Mods folder root is displaced by the <SavePath> setting in setting.xml,
not sure if it's a bug or feature

\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 .


Note: There seems to be some changes as to how where the dedicated server loads mods from. The above solution seems to be deprecated, see below if above solution doesn't work.

WIN:[Where you've installed the server]/Steam/steamapps/common/Stationeers Dedicated Server/rocketstation_DedicatedServer_Data/StreamingAssets/Data/Mods
LIN:/home/USERNAME_HERE/Steam/steamapps/common/Stationeers Dedicated Server/rocketstation_DedicatedServer_Data/StreamingAssets/Data/Mods
OSX:[Where you've installed the server]/Steam/steamapps/common/Stationeers Dedicated Server/rocketstation_DedicatedServer_Data/StreamingAssets/Data/Mods

The Mods folder in /StreamingAssets/ is not premade, but needs to be added manually. Put the mods you want in here, and the server will load them. It is unknown if a ModConfig is even needed when doing it this way.