Compare commits

...

10 Commits

Author SHA1 Message Date
Claude
b42d24c477 README: час збірок після кешу й паралельних тестів
All checks were successful
build / build (push) Successful in 37s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZxjRNfPF6rNJTvBXnq
2026-11-25 16:00:17 +00:00
Gitea Actions
90d7440756 template.sha256: rebuilt template-4.7.2 2026-11-25 15:58:49 +00:00
Claude
25bf505bab CI швидше: тести й сіди бота паралельно (тег пропускає тести, якщо коміт уже пройшов на main); шаблон і образ збираються BuildKit з кешем (тулчейн, вихідні коди, об'єкти scons)
All checks were successful
build / build (push) Successful in 35s
ci-image / image (push) Successful in 3m15s
template / template (push) Successful in 14m27s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZxjRNfPF6rNJTvBXnq
2026-11-25 15:40:30 +00:00
Gitea Actions
796f4c73e3 template.sha256: rebuilt template-4.7.2
All checks were successful
build / build (push) Successful in 1m29s
2026-11-25 15:31:07 +00:00
Claude
7e64cdd18b template: winrt, accesskit, angle явно вимкнено (і так вимикались без SDK, тепер без попереджень)
All checks were successful
build / build (push) Successful in 1m6s
template / template (push) Successful in 18m22s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZxjRNfPF6rNJTvBXnq
2026-11-25 15:15:47 +00:00
Gitea Actions
2ba5ac6424 template.sha256: rebuilt template-4.7.2 2026-11-25 15:11:12 +00:00
Claude
54564c5764 CI: build.yml працює в образі tinmerezhi-ci, без завантаження Godot, Go, fontTools і butler щоразу
All checks were successful
build / build (push) Successful in 1m26s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZxjRNfPF6rNJTvBXnq
2026-11-25 14:54:27 +00:00
Claude
3e78f4ccef CI: власний Docker-образ tinmerezhi-ci (Godot, малий шаблон, fontTools, go-winres, butler) і workflow перезбірки шаблону на сервері
All checks were successful
build / build (push) Successful in 1m14s
ci-image / image (push) Successful in 3m53s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZxjRNfPF6rNJTvBXnq
2026-11-25 14:42:27 +00:00
JunioR
a3711c0500 help: опис для achievements, status, save, sound, settings, update, newgame, clear, help; тест — кожна команда має рядок з описом у help
All checks were successful
build / build (push) Successful in 2m54s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZz4FUZdrPc3ckXU8qx
2026-11-25 14:30:28 +00:00
Claude
b508a18589 Версія й стан оновлень видно при старті: рядок у вітанні, бейдж у правому куті (перевірка / остання / доступна vX / не вдалося), спливаюче повідомлення з результатом; en; тест
All checks were successful
build / build (push) Successful in 2m48s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZwKLzKKh4DoRQTxw8x
2026-11-25 14:21:44 +00:00
17 changed files with 274 additions and 60 deletions

View File

@@ -12,44 +12,62 @@ env:
jobs:
build:
runs-on: ubuntu-latest
# local image with Godot, the small template, fontTools, go-winres and butler (ci/Dockerfile, workflow ci-image.yml);
# if a job says the image is missing: Actions -> ci-image -> Run workflow
container:
image: tinmerezhi-ci:4.7.2
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # all tags and history: release notes from commits since the previous tag
- name: Godot
run: |
curl -sSL --fail -o /tmp/godot.zip "https://github.com/godotengine/godot/releases/download/${GODOT_VER}-stable/Godot_v${GODOT_VER}-stable_linux.x86_64.zip"
unzip -q -o /tmp/godot.zip -d /tmp/godot
install /tmp/godot/Godot_v${GODOT_VER}-stable_linux.x86_64 /usr/local/bin/godot
godot --version
- name: Import
working-directory: source_godot
run: godot --headless --path . --import
run: godot --version && godot --headless --path . --import
- name: Tests
run: GODOT=godot sh source_godot/run_tests.sh
- name: Balance bot (several seeds, every difficulty, both endings, endless)
- name: Tests and balance bot (in parallel; a tag skips them if this commit already passed on main)
working-directory: source_godot
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# seed:difficulty (0 novice, 1 normal, 2 paranoid):choices in the Act IV and Act V finals
fail=0
case "$GITHUB_REF" in refs/tags/*)
if curl -sf -H "Authorization: token $TOKEN" "http://gitea:3000/api/v1/repos/$GITHUB_REPOSITORY/actions/tasks?limit=50" | python3 -c '
import json, os, sys
ok = any(t["name"] == "build" and t["head_branch"] == "main" and t["head_sha"] == os.environ["GITHUB_SHA"]
and t["status"] == "success" for t in json.load(sys.stdin)["workflow_runs"])
sys.exit(0 if ok else 1)'; then
echo "commit $GITHUB_SHA already passed the tests on main: skipped"; exit 0
fi;;
esac
# every Godot process gets its own user:// (XDG_DATA_HOME), because the tests reuse save file names
L=/tmp/ci; mkdir -p $L
run() { n=$1; shift; (env XDG_DATA_HOME=$L/u_$n "$@" > $L/$n.log 2>&1; echo $? > $L/$n.rc) & }
run tests env GODOT=godot sh run_tests.sh
# balance bot: seed:difficulty (0 novice, 1 normal, 2 paranoid):choices in the Act IV and Act V finals
for c in 1:1:22 2:1:11 3:1:22 4:0:11 5:2:22 7:2:11; do
s=$(echo $c | cut -d: -f1); d=$(echo $c | cut -d: -f2); ch=$(echo $c | cut -d: -f3)
r=$(BAL_DIFF=$d BAL_CHOICE=$ch BAL_ENDLESS=1 godot --headless --path . -s tests/balance.gd -- $s 2>&1) || fail=1
echo "seed $s diff $d choice $ch: $(echo "$r" | grep -E '^(НЕСКІНЧЕННА|КІНЕЦЬ|OK|FAIL)' | tr '\n' ' ')"
run "bal_$s" env BAL_DIFF=$d BAL_CHOICE=$ch BAL_ENDLESS=1 godot --headless --path . -s tests/balance.gd -- $s
done
wait
cat $L/tests.log
fail=0
for c in 1:1:22 2:1:11 3:1:22 4:0:11 5:2:22 7:2:11; do
s=${c%%:*}
echo "seed $c: $(grep -E '^(НЕСКІНЧЕННА|КІНЕЦЬ|OK|FAIL)' $L/bal_$s.log | tr '\n' ' ')"
done
for r in $L/*.rc; do [ "$(cat $r)" = 0 ] || { fail=1; echo "FAILED: $(basename $r .rc)"; cat ${r%.rc}.log | tail -30; }; done
exit $fail
- name: Export Windows exe
if: startsWith(github.ref, 'refs/tags/')
working-directory: source_godot
run: |
# small template without 3D/physics (tools/build_template.sh), kept in the prerelease template-<ver>;
# if it is missing or its checksum differs, fall back to the official 109 MB one
if curl -sSL --fail -o tools/template.exe "http://gitea:3000/${{ github.repository }}/releases/download/template-${GODOT_VER}/TinMerezhi-template.exe" \
# small template without 3D/physics (tools/build_template.sh): from the CI image, else from the prerelease
# template-<ver>; if both are missing or their checksum differs, fall back to the official 109 MB one
cp /opt/tinmerezhi/template.exe tools/template.exe 2>/dev/null || true
if echo "$(cat tools/template.sha256) tools/template.exe" | sha256sum -c - 2>/dev/null; then
echo "small template from the CI image: $(stat -c %s tools/template.exe) bytes"
elif curl -sSL --fail -o tools/template.exe "http://gitea:3000/${{ github.repository }}/releases/download/template-${GODOT_VER}/TinMerezhi-template.exe" \
&& echo "$(cat tools/template.sha256) tools/template.exe" | sha256sum -c -; then
echo "small template: $(stat -c %s tools/template.exe) bytes"
else
@@ -57,20 +75,11 @@ jobs:
python3 tools/fetch_template.py
cp ~/.local/share/godot/export_templates/${GODOT_VER}.stable/windows_release_x86_64.exe tools/template.exe
fi
# emoji font: keep only the characters the game uses (10.6 MB -> ~0.2 MB); without fontTools the full font stays
python3 -c 'import fontTools' 2>/dev/null || python3 -m pip install -q --break-system-packages fonttools \
|| (apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq python3-fonttools >/dev/null) || true
if python3 -c 'import fontTools'; then
python3 tools/subset_emoji.py fonts/NotoColorEmoji.ttf /tmp/emoji.ttf && mv /tmp/emoji.ttf fonts/NotoColorEmoji.ttf
godot --headless --path . --import
else
echo "::warning::fontTools not installed, emoji font not reduced"
fi
# emoji font: keep only the characters the game uses (10.6 MB -> ~0.2 MB), fontTools is in the CI image
python3 tools/subset_emoji.py fonts/NotoColorEmoji.ttf /tmp/emoji.ttf && mv /tmp/emoji.ttf fonts/NotoColorEmoji.ttf
godot --headless --path . --import
cp icon.ico tools/
# official Go toolchain from the Go module proxy, only to build go-winres (puts the icon into the exe)
curl -sSL --fail -o /tmp/go.zip "https://proxy.golang.org/golang.org/toolchain/@v/v0.0.1-go1.24.7.linux-amd64.zip"
unzip -q -o /tmp/go.zip -d /tmp/go
GOBIN=/usr/local/bin /tmp/go/golang.org/toolchain@v0.0.1-go1.24.7.linux-amd64/bin/go install github.com/tc-hib/go-winres@v0.3.3
# go-winres (from the CI image) puts the icon into the exe
(cd tools && go-winres patch --in winres.json --no-backup template.exe)
sed -i "s|^custom_template/release=.*|custom_template/release=\"$PWD/tools/template.exe\"|" export_presets.cfg
# version for the in-game updater: tag v1.0.4 -> 1.0.4
@@ -107,6 +116,4 @@ jobs:
TAG: ${{ github.ref_name }}
run: |
if [ -z "$BUTLER_API_KEY" ] || [ -z "$ITCH_TARGET" ]; then echo "itch.io: no BUTLER_API_KEY / ITCH_TARGET, skipped"; exit 0; fi
curl -sSL --fail -o /tmp/butler.zip https://broth.itch.zone/butler/linux-amd64/15.32.0/archive/default
unzip -q -o /tmp/butler.zip -d /tmp/butler && chmod +x /tmp/butler/butler
/tmp/butler/butler push game_godot "$ITCH_TARGET:windows" --userversion "${TAG#v}"
butler push game_godot "$ITCH_TARGET:windows" --userversion "${TAG#v}"

View File

@@ -0,0 +1,15 @@
# Rebuilds the local CI image tinmerezhi-ci:4.7.2 that build.yml runs in.
# Runs by hand (Actions -> ci-image -> Run workflow) or when the image recipe or the template checksum changes.
name: ci-image
on:
push:
branches: [main]
paths: ['ci/**', 'source_godot/tools/template.sha256', '.gitea/workflows/ci-image.yml']
workflow_dispatch:
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sh ci/build_image.sh

View File

@@ -0,0 +1,54 @@
# Rebuilds the small Windows export template (tools/template_custom.py) from Godot sources on the server,
# replaces TinMerezhi-template.exe in the prerelease template-<ver>, commits the new tools/template.sha256
# and rebuilds the CI image. First build ~15 min on 8 cores, a profile change rebuilds only what it touches,
# an unchanged profile ~1 min (Docker cache). Up to ~8 GB RAM (lto=full), ~6 GB disk in the Docker build cache.
name: template
on:
push:
branches: [main]
paths: ['source_godot/tools/template_custom.py', 'source_godot/tools/build_template.sh']
workflow_dispatch:
env:
GODOT_VER: "4.7.2"
jobs:
template:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build template (Docker, cached toolchain and objects)
run: |
. ci/docker_cli.sh
time docker buildx build --build-arg GODOT_VER=$GODOT_VER -f ci/template.Dockerfile --output type=local,dest=/tmp/tpl source_godot/tools
ls -l /tmp/tpl/template.exe
- name: Upload to the prerelease, commit the checksum
env:
TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
API: http://gitea:3000/api/v1/repos/${{ github.repository }}
run: |
EXE=/tmp/tpl/template.exe
TAG=template-$GODOT_VER
H="Authorization: token $TOKEN"
getid() { python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])'; }
ID=$(curl -sf -H "$H" "$API/releases/tags/$TAG" | getid) || \
ID=$(curl -sf -H "$H" -H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"prerelease\":true,\"body\":\"Small Windows export template (tools/template_custom.py)\"}" "$API/releases" | getid)
# replace the old asset
for a in $(curl -sf -H "$H" "$API/releases/$ID/assets" | python3 -c 'import json,sys; [print(a["id"]) for a in json.load(sys.stdin) if a["name"]=="TinMerezhi-template.exe"]'); do
curl -sSf -X DELETE -H "$H" "$API/releases/$ID/assets/$a"
done
curl -sSf -H "$H" -F "attachment=@$EXE" "$API/releases/$ID/assets?name=TinMerezhi-template.exe" >/dev/null
sha256sum "$EXE" | cut -d' ' -f1 > source_godot/tools/template.sha256
echo "template: $(stat -c %s "$EXE") bytes, sha256 $(cat source_godot/tools/template.sha256)"
git config user.name "Gitea Actions"; git config user.email "actions@localhost"
if ! git diff --quiet source_godot/tools/template.sha256; then
git commit -qm "template.sha256: rebuilt template-$GODOT_VER" source_godot/tools/template.sha256
git pull -q --rebase "http://x:$TOKEN@gitea:3000/${{ github.repository }}.git" main
git push -q "http://x:$TOKEN@gitea:3000/${{ github.repository }}.git" HEAD:main
fi
- name: Rebuild the CI image with the new template
run: sh ci/build_image.sh

1
.gitignore vendored
View File

@@ -18,3 +18,4 @@ cleanup/
# Windows junk
Thumbs.db
desktop.ini
ci/template.exe

18
ci/Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
# CI image for build.yml: Godot headless, the small Windows template, fontTools, go-winres, butler.
# Built on the server by ci/build_image.sh (workflow ci-image.yml) as the local image tinmerezhi-ci:4.7.2.
FROM node:20-bookworm
ARG GODOT_VER=4.7.2
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends python3-fonttools \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sSL --fail -o /tmp/g.zip "https://github.com/godotengine/godot/releases/download/${GODOT_VER}-stable/Godot_v${GODOT_VER}-stable_linux.x86_64.zip" \
&& unzip -q /tmp/g.zip -d /tmp/g && install /tmp/g/Godot_v${GODOT_VER}-stable_linux.x86_64 /usr/local/bin/godot && rm -rf /tmp/g /tmp/g.zip
# go-winres puts the icon into the exe; the Go toolchain is only needed to build it
RUN curl -sSL --fail -o /tmp/go.zip "https://proxy.golang.org/golang.org/toolchain/@v/v0.0.1-go1.24.7.linux-amd64.zip" \
&& unzip -q /tmp/go.zip -d /tmp/go \
&& GOBIN=/usr/local/bin GOPATH=/tmp/gopath GOCACHE=/tmp/gocache /tmp/go/golang.org/toolchain@v0.0.1-go1.24.7.linux-amd64/bin/go install github.com/tc-hib/go-winres@v0.3.3 \
&& rm -rf /tmp/go /tmp/go.zip /tmp/gopath /tmp/gocache
RUN curl -sSL --fail -o /tmp/b.zip https://broth.itch.zone/butler/linux-amd64/15.32.0/archive/default \
&& unzip -q /tmp/b.zip -d /opt/butler && chmod +x /opt/butler/butler && ln -s /opt/butler/butler /usr/local/bin/butler && rm /tmp/b.zip
# the small template from the prerelease template-<ver> (build_image.sh downloads it next to this file)
COPY template.exe /opt/tinmerezhi/template.exe
RUN godot --version && go-winres --help >/dev/null && butler -V && python3 -c 'import fontTools'

13
ci/build_image.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
# Builds the local CI image tinmerezhi-ci:<ver> through the host Docker (the runner mounts /var/run/docker.sock into jobs).
# Run from the repo root inside a Gitea Actions job (needs http://gitea:3000).
set -e
VER="${GODOT_VER:-4.7.2}"
REPO="${GITHUB_REPOSITORY:-junior/TinMerezhi}"
. ci/docker_cli.sh
curl -sSL --fail -o ci/template.exe "http://gitea:3000/$REPO/releases/download/template-$VER/TinMerezhi-template.exe"
echo "$(cat source_godot/tools/template.sha256) ci/template.exe" | sha256sum -c -
docker buildx build --build-arg GODOT_VER="$VER" -t "tinmerezhi-ci:$VER" ci
rm -f ci/template.exe
docker image prune -f >/dev/null # drop the previous untagged image; build cache stays for the next run
docker images tinmerezhi-ci

12
ci/docker_cli.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
# Docker CLI + buildx (BuildKit: layer cache and cache mounts) for jobs; the daemon is the host one via /var/run/docker.sock.
set -e
command -v docker >/dev/null || {
curl -sSL --fail -o /tmp/docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz
tar xzf /tmp/docker.tgz -C /tmp && install /tmp/docker/docker /usr/local/bin/docker
}
docker buildx version >/dev/null 2>&1 || {
mkdir -p ~/.docker/cli-plugins
curl -sSL --fail -o ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.19.3/buildx-v0.19.3.linux-amd64
chmod +x ~/.docker/cli-plugins/docker-buildx
}

16
ci/template.Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
# Small Windows export template (source_godot/tools/template_custom.py), built by template.yml:
# docker buildx build -f ci/template.Dockerfile --output type=local,dest=out source_godot/tools
# The toolchain is a cached layer; the Godot sources and scons objects live in a BuildKit cache mount,
# so a rebuild only recompiles what the new profile changes.
FROM debian:bookworm-slim AS build
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
scons mingw-w64 python3 curl ca-certificates xz-utils >/dev/null \
&& update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix \
&& update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
ARG GODOT_VER=4.7.2
COPY template_custom.py build_template.sh /tools/
RUN --mount=type=cache,target=/work cd /work && GODOT_VER=$GODOT_VER sh /tools/build_template.sh \
&& mkdir /out && cp godot-$GODOT_VER-stable/bin/godot.windows.template_release.x86_64.exe /out/template.exe
FROM scratch
COPY --from=build /out/template.exe /

View File

@@ -69,8 +69,11 @@
**Малий exe (~35 МБ замість ~120 МБ).** CI бере власний шаблон без 3D, фізики, навігації, XR і зайвих модулів
(`tools/template_custom.py`) з пререлізу `template-4.7.2` у Gitea і звіряє `tools/template.sha256`; шрифт емодзі
урізається до символів, що є в коді (`tools/subset_emoji.py`, потрібен `pip install fonttools`). Новий шаблон
(інша версія Godot або інші модулі): `tools/build_template.sh` (~20–40 хв, mingw-w64 + scons), викласти exe в
пререліз `template-<версія>` як `TinMerezhi-template.exe` і оновити `tools/template.sha256`. Пререліз не бачить
(інша версія Godot або інші модулі) збирає на сервері workflow `template.yml`: сам, коли змінюється
`tools/template_custom.py`, або вручну (Actions → template → Run workflow). Він кладе exe в пререліз
`template-<версія>` як `TinMerezhi-template.exe`, комітить новий `tools/template.sha256` і перезбирає CI-образ
(перший раз ~15 хв, без змін профілю ~20 с; кеш Docker зберігає тулчейн, вихідні коди й об'єкти scons, тож зміна профілю перезбирає
лише зачеплене; до ~8 ГБ RAM, ~6 ГБ диска). Пререліз не бачить
автооновлення гри (`/releases/latest` віддає лише звичайні релізи). Нові класи рушія в коді: перевір, що їх не вимкнено.
## Реліз
@@ -78,4 +81,9 @@
Кожен push у `main` — тести й бот балансу в Gitea Actions (`.gitea/workflows/build.yml`).
Тег `v*` (`git tag v1.0.17 && git push origin v1.0.17`) — ще й збірка `TinMerezhi.exe` у Releases
з нотатками зі списку комітів після попереднього тегу, і публікація на itch.io через butler.
Збірка йде в локальному Docker-образі `tinmerezhi-ci:4.7.2` (`ci/Dockerfile`: Godot, малий шаблон, fontTools,
go-winres, butler), тож нічого не завантажується щоразу. Образ перезбирає workflow `ci-image.yml`
(сам при зміні `ci/` або `tools/template.sha256`, або вручну); якщо збірка каже, що образу немає, запусти його.
Тести й шість сідів бота балансу йдуть паралельно (~35 с на push). Тег не повторює тести, якщо цей самий коміт
уже пройшов їх на `main`, тож реліз займає менше хвилини.
Гра бачить новий реліз сама (`updater.gd`).

File diff suppressed because one or more lines are too long

View File

@@ -245,6 +245,7 @@ func _intro(loaded: bool) -> void:
out.newline()
_track(L.t("ТІНЬ МЕРЕЖІ"), "big")
say(L.t("Розробник: %s · © 2026 · ліцензія MIT (команда about)") % DEV, "info")
say(L.t("Версія: %s") % Updater.version_label(), "info")
if loaded:
say(L.t("💾 Збереження завантажено: рівень %d, глава %d/%d, $%d.") % [level, mission + 1, missions.size(), money], "info")
else:
@@ -1833,7 +1834,7 @@ func c_help(a: String) -> void:
if a != "":
say(L.t(Complete.HELP.get(a, L.t("Немає такої команди: %s. Пиши help.") % a)), "info")
return
say(L.t("Команди:\n scan — знайти сервери в мережі\n connect <ip|№> — підключитися (або клік на мапі)\n crack — зламати пароль (вгадай код)\n ls / cat <файл> — файли на сервері / прочитати файл\n download <файл> — завантажити файл\n upload [файл] — залити латку на сервер (Акти IV–V)\n disconnect — відключитися (трасування скидається)\n wipe — стерти свої логи (+10%% трасування). Без цього — розслідування!\n route [add №|auto|clear] — маршрут через зламані сервери: −10%% трасування за вузол\n contract [drop] — контракти (потрібне звання)\n missions / jobs — сюжет / побічні замовлення\n skills / learn <навичка> — %s\n shop / buy <модуль> — %s\n code / write / use <програма> — хакерське ПЗ\n news — новини, у яких є твій слід\n ports / open <порт> — закриті порти сервера / відкрити утилітою\n tools / make <утиліта> — утиліти для портів\n logs / wipe [лог] — твої сліди на сервері / стерти один або всі\n agent [№] — скриптові агенти\n hint / abort — відкрити цифру коду / перервати злам\n firewall / dict — міні-ігри перед зламом\n rivals — суперники-хакери\n choose 1|2 — вибір у фіналі акту\n endless / records — Нескінченна мережа після фіналу / рекорди\n difficulty <рівень> — novice | normal | paranoid (до першого зламу)\n lang uk|en — мова гри\n about — про гру і розробника\n achievements, status, save, sound, settings, update, newgame, clear\nhelp <команда> — докладно про команду. Tab — доповнити команду чи аргумент, ↑/↓ — історія команд.") % [", ".join(PackedStringArray(skill_defs.keys())), ", ".join(PackedStringArray(hw_defs.keys()))], "info")
say(L.t("Команди:\n scan — знайти сервери в мережі\n connect <ip|№> — підключитися (або клік на мапі)\n crack — зламати пароль (вгадай код)\n ls / cat <файл> — файли на сервері / прочитати файл\n download <файл> — завантажити файл\n upload [файл] — залити латку на сервер (Акти IV–V)\n disconnect — відключитися (трасування скидається)\n wipe — стерти свої логи (+10%% трасування). Без цього — розслідування!\n route [add №|auto|clear] — маршрут через зламані сервери: −10%% трасування за вузол\n contract [drop] — контракти (потрібне звання)\n missions / jobs — сюжет / побічні замовлення\n skills / learn <навичка> — %s\n shop / buy <модуль> — %s\n code / write / use <програма> — хакерське ПЗ\n news — новини, у яких є твій слід\n ports / open <порт> — закриті порти сервера / відкрити утилітою\n tools / make <утиліта> — утиліти для портів\n logs / wipe [лог] — твої сліди на сервері / стерти один або всі\n agent [№] — скриптові агенти\n hint / abort — відкрити цифру коду / перервати злам\n firewall / dict — міні-ігри перед зламом\n rivals — суперники-хакери\n choose 1|2 — вибір у фіналі акту\n endless / records — Нескінченна мережа після фіналу / рекорди\n difficulty <рівень> — novice | normal | paranoid (до першого зламу)\n lang uk|en — мова гри\n about — про гру і розробника\n achievements — досягнення (лишаються між проходженнями)\n status — рівень, гроші, звання, обладнання, розслідування\n save — зберегти гру (вона й так зберігається після кожної дії)\n sound — увімкнути або вимкнути звук і музику\n settings — налаштування: гучність, CRT, глітч, шрифт, F11, мова\n update — перевірити й завантажити нову версію гри\n newgame — почати спочатку (досягнення лишаться)\n clear — очистити екран\n help [команда] — цей список або докладно про одну команду\nhelp <команда> — докладно про команду. Tab — доповнити команду чи аргумент, ↑/↓ — історія команд.") % [", ".join(PackedStringArray(skill_defs.keys())), ", ".join(PackedStringArray(hw_defs.keys()))], "info")
func c_scan(_a: String) -> void:
say(L.t("Сканування мережі..."))

View File

@@ -61,6 +61,11 @@ func _run() -> void:
for c in g.cmds:
if not C.HELP.has(c):
ok(false, "довідка є для " + c)
g.run("help")
var lines: PackedStringArray = last(g).split("\n")
for c in g.cmds: # кожна команда має рядок з описом у загальному списку help
if not Array(lines).any(func(l): return "—" in l and RegEx.create_from_string("(^|[ /])" + c + "\\b").search(l.split("—")[0]) != null):
ok(false, "help описує " + c)
g.run("help crack")
ok("РІЗНИХ" in last(g), "help <команда> — докладна довідка")
# ── налаштування ──

View File

@@ -43,6 +43,26 @@ func _run() -> void:
g.sound = false
root.add_child(g)
g.run("update")
# стан оновлень у куті й при старті: нова версія / остання / не вдалося
var u0 = g.updater
if not u0.badge.text.begins_with("dev-збірка") or not g.log_lines.any(func(l): return l[0] == "Версія: dev-збірка"):
print("FAIL версія при старті: ", u0.badge.text)
bad += 1
var body := JSON.stringify({"tag_name": "v9.0.0", "assets": [{"name": "TinMerezhi.exe", "browser_download_url": "x", "size": 5}]}).to_utf8_buffer()
u0._on_checked(HTTPRequest.RESULT_SUCCESS, 200, PackedStringArray(), body, false, true)
if not u0.badge.text.contains("доступна v9.0.0: введи update") or u0.latest.is_empty():
print("FAIL бейдж нової версії: ", u0.badge.text)
bad += 1
u0.latest = {}
body = JSON.stringify({"tag_name": "v0.0.0", "assets": [{"name": "TinMerezhi.exe", "browser_download_url": "x", "size": 5}]}).to_utf8_buffer()
u0._on_checked(HTTPRequest.RESULT_SUCCESS, 200, PackedStringArray(), body, true, true)
if not u0.badge.text.contains("✓ остання версія") or not g.log_lines[-1][0].contains("остання версія"):
print("FAIL бейдж останньої версії: ", u0.badge.text)
bad += 1
u0._on_checked(HTTPRequest.RESULT_CANT_CONNECT, 0, PackedStringArray(), PackedByteArray(), true, true)
if not u0.badge.text.contains("не вдалося перевірити") or not g.log_lines[-1][0].contains("немає з'єднання"):
print("FAIL бейдж збою: ", u0.badge.text)
bad += 1
# обрив: сервер недоступний → зрозуміла помилка, недокачаний файл прибрано
var u = g.updater
u.install = false

View File

@@ -1,13 +1,16 @@
#!/bin/sh
# Builds the small Windows export template (tools/template_custom.py) from Godot sources.
# Needs: python3 + scons, mingw-w64 (posix threads). About 40 min on 4 cores, ~6 GB RAM, ~5 GB disk.
# Result: godot-<ver>-stable/bin/godot.windows.template_release.x86_64.exe -> upload it to the Gitea
# prerelease "template-<ver>" as TinMerezhi-template.exe and put its sha256 into tools/template.sha256.
# Needs: python3 + scons, mingw-w64 (posix threads). ~13 min on 8 cores (first build), ~8 GB RAM, ~5 GB disk.
# Run again in the same folder: the sources are kept and scons rebuilds only what changed.
# Result: godot-<ver>-stable/bin/godot.windows.template_release.x86_64.exe. On the server this is done by
# the workflow template.yml (ci/template.Dockerfile), which also uploads it and updates tools/template.sha256.
set -e
VER="${GODOT_VER:-4.7.2}"
HERE="$(cd "$(dirname "$0")" && pwd)"
curl -sSL --fail -o "godot-$VER.tar.xz" "https://github.com/godotengine/godot/releases/download/$VER-stable/godot-$VER-stable.tar.xz"
tar xf "godot-$VER.tar.xz"
if [ ! -f "godot-$VER-stable/SConstruct" ]; then
curl -sSL --fail -o "godot-$VER.tar.xz" "https://github.com/godotengine/godot/releases/download/$VER-stable/godot-$VER-stable.tar.xz"
tar xf "godot-$VER.tar.xz" && rm "godot-$VER.tar.xz"
fi
cd "godot-$VER-stable"
scons profile="$HERE/template_custom.py" d3d12=no vulkan=no -j"$(nproc)"
scons profile="$HERE/template_custom.py" d3d12=no vulkan=no winrt=no accesskit=no angle=no -j"$(nproc)"
sha256sum bin/godot.windows.template_release.x86_64.exe

View File

@@ -1 +1 @@
84715e06d937dd9b7e84838fa4ef8f4619e0d4f97b7887c72385189db26f67bb
5a3eda63d88b32bd07e6139103232403318ff5c0a8dadc04ea1a8d51bbe7550e

View File

@@ -16,6 +16,10 @@ disable_xr = "yes"
vulkan = "no"
d3d12 = "no"
openxr = "no"
# drivers whose SDKs are not in the source tarball: scons switches them off anyway, this only silences the warnings
winrt = "no"
accesskit = "no"
angle = "no"
modules_enabled_by_default = "no"
# GDScript, fonts (FreeType + HarfBuzz shaping), SVG for the default theme icons, mbedTLS for HTTPS in the updater
module_gdscript_enabled = "yes"

View File

@@ -18,6 +18,7 @@ var dl_t0 := 0 # мс початку завантаження; 0 — не
var dl_sample := [0, 0] # [мс, байти] останнього заміру швидкості
var dl_speed := 0.0 # байт/с, згладжена
var dl_step := 0 # скільки п'ятих частин уже надруковано в термінал
var badge := Label.new() # версія й стан оновлень у правому куті рядка підказок
func _init(game) -> void:
g = game
@@ -29,8 +30,24 @@ func _ready() -> void:
var old := exe() + ".old"
if FileAccess.file_exists(old):
DirAccess.remove_absolute(old)
badge.set_anchors_preset(Control.PRESET_FULL_RECT)
badge.offset_right = -14
badge.horizontal_alignment = HORIZONTAL_ALIGNMENT_RIGHT
badge.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
badge.mouse_filter = Control.MOUSE_FILTER_IGNORE
badge.add_theme_font_size_override("font_size", 14)
g.tip.get_parent().add_child(badge)
if can_self_update():
check(false)
check(true, true)
else:
set_badge(version_label(), "#3a7a4a")
static func version_label() -> String:
return "v" + version() if version() != "dev" else L.t("dev-збірка")
func set_badge(text: String, col: String) -> void:
badge.text = text
badge.add_theme_color_override("font_color", Color(col))
static func version() -> String:
return str(ProjectSettings.get_setting("application/config/version", "dev"))
@@ -53,32 +70,41 @@ static func newer(tag: String, cur: String) -> bool:
return x > y
return false
func check(loud: bool) -> void:
# start — перевірка при запуску гри: результат ще й спливаючим повідомленням
func check(loud: bool, start := false) -> void:
if busy:
return
busy = true
http.request_completed.connect(_on_checked.bind(loud), CONNECT_ONE_SHOT)
set_badge(version_label() + L.t(" · перевірка оновлень…"), "#66ccff")
http.request_completed.connect(_on_checked.bind(loud, start), CONNECT_ONE_SHOT)
if http.request(API, ["Accept: application/json"]) != OK:
http.request_completed.disconnect(_on_checked)
busy = false
if loud:
g.say(L.t("Не вдалося перевірити оновлення."), "warn")
_on_checked(HTTPRequest.RESULT_CANT_CONNECT, 0, PackedStringArray(), PackedByteArray(), loud, start)
func _on_checked(result: int, code: int, _h: PackedStringArray, body: PackedByteArray, loud: bool) -> void:
func _on_checked(result: int, code: int, _h: PackedStringArray, body: PackedByteArray, loud: bool, start := false) -> void:
busy = false
var d = JSON.parse_string(body.get_string_from_utf8()) if result == HTTPRequest.RESULT_SUCCESS and code == 200 else null
if not d is Dictionary:
set_badge(version_label() + L.t(" · не вдалося перевірити оновлення"), "#ff9966")
if loud:
g.say(L.t("Сервер оновлень недоступний (код %d). Спробуй пізніше.") % code, "warn")
g.say(L.t("⚠ Не вдалося перевірити оновлення (%s). Спробуй update пізніше.") % why(result, code, 0, 0), "warn")
if start:
g.toast(L.t("⚠ Оновлення"), L.t("Не вдалося перевірити (%s)") % version_label())
return
var tag := str(d.get("tag_name", ""))
for a in d.get("assets", []):
if a.get("name") == ASSET and newer(tag, version()):
latest = {"tag": tag, "url": a["browser_download_url"], "size": int(a["size"])}
g.say(L.t("⬆ Доступна нова версія %s (у тебе v%s). Введи update, щоб оновитися.") % [tag, version()], "warn")
set_badge(version_label() + L.t(" → ⬆ доступна %s: введи update") % tag, "#ffdd33")
g.say(L.t("⬆ Доступна нова версія %s (у тебе %s). Введи update, щоб оновитися.") % [tag, version_label()], "warn")
if start:
g.toast(L.t("⬆ Доступна %s") % tag, L.t("У тебе %s. Введи update") % version_label())
return
set_badge(version_label() + L.t(" ✓ остання версія"), "#33ff66")
if loud:
g.say(L.t("У тебе остання версія v%s.") % version(), "info")
g.say(L.t("✓ У тебе остання версія v%s.") % version(), "info")
if start:
g.toast(L.t("✓ %s") % version_label(), L.t("У тебе остання версія"))
# команда update
func run() -> void: