From e6653199bbfd8fc3c138f14fda4a23899285207e Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Mon, 21 Sep 2026 08:16:09 +0200 Subject: [PATCH] fix(shim): make the generated DrussGT bot dir runnable by hand Running /tmp/tr_bots/DrussGT/DrussGT.sh manually failed with: BotException: Required bot property 'name' is missing. The Tank Royale Java bot API reads bot identity from BOT_* environment variables (EnvVars: BOT_NAME, BOT_VERSION, BOT_AUTHORS, BOT_DESCRIPTION, BOT_HOMEPAGE, BOT_COUNTRY_CODES, BOT_GAME_TYPES, BOT_PLATFORM, BOT_PROG_LANG, BOT_INITIAL_POS). When the TR booter launches the directory it supplies those, derived from the .json - which is why every headless battle worked - but launching the script directly supplies nothing, so the API rejects the handshake. make_botdir.sh now exports them in the generated .sh (kept in sync with the .json it writes), so the script works standalone as well as under the booter. Verified against a server started for the test: before, the exact error above; after, 'Connected to: ws://localhost:4599' and the server logs 'Bot joined: DrussGT 3.1.4159'. --- tools/robocode_shim/make_botdir.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/robocode_shim/make_botdir.sh b/tools/robocode_shim/make_botdir.sh index c0498cc..267613e 100755 --- a/tools/robocode_shim/make_botdir.sh +++ b/tools/robocode_shim/make_botdir.sh @@ -30,9 +30,26 @@ cat > "$TARGET/$NAME.json" < "$TARGET/$NAME.sh" <