Ubuntu 部署饥荒联机版服务器 Linux DST_Dedicate_Server

0. 文件夹

- ~
|- ~/steamcmd # 装的是steamcmd_linux.tar.gz以及其解压出来的东西
|- ~/DST # 装的是DST服务器可执行文件、世界存档、世界模板
|- ~/DST/start-server.sh # 这个对应是1.start_server.sh的内容,负责启动服务器
|- ~/DST/server # 这个是steam下载的 dedicated_DST_Server
|- ~/DST/server/mods # 这个是要下载的mod,以及mod的保存位置,因为steam更新游戏会导致server文件夹重置,我没有用该文件夹,里面的dedicated_server_mods_setup.lua 就是2.dedicated_server_mods_setup.lua的内容
|- ~/DST/template/ # 这个是世界的模板,当初生成世界以及mod应用总是失败,故搞了个世界模板,当世界生成和mod应用失败但是找不到原因,就直接干了世界,重新生成
|- ~/DST/template/dedicated_server_mods_setup.lua # 内容同样是2.dedicated_server_mods_setup.lua,这个文件的内容也是 ~/DST/server/mods/dedicated_server_mods_setup.lua的内容,我做了备份,但是指定使用该文件下载mod
|- ~/DST/template/content/322330 这个文件夹是mod存放位置,可以在windows开一个世界,测试mod正常无冲突,然后把windows的mod复制到该文件夹内。服务器下载mod也是通过创意工坊,大概率会因为网络问题下载不下来,梯子我试了也不太好使,可能我梯子不行
|- ~/DST/template/World 这个文件夹是 Keli Account - 游戏服务器 按步骤填写后下载得到的压缩文件,解压后得到的内容 Cave、Master、cluster.ini、cluster-token.ini(如果需要在线游玩就重要,科雷会验证该文件内容是否通过,在线游玩会有礼包)
|- ~/DST/game 这个文件夹是存档文件的位置
|- ~/DST/game/Agreements 这个文件夹是同意的协议
|- ~/DST/game/DoNotStarveTogether 这个文件夹是世界存档,里面可能有多个世界存档,一个文件夹就是一个存档
|- ~/DST/game/DoNotStarveTogether/World 这个文件夹是名字叫World的世界的存档,就是~/DST/template/World里面的复制进去的(游戏开始后不要复制,不然会覆盖存档),可以在每次玩完游戏后,把这个文件压缩一份,当作游戏备份,可以回档。有次所有人物都死了,然后没有人发现,让世界重置了
|- ~/DST/game/DoNotStarveTogether/World/Master 这个是地上世界的内容和配置
|- ~/DST/game/DoNotStarveTogether/World/Master/modoverrides.lua 这个是地上世界的mod和配置,一般和地下(洞穴)的mod配置保持一致,内容见4. modoverrides.lua
|- ~/DST/game/DoNotStarveTogether/World/Caves 这个是洞穴世界的内容和配置
|- ~/DST/game/DoNotStarveTogether/World/Caves/modoverrides.lua 这个是洞穴世界的mod和配置,一般和地上(主世界)的mod配置保持一致,内容见4. modoverrides.lua

文件夹图片,见末尾 4. modoverrides.lua

1. start-server.sh

该内容是服务器启动脚本

#!/bin/bash
steamcmd_dir="$HOME/steamcmd" # SteamCMD 安装目录
install_dir="$HOME/DST/server" # 服务器安装目录
cluster_name="World" # 集群名称(你的World文件夹)
dontstarve_dir="$HOME/DST/game" # 游戏存档目录
mod_dir="mods"
mod_setup_file="dedicated_server_mods_setup.lua"
template_dir="$HOME/DST/template"
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 "$dontstarve_dir/DoNotStarveTogether/$cluster_name/cluster.ini"
check_for_file "$dontstarve_dir/DoNotStarveTogether/$cluster_name/cluster_token.txt"
check_for_file "$dontstarve_dir/DoNotStarveTogether/$cluster_name/Master/server.ini"
check_for_file "$dontstarve_dir/DoNotStarveTogether/$cluster_name/Caves/server.ini"
# 安装DST服务器文件
#"./steamcmd.sh" +force_install_dir "$install_dir" +login anonymous +app_update 343050 validate +quit
# 检查安装目录
check_for_file "$install_dir/bin64"
cd "$install_dir/bin64" || fail
# 启动主世界和洞穴世界
run_shared=(./dontstarve_dedicated_server_nullrenderer_x64)
run_shared+=(-console)
run_shared+=(-cluster "$cluster_name")
run_shared+=(-monitor_parent_process $$)
# 启动洞穴世界
"${run_shared[@]}"\
-persistent_storage_root "$dontstarve_dir"\
-ugc_directory "$template_dir/$mods" \
-modsetupfile "$template_dir/dedicated_server_mods_setup.lua" \
-shard Caves | sed 's/^/Caves: /' &
# 启动主世界
"${run_shared[@]}"\
-persistent_storage_root "$dontstarve_dir"\
-ugc_directory "$template_dir/$mods" \
-modsetupfile "$template_dir/dedicated_server_mods_setup.lua" \
-shard Master | sed 's/^/Master: /'

2. dedicated_server_mods_setup.lua

该内容是应该下载的mod

--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("831523966") -- 999堆叠
ServerModSetup("1172839635") -- Better Ice Box
ServerModSetup("661253977") -- 灵魂携带物品 - Don't Drop Everything
ServerModSetup("375850593") -- Extra Equip Slots
ServerModSetup("378160973") -- Global Positions
ServerModSetup("1595934840") -- 扶我起来
ServerModSetup("2189004162") -- Insight
ServerModSetup("1207269058") -- 简易血条DST
ServerModSetup("1595631294") -- 智能小木牌
ServerModSetup("362175979") -- Wormhole Marks [DST]
ServerModSetup("2115943953") -- Auto Stack Pro
ServerModSetup("2700454470") -- 妖刀姬
ServerModSetup("1998081438") -- 掉落堆叠(Drop & Stack)
ServerModSetup("2097358269") -- 成熟的箱子
ServerModSetup("2477889104") -- Beefalo Status Bar
ServerModSetup("3007715893") -- 更多物品堆叠
ServerModSetup("3293480002") -- Auto Watering 自动浇水

3. cluster.ini

该内容是世界配置

[GAMEPLAY]
# 游戏模式
game_mode = survival
# 最多服务器容纳人数
max_players = 6
# 是否可以PVP
pvp = false
# 当服务器没有玩家是否暂停世界
pause_when_empty = true
[NETWORK]
# 服务器描述,在浏览世界页面,点击世界后显示的描述,该选项不影响服务器,主要是世界重名后查找哪个才是自己需要加入的世界
cluster_description = no description
# 游戏世界名称,在浏览世界的时候显示的名字
cluster_name = world name
# 世界密码,密码错误无法加入世界
cluster_password = 123456
# 存档语言:中文
cluster_language = chinese
[MISC]
# 控制台是否启用,就是进入游戏后,按esc下面哪个按钮能否唤出命令行
console_enabled = true
[SHARD]
# 忘记了
shard_enabled = true
# 这个我填的是主机的ip
bind_ip = 127.0.0.1
# 这个我填的也是主机的ip
master_ip = 127.0.0.1
# 地上世界的端口,地上世界被称为主世界
master_port = 10889
# 表示需要从klei申请dedicated_DST_server_key,文件名:cluster_token.txt
cluster_key = supersecretkey

4. modoverrides.lua

该内容是世界的mod配置

return {
["workshop-1172839635"]={ configuration_options={ icebox_freeze="-5" }, enabled=true },
["workshop-1207269058"]={ configuration_options={ }, enabled=true },
["workshop-1595631294"]={
configuration_options={
BundleItems=false,
ChangeSkin=true,
Digornot=false,
DragonflyChest=false,
Icebox=false,
SaltBox=false
},
enabled=true
},
["workshop-1595934840"]={
configuration_options={
base_hp=1,
ghost_button=true,
ghost_delay=360,
hunger_kills=true,
language="chs",
no_death_announcement=false,
rip_cmd=true,
wes_mult=0.5,
wilson_extra_hp=0.6,
wilson_speed_mult=0.5
},
enabled=true
},
["workshop-2115943953"]={
configuration_options={ auto_stack=true, auto_stack_range=10, auto_stack_target=true },
enabled=true
},
["workshop-2189004162"]={
configuration_options={
DEBUG_ENABLED=false,
DEBUG_SHOW_DISABLED=false,
DEBUG_SHOW_NOTIMPLEMENTED=false,
DEBUG_SHOW_PREFAB=false,
alt_only_information=false,
appeasement_value="undefined",
armor="undefined",
attack_range_type="undefined",
battlesong_range="both",
blink_range=true,
boss_indicator=true,
bottle_indicator=true,
crash_reporter=false,
danger_announcements="undefined",
death_indicator=false,
display_attack_range="undefined",
display_cawnival="undefined",
display_compostvalue="undefined",
display_crafting_lookup_button=true,
display_fertilizer="undefined",
display_finiteuses=true,
display_food="undefined",
display_gyminfo="undefined",
display_harvestable=true,
display_health="undefined",
display_hunger="undefined",
display_insight_menu_button=true,
display_mob_attack_damage="undefined",
display_oceanfishing="undefined",
display_perishable="undefined",
display_pickable=true,
display_plant_stressors="undefined",
display_pollination="undefined",
display_sanity="undefined",
display_sanity_interactions="undefined",
display_sanityaura="undefined",
display_shared_stats="undefined",
display_shelter_info="undefined",
display_simplefishing="undefined",
display_spawner_information="undefined",
display_tackle_information="undefined",
display_timers="undefined",
display_unwrappable="undefined",
display_upgradeable="undefined",
display_weather="undefined",
display_weighable="undefined",
display_world_events="undefined",
display_worldmigrator="undefined",
display_yotb_appraisal="undefined",
display_yotb_winners="undefined",
domestication_information="undefined",
experimental_highlighting=true,
extended_info_indicator=true,
follower_info="undefined",
followtext_insight_font_size=28,
food_effects=true,
food_memory="undefined",
food_order="interface",
food_style="long",
food_units=true,
fuel_highlighting=false,
fuel_highlighting_color="RED",
fuel_verbosity="undefined",
growth_verbosity="undefined",
herd_information="undefined",
highlighting=true,
highlighting_color="GREEN",
hover_range_indicator=true,
hoverer_insight_font_size=30,
hunt_indicator="undefined",
info_preload="undefined",
info_style="text",
insight_font="UIFONT",
inventorybar_insight_font_size=25,
item_worth="undefined",
itemtile_display="percentages",
klaus_sack_info="undefined",
klaus_sack_markers="undefined",
language="automatic",
lightningrod_range=1,
miniboss_indicator=true,
naughtiness_verbosity="undefined",
nightmareclock_display="undefined",
notable_indicator=true,
orchestrina_indicator="undefined",
pipspook_indicator=true,
refresh_delay="undefined",
repair_values="undefined",
sinkhole_marks=2,
soil_moisture=2,
soil_nutrients="undefined",
soil_nutrients_needs_hat="undefined",
stewer_chef="undefined",
suspicious_marble_indicator=false,
temperature_units="game",
text_coloring=true,
time_style="gametime",
tumbleweed_info="undefined",
weapon_damage="undefined",
weather_detail="undefined",
wortox_soul_range=true,
wx78_scanner_info="undefined",
["信息控制"]=0,
["指示器"]=0,
["杂项"]=0,
["格式"]=0,
["调试"]=0,
["食物相关"]=0
},
enabled=true
},
["workshop-2700454470"]={ configuration_options={ ChineseLanguage=0, q=0 }, enabled=true },
["workshop-362175979"]={ configuration_options={ ["Draw over FoW"]="enabled" }, enabled=true },
["workshop-375850593"]={ configuration_options={ }, enabled=true },
["workshop-378160973"]={
configuration_options={
ENABLEPINGS=true,
FIREOPTIONS=2,
OVERRIDEMODE=false,
SHAREMINIMAPPROGRESS=true,
SHOWFIREICONS=true,
SHOWPLAYERICONS=true,
SHOWPLAYERSOPTIONS=2
},
enabled=true
},
["workshop-661253977"]={
configuration_options={ amudiao=false, baodiao=0, kong=0, nillots=1, rendiao=0, zbdiao=false },
enabled=true
},
["workshop-831523966"]={ configuration_options={ soul_stack=20, stack_size=99 }, enabled=true },
["workshop-1998081438"]={ configuration_options={ StackMode=true, StackRadius=10 }, enabled=true },
["workshop-2097358269"]={
configuration_options={
allcontainers=0,
collectAll=0,
collectChestSlot=0,
collect_items_dist0=1,
collect_items_dist1=6,
dragonflychest=1,
icebox=1,
is_collect_all=1,
is_collect_drop=1,
is_collect_lootdropper=1,
is_collect_open=1,
is_collect_periodicspawner=1,
is_collect_take=1,
iscollectone=1,
minisign_dist=1.5,
minisignnofire=1,
renameSpecialMinisign=1,
saltbox=1,
treasurechest=1,
["其他设置"]=false,
["收集时机"]=false,
["收集种类限制"]=false,
["特殊木牌"]=false,
["箱子种类"]=false,
["距离设置 (4 == 一块地皮)"]=false
},
enabled=true
},
["workshop-2477889104"]={
configuration_options={
BADGE_BG_BRIGHTNESS=60,
BADGE_BG_OPACITY=100,
COLOR_DOMESTICATION_DEFAULT="WHITE",
COLOR_DOMESTICATION_ORNERY="ORANGE",
COLOR_DOMESTICATION_PUDGY="PURPLE",
COLOR_DOMESTICATION_RIDER="BLUE",
COLOR_OBEDIENCE="RED",
COLOR_TIMER="GREEN",
ClientConfig=false,
EnableSounds=false,
GapModifier=0,
HEALTH_BADGE_CLEAR_BG=false,
HungerThreshold=10,
OffsetX=0,
OffsetXFine=0,
OffsetXMult=1,
OffsetY=0,
OffsetYFine=0,
OffsetYMult=1,
SEPARATOR_BADGE_COLORS=1,
SEPARATOR_BADGE_SETTINGS=1,
SEPARATOR_GENERAL=1,
SEPARATOR_POSITIONING_X=1,
SEPARATOR_POSITIONING_Y=1,
Scale=1,
ShowByDefault=true,
Theme="TheForge",
ToggleKey="KEY_T"
},
enabled=true
},
["workshop-3007715893"]={
configuration_options={
[""]=0,
STACK_OTHER_OBJECTS=true,
STACK_SIZE=99,
STACK_SIZE1=100,
aip_leaf_note=false,
ancienttree_stuff=true,
bird=true,
blank_certificate=false,
blueprint=false,
boat_stuff=true,
chestupgrade_stacksize=true,
crow=true,
deer_antler=true,
dengxian=false,
eyeturret=true,
fish=true,
foliageath=false,
glommerwings=true,
heap_of_foods=false,
horn=true,
lavae_egg=true,
lg_choufish_inv=false,
miao_packbox=false,
mole=true,
mooneye=true,
moonrockidol=true,
myth_lotusleaf=false,
rabbit=true,
reskin_tool=false,
security_pulse_cage=true,
shadowheart=true,
shell=true,
sketch=false,
spider=true,
tallbirdegg=false,
tropical=false,
wally=true,
winona=true
},
enabled=true
},
["workshop-3293480002"]={ configuration_options={ }, enabled=true },
}
  1. 文件夹图片

5. 参考

  1. Dedicated Server Quick Setup Guide - Linux
  2. 这个是mod下不下来,论坛里有人给出的传送门(13楼),但是我没有用这个方法。https://tieba.baidu.com/p/9251408506
  3. 如果之前可以玩,但是后来搜不到游戏服务器,则可能是游戏更新了,尝试把 start_server.sh的33行前面的#删除掉,然后再启动,改行是用来验证并更新饥荒服务器程序的
  4. 如果提示服务器正在运行旧版本模组。服务器所有者必须更新模组,才能让新的玩家加入。,windows更新下mod,然后上传到~/DST/template/content/322330即可,可以直接覆盖

__EOF__

本文作者echo_lovely
本文链接https://www.cnblogs.com/echo-lovely/p/18619365.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   echo_lovely  阅读(202)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示