Guides/Don’t Starve Together Dedicated Servers

具体教程 http://dontstarve.wikia.com/wiki/Guides/Don%E2%80%99t_Starve_Together_Dedicated_Servers

sudo dpkg --add-architecture i386 # If running a 64bit OS
sudo apt-get update
sudo apt-get install lib32gcc1    # If running a 64bit OS
sudo apt-get install lib32stdc++6 # If running a 64bit OS
sudo apt-get install libgcc1      # If running a 32bit OS
sudo apt-get install libcurl4-gnutls-dev:i386
sudo useradd -m steam
chmod a+rw `tty`  # Note those are backticks, not single quotes
sudo su - steam
mkdir ~/steamcmd
cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
./steamcmd.sh
login anonymous
force_install_dir /home/steam/steamapps/DST (or whatever absolute path is wanted)
app_update 343050 validate
quit

创建你服务器的地上世界目录和地下世界目录

mkdir -p ~/.klei/DoNotStarveTogether/Cluster_1/Master
mkdir -p ~/.klei/DoNotStarveTogether/Cluster_1/Caves

添加服务器的令牌

echo '令牌' > ~/.klei/DoNotStarveTogether/Cluster_1/cluster_token.txt

游戏配置

vim ~/.klei/DoNotStarveTogether/Cluster_1/cluster.ini
[GAMEPLAY]
game_mode = survival
max_players = 6
pvp = false
pause_when_empty = true

[NETWORK]
cluster_description = My server!
cluster_name = Super Server
cluster_intention = cooperative
cluster_password =

[MISC]
console_enabled = true

[SHARD]
shard_enabled = true
bind_ip = 127.0.0.1
master_ip = 127.0.0.1
master_port = 10889
cluster_key = supersecretkey

两个世界的各自配置
~/.klei/DoNotStarveTogether/Cluster_1/Master/server.ini

[NETWORK]
server_port = 11000


[SHARD]
is_master = true


[STEAM]
master_server_port = 27018
authentication_port = 8768

~/.klei/DoNotStarveTogether/Cluster_1/Caves/server.ini

[NETWORK]
server_port = 11001


[SHARD]
is_master = false
name = Caves


[STEAM]
master_server_port = 27019
authentication_port = 8769

创建你的洞穴worldgenoverride.lua

vim ~/.klei/DoNotStarveTogether/Cluster_1/Caves/worldgenoverride.lua
return {
    override_enabled = true,
    preset = "DST_CAVE",
}

启动

cd /home/steam/steamapps/DST/bin/
screen -S "DST Server" ./dontstarve_dedicated_server_nullrenderer

Create a shell script to start screen and run the DST server. Once the shell script is running GSAd can press and release CTRL+A then press D and it will return them to their shell and continue running DST.

vim start_dst.sh
#!/bin/sh
cd /home/steam/steamapps/DST/bin
/usr/bin/screen -S "DST" /bin/sh -c './dontstarve_dedicated_server_nullrenderer -console'

sudo su steam
./start_dst.sh

发表评论