# `tools/booter/` — the official Robocode Tank Royale **booter** `robocode-tankroyale-booter-0.35.5-all.jar` is the official booter from the Tank Royale project (`dev.robocode.tankroyale:robocode-tankroyale-booter`), copied here from a local build of `/home/davide/Projects/tank-royale/booter/build/libs/` so every future session has it without re-resolving or re-downloading anything. ## What it does The booter is a **process launcher and nothing more**. It scans a directory of bot entries, and for each one spawns the bot as a child JVM process. It knows nothing about Robocode, about Tank Royale physics, or about our shim — it just starts `.sh` and relays stdin commands. Every directory under `legacy_bots/` satisfies the booter's **base-name rule**: all files in the directory share the same base filename, which equals the directory name. So `legacy_bots/Dookious/` holds `Dookious.sh`, `Dookious.json` and `Dookious.jar`, and the booter resolves and runs `Dookious.sh`. For our legacy bots the `.sh` execs `robocode_shim.LegacyBotBridge`, which is what actually loads the classic jar and speaks the Tank Royale bot API. ## CLI ``` Usage: booter [] []... Options: -v, --version Show the version and exit -h, --help Show this message and exit Commands: dir List all available bot and team directories. info List info of all available bots in JSON format. boot Boot one or multiple bot or team entries into individual bot processes. ``` **The command is `boot`, not `run`.** The upstream README still documents `run`; that text is stale — `run` does not exist in 0.35.5 and exits with a usage error. ### Server URL and secret are SYSTEM PROPERTIES, not CLI arguments This is the part that trips everyone up. There is no `--server-url` flag. The booter reads them from the JVM system properties `-Dserver.url` and `-Dserver.secret`, which the booter then hands to each booted bot process in the environment (as `SERVER_URL` / `SERVER_SECRET`). Our `.sh` launchers deliberately never hardcode either value. ```sh java \ -Dserver.url=localhost:9876 \ -Dserver.secret=$TR_SERVER_SECRET \ -jar tools/booter/robocode-tankroyale-booter-0.35.5-all.jar boot legacy_bots/Dookious ``` ## Common uses List what the booter can see: ```sh java -jar tools/booter/robocode-tankroyale-booter-0.35.5-all.jar dir "$PWD/legacy_bots" ``` The same thing as machine-readable JSON (one object per bot): ```sh java -jar tools/booter/robocode-tankroyale-booter-0.35.5-all.jar info "$PWD/legacy_bots" ``` Boot bots. Paths are resolved relative to the working directory, and the booter accepts a parent directory to boot everything under it: ```sh java -jar tools/booter/robocode-tankroyale-booter-0.35.5-all.jar boot "$PWD/legacy_bots/Dookious" java -jar tools/booter/robocode-tankroyale-booter-0.35.5-all.jar boot "$PWD/legacy_bots" ``` ### Stdin commands Once booted, the booter reads commands from stdin, one per line: | Command | Effect | |---|---| | `boot {dir}` | boot another bot or team entry into its own process | | `stop {pid}` | stop the bot process with that pid | | `quit` | stop everything and exit | ``` $ java -jar tools/booter/robocode-tankroyale-booter-0.35.5-all.jar boot "$PWD/legacy_bots/Dookious" Booting: Dookious #12345 boot legacy_bots/CassiusClay #12346 stop 12345 quit ``` ## Verified against this repo Booter 0.35.5 discovers **all 28** curated bots in `legacy_bots/` — both `dir` and `info` return 28 entries. See [`legacy_bots/README.md`](../../legacy_bots/README.md) for the roster. ## Provenance Copied from a local build; no download was needed. Upstream coordinates, if you ever need to re-fetch it: - group: `dev.robocode.tankroyale` - artifact: `robocode-tankroyale-booter` - Use the `-all` (fat) jar — the plain `-0.35.5.jar` needs the rest of the distribution's libraries on the classpath and will not run standalone.