饥荒联机云服务器 | 您所在的位置:网站首页 › 饥荒云服务器搭建教程手机版 › 饥荒联机云服务器 |
放假闲来无事,搭建一个饥荒联机专用服务器和朋友一起来玩玩。 docker搭建饥荒联机服务器 注意:如果你的linux服务器上还没有安装docker,那么请看Centos7 安装Docker。 注意:如果你的linux服务器上还没安装docker-compose,那么请看Centos7 安装docker-compose。 然后执行下面的命令来下载”饥荒联机服务器“镜像: 1$ docker pull jamesits/dst-server 镜像下载好之后,进入到~目录下 1$ cd ~ 创建文件夹 1$ mkdir dont_starve_together 进入刚刚创建的文件夹,创建一个文件 1 2$ cd dont_starve_together $ nano docker-compose.yml 填入以下内容 1 2 3 4 5 6 7 8 9 10 11 12 13version: "3" services: dst-server: image: jamesits/dst-server:latest deploy: restart_policy: condition: on-failure ports: - "10999-11000:10999-11000/udp" - "12346-12347:12346-12347/udp" volumes: - ~/.klei/DoNotStarveTogether:/data stop_grace_period: 6m 然后ctrl+x,输入y,回车保存该文件。 同时服务器需要开放10999-11000,12346-12347端口。如果你的服务器是在阿里云或者腾讯云等地方购买的,可以通过服务器控制台进行端口开放操作。 至此docker的配置工作已经完成,接下来执行以下命令即可(第一次执行该命令会初始化饥荒服务器配置,并不会直接启动饥荒服务器) 1$ docker-compose up -d 然后再执行以下的代码查看docker容器的id(饥荒服务器的id) 1$ docker ps 显示信息如下(我更改了一下输出格式) 1 2 3 4 5 6 7CONTAINER ID 8b1011687993 IMAGE jamesits/dst-server:latest COMMAND "entrypoint.sh sup..." CREATED 1 hours ago STATUS **** PORTS 0.0.0.0:10999-11000->10999-11000/udp, 0.0.0.0:12346-12347->12346-12347/udp NAMES dont_starve_together_dst-server_1 确认启动起来之后我们停止掉饥荒服务器 1$ docker stop 你的容器id(我这里是8b1011687993,请替换成你的) 到了这里,我们docker搭建饥荒联机服务器步骤已经完成了,请继续进行下一步操作 配置服务器信息 现在来配置我们的饥荒游戏世界。 首先我们要准备以下材料: KLEI用户IDKU_xxxxxx 服务器tokenpds-gKU_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxx 1) 准备好材料之后,进入到饥荒配置文件夹 1$ cd ~/.klei/DoNotStarveTogether/DoNotStarveTogether/Cluster_1/ 查看一下该文件夹下有什么内容 1 2$ ls adminlist.txt blocklist.txt Caves/ cluster.ini cluster_token.txt Master/ mods/ whitelist.txt 2) 接下来编辑管理员列表 1$ nano adminlist.txt 将上面材料中的”KLEI用户ID”填进去,然后ctrl+x,输入y,回车保存该文件 3) 编辑白名单列表 1$ nano whitelist.txt 同样将上面材料中的”KLEI用户ID”填进去,然后ctrl+x,输入y,回车保存该文件 4) 编辑cluster_token.txt文件 1$ nano cluster_token.txt 将上面准备的服务器token填进去,然后ctrl+x,输入y,回车保存该文件 5) 编辑cluster.ini文件 1$ nano cluster.ini 修改以下内容 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36[NETWORK] cluster_name = 这里填你的房间名称 cluster_description = 这里填你的房间说明 cluster_password =这里填你的房间密码 offline_cluster = false lan_only_cluster = false tick_rate = 30 whitelist_slots = 1 cluster_intention = social autosaver_enabled = true [GAMEPLAY] game_mode = endless max_players = 64 pvp = true pause_when_empty = true vote_kick_enabled = false [STEAM] steam_group_only = false steam_group_id = 0 steam_group_admins = false [MISC] console_enabled = true max_snapshots = 6 ; ==================================================================== ; 注意,下面的内容严禁修改. ; ==================================================================== [SHARD] shard_enabled = true bind_ip = 127.0.0.1 master_ip = 127.0.0.1 master_port = 10998 cluster_key = MsAhBOXhhnElO5IPKr4G 将上面的内容替换成你自己的,其它的配置自行百度,然后ctrl+x,输入y,回车保存该文件 到了这一步,如果你的饥荒服务器不使用mod的话,就可以直接进行第三步操作了 现在我们来配置服务器的mod 6) 首先进入到mods文件夹 1$ cd ~/.klei/DoNotStarveTogether/DoNotStarveTogether/Cluster_1/mods 7) 编辑dedicated_server_mods_setup.lua 文件 1nano dedicated_server_mods_setup.lua 填入以下内容(以下是我自用的一些mod,你可以替换成你自己的mod) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54--There are two functions that will install mods, ServerModSetup and ServerModCollectionSetup. Put the calls $ --ServerModSetup takes a string of a specific mod's Workshop id. It will download and install the mod to your$ --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 t$ --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("346968521") ServerModSetup("347079953") ServerModSetup("351325790") ServerModSetup("352373173") ServerModSetup("358749986") ServerModSetup("367546858") ServerModSetup("374550642") ServerModSetup("375850593") ServerModSetup("376333686") ServerModSetup("378160973") ServerModSetup("396026892") ServerModSetup("398109522") ServerModSetup("404161345") ServerModSetup("430427326") ServerModSetup("438293817") ServerModSetup("444235588") ServerModSetup("447092740") ServerModSetup("453693119") ServerModSetup("460972875") ServerModSetup("463740026") ServerModSetup("466732225") ServerModSetup("572538624") ServerModSetup("604761020") ServerModSetup("609051112") ServerModSetup("623749604") ServerModSetup("656256171") ServerModSetup("668708075") ServerModSetup("678340265") ServerModSetup("684098549") ServerModSetup("684722436") ServerModSetup("703758203") ServerModSetup("720221857") ServerModSetup("721491336") ServerModSetup("780009141") ServerModSetup("804317397") ServerModSetup("884642675") ServerModSetup("913454779") ServerModSetup("917203276") ServerModSetup("1108032281") ServerModSetup("1166220990") ServerModSetup("1181077385") ServerModSetup("1217385169") 然后ctrl+x,输入y,回车保存该文件 8) 进入到Master文件夹 1$ cd ~/.klei/DoNotStarveTogether/DoNotStarveTogether/Cluster_1/Master 9) 创建文件modoverrides.lua 1$ nano modoverrides.lua 填入以下内容(这些内容是对mod的配置,不填的话,服务器显示无mod) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164return { ["workshop-1108032281"]={ configuration_options={ ExtraEquipSlot="Disabled", wharang_dodge_key=114, wharang_language="lan_en", wharang_stat="stat_soul", wharang_stat_key=107, wharang_transform_key=118 }, enabled=true }, ["workshop-1166220990"]={ configuration_options={ attract=2, language=2 }, enabled=true }, ["workshop-1181077385"]={ configuration_options={ }, enabled=true }, ["workshop-1217385169"]={ configuration_options={ }, enabled=true }, ["workshop-346968521"]={ configuration_options={ }, enabled=true }, ["workshop-347079953"]={ configuration_options={ DFV_Language="EN", DFV_MinimalMode="default" }, enabled=true }, ["workshop-358749986"]={ configuration_options={ IndicatorSize=3, MaxIndicator=7000, PlayerIndicators=1 }, 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-396026892"]={ configuration_options={ OPT_DIFFICULTY=1 }, enabled=true }, ["workshop-404161345"]={ configuration_options={ Allow_Harvesting="true", Drop_Content="true", Fortify_Building=0, Ownership="Multi", Player_Trap="false", Share_Container="false", Share_Equipments="true" }, enabled=true }, ["workshop-430427326"]={ configuration_options={ beecbees=2, beechoney=4, beeckbees=2, beecpetals=4, rbeediffdef=2, rbeetech=2 }, enabled=true }, ["workshop-444235588"]={ configuration_options={ deluxeEndoFirepitBurnRate=0.75, deluxeFirepitBurnRate=0.75, dropLoot="yes", endoDropLoot="yes", heatStarBurnRate=0.9, heatStarDropLoot="yes", iceStarBurnRate=0.9, iceStarDropLoot="yes", recipeCost="standard", starsSpawnHounds="no" }, enabled=true }, ["workshop-447092740"]={ configuration_options={ }, enabled=true }, ["workshop-463740026"]={ configuration_options={ ownership=false }, enabled=true }, ["workshop-466732225"]={ configuration_options={ }, enabled=true }, ["workshop-604761020"]={ configuration_options={ RUOYINXIAN=false, SHENGDANSHI=false, baoshibaolv=1, blue_baoshi=1, er_shuoming=0, green_baoshi=1, huangjinbaolv=1, marble_suipian=1, orange_baoshi=1, purple_baoshi=1, red_baoshi=1, shishengzhang=0, shitoubaolv=1, thulecite_xiukuang=1, wajuecishu=2, yellow_baoshi=1, yi_shuoming=0 }, enabled=true }, ["workshop-623749604"]={ configuration_options={ Craft="Normal", Destroyable="DestroyByAll", FoodSpoilage=1, Language="En", Position="Center", Slots=80 }, enabled=true }, ["workshop-656256171"]={ configuration_options={ dont_give_dubloons=2, give_dubloons=1, position=1, rec_dubloon=3, rec_gold=3 }, enabled=true }, ["workshop-684098549"]={ configuration_options={ remilia_diet="blood" }, enabled=true }, ["workshop-684722436"]={ configuration_options={ ccraft=1, lang=0 }, enabled=true }, ["workshop-703758203"]={ configuration_options={ }, enabled=true }, ["workshop-720221857"]={ configuration_options={ }, enabled=true }, ["workshop-721491336"]={ configuration_options={ ["Death Lv Drain (Trust)"]="Off", ["General Winter"]="On", ["Phoenix's Resilience"]="On", ["Survivor's Guilt"]="On", Trustworthy="On" }, enabled=true }, ["workshop-804317397"]={ configuration_options={ buffgo=false, fhl_cos=0.05, fhl_hjopen=false, likeornot=false, openli=false, openlight=false, zzj_cankanshu=false, zzj_canuseashammer=false, zzj_canuseasshovel=false, zzj_canwakuang=false, zzj_finiteuses=210, zzj_fireopen=false, zzj_pre=1 }, enabled=true }, ["workshop-884642675"]={ configuration_options={ ["General Winter"]="On", ["Phoenix's Resilience"]="On", ["Survivor's Guilt"]="On", Trustworthy="On" }, enabled=true }, ["workshop-913454779"]={ configuration_options={ }, enabled=true }, ["workshop-917203276"]={ configuration_options={ EQUIPMENT_SELF=true, HAMBAT=true, NIGHTSTICK=true, NIGHTSWORD=1, OTHER_EQUIPMENT=false, PERISHABLE_WEARS=true, TORNADO=false }, enabled=true } } 然后ctrl+x,输入y,回车保存该文件 10) 复制文件modoverrides.lua 到Caves文件夹下 1$ cp modoverrides.lua ../Caves/ 到了这里,我们配置服务器信息步骤已经完成了,请继续进行下一步操作 启动饥荒服务器 执行以下的代码查看docker容器的id(饥荒服务器的id) 1$ docker ps 显示信息如下(我更改了一下输出格式) 1 2 3 4 5 6 7CONTAINER ID 8b1011687993 IMAGE jamesits/dst-server:latest COMMAND "entrypoint.sh sup..." CREATED 1 hours ago STATUS **** PORTS 0.0.0.0:10999-11000->10999-11000/udp, 0.0.0.0:12346-12347->12346-12347/udp NAMES dont_starve_together_dst-server_1 执行启动命令 1$ docker start 你的容器id(我这里是8b1011687993,请替换成你的) 然后等待饥荒服务器启动成功即可。 启动期间会自动下载steam创意工坊mod,花费时间比较长。你可以执行下面的代码查看服务器启动状态 1$ docker logs 你的容器id(我这里是8b1011687993,请替换成你的) 到这里就说的差不多啦。服务器启动成功与否,可以去游戏中,搜索你配置的房间名查看。 最后祝大家游戏愉快。 |
CopyRight 2018-2019 实验室设备网 版权所有 |