Jump to content

Dedicated Server Quick Setup Guide - Linux


Recommended Posts

Quote

Caves:  [00:00:02]: OnFilesLoaded()
Caves:  [00:00:02]: OnUpdatePurchaseStateComplete
Caves:  [00:00:02]: Klump load on boot started.
Caves:  [00:00:02]: Klump files loaded:         0
Caves:  [00:00:02]:     Load FE
Master: [00:00:03]:     Load FE
Master: [00:00:03]:     Load FE: done
Caves:  [00:00:03]:     Load FE: done
Master: [00:00:03]: Check for write access: TRUE
Caves:  [00:00:03]: Check for write access: TRUE
Caves:  [00:00:03]: Check for read access: TRUE
Caves:  [00:00:03]: Available disk space for save files: 72324 MB
Master: [00:00:03]: Check for read access: TRUE
Master: [00:00:03]: Available disk space for save files: 72324 MB
Caves:  [00:00:03]: ModIndex: Load sequence finished successfully.
Caves:  [00:00:03]: Reset() returning
Master: [00:00:03]: ModIndex: Load sequence finished successfully.
Master: [00:00:03]: Reset() returning
Caves:  [00:00:03]: THREAD - started 'FilesExistAsyncThread' (4046412608)
Caves:  [00:00:03]: FilesExistAsyncThread started (17823 files)...
Master: [00:00:03]: THREAD - started 'FilesExistAsyncThread' (4046744384)
Master: [00:00:03]: FilesExistAsyncThread started (17823 files)...
Master: [00:00:04]: [200] Account Failed (6): "E_INVALID_TOKEN"
Master: [00:00:04]: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Master: [00:00:04]: !!!! Your Server Will Not Start !!!!
Master: [00:00:04]: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Master: [00:00:04]: No auth token could be found.
Master: [00:00:04]: Please visit https://accounts.klei.com/account/game/servers?game=DontStarveTogether
Master: [00:00:04]: to generate server configuration files
Master: [00:00:04]:
Master: [00:00:04]: Alternatively generate a cluster_token you can
Master: [00:00:04]: open the console from a logged-in game
Master: [00:00:04]: client with the tilda key (~ / ù) and type:
Master: [00:00:04]: TheNet:GenerateClusterToken()
Master: [00:00:04]: This will create 'cluster_token.txt' in
Master: [00:00:04]: your client settings directory. Copy this
Master: [00:00:04]: into your cluster settings directory.
Master: [00:00:04]: [Connect] PendingConnection::Reset(true)
Caves:  [00:00:04]: [200] Account Failed (6): "E_INVALID_TOKEN"
Caves:  [00:00:04]: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Caves:  [00:00:04]: !!!! Your Server Will Not Start !!!!
Caves:  [00:00:04]: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Caves:  [00:00:04]: No auth token could be found.
Caves:  [00:00:04]: Please visit https://accounts.klei.com/account/game/servers?game=DontStarveTogether
Caves:  [00:00:04]: to generate server configuration files
Caves:  [00:00:04]:
Caves:  [00:00:04]: Alternatively generate a cluster_token you can
Caves:  [00:00:04]: open the console from a logged-in game
Caves:  [00:00:04]: client with the tilda key (~ / ù) and type:
Caves:  [00:00:04]: TheNet:GenerateClusterToken()
Caves:  [00:00:04]: This will create 'cluster_token.txt' in
Caves:  [00:00:04]: your client settings directory. Copy this
Caves:  [00:00:04]: into your cluster settings directory.
Caves:  [00:00:04]: [Connect] PendingConnection::Reset(true)
Master: [00:00:04]: ... FilesExistAsyncThread complete
Caves:  [00:00:04]: ... FilesExistAsyncThread complete
 

 

Why this doesn't work? I do everything how it should be done.

Link to comment
Share on other sites

On 7/18/2021 at 3:44 AM, Cyborg said:

Why this doesn't work?

 

On 7/18/2021 at 3:44 AM, Cyborg said:

Master: [00:00:04]: [200] Account Failed (6): "E_INVALID_TOKEN"
Master: [00:00:04]: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Master: [00:00:04]: !!!! Your Server Will Not Start !!!!
Master: [00:00:04]: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Master: [00:00:04]: No auth token could be found.

 

Edited by myxal
Link to comment
Share on other sites

On 10/16/2021 at 1:43 AM, crazypenguin011 said:

So I was able to set up the server, but I cannot change the settings, like server name, password, etc. I tried changing the cluster.ini file but that does nothing. I was wondering if someone could help me resolve this issue

My guess is the path of the file you're editing and the one that's s being executed don't match. Check and/or post logs.

Link to comment
Share on other sites

On 11/9/2020 at 6:49 AM, myxal said:

I don't use Klei's script so I'm not even sure how it's supposed to work.

How do you do?

I have done using docker image, but I'm thinking if this can make it slower or worse, idk.

Edited by Otomay
Link to comment
Share on other sites

I could not for the life of me get this to work.

I was pulling my hair out for 2 days straight before I finally realised what the problem was - permissions.

I needed to give permissions to my steam user first, running the command to start the server from the root user did not work, even when I edited the .sh file to have the correct file path regardless of who ran it.

This required me to (from the root user) enter:

usermod -aG sudo steam

to give the username 'steam' sudo privileges. This did not work the first time, and required restarting and re-running the command a couple times before it actually worked.

I then had to change the permissions of the hidden directory that the server config files are in (the /.klei/ directory). To do this I went as the root user to the file:

cd /home/steam/

and edited the permissions to allow any user on my computer to read/write to the directory:

chmod ugo+rwx /.klei/

From there the server would work, but only when running the startserver.sh from the steam user.

 

I hope someone out there finds this useful.

  • Big Ups 1
Link to comment
Share on other sites

When running the server script I always get the errors

Master: [00:00:10]: [CRITICAL] Failed to save file: /home/steam/.klei//DoNotStarveTogether/MyDediServer/Master/save/shardindex
Master: [00:00:10]: [CRITICAL] Fingerprint:(VERY LONG STRING).

a few times for both Master and Cave shards before they ultimately shutdown after the messages:

Master: [00:00:10]: Check for write access: FALSE
Master: [00:00:10]: Reset() returning
Master: [00:00:10]: THREAD - started 'WorldSim' (140422007482048)
Master: [00:00:10]: WorldSim::SimThread::Main()
Master: [00:00:10]: DoLuaFile scripts/worldgen_main.lua
Master: [00:00:10]: DoLuaFile loading buffer scripts/worldgen_main.lua
Caves:  [00:00:10]: DLC enabled :       false
Master: [00:00:10]: DLC enabled :       false
src/tier1/fileio.cpp (5086) : m_vecRegisteredWriters.Count() == 0
src/tier1/fileio.cpp (5086) : m_vecRegisteredWriters.Count() == 0
Caves:  src/tier1/fileio.cpp (5086) : m_vecRegisteredWriters.Count() == 0
Master: src/tier1/fileio.cpp (5086) : m_vecRegisteredWriters.Count() == 0

This happens in both my Debian and Arch Linux installations...

I noticed the program is trying to save the file to a path with a double slashes (.../.klei//DoNotStarveTogether/...) but I don't know how I would change that.

Any clue as to what may be causing the problem?

Edited by Hatty DeWitt
Link to comment
Share on other sites

On 2/17/2016 at 4:52 AM, 255 said:

This guide will help you set up a dedicated server on an Ubuntu machine (32 or 64-bit)

4. Create the script that will run the servers.

  Hide contents

Download this shell script and move it to ~/run_dedicated_servers.sh.

 

 

I have optimized the following code by adding automatic mod file rewriting, so that additional configuration is not required for dedicated_server_mods_setup.lua in the configuration file.

 

#Check mod file
check_for_file "$dontstarve_dir/$cluster_name/Master/modoverrides.lua"

#rewirte mod file in dedicated_server_mods_setup.lua
cd "$dontstarve_dir/$cluster_name/Master" || fail 
grep -o '\-[0-9]*"' modoverrides.lua | sed 's/^\-/ServerModSetup("/g; s/$/)/g' > "$install_dir/mods/dedicated_server_mods_setup.lua"

 

 

 

Link to comment
Share on other sites

On 8/7/2023 at 5:21 PM, AllanChao said:

I have optimized the following code by adding automatic mod file rewriting, so that additional configuration is not required for dedicated_server_mods_setup.lua in the configuration file.

#Check mod file
check_for_file "$dontstarve_dir/$cluster_name/Master/modoverrides.lua"

#rewirte mod file in dedicated_server_mods_setup.lua
cd "$dontstarve_dir/$cluster_name/Master" || fail 
grep -o '\-[0-9]*"' modoverrides.lua | sed 's/^\-/ServerModSetup("/g; s/$/)/g' > "$install_dir/mods/dedicated_server_mods_setup.lua"

Thanks for the script, very useful for an existing cluster ;)

Link to comment
Share on other sites

I was able to configure everything, that's what I did to make the mods work
1. I created the folder "mods" in the folder "MyDediServer" in it I placed 2 files "dedicated_server_mods_setup.lua" and "modsettings.lua" (you should know what should be written in them)
2. In the folder "Master" and "Caves" placed the file "mods overrides.lua"
3. D file "run_dedicated_servers.sh " added 2 lines
check_for_file "$dontstarve_dir/$cluster_name/Master/modoverrides.lua"
check_for_file "$dontstarve_dir/$cluster_name/Caves/modoverrides.lua"
These 2 lines should be placed under the line (check_for_file "steamcmd.sh ")

P.s. English is not my native language, so if I explained it badly, I'm sorry

Edited by kriatit
Link to comment
Share on other sites

I'm having trouble with dedicated server on linux setup with mods. I already added the modoverrides.lua with mod setting enable true to both Master and Caves folder. Also added ServerModSetup("2003549262") to the dedicated_server_mods_setup.lua. Then I ran the run_dedicated_servers.sh. The server was online but no mod added. Please help!

Link to comment
Share on other sites

I follow this guide, and the last version my dedicated server run normally, but this version I got problem with running my server, it just stay in here , I use none mod in this cluster

image.png.97f28a5683916621f3ecb0776cf3aa9c.png

 

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