Jump to content

[HowTo] Run a Dedicated Server from your PC - without SteamCMD or the Dedicated Server Tool


Recommended Posts

Been at this for a few hours already. Tried all of the steps given in the thread, but was unsuccessful in hosting a dedicated server with caves. I somewhat pinpointed my problem, but I do not know what is causing it.

Spoiler

2017-05-20.png

When I run the batch file, "RunDSTServer", whether it is with admin permissions or not, I get the first cmd prompt shown. Then a few seconds past and I get a message saying that "Windows cannot find '?dontstarve_dedicated_server_nullrenderer.exe'". After which, a second cmd prompt appears behind the second one successfully running part of the batch code.

With the first cmd failing, but the second one successful, I ran the game, renewed the cluster token, and my friends, including myself, were able to join no problem other than how caves were inaccessible. The caves are there, but are blocked by vines with wood flooring meaning that caves are unavailable in the server at the moment.

What I highlighted in the image is what could potentially be the problem. If I get rid of the line that involves 'shard Caves', the batch file runs fine, but only one cmd will appear. This is as far as I could pinpoint the problem as I have already tried uninstalling the game and verifying the integrity of the game files.

Link to comment
Share on other sites

Hi @ThatOneJosh, welcome to the forums!

Your error message shows there's a special character before dontstarve_dedicated_server_nullrenderer.exe, so Windows is looking for a file with that character in the name. I just tried copying the script from the OP and running it and it still works for me (Windows 8.1). Try this instead:

cd /D "%~dp0"
dontstarve_dedicated_server_nullrenderer.exe -only_update_server_mods
start "My DST Server Master" dontstarve_dedicated_server_nullrenderer.exe -skip_update_server_mods -cluster Cluster_5 -shard Master
start "My DST Server Caves" dontstarve_dedicated_server_nullrenderer.exe -skip_update_server_mods -cluster Cluster_5 -shard Caves

(I removed a space before the filename in the last line. I also removed the -console parameter from the last two lines because they're no longer needed here, but that's completely unrelated to your issue. I've updated the OP to reflect this.)

If it still doesn't work, try replacing the last line with a copy of the second-to-last line and replace in it Master with Caves (twice). Let me know how it works out for you.

Link to comment
Share on other sites

@alainmcd, tried the modifications earlier and that seemed to fix the problem. I had to run it a second time though as the first attempt failed, but it was most likely due to having to many processes up at the time. I closed down everything I did not need to run the server and beyond the first attempt, every other attempt worked. Have not ran it to see if friends can join, but the caves are working as intended. I will inform you if I need additional help beyond this post.

Extremely helpful, thank you very much :encouragement:

Link to comment
Share on other sites

Hi @chrismus_time, welcome to the forums!

Make sure you are logging in, or else you won't be able to join. Also note that it might take a few seconds for your server to show up in the list, even if it's locally hosted. It should always be in LAN for you.

... If it really, really doesn't want to show up (I've never encountered this issue myself), you can always connect via the c_connect console command. Launch DST, log in, open the console, type the code below and press Enter:

c_connect"127.0.0.1"

If you have a password mypassword set, you'll need to specify it:

c_connect("127.0.0.1", nil, "mypassword")

Note that you have to add quotes to your password.

The second parameter is the port of the master server (server_port in your Master server's server.ini file), you won't need to specify it unless you're using something different from the default 10999.

Link to comment
Share on other sites

Hello! Running into some trouble with mods.

If I host directly from the game via the "Host Game" option, the mods are available and enabled and work fine in game. However, when I launch it as a dedicated server using the RunDSTServer.bat file, none of the mods work and the world appears as an unmodded server on the game list. Any idea why my mods aren't enabled in the dedicated server?

Link to comment
Share on other sites

Hi @mooncake, welcome to the forums!

I just tried it and it works correctly for me, mod info is displayed before joining. I'm not sure what could be going wrong for you, since the server reads the exact same files when hosting, whether it's dedicated or player-hosted. (In fact, it's the same process that hosts the game regardless, at least when you're hosting a world with caves, since the game launches the dedicated server application to actually run the server, though invisible to the player. That's why this works.) Maybe you created a server in a slot other than 5 and didn't change the script to reflect it?

And sorry for the late reply!

Link to comment
Share on other sites

Thanks, @alainmcd. Worked perfectly! Pretty straightforward and no problems. Always had problems trying the other two ways and was not much faithful to this method to work.

Had some doubts abt the first command line, but quick searched it and understood its meaning.

Link to comment
Share on other sites

Hi @CrazyDwarf, welcome around here!

The extra line at the beginning avoids an issue when executing the batch file with admin rights (since it sets the current location to C:\Windows\System32), otherwise it's unnecessary.

I'm glad to hear this helped you, thanks for letting me know!

Link to comment
Share on other sites

@alainmcd no worries, I appreciate your taking the time to look into it for me! I figured out how to get the mods working on my dedicated server. Had to go into steamapps\common\Don't Starve Together Dedicated Server\mods\dedicated_server_mods_setup.lua and call the ServerModSetup function for each mod. Not sure why dedicated server mods didn't work right outta the box for me, but I'm just happy they're working now! 

Link to comment
Share on other sites

extremely confused :/ im on mac and im lost where u want me to put those directions? you say put 

On 12/22/2016 at 9:41 AM, alainmcd said:

I'm not a Mac user, so your computer might burst into flames it might not work at all. Feedback would be very appreciated.

Copy and save the following text to "~/run_dst_servers.sh":


#!/bin/bash

install_dir="~/Library/Application Support/Steam/SteamApps/common/Don't Starve Together"
cluster_name="Cluster_5"

cd "$install_dir/bin"

run_shared=(./dontstarve_dedicated_server_nullrenderer)
run_shared+=(-cluster "$cluster_name")
run_shared+=(-monitor_parent_process $$)

"${run_shared[@]}" -shard Caves  | sed 's/^/Caves:  /' &
"${run_shared[@]}" -shard Master | sed 's/^/Master: /'

 

where do i find that?? where do i find ~/run_dst_servers.sh

Just a little unclear on how to execute the mac directions :/.. 

Link to comment
Share on other sites

First off, my dear @alainmcd.. this is the quickest and coolest way for a dedi server I've ever seen.. ty so much.. 

I do have some questions tho.. is the 5th cluster "blocked" by the dedi server as long as I continue to use it? 

how can I manage new mods after having created the server?

 

Link to comment
Share on other sites

@FreyaMaluk, glad to hear that.

Yes, if you follow this guide, you are using up your fifth slot. However:

  • You can manage your server (including mods) from the "host" menu through the game, or even host the game regularly**; in both cases I'd strongly suggest only doing so when your server isn't running, or you risk losing progress or even your whole world. OR
  • You can rename your cluster folder from Cluster_5 to whatever you want (and the script accordingly) so it no longer shows up in the "host" menu. You won't be able to manage your world from within the game, obviously. You can still change your mods via the modoverrides.lua file of your servers (Documents\Klei\DoNotStarveTogether\YOURCLUSTER\Master\modoverrides.lua and ...\YOURCLUSTER\Caves\modoverrides.lua).

Also, I think there's a mod that gives you more slots, and it should work nicely.

** I've seen an issue with expiring tokens when "mixed" hosting, specifically creating a world via the game, then hosting the world as a dedicated, then hosting it through the game, then hosting it again via dedicated server. Solution? Create a new cluster token and move it to your cluster folder (see last spoiler in the OP).

re: your questions in the other topic:

  • 1 and 2: You should be covered if you're creating a world with this method. If you're creating a new world with the "official" guide, you'd need to create a worldgenoverride.lua file for your master and one for your caves.
  • 3: I think remote console is enabled by default. If not, go to your cluster folder (Cluster_5 or whatever you chose if you renamed it), open cluster.ini, look for the line "[MISC]" (if there isn't, add it at the end of the file) and add "console_enabled = true" without the quotes. To give other people admin privileges, you have to create an adminlist.txt file in your cluster folder with a list of their KU's (or KO's if it's an offline server) separated by new lines. I imagine you can add comments somehow, but I haven't looked into it, I just copied the file and added the comments to the copied file. Tip: if you create your server for a group, you can allow the group moderators to automatically be admins in your server, regardless of whether the server is public or group-only.
  • 4: I don't know and I don't care. I never play on public servers and I only host private or group-only servers, so the ping not showing up doesn't bother me. Sorry!

Let me know if I'm not clear or detailed enough on anything, or if it's not working for you.

Link to comment
Share on other sites

@BigBBB, welcome! You have to close both windows with c_shutdown() - one is the overworld, the other is the caves.

@Zillvr, c_shutdown() takes an optional argument. If it's false, the server shuts down without saving; any other value triggers a shutdown saving the world. So c_shutdown(true) is valid and does the same as c_shutdown() (or c_shutdown(nil) or c_shutdown("give me all skins") for that matter).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...