防火墙开放
#服务器_master CentOS8
firewall-cmd --zone=public --add-port=10889/tcp --permanent
firewall-cmd --reload
#服务器_cave Ubuntu16.04
iptables -I INPUT -p tcp --dport 10889 -j ACCEPT
iptables -I INPUT -p tcp --dport 11000 -j ACCEPT
iptables-save
#持久配置防火墙
apt-get install iptables-persistent
netfilter-persistent save
netfilter-persistent reload
服务端程序包下载
#安装steamcmd
#服务器_master
yum -y install glibc.i686 libstdc++.i686
mkdir steamcmd
curl -sqL https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar zxvf -
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum install glibc.i686 libstdc++.i686 libcurl4-gnutls-dev.i686 libcurl.i686
ln -s /usr/lib/libcurl.so.4 /data/dontstarvetogether_server/bin/lib32/libcurl-gnutls.so.4
#服务器_cave
apt install steamcmd -y
#匿名登陆
steamcmd
login anonymous
#login example_user
force_install_dir /data/dontstarvetogether_server
app_update 343050 validate
quit
#apt-get install libstdc++6 libgcc1 libcurl4-gnutls-dev
apt-get install libcurl4-gnutls-dev:i386
配置服务
cd /data/dontstarvetogether_server/bin
./dontstarve_dedicated_server_nullrenderer
#从klei获取key等信息
#https://accounts.klei.com/account/info
#启动测试
nohup ./dontstarve_dedicated_server_nullrenderer -shard Master &
nohup ./dontstarve_dedicated_server_nullrenderer -shard Caves &
配置文件示例
[GAMEPLAY]
game_mode = endless # 游戏模式
max_players = 8 # 最大玩家人数
pvp = false # pvp开关
pause_when_empty = true # 没人在线时暂停世界
vote_enabled = true # 投票开关(投票T人,投票重置世界)
[NETWORK]
lan_only_cluster = false # 只允许本地局域网加入开关
offline_cluster = false # 离线游戏
cluster_description = '0.0' # 服务器简介
cluster_name = 'My World' # 服务器名称
cluster_intention = cooperative # 服务器类型
cluster_password = 123456 # 服务器密码
tick_rate = 30 # 帧刷新频率
connection_timeout = 120000 # 掉线等待时间,单位毫秒
whitelist_slots = 1 # 白名单个数
autosaver_enabled = true # 天亮自动保存
cluster_language = zh
[MISC]
console_enable = true # 是否开启控制台
max_snapshots = 6 # 最大快照
[SHARD]
shard_enabled = true # 是否多世界
bind_ip = 127.0.0.1 # 主从世界在同一台服务器上(默认)
master_ip = 127.0.0.1 # 主从世界在同一台服务器上(默认)
master_port = 10889 # 端口
cluster_key = rain # 主从世界连接密码
[STEAM]
steam_group_only = false # 是否只允许同steam组的人加入
steam_group_id = 2222222 # steam组ID
steam_group_admins = true # steam组员自动成为管理员
双服务器部署配置
#master
#cluster.ini
[GAMEPLAY]
#game_mode = survival
game_mode = endless
max_players = 16
pvp = false
pause_when_empty = true
[NETWORK]
cluster_description = 有兴趣一起玩的话可以加QQ群:xxxx
cluster_name = xxxxx
cluster_intention = cooperative
cluster_password =
cluster_language = zh
[MISC]
console_enabled = true
[SHARD]
shard_enabled = true
bind_ip = 0.0.0.0
master_ip = 127.0.0.1
master_port = 10889
cluster_key = supersecretkey
#----------------------------------------
#Master/server.ini
[NETWORK]
server_port = 11000
[SHARD]
is_master = true
[STEAM]
master_server_port = 27018
authentication_port = 8768
[ACCOUNT]
encode_user_path = true
--------------------------------------------------------------------------
#cave
#cluster.ini
[GAMEPLAY]
game_mode = survival
max_players = 16
pvp = false
pause_when_empty = true
[NETWORK]
cluster_description = 有兴趣一起玩的话可以加QQ群:xxxxx
cluster_name = xxxxxx
cluster_intention = cooperative
cluster_password =
[MISC]
console_enabled = true
[SHARD]
shard_enabled = true
bind_ip = 0.0.0.0
master_ip = Master服务器地址
master_port = 10889
cluster_key = supersecretkey
#----------------------------------------
#Cave/server.ini
[NETWORK]
server_port = 11001
[SHARD]
is_master = false
name = Caves
id = 2266424570
[STEAM]
master_server_port = 27019
authentication_port = 8769
[ACCOUNT]
encode_user_path = true
文章评论