From 99c2a67ab10e0ddc050ec2b3fc7c4beafeef33ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9C=B1?= <10714957+xiao-zhu245@user.noreply.gitee.com> Date: Fri, 18 Jul 2025 17:19:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=83=A8=E7=BD=B2=E6=B8=B8?= =?UTF-8?q?=E6=88=8F2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 17 +++++++---------- client/src/pages/SettingsPage.tsx | 4 ++-- server/data/games/installgame.json | 12 +++++++----- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index c01240a..2df472f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,9 @@ FROM debian:bullseye-slim ENV DEBIAN_FRONTEND=noninteractive \ STEAM_USER=steam \ - STEAM_HOME=/home/steam \ - STEAMCMD_DIR=/home/steam/steamcmd \ - GAMES_DIR=/home/steam/games \ + STEAM_HOME=/root \ + STEAMCMD_DIR=/root/steamcmd \ + GAMES_DIR=/root/games \ NODE_VERSION=22.17.0 # 将apt源改为中国镜像源(清华TUNA) @@ -148,7 +148,7 @@ ENV LANG=zh_CN.UTF-8 \ # 创建steam用户和应用目录 RUN useradd -m -s /bin/bash ${STEAM_USER} \ && mkdir -p ${STEAMCMD_DIR} ${GAMES_DIR} /app \ - && chown -R ${STEAM_USER}:${STEAM_USER} ${STEAM_HOME} \ + && chown -R ${STEAM_USER}:${STEAM_USER} /home/steam \ && chown -R ${STEAM_USER}:${STEAM_USER} /app # 复制项目文件 @@ -172,9 +172,8 @@ RUN mkdir -p ${STEAMCMD_DIR} \ || wget -t 5 --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -O steamcmd_linux.tar.gz https://media.steampowered.com/installer/steamcmd_linux.tar.gz; \ tar -xzvf steamcmd_linux.tar.gz; \ rm steamcmd_linux.tar.gz; \ - chown -R ${STEAM_USER}:${STEAM_USER} ${STEAMCMD_DIR}; \ chmod +x ${STEAMCMD_DIR}/steamcmd.sh; \ - su - ${STEAM_USER} -c "export http_proxy=http://192.168.10.23:7890 && export https_proxy=http://192.168.10.23:7890 && cd ${STEAMCMD_DIR} && ./steamcmd.sh +quit"; \ + cd ${STEAMCMD_DIR} && ./steamcmd.sh +quit; \ unset http_proxy https_proxy; \ else \ echo "代理服务器不可用,使用直接连接"; \ @@ -182,9 +181,8 @@ RUN mkdir -p ${STEAMCMD_DIR} \ || wget -t 5 --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -O steamcmd_linux.tar.gz https://media.steampowered.com/installer/steamcmd_linux.tar.gz; \ tar -xzvf steamcmd_linux.tar.gz; \ rm steamcmd_linux.tar.gz; \ - chown -R ${STEAM_USER}:${STEAM_USER} ${STEAMCMD_DIR}; \ chmod +x ${STEAMCMD_DIR}/steamcmd.sh; \ - su - ${STEAM_USER} -c "cd ${STEAMCMD_DIR} && ./steamcmd.sh +quit"; \ + cd ${STEAMCMD_DIR} && ./steamcmd.sh +quit; \ fi) \ # 创建steamclient.so符号链接 && mkdir -p ${STEAM_HOME}/.steam/sdk32 ${STEAM_HOME}/.steam/sdk64 \ @@ -195,8 +193,7 @@ RUN mkdir -p ${STEAMCMD_DIR} \ && mkdir -p ${STEAM_HOME}/.steam/steam \ && ln -sf ${STEAMCMD_DIR}/linux32 ${STEAM_HOME}/.steam/steam/linux32 \ && ln -sf ${STEAMCMD_DIR}/linux64 ${STEAM_HOME}/.steam/steam/linux64 \ - && ln -sf ${STEAMCMD_DIR}/steamcmd ${STEAM_HOME}/.steam/steam/steamcmd \ - && chown -R ${STEAM_USER}:${STEAM_USER} ${STEAM_HOME}/.steam + && ln -sf ${STEAMCMD_DIR}/steamcmd ${STEAM_HOME}/.steam/steam/steamcmd # 安装依赖并构建项目 RUN npm run install:all \ diff --git a/client/src/pages/SettingsPage.tsx b/client/src/pages/SettingsPage.tsx index 54f1d17..d41f2c9 100644 --- a/client/src/pages/SettingsPage.tsx +++ b/client/src/pages/SettingsPage.tsx @@ -1011,8 +1011,8 @@ const SettingsPage: React.FC = () => { }))} className="w-full px-3 py-2 pr-10 bg-white/10 border border-white/20 rounded-lg text-black dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder={steamcmdSettings.installMode === 'online' - ? '例如: C:\\SteamCMD 或 /opt/steamcmd' - : '例如: C:\\SteamCMD 或 /opt/steamcmd' + ? '例如: C:\\SteamCMD 或 容器写 /root/steamcmd' + : '例如: C:\\SteamCMD 或 容器写 /root/steamcmd' } disabled={steamcmdLoading} /> diff --git a/server/data/games/installgame.json b/server/data/games/installgame.json index ac5f521..e4b58ef 100644 --- a/server/data/games/installgame.json +++ b/server/data/games/installgame.json @@ -311,8 +311,8 @@ "tip": "", "image":"https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/440900/header.jpg", "url":"https://store.steampowered.com/app/440900/Conan_Exiles/", - "system":["Windows","Linux"], - "system_info":["Linux"] + "system":["Windows"], + "system_info":[""] }, "NoOneSurvived": { "game_nameCN": "无人生还", @@ -353,7 +353,8 @@ "appid": "412680", "tip": "Windows请开启输出流转发\\TheIsleServer.exe 'TheIsland?listen?SessionName=MyServer?ServerPassword=123456?ServerAdminPassword=admin123' -server -log", "image":"https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/376210/header.jpg", - "url":"https://store.steampowered.com/app/376210/The_Isle/" + "url":"https://store.steampowered.com/app/376210/The_Isle/", + "system":["Windows"] }, "Outworlder": { "game_nameCN": "伤害世界", @@ -391,7 +392,8 @@ "appid": "1794810", "tip": "", "image":"https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/1371580/header_schinese.jpg", - "url":"https://store.steampowered.com/app/1371580/" + "url":"https://store.steampowered.com/app/1371580/", + "system":["Windows"] }, "Barotrauma": { "game_nameCN": "潜渊症", @@ -432,7 +434,7 @@ "tip": "Windows需要开启输出流转发\\IcarusServer.exe -dedicated -port=17777 -maxplayers=8 -log", "image":"https://shared.cdn.queniuqe.com/store_item_assets/steam/apps/1149460/header_schinese.jpg", "url":"https://store.steampowered.com/app/1149460/_ICARUS/", - "system":["Windows","Linux"] + "system":["Windows"] }, "Mindustry": { "game_nameCN": "像素工厂",