Files
rong 53c6018bed feat: 集成单词对战(wordduel)与数独(numberplace),中心扩到 7 个游戏
- games.json 新增两条进程型配置:wordduel(../en,/wordduel/)与
  numberplace(/numberplace/),启动器自动多出两张卡片
- build-games.sh 改为「二进制名:目录名」映射循环,wordduel 住在 ../en
- 重写规则全部走代理层,未改游戏源码:
  - numberplace 的 api(`/api/…`) 反引号/单引号两种写法补 rewrites
  - wordduel 邀请链接 location.origin + '/#' + c 补前缀
  - WS 地址与 index.html 的 href/src 走内置规则
- README 同步路由表、重写规则表、kill -9 兜底命令;
  并更正 games.json 需重启中心才生效(config 启动时一次性加载)
2026-10-24 16:29:11 +08:00

42 lines
998 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 把「进程型」游戏编成 release 单文件二进制。
# 游戏中心只在第一次访问时才拉起它们,所以先得有这么些可执行文件。
#
# 条目格式「二进制名:目录名」——两者不一致时以目录名定位(如 wordduel 住在 ../en)。
set -euo pipefail
here="$(cd "$(dirname "$0")/.." && pwd)"
games=(
cnchess:cnchess
cngo:cngo
cs:cs
wordduel:en
numberplace:numberplace
)
for entry in "${games[@]}"; do
g="${entry%%:*}"
sub="${entry##*:}"
dir="$here/../$sub"
if [ ! -d "$dir" ]; then
echo "!! 找不到 $dir($g),跳过"
continue
fi
echo "==> 构建 $g($dir)"
( cd "$dir" && cargo build --release )
done
echo
echo "完成。二进制:"
for entry in "${games[@]}"; do
g="${entry%%:*}"
sub="${entry##*:}"
bin="$here/../$sub/target/release/$g"
if [ -x "$bin" ]; then
printf ' %-12s %s\n' "$g" "$(du -h "$bin" | cut -f1)"
else
printf ' %-12s 缺失\n' "$g"
fi
done