Sign in to follow this  
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    271
Posted (edited)

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: /'

 

Edited by Daniel86268
  • Like 2

Share this post


Link to post
Share on other sites
Izerix    0
Posted (edited)

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

 

Edited by Izerix

Share this post


Link to post
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

Sign in to follow this