# EPM mod artifacts

Drop-in `Content/Mods/EPM/` for Empyrion. Loaded by the dedicated server's
mod loader; opens a TCP listener on `Settings.yaml.GameServerApiPort` (we
ship `0.0.0.0:7028`, panel-allocated to whatever `EAH_API_PORT` env says).

## Files

- `EmpyrionNetworkRelayMod.dll` — the mod (`ModTargets: Dedi`). Compiled
  from `EmpyrionNetworkConnectedMods/sample-empyrion-mod/Empyrion Mod/`
  with one tweak: `Configuration.cs` was rewritten to manually parse
  `Settings.yaml` (key: value lines) instead of using `YamlDotNet`. Reason:
  current Empyrion 1.16.x ships `YamlAssembly.dll` rather than the old
  `Assembly-CSharp-firstpass.dll` that bundled `YamlDotNet`, so the
  upstream binary fails with `TypeLoadException` at `Game_Start`.
- `EPMConnector.dll` — wire protocol library (TCP framing + protobuf-net
  message dispatch). Linked by both EPM and any C# client.
- `EmpyrionNetworkRelayMod_Info.yaml` — manifest. Per-DLL naming is
  required because there are two DLLs in the folder; with a single DLL,
  `Info.yaml` works, but with multiple Empyrion's loader needs each main
  DLL to have a sibling `<DllName>_Info.yaml`.
- `Settings.yaml` — host+port for the TCP listener. `0.0.0.0` is fine
  inside the container (host networking limits exposure to the container
  port; opnfwd handles WAN forwarding).

## Verified end-to-end on 2026-04-30

1. EPM loads under Wine: `Loaded Mod 'EmpyrionNetworkRelayMod': "EPM"`.
2. TCP listener opens: `Now listening on port 7028`.
3. C# probe (`/eah_probe/probe/Probe.cs`) connects via `EPMConnector.Client`
   and gets typed protobuf-net responses for `Request_Get_Factions`,
   `Request_Player_List`, `Request_Playfield_List`. Default Human
   faction came back deserialized into `Eleon.Modding.FactionInfoList`.

## How to rebuild

1. Open `C:\Users\dbledeez\AppData\Local\Temp\eah_probe\EmpyrionNetworkConnectedMods\sample-empyrion-mod\Empyrion Mod\` (or re-clone from `MichaelGoulding/EmpyrionNetworkConnectedMods`).
2. Replace `Configuration.cs` with the YAML-free version (see
   `feedback_empyrion_yaml_dotnet_drop.md` for the snippet).
3. `cd` to that folder and `csc.exe @build.rsp`. Output goes to
   `bin\Release\EmpyrionNetworkRelayMod.dll`.
4. Copy `EmpyrionNetworkRelayMod.dll` + `EPMConnector.dll` + the two yamls
   into this directory; commit.
