From b8f5f7fe3ff661ce825984fea9ccb090c2dd32f7 Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Thu, 6 Aug 2026 18:21:12 +0800 Subject: [PATCH] =?UTF-8?q?Boss=E6=8C=91=E6=88=98=E5=BC=BA=E5=8C=96?= =?UTF-8?q?=EF=BC=9A=E9=9A=8F=E6=9C=BA=E6=AD=A6=E8=A3=85=E5=8D=87Lv4/4/3?= =?UTF-8?q?=E3=80=81=E6=96=B0=E5=A2=9E=E8=87=AA=E9=80=89=E6=AD=A6=E5=99=A8?= =?UTF-8?q?=EF=BC=88=E5=9B=BE=E9=89=B4=E5=B7=B2=E8=A7=A3=E9=94=813?= =?UTF-8?q?=E4=B8=BB+3=E5=89=AF+2=E5=83=9A=EF=BC=89=E3=80=81rush=E9=98=B6?= =?UTF-8?q?=E6=AE=B5=E5=9B=9E=E8=A1=8050%=EF=BC=9BAGENTS.md=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E7=8E=A9=E6=B3=95=E6=94=B9=E5=8A=A8=E7=94=B1=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BA=B2=E8=87=AA=E9=AA=8C=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 9 + AGENTS.md | 5 +- deploy_starraid.sh | 106 ++++++++ star-raid/css/style.css | 5 + star-raid/index.html | 31 ++- star-raid/js/enemies.js | 8 +- star-raid/js/ui.js | 95 ++++++- starraid-android/.gitignore | 25 ++ starraid-android/APP_CHANGELOG.md | 7 + starraid-android/README.md | 34 +++ starraid-android/app/build.gradle.kts | 66 +++++ starraid-android/app/proguard-rules.pro | 1 + .../app/src/main/AndroidManifest.xml | 29 ++ .../java/com/cyjai/starraid/MainActivity.kt | 120 +++++++++ .../src/main/res/drawable/ic_launcher_fg.png | Bin 0 -> 2066 bytes .../main/res/drawable/ic_launcher_full.png | Bin 0 -> 4021 bytes .../main/res/drawable/ic_launcher_mono.png | Bin 0 -> 1756 bytes .../app/src/main/res/drawable/splash_bg.xml | 11 + .../app/src/main/res/drawable/splash_logo.png | Bin 0 -> 2351 bytes .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../res/mipmap-anydpi-v33/ic_launcher.xml | 6 + .../mipmap-anydpi-v33/ic_launcher_round.xml | 6 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 592 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 592 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 441 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 441 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 733 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 733 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1140 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 1140 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1425 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 1425 bytes .../app/src/main/res/values/colors.xml | 5 + .../app/src/main/res/values/strings.xml | 4 + .../app/src/main/res/values/themes.xml | 9 + .../main/res/xml/network_security_config.xml | 7 + starraid-android/build.gradle.kts | 4 + starraid-android/gradle.properties | 4 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 43739 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + starraid-android/gradlew | 251 ++++++++++++++++++ starraid-android/gradlew.bat | 94 +++++++ starraid-android/settings.gradle.kts | 18 ++ starraid-android/tools/gen_icons.py | 89 +++++++ 45 files changed, 1053 insertions(+), 13 deletions(-) create mode 100755 deploy_starraid.sh create mode 100644 starraid-android/.gitignore create mode 100644 starraid-android/APP_CHANGELOG.md create mode 100644 starraid-android/README.md create mode 100644 starraid-android/app/build.gradle.kts create mode 100644 starraid-android/app/proguard-rules.pro create mode 100644 starraid-android/app/src/main/AndroidManifest.xml create mode 100644 starraid-android/app/src/main/java/com/cyjai/starraid/MainActivity.kt create mode 100644 starraid-android/app/src/main/res/drawable/ic_launcher_fg.png create mode 100644 starraid-android/app/src/main/res/drawable/ic_launcher_full.png create mode 100644 starraid-android/app/src/main/res/drawable/ic_launcher_mono.png create mode 100644 starraid-android/app/src/main/res/drawable/splash_bg.xml create mode 100644 starraid-android/app/src/main/res/drawable/splash_logo.png create mode 100644 starraid-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 starraid-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 starraid-android/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml create mode 100644 starraid-android/app/src/main/res/mipmap-anydpi-v33/ic_launcher_round.xml create mode 100644 starraid-android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 starraid-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 starraid-android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 starraid-android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 starraid-android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 starraid-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 starraid-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 starraid-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 starraid-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 starraid-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 starraid-android/app/src/main/res/values/colors.xml create mode 100644 starraid-android/app/src/main/res/values/strings.xml create mode 100644 starraid-android/app/src/main/res/values/themes.xml create mode 100644 starraid-android/app/src/main/res/xml/network_security_config.xml create mode 100644 starraid-android/build.gradle.kts create mode 100644 starraid-android/gradle.properties create mode 100644 starraid-android/gradle/wrapper/gradle-wrapper.jar create mode 100644 starraid-android/gradle/wrapper/gradle-wrapper.properties create mode 100755 starraid-android/gradlew create mode 100644 starraid-android/gradlew.bat create mode 100644 starraid-android/settings.gradle.kts create mode 100644 starraid-android/tools/gen_icons.py diff --git a/.gitignore b/.gitignore index 3dcd1e4..115e0d2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,12 @@ research/ .playwright-mcp/ cache/ star-raid/.env + +# Star Raid Android App +starraid-android/build/ +starraid-android/app/build/ +starraid-android/.gradle/ +starraid-android/local.properties +starraid-android/app/release/ +starraid-android/.keystore-pass +*.apk diff --git a/AGENTS.md b/AGENTS.md index 14ad23c..405eb51 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -31,8 +31,9 @@ git add -A && git commit -m "提交信息" ## 验证规则(最高优先级,违反会被用户骂) 1. **游戏视觉/手感禁止 Agent 验收**——用户亲自验收。但**账号/大厅/排行榜/结算上报等功能流允许 playwright 测试**(用户 2026-08-06 明确授权):注册/登陆/数据断言可跑,只是不许用截图评判游戏画面效果。 -2. 交付时必须诚实标注验证状态。 -3. 完成了操作 ≠ 任务完成,未经验证不得说“修复了/完成了”。 +2. **游戏玩法改动(武装配置/Boss机制/手感/数值等)默认由用户亲自测试**(用户 2026-08-06 补充):Agent 不主动跑 playwright 验收这类改动,只做语法检查等静态校验,交付时标注“未做功能验证,待用户验收”;用户明确要求时才跑功能流测试。 +3. 交付时必须诚实标注验证状态。 +4. 完成了操作 ≠ 任务完成,未经验证不得说“修复了/完成了”。 ## 项目结构 diff --git a/deploy_starraid.sh b/deploy_starraid.sh new file mode 100755 index 0000000..343e47e --- /dev/null +++ b/deploy_starraid.sh @@ -0,0 +1,106 @@ +#!/bin/bash +set -euo pipefail + +# ============================================================================ +# deploy_starraid.sh — Star Raid 一键部署(2026-08-06) +# ---------------------------------------------------------------------------- +# 参考项目本体 agents 的 deploy_agents.sh / refresh_agents.sh 双脚本模式: +# 本地:git push → rsync 上传 → SSH 触发服务器 refresh_starraid.sh +# 服务器:/opt/starraid/refresh_starraid.sh(重启 + 健康检查 + nginx reload) +# +# 用法: +# bash deploy_starraid.sh # 默认:push main + rsync + 触发刷新 +# bash deploy_starraid.sh --no-push # 跳过 git push(例如已手动 push) +# REMOTE_HOST=xxx bash deploy_starraid.sh # 覆盖远程主机 +# +# 说明: +# - rsync 排除 .env(生产密钥)、demo/、.DS_Store +# - Star Raid 是纯静态 + node 服务,无前端构建步骤 +# - 游戏服务器目录 /opt/starraid 无 git,采用 rsync 直传(与项目本体 git pull 模式不同) +# ============================================================================ + +# ── 配置(可通过环境变量覆盖) ── +REMOTE_HOST="${REMOTE_HOST:-59.110.19.30}" +REMOTE_USER="${REMOTE_USER:-root}" +REMOTE_PORT="${REMOTE_PORT:-22}" +REMOTE_DIR="${REMOTE_DIR:-/opt/starraid}" +GIT_BRANCH="${GIT_BRANCH:-main}" + +LOCAL_ROOT="$(cd "$(dirname "$0")" && pwd)" +GAME_DIR="$LOCAL_ROOT/star-raid" +SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + +log() { printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$*"; } + +need_cmd() { + if ! command -v "$1" >/dev/null 2>&1; then + log "缺少命令 $1,请先安装后重试" + exit 1 + fi +} + +ssh_exec() { ssh -p "$REMOTE_PORT" $SSH_OPTS "$REMOTE_USER@$REMOTE_HOST" "$@"; } + +# ── 参数解析 ── +SKIP_PUSH=false +for arg in "$@"; do + case "$arg" in + --no-push) SKIP_PUSH=true ;; + -h|--help) + echo "用法: bash deploy_starraid.sh [--no-push]" + echo " --no-push 跳过 git push(仅 rsync 上传 + 服务器刷新)" + exit 0 + ;; + *) log "未知参数: $arg(支持 --no-push)"; exit 1 ;; + esac +done + +main() { + need_cmd ssh + need_cmd rsync + + # ── 0. 前置检查 ── + if [[ ! -d "$GAME_DIR" ]]; then + log "错误: 未找到游戏目录 $GAME_DIR" + exit 1 + fi + + # ── 1. Git Push ── + if $SKIP_PUSH; then + log "1/3 跳过 git push(--no-push)" + else + log "1/3 git push → origin/$GIT_BRANCH" + cd "$LOCAL_ROOT" + if ! git diff --quiet --exit-code 2>/dev/null || ! git diff --cached --quiet --exit-code 2>/dev/null; then + log "警告:有未提交的改动,请先 commit 或 stash" + log " - 查看: git status" + log " - 提交: git add -A && git commit -m '...'" + log " - 暂存: git stash push -m 'WIP'" + log "若仍要部署,请使用 --no-push 跳过此步骤" + exit 1 + fi + git push origin "$GIT_BRANCH" + log "push 完成" + fi + + # ── 2. rsync 上传 ── + log "2/3 rsync 上传 → $REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR" + # 注意:不用 --delete——服务器端 refresh_starraid.sh 等本地没有的文件必须保留; + # 且避免本地临时缺文件时连带删除服务器文件(与手动 rsync 命令保持一致) + rsync -az \ + --exclude='.env' \ + --exclude='.env.example' \ + --exclude='.DS_Store' \ + --exclude='demo/' \ + --exclude='*.log' \ + --exclude='refresh_starraid.sh' \ + "$GAME_DIR/" "$REMOTE_USER@$REMOTE_HOST:$REMOTE_DIR/" + log "上传完成" + + # ── 3. 触发服务器刷新 ── + log "3/3 触发服务器 refresh_starraid.sh" + ssh_exec "bash $REMOTE_DIR/refresh_starraid.sh" + log "全部完成 🚀 https://starraid.cyjai.com" +} + +main "$@" diff --git a/star-raid/css/style.css b/star-raid/css/style.css index 8eb6d58..c3aea78 100644 --- a/star-raid/css/style.css +++ b/star-raid/css/style.css @@ -134,6 +134,11 @@ h1.logo{font-size:clamp(20px,5.4vw,44px);color:#fff;letter-spacing:4px;line-heig .cx-item .nm{font-size:clamp(6px,1.1vw,8px);margin-top:4px;letter-spacing:1px} .cx-item.lock{opacity:.35;cursor:default} .cx-item.lock:hover{transform:none;border-color:var(--line)} +/* 自选武装(Boss挑战):选中高亮 + 槽位计数 */ +.cx-item.sel{border-color:var(--cyan);box-shadow:0 0 12px rgba(65,230,255,.4);background:rgba(65,230,255,.08)} +.cnt{color:var(--gold);font-size:clamp(8px,1.4vw,11px)} +.cx-grid.full .cx-item:not(.sel){opacity:.55} +.cx-grid.full .cx-item:not(.sel):hover{border-color:var(--line);transform:none} .cx-sec{font-size:clamp(8px,1.5vw,10px);color:var(--cyan);margin:10px 0 4px;letter-spacing:3px} /* ---------- 登陆/注册 ---------- */ diff --git a/star-raid/index.html b/star-raid/index.html index d409855..808b6f2 100644 --- a/star-raid/index.html +++ b/star-raid/index.html @@ -102,7 +102,7 @@
+ + + + + +