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

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yechentide committed Dec 2, 2022
1 parent f1be405 commit c42ffb0
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
8 changes: 4 additions & 4 deletions 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.6.1'
declare -r SCRIPT_VERSION='v1.6.2'
declare -r ARCHITECTURE=$(getconf LONG_BIT)
declare -r REPO_ROOT_DIR="$HOME/DSTServerManager"
# DST服务端文件夹
Expand Down Expand Up @@ -63,9 +63,9 @@ function check_os() {

function check_user_is_root() {
if echo $HOME | grep -sq ^/root; then
color_print error '出于安全方面考虑, 最好不要使用root用户执行本脚本!'
color_print tip '这里建议你使用 Ctrl 加 c 来终止脚本, 并使用sudo权限的用户执行本脚本(暂停10s来等你决定)'
count_down -n 10
color_print warn '出于安全方面考虑, 最好不要使用root用户执行本脚本!'
color_print tip '这里建议你使用 Ctrl 加 c 来终止脚本, 并使用sudo权限的用户执行本脚本(暂停5s来等你决定)'
count_down -n 5
fi
}

Expand Down
9 changes: 7 additions & 2 deletions bin/environment/install_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function check_user_is_sudoer() {
declare sudoer_group=''
if [[ $1 == 'Ubuntu' ]]; then sudoer_group='sudo'; fi
if [[ $1 == 'CentOS' ]]; then sudoer_group='wheel'; fi
if [[ $(whoami) == 'root' ]]; then return 0; fi
if groups | grep -sqv $sudoer_group; then
color_print warn "当前用户$(whoami)没有sudo权限, 可能无法下载依赖。"
color_print warn '接下来将会列出所需依赖包, 如果不确定是否已安装, 请终止脚本!'
Expand Down Expand Up @@ -40,7 +41,11 @@ else
fi

if [[ $1 == 'Ubuntu' ]]; then
declare -a requires=(lib32gcc-s1 lua5.3 tmux wget git curl)
if grep -sq '^VERSION_ID="18.04"' /etc/os-release; then
declare -a requires=(lib32gcc1 lua5.3 tmux wget git curl)
else
declare -a requires=(lib32gcc-s1 lua5.3 tmux wget git curl)
fi
elif [[ $1 == 'CentOS' ]]; then
declare -a requires=(glibc.i686 libstdc++ lua tmux wget git which)
fi
Expand All @@ -52,7 +57,7 @@ echo "${requires[@]}"
if [[ $is_sudoer == 'no' ]] && [[ $(whoami) != 'root' ]]; then
color_print warn '以上软件是否已安装?没有安装的话请联系该服务器的管理员...'
confirm warn '是否已安装?'
if [[ $(cat ANSWER_PATH) == 'yes' ]]; then return 0; fi
if [[ $(cat $ANSWER_PATH) == 'yes' ]]; then return 0; fi

color_print error '无权限下载安装必须软件,终止运行脚本。请联系服务器管理员解决。'
exit 1
Expand Down
2 changes: 1 addition & 1 deletion bin/utils/get_mod_name
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ set -eu
# mod名字
#######################################
# echo "$(cat $1 | grep ^name | awk -F= '{print $2}' | awk -F\" '{print $2}')"
declare -r name=$(lua -e "locale = \"zh\"; folder_name = \"\"; dofile(\"$1\") print(name)")
declare -r name=$(lua -e "locale = \"zh\"; folder_name = \"\"; function ChooseTranslationTable() end; dofile(\"$1\") print(name)")
echo $name # 通过echo来去除头尾的空白
5 changes: 5 additions & 0 deletions docs/更新日志.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 更新日志

## 1.6.2

- 修复BUG
- 修改等待时间

## 1.6.1

- 移除游戏风格和游戏模式的编辑功能
Expand Down
2 changes: 1 addition & 1 deletion lib/server/start_shard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function start_shard() {
accent_color_print error $accent_color '世界 ' $1 ' 启动失败!'
color_print tip '请确保先启动主世界(不然副世界会一直尝试连接主世界)'
color_print -n info '即将进入后台, 请自己查看失败原因(截图或者复制)'
sleep 2
sleep 5
tmux display -t "$1:^.top" '请自己查看失败原因(截图或者复制)'
tmux send-keys -t "$1:^.top" ENTER ENTER
tmux send-keys -t "$1:^.top" '请查看服务器输出的日志, 按需求复制或者截图, 向他人询问解决方法'
Expand Down
2 changes: 1 addition & 1 deletion lib/server_panel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function start_server() {

# 选择了shard
if echo $answer | grep -sq -; then
declare shard_path="$KLEI_ROOT_DIR/$WORLDS_DIR_NAME/$(echo $answer | sed -e "s#-#/#g")"
declare shard_path="$KLEI_ROOT_DIR/$WORLDS_DIR_NAME/$(echo $answer | sed -e 's#-\([^-]*\)$#/\1#g')"
if check_shard $shard_path; then
start_shard $answer
fi
Expand Down
9 changes: 2 additions & 7 deletions templates/cluster/cluster.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,12 @@ offline_cluster = false
# 如果此项设为false,游戏将不会在每天结束时自动存档。相对的,游戏会在关闭服务器时存档。
# 通过c_save()命令手动存档依然可用。
#cluster_intention = cooperative
# 默认值: 取决于游戏模式选择
# 可选值: cooperative, competitive, social, madness
# 服务器集群的游戏风格。此配置项的功能和游戏中Host Game中选择游戏风格的功能一致。
# 注意: 多主机开一个存档时, 仅主服务器有效
# 最新版本已经弃用

[GAMEPLAY]
game_mode = survival
# 默认值: survival
# 可选值: survival, endless, wilderness
# 游戏模式。此配置项的功能与Host Game中游戏模式的选项一致(生存、无尽,狂野)。
# 注意: 多主机开一个存档时, 每个cluster.ini中的设置必须一致。
# 最新版本只剩下survival了
max_players = 6
# 默认值: 6
# 可用同时连接服务器的玩家数量。
Expand Down

0 comments on commit c42ffb0

Please sign in to comment.