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

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

unstorm

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

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

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

打赏作者

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

抵扣说明:

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

余额充值