# Agrarian Dedicated Server Build Runbook

Agrarian's multiplayer server target is Linux. Windows-Builder remains the
interactive Unreal build machine, but the server artifact should run on an
Ubuntu cloud VM or other Linux host.

## Build Machine

Use Windows-Builder for the first repeatable build lane:

- Unreal Engine `5.7`
- VS 2022 Build Tools toolchain compatible with Unreal `5.7`
- Epic Linux cross-compile toolchain for Unreal `5.7`
- Project path: `P:\AgrarianGameBulid` when mapped from `\\DevBox\projects`

The server target is `AgrarianGameServer`, defined in
`Source/AgrarianGameServer.Target.cs`.

## Build Command

From an elevated or normal Command Prompt on Windows-Builder:

```bat
cd /d P:\AgrarianGameBulid
Scripts\BuildLinuxDedicatedServer-Windows.bat
```

Expected output:

- Logs: `Saved\BuildLogs\BuildLinuxDedicatedServer.log`
- Archive: `Builds\LinuxServerDevelopment`

If the script fails before compile with a Linux toolchain error, install Epic's
Unreal `5.7` Linux cross-compile toolchain on Windows-Builder, reopen the
terminal, and run the script again.

## Initial Runtime Shape

The first server package cooks the Ground Zero MVP map:

```text
/Game/Agrarian/Maps/L_GroundZeroTerrain_Test
```

First cloud/server launch target:

```bash
./AgrarianGameServer L_GroundZeroTerrain_Test?listen -log -port=7777
```

Open firewall ports only as needed:

- `7777/udp` for Unreal gameplay traffic.
- SSH from trusted admin IPs only.

Do not expose editor, SMB, RDP, database, or admin ports on the public server.

## Smoke Test

For the first MVP validation:

1. Build the Linux server package on Windows-Builder.
2. Copy the archived server package to an Ubuntu test VM.
3. Start the server with `-log -port=7777`.
4. Confirm the log reaches map load without fatal errors.
5. Connect from a packaged Windows Development client on the LAN or test VPN.
6. Record the commit, package date, map, client build, and server log path.

## Current Limits

This runbook creates the repeatable build lane. It does not yet prove a full
external multiplayer session. That remains a later roadmap item after the
project has a clean server package and a stable deploy target.
