Jump to content
Sign in to follow this  
RedEagle_P1.

Ylands Dedicated Server Info

Recommended Posts

Since Ylands Dedicated Servers are no longer a thing, I thought I would post this to share useful insight into how they work. Remember you cannot run these any more, you have to do so from the in-game menu. 

 

--Ylands Dedicated Server Installation and Operation Manual--

This document contains information on how to install Ylands Dedicated Server (DS) distribution and launch DS instances.

(0.1) Assumed User Expertise Level
This document assumes user has basic experience working with windows commandline (cmd).

(0.2) System requirements
DS will run on any system compatible with Unity Win64 build. That is Windows 7 64-bit or older or equivalent Windows Server versions.
DS does not require GPU or any version of DirectX installed to run.
DS is quite CPU intensive, at least 2 ~3GHz logical cores per DS instance are recommended.

(0.3) Common instructions
If there is a <something> fragment in text, the <something> needs to be replaced with actual value first (replace the fragment including the surrounding less-than/greater-than symbols). 
Explanation of what the fragment needs to be substituted for will always be located below the fragment occurance.

If a path (D:\Some Directory With Spaces) contains spaces, you will need to surround the path string in "". Try to avoid using paths with spaces.

(1) Installing Ylands Dedicated Server (DS) distribution

Download DS distribution from http://data.bistudio.com/ylands/YlandsDS_063v2.zip

Extract the contents into <install_dir>

<install_dir> - path to installation directory of your choosing

Note2: If a new version of DS is out, you will need to redownload the distribution.

(1.1) Example:
I will use D:\yds\Ylands as <install_dir> (the directory where the DS distribution will be stored), I have downloaded the file so and extracted the contents there, so the directory structure is
D:\yds\Ylands
|-YlandsDs.exe
|-YlandsDs_Data
|-...

(2) Managing a DS instance
The work instance is used to refer to one DS process. If you want to host multiple different games (worlds) at the same time, you will need a separate DS instance for each.

(2.1) DS instance directory
Each DS instance requires its own private working directory, there are no requirements on the directory other than the DS process must have access to it.
Your instance directory should be different from your installation directory (<install_dir> in step 1.2), otherwise you will not be able to run multiple instances at the same time.

Example:

D:\yds\YlandsDsInstances\1
D:\yds\YlandsDsInstances\2

(2.2) Configuration
Each DS instance is driven by two configuration files: DsConfig.json and Ylands.ini, both of which must be located in the instance directory (2.1) of the instance.
Note: when creating the files, be sure to actually create a file with the correct extension, if extensions are hidden in explorer, it is easy to mistake Ylands.ini for Ylands.ini.txt.

So create separare DsConfig.json and Ylands.ini in each instace directory

(2.2.1) DsConfig.json
DsConfig.json is responsible for specifying parameters of the hosted session. Example DsConfig.json has following structure:

{
  "SessionDataType" : "BuiltIn",
  "SessionData" : "Creative",
  "nMaxPlayers" : 4,
  "Name" : "My Mp Session"
}

(2.2.1.1) Overview of DsConfig.json fields
[] denotes a field type, if the type is string, the value needs to be surrounded in "", otherwise it is written as is.

-required fields

[string] "SessionDataType": Specifies where to get the data for the hosted session. Determines the contents of SessionData. Allowed values are:
- "YlandFile" - Path to a savegame to host. Absolute or relative to the config file.
- "GameFile" - Path to a game (scenario) file from which a fresh savegame will be created and hosted. Path can be absolute or relative to the config file.
- "BuiltIn" - Identifier of a built-in game type from which a fresh savegame will be created and hosted. "Explore" or "Creative"

[string] "SessionData": Depends on SessionDataType

-optional fields
[int] "nMaxPlayers" : Maximum number of players that can connect to the session at a time (2-10)
[string] "Name" : Name of the session visible in lobby
[string] "Password" : Password for the session
[string] "SavePath" : Path to the file where the world for the session will be saved. Is SessionSave.ylandsgame in the instance directory by default.

(2.2.2) Ylands.ini
Ylands.ini contains general configuration of the server process. Example of Ylands.ini:

i NetHostPort=2500
s DsBohemiaLoginToken=<bohemia_token>

(2.2.2.1) Overview of parameters specifiable through Ylands.ini:
-required
s DsBohemiaLoginToken=Private identifier of your DS instance, see (3) on how to get one. Make sure you create the token and specify it in the .ini (by substituting it for <bohemia_token>) before running the instance.

-optional
i NetHostPort=If specified, forces the instance to use ports in range starting with NetHostPort value (reserve 10 ports per instance). If not specified, selecting ports to use will be left to underlying OS socket implementation.
b DsAutoLaunchMonitor=1 If true, will lauch monitor console window alongside the server. (see 2.4)
 
(2.3) Launching DS instance
To start a dedicated server instance:

Create an instance directory for the instance (2.1) and prepare DsConfig.json (2.2.1) and Ylands.ini (2.2.2) configuration files in that directory.

Start windows command line

Switch to the instance working directory 
-first switch to a correct drive letter by executing: ? (to switch to D drive for example)
-then to move to the correct directory by execute: cd "path to the instance directory" (i.e D:\yds\YlandsDsInstances\1)

Run: 
start "" "<install_dir>\YlandsDs.exe" -logfile "%CD%\log.txt" -nographics -batchmode

<install_dir>: diretory where the DS distribution is installed (1)

-launching the DS instance will start to generate 2 logs in the instance working directory: log.txt and log_clean.txt. 
-some time after launch - typically a minute, it may be longer if you are generating a new world instead of loading a save, the DS MP session will be visible in MP lobby. 
-if the DS instance does not seem to launch correctly, consult logs
-repeat for all instances

(2.3.1) Example:
My instance directory will be D:\yds\YlandsDsInstances\1, I have created the directory and added Ylands.ini and DsConfig.json as per instructions above.
My installation directory is D:\yds\Ylands from example (1.2.1)

[open command line]
>D:
>cd "D:\yds\YlandsDsInstances\1"
>start "" "D:\yds\Ylands\YlandsDs.exe" -logfile "%CD%\log.txt" -nographics -batchmode

(2.4) Managing the instance

(2.4.1) Via monitor console

If you specify the 
b DsAutoLaunchMonitor=1 monitor parameter in the instance Ylands.ini, the monitor console window will appear after the server instance initializes.

The monitor console offers several commands (type 'help' for full list)

tail: open/close window displaying the server log in the real time
exec: execute a server side console command (as if you were a host without a character)
shutdown/kill: terminate the server process

(2.4.1) Manually
log_clean.txt can be tailed as any normal text file (uses \n line endings) to observe what the DS instance is doing

Use Task Manager to kill DS instances if hanging. If you have multiple instances running, you can identify the correct one by showing the 'Command line' column under 'Processes' tab (right click existing column header to change which columns are displayed).

(3) Obtaining DS login token 
For each individual DS instance you want to run, you will need to create a separate login token, to create one:

Go to https://accounts.bistudio.com/profile/server-management and create a new login token

Note: You will be prompted to login with an account that owns ylands (login via steam or bohemia credentials), if logging in does not redirect you to the correct page, simply enter the address again

Note2: Currently a single account is limited to 3 login tokens (Each concurrently running DS instance needs its own login token)
 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×