Actions

Difference between revisions of "Dedicated Server Guide"

From Unofficial Stationeers Wiki

(Dedicated Server Commands)
(Elaborated on how the server looks for existing world files with the -loadworld option.)
Line 48: Line 48:
 
== Examples ==
 
== Examples ==
  
====== Dedicated server starts new Mars world. Autosave every 5 mins to Mars1. ======
+
===== Dedicated server starts new Mars world. Autosave every 5 mins to Mars1. =====
 
  rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -worldtype=Mars -worldname=Mars1 -basedirectory="C:\Server\User1"
 
  rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -worldtype=Mars -worldname=Mars1 -basedirectory="C:\Server\User1"
  
====== Load Mothership file. Autosave every 5 mins. ======
+
 
 +
===== Load Mothership file. Autosave every 5 mins. =====
 
  rocketstation_DedicatedServer.exe -batchmode -nographics -autostart  -gameport=27200 -updateport=27016 -autosaveinterval=300 -loadworld=Mothership -servername="Official Dedicated Server"
 
  rocketstation_DedicatedServer.exe -batchmode -nographics -autostart  -gameport=27200 -updateport=27016 -autosaveinterval=300 -loadworld=Mothership -servername="Official Dedicated Server"
  
====== Load . Autosave  every 5 mins. C:\Profile\Player1\saves\Mothership C:\Profile\Player1\saves\map1 ======
+
 
 +
===== Load . Autosave  every 5 mins. C:\Profile\Player1\saves\Mothership C:\Profile\Player1\saves\map1 =====
 
  rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -gameport=27200 -updateport=27016 -loadwo
 
  rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -gameport=27200 -updateport=27016 -loadwo
 
  rld=Mothership -worldname=map1 -basedirectory="C:\Profile\Player1" -servername "Official Dedicated Server"
 
  rld=Mothership -worldname=map1 -basedirectory="C:\Profile\Player1" -servername "Official Dedicated Server"
  
====== Example -logfile syntax ======
+
 
 +
===== Example -logfile syntax =====
 
-logFile "C:\Server_Path\rocketstation_DedicatedServer_Data\output_log.txt"
 
-logFile "C:\Server_Path\rocketstation_DedicatedServer_Data\output_log.txt"
  
  
====== Configuration from default.ini ======
+
===== Example -loadworld="myworld" directory structure. =====
 +
'''Note:''' ''BaseDirectory'' is by default in SteamApps/common/Stationeers Dedicated Server/''<Contents of BaseDirectory>'' if installed with SteamCMD<br>
 +
 
 +
<big>'''Linux:'''</big><br>
 +
-loadworld="myworld" will look for a folder named "myworld" in the ''saves'' directory like this:<br>
 +
''BaseDirectory''/saves/myworld/<br>
 +
 
 +
<big>'''Windows:'''</big><br>
 +
-loadworld="myworld" 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", there must be a few files:
 +
* 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
 +
<br>
 +
 
 +
 
 +
===== Configuration from default.ini =====
 
default.ini will be created once you start game. Command parameters override defaut.ini
 
default.ini will be created once you start game. Command parameters override defaut.ini
 
  [SERVER]
 
  [SERVER]

Revision as of 11:58, 15 December 2019


Dedicated Server Commands

String parameters can take space with double quotes.

parameter value etc
-batchmode Dedicated server runs without UI and start to listen port.
-nographics When running in batch mode, do not initialize graphics device at all.
-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.
-creator int64 Set creator's steam id as gamedata and key-value.

This is for future integration of server instancing.

-worldname string Load and save game data automatically from existing file.
-worldtype string Worldtype(Space, Mars, Terrain)
-loadworld 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.
-updateport integer UDP port for steam query
-servername string Server title.
-basedirectory string 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]

batchmode, nographics and logfile are Unity3D commands.

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

Examples

Dedicated server starts new Mars world. Autosave every 5 mins to Mars1.
rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -worldtype=Mars -worldname=Mars1 -basedirectory="C:\Server\User1"


Load Mothership file. Autosave every 5 mins.
rocketstation_DedicatedServer.exe -batchmode -nographics -autostart  -gameport=27200 -updateport=27016 -autosaveinterval=300 -loadworld=Mothership -servername="Official Dedicated Server"


Load . Autosave every 5 mins. C:\Profile\Player1\saves\Mothership C:\Profile\Player1\saves\map1
rocketstation_DedicatedServer.exe -batchmode -nographics -autostart -autosaveinterval=300 -gameport=27200 -updateport=27016 -loadwo
rld=Mothership -worldname=map1 -basedirectory="C:\Profile\Player1" -servername "Official Dedicated Server"


Example -logfile syntax

-logFile "C:\Server_Path\rocketstation_DedicatedServer_Data\output_log.txt"


Example -loadworld="myworld" directory structure.

Note: BaseDirectory is by default in SteamApps/common/Stationeers Dedicated Server/<Contents of BaseDirectory> if installed with SteamCMD

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

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

Details:
In the world directory named "myworld", there must be a few files:

  • 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 default.ini

default.ini will be created once you start game. Command parameters override defaut.ini

[SERVER]
SERVERNAME=Stationeers
GAMEPORT=27500
UPDATERPORT=27015
PASSWORD=
MAPNAME=BASE
DESCRIPTION=Stationeers
MAXPLAYER=30
[RCON]
RCONPASSWORD=stationeers

Remote Administrator

You can send commands on web browser.

Link : http://[dedicated server address]:[GamePort]

Dediserv1.png

Command Lists

Command Parameter Details
login password RCONPASSWORD is defined in default.ini. Default rcon password is stationeers.
save worldname Save world to basedirectory

When basedirectory is "C:\Profile\Player1",

>> save "Moon 2"

Save world to "C:\Profile\Player1\Moon 2"

>> save Moon

Save world to "C:\Profile\Player1\Moon"

shutdown [-m message] [-t timeout in seconds] 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 message Notice to all players. >> notice "Welcome to Stationeers!"
status Display game state and player lists.
ban steamId timeout Ban player for specific time. Timeout is double in hour. 0.5 is 30 minutes. 0 is infinite. >> ban 76561198299941358 0.5
unban steamId Remove player from the ban lists.
kick steamId Kick player from the current server.
clearall Delete disconnected players
hungerRate hunger rate 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. Dediserv2.png

Modding on Servers

Undocumented feature

ModConfig.xml

Place a ModConfig.xml in the serverfiles root (next to executable).


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