Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
修复更新时没有关闭世界的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yechentide committed May 7, 2022
1 parent 45cc95b commit 33ba5bc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion DSTManager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -eu

# 这个脚本里将会读取其他的全部shell脚本, 所以以下全局常量/变量在其他shell脚本里可用
declare OS='MacOS'
declare -r SCRIPT_VERSION='v1.5.0'
declare -r SCRIPT_VERSION='v1.5.1'
declare -r ARCHITECTURE=$(getconf LONG_BIT)
declare -r REPO_ROOT_DIR="$HOME/DSTServerManager"
# DST服务端文件夹
Expand Down
18 changes: 3 additions & 15 deletions bin/environment/update_dst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ shift $((OPTIND - 1))
#######################################
# 参数:
# -b: 测试版的字符串
# -c: 重装服务端时加上这个
# -u: 升级服务端时加上这个
# $1: DST服务端下载位置
# ¥2: V1_MOD_DIR
#######################################

if [[ $clean_install == 'true' ]]; then
Expand All @@ -42,16 +43,6 @@ if [[ $is_update == 'false' ]]; then
echo ''
color_print warn "路径$1 未找到饥荒服务端,即将开始下载..."
else
color_print warn '升级服务端之前,将会关闭所有运行中的世界!'
confirm warn '是否关闭所有运行中的世界, 并更新服务端?'
if [[ $(cat $ANSWER_PATH) == 'no' ]]; then
color_print -n info '取消升级 '; count_down 3
exit 0
fi

# To Fix: 升级服务端会导致dedicated_server_mods_setup.lua被清空, 然后Mod会无效
cp $2/dedicated_server_mods_setup.lua $2/dedicated_server_mods_setup.lua.bak
#stop_all_shard
color_print info "开始升级服务端..."
fi

Expand All @@ -74,13 +65,10 @@ install_dst $1

if [[ $? ]]; then
color_print success '饥荒服务端下载更新完成!'
if [[ $is_update == 'true' ]]; then
cp $2/dedicated_server_mods_setup.lua.bak $2/dedicated_server_mods_setup.lua
fi
color_print info '途中可能会出现Failed to init SDL priority manager: SDL not found警告'
color_print info '不用担心, 这个不影响下载/更新DST'
color_print -n info '虽然可以解决, 但这需要下载一堆依赖包, 有可能会对其他运行中的服务造成影响, 所以无视它吧~ '
count_down -n 6
count_down -n 3
else
color_print error '似乎出现了什么错误(国内主机的话, 一般是网络问题)...'
exit 1
Expand Down
4 changes: 4 additions & 0 deletions docs/更新日志.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

## 1.5.1

- 修复更新时没有关闭世界的问题

## 1.5.0

- 更改版本号命名规则
Expand Down
13 changes: 12 additions & 1 deletion lib/server_panel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,18 @@ function server_panel() {
done
;;
'更新服务端')
update_dst -u $DST_ROOT_DIR $V1_MOD_DIR
color_print warn '升级服务端之前,将会关闭所有运行中的世界!'
confirm warn '是否关闭所有运行中的世界, 并更新服务端?'
if [[ $(cat $ANSWER_PATH) == 'no' ]]; then
color_print -n info '取消升级 '; count_down 3
continue
fi
# To Fix: 升级服务端会导致dedicated_server_mods_setup.lua被清空, 然后Mod会无效
cp $V1_MOD_DIR/dedicated_server_mods_setup.lua $V1_MOD_DIR/dedicated_server_mods_setup.lua.bak
stop_all_shard

update_dst -u $DST_ROOT_DIR
cp $V1_MOD_DIR/dedicated_server_mods_setup.lua.bak $V1_MOD_DIR/dedicated_server_mods_setup.lua
;;
'返回')
color_print info '即将返回主面板'
Expand Down

0 comments on commit 33ba5bc

Please sign in to comment.