Files
TeslaSuite/README.md
T
CydandClaude Opus 5 2a5a387381 Console: remember Enable Custom Bitmaps, ship the art; bump suite to 4.11.4.5
Settings -> Enable Custom Bitmaps was a static bool with no backing store:
it defaulted to off on every launch, so an operator had to re-tick it each
session and any custom plasma art was silently ignored until they did. New
ConsoleSettings persists machine-level menu toggles as XML in
%ProgramData%\Tesla Console\console.settings, alongside RPDefaults.rpd /
BTDefaults.btd / local.siteconfig. It is loaded once from Main and never
from a static initializer: the differential suite drives PlasmaBitmaps
directly and must keep seeing the original defaults rather than whatever
this machine has saved. A missing file is the first-run case; a corrupt one
is ignored and rewritten by the next toggle, because losing a menu setting
must never stop the console starting.

Custom art is now version-controlled and rolls with the release. New
Console\Plasma Images\ is copied into the package, and the lookup searches
%ProgramData%\Tesla Console\Plasma Images first and the exe-relative folder
second, so a release can never clobber a site's own name bitmaps.
install.bat creates the data-dir folder before the icacls grant so an
unelevated operator can write it. Ships with three 128x32 name bitmaps
(Deadmeat, Muerte, Phrogg); Muerte arrived as "Muerte_128x32-2.bmp", a name
the lookup can never build, so it is renamed to match its pilot.

Two fixes fell out of making the flag sticky. Path.Combine ran on the raw
participant name outside the try block, so with the option on a pilot named
"A:B" threw ArgumentException straight out of egg generation; names that
cannot be a Windows file name now just render procedurally. And the art was
loaded with Image.FromFile, which keeps the bitmap backed by the file and
locked for its whole lifetime — it is copied out through a stream now, so
art can be swapped between missions without restarting the console.

Verified against the built net40 exe: all three shipped bitmaps resolve by
pilot name, ProgramData wins over the shipped copy, a wrong-size file is
ignored, an illegal-character name does not throw, the file is not left
locked, and the settings round-trip and corrupt-file tolerance both hold.
Diff suite 106/106.

Version bumped 4.11.4.4 -> 4.11.4.5 across Console, Launcher, vPOD, the
install/build banners, the diff-suite version assertion and the README's
latest-release pointer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 13:16:11 -05:00

77 lines
5.1 KiB
Markdown

# TeslaSuite
The Tesla cockpit-pod software, in one repository:
| Folder | What it is | Target |
|--------|------------|--------|
| [`Console/`](Console/) | **TeslaConsole** — the operator console (WinForms) that configures and drives the pods. A decompiled reconstruction of the original `TeslaConsole.exe` (now the modernized 4.11.4.x line), with a differential test suite pinning it to the original 4.11.3.37076 baseline. | .NET Framework 4.0 |
| [`Launcher/`](Launcher/) | **TeslaLauncher** — the pod-side launcher: ONE userland tray app (RPC listener + app launcher). A clean rewrite of the original; the old Service+Agent split (a Session 0 workaround) is gone. | .NET Framework 4.0 |
| [`Contract/`](Contract/) | **Tesla.Contract** — the shared Console↔Launcher RPC contract: wire types, the client, and the framed-JSON protocol. Emits assembly `TeslaConsoleLaunchLib`. | .NET Framework 4.0 |
| [`SecureConfig/`](SecureConfig/) | **Tesla.SecureConfig** — the first-boot pod provisioning protocol (UDP beacons, OFB crypto, RSA key exchange). Emits assembly `TeslaSecureConfiguration`. | .NET Framework 4.0 |
| [`vPOD/`](vPOD/) | **vPOD** — a virtual pod for testing the consoles without cockpit hardware: impersonates both the game client (Munga, TCP 1501) and the pod's TeslaLauncher (provisioning + Site Management / Install Product on TCP 53290). | .NET Framework 4.0 |
Everything targets **net40** on purpose (the XP11 port, v4.11.4.3): it is the newest
.NET Framework that installs on Windows XP SP3, and net40 assemblies run in-place on
the 4.8 runtime that ships in Windows 10/11 — so the same binaries cover the original
XP-era cockpit PCs and modern hardware. That rules out net45+ APIs
(`System.Text.Json`, `ZipFile`, async/await, ...); JSON is Newtonsoft, zip extraction
is the launcher's own [`MiniZip.cs`](Launcher/MiniZip.cs).
The console and launcher talk over **TCP 53290** using **length-prefixed JSON
frames over an OFB-encrypted stream** ([`Contract/PodRpcProtocol.cs`](Contract/PodRpcProtocol.cs)),
dispatched by method name. The wire contract lives in one source project
([`Contract/`](Contract/)) referenced by both sides — a single source of truth, no
duplication or hand-syncing.
> **Note:** Red Planet game *control* uses a separate protocol (Munga, TCP 1501) via the
> vendored `Munga Net.dll` — not the RPC channel above. The game itself is C++ and lives
> in its own repo (`gitea.mysticmachines.com/VWE/RP411.git`).
## Building
```
dotnet build TeslaSuite.sln -c Release
dotnet test Console/tests/TeslaConsole.DiffTests # differential + protocol + crypto guards
```
**Pod deployment:** [`Launcher/build.bat`](Launcher/build.bat) publishes the
framework-dependent net40 package into `Launcher/dist/` — the launcher itself is tiny,
but the package bundles the pod redists (DirectX June 2010, OpenAL, UltraVNC, and
`dotNetFx40_Full_x86_x64.exe` for XP-era pods that don't have .NET 4.0 yet).
[`Launcher/install.bat`](Launcher/install.bat) deploys it on a cockpit PC — dual-OS
(XP SP3 and Win10/11 code paths): auto-login, Run-key registration for the single
launcher binary, firewall + box hardening. The operator console packages
the same way: [`Console/build-package.bat`](Console/build-package.bat) → `Console/dist/`,
installed with [`Console/install.bat`](Console/install.bat). vPOD packages with
[`vPOD/pack.ps1`](vPOD/pack.ps1) → `vPOD/dist/vPOD.zip`, deployable to a pod via the
console's Install Product (or run directly on any machine).
Release packages for all three are attached to the
[Gitea releases](https://gitea.mysticmachines.com/VWE/TeslaSuite/releases)
(latest: **v4.11.4.5**).
## Layout notes
- `Console/original/TeslaConsole.exe` — the **4.11.3.37076** reference baseline the
differential tests compare against. Keep it.
- `Console/lib/*.dll` — the remaining vendored binary dependencies (`Munga Net`,
`BitmapLibrary`, `WeifenLuo` docking). The original `TeslaConsoleLaunchLib.dll` and
`TeslaSecureConfiguration.dll` are also kept here, but **only as byte-compatibility test
baselines** — both are now built from source (`Contract/`, `SecureConfig/`).
- `Console/RedPlanet/Apps.xml` — the data-driven product catalog (see the console's
Site Management → Add Product / Register Product on Pods).
## History
The system was modernized in 2026: the duplicated wire contract was extracted to a single
source project, `BinaryFormatter` (an RCE sink, and what pinned the launcher to an old
runtime) was replaced with the framed-JSON protocol, and the launcher was rebuilt — briefly
on net8/x64, then on net48, then (the **XP11** port, v4.11.4.3) the whole suite settled on
**net40** so one set of binaries runs on the original Windows XP SP3 cockpit hardware and
on Windows 10/11 alike. XP11 also merged the launcher's Service+Agent pair — a workaround
for Vista+ Session 0 isolation that XP never needed — back into a single userland app, and
moved the console's `.resx` BinaryFormatter bitmaps to raw embedded images (their runtime
reader doesn't exist on net40). The whole console↔pod path (provisioning, install, launch)
is validated on real pods; the net40 build is bench-validated on Win11's 4.8 runtime (real
XP SP3 hardware still pending).