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.

Izerix

Having more than one dedicated server [Mac OS X]

Recommended Posts

Izerix    0

Hi, I wanted to know if I could have two dedicated servers but separately. I don't want to run two dedicated servers at once, I want to choose which one I want to boot, cause I've been playing with my friends and we play on two servers but I always need to copy and paste files from Cluster_1 to MyDediServer and then when I want to play on my other server i need to copy Cluster_2. Can i make this proces a little bit easier for myself? Also I'm a Mac user. 

Share this post


Link to post
Share on other sites
Daniel86268    369

Just make two different startup scripts pointing to two different save locations.

Then you can just start the appropriate script for whichever server you want. Ofc you can do as many of these as you like.

Kinda like this:

Startup script 1:

Spoiler

#!/bin/bash

steamcmd_dir="$HOME/steamcmd"
install_dir="$HOME/dontstarvetogether_dedicated_server"
cluster_name="MyDediServer"
dontstarve_dir="$HOME/Documents/Klei/DoNotStarveTogether"

function fail()
{
        echo Error: "$@" >&2
        exit 1
}

function check_for_file()
{
    if [ ! -e "$1" ]; then
            fail "Missing file: $1"
    fi
}

cd "$steamcmd_dir" || fail "Missing $steamcmd_dir directory!"

check_for_file "steamcmd.sh"
check_for_file "$dontstarve_dir/$cluster_name/cluster.ini"
check_for_file "$dontstarve_dir/$cluster_name/cluster_token.txt"
check_for_file "$dontstarve_dir/$cluster_name/Master/server.ini"
check_for_file "$dontstarve_dir/$cluster_name/Caves/server.ini"

check_for_file "$install_dir/dontstarve_dedicated_server_nullrenderer.app/Contents/MacOS/"

cd "$install_dir/dontstarve_dedicated_server_nullrenderer.app/Contents/MacOS/" || fail

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

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

 

 

and startup script 2:

Spoiler

#!/bin/bash

steamcmd_dir="$HOME/steamcmd"
install_dir="$HOME/dontstarvetogether_dedicated_server"
cluster_name="MyDediServer2"
dontstarve_dir="$HOME/Documents/Klei/DoNotStarveTogether"

function fail()
{
        echo Error: "$@" >&2
        exit 1
}

function check_for_file()
{
    if [ ! -e "$1" ]; then
            fail "Missing file: $1"
    fi
}

cd "$steamcmd_dir" || fail "Missing $steamcmd_dir directory!"

check_for_file "steamcmd.sh"
check_for_file "$dontstarve_dir/$cluster_name/cluster.ini"
check_for_file "$dontstarve_dir/$cluster_name/cluster_token.txt"
check_for_file "$dontstarve_dir/$cluster_name/Master/server.ini"
check_for_file "$dontstarve_dir/$cluster_name/Caves/server.ini"

check_for_file "$install_dir/dontstarve_dedicated_server_nullrenderer.app/Contents/MacOS/"

cd "$install_dir/dontstarve_dedicated_server_nullrenderer.app/Contents/MacOS/" || fail

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

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

 

Share this post


Link to post
Share on other sites
Izerix    0

Thank you very very much, it was easier than I thought and it works perfectly for me!

 

Share this post


Link to post
Share on other sites