Infrastruttura: nome «Rail Enterprise», CI e rilasci su Gitea, documentazione
CI / Build e test (pull_request) Successful in 1m20s
CI / Immagine Docker (pull_request) Successful in 37s

Il progetto adotta il nome «Rail Enterprise» ovunque (codice RailEnterprise.*,
variabili RE_*, intestazioni RESV/RECL, immagine rail-enterprise-server) per
allinearsi al repository Gitea. Aggiunge Gitea Actions sul modello di Chronos:
CI su PR e main, rilascio da tag con gioco Windows (client Godot + server in
server/), server Windows/Linux e immagine Docker nel registro Gitea, nightly.
Aggiunge i riferimenti visivi 06–09, i modelli di PR e issue, l'ADR 0014 e
aggiorna README (comandi locali), STATE e CLAUDE.md. 120 test verdi.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-07 11:14:54 +01:00
1 parent f6c2a17b4d
commit c1a0049bcf
300 files changed
+1602 -1045

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
name: Difetto
about: Qualcosa non funziona nel gioco, nel server o negli strumenti
title: "[Difetto] "
labels: ["bug"]
body:
- type: textarea
id: cosa
attributes:
label: Cosa succede
description: Cosa hai visto e cosa ti aspettavi.
validations:
required: true
- type: textarea
id: passi
attributes:
label: Come riprodurlo
description: Passi, seme della mappa, difficoltà, salvataggio o registro dei comandi (--record) se disponibili.
- type: input
id: versione
attributes:
label: Versione
description: Versione del gioco o tag dell'immagine Docker.
- type: dropdown
id: dove
attributes:
label: Dove
options:
- Gioco desktop (partita locale)
- Server Docker
- Strumenti (railenterprise-tools)
- Altro
+17
View File
@@ -0,0 +1,17 @@
name: Funzionalità
about: Un lavoro della roadmap o una nuova idea
title: "[F?] "
labels: ["enhancement"]
body:
- type: textarea
id: obiettivo
attributes:
label: Obiettivo
description: Cosa deve fare e quale sezione di docs/GUIDA.md copre.
validations:
required: true
- type: textarea
id: accettazione
attributes:
label: Criteri di accettazione
description: Test o misure che dicono quando è finito.
+16
View File
@@ -0,0 +1,16 @@
## Cosa cambia e perché
<!-- Una o due frasi. Collega la issue: «Chiude #N». -->
## Fase
<!-- F0…F7 secondo docs/GUIDA.md §16, oppure «infrastruttura» / «documentazione». -->
## Verifica
- [ ] `scripts/build.sh` verde (zero NuGet, warning come errori)
- [ ] `scripts/test.sh` verde (indica eventuali test lunghi saltati)
- [ ] `docs/STATE.md` aggiornato se cambia lo stato della fase
- [ ] ADR in `docs/adr/` per ogni decisione non coperta dalla guida
- [ ] Nessun numero magico nella simulazione (parametri in `data/*.json`), determinismo rispettato
- [ ] Schermate in `docs/screenshots/` se cambia l'interfaccia
+104
View File
@@ -0,0 +1,104 @@
name: CI
# Gitea Actions (ADR 0014). Il runner è act_runner in modalità Docker sul server Linux che ospita Gitea: ogni job
# gira in un container. I job .NET usano l'immagine dell'SDK e fanno il checkout con git, perché le azioni JavaScript
# richiedono Node.js, assente in quell'immagine. Nessuna cache e nessun artefatto: il risultato è il verde o il rosso.
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
env:
DOTNET_NOLOGO: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
BUILD_CPUS: "4"
jobs:
build:
name: Build e test
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:10.0
timeout-minutes: 90
defaults:
run:
shell: bash
steps:
- name: Checkout
env:
TOKEN: ${{ github.token }}
run: |
git config --global --add safe.directory "$PWD"
git init -q .
git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}"
git checkout -q FETCH_HEAD
git log -1 --format='%h %s'
# Core e Protocol compilano anche per net8.0 (client Godot): serve il targeting pack 8.0, che l'SDK 10 scarica
# da solo come pacchetto di riferimento. Nessun PackageReference è ammesso (check-nuget).
- name: Zero pacchetti NuGet
run: scripts/check-nuget.sh
- name: Build Release (warning come errori)
run: dotnet build RailEnterprise.sln -c Release -m:"$BUILD_CPUS" -nologo
- name: Validazione dei dati
run: dotnet run --project src/RailEnterprise.Tools -c Release --no-build -- validate-data --data data
# Sulle PR i test lunghi (accettazioni pluriennali) si saltano; su main gira la suite completa.
- name: Test
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
dotnet run --project tests/RailEnterprise.Tests -c Release --no-build -- --skip-slow
else
dotnet run --project tests/RailEnterprise.Tests -c Release --no-build
fi
# Il server per Windows (quello che il gioco desktop avvia da «server/») si compila anche qui.
- name: Server Windows x64 (compilazione incrociata)
run: dotnet publish src/RailEnterprise.Server -c Release -r win-x64 --self-contained -p:ReServerOnly=true -o out/server-win-x64 -nologo
# Il client Godot compila con il proprio SDK (Godot.NET.Sdk da NuGet, unica eccezione ammessa): basta dotnet.
- name: Client Godot (compilazione C#)
run: dotnet build client/RailEnterprise.Client/RailEnterprise.Client.csproj -c Release -nologo
docker:
name: Immagine Docker
needs: build
runs-on: ubuntu-latest
timeout-minutes: 45
env:
NAME: re-ci-${{ github.run_id }}
steps:
- name: Checkout
env:
TOKEN: ${{ github.token }}
run: |
git config --global --add safe.directory "$PWD"
git init -q .
git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}"
git checkout -q FETCH_HEAD
- name: Build dell'immagine
run: docker build -f docker/Dockerfile -t "$NAME:ci" .
# Il container del job e quello del server non condividono la rete: la prova usa l'healthcheck interno.
- name: Prova di avvio (/health)
run: |
docker run -d --name "$NAME" -e RE_TOKEN=ci "$NAME:ci"
for i in $(seq 1 60); do
if docker exec "$NAME" dotnet RailEnterprise.Server.dll --healthcheck; then echo "server sano"; exit 0; fi
sleep 2
done
docker logs "$NAME" | tail -50
exit 1
- name: Pulizia
if: always()
run: |
docker rm -f "$NAME" 2> /dev/null || true
docker image rm "$NAME:ci" 2> /dev/null || true
+55
View File
@@ -0,0 +1,55 @@
name: Immagine nightly
# L'immagine del server di main come :nightly nel registro container di Gitea (ADR 0014). Mai una release.
on:
schedule:
- cron: "37 2 * * *"
workflow_dispatch:
permissions:
contents: read
packages: write
env:
PUBLIC_URL: ${{ vars.PUBLIC_URL || 'https://gitea.encke-hake.ts.net' }}
jobs:
nightly:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
env:
TOKEN: ${{ github.token }}
run: |
git config --global --add safe.directory "$PWD"
git init -q .
git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}"
git checkout -q FETCH_HEAD
- name: Accesso al registro
env:
REGISTRY: ${{ vars.REGISTRY }}
USER: ${{ vars.REGISTRY_USER || github.actor }}
TOKEN: ${{ secrets.REGISTRY_TOKEN || github.token }}
run: |
registry="${REGISTRY:-$(printf '%s' "$PUBLIC_URL" | sed -E 's#^[a-z]+://##; s#/.*$##')}"
owner="$(printf '%s' "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
{ echo "REGISTRY_HOST=$registry"; echo "IMAGE=$registry/$owner/rail-enterprise-server"; } >> "$GITHUB_ENV"
if ! printf '%s' "$TOKEN" | docker login "$registry" -u "$USER" --password-stdin; then
echo "::error title=Registro::Accesso a $registry rifiutato: serve il segreto REGISTRY_TOKEN."
exit 1
fi
- name: Build e push
run: |
docker build -f docker/Dockerfile --build-arg RE_VERSION="0.0.0-nightly.${{ github.run_number }}" -t "$IMAGE:nightly" .
docker push "$IMAGE:nightly"
- name: Pulizia
if: always()
run: |
docker image rm "$IMAGE:nightly" 2> /dev/null || true
docker logout "$REGISTRY_HOST" || true
+213
View File
@@ -0,0 +1,213 @@
name: Release
# Un tag vMAJOR.MINOR.PATCH[-PRERELEASE] costruisce, prova e pubblica tutto (ADR 0014):
# - sulla release Gitea: il gioco desktop per Windows (client Godot + server locale in «server/»), il server per
# Windows e per Linux, SHA256SUMS e le note di rilascio;
# - nel registro container di Gitea: l'immagine del server con il tag della versione e, per le versioni stabili, :latest.
# La versione viene dal tag e sovrascrive quella di Directory.Build.props, che resta la versione di sviluppo.
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Tag esistente da (ri)pubblicare, per esempio v0.6.0"
required: true
permissions:
contents: write
packages: write
env:
DOTNET_NOLOGO: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
BUILD_CPUS: "4"
TAG: ${{ github.event.inputs.tag || github.ref_name }}
PUBLIC_URL: ${{ vars.PUBLIC_URL || 'https://gitea.encke-hake.ts.net' }}
# Versione di Godot .NET usata per esportare il client (deve coincidere con Godot.NET.Sdk nel csproj del client).
GODOT_VERSION: "4.7.2"
GODOT_MIRROR: ${{ vars.GODOT_MIRROR || 'https://github.com/godotengine/godot-builds/releases/download' }}
jobs:
release:
name: Build, test e pubblicazione
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:10.0
timeout-minutes: 150
defaults:
run:
shell: bash
outputs:
version: ${{ steps.version.outputs.version }}
prerelease: ${{ steps.version.outputs.prerelease }}
steps:
- name: Versione
id: version
run: |
semver='^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?$'
if [[ ! "$TAG" =~ $semver ]]; then
echo "::error title=Release::Il tag '$TAG' non è vMAJOR.MINOR.PATCH o vMAJOR.MINOR.PATCH-PRERELEASE"
exit 1
fi
version="${TAG#v}"
prerelease=false
if [[ "$version" == *-* ]]; then prerelease=true; fi
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "prerelease=$prerelease" >> "$GITHUB_OUTPUT"
{ echo "VERSION=$version"; echo "PRERELEASE=$prerelease"; } >> "$GITHUB_ENV"
# Storia completa e tag: le note di rilascio elencano i commit dal tag precedente.
- name: Checkout
env:
TOKEN: ${{ github.token }}
run: |
git config --global --add safe.directory "$PWD"
git init -q .
git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --tags origin
git checkout -q "refs/tags/$TAG"
git log -1 --format='%h %s'
- name: Strumenti di sistema
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends unzip zip curl jq libfontconfig1 > /dev/null
- name: Build e test
run: |
scripts/check-nuget.sh
dotnet build RailEnterprise.sln -c Release -m:"$BUILD_CPUS" -nologo -p:Version="$VERSION"
dotnet run --project src/RailEnterprise.Tools -c Release --no-build -- validate-data --data data
dotnet run --project tests/RailEnterprise.Tests -c Release --no-build
- name: Server autonomi (win-x64, linux-x64)
run: |
for rid in win-x64 linux-x64; do
dotnet publish src/RailEnterprise.Server -c Release -r "$rid" --self-contained -p:ReServerOnly=true \
-p:Version="$VERSION" -o "out/server-$rid" -nologo
done
# Godot .NET senza interfaccia esporta il client per Windows. Il server per Windows va in «server/» accanto al
# gioco: è lì che LocalServerLauncher lo cerca per la partita locale.
- name: Gioco desktop per Windows (esportazione Godot)
run: |
set -euo pipefail
tools="$RUNNER_TEMP/godot"
mkdir -p "$tools"
base="$GODOT_MIRROR/$GODOT_VERSION-stable"
curl -fsSL -o "$tools/godot.zip" "$base/Godot_v$GODOT_VERSION-stable_mono_linux_x86_64.zip"
curl -fsSL -o "$tools/templates.tpz" "$base/Godot_v$GODOT_VERSION-stable_mono_export_templates.tpz"
unzip -q "$tools/godot.zip" -d "$tools"
godot="$(find "$tools" -type f -name "Godot_v*_mono_linux.x86_64" | head -n1)"
chmod +x "$godot"
templates="$HOME/.local/share/godot/export_templates/$GODOT_VERSION.stable.mono"
mkdir -p "$templates"
unzip -q "$tools/templates.tpz" -d "$tools/tpl"
cp -r "$tools/tpl/templates/." "$templates/"
cd client/RailEnterprise.Client
mkdir -p export/windows
"$godot" --headless --import || true
"$godot" --headless --export-release "Windows Desktop" export/windows/RailEnterprise.exe
test -f export/windows/RailEnterprise.exe
cp -r "../../out/server-win-x64" export/windows/server
- name: Pacchetti
run: |
set -euo pipefail
mkdir -p out/release
(cd client/RailEnterprise.Client/export/windows && zip -qr "$OLDPWD/out/release/RailEnterprise-$VERSION-windows-x64.zip" .)
(cd out/server-win-x64 && zip -qr "$OLDPWD/out/release/RailEnterprise-Server-$VERSION-windows-x64.zip" .)
tar -C out/server-linux-x64 -czf "out/release/RailEnterprise-Server-$VERSION-linux-x64.tar.gz" .
cp docker/docker-compose.yml "out/release/docker-compose.yml"
cp docker/unraid-template.xml "out/release/unraid-template.xml"
(cd out/release && sha256sum -- * > SHA256SUMS && cat SHA256SUMS)
- name: Note di rilascio
run: |
prev="$(git describe --tags --abbrev=0 "$TAG^" 2> /dev/null || true)"
owner="$(printf '%s' "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
host="$(printf '%s' "$PUBLIC_URL" | sed -E 's#^[a-z]+://##; s#/.*$##')"
{
echo "## Rail Enterprise $VERSION"
echo
echo "- **Gioco desktop (Windows x64):** scarica \`RailEnterprise-$VERSION-windows-x64.zip\`, estrai e avvia \`RailEnterprise.exe\`. «Partita locale» avvia da sola il server in \`server/\`."
echo "- **Server Docker:** \`docker pull $host/$owner/rail-enterprise-server:$VERSION\` (vedi \`docker-compose.yml\` e \`unraid-template.xml\`)."
echo "- **Server senza Docker:** \`RailEnterprise-Server-$VERSION-*.zip|tar.gz\`, poi \`RailEnterprise.Server --data ./dati\` con \`RE_TOKEN\` impostato."
echo
if [ -n "$prev" ]; then echo "### Modifiche da $prev"; else echo "### Modifiche"; fi
echo
git log --no-merges --format='- %s (%h)' ${prev:+$prev..}"$TAG"
} > out/release-notes.md
cat out/release-notes.md
# Creata come bozza, pubblicata quando tutti i file sono caricati.
- name: Release Gitea
env:
TOKEN: ${{ github.token }}
run: |
set -euo pipefail
api="${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
auth="Authorization: token $TOKEN"
existing="$(curl -fsS -H "$auth" "$api/releases/tags/$TAG" 2> /dev/null | jq -r '.id // empty' || true)"
if [ -n "$existing" ]; then curl -fsS -X DELETE -H "$auth" "$api/releases/$existing"; fi
body="$(jq -n --arg tag "$TAG" --arg name "Rail Enterprise $VERSION" --rawfile body out/release-notes.md \
--argjson pre "$PRERELEASE" '{tag_name:$tag, name:$name, body:$body, draft:true, prerelease:$pre}')"
id="$(curl -fsS -X POST -H "$auth" -H 'Content-Type: application/json' -d "$body" "$api/releases" | jq -r .id)"
for f in out/release/*; do
name="$(basename "$f")"
curl -fsS -X POST -H "$auth" -F "attachment=@$f" "$api/releases/$id/assets?name=$name" > /dev/null
echo "caricato $name"
done
curl -fsS -X PATCH -H "$auth" -H 'Content-Type: application/json' -d '{"draft":false}' "$api/releases/$id" > /dev/null
echo "Release pubblicata: $PUBLIC_URL/${{ github.repository }}/releases/tag/$TAG"
image:
name: Immagine del server
needs: release
runs-on: ubuntu-latest
timeout-minutes: 60
env:
VERSION: ${{ needs.release.outputs.version }}
PRERELEASE: ${{ needs.release.outputs.prerelease }}
steps:
- name: Checkout
env:
TOKEN: ${{ github.token }}
run: |
git config --global --add safe.directory "$PWD"
git init -q .
git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "refs/tags/$TAG:refs/tags/$TAG"
git checkout -q "refs/tags/$TAG"
- name: Accesso al registro
env:
REGISTRY: ${{ vars.REGISTRY }}
USER: ${{ vars.REGISTRY_USER || github.actor }}
TOKEN: ${{ secrets.REGISTRY_TOKEN || github.token }}
run: |
registry="${REGISTRY:-$(printf '%s' "$PUBLIC_URL" | sed -E 's#^[a-z]+://##; s#/.*$##')}"
owner="$(printf '%s' "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
{ echo "REGISTRY_HOST=$registry"; echo "IMAGE=$registry/$owner/rail-enterprise-server"; } >> "$GITHUB_ENV"
if ! printf '%s' "$TOKEN" | docker login "$registry" -u "$USER" --password-stdin; then
# il token del workflow (utente gitea-actions) non può scrivere i pacchetti di un'organizzazione
echo "::error title=Registro::Accesso a $registry rifiutato. Serve il segreto REGISTRY_TOKEN (organizzazione o repository): un token di un utente che può scrivere i pacchetti (scope package: read e write)."
exit 1
fi
- name: Build e push
run: |
docker build -f docker/Dockerfile --build-arg RE_VERSION="$VERSION" -t "$IMAGE:$VERSION" .
docker push "$IMAGE:$VERSION"
# Compose e Unraid seguono :latest, che si muove solo con le versioni stabili.
if [ "$PRERELEASE" != "true" ]; then
docker tag "$IMAGE:$VERSION" "$IMAGE:latest"
docker push "$IMAGE:latest"
fi
- name: Pulizia
if: always()
run: |
docker image rm "$IMAGE:$VERSION" "$IMAGE:latest" 2> /dev/null || true
docker logout "$REGISTRY_HOST" || true
+5 -5
View File
@@ -428,11 +428,11 @@ FodyWeavers.xsd
*.msm
*.msp
# --- Via Ferrea ---
# --- Rail Enterprise ---
# Godot
.godot/
client/ViaFerrea.Client/.godot/
client/ViaFerrea.Client/export/
client/RailEnterprise.Client/.godot/
client/RailEnterprise.Client/export/
# Output degli strumenti e dei test
/out/
/artifacts/
@@ -442,6 +442,6 @@ docker/data/
# Salvataggi locali di sviluppo
/saves/
# Dati copiati nel progetto Godot dalla build del client
client/ViaFerrea.Client/data/
client/RailEnterprise.Client/data/
# Traduzioni generate da Godot importando strings.csv
client/ViaFerrea.Client/assets/i18n/*.translation
client/RailEnterprise.Client/assets/i18n/*.translation
+17 -10
View File
@@ -1,4 +1,4 @@
# CLAUDE.md — Via Ferrea
# CLAUDE.md — Rail Enterprise
Gestionale ferroviario dall'alto: motore headless in C# (.NET 10), server ASP.NET Core in Docker, client Godot 4 .NET.
La specifica vincolante è `docs/GUIDA.md`; lo stato dei lavori è in `docs/STATE.md`. Leggili entrambi a inizio sessione.
@@ -8,8 +8,8 @@ La specifica vincolante è `docs/GUIDA.md`; lo stato dei lavori è in `docs/STAT
```
scripts/build.sh # check-nuget + build Release della soluzione
scripts/test.sh [filtri] # build + validate-data + tutti i test (--skip-slow, --serial)
dotnet run --project tests/ViaFerrea.Tests -- --list
dotnet run --project src/ViaFerrea.Tools -- <comando> # validate-data, genmap, profile, simulate, bench, replay
dotnet run --project tests/RailEnterprise.Tests -- --list
dotnet run --project src/RailEnterprise.Tools -- <comando> # validate-data, genmap, profile, simulate, bench, replay
```
## Regole non negoziabili
@@ -25,14 +25,21 @@ dotnet run --project src/ViaFerrea.Tools -- <comando> # validate-data, genmap,
## Flusso di lavoro
- Una fase alla volta (sezione 16 della guida). Fine fase: build verde, test verdi, `docs/STATE.md` aggiornato, commit `F<n>: <cosa>`.
- Nuovi test nel harness interno (`[Test]`, `Assert`), un file per area in `tests/ViaFerrea.Tests/<Area>/`.
- Nuovi test nel harness interno (`[Test]`, `Assert`), un file per area in `tests/RailEnterprise.Tests/<Area>/`.
- I test lunghi si marcano `[Test(Slow = true)]`.
## Gitea, CI e rilasci
- Repository `BalboSoft/Rail_Enterprise` su Gitea (`gitea.encke-hake.ts.net`, in LAN `192.168.30.23:3000`). Il progetto si chiamava «Via Ferrea»: il nome attuale è «Rail Enterprise» ovunque (ADR 0014).
- Ogni lavoro ha una issue nel milestone della sua fase (F0…F7, «Infrastruttura») e nel progetto «Roadmap»; PR verso `main` con `.gitea/PULL_REQUEST_TEMPLATE.md`, merge con la CI verde.
- `.gitea/workflows/ci.yml` (PR e main), `release.yml` (tag `vX.Y.Z`: gioco Windows + server + immagine Docker), `nightly.yml`. Segreto di organizzazione `REGISTRY_TOKEN`.
- La Wiki su Gitea (guida del giocatore, schermate) si aggiorna quando cambia l'interfaccia.
## Mappa del codice
- `src/ViaFerrea.Core` — Common, Time, Data, Map, Economy, Rail, Commands, Simulation, Persistence (vedi `docs/ARCHITECTURE.md`).
- `src/ViaFerrea.Protocol` — frame e messaggi (vedi `docs/PROTOCOL.md`).
- `src/ViaFerrea.Server` — GameLoop, sessioni WebSocket, API HTTP.
- `src/ViaFerrea.Tools` — `viaferrea-tools`.
- `client/ViaFerrea.Client` — progetto Godot.
- `reference/` — immagini di riferimento visivo vincolanti.
- `src/RailEnterprise.Core` — Common, Time, Data, Map, Economy, Rail, Commands, Simulation, Persistence (vedi `docs/ARCHITECTURE.md`).
- `src/RailEnterprise.Protocol` — frame e messaggi (vedi `docs/PROTOCOL.md`).
- `src/RailEnterprise.Server` — GameLoop, sessioni WebSocket, API HTTP.
- `src/RailEnterprise.Tools` — `railenterprise-tools`.
- `client/RailEnterprise.Client` — progetto Godot.
- `reference/` — immagini di riferimento visivo vincolanti (01–09: mappa, binari, treni, edifici, palette, mercato, industria, scalata, connessione).
+4 -4
View File
@@ -1,5 +1,5 @@
<Project>
<!-- Impostazioni comuni a tutti i progetti .NET di Via Ferrea (il client Godot ha il proprio). -->
<!-- Impostazioni comuni a tutti i progetti .NET di Rail Enterprise (il client Godot ha il proprio). -->
<PropertyGroup>
<!-- Unica fonte della versione: letta anche da scripts/publish-image.sh e dal protocollo. -->
<Version>0.1.0</Version>
@@ -9,9 +9,9 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<InvariantGlobalization>true</InvariantGlobalization>
<Deterministic>true</Deterministic>
<Authors>Via Ferrea</Authors>
<Product>Via Ferrea</Product>
<Copyright>Via Ferrea</Copyright>
<Authors>Rail Enterprise</Authors>
<Product>Rail Enterprise</Product>
<Copyright>Rail Enterprise</Copyright>
<SatelliteResourceLanguages>it;en</SatelliteResourceLanguages>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<!-- Nessun pacchetto NuGet: niente audit verso feed esterni. -->
+76 -37
View File
@@ -1,63 +1,101 @@
# Via Ferrea
# Rail Enterprise
Gestionale ferroviario visto dall'alto, ambientato dal 1850 in una regione immaginaria: binari con pendenze, trincee, ponti e gallerie; economia con prezzi globali e locali; pendolarismo di lavoratori e personale; manutenzione per componente di treni e industrie; concorrenti IA, borsa e scalate; un mondo che non finisce mai.
Il motore di gioco è headless e deterministico (C# su .NET 10) e gira sia dentro il client desktop (Godot 4 .NET) sia come server Linux in Docker.
Il motore di gioco è headless e deterministico (C# su .NET 10) e gira sia dentro il gioco desktop (client Godot 4 .NET, che avvia un server locale) sia come server Linux in Docker.
## Requisiti
![Linea con ponte nel client](docs/screenshots/f3-linea-con-ponte.jpg)
## Scaricare
Ogni versione è sulla pagina [Release](https://gitea.encke-hake.ts.net/BalboSoft/Rail_Enterprise/releases):
| File | Per |
|---|---|
| `RailEnterprise-<versione>-windows-x64.zip` | il gioco desktop: estrai e avvia `RailEnterprise.exe` («Partita locale» avvia il server in `server/`) |
| `RailEnterprise-Server-<versione>-windows-x64.zip` / `-linux-x64.tar.gz` | il server senza Docker |
| immagine `gitea.encke-hake.ts.net/balbosoft/rail-enterprise-server:<versione>` | il server in Docker / Unraid |
## Requisiti per lo sviluppo
- .NET SDK 10.x (`dotnet --version`)
- Godot 4 .NET, versione stabile più recente, come `godot` nel PATH (solo per il client)
- Godot 4.7 .NET come `godot` nel PATH (solo per avviare o esportare il client)
- Docker (solo per l'immagine del server)
## Compilare e provare
```
scripts/build.sh # controllo "zero NuGet" + build Release
scripts/test.sh # validazione dei dati + tutti i test
```bash
scripts/build.sh # controllo "zero NuGet" + build Release
scripts/test.sh # validazione dei dati + tutti i test
scripts/test.sh --skip-slow # senza i test di accettazione pluriennali
```
Su Windows: `./scripts/build.ps1 -Test`.
Su Windows (PowerShell): `./scripts/build.ps1 -Test`.
## Avviare in locale
**Server da sorgente** (porta 7400, token `prova`, salvataggi in `./dati-locali`):
```bash
dotnet run --project src/RailEnterprise.Server -c Release -- --port 7400 --token prova --data ./dati-locali
```
Poi `http://localhost:7400/health` e `http://localhost:7400/metrics`. Con `--local` il server sceglie una porta libera e stampa `LISTENING <porta>` (è il modo in cui lo avvia il client).
**Server in Docker** (dalla radice del repository):
```bash
docker compose -f docker/docker-compose.yml up -d --build
```
Variabili: `RE_TOKEN` (obbligatoria in rete), `RE_DIFFICULTY`, `RE_SEED`, `RE_MAP_SIZE`, `RE_DATA_DIR` (default `/data`), `RE_AUTOSAVE_MIN`, `RE_TICK_MS`, `RE_LOG_LEVEL`.
**Client Godot**:
```bash
dotnet build src/RailEnterprise.Server -c Release
dotnet build client/RailEnterprise.Client/RailEnterprise.Client.csproj
godot --path client/RailEnterprise.Client
```
Dal menu, «Partita locale» avvia il server compilato (`src/RailEnterprise.Server/bin/Release/...` oppure `RE_SERVER_PATH`); «Connetti a un server» usa indirizzo e token di un server già avviato.
**Collaudi senza mani**:
```bash
dotnet run --project src/RailEnterprise.Tools -- smoke --url ws://127.0.0.1:7400/ws --token prova
GODOT=/percorso/godot scripts/client-autopilot.sh
```
## Strumenti
`dotnet run --project src/RailEnterprise.Tools -- <comando>`: `validate-data`, `genmap`, `profile`, `simulate`, `bench`, `smoke`, `replay` (vedi la [Wiki](https://gitea.encke-hake.ts.net/BalboSoft/Rail_Enterprise/wiki)).
## Struttura
| Cartella | Contenuto |
|---|---|
| `src/ViaFerrea.Core` | simulazione, dati, mappa, economia, rete ferroviaria, salvataggi |
| `src/ViaFerrea.Protocol` | protocollo binario su WebSocket |
| `src/ViaFerrea.Server` | server autorevole (Kestrel) |
| `src/ViaFerrea.Tools` | `viaferrea-tools`: validate-data, genmap, profile, simulate, bench, smoke, replay |
| `tests/ViaFerrea.Tests` | harness di test interno e scenari |
| `client/ViaFerrea.Client` | client Godot |
| `src/RailEnterprise.Core` | simulazione, dati, mappa, economia, rete ferroviaria, salvataggi |
| `src/RailEnterprise.Protocol` | protocollo binario su WebSocket |
| `src/RailEnterprise.Server` | server autorevole (Kestrel) |
| `src/RailEnterprise.Tools` | `railenterprise-tools` |
| `tests/RailEnterprise.Tests` | harness di test interno e scenari |
| `client/RailEnterprise.Client` | client Godot |
| `data/` | parametri di gioco in JSON con schema |
| `docker/` | Dockerfile, compose, template Unraid |
| `docs/` | guida, GDD, architettura, protocollo, stato, ADR |
| `reference/` | immagini di riferimento visivo |
| `docs/` | guida, GDD, architettura, protocollo, stato, ADR, schermate |
| `reference/` | immagini di riferimento visivo vincolanti (01–09) |
| `.gitea/` | workflow di CI e rilascio, modelli di PR e issue |
## Server e client in locale
## CI e rilasci
```
dotnet run --project src/ViaFerrea.Server -- --local --token prova # stampa LISTENING <porta>
dotnet build client/ViaFerrea.Client/ViaFerrea.Client.csproj # poi apri client/ViaFerrea.Client con Godot 4.7 .NET
```
- **CI** (`.gitea/workflows/ci.yml`): su ogni PR e su `main` — zero NuGet, build, dati, test, server per Windows, client, immagine Docker con healthcheck.
- **Rilascio** (`.gitea/workflows/release.yml`): `git tag v0.6.0 && git push origin v0.6.0` pubblica la release con il gioco per Windows, i server e `SHA256SUMS`, e l'immagine Docker `:<versione>` (`:latest` per le versioni stabili).
- **Nightly** (`.gitea/workflows/nightly.yml`): immagine `:nightly` da `main` ogni notte.
Dal menu del client, «Partita locale» avvia da solo il server compilato (`src/ViaFerrea.Server/bin/...` oppure `VF_SERVER_PATH`).
Collaudi senza mani: `dotnet run --project src/ViaFerrea.Tools -- smoke --url ws://127.0.0.1:7400/ws --token prova`
contro un server in esecuzione; `GODOT=/percorso/godot scripts/client-autopilot.sh` per il client con schermate.
Dettagli in [ADR 0014](docs/adr/0014-nome-ci-e-rilasci.md).
![Linea con ponte nel client](docs/screenshots/f3-linea-con-ponte.jpg)
## Server in Docker
```
docker compose -f docker/docker-compose.yml up -d # oppure scripts/publish-image.sh per il registry Gitea
curl http://localhost:7400/health
curl http://localhost:7400/metrics
```
Variabili principali: `VF_TOKEN` (obbligatoria in rete), `VF_DIFFICULTY`, `VF_SEED`, `VF_MAP_SIZE`, `VF_DATA_DIR` (default `/data`).
Il server parla WebSocket in chiaro: per l'uso fuori da una rete privata mettilo dietro un reverse proxy con TLS (per esempio Caddy, Traefik o Nginx Proxy Manager su Unraid) ed esponi solo `wss://`.
Il server parla WebSocket in chiaro: fuori da una rete privata mettilo dietro un reverse proxy con TLS ed esponi solo `wss://`.
## Documentazione
@@ -67,3 +105,4 @@ Il server parla WebSocket in chiaro: per l'uso fuori da una rete privata mettilo
- `docs/PROTOCOL.md` — protocollo di rete
- `docs/STATE.md` — stato dei lavori
- `docs/adr/` — decisioni architetturali
- [Wiki](https://gitea.encke-hake.ts.net/BalboSoft/Rail_Enterprise/wiki) — guida del giocatore e schermate
+5 -5
View File
@@ -5,17 +5,17 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViaFerrea.Core", "src\ViaFerrea.Core\ViaFerrea.Core.csproj", "{D50BCC13-4F79-4DB1-BD16-5E7576006DA9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RailEnterprise.Core", "src\RailEnterprise.Core\RailEnterprise.Core.csproj", "{D50BCC13-4F79-4DB1-BD16-5E7576006DA9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViaFerrea.Protocol", "src\ViaFerrea.Protocol\ViaFerrea.Protocol.csproj", "{7582B640-61C0-47F8-9A2E-B3607B01FD35}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RailEnterprise.Protocol", "src\RailEnterprise.Protocol\RailEnterprise.Protocol.csproj", "{7582B640-61C0-47F8-9A2E-B3607B01FD35}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViaFerrea.Server", "src\ViaFerrea.Server\ViaFerrea.Server.csproj", "{D9E37057-86E8-4DDE-B3DA-EDC44F4EAE30}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RailEnterprise.Server", "src\RailEnterprise.Server\RailEnterprise.Server.csproj", "{D9E37057-86E8-4DDE-B3DA-EDC44F4EAE30}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViaFerrea.Tools", "src\ViaFerrea.Tools\ViaFerrea.Tools.csproj", "{509F4E00-74B7-4FFB-84E0-3CB1F671A70E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RailEnterprise.Tools", "src\RailEnterprise.Tools\RailEnterprise.Tools.csproj", "{509F4E00-74B7-4FFB-84E0-3CB1F671A70E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0AB3BF05-4346-4AA6-1389-037BE0695223}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViaFerrea.Tests", "tests\ViaFerrea.Tests\ViaFerrea.Tests.csproj", "{BE4E0868-2350-4C87-968E-E424D4DEB1C5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RailEnterprise.Tests", "tests\RailEnterprise.Tests\RailEnterprise.Tests.csproj", "{BE4E0868-2350-4C87-968E-E424D4DEB1C5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -1,13 +1,13 @@
<Project Sdk="Godot.NET.Sdk/4.7.2">
<!--
Client Godot di Via Ferrea: fuori dalla soluzione principale. Usa Core e Protocol (net8.0)
Client Godot di Rail Enterprise: fuori dalla soluzione principale. Usa Core e Protocol (net8.0)
per le anteprime e per la copia locale del mondo; nessuna logica di gioco.
-->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<RootNamespace>ViaFerrea.Client</RootNamespace>
<RootNamespace>RailEnterprise.Client</RootNamespace>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
@@ -16,8 +16,8 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\ViaFerrea.Core\ViaFerrea.Core.csproj" />
<ProjectReference Include="..\..\src\ViaFerrea.Protocol\ViaFerrea.Protocol.csproj" />
<ProjectReference Include="..\..\src\RailEnterprise.Core\RailEnterprise.Core.csproj" />
<ProjectReference Include="..\..\src\RailEnterprise.Protocol\RailEnterprise.Protocol.csproj" />
</ItemGroup>
<!-- I file dati del gioco entrano nel progetto Godot (res://data) prima di ogni build. -->
@@ -282,7 +282,7 @@ Seleziona un treno,,Select a train
Seleziona un treno e un deposito,,Select a train and a depot
Sentiment del mercato,,Market sentiment
Serve un deposito,,A depot is required
Server locale non trovato: compila src/ViaFerrea.Server o imposta VF_SERVER_PATH.,,Local server not found: build src/ViaFerrea.Server or set VF_SERVER_PATH.
Server locale non trovato: compila src/RailEnterprise.Server o imposta RE_SERVER_PATH.,,Local server not found: build src/RailEnterprise.Server or set RE_SERVER_PATH.
Servizi,,Services
Servono almeno due fermate,,At least two stops are needed
Soddisfazione,,Satisfaction
@@ -314,7 +314,7 @@ Veicoli,,Vehicles
Velocità,,Speed
Vendi,,Sell
Verde,,Green
Via Ferrea,,Via Ferrea
Rail Enterprise,,Rail Enterprise
a piedi,,on foot
abitanti,,inhabitants
agli azionisti; i dividendi alzano il sentiment del titolo.,,to shareholders; dividends raise the share's sentiment.
1 keys it en
282 Seleziona un treno e un deposito Select a train and a depot
283 Sentiment del mercato Market sentiment
284 Serve un deposito A depot is required
285 Server locale non trovato: compila src/ViaFerrea.Server o imposta VF_SERVER_PATH. Server locale non trovato: compila src/RailEnterprise.Server o imposta RE_SERVER_PATH. Local server not found: build src/ViaFerrea.Server or set VF_SERVER_PATH. Local server not found: build src/RailEnterprise.Server or set RE_SERVER_PATH.
286 Servizi Services
287 Servono almeno due fermate At least two stops are needed
288 Soddisfazione Satisfaction
314 Velocità Speed
315 Vendi Sell
316 Verde Green
317 Via Ferrea Rail Enterprise Via Ferrea Rail Enterprise
318 a piedi on foot
319 abitanti inhabitants
320 agli azionisti; i dividendi alzano il sentiment del titolo. to shareholders; dividends raise the share's sentiment.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 351 B

@@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources"
include_filter="data/*.json, data/schema/*.json, assets/i18n/*.csv, assets/fonts/*.ttf, assets/fonts/OFL.txt"
exclude_filter=""
export_path="export/windows/ViaFerrea.exe"
export_path="export/windows/RailEnterprise.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
@@ -21,8 +21,8 @@ custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
binary_format/architecture="x86_64"
application/product_name="Via Ferrea"
application/company_name="Via Ferrea"
application/product_name="Rail Enterprise"
application/company_name="Rail Enterprise"
application/file_description="Gestionale ferroviario dall'alto"
dotnet/include_scripts_content=false
dotnet/include_debug_symbols=false
@@ -38,7 +38,7 @@ custom_features=""
export_filter="all_resources"
include_filter="data/*.json, data/schema/*.json, assets/i18n/*.csv, assets/fonts/*.ttf, assets/fonts/OFL.txt"
exclude_filter=""
export_path="export/linux/ViaFerrea.x86_64"
export_path="export/linux/RailEnterprise.x86_64"
encrypt_pck=false
encrypt_directory=false
@@ -1,11 +1,11 @@
; File di progetto di Godot 4: client di Via Ferrea (rendering, input, interfaccia).
; File di progetto di Godot 4: client di Rail Enterprise (rendering, input, interfaccia).
; Nessuna logica di gioco: il server è autorevole (docs/GUIDA.md, sezione 14.3).
config_version=5
[application]
config/name="Via Ferrea"
config/name="Rail Enterprise"
config/description="Gestionale ferroviario dall'alto"
run/main_scene="res://scenes/Main.tscn"
config/features=PackedStringArray("4.7", "C#", "GL Compatibility")
@@ -21,7 +21,7 @@ window/stretch/aspect="expand"
[dotnet]
project/assembly_name="ViaFerrea.Client"
project/assembly_name="RailEnterprise.Client"
[internationalization]
@@ -1,15 +1,15 @@
using Godot;
using ViaFerrea.Client.Hud;
using ViaFerrea.Client.Map;
using ViaFerrea.Client.Net;
using ViaFerrea.Client.Screens;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using ViaFerrea.Core.Rail;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using RailEnterprise.Client.Hud;
using RailEnterprise.Client.Map;
using RailEnterprise.Client.Net;
using RailEnterprise.Client.Screens;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using RailEnterprise.Core.Rail;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
namespace ViaFerrea.Client.App;
namespace RailEnterprise.Client.App;
/// <summary>
/// Pilota automatico per il collaudo del client (<c>-- --autopilot cartella</c>): nella partita
@@ -1,7 +1,7 @@
using Godot;
using ViaFerrea.Core.Data;
using RailEnterprise.Core.Data;
namespace ViaFerrea.Client.App;
namespace RailEnterprise.Client.App;
/// <summary>File dati del gioco dentro il progetto Godot (res://data, copiati dalla build del client).</summary>
public sealed class GodotDataSource(string root = "res://data") : IDataSource
@@ -1,6 +1,6 @@
using Godot;
namespace ViaFerrea.Client.App;
namespace RailEnterprise.Client.App;
/// <summary>
/// Testi dell'interfaccia: la lingua sorgente è l'italiano (le chiavi sono i testi italiani),
@@ -1,6 +1,6 @@
using Godot;
namespace ViaFerrea.Client.App;
namespace RailEnterprise.Client.App;
/// <summary>Palette dell'immagine di riferimento 05: interfaccia blu-ardesia con accento ambra, mappa cartografica chiara.</summary>
public static class Palette
@@ -1,6 +1,6 @@
using Godot;
namespace ViaFerrea.Client.App;
namespace RailEnterprise.Client.App;
/// <summary>
/// Tema dell'interfaccia costruito in codice dalla palette (immagine 05): titoli in Big Shoulders
@@ -1,10 +1,10 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Map;
using ViaFerrea.Core.Map;
using ViaFerrea.Protocol.Client;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Map;
using RailEnterprise.Core.Map;
using RailEnterprise.Protocol.Client;
namespace ViaFerrea.Client.Hud;
namespace RailEnterprise.Client.Hud;
/// <summary>Minimappa: terreno ridotto, linee, città e rettangolo della vista; un clic centra la mappa.</summary>
public partial class Minimap : Control
@@ -1,9 +1,9 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Protocol.Messages;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Protocol.Messages;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Hud;
namespace RailEnterprise.Client.Hud;
/// <summary>Notiziario in basso (immagine 01): «Notizie» e gli ultimi eventi che scorrono.</summary>
public partial class Ticker : PanelContainer
@@ -1,8 +1,8 @@
using Godot;
using ViaFerrea.Client.App;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Hud;
namespace RailEnterprise.Client.Hud;
/// <summary>Strumenti e pannelli della barra sinistra (immagine 01).</summary>
public enum Tool { None, Track, Station, Signal, Depot, Trains, Lines, Maintenance, Employment, Industries, Market, Companies, Finance, Demolish }
@@ -1,9 +1,9 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Hud;
namespace RailEnterprise.Client.Hud;
/// <summary>Barra superiore (immagine 01): compagnia e livello, data, velocità, cassa, patrimonio, rating, stato del server.</summary>
public partial class TopBar : PanelContainer
@@ -1,11 +1,11 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Client.Screens;
using ViaFerrea.Core.Data;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Client.Screens;
using RailEnterprise.Core.Data;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client;
namespace RailEnterprise.Client;
/// <summary>
/// Nodo radice: tema e traduzioni, dati del gioco, passaggio tra menu, collegamento e partita;
@@ -26,7 +26,7 @@ public partial class Main : Node
string locale = (string)cfg.GetValue("ui", "locale", "it");
Localization.Load(locale);
GetWindow().Theme = UiTheme.Build();
GetWindow().Title = "Via Ferrea";
GetWindow().Title = "Rail Enterprise";
try
{
_data = GodotDataSource.LoadGameData();
@@ -42,9 +42,9 @@ public partial class Main : Node
{
// collaudo: mappa piccola e seme fisso per il server locale
_autopilot = i + 1 < args.Length ? args[i + 1] : ProjectSettings.GlobalizePath("user://autopilot");
System.Environment.SetEnvironmentVariable("VF_MAP_SIZE", "64");
System.Environment.SetEnvironmentVariable("VF_SEED", "3");
System.Environment.SetEnvironmentVariable("VF_AUTOSAVE_MIN", "0");
System.Environment.SetEnvironmentVariable("RE_MAP_SIZE", "64");
System.Environment.SetEnvironmentVariable("RE_SEED", "3");
System.Environment.SetEnvironmentVariable("RE_AUTOSAVE_MIN", "0");
StartLocal();
}
}
@@ -102,7 +102,7 @@ public partial class Main : Node
string? server = LocalServerLauncher.FindServer();
if (server is null)
{
ShowMenu(T("Server locale non trovato: compila src/ViaFerrea.Server o imposta VF_SERVER_PATH."));
ShowMenu(T("Server locale non trovato: compila src/RailEnterprise.Server o imposta RE_SERVER_PATH."));
return;
}
if (_screen is MenuScreen menu) menu.SetStatus(T("Avvio del server locale…"));
@@ -1,10 +1,10 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Core.Map;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using RailEnterprise.Client.App;
using RailEnterprise.Core.Map;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
namespace ViaFerrea.Client.Map;
namespace RailEnterprise.Client.Map;
/// <summary>
/// Entità sulla mappa (immagine 04): case con tetti in coppi sulle celle d'abitato, impronte
@@ -1,9 +1,9 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Core.Common;
using ViaFerrea.Protocol.Client;
using RailEnterprise.Client.App;
using RailEnterprise.Core.Common;
using RailEnterprise.Protocol.Client;
namespace ViaFerrea.Client.Map;
namespace RailEnterprise.Client.Map;
/// <summary>
/// Etichette a dimensione costante sullo schermo: città in Big Shoulders Display con gli abitanti,
@@ -1,7 +1,7 @@
using Godot;
using ViaFerrea.Core.Common;
using RailEnterprise.Core.Common;
namespace ViaFerrea.Client.Map;
namespace RailEnterprise.Client.Map;
/// <summary>
/// Scala dei simboli: a zoom ravvicinato binari e treni hanno le misure della guida in metri
@@ -1,7 +1,7 @@
using Godot;
using ViaFerrea.Client.Net;
using RailEnterprise.Client.Net;
namespace ViaFerrea.Client.Map;
namespace RailEnterprise.Client.Map;
/// <summary>
/// Vista della mappa: Node2D con Camera2D e i livelli (terreno, opere e binari, entità, treni,
@@ -1,9 +1,9 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Core.Map;
using ViaFerrea.Protocol.Client;
using RailEnterprise.Client.App;
using RailEnterprise.Core.Map;
using RailEnterprise.Protocol.Client;
namespace ViaFerrea.Client.Map;
namespace RailEnterprise.Client.Map;
/// <summary>
/// Terreno a chunk (immagine 01): colori per tipo di cella e fascia altimetrica, ombreggiatura
@@ -1,9 +1,9 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Core.Rail;
using ViaFerrea.Protocol.Client;
using RailEnterprise.Client.App;
using RailEnterprise.Core.Rail;
using RailEnterprise.Protocol.Client;
namespace ViaFerrea.Client.Map;
namespace RailEnterprise.Client.Map;
/// <summary>Sagome degli strumenti: tracciato in corso con l'anteprima delle opere, stazione o deposito da posare, fermate di una linea.</summary>
public partial class ToolOverlay : Node2D
@@ -1,10 +1,10 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Core.Rail;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using RailEnterprise.Client.App;
using RailEnterprise.Core.Rail;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
namespace ViaFerrea.Client.Map;
namespace RailEnterprise.Client.Map;
/// <summary>
/// Binari e opere (immagini 01 e 02): massicciata #bfb79f, traversine #5b4a39 ogni 5,3 unità,
@@ -1,12 +1,12 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Data;
using ViaFerrea.Core.Rail;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Data;
using RailEnterprise.Core.Rail;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
namespace ViaFerrea.Client.Map;
namespace RailEnterprise.Client.Map;
/// <summary>
/// Treni dall'alto (immagine 03): locomotiva scura con dettagli ambra, carri e carrozze con le
@@ -1,11 +1,11 @@
using Godot;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Data;
using ViaFerrea.Protocol;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Data;
using RailEnterprise.Protocol;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
namespace ViaFerrea.Client.Net;
namespace RailEnterprise.Client.Net;
/// <summary>
/// Sessione di gioco del client: connessione, copia locale del mondo, esiti dei comandi e
@@ -1,7 +1,7 @@
using System.Diagnostics;
using Godot;
namespace ViaFerrea.Client.Net;
namespace RailEnterprise.Client.Net;
/// <summary>
/// Partita locale: avvia il server come processo figlio con <c>--local --token</c>, legge
@@ -14,22 +14,22 @@ public sealed class LocalServerLauncher : IDisposable
public int Port { get; private set; }
public string Token { get; } = Guid.NewGuid().ToString("N");
/// <summary>Percorso del server: variabile VF_SERVER_PATH, cartella «server» accanto al gioco, build del repository.</summary>
/// <summary>Percorso del server: variabile RE_SERVER_PATH, cartella «server» accanto al gioco, build del repository.</summary>
public static string? FindServer()
{
string? env = System.Environment.GetEnvironmentVariable("VF_SERVER_PATH");
string? env = System.Environment.GetEnvironmentVariable("RE_SERVER_PATH");
if (!string.IsNullOrWhiteSpace(env) && File.Exists(env)) return env;
string exeDir = Path.GetDirectoryName(OS.GetExecutablePath()) ?? ".";
foreach (string name in new[] { "ViaFerrea.Server.exe", "ViaFerrea.Server", "ViaFerrea.Server.dll" })
foreach (string name in new[] { "RailEnterprise.Server.exe", "RailEnterprise.Server", "RailEnterprise.Server.dll" })
{
string candidate = Path.Combine(exeDir, "server", name);
if (File.Exists(candidate)) return candidate;
}
// sviluppo: il progetto Godot sta in client/ViaFerrea.Client, il server in src/
// sviluppo: il progetto Godot sta in client/RailEnterprise.Client, il server in src/
string project = ProjectSettings.GlobalizePath("res://");
foreach (string config in new[] { "Release", "Debug" })
{
string candidate = Path.GetFullPath(Path.Combine(project, "..", "..", "src", "ViaFerrea.Server", "bin", config, "net10.0", "ViaFerrea.Server.dll"));
string candidate = Path.GetFullPath(Path.Combine(project, "..", "..", "src", "RailEnterprise.Server", "bin", config, "net10.0", "RailEnterprise.Server.dll"));
if (File.Exists(candidate)) return candidate;
}
return null;
@@ -1,14 +1,14 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using ViaFerrea.Core.Economy;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using RailEnterprise.Core.Economy;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>
/// Compagnie e borsa (sezione 12, pannello a tutto schermo con palette e componenti dell'immagine
@@ -1,13 +1,13 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>
/// Registro degli impieghi (sezione 9): convenzioni proposte dalle industrie (accetta o rifiuta),
@@ -1,9 +1,9 @@
using System.Globalization;
using ViaFerrea.Core.Common;
using ViaFerrea.Protocol.Client;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Core.Common;
using RailEnterprise.Protocol.Client;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>
/// Formati numerici dell'interfaccia (immagine 05): separatore delle migliaia con il punto,
@@ -1,14 +1,14 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using ViaFerrea.Core.Economy;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using RailEnterprise.Core.Economy;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>
/// Industrie (sezione 11): elenco delle industrie della regione e pannello del proprietario
@@ -1,11 +1,11 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Common;
using ViaFerrea.Core.Rail;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Common;
using RailEnterprise.Core.Rail;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>Scheda dell'entità selezionata (treno, stazione, industria, città) come nel pannello destro dell'immagine 01.</summary>
public partial class InfoPanel : VBoxContainer
@@ -197,7 +197,7 @@ public partial class InfoPanel : VBoxContainer
}
default:
{
AddChild(UiTheme.TitleLabel(T("Via Ferrea"), 38));
AddChild(UiTheme.TitleLabel(T("Rail Enterprise"), 38));
var help = UiTheme.Text(T("Scegli uno strumento a sinistra oppure fai clic su un treno, una stazione, un'industria o una città per vederne la scheda."), 14, Palette.TextSecondary);
help.AutowrapMode = TextServer.AutowrapMode.WordSmart;
AddChild(help);
@@ -1,12 +1,12 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using ViaFerrea.Core.Rail;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using RailEnterprise.Core.Rail;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>Linee: fermate scelte con un clic sulle stazioni, nome e colore, attesa del pieno alla prima fermata.</summary>
public partial class LinesPanel : VBoxContainer
@@ -1,12 +1,12 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using ViaFerrea.Protocol.Messages;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using RailEnterprise.Protocol.Messages;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>
/// Officine (sezione 10.3): politica della flotta, avvisi, flotta ordinata per condizione con la
@@ -1,7 +1,7 @@
using Godot;
using ViaFerrea.Client.App;
using RailEnterprise.Client.App;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>Mattoni comuni dei pannelli laterali.</summary>
public static class PanelKit
@@ -1,9 +1,9 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Map;
using ViaFerrea.Core.Rail;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Map;
using RailEnterprise.Core.Rail;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>Grafico altimetrico del tracciato: terreno, quota del binario e opere colorate (pannello TrackProfile).</summary>
public partial class ProfileChart : Control
@@ -1,8 +1,8 @@
using Godot;
using ViaFerrea.Client.App;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>
/// Grafico di una serie (come ProfileChart): linea con area per i prezzi mensili delle azioni,
@@ -1,11 +1,11 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>Strumento stazione: numero di binari, nome facoltativo, costo stimato; clic sulla mappa per posarla.</summary>
public partial class StationPanel : VBoxContainer
@@ -1,11 +1,11 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Core.Data;
using ViaFerrea.Core.Rail;
using ViaFerrea.Protocol.Client;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Core.Data;
using RailEnterprise.Core.Rail;
using RailEnterprise.Protocol.Client;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>
/// Strumento binari: classe, ponti, gallerie, doppio binario, elettrificazione e quota; anteprima
@@ -1,14 +1,14 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Net;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using ViaFerrea.Core.Data;
using ViaFerrea.Core.Rail;
using ViaFerrea.Protocol.Messages;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Net;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using RailEnterprise.Core.Data;
using RailEnterprise.Core.Rail;
using RailEnterprise.Protocol.Messages;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Panels;
namespace RailEnterprise.Client.Panels;
/// <summary>
/// Treni: acquisto dei veicoli in un deposito, composizione, assegnazione alle linee, rientro.
@@ -1,11 +1,11 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Panels;
using ViaFerrea.Protocol.Client;
using ViaFerrea.Protocol.Messages;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Panels;
using RailEnterprise.Protocol.Client;
using RailEnterprise.Protocol.Messages;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Screens;
namespace RailEnterprise.Client.Screens;
/// <summary>
/// Cronaca finale (12.3), a tutto schermo sopra la partita: storia della compagnia anno per anno
@@ -1,8 +1,8 @@
using Godot;
using ViaFerrea.Client.App;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Screens;
namespace RailEnterprise.Client.Screens;
/// <summary>
/// Collegamento a un server (immagine 09 non fornita: palette e componenti dell'immagine 05).
@@ -1,18 +1,18 @@
using Godot;
using ViaFerrea.Client.App;
using ViaFerrea.Client.Hud;
using ViaFerrea.Client.Map;
using ViaFerrea.Client.Net;
using ViaFerrea.Client.Panels;
using ViaFerrea.Core.Commands;
using ViaFerrea.Core.Common;
using ViaFerrea.Core.Data;
using ViaFerrea.Core.Rail;
using ViaFerrea.Protocol;
using ViaFerrea.Protocol.Messages;
using static ViaFerrea.Client.App.Localization;
using RailEnterprise.Client.App;
using RailEnterprise.Client.Hud;
using RailEnterprise.Client.Map;
using RailEnterprise.Client.Net;
using RailEnterprise.Client.Panels;
using RailEnterprise.Core.Commands;
using RailEnterprise.Core.Common;
using RailEnterprise.Core.Data;
using RailEnterprise.Core.Rail;
using RailEnterprise.Protocol;
using RailEnterprise.Protocol.Messages;
using static RailEnterprise.Client.App.Localization;
namespace ViaFerrea.Client.Screens;
namespace RailEnterprise.Client.Screens;
/// <summary>
/// Partita: mappa con i livelli, HUD (barra superiore, strumenti, pannello destro con minimappa,
Loaded 100 of 300 files, more files were not shown because too many files have changed in this diff. Show more