Linux搭建Steam饥荒服务器教程 — Linux GSM方式

本文指导如何在Linux服务器上快速安装和配置LinuxGSM,搭建饥荒游戏的主世界和洞穴世界服务器,包括依赖安装、LinuxGSM安装、配置和启动流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

LinuxGSM 是用于快速、简单地部署和管理 Linux 专用游戏服务器的命令行工具。
官网地址:https://linuxgsm.com
饥荒服务器搭建文档:https://linuxgsm.com/servers/dstserver

1. 服务器

准备一台1核2G的腾讯云服务器or阿里云服务器,我这使用的centos系统,所以下面教程内容全部以该系统为主。

2. LinuxGSM依赖安装

yum install epel-release

yum install curl wget tar bzip2 gzip unzip python3 binutils bc jq tmux glibc.i686 libstdc++ libstdc++.i686 libcurl.i686

3. LinuxGSM安装

3.1 添加用户

# 添加用户
adduser dstserver

# 设置密码
passwd dstserver

# 切换到该用户
su dstserver

3.2 下载LinuxGSM

wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh dstserver

如果出现了github访问超时,可以按照这个文章方式调整,地址:https://blog.csdn.net/unstorm/article/details/121532868

3.3 初始化

./dstserver install

3.4 添加存档

找到本地的Cluster_1存档,将里面内容,放到云服务器~/.klei/DoNotStarveTogether/Cluster_1 位置(可以使用ftp工具上传文件)

配置token

进入这个网址配置token,https://accounts.klei.com/account/game/servers?game=DontStarveTogether
在这里插入图片描述
名字随便起,然后点击添加新服务器就行。
拿到token后,将内容复制到~/.klei/DoNotStarveTogether/Cluster_1/cluster_token.txt

修改LinuxGSM配置

cd ~/lgsm/config-lgsm/dstserver

_default.cfg中的内容复制出来,粘贴到dstserver.cfg中,同时新建一个dstserver_caves.cfg文件,内容一并复制过去。

dstserver.cfg 修改如下:

sharding="true"
master="true"
shard="Master"
cluster="Cluster_1"
cave="false"

dstserver_caves.cfg 修改如下:

sharding="false"
master="false"
shard="Caves"
cluster="Cluster_1"
cave="true"

修改mods:

修改云服务器中dedicated_server_mods_setup.lua文件

vim ~/serverfiles/mods/dedicated_server_mods_setup.lua

按照下方方式修改

--There are two functions that will install mods, ServerModSetup and ServerModCollectionSetup. Put the calls to the functions in this file and they will be executed on boot.

--ServerModSetup takes a string of a specific mod's Workshop id. It will download and install the mod to your mod directory on boot.
	--The Workshop id can be found at the end of the url to the mod's Workshop page.
	--Example: http://steamcommunity.com/sharedfiles/filedetails/?id=350811795
	--ServerModSetup("350811795")

--ServerModCollectionSetup takes a string of a specific mod's Workshop id. It will download all the mods in the collection and install them to the mod directory on boot.
	--The Workshop id can be found at the end of the url to the collection's Workshop page.
	--Example: http://steamcommunity.com/sharedfiles/filedetails/?id=379114180
	--ServerModCollectionSetup("379114180")

ServerModSetup("345692228")
ServerModSetup("347079953")
ServerModSetup("这块填你的mod ID")

mod ID可以在Cluster_1/Master/modoverrides.lua文件中查看,如图:
在这里插入图片描述

配置启动命令

cp ~/dstserver ~/dstserver_caves

启动

启动主世界

cd ~
./dstserver start

等待启动后执行

./dstserver console

查看主服务控制台,查看日志。
看到启动成功日志后证明专用服务器已经搭建成功了,然后按照Ctrl + B再按D的方式安全退出控制台。
继续启动洞穴服务

cd ~
./dstserver_caves start

继续按照上方查看控制台的方式看两个世界是否连接成功。等待连接成功后,两个服务就都起好了~

### 搭建 Linux 下 Don't Starave Together (DST) 服务器 #### 准备工作 为了成功搭建 DST 服务器,在开始之前需确认已具备如下条件: - 已经拥有一台可以访问互联网并能正常工作的 Linux 主机。 - 安装了必要的依赖库,这可以通过执行命令 `yum install glibc.i686 libstdc++.i686 screen libcurl.i686` 来完成[^3]。 #### 获取 SteamCMD 并设置游戏文件夹 通过 wget 命令获取 Steam 的命令行工具——SteamCMD。此操作允许管理员无需图形界面即可更新或安装由 Steam 提供的游戏和服务端程序。 ```bash wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz tar -xvzf steamcmd_linux.tar.gz ``` 创建用于存储 DST 游戏数据的目录结构,并切换至该路径下准备后续的操作。 ```bash mkdir DSTserver && cd DSTserver/ ``` 启动 SteamCMD 进行登录以及指定安装位置和验证应用完整性。 ```bash ./steamcmd.sh +login anonymous +force_install_dir ./dst_dedicated_server +app_update 343050 validate +quit ``` 上述指令中的 `+login anonymous` 表明匿名登录;而 `+force_install_dir` 后面跟的是自定义的服务端存放地址;最后部分则是指定了要下载的应用 ID 号码加上校验选项来确保所有文件无误后再退出程序[^1]。 #### 配置服务器参数 编辑集群配置文件 Cluster.ini 和其他相关设定(如洞穴世界、主世界的 settings.lua),这些文件位于刚才创建的数据文件夹内。根据个人喜好调整难度等级、季节长度等细节以满足玩家群体的需求。 对于希望实现自动化管理的朋友来说,编写批处理脚本来简化日常维护工作也是不错的选择之一。例如下面这段简单的 Bash 脚本可用于一键开服: ```bash #!/bin/bash screen -S dst-server -d -m /path/to/dst/bin64/dontstarve_dedicated_server_nullrenderer \ -console -cluster MyDediServer -shard Master ``` 请注意替换 `/path/to/dst/bin64/dontstarve_dedicated_server_nullrenderer` 成实际可执行文件的位置,同时也要修改 `-cluster` 参数后的名称为你自己的集群名。 #### 解决常见错误提示 如果遇到像 "PlayerHistory could not load player_history" 类似的警告信息,则不必过分担心,因为这只是表明某些功能暂时不可用而已,并不会影响到整体游玩体验[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

unstorm

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值